md-render-pdf
v0.1.0
Published
Render Markdown with KaTeX math to PDF, HTML, or a long PNG using system Chrome.
Maintainers
Readme
md-render-pdf
Tiny CLI for rendering Markdown with KaTeX math to PDF, HTML, or a long PNG.
Install
npm install -g md-render-pdfOr install from a GitHub release tarball:
npm install -g https://github.com/sparkjokerben/md-render-pdf/releases/download/v0.1.0/md-render-pdf-0.1.0.tgzInstall from this folder while developing:
npm install
npm linkUsage
md-render-pdf input.md -o output.pdf --html output.html
md-render-pdf input.md --png output.pngBy default it writes a PDF next to the input file.
You can also use it without global install:
npx md-render-pdf input.md -o output.pdfChrome
The tool uses an installed Chrome/Chromium. On macOS it tries:
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome/Applications/Chromium.app/Contents/MacOS/Chromium/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge
Override it with:
md-render-pdf input.md --chrome "/path/to/chrome"Fonts
The default Chinese font stack is Apple-ish:
-apple-system, BlinkMacSystemFont, "Hiragino Sans GB", "STHeiti", "Heiti SC", "PingFang SC", "Helvetica Neue", Arial, sans-serifOverride it:
md-render-pdf input.md --font '"PingFang SC", "Hiragino Sans GB", sans-serif'Math
Supported math delimiters:
- Display:
$$ ... $$ - Inline:
\\( ... \\)
