Skip to content

ToB213/mdtex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License


mdtex

Markdown → LaTeX → PDF live preview, powered by pandoc + latexmk

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Templates
  5. Configuration
  6. Roadmap
  7. Contributing
  8. License

About The Project

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

Built With

(back to top)

Getting Started

Prerequisites

Installation

cargo install --path .

Or run directly without installing:

cargo run -- watch

Using Nix? A flake is included — nix develop gives you pandoc, latexmk, and the Rust toolchain without any host installs.

(back to top)

Usage

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.md

Starts 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 eisvogel

With bibliography:

mdtex watch paper.md --template ieee --bib refs.bib

Japanese 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 xelatex

Build once (no watch):

mdtex build paper.md --template neurips

Use a native viewer instead of the browser:

mdtex watch paper.md --viewer skim

(back to top)

Templates

Built-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 eisvogel

(back to top)

Configuration

mdtex init

Creates 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

(back to top)

Roadmap

  • 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.

(back to top)

Contributing

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors