用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/HKUDS/OpenSpace --skill pandoc-pdf-error-resolution命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Incremental audio production with duration mismatch handling, adaptive stem extension, and pre-mix alignment verification
Audio production with diagnostic analysis, timecode parsing from documents, and verified export workflow
Incremental audio production with duration alignment handling, per-stem verification, and adaptive extension strategies
基于 SOC 职业分类
| name | pandoc-pdf-error-resolution |
| description | Systematic debugging workflow for pandoc PDF conversion errors |
This skill provides a step-by-step workflow for diagnosing and resolving "unknown error" messages when using pandoc to generate PDFs.
Use this skill when:
First, confirm pandoc is installed and check its version:
pandoc --version
This confirms pandoc is available and shows the version number. Note that pandoc itself doesn't generate PDFs directly—it delegates to external PDF engines.
Identify which PDF engines are installed on the system:
which pdflatex xelatex lualatex wkhtmltopdf pdfroff 2>/dev/null || echo "Checking individual engines..."
which pdflatex
which xelatex
which lualatex
which wkhtmltopdf
Common engines and their characteristics:
Retry the conversion with an explicit --pdf-engine flag:
pandoc input.md -o output.pdf --pdf-engine=xelatex
Try engines in this order:
xelatex (best Unicode support)pdflatex (most widely available)lualatex (if xelatex fails)wkhtmltopdf (for HTML-heavy content)Always capture the complete error output before falling back:
pandoc input.md -o output.pdf --pdf-engine=xelatex 2>&1 | tee pandoc_error.log
This preserves the full error message for analysis. Common error patterns:
tlmgr install <package>)If errors indicate missing LaTeX packages:
# For TeX Live
tlmgr install <package-name>
# For Debian/Ubuntu
apt-get install texlive-latex-extra texlive-fonts-recommended
# For macOS with Homebrew
brew install --cask mactex
If all engines fail, consider:
#!/bin/bash
# pandoc-pdf-debug.sh
INPUT_FILE="$1"
OUTPUT_FILE="${INPUT_FILE%.md}.pdf"
echo "=== Pandoc PDF Conversion Debug ==="
echo "Input: $INPUT_FILE"
echo "Output: $OUTPUT_FILE"
# Step 1: Verify pandoc
echo -e "\n[1] Checking pandoc version..."
pandoc --version | head -1
# Step 2: Check engines
echo -e "\n[2] Checking available PDF engines..."
for engine in pdflatex xelatex lualatex wkhtmltopdf; do
if which "$engine" &>/dev/null; then
echo " ✓ $engine: $(which $engine)"
else
echo " ✗ $engine: not found"
fi
done
# Step 3: Try conversion with xelatex
echo -e "\n[3] Attempting conversion with xelatex..."
pandoc "$INPUT_FILE" -o "$OUTPUT_FILE" --pdf-engine=xelatex 2>&1 | tee /tmp/pandoc_error.log
if [ $? -eq 0 ]; then
echo
pandoc -o --pdf-engine=pdflatex 2>&1
| Command | Purpose |
|---|---|
pandoc --version | Verify pandoc installation |
which xelatex | Check if xelatex engine exists |
pandoc file.md -o file.pdf --pdf-engine=xelatex | Convert with explicit engine |
... 2>&1 | tee error.log | Capture full stderr output |
tlmgr install <pkg> | Install missing LaTeX package |