frinfo702 / markdown-and-latex.md

frinfo702 · Last active

Markdown and LaTeX

Everything fundamental renders out of the box — including typeset math. This note is the living cheatsheet.

Text

Bold, italic, strikethrough, and inline code. A link too. Use a hard break by ending a line with two spaces, or just let paragraphs flow.

Lists

  1. Ordered item
  2. Second item
    • Nested bullet
    • Another
  3. Done

And task lists:

  • Render markdown
  • Render LaTeX
  • Add a note about the thing

Blockquote

Stay curious. The notes you keep today are the memory you’ll want tomorrow.

— someone who writes things down

Code

Inline const x = 1;. Fenced with a language tag:

// A tiny debounce
function debounce(fn, ms = 200) {
let t;
return (...args) => {
clearTimeout(t);
t = setTimeout(() => fn(...args), ms);
};
}
def fib(n):
a, b = 0, 1
for _ in range(n):
a, b = b, a + b
return a

Table

SymbolMeaningExample
codex + 1
boldstrong emphasishi
{ }a set{1, 2, 3}

LaTeX

Inline math: the quadratic formula x=−b±b2−4ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}, and the golden ratio φ=1+52\varphi = \frac{1 + \sqrt{5}}{2}.

Display math:

∫−∞∞e−x2 dx=π\int_{-\infty}^{\infty} e^{-x^2}\, dx = \sqrt{\pi}

And a matrix:

A=(abcd),det⁡(A)=ad−bcA = \begin{pmatrix} a & b \\ c & d \end{pmatrix}, \qquad \det(A) = ad - bc

Footnote

LaTeX is handled by KaTeX at build time.1

Footnotes

  1. There’s no JavaScript math engine needed on the client — it’s all server-rendered HTML. ↩