मुख्य सामग्री पर जाएँ
Skillpedia
PDF, Word और स्लाइड7.8k · #12905

pandoc-pdf-error-resolution

यह क्या करती है

यह स्किल तब pandoc के PDF रूपांतरण की एरर सुलझाने का व्यवस्थित तरीका है, जब संदेश साफ़ न हो। यह उन लोगों के लिए है जो दस्तावेज़ PDF में बदलते हैं और unknown error देखते हैं।

कब इस्तेमाल करें

  • ✓जब PDF रूपांतरण के दौरान pandoc अज्ञात एरर लौटाए।
  • ✓जब वही दस्तावेज़ HTML या Markdown में बने, पर PDF में नहीं।
  • ✓जब मुझे पता लगाना है कि इस कंप्यूटर पर कौन सा PDF इंजन काम करता है।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pandoc-pdf-error-resolution/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“pandoc मेरे दस्तावेज़ को PDF नहीं बनाएगा और सिर्फ़ unknown error कहता है। कृपया पता लगाइए कि कौन सा PDF इंजन काम करता है और उससे PDF बनाइए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

AI pandoc का वर्ज़न जाँचता है, pdflatex, xelatex, lualatex और wkhtmltopdf खोजता है, किसी खास इंजन से रूपांतरण दोबारा आज़माता है, और एरर पढ़कर तय करता है कि क्या बदलना है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

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

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
अक्सर पूछे जाने वाले सवाल

क्या pandoc अपने-आप PDF बनाता है?

नहीं, गाइड समझाती है कि pandoc काम एक बाहरी PDF इंजन को सौंपता है।

दूसरे फ़ॉर्मैट क्यों जाँचें?

अगर दूसरे फ़ॉर्मैट काम करते हैं, तो समस्या दस्तावेज़ में नहीं, बल्कि PDF इंजन में होने की संभावना ज़्यादा है।

Unicode के लिए कौन सा इंजन बेहतर है?

गाइड xelatex को pdflatex से बेहतर Unicode और फ़ॉन्ट सपोर्ट वाला बताती है।

जानकारी

लेखक का मूल विवरण

Systematic debugging workflow for pandoc PDF conversion errors

repo: HKUDS/AgentPilot

लोकप्रियता

GitHub स्टार
7.8k
रैंकिंग में स्थान
#12905
लाइसेंस
MIT
अपडेट की गई
1/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills