Markdown to PDF with LaTeX Support ✨
Convert your markdown documents to PDF with full LaTeX math support, syntax highlighting, and Mermaid diagrams. Click the Download as PDF button in the preview toolbar to export.
LaTeX Math — Renders Perfectly in PDF
Inline Math
Einstein's mass-energy equivalence: and the Pythagorean theorem .
Display Equations
The quadratic formula:
Euler's identity — the most beautiful equation in mathematics:
The fundamental theorem of calculus:
Complex Equations
Maxwell's equations in differential form:
Matrix multiplication:
Greek Letters & Symbols
Code — Syntax Highlighted in PDF
def newton_raphson(f, df, x0, tol=1e-9, max_iter=100):"""Find root of f(x) = 0 using Newton-Raphson method.Convergence rate: quadratic (O(x^2))"""x = x0for i in range(max_iter):fx = f(x)if abs(fx) < tol:return x, ix = x - fx / df(x)raise ValueError(f"Did not converge after {max_iter} iterations")# Example: solve x^2 - 2 = 0 => x = sqrt(2)import mathroot, iters = newton_raphson(lambda x: x**2 - 2,lambda x: 2*x,x0=1.5)print(f"√2 ≈ {root:.10f} (converged in {iters} iterations)")
// Fibonacci with memoizationconst fib = (() => {const memo = new Map([[0, 0], [1, 1]]);return function(n) {if (memo.has(n)) return memo.get(n);const result = fib(n - 1) + fib(n - 2);memo.set(n, result);return result;};})();console.log(Array.from({ length: 10 }, (_, i) => fib(i)));// [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
Tables — Clean Formatting in PDF
| Algorithm | Time | Space | Best For |
|---|---|---|---|
| Binary Search | Sorted arrays | ||
| Quick Sort | General purpose | ||
| Merge Sort | Stable sorting | ||
| Bubble Sort | Small datasets | ||
| Hash Table | avg | Key-value lookup |
Mermaid Diagrams
Document Features
Text Formatting
Bold text for important concepts, italic for emphasis, strikethrough for corrections.
Blockquotes render with a distinctive left border in the PDF, making them ideal for highlighting key quotes or important notes in academic papers.
Task Lists
- LaTeX math equations ✓
- Syntax highlighted code ✓
- Mermaid diagrams ✓
- Tables ✓
- Blockquotes ✓
- Your custom content — start writing above!
How to Export to PDF
- Write your markdown with LaTeX equations in the editor (left panel)
- Preview the rendered output in real-time (right panel)
- Click the blue Download as PDF button (↓ icon) in the preview toolbar
- Choose "Save as PDF" in your browser's print dialog
- Select paper size (A4 recommended) and margins
💡 Tip for best results: In the print dialog, enable "Background graphics" to preserve code block colors and table shading. Select "More settings" → check "Background graphics".
Page Breaks
Insert a manual page break anywhere in your document using a raw HTML div:
<div class="page-break"></div>
Note: A horizontal rule --- is a visual divider — it does not force a new page. Use the div above for page breaks.
🛠️ More tools: Markdown to Word (.docx) · LaTeX Equation Editor · Markdown to LaTeX · LaTeX to Markdown · All Markdown Tools · Markdown Editor
Markdown to PDF — FAQ
How do I convert Markdown to PDF with LaTeX equations?
Write your markdown with LaTeX math using $...$ for inline equations and $$...$$ for display equations. The preview renders them in real time using KaTeX. Click the Download as PDF button (↓ icon) in the preview toolbar to open your browser's print dialog, then choose "Save as PDF".
Is this markdown to PDF converter free?
Yes, completely free. No sign-up, no file upload, no watermarks. The conversion runs entirely in your browser using KaTeX for math rendering and your browser's built-in print-to-PDF functionality.
Does the PDF include LaTeX math equations?
Yes. LaTeX equations are rendered by KaTeX before PDF generation, so they appear as proper typeset mathematics in the output. Both inline math ($...$) and display math ($$...$$) are fully supported.
How do I get code syntax highlighting in the PDF?
Code blocks are syntax highlighted using Prism.js. To preserve the colors in your PDF, enable "Background graphics" in your browser's print dialog (usually under "More settings").
Can I include Mermaid diagrams in the PDF?
Yes. Mermaid diagrams (flowcharts, sequence diagrams, class diagrams, etc.) are rendered as SVG before PDF export, so they appear crisp and clean at any scale.
What paper size does the PDF use?
A4 by default, with Letter and A5 available, and narrow, normal or wide margins. Choose them under the preview, together with page numbers and an optional table of contents. Your choices are remembered in your browser. Page numbers appear in Chromium-based browsers (Chrome, Edge); other browsers may ignore them.
What is the typeset PDF option?
The Download PDF (typeset) button creates a professionally typeset PDF instead of using your browser's print dialog: proper fonts, justified text, native equations, real page numbers in every browser, and a choice of article, report or resume layout. It is created in your browser, so your files stay private. If it is unavailable, the standard print-to-PDF export still works.