Posted: Aug 16, 2015 2:06 am
chango369 wrote:Pulsar's Latex Tutorial Part 3 - reboot

Pulsar wrote:

Code: Select all
$\textbf{A }\mathbf{\LaTeX\ }\textbf{Tutorial, part 3}$

Arrows

Code: Select all
\begin{align}&\leftarrow \quad \longleftarrow \quad \Leftarrow \quad \Longleftarrow \quad \rightarrow \quad \longrightarrow \quad \Rightarrow \quad \Longrightarrow \quad\overleftarrow{abc} \quad \overrightarrow{abc} \\&\leftrightarrow \quad \longleftrightarrow \quad \Leftrightarrow \quad \Longleftrightarrow \quad \leftrightarrows \quad \leftleftarrows \quad \rightrightarrows \quad \uparrow \quad \Uparrow \quad \downarrow \quad \Downarrow \quad \updownarrow \quad \Updownarrow\end{align}

If you want an arrow with additional text, use \xleftarrow or \xrightarrow. Be aware of the precise format: text below is placed between square brackets [] and can be omitted, while text above is placed between mandatory curly brackets {}.

Code: Select all
$\xrightarrow{\text{above the arrow}} \qquad \xleftarrow[\text{below}]{}\qquad \xrightarrow[\text{below}]{\text{above the arrow}}$

In combination with the \lim operator, you can write something like this:

Code: Select all
$\lim_{x \rightarrow +\infty} f(x) = 0$

This doesn't look very pretty, but it can be tidied up by enclosing the equation by a \displaystyle{} environment:

Code: Select all
$\displaystyle{\lim_{x \rightarrow +\infty} f(x) = 0}$

Various operators

Again, use \displaystyle{} for nice results:

Code: Select all
$\displaystyle{\sum \quad \sum_{i=1}^{n} \quad \sum_{\substack{i,j \\ i > j}} \quad \prod \quad \prod_{n=0}^{\infty} \quad \coprod\quad \int \quad \int_0^1 \quad \oint \quad \iint \quad \iiint \quad \sqrt{x} \quad \sqrt[3]{26}}$

Note the \substack{} command in the third sum, to stack multiple limits. Fractions and binomials looks as follows, without and with \displaystyle{}:

Code: Select all
$\frac{1}{2} \quad \binom{n}{k}\qquad\displaystyle{\frac{1}{2} \quad \binom{n}{k}}$

Brackets

Code: Select all
$\displaystyle{() \quad [] \quad \{ \} \quad | \quad \langle \rangle \quad \lfloor \rfloor \quad \lceil \rceil \quad \Vert}$

Note the backslash in \{ and \} to produce curly brackets. The size of these delimiters can be increased manually by preceding them with \big, \Big, \bigg or \Bigg. You can also let Latex determine an appropriate size, by using \left and \right. However, every \left delimiter has to be followed by a similar \right delimiter; in case you want only one delimiter, use a dot for the other, i.e. \left. or \right. to generate an empty delimiter. See the examples:

Code: Select all
$\displaystyle{\Bigg( \bigg( \Big( \big( () \big) \Big) \bigg) \Bigg)\qquad \left(\frac{a}{b}\right) \qquad \left[\frac{A}{B} + \left( C + \sqrt{D}\right) \right]\qquad \left\langle\left. \psi_1 \right. \right|}$

The \underbrace{} and \overbrace{} commands produce

Code: Select all
$\underbrace{\underbrace{a + b}_\text{brace 1} +\overbrace{c + d}^\text{brace 2}}_\text{brace 3}= e$