md2pdf converts Markdown into structured PDF files using Pandoc, LaTeX templates, and a curated Lua filter pipeline.
Runtime requirements:
- Pandoc with Lua support
- A LaTeX distribution with
pdflatex pandoc-includepandoc-crossref- Python 3 (required for
--asset-link)
Installation from this repository also requires make and the standard install utility.
Install the Python-based Pandoc include filter with pipx:
pipx install pandoc-includeCheck that the required Pandoc filters are visible on PATH:
command -v pandoc-include pandoc-crossrefInstall 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.mdRun directly from source tree:
./src/app/md2pdf.sh -- doc/exp/main.mdSee doc/exp for runnable examples, including filters, assets, tables, and source includes.
md2pdf [options] -- <input.md> [pandoc args...]Options:
-o, --output <file>: output PDF path (default:<input>.pdf)--template <name|path>: template name or explicit.texpath--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.md.
|-- .ai4X
|-- acc
| `-- obsidian
|-- doc
| `-- exp
|-- src
| |-- app
| |-- lib
| | |-- filters
| | `-- templates
| `-- tst
`-- utl
`-- completions