본문으로 건너뛰기
cccskills
무료GitHub에 공개

pandoc-pdf-error-resolution

Diagnose PDF conversion failures in pandoc by checking installed conversion engines, capturing full error logs, and investigating missing fonts or packages. Follow a structured sequence of retries and fallback methods to find a working conversion route.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Systematic debugging workflow for pandoc PDF conversion errors

설치 방법 보기

이럴 때 유용합니다

  • Investigate an unknown error during PDF conversion
  • Check which PDF engines are installed
  • Find missing fonts or LaTeX packages
  • Explore another conversion route when PDF output fails

포함된 파일(2)

  • SKILL.md4.1 KB
  • .skill_id41 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Pandoc PDF Error Resolution

This skill provides a step-by-step workflow for diagnosing and resolving "unknown error" messages when using pandoc to generate PDFs.

When to Use

Use this skill when:

  • Pandoc returns an "unknown error" during PDF conversion
  • The conversion succeeds for other formats (e.g., markdown, HTML) but fails for PDF
  • You need to identify which PDF engine is available and working

Step-by-Step Procedure

Step 1: Verify Pandoc Installation

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.

Step 2: Check Available 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:

  • pdflatex: Fast, widely available, good for basic documents
  • xelatex: Better Unicode/font support, recommended for complex documents
  • lualatex: Advanced typography, Lua scripting support
  • wkhtmltopdf: HTML-to-PDF conversion, good for web-style documents

Step 3: Attempt Conversion with Explicit Engine

Retry the conversion with an explicit --pdf-engine flag:

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

Try engines in this order:

  1. xelatex (best Unicode support)
  2. pdflatex (most widely available)
  3. lualatex (if xelatex fails)
  4. wkhtmltopdf (for HTML-heavy content)

Step 4: Capture Full stderr Output

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:

  • Font errors: Missing LaTeX packages or fonts
  • Package errors: Missing LaTeX packages (use tlmgr install <package>)
  • Syntax errors: Issues in the source document

Step 5: Install Missing Dependencies (if needed)

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

Step 6: Fallback Strategies

If all engines fail, consider:

  1. Convert to HTML first, then use wkhtmltopdf
  2. Simplify the document (remove complex formatting)
  3. Use an online conversion service
  4. Generate PDF from a different format (e.g., DOCX via LibreOffice)

Example Complete Workflow

#!/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 "✓ Conversion successful!"
else
    echo "✗ Conversion failed. Check /tmp/pandoc_error.log for details"
    echo "Attempting fallback with pdflatex..."
    pandoc "$INPUT_FILE" -o "$OUTPUT_FILE" --pdf-engine=pdflatex 2>&1
fi

Quick Reference

CommandPurpose
pandoc --versionVerify pandoc installation
which xelatexCheck if xelatex engine exists
pandoc file.md -o file.pdf --pdf-engine=xelatexConvert with explicit engine
... 2>&1 | tee error.logCapture full stderr output
tlmgr install <pkg>Install missing LaTeX package

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Prepare audio stems, the separate parts of a track, for mixing by matching their durations with silence, loops, or crossfades. Verify each generated and processed file before moving to the next production step.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Match audio parts with different durations
  • Extend drums and melodic parts using suitable methods
  • Check audio specifications before mixing
HKUDS/OpenSpace7.8천2026년 8월 13일 업데이트

Produce audio in separate stems, meaning individual instrument tracks, and verify each output as you go. Align track lengths with silence, loops, or crossfades, then apply effects, mix a master, and package the files.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Align instrument tracks to a reference audio file
  • Choose how to extend tracks that are too short
  • Verify audio properties after generation and effects
HKUDS/OpenSpace7.8천2026년 8월 13일 업데이트

Build serverless endpoints that relay external API requests for a dashboard while keeping API keys on the server. Includes Vercel examples for input checks, caching, cross-origin access, and consistent JSON responses.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Connect a dashboard to external APIs without exposing API keys
  • Create endpoints for stock quotes and news
  • Standardize API responses and error handling
HKUDS/OpenSpace7.8천2026년 8월 13일 업데이트

Produce a master track and separate audio parts through a structured Python workflow. Apply filters and reverb, export WAV files with consistent settings, package them in a ZIP archive, and check that the deliverables meet the requested specifications.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Export a master track with separate audio parts
  • Apply filters and reverb to audio
  • Check duration and format across deliverables
HKUDS/OpenSpace7.8천2026년 8월 13일 업데이트

Keep document creation moving when web searches and page retrieval repeatedly fail. The skill preserves the original task, uses the model’s existing knowledge, and clearly identifies information that could not be checked against external sources.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Continue drafting after repeated web retrieval failures
  • Preserve task requirements during network errors
  • Mark information that could not be externally verified
HKUDS/OpenSpace7.8천2026년 8월 13일 업데이트

When Python execution repeatedly fails in execute_code_sandbox, use a file-based alternative: save the script, run it through the shell, and capture results or errors. The guidance covers paths, imports, timeouts, structured output, and optional cleanup.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Retry Python work through the shell after repeated sandbox failures
  • Run longer tasks with an adjusted timeout
  • Execute Python work that needs multiple files or system utilities
HKUDS/OpenSpace7.8천2026년 8월 13일 업데이트

HKUDS의 스킬 모두 보기

이 스킬의 문제 신고