---
title: "Markdown and LaTeX"
tags: ["markdown", "latex", "reference"]
published: true
---

# 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](https://example.com) 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:

- [x] Render markdown
- [x] 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:

```js
// A tiny debounce
function debounce(fn, ms = 200) {
  let t;
  return (...args) => {
    clearTimeout(t);
    t = setTimeout(() => fn(...args), ms);
  };
}
```

```python
def fib(n):
    a, b = 0, 1
    for _ in range(n):
        a, b = b, a + b
    return a
```

## Table

| Symbol | Meaning            | Example |
| ------ | ------------------ | ------- |
| `    ` | code               | `x + 1` |
| **bold** | strong emphasis | **hi**  |
| { }    | a set              | {1, 2, 3} |

## LaTeX

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

Display math:

$$\int_{-\infty}^{\infty} e^{-x^2}\, dx = \sqrt{\pi}$$

And a matrix:

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

## Footnote

LaTeX is handled by KaTeX at build time.[^1]

[^1]: There's no JavaScript math engine needed on the client — it's all server-rendered HTML.
