Markdown → LaTeX → PDF live preview, powered by pandoc + latexmk
Report Bug
·
Request Feature
Table of Contents
Markdown change
↓ mdtex watches for changes
pandoc → paper.tex
↓
latexmk → paper.pdf
↓
Browser auto-reloads via SSE
mdtex watches your Markdown source, rebuilds through pandoc and latexmk on every save, and reloads the PDF in your browser automatically — no manual compiling, no viewer plugin required.
Why mdtex?
- Write in Markdown, publish in LaTeX-quality PDF
- Live preview in any browser — no software to install
- Built-in templates for IEEE, Eisvogel, NeurIPS (downloaded on first use)
- Structured error output from pandoc and LaTeX
- Reproducible environment via Nix flake
cargo install --path .Or run directly without installing:
cargo run -- watchUsing Nix? A flake is included — nix develop gives you pandoc, latexmk, and the Rust toolchain without any host installs.
Create a new file with frontmatter pre-filled:
mdtex new paper.md
mdtex new paper.md --template eisvogel --author "Jane Doe"Watch a file and open browser preview:
mdtex watch paper.mdStarts a local server at http://localhost:8080 and opens it automatically. The PDF reloads in the browser on every save.
With a template:
mdtex watch paper.md --template eisvogelWith bibliography:
mdtex watch paper.md --template ieee --bib refs.bibJapanese output:
# uplatex (traditional, no template required)
mdtex watch paper.md --engine uplatex
# lualatex with Eisvogel (add CJKmainfont to frontmatter)
mdtex watch paper.md --template eisvogel --engine lualatex
# xelatex with IEEE (add CJKmainfont to frontmatter)
mdtex watch paper.md --template ieee --engine xelatexBuild once (no watch):
mdtex build paper.md --template neuripsUse a native viewer instead of the browser:
mdtex watch paper.md --viewer skimBuilt-in templates are downloaded on first use and cached locally.
| Template | Engine | Notes |
|---|---|---|
eisvogel |
pdflatex | Report / thesis style |
eisvogel |
lualatex | Japanese support (CJKmainfont) |
ieee |
pdflatex | IEEE conference format |
ieee |
xelatex | Japanese support (CJKmainfont) |
neurips |
pdflatex | NeurIPS paper format |
| (none) | uplatex | Japanese-native engine |
See examples/ for sample Markdown files and rendered PDFs for each combination.
# List all available templates
mdtex templates list
# Show the cached file path for a template
mdtex templates which eisvogel
# Add your own template
mdtex templates add mythesis ./my-thesis.latex
# Remove a cached template
mdtex templates remove eisvogelmdtex initCreates mdtex.toml in the current directory. Command-line flags take precedence over the config file.
[build]
entry = "main.md"
# template = "eisvogel" # ieee | neurips | eisvogel | path/to/custom.latex
# engine = "pdflatex" # pdflatex | lualatex | xelatex | uplatex
# bib = "refs.bib"
out_dir = ".mdtex-build"
extra_pandoc_args = []
extra_latexmk_args = []
[watch]
extensions = ["md", "bib", "tex", "sty", "cls", "png", "jpg", "pdf"]
debounce_ms = 300
[viewer]
program = "web" # web | skim | auto- SyncTeX support (click PDF → jump to source line)
- Multi-file projects (
\include{}) - Lua filter pass-through
- crates.io release
See the open issues for a full list of proposed features and known issues.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.