| Crates.io | md2pdf-rs |
| lib.rs | md2pdf-rs |
| version | 0.1.0 |
| created_at | 2026-01-22 00:21:13.824479+00 |
| updated_at | 2026-01-22 00:21:13.824479+00 |
| description | A CLI tool to convert Markdown to PDF using Typst |
| homepage | |
| repository | https://github.com/cipherchabon/md2pdf |
| max_upload_size | |
| id | 2060495 |
| size | 125,732 |
A CLI tool to convert Markdown to PDF using Typst as the rendering backend.
cargo install --path .
# Basic usage - creates input.pdf
md2pdf input.md
# Specify output file
md2pdf input.md -o output.pdf
# Use a different theme
md2pdf input.md --theme github
# Change paper size
md2pdf input.md --paper letter
# Verbose output
md2pdf input.md -v
Usage: md2pdf [OPTIONS] <INPUT>
Arguments:
<INPUT> Input Markdown file
Options:
-o, --output <OUTPUT> Output PDF file (defaults to input filename with .pdf extension)
--paper <PAPER> Paper size (a4, letter, legal) [default: a4]
--theme <THEME> Theme to use (default, github, academic, minimal) [default: default]
-v, --verbose Enable verbose output
-h, --help Print help
-V, --version Print version
Inline code and code blocks with syntax highlighting$E = m c^2$Add YAML frontmatter to customize the document header:
---
title: My Document
author: John Doe
date: 2025-01-21
---
# Content starts here...
| Theme | Description |
|---|---|
default |
Clean, readable style with justified text |
github |
GitHub-flavored markdown style |
academic |
Formal style with numbered headings |
minimal |
Simple, distraction-free design |
Math uses Typst syntax (not LaTeX). Key differences:
Inline: $E = m c^2$ (note: spaces between variables)
Block: $$ sum_(i=1)^n x_i $$ (use sum_() not \sum_{})
See the Typst math documentation for full syntax.
MIT