Posted: Jun 27, 2015 7:39 pm
by chango369
Pulsar's Latex Tutorial Part 3 - reboot


Pulsar wrote:

Code: Select all
[latex]\textbf{A }\mathbf{\LaTeX\ }\textbf{Tutorial, part 3}[/latex]


Image

Arrows

Code: Select all
[latex]\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}[/latex]


Image

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
[latex]\xrightarrow{\text{above the arrow}} \qquad
\xleftarrow[\text{below}]{}\qquad
\xrightarrow[\text{below}]{\text{above the arrow}}[/latex]


Image

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

Code: Select all
[latex]\lim_{x \rightarrow +\infty} f(x) = 0[/latex]


Image

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

Code: Select all
[latex]\displaystyle{
\lim_{x \rightarrow +\infty} f(x) = 0}[/latex]


Image

Various operators

Again, use \displaystyle{} for nice results:

Code: Select all
[latex]\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}
}[/latex]


Image

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
[latex]\frac{1}{2} \quad \binom{n}{k}
\qquad
\displaystyle{\frac{1}{2} \quad \binom{n}{k}}[/latex]


Image

Brackets

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


Image

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
[latex]\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|}[/latex]


Image

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

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


Image