Md To PDF
Mathews-Tom/armory
Convert Markdown to styled PDFs with Mermaid diagrams, LaTeX/KaTeX math, tables, and code highlighting.
Unicode-safe fallback workflow for multi-format document generation with character sanitization and explicit error capture
$ npx skills add HKUDS/OpenSpace --skill document-gen-unicode-safe -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install HKUDS/OpenSpace document-gen-unicode-safe --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/HKUDS/OpenSpace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/benchmarks/gdpval/skills/document-gen-fallback-enhanced .claude/skills/document-gen-unicode-safe && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "document-gen-unicode-safe" agent skill from https://github.com/HKUDS/OpenSpace/tree/main/benchmarks/gdpval/skills/document-gen-fallback-enhanced into .claude/skills/document-gen-unicode-safe/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "document-gen-unicode-safe", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/HKUDS/OpenSpace/tree/main/benchmarks/gdpval/skills/document-gen-fallback-enhancedType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add HKUDS/OpenSpace --skill document-gen-unicode-safe -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install HKUDS/OpenSpace document-gen-unicode-safe --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/HKUDS/OpenSpace.git skills-src && mkdir -p .agents/skills && cp -r skills-src/benchmarks/gdpval/skills/document-gen-fallback-enhanced .agents/skills/document-gen-unicode-safe && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "document-gen-unicode-safe" agent skill from https://github.com/HKUDS/OpenSpace/tree/main/benchmarks/gdpval/skills/document-gen-fallback-enhanced into .agents/skills/document-gen-unicode-safe/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "document-gen-unicode-safe", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add HKUDS/OpenSpace --skill document-gen-unicode-safe -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install HKUDS/OpenSpace document-gen-unicode-safe --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/HKUDS/OpenSpace.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/benchmarks/gdpval/skills/document-gen-fallback-enhanced .cursor/skills/document-gen-unicode-safe && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "document-gen-unicode-safe" agent skill from https://github.com/HKUDS/OpenSpace/tree/main/benchmarks/gdpval/skills/document-gen-fallback-enhanced into .cursor/skills/document-gen-unicode-safe/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "document-gen-unicode-safe", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/HKUDS/OpenSpace.git --path benchmarks/gdpval/skills/document-gen-fallback-enhanced--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add HKUDS/OpenSpace --skill document-gen-unicode-safe -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install HKUDS/OpenSpace document-gen-unicode-safe --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/HKUDS/OpenSpace.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/benchmarks/gdpval/skills/document-gen-fallback-enhanced .gemini/skills/document-gen-unicode-safe && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "document-gen-unicode-safe" agent skill from https://github.com/HKUDS/OpenSpace/tree/main/benchmarks/gdpval/skills/document-gen-fallback-enhanced into .gemini/skills/document-gen-unicode-safe/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "document-gen-unicode-safe", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install HKUDS/OpenSpace document-gen-unicode-safeInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add HKUDS/OpenSpace --skill document-gen-unicode-safe -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/HKUDS/OpenSpace.git skills-src && mkdir -p .github/skills && cp -r skills-src/benchmarks/gdpval/skills/document-gen-fallback-enhanced .github/skills/document-gen-unicode-safe && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "document-gen-unicode-safe" agent skill from https://github.com/HKUDS/OpenSpace/tree/main/benchmarks/gdpval/skills/document-gen-fallback-enhanced into .github/skills/document-gen-unicode-safe/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "document-gen-unicode-safe", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add HKUDS/OpenSpace --skill document-gen-unicode-safe -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install HKUDS/OpenSpace document-gen-unicode-safe --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/HKUDS/OpenSpace.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/benchmarks/gdpval/skills/document-gen-fallback-enhanced .opencode/skills/document-gen-unicode-safe && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "document-gen-unicode-safe" agent skill from https://github.com/HKUDS/OpenSpace/tree/main/benchmarks/gdpval/skills/document-gen-fallback-enhanced into .opencode/skills/document-gen-unicode-safe/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "document-gen-unicode-safe", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
document-gen-unicode-safeUnicode-safe fallback workflow for multi-format document generation with character sanitization and explicit error capture
Document Gen Unicode Safe is an agent skill from HKUDS/OpenSpace. Unicode-safe fallback workflow for multi-format document generation with character sanitization and explicit error capture
Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file.
It sits in Documents & Office, covering PDF and LaTeX. It works with LaTeX and Pandoc. The repository describes itself as: "OpenSpace: The Skill Management Layer for AI Agents" -- https://open-space.cloud/. The licence is MIT.
4 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 3827781. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
pandocapt-getbrewFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Document Gen Unicode Safe loads about 2.6k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 838 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from HKUDS/OpenSpace at commit 3827781, republished under its MIT licence (© HKUDS). 838 words, ~2,622 tokens.
.claude/skills/document-gen-unicode-safe/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Use this skill when shell_agent returns unknown or unclear errors on complex document generation tasks, especially when:
.docx, .pdf, .html)Instead of delegating the entire document generation to shell_agent, manually split the workflow into discrete, observable steps:
write_file to create source document (Markdown)run_shell with pandoc for each target format, capturing full stderr outputCritical: PDF generation via pandoc typically uses LaTeX (pdflatex or xelatex), which has limited Unicode support. Common problematic characters include:
| Character | Issue | Safe Replacement |
|---|---|---|
— (em dash) | May not render | -- or - |
– (en dash) | May not render | - |
" " (curly quotes) | Encoding errors | " " (straight quotes) |
' ' (curly apostrophe) | Encoding errors | ' (straight apostrophe) |
… (ellipsis) | May not render | ... |
→ ← ↑ ↓ (arrows) | LaTeX incompatibility | -> <- ^ v |
✓ ✗ (checkmarks) | May not render | [x] [ ] |
★ ● (symbols) | May not render | * - |
© ® ™ | May require packages | (c) (r) (tm) |
| Non-ASCII letters (é, ñ, ü) | Font-dependent | Use xeLaTeX or replace |
Write your document content as Markdown to a temporary source file. This gives you full visibility into the content being generated.
write_file
path: /tmp/document_source.md
content: |
# Document Title
## Section 1
Content here...
## Section 2
More content...Before PDF conversion, create a sanitized version of your markdown with LaTeX-safe characters:
write_file
path: /tmp/document_source_sanitized.md
content: |
# Document Title
## Section 1
Content here... (with all special chars replaced per table above)Alternative: Use a shell script to sanitize:
run_shell
command: sed -e 's/—/--/g' -e 's/–/-/g' -e 's/"([^"]*)"/"\1"/g' -e 's/'([^']*)/'\1'/g' /tmp/document_source.md > /tmp/document_source_sanitized.mdNote: Keep the original unsanitized file for DOCX/HTML conversion (these formats handle Unicode better).
Use run_shell with explicit pandoc commands for each format. Use sanitized source for PDF, original for other formats.
Critical: Always capture stderr output (2>&1) to diagnose failures before retrying with alternative engines.
run_shell
command: pandoc /tmp/document_source.md -o output.docxrun_shell
command: pandoc /tmp/document_source.md -o output.htmlUse xelatex as the first engine - it has better Unicode support and is commonly available in containerized environments:
run_shell
command: pandoc /tmp/document_source_sanitized.md --pdf-engine=xelatex -o output.pdf 2>&1Before retrying, examine the full stderr output from Step 3a to understand the failure cause (missing engine, font issues, etc.). Then try wkhtmltopdf as fallback:
run_shell
command: pandoc /tmp/document_source_sanitized.md --pdf-engine=wkhtmltopdf -o output.pdf 2>&1Check that files were created successfully:
run_shell
command: ls -lh output.docx output.pdf output.html# Generate Negotiation Strategy Document
## Step 1: Write Markdown source
write_file
path: /tmp/negotiation_strategy.md
content: |
# Negotiation Strategy
## Executive Summary
[Content with original unicode...]
## Resolution Path
[Content...]
## BATNA Analysis
[Content...]
## Step 2: Create sanitized version for PDF
write_file
path: /tmp/negotiation_strategy_sanitized.md
content: |
# Negotiation Strategy
## Executive Summary
[Content with unicode replaced: em-dash -> --, curly quotes -> straight, etc.]
## Resolution Path
[Content...]
## BATNA Analysis
[Content...]
## Step 3: Convert to DOCX (from original)
run_shell
command: pandoc /tmp/negotiation_strategy.md -o negotiation_strategy.docx
## Step 4: Convert to HTML (from original)
run_shell
command: pandoc /tmp/negotiation_strategy.md -o negotiation_strategy.html
## Step 5: Convert to PDF (try xelatex first, capture stderr)
run_shell
command: pandoc /tmp/negotiation_strategy_sanitized.md --pdf-engine=xelatex -o negotiation_strategy.pdf 2>&1
## Step 6: If xelatex fails, retry with wkhtmltopdf (after examining error)
run_shell
command: pandoc /tmp/negotiation_strategy_sanitized.md --pdf-engine=wkhtmltopdf -o negotiation_strategy.pdf 2>&1
## Step 7: Verify
run_shell
command: ls -lh negotiation_strategy.*| Aspect | shell_agent | Manual Workflow |
|---|---|---|
| Error visibility | Opaque, may retry silently | Each step shows explicit output |
| Recovery | Automatic but may loop | Manual intervention at specific step |
| Debugging | Hard to isolate failure point | Clear which step failed |
| Unicode control | Agent may not handle encoding | You control character sanitization |
| Control | Agent decides approach | You control each conversion |
| Stderr capture | Often lost in retries | Explicit 2>&1 capture at each step |
# Markdown to Word
pandoc input.md -o output.docx
# Markdown to PDF with xelatex (better Unicode support - TRY FIRST)
pandoc input.md -o output.pdf --pdf-engine=xelatex
# Markdown to PDF with wkhtmltopdf (fallback if xelatex unavailable)
pandoc input.md -o output.pdf --pdf-engine=wkhtmltopdf
# Markdown to HTML
pandoc input.md -o output.html
# With custom template
pandoc input.md --template=template.html -o output.html
# With metadata
pandoc input.md -o output.pdf --metadata title="Document Title"PDF generation fails with encoding error:
--pdf-engine=xelatex2>&1 and examine the error before retrying--pdf-engine=wkhtmltopdfPDF generation fails: LaTeX not found:
apt-get install texlive-latex-recommended texlive-fonts-recommended--pdf-engine=xelatex (often pre-installed in containers)--pdf-engine=wkhtmltopdf if xelatex unavailablexelatex not found: Install with apt-get install texlive-xetex or use wkhtmltopdf fallback
wkhtmltopdf not found: Install with apt-get install wkhtmltopdf
DOCX formatting issues: Add --reference-doc=template.docx for custom styles
Unicode/encoding errors in any format:
-f markdown+utf8 to pandoc commandfile -i source.mdSpecial characters not rendering in PDF:
Missing pandoc: Install via apt-get install pandoc or brew install pandoc
Engine failures not diagnosed: Always append 2>&1 to capture stderr, examine output before retrying with different engine
For repeated use, create a reusable sanitization script:
#!/bin/bash
# sanitize_for_pdf.sh - Replace problematic unicode chars for LaTeX/PDF
if [ -z "$1" ]; then
echo "Usage: $0 <input.md> [output.md]"
exit 1
fi
INPUT="$1"
OUTPUT="${2:-${1%.md}_sanitized.md}"
sed -e 's/—/--/g' \
-e 's/–/-/g' \
-e 's/"([^"]*)"/"\1"/g' \
-e 's/'([^']*)/'\1'/g' \
-e 's/…/.../g' \
-e 's/→/->/g' \
-e 's/←/<-/g' \
-e 's/✓/[x]/g' \
-e 's/✗/[ ]/g' \
-e 's/©/(c)/g' \
-e 's/®/(r)/g' \
-e 's/™/(tm)/g' \
"$INPUT" > "$OUTPUT"
echo "Sanitized: $INPUT -> $OUTPUT"Save as sanitize_for_pdf.sh, make executable with chmod +x sanitize_for_pdf.sh, then use:
run_shell
command: ./sanitize_for_pdf.sh /tmp/document_source.md /tmp/document_source_sanitized.mdAfter successfully completing the manual workflow once, you can attempt shell_agent again for similar tasks, now with a known-working fallback if errors recur. For documents with heavy Unicode content, consider always using the manual workflow with sanitization.
document-gen-fallback: Original fallback workflow without Unicode guidanceshell_agent in these scenarios:For documents with heavy Unicode content, consider always using the manual workflow with sanitization, but only after confirming the toolchain is available.
© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in benchmarks/gdpval/skills/document-gen-fallback-enhanced of HKUDS/OpenSpace.
Open the folder on GitHubat commit 3827781
Document Gen Unicode Safe next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Document Gen Unicode Safe this skillHKUDS/OpenSpace | 7.8k | — | ~2.6k | Automated safety check: Pass | MIT | |
| Md To PDFMathews-Tom/armory | 328 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Md To PDF Academicwentorai/research-plugins | 298 | 1 repos | ~1.8k | Automated safety check: Notes | MIT | |
| Harness Book Best Practicewquguru/harness-books | 3.2k | — | ~4.1k | Automated safety check: Pass | None | |
| AI Review SkillNeuroDong/Ai-Review | 626 | — | ~2.5k | Automated safety check: Pass | MIT | |
| MineruNebutra/MinerU-Skill | 122 | — | ~504 | Automated safety check: Pass | MIT |
Mathews-Tom/armory
Convert Markdown to styled PDFs with Mermaid diagrams, LaTeX/KaTeX math, tables, and code highlighting.
wentorai/research-plugins
Convert Markdown to publication-quality PDF with LaTeX math rendering
wquguru/harness-books
Best practices for working on the Harness books repo. An agent skill from wquguru/harness-books.
NeuroDong/Ai-Review
Generates structured AI paper reviews (SoT style) for LaTeX, PDF, and Word manuscripts.
Nebutra/MinerU-Skill
An AI-Native skill for parsing PDF / Office / image files into Markdown with MinerU — a fast, zero-config document parser for AI agents.
ysyecust/lecture-to-notes
把课堂视频(本地或 B 站/YouTube)、文字稿、课件三者(任意组合)整理成一份详细的中文 Markdown 课堂笔记,输出按课程标题命名的 {titlename}.md(首行为 文档标题)+ 相对路径图片。Markdown 工作流,与上游 lecture-to-notes 的 LaTeX/PDF 输出并行存在;上游 skill 完全不动。触发词:markdown 笔记、md 笔记、视频转…
HKUDS/OpenSpace
Walks through producing a master audio track plus stems in Python, from checking a reference file and timing sections by BPM to effects, a zip archive and final verification.
HKUDS/OpenSpace
Handle cascading data retrieval tool failures by falling back to embedded knowledge generation
HKUDS/OpenSpace
Gives an agent a workaround when its code-execution sandbox keeps failing: save the Python script to a file and run it through the shell instead.
HKUDS/OpenSpace
A recovery routine for agents whose sandboxed code runner keeps failing: save the Python script to disk, then run it through the shell and read the output.
HKUDS/OpenSpace
Fallback ladder for failed sandboxed code runs, plus the habit of fixing the working directory first so generated files land in the right place.
HKUDS/OpenSpace
Fallback workflow for executing Python code when executecodesandbox fails repeatedly
Categories
Unicode-safe fallback workflow for multi-format document generation with character sanitization and explicit error capture. Document Gen Unicode Safe is an agent skill from HKUDS/OpenSpace.
Document Gen Unicode Safe fits situations like: tasks that involve PDF; tasks that involve LaTeX.
Run `npx skills add HKUDS/OpenSpace --skill document-gen-unicode-safe -a claude-code`. Or copy the skill folder (benchmarks/gdpval/skills/document-gen-fallback-enhanced in HKUDS/OpenSpace) into .claude/skills/document-gen-unicode-safe in your project. Claude Code loads it when a task matches its description.
Run `npx skills add HKUDS/OpenSpace --skill document-gen-unicode-safe -a codex`. Or copy the skill folder (benchmarks/gdpval/skills/document-gen-fallback-enhanced in HKUDS/OpenSpace) into .agents/skills/document-gen-unicode-safe in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/OpenSpace --skill document-gen-unicode-safe -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/document-gen-unicode-safe, .gemini/skills/document-gen-unicode-safe, .github/skills/document-gen-unicode-safe and .opencode/skills/document-gen-unicode-safe in your project.
Going by SKILL.md and its folder, Document Gen Unicode Safe needs the command-line tools its instructions call (pandoc, apt-get and brew).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Document Gen Unicode Safe is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Document Gen Unicode Safe: Md To PDF (Mathews-Tom/armory, 328 stars), Md To PDF Academic (wentorai/research-plugins, 298 stars), Harness Book Best Practice (wquguru/harness-books, 3.2k stars) and AI Review Skill (NeuroDong/Ai-Review, 626 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
HKUDS (a GitHub organization) maintains it in HKUDS/OpenSpace, which has 7,750 GitHub stars. The repository holds 199 skills in this directory. The repository was last updated on August 12, 2026.
Source: HKUDS/OpenSpace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.