Universal document converter for transforming Markdown to PDF, DOCX, HTML, LaTeX, and 40+ other formats. Covers templates, filters, citations with BibTeX/CSL, and batch conversion automation scripts.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Universal document converter for transforming Markdown to PDF, DOCX, HTML, LaTeX, and 40+ other formats. Covers templates, filters, citations with BibTeX/CSL, and batch conversion automation scripts.
version
1.0.0
category
documentation
type
skill
capabilities
["Markdown to PDF conversion","Markdown to DOCX (Word) conversion","Markdown to HTML conversion","Markdown to LaTeX conversion","Custom LaTeX templates","Custom DOCX reference documents","Lua filters for content transformation","Citation processing with BibTeX/CSL","Batch conversion scripts","Cross-reference support","Table of contents generation","Syntax highlighting"]
Convert documents between 40+ formats with Pandoc. This skill covers Markdown to PDF/DOCX/HTML conversions, custom templates, citation management, and batch processing automation.
When to Use This Skill
USE When
Converting Markdown to PDF with professional formatting
Creating Word documents from Markdown sources
Need reproducible document builds from plain text
Managing academic papers with citations (BibTeX/CSL)
Batch converting multiple documents
Need custom templates for consistent branding
Converting between multiple documentation formats
Creating LaTeX documents from Markdown
Need cross-references (figures, tables, equations)
Building automated document pipelines
DON'T USE When
Building documentation websites (use MkDocs or Sphinx)
Need interactive documentation (use web frameworks)
Require real-time collaborative editing (use Google Docs)
Building slide presentations (use Marp)
Need WYSIWYG editing (use Word directly)
Converting complex nested HTML (may lose formatting)
%% references.bib
@article{smith2024,
author = {Smith, John and Doe, Jane},
title = {Advanced Documentation Techniques},
journal = {Journal of Technical Writing},
year = {2024},
volume = {15},
number = {3},
pages = {42--58},
doi = {10.1234/jtw.2024.001}
}
@book{johnson2023,
author = {Johnson, Robert},
title = {The Complete Guide to Markdown},
publisher = {Tech Press},
year = {2023},
address = {New York},
isbn = {978-0-123456-78-9}
}
@inproceedings{williams2025,
author = {Williams, Sarah},
title = {Document Automation Best Practices},
booktitle = {Proceedings of DocCon 2025},
year = {2025},
pages = {100--115},
organization = {Documentation Society}
}
@online{pandocmanual,
author = {{Pandoc Contributors}},
title = {Pandoc User's Guide},
year = {2024},
url = {https://pandoc.org/MANUAL.html},
urldate = {2024-01-15}
}
<!-- document.md with citations -->
---
title: "Research Paper"
bibliography: references.bib
csl: apa.csl
---# Literature Review
According to @smith2024, documentation is essential for
project success. This aligns with earlier findings
[@johnson2023; @williams2025].
The standard approach uses markdown formatting
[see @pandocmanual, chapter 3].
Multiple citations can be grouped together
[@smith2024; @johnson2023, pp. 15-20].
# References
::: {#refs}
:::
# Install pandoc-crossref# macOS
brew install pandoc-crossref
# Or download from releases# https://github.com/lierdakil/pandoc-crossref/releases
<!-- document.md with cross-references -->
---title: "Document with Cross-References"
---# Introduction
See @fig:architecture for the system overview.
The data flow is described in @sec:dataflow.
Results are shown in @tbl:results.
The equation @eq:formula describes the relationship.
# System Architecture {#sec:architecture}
{#fig:architecture}
# Data Flow {#sec:dataflow}
The process follows these steps...
# Results
| Metric | Value | Unit |
|--------|-------|------|
| Speed | 100 | ms |
| Memory | 256 | MB |
: Performance metrics {#tbl:results}
# Mathematical Model
The core formula is:
$$ E = mc^2 $$ {#eq:formula}
Equation @eq:formula shows Einstein's famous equation.
-- filters/word-count.lua-- Count words in documentlocal word_count = 0functionStr(el)
word_count = word_count + 1return el
endfunctionPandoc(doc)print("Word count: " .. word_count)
return doc
end
-- filters/uppercase-headers.lua-- Convert all headers to uppercasefunctionHeader(el)return pandoc.walk_block(el, {
Str = function(s)return pandoc.Str(string.upper(s.text))
end
})
end
-- filters/remove-links.lua-- Remove all hyperlinks, keeping textfunctionLink(el)return el.content
end
-- filters/custom-blocks.lua-- Convert custom div blocks to styled outputfunctionDiv(el)if el.classes:includes("warning") then-- For LaTeX outputlocal latex_begin = pandoc.RawBlock('latex',
'\\begin{tcolorbox}[colback=yellow!10,colframe=orange]')
local latex_end = pandoc.RawBlock('latex', '\\end{tcolorbox}')
table.insert(el.content, 1, latex_begin)
table.insert(el.content, latex_end)
return el.content
endif el.classes:includes("info") thenlocal latex_begin = pandoc.RawBlock('latex',
'\\begin{tcolorbox}[colback=blue!5,colframe=blue!50]')
local latex_end = pandoc.RawBlock('latex', '\\end{tcolorbox}')
table.insert(el.content, 1, latex_begin)
table.insert(el.content, latex_end)
return el.content
endend
-- filters/include-files.lua-- Include content from external filesfunctionCodeBlock(el)if el.classes:includes("include") thenlocal file = io.open(el.text, "r")
if file thenlocal content = file:read("*all")
file:close()
-- Get file extension for syntax highlightinglocal ext = el.text:match("%.(%w+)$")
local lang = ext or""return pandoc.CodeBlock(content, {class = lang})
endendend
#!/usr/bin/env python3"""
scripts/smart_convert.py
Smart document converter with configuration file support.
"""import subprocess
import sys
from pathlib import Path
import yaml
defload_config(config_path: Path) -> dict:
"""Load conversion configuration from YAML."""withopen(config_path) as f:
return yaml.safe_load(f)
defconvert_document(
input_file: Path,
output_file: Path,
config: dict) -> bool:
"""Convert a single document using pandoc."""
cmd = ['pandoc', str(input_file), '-o', str(output_file)]
# Add common optionsif config.get('toc'):
cmd.append('--toc')
if toc_depth := config.get('toc_depth'):
cmd.extend(['--toc-depth', str(toc_depth)])
if config.get('number_sections'):
cmd.append('--number-sections')
if template := config.get('template'):
cmd.extend(['--template', template])
if pdf_engine := config.get('pdf_engine'):
cmd.extend(['--pdf-engine', pdf_engine])
if highlight := config.get('highlight_style'):
cmd.extend(['--highlight-style', highlight])
if bibliography := config.get('bibliography'):
cmd.append('--citeproc')
cmd.extend(['--bibliography', bibliography])
if csl := config.get('csl'):
cmd.extend(['--csl', csl])
# Add variablesfor key, value in config.get('variables', {}).items():
cmd.extend(['-V', f'{key}={value}'])
# Add filtersfor filter_name in config.get('filters', []):
if filter_name.endswith('.lua'):
cmd.extend(['--lua-filter', filter_name])
else:
cmd.extend(['--filter', filter_name])
print(f"Running: {' '.join(cmd)}")
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
print(f"Error: {result.stderr}", file=sys.stderr)
returnFalsereturnTruedefmain():
iflen(sys.argv) < 3:
print(f"Usage: {sys.argv[0]} <input.md> <output.pdf> [config.yaml]")
sys.exit(1)
input_file = Path(sys.argv[1])
output_file = Path(sys.argv[2])
config_file = Path(sys.argv[3]) iflen(sys.argv) > 3elseNone
config = {}
if config_file and config_file.exists():
config = load_config(config_file)
success = convert_document(input_file, output_file, config)
sys.exit(0if success else1)
if __name__ == '__main__':
main()
# config/pandoc-config.yaml# Configuration for smart_convert.pytoc:truetoc_depth:3number_sections:truepdf_engine:xelatexhighlight_style:tangotemplate:templates/report.texbibliography:references/main.bibcsl:styles/ieee.cslvariables:geometry:margin=1infontsize:11ptmainfont:Georgiamonofont:FiraCodelinkcolor:bluefilters:-pandoc-crossref-filters/custom-blocks.lua
---
title: "Document Title"
author: "Author Name"
date: "2026-01-17"
abstract: |
Brief summary of the document content.
---# Introduction
Opening paragraph...
## Background
Context and background information...
# Main Content## Section One
Content...
### Subsection
More detailed content...
## Section Two
Additional content...
# Conclusion
Summary and conclusions...
# References
::: {#refs}
:::
# Appendix A: Additional Data {.appendix}
Supplementary material...
2. Image Management
<!-- Recommended image syntax -->
{width=80%}
<!-- With cross-reference -->
{#fig:arch width=100%}
See @fig:arch for the overview.
<!-- Multiple images -->
::: {#fig:comparison layout-ncol=2}
{#fig:before}
{#fig:after}
Comparison of results
:::
3. Code Block Best Practices
<!-- Named code blocks with line numbers -->
```python {.numberLines startFrom="1"}
def process_data(data: list) -> dict:
"""Process input data and return results."""
results = {}
for item in data:
results[item.id] = transform(item)
return results
```
<!-- Highlighted lines -->
```python {.numberLines hl_lines=[2,4]}
def calculate(x, y):
total = x + y # highlighted
average = total / 2
return average # highlighted
```
4. Table Formatting
<!-- Simple table -->
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Data 1 | Data 2 | Data 3 |
| Data 4 | Data 5 | Data 6 |
<!-- Table with caption and reference -->
| Metric | Value | Unit |
|--------|-------|------|
| Speed | 100 | ms |
| Memory | 256 | MB |
: Performance metrics {#tbl:perf}
See @tbl:perf for benchmarks.
<!-- Grid tables (more flexible) -->
+---------------+---------------+
| Column 1 | Column 2 |
+===============+===============+
| Multi-line | Another cell |
| content here | |
+---------------+---------------+
| More data | Final cell |
+---------------+---------------+
Troubleshooting
Common Issues
PDF Engine Not Found
# Check if xelatex is installedwhich xelatex
# Install on Ubuntusudo apt-get install texlive-xetex
# Use pdflatex instead
pandoc doc.md -o doc.pdf --pdf-engine=pdflatex
Missing LaTeX Packages
# Install specific package (TeX Live)
tlmgr install <package-name>
# Install common packagessudo apt-get install texlive-latex-extra texlive-fonts-extra
# Check which package provides a file
tlmgr search --file <filename>
Unicode Characters in PDF
# Use XeLaTeX for Unicode support
pandoc doc.md -o doc.pdf \
--pdf-engine=xelatex \
-V mainfont="DejaVu Sans"
Images Not Found
# Use resource path
pandoc doc.md -o doc.pdf \
--resource-path=.:images:assets
# Or use absolute paths in markdown
