Some notes on the nuts and bolts of this thing.
 in WordPress
 Pretty Images
LaTeX in WordPress
This blog would be much harder to maintain with out WordPress’ built in support for LaTeX markup. That said, using LaTeX in WordPress does present a few challenges; this page contains a bunch of tips I’ve learned about how to wrestle the markup into submission.
Centered math elements
Suppose you have a large formula that would look better set apart from the surrounding text, like the \displaymath
environment in LaTeX. Just stick the formula inside a div
tag with style="textalign:center;"
. For instance, the markup
<div style="textalign:center;"> $latex \frac{\mathrm{Big\ Thing}}{\mathrm{Small\ Thing}} = \displaystyle\sum_{i \in \mathbb{N}} \mathrm{Blah}$ </div>
produces
Matrices
You might notice that even if you write a post in “raw HTML mode”, WordPress preprocesses your text – for instance, to replace certain symbols with entity codes. The preprocessor indiscriminately munges these symbols inside latex fragments as well, such as the ampersand symbol used to separate cells in a matrix. Evidently the latex interpreter WordPress uses is smart enough to handle this, so that matrices work as usual. Just ignore the fact that ampersands are replaced by &
s.
HTML Entity Codes
The list of HTML entity codes is quite handy if WordPress mangles your carefully crafted text especially text containing lots of weird characters (like source code).
Especially important are the codes for < (<) and > (>). If you use these characters in their unentitycoded version, wordpress will think that any text between two angle brackets is a malformed HTML tag and delete it. I have had several paragraphs disappear in this fashion. It is not fun.
Special Symbols
I can never remember these.
Symbol  Name  Latex 
Semidirect product with left normal factor  \rtimes 

Injective/Direct limit  \varinjlim 

Projective/Inverse limit  \varprojlim 

Normal subgroup  \vartriangleleft 

Fraktur script  \mathfrak{Fraktur} 

Calligraphic script (upper case only)  \mathcal{CALLIGRAPHIC} 

Sansserif script  \mathsf{Sans\mbox{}serif} 

Display style fraction  \dfrac{a}{b} 

Binomial Coefficient/”choose” operator  \binom{n}{k} 
Pretty Images
Commutative Diagrams
As far as I can tell, WordPress’ latex support – while very nice! – does not include any commutative diagram packages. To work around this, we have several options. My favorite is to use MathURL.com; this is a webbased service that compiles latex to png images and which supports the xy
package. The Guide to Commutative Diagrams Packages has lots of examples. More indepth information on the xy
package (which is quite powerful) can be found in the xypic User’s Guide and the xypic Reference Manual.
For example, the following code…
\usepackage[all]{xy} \xymatrix{1 \ar[r] & A_1 \ar[r]^{\iota_1} \ar[d]^{\alpha} & B_1 \ar[r]^{\pi_1} \ar[d]^{\beta} & C_1 \ar[r] \ar[d]^{\gamma} & 1 \\ 1 \ar[r] & A_2 \ar[r]_{\iota_2} & B_2 \ar[r]_{\pi_2} & C_2 \ar[r] & 1}
…produces this diagram.
Lattice and Graph diagrams
The graphviz library is good for making pretty lattice diagrams. A web interface can be found here.
Flow and other charts
The ditaa library is handy for converting ASCII diagrams into nice vector art. The main difference between ditaa and graphviz is that ditaa doesn’t do any of the arrangement for you. A web interface can be found here.
Comments
Oh, this is great, thanks for sharing!
WP scrubs the align attribute because it is deprecated in HTML. Use style=”textalign:center;” inside a DIV tag instead.
Great collection, by the way.
Thanks for the tip! I spent about half an hour wrestling with that and never thought to use “style”.