pandoc-unicode-workaround
What it does
This skill describes a workflow for converting Markdown to PDF when pandoc fails on special characters. It is for people whose documents contain checkmarks, arrows, dashes or similar symbols.
When to use it
- ✓When pandoc fails to make a PDF with a Unicode or LaTeX error.
- ✓When the error names a special character such as a checkmark, arrow or em dash.
- ✓When I need a PDF and can accept plain text versions of the symbols.
Skill link
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pandoc-unicode-workaround/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“My PDF export fails on the checkmarks and arrows in my notes. Replace them with plain text and make the PDF again.”
5 new skills a week. 1 minute to read.
How it works
The AI tries the normal conversion first. If it fails, it replaces special characters with ASCII equivalents from a table and converts again.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Pandoc Unicode Workaround
This skill provides a workflow for generating PDFs from Markdown using pandoc when LaTeX compilation fails due to Unicode character errors.
When to Use
Use this skill when:
pandoc document.md -o document.pdffails with LaTeX/Unicode errors- Error messages mention "Unicode character", "LaTeX Error", or specific characters like ✓, →, —, etc.
- You need to produce PDF output but pandoc's default LaTeX engine cannot handle special characters
Step-by-Step Procedure
Step 1: Attempt Initial PDF Generation
pandoc input.md -o output.pdf
If this succeeds, you're done. If it fails with Unicode/LaTeX errors, proceed to Step 2.
Step 2: Normalize Unicode Characters
Replace problematic Unicode characters with ASCII equivalents. Common replacements:
| Unicode Character | ASCII Replacement | Alternative |
|---|---|---|
| ✓ (checkmark) | [Y] or [X] | OK, ✓ removed |
| ✗ or ✘ (cross) | [N] | FAIL |
| → (arrow right) | -> | => |
| ← (arrow left) | <- | |
| — (em dash) | -- or - | --- |
| – (en dash) | - | |
| • (bullet) | - | * |
| © (copyright) | (c) | Copyright |
| ® (registered) | (R) | |
| ™ (trademark) | (TM) | |
| … (ellipsis) | ... | |
| " (smart quotes) | " or ' |
Step 3: Apply Replacements
Option A - Manual edit: Open the Markdown file and manually replace the characters using find/replace.
Option B - Automated with sed (Linux/Mac):
sed -i 's/✓/[Y]/g' input.md
sed -i 's/✗/[N]/g' input.md
sed -i 's/→/->/g' input.md
sed -i 's/—/--/g' input.md
Option C - Automated with Python:
replacements = {
'✓': '[Y]',
'✗': '[N]',
'→': '->',
'—': '--',
'–': '-',
'…': '...',
'"': '"',
'"': '"',
}
with open('input.md', 'r', encoding='utf-8') as f:
content = f.read()
for orig, repl in replacements.items():
content = content.replace(orig, repl)
with open('input.md', 'w', encoding='utf-8') as f:
f.write(content)
Step 4: Regenerate PDF
pandoc input.md -o output.pdf
Step 5: Verify Output
Check that the PDF was generated successfully and review the content to ensure character replacements are acceptable for your use case.
Alternative Approaches
If Unicode normalization is not acceptable:
Use a different PDF engine:
pandoc input.md -o output.pdf --pdf-engine=wkhtmltopdfUse XeLaTeX (better Unicode support):
pandoc input.md -o output.pdf --pdf-engine=xelatexAdd LaTeX packages for Unicode:
pandoc input.md -o output.pdf -H header.texWhere header.tex contains:
\usepackage{fontspec} \usepackage{xunicode}
Tips
- Keep the original Markdown file before normalization if you need to preserve characters
- Document which characters were replaced for future reference
- Test with a small sample first if working with large documents
- For Word documents (.docx), Unicode issues are less common; this pattern is primarily for PDF generation
Error Indicators
Common LaTeX Unicode errors to watch for:
- ! LaTeX Error: Unicode character ... not set up for use with LaTeX
- Package inputenc Error: Unicode character ... not set up
- ! Missing character: There is no ... in font ...
FAQ
Does it try the normal conversion first?
Yes, the guide starts with the plain pandoc command and only cleans the text if it fails.
What replaces a checkmark?
The guide suggests a plain marker such as a bracketed Y or X.
Are the replacements listed?
Yes, the guide includes a table that maps each symbol to a plain alternative.
Details
Original description by the author
Handle LaTeX Unicode errors in pandoc PDF generation by normalizing special characters to ASCII
repo: HKUDS/AgentPilot
Popularity
- GitHub stars
- 7.8k
- Ranking position
- #12907
- License
- MIT
- Updated
- 11/1/2026
Comments
- …
More skills from this repository
agentpilot
7.8kHelps your agent improve a project step by step by preparing a task and running the AgentPilot loop that proposes, tests and scores changes.
openspace
7.8kHelps your agent set up OpenSpace, a tool that stores and fetches agent skills, and connect it to your AI app through MCP.
rsi-arena
7.8kHelps your agent set up and run standard AI benchmark tests, such as AIME and Terminal-Bench, to compare different improvement methods.
experiment-guide
7.8kHelps your agent plan small experiments, read their results and record findings while it investigates how to improve a program.
Similar skills
feishu-doc
394kHelps your agent read, create, and edit Feishu cloud documents, including text, images, and tables, using the document tool.
feishu-drive
394kLets your agent browse, organize, and comment on files in a Feishu cloud folder that has been shared with the bot.
feishu-perm
394kHelps your agent check and change who can access a Feishu file, choosing the smallest permission that meets your request.