본문으로 건너뛰기
Skillpedia
PDF, Word, 슬라이드7.8k · #12903

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pandoc-pdf-error-diagnosis/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Markdown으로 PDF를 만들려는데 pandoc이 알 수 없는 오류(unknown error)라고만 합니다. 무엇이 잘못됐는지 찾아서 고쳐 주세요.”

매주 새 스킬 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:

  1. Remove complex tables or math
  2. Replace custom fonts with standard fonts
  3. Split large documents into sections
  4. 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 엔진에 맡긴다고 설명합니다.

먼저 어떤 엔진을 시도하라고 하나요?

가이드는 유니코드와 글꼴 처리를 잘하므로 xelatex를 먼저 시도하라고 제안합니다.

오류 출력을 로그로 저장하는 이유는 무엇인가요?

로그에 전체 메시지가 남아, 화면에 짧은 오류만 보여도 실제 원인을 찾을 수 있습니다.

상세 정보

작성자의 원본 설명

Systematic diagnostic workflow for resolving pandoc PDF conversion errors

repo: HKUDS/AgentPilot

인기도

GitHub 스타
7.8k
순위
#12903
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬