KaTeX Math

Write mathematical equations using LaTeX syntax. Papersmith renders math via KaTeX — no installation or plugins required.

Pro feature. KaTeX math rendering is available on the Pro plan. Free users will see raw $...$ syntax in the preview. Upgrade to Pro to render equations.
ℹ️
Math is powered by KaTeX with the markdown-it-texmath plugin. If a formula contains an error, it renders in red with a description rather than breaking the document.

Inline vs. Display Math#

Use dollar sign delimiters to write math. Single dollars for inline math (flows within text), double dollars for display math (centered on its own line).

LaTeXRendered
$x^2 + y^2 = r^2$x2+y2=r2x^2 + y^2 = r^2Inline — flows within the paragraph
$$\int_0^\infty e^{-x}\,dx = 1$$0exdx=1\int_0^\infty e^{-x}\,dx = 1Display — centered on its own line
$E = mc^2$E=mc2E = mc^2
$$\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}$$n=11n2=π26\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}Display mode — ideal for important equations
💡
Use display mode ($$...$$) for equations you want to stand out. Use inline mode ($...$) for variables and short expressions within a sentence.

Greek Letters#

All standard Greek letters are supported. Use a backslash followed by the letter name.

\alphaα\alpha
\betaβ\beta
\gammaγ\gamma
\deltaδ\delta
\epsilonϵ\epsilon
\zetaζ\zeta
\etaη\eta
\thetaθ\theta
\iotaι\iota
\kappaκ\kappa
\lambdaλ\lambda
\muμ\mu
\nuν\nu
\xiξ\xi
\piπ\pi
\rhoρ\rho
\sigmaσ\sigma
\tauτ\tau
\upsilonυ\upsilon
\phiϕ\phi
\chiχ\chi
\psiψ\psi
\omegaω\omega
\GammaΓ\Gamma
\DeltaΔ\Delta
\ThetaΘ\Theta
\LambdaΛ\Lambda
\XiΞ\Xi
\PiΠ\Pi
\SigmaΣ\Sigma
\UpsilonΥ\Upsilon
\PhiΦ\Phi
\PsiΨ\Psi
\OmegaΩ\Omega
\varepsilonε\varepsilon
\varphiφ\varphi
\varthetaϑ\vartheta
\varpiϖ\varpi
\varrhoϱ\varrho
\varsigmaς\varsigma

Operators#

Binary operators for arithmetic, algebra, and set operations.

+++
--
\times×\times
\div÷\div
\pm±\pm
\mp\mp
\cdot\cdot
\ast\ast
\circ\circ
\bullet\bullet
\oplus\oplus
\otimes\otimes
\odot\odot
\cup\cup
\cap\cap
\setminus\setminus
\wedge\wedge
\vee\vee

Relations & Arrows#

===
\neq\neq
\lt<\lt
\gt>\gt
\leq\leq
\geq\geq
\ll\ll
\gg\gg
\approx\approx
\sim\sim
\simeq\simeq
\equiv\equiv
\cong\cong
\propto\propto
\parallel\parallel
\perp\perp
\subset\subset
\supset\supset
\subseteq\subseteq
\supseteq\supseteq
\in\in
\notin\notin
\to\to
\leftarrow\leftarrow
\leftrightarrow\leftrightarrow
\Rightarrow\Rightarrow
\Leftarrow\Leftarrow
\Leftrightarrow\Leftrightarrow
\uparrow\uparrow
\downarrow\downarrow
\updownarrow\updownarrow
\mapsto\mapsto
\nearrow\nearrow
\searrow\searrow

Fractions & Roots#

LaTeXRendered
\frac{a}{b}ab\frac{a}{b}Standard fraction — scales with context
\dfrac{a}{b}ab\dfrac{a}{b}Display-style fraction — always full size
\tfrac{a}{b}ab\tfrac{a}{b}Text-style fraction — always compact
\cfrac{a}{b}ab\cfrac{a}{b}Continued fraction style
\binom{n}{k}(nk)\binom{n}{k}Binomial coefficient "n choose k"
\sqrt{x}x\sqrt{x}Square root
\sqrt[3]{x}x3\sqrt[3]{x}Nth root (cube root shown)
💡
Use \dfrac inside inline math ($...$) when you want a full-size fraction that doesn't shrink. Use \tfrac inside display math to keep a fraction compact.

Sums, Integrals & Limits#

Limits, subscripts, and superscripts on large operators are placed below/above in display mode and inline in text mode.

LaTeXRendered
\sum_{i=0}^{n} ii=0ni\sum_{i=0}^{n} i
\prod_{i=1}^{n} ii=1ni\prod_{i=1}^{n} i
\int_a^b f(x)\,dxabf(x)dx\int_a^b f(x)\,dx
\iint_D f\,dADfdA\iint_D f\,dA
\oint_C F\,dsCFds\oint_C F\,ds
\lim_{x \to 0} f(x)limx0f(x)\lim_{x \to 0} f(x)
\max_{x \in S} f(x)maxxSf(x)\max_{x \in S} f(x)
\inf_{n} a_ninfnan\inf_{n} a_n

Logic & Set Theory#

\forall\forall
\exists\exists
\nexists\nexists
\in\in
\notin\notin
\subset\subset
\supset\supset
\cup\cup
\cap\cap
\emptyset\emptyset
\varnothing\varnothing
\neg¬\neg
\wedge\wedge
\vee\vee
\oplus\oplus
\Rightarrow\Rightarrow
\Leftrightarrow\Leftrightarrow
\top\top
\bot\bot
\vdash\vdash
\models\models
\complement\complement

Brackets & Delimiters#

Use \left and \right to make brackets automatically resize to match the height of their contents.

LaTeXRendered
\left( \frac{a}{b} \right)(ab)\left( \frac{a}{b} \right)Auto-sizing parentheses
\left[ \frac{a}{b} \right][ab]\left[ \frac{a}{b} \right]Auto-sizing square brackets
\left\{ \frac{a}{b} \right\}{ab}\left\{ \frac{a}{b} \right\}Auto-sizing curly braces
\langle x, y \ranglex,y\langle x, y \rangleAngle brackets
\lfloor x \rfloorx\lfloor x \rfloorFloor function
\lceil x \rceilx\lceil x \rceilCeiling function
\left| x \right|x\left| x \right|Absolute value
\left\| \vec{v} \right\|v\left\| \vec{v} \right\|Norm

Accents & Decorators#

LaTeXRendered
\hat{x}x^\hat{x}Hat / caret
\bar{x}xˉ\bar{x}Bar (mean)
\vec{x}x\vec{x}Vector arrow
\tilde{x}x~\tilde{x}Tilde
\dot{x}x˙\dot{x}Single dot (derivative)
\ddot{x}x¨\ddot{x}Double dot (2nd derivative)
\acute{x}xˊ\acute{x}Acute accent
\grave{x}xˋ\grave{x}Grave accent
\breve{x}x˘\breve{x}Breve
\check{x}xˇ\check{x}Check / háček
\widehat{xy}xy^\widehat{xy}Wide hat (spans multiple chars)
\overline{AB}AB\overline{AB}Overline
\underline{AB}AB\underline{AB}Underline
\overbrace{a+b+c}^{n}a+b+cn\overbrace{a+b+c}^{n}Overbrace with label
\underbrace{a+b}_{\text{sum}}a+bsum\underbrace{a+b}_{\text{sum}}Underbrace with label

Matrices & Arrays#

Matrix environments must be used inside math delimiters. The columns are separated by & and rows by \\.

LaTeXRendered
\begin{pmatrix} a & b \\ c & d \end{pmatrix}(abcd)\begin{pmatrix} a & b \\ c & d \end{pmatrix}pmatrix — round parentheses
\begin{bmatrix} a & b \\ c & d \end{bmatrix}[abcd]\begin{bmatrix} a & b \\ c & d \end{bmatrix}bmatrix — square brackets
\begin{vmatrix} a & b \\ c & d \end{vmatrix}abcd\begin{vmatrix} a & b \\ c & d \end{vmatrix}vmatrix — vertical bars (determinant)
\begin{cases} x+y & \text{if } x > 0 \\ x-y & \text{otherwise} \end{cases}{x+yif x>0xyotherwise\begin{cases} x+y & \text{if } x > 0 \\ x-y & \text{otherwise} \end{cases}cases — piecewise function

Use these as the content inside $$...$$ delimiters for best results. For example:

$$
\begin{pmatrix}
  a_{11} & a_{12} & a_{13} \\
  a_{21} & a_{22} & a_{23} \\
  a_{31} & a_{32} & a_{33}
\end{pmatrix}
$$

Text & Font Styles#

LaTeXRendered
\text{plain text}plain text\text{plain text}Roman text inside math (use for labels)
\mathbb{R}R\mathbb{R}Blackboard bold — number sets (ℝ, ℂ, ℤ, ℕ, ℚ)
\mathcal{L}L\mathcal{L}Calligraphic — Lagrangian, transforms
\mathbf{x}x\mathbf{x}Bold (vectors and matrices)
\mathit{x}x\mathit{x}Italic (default for variables)
\mathrm{d}d\mathrm{d}Roman (upright) — use for differential d
\mathsf{A}A\mathsf{A}Sans-serif
\mathtt{A}A\mathtt{A}Typewriter / monospace
\boldsymbol{\alpha}α\boldsymbol{\alpha}Bold Greek letters
💡
Use \mathbb{R} for the set of real numbers, \mathbb{Z} for integers, \mathbb{C} for complex numbers, and \mathbb{N} for natural numbers.

Multi-line Equations#

Use the aligned or align environment to typeset equations that span multiple lines, aligned on the = sign.

aligned environment#

Use aligned inside $$...$$. Align columns with & and break lines with \\.

$$
\begin{aligned}
  f(x) &= x^2 + 2x + 1 \\
       &= (x + 1)^2
\end{aligned}
$$
f(x)=x2+2x+1=(x+1)2\begin{aligned} f(x) &= x^2 + 2x + 1 \\ &= (x + 1)^2 \end{aligned}

Piecewise functions#

$$
f(x) = \begin{cases}
  x^2   & \text{if } x \geq 0 \\
  -x^2  & \text{if } x < 0
\end{cases}
$$
f(x)={x2if x0x2if x<0f(x) = \begin{cases} x^2 & \text{if } x \geq 0 \\ -x^2 & \text{if } x < 0 \end{cases}

Spacing in equations#

Control horizontal spacing between elements using these spacing commands:

LaTeXRendered
a\,baba\,bThin space (3/18 em)
a\;ba  ba\;bThick space (5/18 em)
a\quad baba\quad b1 em space
a\qquad baba\qquad b2 em space
a\!ba ⁣ba\!bNegative thin space (tighten)

PDF Export Notes#

KaTeX renders to HTML/CSS (not images or SVG), so math renders with the same quality in the exported PDF as in the live preview.

  • Errors render gracefully — invalid KaTeX shows in red with a description rather than crashing the export.
  • Fonts are embedded — the KaTeX fonts are included in the PDF, so math looks correct on any device.
  • Large matrices at narrow page widths — a wide matrix in a document with small margins may overflow. Use the smallmatrix environment or increase margins in the toolbar.
  • Display math near page breaks — a large display equation that falls near the bottom of a page may be split. Add <!-- pagebreak --> on its own line before it to force it onto the next page (Pro feature).