Problem set 3 — solutions
Q1. Show that the geometric series converges for .
Starting from the partial sum and taking the limit gives
Q2. The Gaussian integral is , which follows from squaring and switching to polar coordinates.
— 1 —
Inline $…$ and display $$…$$ math typeset at KaTeX quality and printed as vector glyphs with embedded fonts. No TeX install. Preview free.
Problem set 3 — solutions
Q1. Show that the geometric series converges for .
Starting from the partial sum and taking the limit gives
Q2. The Gaussian integral is , which follows from squaring and switching to polar coordinates.
— 1 —
Use $…$ inline and $$…$$ for display equations. \(…\), \[…\] and ```math fences are accepted too.
Equations render as you type. Switch to Times New Roman if you want the classic paper look; math uses a matching serif face.
Math is written as vector glyphs with fonts embedded, so it prints sharp and stays selectable.
The obvious way to get LaTeX into a PDF is to run LaTeX. That means installing TeX Live or MiKTeX, which is two to four gigabytes, and it means your Markdown has to survive a Pandoc conversion into a .tex file where a stray underscore or a table with merged cells can stop the build. Most people who write $E=mc^2$ in a Markdown note do not want a TeX toolchain. They want the equation to look right on paper.
MDtoDOCX takes the route that KaTeX and MathJax pioneered for the web and applies it to print. Each math span is parsed into a layout tree, laid out with the same TeX spacing rules (thin spaces around relations, thick spaces around binary operators, correct sub- and superscript shifts) and emitted as positioned glyphs. When the page is printed to PDF, those glyphs become vector outlines. The result is indistinguishable from LaTeX output for the command set that Markdown authors actually use, and it needs no installation at all.
The full KaTeX function list: fractions and binomials, roots, sums, products, integrals with limits, \lim, Greek and Hebrew letters, blackboard bold and calligraphic alphabets, \left and \right delimiters that stretch, \text{} for words inside math, accents, arrows, and the matrix, pmatrix, bmatrix, cases, aligned and array environments. Macros defined with \newcommand at the top of the document are expanded. Unsupported commands are shown in a highlighted monospace span with the offending token, never dropped, so you can see exactly what to change.
Math typesetting depends on a font with the right glyphs and the right metrics. MDtoDOCX embeds a Latin Modern-derived math font in every PDF that contains equations, and subsets it to the glyphs used, so a problem set with fifty equations adds about 60 KB. Because the font travels with the file, the integral signs, the stretched brackets and the script letters look the same in Preview on a Mac, in Adobe Reader on Windows, and on the department's laser printer. This is the difference between a PDF you can hand in and one that arrives with tofu boxes.
A display equation is a block that must not be split. Each $$…$$ block is kept whole; if it does not fit at the bottom of a page it moves to the next one together with the sentence that introduces it, so you never see "gives" at the foot of page 3 and the formula alone at the head of page 4. Multi-line aligned environments are treated as a single block. Optional equation numbers sit flush right, the way amsmath places them, and are counted per document.
Because equations are vector outlines and not bitmaps, they are sharp at any zoom and at any printer resolution. The text inside remains selectable: you can copy an equation out of the PDF and paste it into another document as Unicode. Body text and math share a baseline grid, so an inline fraction does not push its line apart; MDtoDOCX uses the same \frac shrink rules as TeX for inline mode and switches to full-size layout only in display mode.
Typesetting runs in your browser and the preview is free. Downloading a PDF with rendered LaTeX is a Pro feature; free downloads keep the LaTeX source in a monospace span so nothing is lost. The same LaTeX becomes native Word equations in Markdown to Word with LaTeX. For symbols, matrices and spacing details see Markdown to PDF with math, and for plans see Pricing.
| What matters | MDtoDOCX | Pandoc → pdflatex | Print a MathJax page |
|---|---|---|---|
| Install size | 0 | 2–4 GB TeX distribution | 0 |
| Time to first PDF | Seconds | Minutes to hours on first setup | Seconds |
| Math quality | KaTeX-class, TeX spacing | Reference | Depends on browser |
| Math fonts embedded | Yes, subsetted | Yes | Often substituted |
| Display equation kept on one page | Yes | Yes | No |
| Tables, task lists, fenced code | Native | Fragile in .tex | Native |
| Error on unknown command | Shown inline, PDF still produced | Build stops | Red text |
$…$ and display $$…$$ LaTeX is typeset with TeX spacing rules and printed as vector glyphs. The supported command set matches KaTeX, which covers fractions, roots, sums, integrals, matrices, cases, aligned environments and Greek letters.\tag{…} for a custom label.$$…$$ block at the top of the document and they are expanded throughout.