Langsung ke konten
Skillpedia
PDF, Word & slide7.8k · #12904

pandoc-pdf-error-recovery

Fungsinya

Skill ini adalah rencana pemulihan langkah demi langkah untuk konversi PDF pandoc yang gagal dengan pesan yang samar. Skill ini cocok untuk orang yang membutuhkan PDF dari dokumen dan tidak bisa membuat pandoc menyelesaikan prosesnya.

Kapan dipakai

  • ✓Saat pandoc gagal membuat PDF dan memberikan pesan yang samar.
  • ✓Saat pandoc belum terpasang atau tidak bisa ditemukan di komputer.
  • ✓Saat saya ingin PDF dibuat dengan mesin tertentu seperti xelatex.

Link skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pandoc-pdf-error-recovery/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pandoc-pdf-error-recovery/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Konversi PDF pandoc saya gagal dengan galat yang samar. Jelaskan langkah pemulihannya dan berikan saya PDF yang berfungsi.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

AI memastikan pandoc terpasang, menemukan mesin PDF yang ada, mencoba ulang dengan xelatex sambil mencatat seluruh keluaran, lalu menggunakan log untuk memutuskan perbaikan berikutnya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum

Bagaimana pandoc bisa dipasang?

Panduan ini mencantumkan perintah instalasi untuk macOS dengan brew, untuk Linux dengan apt atau yum, dan tautan unduhan untuk Windows.

Mesin PDF apa saja yang tercantum?

Panduan ini mencantumkan pdflatex, xelatex, lualatex, wkhtmltopdf, dan ConTeXt.

Untuk apa file log membantu?

File log menyimpan keluaran lengkap sehingga langkah yang gagal bisa diidentifikasi.

Detail

Deskripsi asli dari pembuat

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

repo: HKUDS/AgentPilot

Popularitas

Bintang GitHub
7.8k
Peringkat
#12904
Lisensi
MIT
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa