Writing Math with a LaTeX Equation Editor: Syntax, Live Preview, and Export
A practical guide to LaTeX equation syntax — fractions, subscripts, sums, and matrices — plus how live preview and SVG/PNG/MathML export fit academic notes and papers.
Writing Math with a LaTeX Equation Editor: Syntax, Live Preview, and Export
The first time I typed \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} and watched the quadratic formula appear stacked and centered, something clicked. Word's equation editor had me hunting through ribbons and clicking little fraction templates for a decade. LaTeX let me describe the math as text and have it rendered correctly every time. The catch was always the feedback loop: write a .tex file, compile, fix the typo, compile again. A browser-based LaTeX equation editor closes that loop — you type on the left and the rendered math updates on the right, no compile step.
This guide covers the syntax you actually need, why live preview changes how you write, and how export gets a formula out of the editor and into a Word doc, a slide, or a Markdown note.
The four syntax patterns that cover most math
LaTeX math notation looks intimidating until you notice that almost everything is one of four patterns.
Fractions and roots. A fraction is \frac{numerator}{denominator}. A square root is \sqrt{x}, and a cube root is \sqrt[3]{x}. Nest them freely: \frac{1}{\sqrt{2\pi}} is the front of a normal distribution.
Subscripts and superscripts. Underscore for down, caret for up. x^2 is x squared, a_i is a-sub-i. When the exponent is more than one character, wrap it in braces: e^{i\pi} not e^i\pi. This single rule trips up beginners more than any other — 2^10 renders as 2¹0, while 2^{10} renders as 2¹⁰.
Sums, products, integrals. These big operators take bounds with the same sub/superscript syntax: \sum_{n=1}^{\infty}, \prod_{k=1}^{n}, \int_0^1. In display mode the bounds sit above and below the operator; inline, they tuck to the side to keep line height sane.
Matrices and environments. A matrix lives inside \begin{...}\end{...}. Use pmatrix for round brackets, bmatrix for square, vmatrix for a determinant's vertical bars. Rows are separated by \\ and columns by &:
\begin{pmatrix} a & b \\ c & d \end{pmatrix}
That renders as a 2×2 matrix with parentheses. Swap pmatrix for vmatrix and you have a determinant. For piecewise functions, cases does the same job with a single left brace. If you want a fuller cheat sheet of commands and symbols, the math formula reference lays them out by category.
A worked example: the Gaussian integral
Here is one formula start to finish. The Gaussian integral — the area under the bell curve — is a classic because it stacks several patterns at once. The LaTeX source:
\int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}
Reading it left to right: \int_{-\infty}^{\infty} is the integral with negative-to-positive-infinity bounds, e^{-x^2} is e raised to negative x squared (note the braces around the whole exponent), \, dx adds a thin space before the differential, and = \sqrt{\pi} is the result. Rendered, you get the integral sign with infinity bounds, a clean exponential integrand, and the square root of pi on the right — exactly what you'd see in a textbook. Type that into the editor and it appears the moment you finish the closing brace, no compile, no PDF viewer.
Why live preview matters more than it sounds
I write notation faster with live preview than on paper, and the reason is the error loop. A misplaced brace in a traditional .tex workflow surfaces as a cryptic compiler error a full edit-compile cycle later. With live rendering, an unbalanced \frac{a}{b shows the problem inline the instant you type it — the editor reports the line number and the renderer's complaint verbatim instead of guessing.
This is also where the choice of rendering engine matters. There are three serious options. KaTeX is the fastest to paint and is what most blog renderers ship, but it covers a narrower slice of LaTeX — no cases, weaker matrix support, no chemistry. MathJax 3 covers the full spectrum that physics grad students and researchers actually write, and it can emit clean SVG. MathJax 2 is the older, slower predecessor most projects have moved off. The Toolora editor uses MathJax 3 loaded async from the jsdelivr CDN, so the editor surface is interactive immediately while the heavier renderer arrives in the background. The trade is a beat of startup time for the wider syntax coverage and the export pipeline.
Getting the formula out: export formats
Writing the math is half the job; the other half is landing it where you need it.
- SVG lifts the rendered MathJax DOM node with its viewBox intact, so the math scales losslessly in Figma, Keynote, or a browser zoom. Vector in, vector out.
- PNG at 2x retina, transparent or white background, for portals and docs that want a flat image.
- Markdown wraps the source in
$...$or$$...$$for Notion, Obsidian, GitLab, Hugo, and Jupyter — anywhere that renders math from LaTeX source. - MathML is the one to use for Word, Pages, and LibreOffice. Those apps don't read LaTeX as a paste source; they read MathML, and they drop it in as a native equation object you can still double-click and edit.
The common mistake here is pasting LaTeX into Word and getting raw \frac{a}{b} back. Word never spoke LaTeX — reach for MathML when the target is an office suite, and LaTeX when the target is a Markdown-flavored tool.
Fitting it into academic and note-taking work
For a problem set, build a matrix or a piecewise function from a preset, export PNG, and drop it into Gradescope or a Google Doc. For a paper draft in Word, export MathML so the equation stays editable for a co-author. For a Hugo or Astro blog post, export Markdown and let the site's own KaTeX render it. For lecture notes in Obsidian, the $$...$$ Markdown export pastes straight into a math block.
The editor pairs naturally with computation tools too. When you've derived a result and want to check it, the matrix calculator handles the arithmetic the determinant notation only describes, and the step-by-step integral calculator and derivative calculator work the calculus you're typesetting. Write the notation cleanly, verify the numbers separately, and your notes stay both correct and presentable.
LaTeX rewards a small vocabulary: fractions, sub/superscripts, big operators, and environments cover the overwhelming majority of what you'll ever typeset. Add live preview so mistakes surface immediately, and export so the result travels, and the gap between thinking a formula and shipping it closes to almost nothing.
Made by Toolora · Updated 2026-06-13