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

pandoc-pdf-error-recovery

하는 일

이 스킬은 불분명한 메시지로 실패하는 pandoc PDF 변환을 위한 단계별 복구 계획입니다. 문서에서 PDF를 얻어야 하는데 pandoc이 완료하지 못하는 사람에게 맞습니다.

사용하는 경우

  • ✓pandoc이 PDF 변환에 실패하고 모호한 메시지를 줄 때.
  • ✓pandoc이 설치되지 않았거나 컴퓨터에서 찾을 수 없을 때.
  • ✓xelatex 같은 특정 엔진으로 PDF를 만들고 싶은 경우.

스킬 링크

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

AI에게 요청하는 예시

“pandoc PDF 변환이 모호한 오류로 실패합니다. 복구 단계를 차례로 진행해서 작동하는 PDF를 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 pandoc이 설치되었는지 확인하고, 있는 PDF 엔진을 찾고, 모든 출력을 기록하면서 xelatex로 다시 시도하며, 그 로그를 보고 다음 수정을 정합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Pandoc PDF Error Recovery

Overview

When pandoc fails to convert documents to PDF with an "unknown error" or similar vague message, follow this systematic diagnostic and recovery workflow.

Step-by-Step Procedure

1. Verify Pandoc Installation

First confirm pandoc is installed and accessible:

pandoc --version

If this fails, install pandoc before proceeding:

2. Check Available PDF Engines

Identify which PDF rendering engines are available on the system:

which pdflatex xelatex lualatex wkhtmltopdf context

Common engines and their typical use cases:

  • pdflatex: Standard LaTeX, fast but limited Unicode support
  • xelatex: Full Unicode support, recommended for most modern documents
  • lualatex: Lua scripting support, good for complex layouts
  • wkhtmltopdf: HTML/CSS rendering, good for web-style documents
  • context: ConTeXt typesetting system

3. Attempt Conversion with Explicit Engine

Try conversion with xelatex first (most versatile for general documents):

pandoc input.md -o output.pdf --pdf-engine=xelatex 2>&1 | tee conversion.log

The 2>&1 | tee pattern captures both stdout and stderr to a log file for analysis.

4. Analyze Error Output

If conversion fails, examine the captured log:

cat conversion.log

Common error patterns and solutions:

  • Missing LaTeX packages: Install with tlmgr install <package> or system package manager
  • Font issues: Specify fonts with -V mainfont="Font Name"
  • Missing engine: Fall back to available engine (go to Step 5)

5. Try Alternative Engines

Systematically try other available engines:

# Fallback to pdflatex
pandoc input.md -o output.pdf --pdf-engine=pdflatex 2>&1 | tee conversion-pdflatex.log

# Or try wkhtmltopdf for HTML-rich content
pandoc input.md -o output.pdf --pdf-engine=wkhtmltopdf 2>&1 | tee conversion-wkhtmltopdf.log

# Or try lualatex for complex documents
pandoc input.md -o output.pdf --pdf-engine=lualatex 2>&1 | tee conversion-lualatex.log

6. Install Missing Dependencies

If all engines fail or are missing, install required packages:

# Full TeX Live installation (comprehensive but large)
sudo apt-get install texlive-full

# Or minimal installation with common packages
sudo apt-get install texlive-latex-base texlive-fonts-recommended

# For xelatex font support
sudo apt-get install fonts-noto fonts-dejavu

7. Simplify and Retry

If errors persist, try conversion with minimal options:

pandoc input.md -o output.pdf --pdf-engine=xelatex --standalone

Remove complex formatting, custom headers, or advanced LaTeX features that may be causing issues.

Quick Reference Command

Complete diagnostic one-liner:

pandoc --version && which pdflatex xelatex wkhtmltopdf && pandoc input.md -o output.pdf --pdf-engine=xelatex -v

Tips

  • Always capture stderr (2>&1) to see the actual error message
  • Use -v (verbose) flag for more detailed output during troubleshooting
  • For non-English documents, xelatex or lualatex are usually required
  • HTML/CSS-heavy documents may work better with wkhtmltopdf
  • Check system disk space - PDF generation can require significant temporary space
자주 묻는 질문

pandoc은 어떻게 설치하나요?

가이드는 macOS용 brew, Linux용 apt 또는 yum 설치 명령과, Windows용 다운로드 링크를 나열합니다.

어떤 PDF 엔진이 나열되나요?

가이드는 pdflatex, xelatex, lualatex, wkhtmltopdf, ConTeXt를 나열합니다.

로그 파일은 무엇에 도움이 되나요?

전체 출력을 보관해서 실패한 단계를 찾을 수 있게 합니다.

상세 정보

작성자의 원본 설명

Systematic approach to diagnose and recover from pandoc PDF conversion unknown errors

repo: HKUDS/AgentPilot

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬