[go: up one dir, main page]

0% found this document useful (0 votes)
14K views5 pages

LaTeX Cookbook

This document is a LaTeX cookbook that provides examples and instructions for typesetting various mathematical elements in LaTeX, including inline and displayed formulas, spaces and text in formulas, multiple line equations, formula numbering, braces, and accents. It shows how to write formulas using math mode and equation environments, add labels for cross-referencing, and apply various symbols like fractions, integrals, and summation/product notation.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14K views5 pages

LaTeX Cookbook

This document is a LaTeX cookbook that provides examples and instructions for typesetting various mathematical elements in LaTeX, including inline and displayed formulas, spaces and text in formulas, multiple line equations, formula numbering, braces, and accents. It shows how to write formulas using math mode and equation environments, add labels for cross-referencing, and apply various symbols like fractions, integrals, and summation/product notation.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

LaTeX Cookbook

1 of 5

http://www.personal.ceu.hu/tex/cookbook.html

Inline and Displayed Formulas


Spaces and Text in Formulas
Multiple Line Equations
Formula Numbering
Braces
Accents

Inline and Displayed Formulas


$x=\frac{1+y}{1+2z^2}$

(inline)
$$x=\frac{1+y}{1+2z^2}$$

(displayed)
$\int_0^\infty e^{-x^2} dx=\frac{\sqrt{\pi}}{2}$

(inline)
$$\int_0^\infty e^{-x^2} dx=\frac{\sqrt{\pi}}{2}$$

(displayed)
$\displaystyle \int_0^\infty e^{-x^2} dx$

(inline)
$$
\frac{1}{\displaystyle 1+
\frac{1}{\displaystyle 2+
\frac{1}{\displaystyle 3+x}}} +
\frac{1}{1+\frac{1}{2+\frac{1}{3+x}}}
$$

Spaces and Text in Formulas


$\sqrt{2} \sin x$, $\sqrt{2}\,\sin x$

$\int \!\! \int f(x,y)\,\mathrm{d}x\mathrm{d}y$

04/06/2013 02:24 .

LaTeX Cookbook

2 of 5

http://www.personal.ceu.hu/tex/cookbook.html

$$
\mathop{\int \!\!\! \int}_{\mathbf{x} \in \mathbf{R}^2}
\! \langle \mathbf{x},\mathbf{y}\rangle
\,d\mathbf{x}
$$

$$ x_1 = a+b \mbox{ and } x_2=a-b $$

$$ x_1 = a+b ~~\mbox{and}~~ x_2=a-b $$

Multiple Line Equations


\begin{eqnarray}
y &=& x^4 + 4
\nonumber \\
&=& (x^2+2)^2 -4x^2 \nonumber \\
&\le&(x^2+2)^2
\end{eqnarray}

\begin{eqnarray*}
e^x &\approx& 1+x+x^2/2! + \\
&& {}+x^3/3! + x^4/4! + \\
&& + x^5/5!
\end{eqnarray*}

\begin{eqnarray*}
\lefteqn{w+x+y+z = }\\
&& a+b+c+d+e+\\
&& {}+f+g+h+i
\end{eqnarray*}

\begin{eqnarray*}
x&=&\sin \alpha = \cos \beta\\
&=&\cos(\pi-\alpha) = \sin(\pi-\beta)
\end{eqnarray*}

{\setlength\arraycolsep{0.1em}
\begin{eqnarray*}
x&=&\sin \alpha = \cos \beta\\
&=&\cos(\pi-\alpha) = \sin(\pi-\beta)
\end{eqnarray*}
}

$$\setlength\arraycolsep{0.1em}
\begin{array}{rclcl}
x&=&\sin \alpha &=& \cos \beta\\

04/06/2013 02:24 .

LaTeX Cookbook

3 of 5

http://www.personal.ceu.hu/tex/cookbook.html

&=&\cos(\pi-\alpha) &=& \sin(\pi-\beta)


\end{array}
$$

Formula Numbering

\begin{equation} x=y+3 \label{eq:xdef}


\end{equation}
In equation (\ref{eq:xdef}) we saw $\dots$

\usepackage{leqno}
...
\begin{equation} x=y+3 \label{eq:xdef}
\end{equation}
In equation (\ref{eq:xdef}) we saw $\dots$

\begin{equation}
\begin{array}{l}
\displaystyle \int 1 = x + C\\
\displaystyle \int x = \frac{x^2}{2} + C \\
\displaystyle \int x^2 = \frac{x^3}{3} + C
\end{array}
\label{eq:xdef}
\end{equation}

\begin{eqnarray}
&& \int 1 = x + C \nonumber\\
&& \int x = \frac{x^2}{2} + C \nonumber\\
&& \int x^2 = \frac{x^3}{3} + C \label{eq:xdef}
\end{eqnarray}

Braces
$\left] 0,1
\right[
+ \lceil x \rfloor - \langle x,y\rangle$

$$
{n+1\choose k} = {n\choose k} + {n \choose k-1}
$$

04/06/2013 02:24 .

LaTeX Cookbook

4 of 5

http://www.personal.ceu.hu/tex/cookbook.html

$$
|x| = \left\{ \begin{array}{rl}
-x &\mbox{ if $x<0$} \\
x &\mbox{ otherwise}
\end{array} \right.
$$

$$
F(x,y)=0 ~~\mbox{and}~~
\left| \begin{array}{ccc}
F''_{xx} & F''_{xy} & F'_x \\
F''_{yx} & F''_{yy} & F'_y \\
F'_x
& F'_y
& 0
\end{array}\right| = 0
$$

$$
\underbrace{n(n-1)(n-2)\dots(n-m+1)}_
{\mbox{total of $m$ factors}}
$$

Accents
Accents in text mode:
gar\c con \'\i{} i
t\`o\'s\.g\^o na\"\i ve na\"ive
Ha\v cek
\r Angstr\"om

Accents in math mode:


$\hat{x}$, $\check{x}$, $\tilde{a}$,
$\bar{\ell}$, $\dot{y}$, $\ddot{y}$,
$\vec{z_1}$, $\vec{z}_1$

Wide accents, under and overline:


$\hat{T} = \widehat{T}$,
$\bar{T} = \overline{T}$, $\widetilde{xyz}$,
$\overbrace{a+\underbrace{b+c}+d}$

$$
\overline{\overline{a}^2+\underline{xy}
+\overline{\overline{z}}}
$$

04/06/2013 02:24 .

LaTeX Cookbook

5 of 5

http://www.personal.ceu.hu/tex/cookbook.html

Sub and superscripts to braces:


$$
\underbrace{a+\overbrace{b+\cdots}^{{}=t}+z}
_{\mathrm{total}} ~~
a+{\overbrace{b+\cdots}}^{126}+z
$$

04/06/2013 02:24 .

You might also like