MDPress

LaTeX in Markdown

Markdown with math to PDF, typeset with KaTeX

You write notes in Markdown and formulas in LaTeX, and you do not want to set up a TeX installation for a two page handout. MDPress typesets TeX between dollar signs with KaTeX, in the live preview and in the PDF, next to your ordinary headings, lists, tables and code.

Open the converter

Convert Markdown with math to PDF in three steps.

  1. 01

    Write or paste your notes

    Put inline formulas between single dollar signs, with no space just inside them. Put display formulas between two lines that contain only a double dollar sign. Everything else is regular Markdown.

  2. 02

    Read the formulas in the preview

    The preview typesets each formula as you type. A command KaTeX does not know is marked in the formula instead of stopping the whole document, so you can find the typo and correct it on the spot.

  3. 03

    Choose a page and download

    Pick a style, a page size and margins. A5 makes a handy formula sheet, A4 and US Letter suit homework and reports. The PDF uses the same KaTeX rendering you saw in the preview.

Inline and block formulas, ready to convert.

This sample uses a fraction, a sum, an aligned derivation and a matrix.

# Statistics notes

For a sample $x_1, \dots, x_n$ the mean is $\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i$.

## Variance

$$
s^2 = \frac{1}{n-1} \sum_{i=1}^{n} (x_i - \bar{x})^2
$$

$$
\begin{aligned}
(a + b)^2 &= (a + b)(a + b) \\
          &= a^2 + 2ab + b^2
\end{aligned}
$$

## Rotation matrix

$$
R(\theta) = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}
$$

Statistics notes

For a sample x1,…,xnx_1, \dots, x_n the mean is xˉ=1n∑i=1nxi\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i.

Variance

s2=1n−1∑i=1n(xi−xˉ)2s^2 = \frac{1}{n-1} \sum_{i=1}^{n} (x_i - \bar{x})^2 (a+b)2=(a+b)(a+b)=a2+2ab+b2\begin{aligned} (a + b)^2 &= (a + b)(a + b) \\ &= a^2 + 2ab + b^2 \end{aligned}

Rotation matrix

R(θ)=(cos⁡θ−sin⁡θsin⁡θcos⁡θ)R(\theta) = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}

Why typeset Markdown math here.

Inline and display math

Single dollar signs set a formula inside the sentence at text size. A double dollar block sets it centred on its own line. Fractions, sums, integrals, Greek letters, subscripts and roots all work, as do aligned derivations and matrix environments that KaTeX supports.

No TeX installation

There is no compiler to install, no packages to fetch and no log file to read. The formulas are rendered by KaTeX in your browser for the preview and again on the server for the PDF, and the two match.

Math beside code and tables

Lab reports and lecture notes mix formulas with result tables, code listings and diagrams. They all live in one Markdown file here: highlighted code blocks, tables that wrap, Mermaid diagrams and KaTeX formulas on the same page, in the same type.

Tips for formulas that render.

  • The opening and closing $$ of a display formula must each sit alone on a line. A formula written as $$ E = mc^2 $$ on one line is not picked up as a block.
  • An inline formula cannot start or end with a space, and the closing dollar sign cannot be followed by a digit. That rule keeps prices such as $5 and $10 in ordinary text from turning into math.
  • KaTeX covers most of LaTeX math mode but not full LaTeX. Document commands, custom packages, TikZ pictures and the backslash bracket markers \( and \[ are not read, so convert those to dollar signs.

Markdown math to PDF questions.

Which LaTeX syntax does MDPress support?
Anything KaTeX can typeset in math mode: fractions, sums, integrals, limits, roots, Greek letters, accents, the aligned, cases and matrix environments, and more. It is math only. Preambles, packages, figures and bibliography commands belong to a full LaTeX system and are not processed.
Why is my formula showing as plain text?
Check the dollar signs first. Inline math needs a single pair with no spaces just inside, and block math needs $$ alone on the line above and below. Formulas copied from an AI chat often use backslash brackets, which need changing to dollar signs.
Is the math in the PDF an image?
No. KaTeX sets formulas with fonts, not pictures, so they stay sharp at any zoom level and print cleanly. The rest of the document is selectable text too, and no watermark is added on any plan.

Typeset your formulas.

Paste your Markdown, watch the math render in the preview and download the PDF. No TeX setup and no account needed to start.

Open the converter