pandoc-unicode-sanitize

pandoc-unicode-sanitize is a skill for Claude Code, Codex from HKUDS/OpenSpace. It costs 21 tokens per session (796 once invoked), scanned A, original, MIT.

A preprocessing workflow that replaces non-ASCII characters with simpler text before converting Markdown to PDF with Pandoc, a document conversion tool.

In plain words
What is it for?
Use it to sanitize Markdown containing currency signs, special quotation marks, arrows, bullets, or other symbols before PDF export.
Why use it?
It helps avoid PDF conversion failures caused by characters or symbols that the chosen LaTeX engine cannot handle.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to sanitize Markdown containing currency signs, special quotation marks, arrows…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hkuds/openspace/pandoc-unicode-sanitize
About the project

OpenSpace is a skill-management layer for AI agents that stores, retrieves, evaluates, shares, and improves reusable workflows. It is intended for people using multiple coding agents who want skills to be reused and refined based on task outcomes. The catalogue provides 200 skills for use with OpenSpace and the agents it supports.

HKUDS/OpenSpace · 7,510 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add HKUDS/OpenSpace --skill pandoc-unicode-sanitize
Clone the repo
git clone --depth 1 https://github.com/HKUDS/OpenSpace

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pandoc-unicode-sanitize

README.md
[![agentmods](https://agentmods.dev/badge/skills/hkuds/openspace/pandoc-unicode-sanitize.svg)](https://agentmods.dev/skills/hkuds/openspace/pandoc-unicode-sanitize)
Your own site
<a href="https://agentmods.dev/skills/hkuds/openspace/pandoc-unicode-sanitize"><img src="https://agentmods.dev/badge/skills/hkuds/openspace/pandoc-unicode-sanitize.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 796 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.00796
Opus 5 $0.00010 $0.00398
Sonnet 5 $0.00004 $0.00159
Haiku 4.5 $0.00002 $0.00080

Measured 3d ago against content hash cf1270cc6d99, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

pandoc-unicode-sanitize scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

benchmarks/gdpval/skills/pandoc-unicode-sanitize/SKILL.md · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pandoc Unicode Sanitization for PDF Conversion

Problem

LaTeX (used by pandoc for PDF output) may fail or produce errors when encountering non-ASCII Unicode characters like currency symbols (₹, €, £), special quotes, or other Unicode characters not supported by the default LaTeX engine.

Solution

Pre-process Markdown files to replace problematic Unicode characters with ASCII equivalents before running pandoc PDF conversion.

Steps

1. Identify Problematic Characters

Common problematic characters include:

  • Currency symbols: ₹, €, £, ¥
  • Special quotes: " " ' '
  • Arrows: →, ←, ↑, ↓
  • Bullets: •, ◦
  • Other symbols: ©, ®, ™, ±, ×, ÷, —, –

2. Create a Sed Substitution Script

Create a shell script for reusable sanitization:

#!/bin/bash
# sanitize-for-pdf.sh

sed -e 's/₹/Rs/g' \
    -e 's/€/EUR/g' \
    -e 's/£/GBP/g' \
    -e 's/¥/JPY/g' \
    -e 's/"/"/g' \
    -e 's/"/"/g' \
    -e "s/'/'/g" \
    -e "s/'/'/g" \
    -e 's/→/->/g' \
    -e 's/←/<-/g' \
    -e 's/•/-/g' \
    -e 's/©/(c)/g' \
    -e 's/®/(R)/g' \
    -e 's/™/(TM)/g' \
    -e 's/±/+/ -/g' \
    -e 's/×/x/g' \
    -e 's/÷/\//g' \
    -e 's/—/--/g' \
    -e 's/–/-/g' \
    "$1"

3. Run Sanitization Before Pandoc

# Using the script
./sanitize-for-pdf.sh input.md > sanitized.md
pandoc sanitized.md -o output.pdf

# Or inline
cat input.md | sed 's/₹/Rs/g; s/€/EUR/g; s/£/GBP/g' | pandoc -o output.pdf

4. Alternative: Use iconv for Automatic Transliteration

For broader Unicode coverage:

iconv -f UTF-8 -t ASCII//TRANSLIT < input.md > sanitized.md
pandoc sanitized.md -o output.pdf

5. Alternative: Use XeLaTeX or LuaLaTeX Engine

If you want to preserve Unicode characters, use a Unicode-capable engine:

pandoc input.md -o output.pdf --pdf-engine=xelatex
# or
pandoc input.md -o output.pdf --pdf-engine=lualatex

Best Practices

  • Sanitize files before conversion rather than debugging LaTeX errors after
  • Keep a mapping of your organization's common symbols and preferred replacements
  • Test with a small sample before processing large documents
  • Consider using XeLaTeX/LuaLaTeX if Unicode preservation is required
  • Document which characters cause issues in your specific environment

Read the full file on GitHub · 100 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 100 lines · 21 tokens per session scan A cf1270cc6d99

Subscribe to this mod's changes

pandoc-unicode-sanitize is a skill published in the GitHub repository HKUDS/OpenSpace (7,510 stars, last pushed 25d ago), licensed MIT. It adds 21 tokens to every session and 796 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

sk-create-diff

Local, Git-free before/after review of an edited document (text, Markdown, HTML, DOCX, text PDF) as a self-contained HTML report.

MichelKerkmeester/skilled-agent-harness_spec-driven-loops · 37 tokens

latex-rescue

Diagnose and fix LaTeX compilation errors. Handles undefined control sequences, missing brackets, math mode violations, package conflicts, undefined references, and environment mismatches.

Calix-L/awesome-latex-skills · 37 tokens

overleaf-compile

Recompile an Overleaf project and extract its build logs, errors and warnings in a standardized format. Use when asked to compile/recompile an Overleaf paper, debug why a PDF build fails, see what's broken after pushing changes, or pull LaTeX/biber errors and warnings out of an Overleaf project. Drives an…

mrshu/agent-skills · 83 tokens

tikz

Audit and fix TikZ visual collisions in any .tex file. Use when labels overlap arrows, text sits on boxes, or arrows cross each other. Applies mathematical gap calculations and Bézier depth formulas — no eyeballing.

franklee16/academic-research-skills · 47 tokens

latex-compilation-fix

Auto-diagnose and fix common LaTeX compilation errors for the PKU thesis template including missing packages, font issues, citation undefined, overfull hboxes, and float placement. Use when xelatex fails or produces warnings.

newtontech/PKU_PhD_Latex_Templete · 53 tokens

pydicom

Use pydicom to read, inspect, write, transform, and safely preflight local DICOM datasets and pixel data. Applies to DICOM metadata, transfer syntaxes, compression plugins, frames, private elements, JSON, and bounded de-identification review.

K-Dense-AI/scientific-agent-skills · 56 tokens