md2pdf converts Markdown into structured PDF files using Pandoc, LaTeX templates, and a curated Lua filter pipeline.
Requirements:
- Pandoc with Lua support
- A LaTeX distribution with
pdflatex pandoc-crossref(optional, enabled by default)- Python 3 (required for
--asset-link)
Install from this repository:
make installUser-local install:
make PREFIX=$HOME/.local installConvert a Markdown file:
md2pdf -- note.mdSelect a template:
md2pdf --template article-modern -- note.mdDisable cross-references for a run:
md2pdf --no-crossref -- note.mdRun directly from source tree:
./src/app/md2pdf.sh -- doc/exp/main.mdmd2pdf [options] -- <input.md> [pandoc args...]Options:
-o, --output <file>: output PDF path (default:<input>.pdf)--template <name|path>: template name or explicit.texpath--no-crossref: disablepandoc-crossreffor the current run--list-templates: list available template names and exit--asset-link <dir>: create temporary asset symlink(s) in input directory--debug: print resolved paths and full Pandoc command--version: print version information
Use external assets without moving files:
md2pdf --asset-link ../shared-assets -- note.mdAvailable templates:
default: balanced default stylearticle-modern: modern single-column article stylearticle-stylish: editorial article stylearticle-stylish-2col: lean two-column article stylenote-modern: compact note-oriented stylereport-stylish: report-oriented style
List templates from CLI:
md2pdf --list-templatesSet lang in front matter to control localized labels such as the table-of-contents title.
---
lang: de-DE
---Installed completion targets:
- Bash:
/usr/local/share/bash-completion/completions/md2pdf - Zsh:
/usr/local/share/zsh/site-functions/_md2pdf - Fish:
/usr/local/share/fish/vendor_completions.d/md2pdf.fish
Run full local verification:
make verifyRun test suite only:
src/tst/run.sh.
|-- doc
| |-- exp
| `-- ops
|-- src
| |-- app
| |-- lib
| | |-- filters
| | `-- templates
| `-- tst
`-- utl
`-- completions