Render Pdf Doc logo

Render Pdf Doc

Organization
Aperivue
render-pdf-doc

Use when rendering a Markdown document (English or Korean) such as a proposal, IRB cover letter, handout or reference table to PDF via pandoc and xelatex, with auto-fitted table widths and CJK fonts. Not for manuscripts with a bibliography (/manage-refs) or Word forms.

Overview

PublisherAperivue
Repositorymedsci-skills
Skill namerender-pdf-doc
Stars
349
Forks
82
Bundled files
18
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 18 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Aperivue on GitHub. Read the source before you install it.

Installation

Install the Render Pdf Doc AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Aperivue/medsci-skills/tree/main/skills/render-pdf-doc
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Aperivue/medsci-skills.git /tmp/medsci-skills
mkdir -p .claude/skills
cp -r /tmp/medsci-skills/skills/render-pdf-doc .claude/skills/render-pdf-doc
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Render Pdf Doc in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Render Pdf Doc on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Render Pdf Doc is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Render-PDF-Doc Skill

This skill handles layout only (CJK fonts, table column widths) with raw pandoc + xelatex — no Quarto, whose tbl-colwidths has reported PDF regressions (issues 6089/9200). Not for: a manuscript with a bibliography (/manage-refs scripts/render_pandoc.sh), an institutional .docx form (/fill-protocol), the ICMJE COI form (/fill-icmje-coi), figures or PPTX (/make-figures, /present-paper).

Dependencies

Python 3 is required by the wrapper. FontTools is optional for the font-file coverage check (python3 -m pip install fonttools).

bash
# macOS
brew install pandoc
brew install --cask mactex-no-gui          # xelatex + xeCJK (~5 GB)

# Linux
sudo apt-get install pandoc texlive-xetex texlive-lang-cjk fonts-noto-cjk

# Windows (PowerShell) — run in Git Bash afterwards
winget install --id JohnMacFarlane.Pandoc
winget install --id MiKTeX.MiKTeX          # xelatex; installs missing LaTeX packages on demand
# No CJK font download needed: Malgun Gothic ships with Windows 7+ and is the default here.

Detection:

bash
bash scripts/check_deps.sh

On Windows / Git Bash, MiKTeX's bin directory (%LOCALAPPDATA%\Programs\MiKTeX\miktex\bin\x64) is often not on PATH; both check_deps.sh and render_pdf.sh probe it. If xelatex still reads [MISS], add that directory to PATH.

Workflow

Step 1 — Author markdown with frontmatter

yaml
---
title: "Paper 2 Calibration Anchor — Q&A Grid"
author: "<Author Group>"
date: "2026-05-01"
mainfont: "Apple SD Gothic Neo"        # macOS default
CJKmainfont: "Apple SD Gothic Neo"
geometry: "margin=0.85in"
fontsize: 11pt
linestretch: 1.25
colorlinks: true
---
  • Set both mainfont and CJKmainfont: without CJKmainfont, Hangul falls back to Times New Roman (broken glyphs or blanks). Use Noto Sans CJK KR on Linux/CI and Malgun Gothic on Windows; the render script auto-detects the per-OS default when the fields are absent.
  • Read every number in a table from the source CSV or analysis output. Do not retype a number from prose or carry one forward from an earlier draft — a table correct in v3 is not evidence it is correct in v4.
  • A circulation PDF carries no change history, internal version numbers (e.g. v3.2.2) or PI attribution: put them in a separate circulation file or a supplementary. Keep the received primary source (the .docx or .eml a co-author sent) unmodified as its own artifact — the PDF is a derivative, and the next round is diffed against the source. If that source was AI-drafted by a collaborator, re-derive every number, denominator and author-year in it from the underlying paper or analysis output before it reaches the PDF.

Step 2 — Infer column widths

Never split pipe-table columns equally: a column holding only short labels then gets the same width as the data columns, which cramps them. Size from content instead:

bash
python3 scripts/infer_colwidths.py input.md > input.colwidths.md

For each pipe table it computes per-column display width = max(len(header), max(len(cell))) (CJK = 2 cells, ASCII = 1) and rewrites the separator row with proportional dash counts. To set widths by hand, write the separator dashes yourself and render without --infer-colwidths.

Step 3 — Render

bash
bash scripts/render_pdf.sh -i input.colwidths.md -o output.pdf

Or one-shot:

bash
bash scripts/render_pdf.sh -i input.md -o output.pdf --infer-colwidths

Frontmatter wins over wrapper defaults, including --font / --cjk-font. Missing fields use the wrapper or OS defaults. This also applies to geometry, fontsize, linestretch and colorlinks (including false). Explicit pandoc -V / -M arguments after -- still override frontmatter; for example, -- -V fontsize=10pt. The wrapper logs font fallbacks, not the final fonts.

The standard article class honours only 10pt, 11pt and 12pt and silently ignores any other size. When the effective fontsize is anything else and no documentclass is set, the wrapper switches to KOMA-Script scrartcl (pandoc's documented route), adds classoption: fontsize=<size> when you set no classoption (KOMA reads a fractional size such as 8.5pt only that way), and logs the switch. Set documentclass yourself to override it.

Step 3.5 — Scientific-symbol + CJK glyph scan (before render)

xelatex can finish successfully with missing glyphs. render_pdf.sh counts the Missing character warnings pandoc relays: if there are any, it lists each glyph (code point, count, font) and exits 4 — the PDF is written but incomplete. It reads them from pandoc's JSON --log (yours if you pass one after --), so a pass-through --quiet does not hide them. --allow-missing-glyphs prints the same list and exits 0. Academic markdown routinely carries glyphs a default Latin font misses: transition arrows (→ ↑ ↓), math operators (− ≤ ≥ ± √ ∪ × ≈ ≠), stats Greek (κ μ σ β), bullets/marks (• ★ ✓), and CJK. Scan the source first so a silent drop is caught before it ships:

bash
python3 scripts/scan_glyph_coverage.py input.md --strict
# real cmap check when you have the font file + fonttools:
python3 scripts/scan_glyph_coverage.py input.md --font "/path/to/body.otf" --strict
# TTC/OTC collections require the zero-based face index used by the renderer:
python3 scripts/scan_glyph_coverage.py input.md --font "/path/to/body.ttc" --font-index 0 --strict --json glyphs.json

Without --font it groups the risky glyphs by class (advisory); with --font + fonttools it checks every non-ASCII character of the source that the font is asked to draw — not only the five classes, so °, µ, ², ‰, ∞ and – are covered too — and reports which are absent from one face's preferred Unicode cmap (format characters such as a BOM or zero-width joiner, and the no-break spaces and … that pandoc writes as ASCII TeX, are not looked up), never combining coverage across collection faces — choose the face (index and PostScript name are in the report) that matches the rendered font. A missing dependency, unreadable font, missing face selection or invalid index is reported as font_checked: false with a reason in font_check; an empty missing_in_font list then means unverified, not full coverage. Default mode exits 0; --strict exits 1 when risky glyphs are unverified or missing (ASCII-only input still exits 0). The scan does not verify shaping, fallback fonts, math fonts or final PDF glyphs.

If risky glyphs are present, make sure mainfont/CJKmainfont cover them — a CJK-capable font such as Apple SD Gothic Neo / Noto Sans CJK usually covers arrows and Hangul but can still miss the true-minus − U+2212 and ★. The DOCX is authoritative; the PDF is a convenience copy — never let a PDF render drop a glyph the document needs.

Step 4 — Visual verify

Open the PDF and check:

  • First-column labels stay on one line; data columns have enough width.
  • No broken Korean glyphs (a Times New Roman fallback means CJKmainfont was not applied).
  • No missing scientific symbols (arrows, −, ≤, ±, √) — the Step 3.5 scan flags candidates.
  • No change history or internal version numbers exposed.

Read references/known_pitfalls.md when a render still looks wrong (em-dash overflow, smart quotes under CJKmainfont, | inside a cell), and references/pandoc_korean_cheatsheet.md for Korean frontmatter and font patterns.

Templates

Starter markdown in templates/ (English default; a Korean variant *_ko.md ships alongside each), with slots marked <!-- TODO: -->:

  • anchor-doc.md — Q&A grid
  • proposal-cover.md — research-proposal cover page
  • briefing-handout.md — meeting brief (1-page)
  • reference-table.md — comparison-table format

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Render Pdf Doc AI skill do?

Use when rendering a Markdown document (English or Korean) such as a proposal, IRB cover letter, handout or reference table to PDF via pandoc and xelatex, with auto-fitted table widths and CJK fonts. Not for manuscripts with a bibliography (/manage-refs) or Word forms.

Why use Render Pdf Doc on TypingMind?

Because you install it once and use it with any model. Render Pdf Doc is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Render Pdf Doc in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Aperivue/medsci-skills/tree/main/skills/render-pdf-doc. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Render Pdf Doc?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Render Pdf Doc?

As many as you like. As long as a model supports skills, you can use Render Pdf Doc with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Render Pdf Doc AI skill free?

Yes. It is published on GitHub by Aperivue under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇