# Latex

I’m writing this as how I use Latex in WordPress.  May not apply to other Latex environments.

Online latex editor

latex wikibook

A good resource, but some things may be specific to MediaWiki.

Something on aligning equations (and other (la)tex stuff)

cheatsheet

tons of Latex symbols

Use with

$latex stuff$

However, don’t put the space between the first $and the word latex. Can put inline with other text, but maybe small. I like it bigger on own line. Make bigger with$ latex stuff &s=2$To do limits with the limit below the word lim,$ latex \displaystyle \lim_{x\to 0}f(x) \$

That \displaystyle tells it to put it under the word lim, otherwise it treats it like a subscript and smaller but to the right.  Can be used with sigma (for sum) to also have limits above/below.  To have things to the right instead, use \textstyle (not needed for WordPress since it looks like that is the default)

Display style also seems to make fractions bigger.  Otherwise the whole fraction will be the same size as the rest of the stuff as if it was going into a line a text, so the stuff in the fraction was smaller.

Without display style (default text style I guess then)

$\frac{d}{dx}f(x)$

With display style

$\displaystyle \frac{d}{dx}f(x)$

Looks like need to use \displaystyle in each { } latex block.

Derivatives x’, \dot{x}, \ddot{x}

$x' \ \dot{x} \ \ddot{x}$

Use \left and \right for things like braces so they match their size to what’s inside

without \left \right

$\displaystyle \frac{d}{dx}[\frac{f(x)}{g(x)}]$

with

$\displaystyle \frac{d}{dx} \left [\frac{f(x)}{g(x)}\right ]$

Sum, use \displaystyle to get the values above and below, \textstyle will put it to the right.

\displaystyle \sum\limits_{i=1}^{n}f(x_i)

$\displaystyle \sum\limits_{i=1}^{n}f(x_i)$

Integral

\int – use sub and super script _, ^ to denote the limits.  Can also use \int\limits_{… like with sum to have them go above and  below like sum (probably need \displaystyle)

$\int_a^b f(x)\ dx$

Underbrace

\underbrace{ a+b+\cdots+z }_{26}

$\underbrace{ a+b+\cdots+z }_{26}$

\sqrt[n]{a}

$\textstyle \sqrt[n]{a}$

$\displaystyle \sqrt[n]{a}$

To write text that isn’t italicized for math, you can use \mbox or \text.  I think \text does some formatting with the spacing between letters and makes it look better, so I suggest that.

\mbox{this is mbox text} \text{this is text text}

$\mbox{this is mbox text}\text{this is text text}$

Preceding sub/super script

{}_1^2\!\Omega_3^4

$\displaystyle {}_1^2\!\Omega_3^4$

Stuff above and below an arrow

B \xrightarrow[T]{n\pm i-1} C

$\displaystyle B \xrightarrow[\displaystyle T]{\displaystyle n\pm i-1} C$

Matrix

$\left[ \begin{array}{ccc} 1 & 2 & 3 \\ 4 & 5 & 6\\ 7 & 8 & 0 \end{array} \right]$

$\begin{bmatrix} 1 & 2 & 3 & 10\\ 4 & 5 & 6 & 11\\ 7 & 8 & 9 &12\end{bmatrix}$

$$\begin{blockarray}{cc} [a] & [b] \\ \begin{block}{[cc]} 1 & 2 \\ 3 & 4 \\ \end{block} \end{blockarray}$$