pandoc-pdf-error-diagnosis
できること
このスキルは、単に不明なエラーと出るpandocのPDFエラーを診断する手順です。MarkdownなどをPDFに変換していて、本当の原因を知る必要がある人向けです。
使う場面
- ✓PDFへの変換中に、pandocが不明なエラーを報告するとき。
- ✓他の形式への変換はできるが、PDFの段階だけ失敗するとき。
- ✓このパソコンにどのPDFエンジンが入っているかを知る必要があるとき。
スキルのリンク
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pandoc-pdf-error-diagnosis/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“MarkdownからPDFを作ろうとすると、pandocが不明なエラーと言います。何が悪いのか見つけて、直してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは、pandocがインストールされているかを確認し、利用可能なPDFエンジンを一覧にし、選んだエンジンで変換を試しながらエラーの出力全体を保存し、その出力を読んで原因を探します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Pandoc PDF Error Diagnosis Workflow
When pandoc reports an "unknown error" during PDF conversion, follow this systematic diagnostic workflow to identify and resolve the issue.
Step 1: Verify Pandoc Installation
First, confirm pandoc is installed and check its version:
pandoc --version
This verifies pandoc is available and shows which version and features are supported.
Step 2: Check Available PDF Engines
Identify which PDF rendering engines are installed on the system:
which pdflatex xelatex lualatex wkhtmltopdf
Common engines and their characteristics:
- pdflatex: Fast, widely available, good for simple documents
- xelatex: Better Unicode/font support, handles modern fonts well
- lualatex: Advanced Lua scripting, modern TeX features
- wkhtmltopdf: HTML-to-PDF via WebKit, good for web-styled content
Step 3: Attempt Conversion with Explicit Engine
Try conversion with an explicit engine specification, starting with xelatex (most forgiving):
pandoc input.md -o output.pdf --pdf-engine=xelatex
Important: Capture the full stderr output for diagnosis:
pandoc input.md -o output.pdf --pdf-engine=xelatex 2>&1 | tee conversion.log
Step 4: Analyze Error Output
Examine the captured stderr for common issues:
| Error Pattern | Likely Cause | Solution |
|---|---|---|
xelatex not found |
Engine not installed | Install TeX Live or try different engine |
Package xyz not found |
Missing LaTeX package | Install missing package or remove feature |
Font xyz not found |
Missing font | Install font or change document fonts |
LaTeX Error: File xyz.sty not found |
Missing style file | Install texlive-extra or simplify document |
Step 5: Fallback Strategy
If the primary engine fails, try alternatives in order:
# Try pdflatex (most basic)
pandoc input.md -o output.pdf --pdf-engine=pdflatex 2>&1
# Try lualatex (if xelatex failed)
pandoc input.md -o output.pdf --pdf-engine=lualatex 2>&1
# Try wkhtmltopdf (for HTML-heavy content)
pandoc input.md -o output.pdf --pdf-engine=wkhtmltopdf 2>&1
Step 6: Install Missing Dependencies (if possible)
If a specific engine is needed but missing:
# Debian/Ubuntu
sudo apt-get install texlive-xetex texlive-fonts-recommended
# macOS with Homebrew
brew install --cask mactex-no-gui
# Check what's available
tlmgr install <package-name>
Step 7: Simplify and Retry
If all engines fail, simplify the source document:
- Remove complex tables or math
- Replace custom fonts with standard fonts
- Split large documents into sections
- Convert to intermediate format first (e.g., HTML then PDF)
Quick Reference Diagnostic Script
#!/bin/bash
# pandoc-pdf-diagnose.sh
INPUT="${1:-input.md}"
OUTPUT="${2:-output.pdf}"
echo "=== Pandoc PDF Conversion Diagnosis ==="
echo "Input: $INPUT"
echo "Output: $OUTPUT"
echo ""
echo "1. Pandoc version:"
pandoc --version | head -1
echo ""
echo "2. Available engines:"
for engine in pdflatex xelatex lualatex wkhtmltopdf; do
if which $engine > /dev/null 2>&1; then
echo " ✓ $engine: $(which $engine)"
else
echo " ✗ $engine: not found"
fi
done
echo ""
echo "3. Attempting conversion with xelatex:"
pandoc "$INPUT" -o "$OUTPUT" --pdf-engine=xelatex 2>&1
if [ $? -eq 0 ]; then
echo "✓ Conversion successful!"
else
echo "✗ Conversion failed. Try alternative engines."
fi
When to Use This Skill
- Pandoc reports "unknown error" during PDF conversion
- PDF output is empty or corrupted
- Need to determine which PDF engine works best for a document
- Troubleshooting CI/CD pipeline document generation failures
よくある質問
pandocは自分でPDFを作りますか?
いいえ。pandocはPDFファイルを作るために、外部のPDFエンジンに作業を任せるとガイドは説明しています。
最初にどのエンジンを試すべきですか?
Unicodeとフォントをよく扱うので、まずxelatexを試すようガイドは勧めています。
エラーの出力をログに保存するのはなぜですか?
ログは完全なメッセージを保つので、画面に短いエラーしか出ていなくても本当の原因が見つかるからです。
詳細
作者による元の説明
Systematic diagnostic workflow for resolving pandoc PDF conversion errors
repo: HKUDS/AgentPilot
人気
- GitHubのスター
- 7.8k
- ランキング
- #12903
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
agentpilot
7.8kエージェントが、作業を準備し、変更案を提案してテストし、評価するAgentPilotのループを実行することで、プロジェクトを段階的に改善できるよう支援します。
openspace
7.8kエージェントが、スキルを保存し取り出すツールであるOpenSpaceをセットアップし、MCPを通じてAIアプリに接続できるよう支援します。
rsi-arena
7.8kエージェントが、AIMEやTerminal-Benchなどの標準的なAIベンチマークテストをセットアップして実行し、異なる改善方法を比較できるよう支援します。
experiment-guide
7.8kエージェントが、プログラムを改善する方法を調べる間に、小さな実験を計画し、その結果を読み、発見を記録できるよう支援します。
似ているスキル
feishu-doc
394kテキスト、画像、表を含むFeishuのクラウドドキュメントを、ドキュメントツールを使って読み、作成し、編集するようエージェントを支援します。
feishu-drive
394kボットと共有されたFeishuのクラウドフォルダ内のファイルを閲覧、整理、コメントできるようエージェントを支援します。
feishu-perm
394kFeishuのファイルにアクセスできる人を確認し、変更するようエージェントを支援します。依頼を満たす最小の権限を選びます。