Like us on Facebook, or we'll kill this dog... f o r   m a t h T e X Click for:   mathTeX homepage

email: john@forkosh.com

$\parstyle\usepackage{color} \large\color{blue}\begin{center}\today\\\time\end{center}$\parstyle\usepackage{color} \large\color{blue}\begin{center}\today\\\time\end{center}

 C o n t e n t s (1) Preliminaries   Character Set Symbols and Commands Command Parameters (2) Basic Constructions   Sub/Superscripts & Limits Delimiters Accents Functions Matrices (3) Additional Refinements   Spacing Text Font Sizes (4) Examples   1     2     3     4     5 6     7     8     9 (5) Symbol Sets   Math, roman, bbold, etc Greek Math Symbols (6) References   Online resources LaTeX books

 L a T e X   P r a c t i c e   B o x     "If you're not making mistakes, then you're not doing anything." –– John Wooden Enter any LaTeX math markup you like in the top box. Then press Submit to see it rendered. I've started you out with a little example already in the box. Or you can Click any example image in this tutorial to place its corresponding markup in the box.
 First enter your own LaTeX expression, or Click any example... \Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
Now click "Submit" to see your expression rendered below...

You should see   $\small x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$\small x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}   if you submit the sample expression already in the box.
Or try clicking this image   $\small \begin{pmatrix} a_{1,1} & a_{1,2} \\ a_{2,1} & a_{2,2} \end{pmatrix}$\small \begin{pmatrix} a_{1,1} & a_{1,2} \\ a_{2,1} & a_{2,2} \end{pmatrix}   and see what happens.

"Computers are like Old Testament gods: lots of rules and no mercy."
–– Joseph Campbell, The Power of Myth   (Doubleday 1988, page 18)

## (1) Preliminaries

"Readers should not be discouraged if they find that they do not have the
prerequisites to read the prerequisites."   –– Paul Halmos, in Measure Theory, 1950

[¶1]   LaTeX is a word processing programpurists will tell you it's a typesetting system, but for our purposes that's a distinction without a difference that lets you easily write documents containing complicated math. It's the math fragment of LaTeX's markup syntax that we'll briefly review here. Only the most basic features are discussed. And to keep the discussion short, examples sometimes illustrate features not explicitly explained in the text. Use the practice box above to try out anything you think I'm trying to tell you. The references below provide more complete information.

[¶2] This tutorial accompanies mathTeXit also accompanies http://www.forkosh.com/mimetex.html for users who can't install LaTeX on their servers, a program that uses LaTeX to facilitate writing math on the web. You write familiar html markup to format your text, and you write <img> tags containing LaTeX markup in query strings to format your math. For example,   <img src="/cgi-bin/mathtex.cgi?\sqrt{a^2+b^2}">align="absmiddle" typically gives the best vertical alignment   displays   $\depth~\small\sqrt{a^2+b^2}$\small\sqrt{a^2+b^2}   wherever you put that tag.

### LaTeX character set...

[¶3] Many ordinary keyboard characters are rendered just like you'd expect. For example, typing   a...z,0...9,+-*/=()[]   in LaTeX (or in a mathTeX query string) just renders   $\small a...z,0...9,+-*/=()[]$\small a...z,0...9,+-*/=()[] .   But some characters have special LaTeX significance. For example, underscore   b_i   introduces a subscript, rendering   $b_i$b_i ,   and carat   a^n   introduces a superscript, rendering   $a^n$a^n .   These and some other special LaTeX characters are discussed in more detail below.

[¶4] In particular, the backslash character   \   always introduces special LaTeX symbols like   \alpha,\beta,\gamma...\omega   (which renders   $\small\alpha,\beta,\gamma...\omega$\small\alpha,\beta,\gamma...\omega ),   or introduces special Latex commands like   \frac 12 \sqrt \pi   (which renders   $\small\frac12\sqrt\pi$\small\frac12\sqrt\pi ). When you want to see a displayed backslash,   type \backslash .

[¶5] LaTeX special symbols and commands always begin with a backslash \,   almost alwaysThere's one occasional exception to these rules. A few LaTeX symbols consist of a backslash followed by a single non-alphabetic character. Among other keyboard characters,   $,%,& have special LaTeX significance, so to display them you have to type \$,\%,\&   instead, which renders   $,%,&. followed by one or more alphabetic characters a-z,A-Z. The symbol or command is always terminated by a space or by any non-alphabetic character. For example, \frac2x can be typed without a space between the \frac and the 2, correctly rendering $\small\frac2x$\small\frac2x . And \frac\pi2 correctly renders $\small\frac\pi2$\small\frac\pi2 . But \fracx2 is incorrectly interpreted as the non-existent command \fracx followed by 2, so a space is mandatory and you must type \frac x2 to render $\small\frac x2$\small\frac x2 . ### Command Parameters... [¶6] As illustrated above, \frac takes two arguments, and \sqrt takes oneActually, \sqrt accepts an optional argument in the form, e.g., \sqrt[3]\pi, which renders the cube root of pi. Several LaTeX commands accept one or more optional arguments, but that's beyond the scope of this tutorial. . Similarly, subscripts b_i and superscripts a^n each take one argument. Some commands take no arguments. When needed, each LaTeX argument is always the next single character following the command. But any expression enclosed in curly braces is treated as a single character, and the curly braces are not displayed. For example, \frac1{\sqrt{a^2+b^2}} renders $\small\frac1{\sqrt{a^2+b^2}}$\small\frac1{\sqrt{a^2+b^2}} . Curly braces must always appear in properly balanced pairs. Unnecessary pairs of curly braces usually do no harm, so use them when in doubt. For example, \sqrt{\frac12} renders $\small\sqrt{\frac12}$\small\sqrt{\frac12} . To display curly braces, type \lbrace...\rbrace which renders $\lbrace...\rbrace$\lbrace...\rbrace . ## (2) Basic Constructions "Where are we going? And why are we in this handbasket?" ### Sub/Superscripts and Limits... [¶1] Besides our preceding examples, note that symbols may be simultaneously subscripted and superscripted. For example, A_{u,v}^k renders $\depth~A_{u,v}^k$A_{u,v}^k . Also note that sub/superscripts may themselves be sub/superscripted to any level (though you may want to reconsider your notation after two levels). For example, A_{u_i,v_j}^{k_m^n} renders $\depth~A_{u_i,v_j}^{k_m^n}$A_{u_i,v_j}^{k_m^n} . [¶2] Limits (lower and upper bounds) are written just like subscripts and superscripts. For example, \sum_{i=1}^n i = \frac{n(n+1)}2 may render $\small\sum\nolimits_{i=1}^n i = \frac{n(n+1)}2$\small\sum\nolimits_{i=1}^n i = \frac{n(n+1)}2 . To make sure limits are displayed directly below and above the operator, begin your expression with \displaystyleA lengthier discussion involving the several LaTeX directives \displaystyle, \textstyle, \limits and \nolimits is beyond the scope of this tutorial. . For example, \displaystyle\sum_{i=1}^n i = \frac{n(n+1)}2 renders $\small\displaystyle\sum_{i=1}^ni=\frac{n(n+1)}2$\small\displaystyle\sum_{i=1}^ni=\frac{n(n+1)}2 . ### Delimiters... [¶3] Enclosing terms in ordinary parentheses doesn't always look good. For example, (\frac1{\sqrt2}x+y) (\frac1{\sqrt2}x-y) renders $\small(\frac1{\sqrt2}x+y)(\frac1{\sqrt2}x-y)$\small(\frac1{\sqrt2}x+y)(\frac1{\sqrt2}x-y) . [¶4] Instead, the LaTeX commands \left( ... \right) automatically size parentheses, and other delimiters, to match the enclosed term. For example, \left(\frac1{\sqrt2}x+y\right) \left(\frac1{\sqrt2}x-y\right) renders $\small\left(\frac1{\sqrt2}x+y\right)\left(\frac1{\sqrt2}x-y\right)$\small\left(\frac1{\sqrt2}x+y\right)\left(\frac1{\sqrt2}x-y\right) . [¶5] Ordinary parentheses (...) don't have to be balanced, but \left(...\right) must always appear in properly balanced pairs. And any number of \middle| commands may appear between a \left(...\right) pair, to size contained delimiters similarly (see the third and fourth examples below). Besides \left(...\middle|...\right), the following delimiters can also be automatically sized:  Delimiter example... ...renders \left( ... \right) \left( \frac1{1-x^2} \right)^2 $\large\left(\frac1{1-x^2}\right)^2$\large\left(\frac1{1-x^2}\right)^2 \left[ ... \right] \left[ \frac1{\sqrt2}x-y \right]^2 $\large\left[\frac1{\sqrt2}x-y\right]^2$\large\left[\frac1{\sqrt2}x-y\right]^2 \left\{ ... \right\} \left\{ x \in \mathbb{R} \middle| x \geq \frac12 \right\} $\large\left\{x\in\mathbb{R}\middle|x\geq\frac12\right\}$\large\left\{x\in\mathbb{R}\middle|x\geq\frac12\right\} \left\langle ... ... \right\rangle \left\langle \varphi \middle| \hat{H} \middle| \phi \right\rangle $\large\left\langle \varphi\middle|\hat{H}\middle|\phi\right\rangle$\large\left\langle \varphi\middle|\hat{H}\middle|\phi\right\rangle \left| ... \right| \left| \begin{matrix} a_1 & a_2 \\ b_1 & b_2 \end{matrix} \right| $\large\left|\begin{matrix}a_1&a_2\\b_1&b_2 \end{matrix}\right|$\large\left|\begin{matrix}a_1&a_2\\b_1&b_2 \end{matrix}\right| \left\| ... \right\| \left\| x^2-y^2 \right\| $\large\left\|x^2-y^2\right\|$\large\left\|x^2-y^2\right\| \left\{ ... \right. y = \left\{ {\text{this}\atop \text{that}} \right. $\large y=\left\{ {\text{this}\atop\text{that}} \right.$\large y=\left\{ {\text{this}\atop\text{that}} \right. \left. ... \right\} \left. {\text{this}\atop \text{that}} \right\} = y $\large\left. {\text{this}\atop\text{that}} \right\}=y$\large\left. {\text{this}\atop\text{that}} \right\}=y Note the last two examples. Any left delimiter can be balanced with a matching \right. and any right delimiter can be balanced with a preceding \left. The . delimiter balances its mate but displays nothing, which lets you format math expressions like the last two illustrated above. The \text{ } and { \atop } commands from those examples are discussed below. ### Accents... [¶6] Use the LaTeX "math accent" \vec{ } to write vectors. For example, \vec{v} renders $\vec{v}$\vec{v} . Some accents have a wide counterpart, used when its argument contains more than a single character. Among the accents LaTeX recognizes are the following:  Accent example... ...renders \vec{ } \vec{x} $\large\vec{x}$\large\vec{x} \hat{ } \widehat{ABC} $\widehat{ABC}$\widehat{ABC} \tilde{ } \widetilde{ABC} $\widetilde{ABC}$\widetilde{ABC} \dot{ } \dot{\omega} $\large\dot{\omega}$\large\dot{\omega} \ddot{ } \ddot{\omega} $\large\ddot{\omega}$\large\ddot{\omega} Note that accents can be composed, e.g., \dot{\vec{x}} renders $\dot{\vec{x}}$\dot{\vec{x}} . [¶7] While not strictly accents, the following one-argument commands are also very useful. They have no wide counterparts: \not{ } accepts only a single-character argument, whereas \cancel{ }, \sout{ }, \overline{ } and \underline{ } all accept one or more characters.  Command example... ...renders \not{ } a \not= b $a\not=b$a\not=b a \not\in \mathbb{Q} $a\not\in\mathbb{Q}$a\not\in\mathbb{Q} \cancel{ } \cancel{ABC} $\usepackage{cancel}\cancel{ABC}$\usepackage{cancel}\cancel{ABC} \sout{ } \sout{$ABC$} $\parstyle\usepackage{ulem}\sout{ABC}$\parstyle\usepackage{ulem}\sout{$ABC} \overline{ } \overline{ABC} $\overline{ABC}$\overline{ABC} \underline{ } \underline{ABC} $\underline{ABC}$\underline{ABC} [¶8] While also not accents, the following two-argument commands are similarly useful. Note that \overbrace{ }^{ } requires a carat ^ between its two arguments, whereas \overset{ }{ } doesn't. Similarly, \underbrace{ }_{ } requires an underscore _, whereas \underset{ }{ } doesn't.  Command example... ...renders \overbrace{ }^{ } \overbrace{a,...,a}^{\text{k a's}} $\overbrace{a,...,a}^{\text{k a's}}$\overbrace{a,...,a}^{\text{k a's}} \underbrace{ }_{ } \underbrace{b,...,b}_{\text{l b's}} $\underbrace{b,...,b}_{\text{l b's}}$\underbrace{b,...,b}_{\text{l b's}} \overset{ }{ } a \overset{\text{def}}{=} b $a \overset{\text{def}}{=} b$a \overset{\text{def}}{=} b \underset{ }{ } c \underset{\text{def}}{=} d $c \underset{\text{def}}{=} d$c \underset{\text{def}}{=} d You can usefully combine \overbrace{ }^{ } and \underbrace{ }_{ } so that, for example, \underbrace{\overbrace{a...a}^{\text{k a's}}, \overbrace{b...b}^{\text{l b's}}}_{\text{k+l elements}} renders $\underbrace{\overbrace{a...a}^{\text{k a's}}, \overbrace{b...b}^{\text{l b's}}}_{\text{k+l elements}}$\underbrace{\overbrace{a...a}^{\text{k a's}}, \overbrace{b...b}^{\text{l b's}}}_{\text{k+l elements}} . ### Functions names... [¶9] Writing sin^2\theta+cos^2\theta renders $sin^2\theta+cos^2\theta$sin^2\theta+cos^2\theta , whereas \sin^2\theta+\cos^2\theta renders $\sin^2\theta+\cos^2\theta$\sin^2\theta+\cos^2\theta . Several dozen common function names are recognized by LaTeX as backslashed commands, and rendered in a roman font that's more typical mathematical notation. And some of these function name commands like \lim render subscripts more typically, too. For example, \lim_{x\to\infty}\frac1x=0 renders $\lim_{x\to\infty}\frac1x=0$\lim_{x\to\infty}\frac1x=0 . The most common LaTeX function name commands are listed below. Those that treat subscripts like \lim are followed by an underscore, e.g., \lim_.  \arccos \arcsin \arctan \arg \cos \cosh \cot \coth \csc \deg \det_ \dim \exp \gcd_ \hom \inf_ \ker \lg \lim_ \liminf_ \limsup_ \ln \log \max_ \min_ \Pr_ \sec \sin \sinh \sup_ \tan \tanh ### Matrices... [¶10] The easiest way to write a matrix in LaTeX is \begin{matrix} a&b\\c&d \end{matrix} which renders $\begin{matrix} a & b \\ c & d \end{matrix}$\begin{matrix} a & b \\ c & d \end{matrix} . Surround it with \left( ... \right) to obtain $\left(\begin{matrix} a & b \\ c & d \end{matrix}\right)$\left(\begin{matrix} a & b \\ c & d \end{matrix}\right) . Alternatively, \begin{pmatrix} ... \end{pmatrix} automatically surounds the rendered matrix with parentheses. [¶11] Matrices are written row-wise, with \\ at the end of each row. Within a row, columns are separated by &. A general m x n matrix is therefore written in the form  \begin{matrix} a1,1 & a1,2 & . . . & a1,n \\ a2,1 & a2,2 & . . . & a2,n \\ . . . . . . . . . . . . . . . . . . . . . \\ am,1 & am,2 & . . . & am,n \end{matrix} [¶12] Each component ai,j can contain any valid LaTeX markup whatsoever, even another matrix. If you write & &, the corresponding component is left blank. For example, \begin{pmatrix} a&\\&b \end{pmatrix} renders the diagonal 2 x 2 matrix $\left(\begin{matrix} a & \\ & b \end{matrix}\right)$\left(\begin{matrix} a & \\ & b \end{matrix}\right) . You can terminate a row with \\ anytime, so the preceding a&\\&b can been written a\\&b. And you can write (lower left) triangular matrices without strings of empty & & &'s. [¶13] More general than \begin{matrix}......\end{matrix} illustrated above is the alternative \begin{array}{lcr}......\end{array} which requires that extra {lcr}-style argument specifying how to center elements in each column. The three one-letter choices stand for left or center or right, and you supply one letter for each column in your array. Thus, \begin{array}{lcr}......\end{array} specifies a three-column array, any number of rows, with elements in the first column left-justified, elements in the second centered, and elements in the third column right-justified. Note that \begin{matrix}......\end{matrix} is equivalent to \begin{array}{ccc...}......\end{array}, with enough c's to accommodate your array. [¶14] Suppose you want to display four simultaneous equations. That can be done with a four-row, three-column {rcl} array whose second column always contains an = sign, first column the left-hand side of an equation, and third column the right-hand side. For example,  \begin{array}{rcl} a + b + c + d & = & 4 \\ 2a - d & = & b + c \\ 2b & = & c + d - a \\ c - d & = & b - 2a \end{array} renders $\begin{array}{rcl}a+b+c+d&=&4\\2a-d&=&b+c\\2b&=&c+d-a\\ c-d&=&b-2a\end{array}$\begin{array}{rcl}a+b+c+d&=&4\\2a-d&=&b+c\\2b&=&c+d-a\\ c-d&=&b-2a\end{array} [¶15] Or, for another example, to illustrate some simple algebra you can leave the first column empty after the first row, rendering (hover over or click the image to see its markup) $\begin{array}{rcl}(a+b)^3&=&(a+b)^2(a+b)\\ &=&(a^2+2ab+b^2)(a+b)\\ &=&(a^3+2a^2b+ab^2)+(a^2b+2ab^2+b^3)\\ &=&a^3+3a^2b+3ab^2+b^3\end{array}$\begin{array}{rcl}(a+b)^3&=&(a+b)^2(a+b)\\ &=&(a^2+2ab+b^2)(a+b)\\ &=&(a^3+2a^2b+ab^2)+(a^2b+2ab^2+b^3)\\ &=&a^3+3a^2b+3ab^2+b^3\end{array} [¶16] LaTeX provides various additional methodsFor example, \begin{align}......\end{align} more readily aligns multi-line equations than \begin{array}{rcl}......\end{array} illustrated above. to display array-type data that you may find useful. But a lengthy discussion is beyond the scope of this tutorial. ## (3) Additional Refinements "Make every day your masterpiece." –– John Wooden ### Spacing... [¶1] LaTeX does its own spacing, and spaces that you type yourself are never displayed. For example, (abcd), (a bcd), (a b cd) and (a b c d) all render the same $(a b c d)$(a b c d) . To explicitly embed displayed space, LaTeX provides several commands including \, \: \; \quad \qquad, and also a backslashed blank $\backslash\underline{\ }$\backslash\underline{\ } (i.e., a \ followed by a blank). These commands take no arguments. For example, (a\,b\:c\;d\ e\quad f\qquad g) renders $(a\,b\:c\;d\ e\quad f\qquad g)$(a\,b\:c\;d\ e\quad f\qquad g) . [¶2] For arbitrary embedded space, the command \hspace{ } takes a single numerical argument that specifies the width of the embedded space (in "points"). For example, (ab\hspace{9pt}cd\hspace{25pt}ef) renders $(ab\hspace{9pt}cd\hspace{25pt}ef)$(ab\hspace{9pt}cd\hspace{25pt}ef) . ### Text... [¶3] Typing abcdef renders $abcdef$abcdef in LaTeX's default math font. To intersperse explanatory text, \text{abc def} or \mbox{def ghi} renders $\small\mbox{abc def}$\small\mbox{abc def} in non-mathematical roman font. Note that embedded spaces are respected. For example, y=\left\{ {x/2\mbox{ ifx$even} \atop (x+1)/2\text{ if odd}} \right. renders $y=\left\{ {x/2\mbox{ if x even} \atop (x+1)/2\text{ if odd}} \right.$y=\left\{ {x/2\mbox{ if$x$even} \atop (x+1)/2\text{ if odd}} \right. . ### Font Sizes... [¶4] LaTeX commands that select font size are \tiny, \small, \normalsize (the usual default), \large, \Large, \LARGE, \huge and \Huge. But these commands are usually not permitted within math markup. MathTeX permits these font size commands by moving them outside the math markup. For example,  \tiny\sqrt{a^2+b^2} renders $\tiny\sqrt{a^2+b^2}$\tiny\sqrt{a^2+b^2} \small\sqrt{a^2+b^2} $\small\sqrt{a^2+b^2}$\small\sqrt{a^2+b^2} \normalsize\sqrt{a^2+b^2} $\normalsize\sqrt{a^2+b^2}$\normalsize\sqrt{a^2+b^2} \large\sqrt{a^2+b^2} $\large\sqrt{a^2+b^2}$\large\sqrt{a^2+b^2} \Large\sqrt{a^2+b^2} $\Large\sqrt{a^2+b^2}$\Large\sqrt{a^2+b^2} \LARGE\sqrt{a^2+b^2} $\LARGE\sqrt{a^2+b^2}$\LARGE\sqrt{a^2+b^2} \huge\sqrt{a^2+b^2} $\huge\sqrt{a^2+b^2}$\huge\sqrt{a^2+b^2} \Huge\sqrt{a^2+b^2} $\Huge\sqrt{a^2+b^2}$\Huge\sqrt{a^2+b^2} These size directives affect the entire expression. There's no easy way to render a single expression at several different sizes, e.g., \frac {\small a}{\large b} won't work. ## (4) Examples "You can observe a lot just by watching." –– Yogi Berra [¶1] Here are several examples further demonstrating LaTeX features and usage. Some of the illustrated features haven't been discussed in this tutorial, and you'll have to consult the references for an explanation. To see how the examples are done, Click any one of them to place its corresponding markup in the Practice Box above. Then press Submit to re-render it, or you can edit the markup first to suit your own purposes.  (1) $\usepackage{color}\color{red} \small e^x=\sum_{n=0}^\infty\frac{x^n}{n!}$\usepackage{color}\color{red} \small e^x=\sum_{n=0}^\infty\frac{x^n}{n!} $\usepackage{color}\color{green} \normalsize e^x=\sum_{n=0}^\infty\frac{x^n}{n!}$\usepackage{color}\color{green} \normalsize e^x=\sum_{n=0}^\infty\frac{x^n}{n!} $\usepackage{color}\color{blue} \large e^x=\sum_{n=0}^\infty\frac{x^n}{n!}$\usepackage{color}\color{blue} \large e^x=\sum_{n=0}^\infty\frac{x^n}{n!} $\large e^x=\lim_{n\to\infty} \left(1+\frac xn\right)^n$\large e^x=\lim_{n\to\infty} \left(1+\frac xn\right)^n (2) $\normalsize \varepsilon=\sum_{i=1}^{n-1} \frac1{\Delta x}\int\limits_{x_i}^{x_{i+1}}\left\{\frac1{\Delta x}\big[ (x_{i+1}-x)y_i^\ast+(x-x_i)y_{i+1}^\ast\big]-f(x)\right\}^2dx$\normalsize \varepsilon=\sum_{i=1}^{n-1} \frac1{\Delta x}\int\limits_{x_i}^{x_{i+1}}\left\{\frac1{\Delta x}\big[ (x_{i+1}-x)y_i^\ast+(x-x_i)y_{i+1}^\ast\big]-f(x)\right\}^2dx (3) $\large x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$\large x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} solution for quadratic (4) $\large f^\prime(x)\ = \lim_{\Delta x\to0}\frac{f(x+\Delta x)-f(x)}{\Delta x}$\large f^\prime(x)\ = \lim_{\Delta x\to0}\frac{f(x+\Delta x)-f(x)}{\Delta x} definition of derivative (5) $\Large f=b_o+\frac{a_1}{b_1+\frac{a_2}{b_2+\frac{a_3}{b_3+a_4}}}$\Large f=b_o+\frac{a_1}{b_1+\frac{a_2}{b_2+\frac{a_3}{b_3+a_4}}} continued fraction (6) $\Large\tilde y=\left\{ {\ddot x \mbox{ if x odd}\atop\widehat{\bar x+1}\text{ if even}}\right.$\Large\tilde y=\left\{ {\ddot x \mbox{ if$xodd}\atop\widehat{\bar x+1}\text{ if even}}\right. illustrating \left\{...\right. and note all the accents (7) $\large\overbrace{a,...,a}^{\text{k a's}}, \underbrace{b,...,b}_{\text{l b's}}\hspace{10pt} \underbrace{\overbrace{a...a}^{\text{k a's}}, \overbrace{b...b}^{\text{l b's}}}_{\text{k+l elements}}$\large\overbrace{a,...,a}^{\text{k a's}}, \underbrace{b,...,b}_{\text{l b's}}\hspace{10pt} \underbrace{\overbrace{a...a}^{\text{k a's}}, \overbrace{b...b}^{\text{l b's}}}_{\text{k+l elements}} \overbrace{}^{} and \underbrace{}_{} (TeXbook page 181, Exercise 18.41) (8) $A\ =\ \left( \begin{array}{c|ccc} & 1 & 2 & 3 \\ \hline 1&a_{11}&a_{12}&a_{13}\\2&a_{21}&a_{22}&a_{23}\\ 3&a_{31}&a_{32}&a_{33} \end{array} \right)$A\ =\ \left( \begin{array}{c|ccc} & 1 & 2 & 3 \\ \hline 1&a_{11}&a_{12}&a_{13}\\2&a_{21}&a_{22}&a_{23}\\ 3&a_{31}&a_{32}&a_{33} \end{array} \right) illustrating \begin{array}{c|ccc}...\end{array} with \hline (9) $\parstyle\large\begin{eqnarray*} x+y+z&=&3\\2y&=&x+z\\2x+y&=&z\end{eqnarray*}$\parstyle\large\begin{eqnarray*} x+y+z&=&3\\2y&=&x+z\\2x+y&=&z\end{eqnarray*} using \begin{eqnarray} to align equations ## (5) LaTeX Symbol Sets "Letters can be used to construct words, phrases and sentences that may be deemed offensive." –– Warning label on children's alphabet blocks [¶1] You've already seen several LaTeX symbols like \alpha, \beta and \omega, and several LaTeX commands like \frac, \sqrt and \sum. The Comprehensive LaTeX Symbol List illustrates over 4,900 symbols supported by LaTeX. Some of the basic math symbols and operators are illustrated in the following tables. ### Math, Roman, Calligraphic, Script and Blackboard Bold ... [¶2] Simply typing a-z,A-Z renders characters $a-z,A-Z$a-z,A-Z in LaTeX's default math font, while typing \mathbf{a-z,A-Z} renders $\mathbf{a-z,A-Z}$\mathbf{a-z,A-Z} in bold math font. And typing \text{a-z,A-Z} renders characters $\text{a-z,A-Z}$\text{a-z,A-Z} in roman font. Spaces inside \text{ } are rendered exactly as typed, for example, \text{this is a test} renders $\text{this is a test}$\text{this is a test} . [¶3] LaTeX supports many useful fonts besides math and roman. Among these are  Blackboard bold: \mathbb{A-Z} renders $\mathbb{A-Z}$\mathbb{A-Z} Calligraphic: \mathcal{A-Z} $\mathcal{A-Z}$\mathcal{A-Z} Script: \mathscr{A-Z} $\usepackage{mathrsfs}\mathscr{A-Z}$\usepackage{mathrsfs}\mathscr{A-Z} [¶4] You'd typically type only one character at a time in these fonts. For example, x\in\mathbb{R}_+ renders $x\in\mathbb{R}_+$x\in\mathbb{R}_+ . But, just like \text{ }, any number of characters is permitted between the { }'s. $\usepackage{mathrsfs}\begin{array}{|c|c|c|c|c|c|c|c|c|} \hline \text{a-z} & \backslash\text{text} & \text{A-Z} & \small \backslash\text{text} & \backslash\text{mathbb} & \backslash\text{mathcal} & \backslash\text{mathscr} \\ \hline a&\text{a}& A&\text{A}&\mathbb{A}&\mathcal{A}&\mathscr{A}\\ b&\text{b}& B&\text{B}&\mathbb{B}&\mathcal{B}&\mathscr{B}\\ c&\text{c}& C&\text{C}&\mathbb{C}&\mathcal{C}&\mathscr{C}\\ d&\text{d}& D&\text{D}&\mathbb{D}&\mathcal{D}&\mathscr{D}\\ e&\text{e}& E&\text{E}&\mathbb{E}&\mathcal{E}&\mathscr{E}\\ f&\text{f}& F&\text{F}&\mathbb{F}&\mathcal{F}&\mathscr{F}\\ g&\text{g}& G&\text{G}&\mathbb{G}&\mathcal{G}&\mathscr{G}\\ h&\text{h}& H&\text{H}&\mathbb{H}&\mathcal{H}&\mathscr{H}\\ i&\text{i}& I&\text{I}&\mathbb{I}&\mathcal{I}&\mathscr{I}\\ j&\text{j}& J&\text{J}&\mathbb{J}&\mathcal{J}&\mathscr{J}\\ k&\text{k}& K&\text{K}&\mathbb{K}&\mathcal{K}&\mathscr{K}\\ l&\text{l}& L&\text{L}&\mathbb{L}&\mathcal{L}&\mathscr{L}\\ m&\text{m}& M&\text{M}&\mathbb{M}&\mathcal{M}&\mathscr{M}\\ n&\text{n}& N&\text{N}&\mathbb{N}&\mathcal{N}&\mathscr{N}\\ o&\text{o}& O&\text{O}&\mathbb{O}&\mathcal{O}&\mathscr{O}\\ p&\text{p}& P&\text{P}&\mathbb{P}&\mathcal{P}&\mathscr{P}\\ q&\text{q}& Q&\text{Q}&\mathbb{Q}&\mathcal{Q}&\mathscr{Q}\\ r&\text{r}& R&\text{R}&\mathbb{R}&\mathcal{R}&\mathscr{R}\\ s&\text{s}& S&\text{S}&\mathbb{S}&\mathcal{S}&\mathscr{S}\\ t&\text{t}& T&\text{T}&\mathbb{T}&\mathcal{T}&\mathscr{T}\\ u&\text{u}& U&\text{U}&\mathbb{U}&\mathcal{U}&\mathscr{U}\\ v&\text{v}& V&\text{V}&\mathbb{V}&\mathcal{V}&\mathscr{V}\\ w&\text{w}& W&\text{W}&\mathbb{W}&\mathcal{W}&\mathscr{W}\\ x&\text{x}& X&\text{X}&\mathbb{X}&\mathcal{X}&\mathscr{X}\\ y&\text{y}& Y&\text{Y}&\mathbb{Y}&\mathcal{Y}&\mathscr{Y}\\ z&\text{z}& Z&\text{Z}&\mathbb{Z}&\mathcal{Z}&\mathscr{Z}\\ \hline \end{array}$ ### Greek characters... [¶5] Characters from the Greek alphabet supported by LaTeX. $\begin{array}{|lcc|lcc|lcc|} \hline \hspace{10pt}\backslash\text{Gamma} & \Gamma & & \hspace{10pt}\backslash\text{Delta} & \Delta & & \hspace{10pt}\backslash\text{Theta} & \Theta & \\ \hspace{10pt}\backslash\text{Lambda} & \Lambda & & \hspace{10pt}\backslash\text{Xi} & \Xi & & \hspace{10pt}\backslash\text{Pi} & \Pi & \\ \hspace{10pt}\backslash\text{Sigma} & \Sigma & & \hspace{10pt}\backslash\text{Upsilon} & \Upsilon & & \hspace{10pt}\backslash\text{Phi} & \Phi & \\ \hspace{10pt}\backslash\text{Psi} & \Psi & & \hspace{10pt}\backslash\text{Omega} & \Omega & & & & \\ \hline \hspace{10pt}\backslash\text{alpha} & \alpha & & \hspace{10pt}\backslash\text{beta} & \beta & & \hspace{10pt}\backslash\text{gamma} & \gamma & \\ \hspace{10pt}\backslash\text{delta} & \delta & & \hspace{10pt}\backslash\text{epsilon} & \epsilon & & \hspace{10pt}\backslash\text{zeta} & \zeta & \\ \hspace{10pt}\backslash\text{eta} & \eta & & \hspace{10pt}\backslash\text{theta} & \theta & & \hspace{10pt}\backslash\text{iota} & \iota & \\ \hspace{10pt}\backslash\text{kappa} & \kappa & & \hspace{10pt}\backslash\text{lambda} & \lambda & & \hspace{10pt}\backslash\text{mu} & \mu & \\ \hspace{10pt}\backslash\text{nu} & \nu & & \hspace{10pt}\backslash\text{xi} & \xi & & \hspace{10pt}\backslash\text{pi} & \pi & \\ \hspace{10pt}\backslash\text{rho} & \rho & & \hspace{10pt}\backslash\text{sigma} & \sigma & & \hspace{10pt}\backslash\text{tau} & \tau & \\ \hspace{10pt}\backslash\text{upsilon} & \upsilon & & \hspace{10pt}\backslash\text{phi} & \phi & & \hspace{10pt}\backslash\text{chi} & \chi & \\ \hspace{10pt}\backslash\text{psi} & \psi & & \hspace{10pt}\backslash\text{omega} & \omega & & & & \\ \hline \hspace{10pt}\backslash\text{varepsilon} & \varepsilon & & \hspace{10pt}\backslash\text{vartheta} & \vartheta & & \hspace{10pt}\backslash\text{varpi} & \varpi & \\ \hspace{10pt}\backslash\text{varrho} & \varrho & & \hspace{10pt}\backslash\text{varsigma} & \varsigma & & \hspace{10pt}\backslash\text{varphi} & \varphi & \\ \hline \end{array}$ ### Math symbols and relations... [¶6] Some operatorsBesides \int illustrated here, similarly promoted operators include \oint, \iint, \sum, \prod, \coprod, \oplus, \otimes, \odot, \uplus, \wedge, \vee, \cup, \cap, and \sqcup. shown below are automatically "promoted" to a larger size in LaTeX's \displaystyle mode. For example, f(x)=\int_{-\infty}^x e^{-t^2}dt renders $\textstyle f(x)=\int_{-\infty}^x e^{-t^2}dt$\textstyle f(x)=\int_{-\infty}^x e^{-t^2}dt , whereas \displaystyle f(x)=\int_{-\infty}^x e^{-t^2}dt renders $\displaystyle f(x)=\int_{-\infty}^x e^{-t^2}dt$\displaystyle f(x)=\int_{-\infty}^x e^{-t^2}dt . [¶7] The arrangement of symbols in the tables will be improved in a future version of this tutorial. $\small \begin{array}{|lcc|lcc|lcc|} \hline \hspace{1pt}\backslash\text{cdot} & \cdot & & \hspace{1pt}\backslash\text{times} & \times & & \hspace{1pt}\backslash\text{ast} & \ast & \\ \hspace{1pt}\backslash\text{div} & \div & & \hspace{1pt}\backslash\text{diamond} & \diamond & & \hspace{1pt}\backslash\text{pm} & \pm & \\ \hspace{1pt}\backslash\text{mp} & \mp & & \hspace{1pt}\backslash\text{oplus} & \oplus & & \hspace{1pt}\backslash\text{ominus} & \ominus & \\ \hspace{1pt}\backslash\text{otimes} & \otimes & & \hspace{1pt}\backslash\text{oslash} & \oslash & & \hspace{1pt}\backslash\text{odot} & \odot & \\ \hspace{1pt}\backslash\text{bigcirc} & \bigcirc & & \hspace{1pt}\backslash\text{circ} & \circ & & \hspace{1pt}\backslash\text{bullet} & \bullet & \\ \hspace{1pt}\backslash\text{asymp} & \asymp & & \hspace{1pt}\backslash\text{equiv} & \equiv & & \hspace{1pt}\backslash\text{subseteq} & \subseteq & \\ \hspace{1pt}\backslash\text{supseteq} & \supseteq & & \hspace{1pt}\backslash\text{leq} & \leq & & \hspace{1pt}\backslash\text{geq} & \geq & \\ \hspace{1pt}\backslash\text{preceq} & \preceq & & \hspace{1pt}\backslash\text{succeq} & \succeq & & \hspace{1pt}\backslash\text{sim} & \sim & \\ \hspace{1pt}\backslash\text{approx} & \approx & & \hspace{1pt}\backslash\text{subset} & \subset & & \hspace{1pt}\backslash\text{supset} & \supset & \\ \hspace{1pt}\backslash\text{ll} & \ll & & \hspace{1pt}\backslash\text{gg} & \gg & & \hspace{1pt}\backslash\text{prec} & \prec & \\ \hspace{1pt}\backslash\text{succ} & \succ & & \hspace{1pt}\backslash\text{leftarrow} & \leftarrow & & \hspace{1pt}\backslash\text{rightarrow} & \rightarrow & \\ \hspace{1pt}\backslash\text{uparrow} & \uparrow & & \hspace{1pt}\backslash\text{downarrow} & \downarrow & & \hspace{1pt}\backslash\text{leftrightarrow}&\leftrightarrow&\\ \hspace{1pt}\backslash\text{nearrow} & \nearrow & & \hspace{1pt}\backslash\text{searrow} & \searrow & & \hspace{1pt}\backslash\text{simeq} & \simeq & \\ \hspace{1pt}\backslash\text{Leftarrow} & \Leftarrow & & \hspace{1pt}\backslash\text{Rightarrow} & \Rightarrow & & \hspace{1pt}\backslash\text{Uparrow} & \Uparrow & \\ \hspace{1pt}\backslash\text{Downarrow} & \Downarrow & & \hspace{1pt}\backslash\text{Leftrightarrow}&\Leftrightarrow&& \hspace{1pt}\backslash\text{nwarrow} & \nwarrow & \\ \hspace{1pt}\backslash\text{swarrow} & \swarrow & & \hspace{1pt}\backslash\text{propto} & \propto & & \hspace{1pt}\backslash\text{prime} & \prime & \\ \hspace{1pt}\backslash\text{infty} & \infty & & \hspace{1pt}\backslash\text{in} & \in & & \hspace{1pt}\backslash\text{ni} & \ni & \\ \hspace{1pt}\backslash\text{triangle} & \triangle & & \hspace{1pt}\backslash\text{bigtriangledown}&\bigtriangledown&& \hspace{1pt}\backslash^\prime & {}^\prime & \\ \hspace{1pt}\text{/} & / & & \hspace{1pt}\backslash\text{forall} & \forall & & \hspace{1pt}\backslash\text{exists} & \exists & \\ \hspace{1pt}\backslash\text{neg} & \neg & & \hspace{1pt}\backslash\text{emptyset} & \emptyset & & \hspace{1pt}\backslash\text{Re} & \Re & \\ \hspace{1pt}\backslash\text{Im} & \Im & & \hspace{1pt}\backslash\text{top} & \top & & \hspace{1pt}\backslash\text{bot} & \bot & \\ \hspace{1pt}\backslash\text{aleph} & \aleph & & \hspace{1pt}\backslash\text{mathcal}\lbrace\text{A}\rbrace}&\;\mathcal{A}&& \hspace{1pt}\backslash\text{mathcal}\lbrace\text{Z}\rbrace}&\;\mathcal{Z}&\\ \hline \end{array}$ $\small\begin{array}{|lcc|lcc|lcc|} \hline \hspace{1pt}\backslash\text{cup} & \cup & & \hspace{1pt}\backslash\text{cap} & \cap & & \hspace{1pt}\backslash\text{uplus} & \uplus & \\ \hspace{1pt}\backslash\text{wedge} & \wedge & & \hspace{1pt}\backslash\text{vee} & \vee & & \hspace{1pt}\backslash\text{vdash} & \vdash & \\ \hspace{1pt}\backslash\text{dashv} & \dashv & & \hspace{1pt}\backslash\text{lfloor} & \lfloor & & \hspace{1pt}\backslash\text{rfloor} & \rfloor & \\ \hspace{1pt}\backslash\text{lceil} & \lceil & & \hspace{1pt}\backslash\text{rceil} & \rceil & & \hspace{1pt}\backslash\text{lbrace} & \lbrace & \\ \hspace{1pt}\backslash\text{rbrace} & \rbrace & & \hspace{1pt}\backslash\text{langle} & \langle & & \hspace{1pt}\backslash\text{rangle} & \rangle & \\ \hspace{1pt}\backslash\text{mid} & \mid & & \hspace{1pt}\backslash\text{parallel} & \parallel & & \hspace{1pt}\backslash\text{updownarrow}& \updownarrow & \\ \hspace{1pt}\backslash\text{Updownarrow}& \Updownarrow & & \hspace{1pt}\backslash\text{setminus} & \setminus & & \hspace{1pt}\backslash\text{wr} & \wr & \\ \hspace{1pt}\backslash\text{surd} & \surd & & \hspace{1pt}\backslash\text{amalg} & \amalg & & \hspace{1pt}\backslash\text{nabla} & \nabla & \\ \hspace{1pt}\backslash\text{int} & \int & & \hspace{1pt}\backslash\text{sqcup} & \sqcup & & \hspace{1pt}\backslash\text{sqcap} & \sqcap & \\ \hspace{1pt}\backslash\text{sqsubseteq} & \sqsubseteq & & \hspace{1pt}\backslash\text{sqsupseteq} & \sqsupseteq & & \hspace{1pt}\backslash\text{S} & \S & \\ \hspace{1pt}\backslash\text{dag} & \dag & & \hspace{1pt}\backslash\text{ddag} & \ddag & & \hspace{1pt}\backslash\text{P} & \P & \\ \hspace{1pt}\backslash\text{clubsuit} & \clubsuit & & \hspace{1pt}\backslash\text{Diamond} & \Diamond & & \hspace{1pt}\backslash\text{Heart} & \Heart & \\ \hspace{1pt}\backslash\text{spadesuit} & \spadesuit & & \hspace{55pt} & & & & & \\ \hspace{1pt}\backslash\text{oint} & \oint & & \hspace{1pt}\backslash\text{sum} & \sum & & \hspace{1pt}\backslash\text{prod} & \prod & \\ \hspace{1pt}\backslash\text{coprod} & \coprod & & \hspace{1pt}\backslash\text{star} & {\star} & & \hspace{1pt}\backslash\text{partial} & \partial & \\ \hspace{1pt}\backslash\text{flat} & \flat & & \hspace{1pt}\backslash\text{natural} & \natural & & \hspace{1pt}\backslash\text{sharp} & \sharp & \\ \hspace{1pt}\backslash\text{smile} & \smile & & \hspace{1pt}\backslash\text{frown} & \frown & & \hspace{1pt}\backslash\text{ell} & \ell & \\ \hspace{1pt}\backslash\text{imath} & \imath & & \hspace{1pt}\backslash\text{jmath} & \jmath & & \hspace{1pt}\backslash\text{wp} & \wp & \\ \hspace{1pt}\backslash\text{ss} & \ss & & \hspace{1pt}\backslash\text{ae} & \ae & & \hspace{1pt}\backslash\text{oe} & \oe & \\ \hspace{1pt}\backslash\text{AE} & \AE & & \hspace{1pt}\backslash\text{OE} & \OE & & & & \\ \hspace{1pt}\backslash\text{AA} & \AA & & \hspace{1pt}\backslash\text{aa} & \aa & & \hspace{1pt}\backslash\text{hbar} & \hbar & \\ \hspace{1pt}\backslash\text{ldots} & \ldots & & \hspace{1pt}\backslash\text{cdots} & \cdots & & \hspace{1pt}\backslash\text{vdots} & \vdots & \\ \hspace{1pt}\backslash\text{ddots} & \ddots & & \hspace{1pt}\backslash\text{angle} & \angle & & \hspace{1pt}\backslash\text{iint} & \iint & \\ \hline \end{array}$ ## (6) LaTeX References "Have nothing in your house that you do not know to be useful, or believe to be beautiful" –– William Morris [¶1] This tutorial discusses LaTeX's mathematical markup capabilities, ignoring the preparation of documents containing formatted text. Most references explain LaTeX's mathematical markup, but emphasize the preparation of complete documents. The TeX Users Group provides lists of online resources and book resources that you may find useful. ### Online LaTeX sources... [¶2] Among the online resources, the two pages Latex Math I and Latex Math II comprise another short LaTeX math tutorial. And The not so Short Introduction to LaTeX is a good general online LaTeX reference. ### LaTeX books... [¶3] If you're only interested in LaTeX for online mathematical markup (and not for document preparation), then you may not want to invest the time and money that books entail. But in case you do want a book, try to browse as many as you can, and then choose the one or two you personally like best. Among the book resources, here are a few you might want to look at: [¶4] Intermediate: A Guide to LaTeX2e, 4th ed. is authoritative and easy to read, with a good math discussion. [¶5] Advanced: at 1100 pages it's not a suitable tutorial or first book, but the most comprehensive LaTeX reference available is, The LaTeX Companion, 2nd ed., Frank Mittelbach and Michel Goossens, Addison-Wesley 2004, ISBN 0-201-36299-6 (59.99).

[¶6]   Math:   Math into LaTeX, 3rd ed., George Gratzer, Birkhauser Boston 2000, ISBN: 0-8176-4131-9     emphasizes math. Portions of the first edition are available online.

"My grandfather once told me there are two kinds of people:
Those who do the work and those who take the credit.
He told me to try to be in the first group; there was much less competition."
–– Indira Gandhi, the late Prime Minister of India

[¶1] This page's copyright is registered by me with the US Copyright Office, and I hereby license it to you under the terms and conditions of the GPL. There is no official support of any kind whatsoever, and you use this page entirely at your own risk, with no guarantee of any kind, in particular with no warranty of merchantability.

[¶2] By using this page, you warrant that you have read, understood and agreed to these terms and conditions, and that you possess the legal right and ability to enter into this agreement and to use this page in accordance with it.

[¶3] Hopefully, the law and ethics regarding web material will evolve to make this kind of obnoxious banter unnecessary. In the meantime, please forgive me my paranoia.

[¶4] To protect your own intellectual property, I recommend (both are pdf) Copyright Basics from The Library of Congress, in particular Circular 61, Copyright Registration for Computer Programs. Very briefly, download Form TX and follow the included instructions. In principle, you automatically own the copyright to anything you write the moment it's on paper. In practice, if the matter comes under dispute, the courts look _very_ favorably on you for demonstrating your intent by registering the copyright.

 Copyright © 2002-2012, John Forkosh Associates, Inc. email: john@forkosh.com $\hspace{100}$ $\blue{\small\rm You're the } \Large\counter[counters.log]{counters.txt:mathtextutorial.html}\\[0] {\small\rm visitor to this page.}$