Markdown for this blog

A cheatsheet for me, since I will forget which underscore does what and which fence wants a language tag. Most of this is plain Markdown plus the extras from pymdown-extensions listed in blog/templatetags/markdown_extras.py.

Inline and display math

Inline with single dollars, display with doubles. Underscores inside math do not trigger italic.

$\mathfrak{sl}_2 = \operatorname{span}\{E, F, H\}$

$$[H, E] = 2E, \quad [H, F] = -2F, \quad [E, F] = H$$

Renders as \(\mathfrak{sl}_2 = \operatorname{span}\{E, F, H\}\), then

\[[H, E] = 2E, \quad [H, F] = -2F, \quad [E, F] = H\]

AMS environments live inside $$ ... $$:

$$
\begin{align}
\Delta(E) &= E \otimes 1 + K \otimes E \\
\Delta(F) &= F \otimes K^{-1} + 1 \otimes F
\end{align}
$$
\[ \begin{align} \Delta(E) &= E \otimes 1 + K \otimes E \\ \Delta(F) &= F \otimes K^{-1} + 1 \otimes F \end{align} \]

cases, pmatrix, bmatrix, array, and so on all work the same way. Equation tags are AMS-style (config in base.html).

Headings

## H2 and ### H3 for sections inside the body. The post title already occupies # H1, so do not use that level.

Lists

- one item
- another
  - sub-item by indent

1. first
2. second
  • one item
  • another
  • sub-item by indent

  • first

  • second

Code blocks

Fence with a language tag and Pygments picks it up:

```julia
function bracket(L, A)
    sum(s -> A^(a(s) - b(s)) * (-A^2 - A^-2)^(loops(s) - 1), states(L))
end
```
function bracket(L, A)
    sum(s -> A^(a(s) - b(s)) * (-A^2 - A^-2)^(loops(s) - 1), states(L))
end

Inline code with single backticks: using LinearAlgebra.

Tables

| Generator | Action                                  |
|-----------|-----------------------------------------|
| $E$       | raises weight by two                    |
| $F$       | lowers weight by two                    |
| $H$       | diagonal, eigenvalues are the weights   |
Generator Action
\(E\) raises weight by two
\(F\) lowers weight by two
\(H\) diagonal, eigenvalues are the weights

Blockquotes

The miracle of the appropriateness of the language of mathematics for the formulation of the laws of physics is a wonderful gift which we neither understand nor deserve.

(Wigner, The Unreasonable Effectiveness of Mathematics in the Natural Sciences)

Footnotes

Drop [^name] inline, define at the bottom:

The bracket polynomial[^kauffman] is a state sum over crossings.

[^kauffman]: Kauffman, *On Knots*, Princeton, 1987.

Emphasis

*italic*, **bold**, ~~strikethrough~~ give italic, bold, strikethrough.

[Anathem](https://www.nealstephenson.com/anathem.html) becomes Anathem. Bare URLs are linkified automatically.

Embedding a Pluto notebook

Raw HTML is allowed in the body:

<iframe src="/static/blog/notebooks/<slug>.html" class="notebook-embed" loading="lazy"></iframe>

The .notebook-embed class is theme-aware. Export with bin/export-to-blog from ~/Projects/julia-math/.

Smart symbols

-> becomes →, <- becomes ←, (c) becomes ©, +/- becomes ±. Inside math mode the proper TeX commands (\to, \copyright, \pm) are more precise; the smart-symbol pass mostly helps in prose.

What not to do

  • No $math$ in titles. Titles flow into <title> and feed metadata, neither of which run MathJax.
  • No AMS environments outside $$ ... $$. They need math mode.
  • No heredocs when seeding posts from bash. Bash eats backslashes and \frac becomes rac. Drop the script into scripts/ and run python manage.py shell < scripts/foo.py.
  • No raw HTML for math. The dollar delimiters are enough and MathJax catches them at render time.

This guide was drafted by Claude (Anthropic) at my request, as a working example of a Fragment and a permanent reference for myself. Edits and additions are my own as I go.

Tagged meta, reference.

← All fragments