# Copyright: (c) 2007 The Open University, Milton Keynes, UK. # License: GPL version 2 or (at your option) any later version. # Author: Jonathan Fine , # $Source: /cvsroot/mathtran/website/txt/examples.txt,v $ # $Revision: 1.3 $ $Date: 2007/04/23 10:08:44 $ # Examples are separated by '\n=====\n'. ===== math=Math basics Use \$\dots\$ for math in running text, and \$\$\dots\$\$ for display math. Use \^{} and \_ for superscripts and subscripts. Use $\{$ and $\}$ for compound scripts. Greek letters are accessed using their name. Some examples: $\alpha_2^{n+1}$, $\Gamma(2)$, $\zeta(3)$ and $$a^2 + b^2 = c^2$$ ===== roots=Square roots, cube roots, etc $\sqrt{2}$, $\root 3\of{x+1}$. $$ \sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1}}}} $$ ===== binop=Binary operators Don't use `x', use times: $2 \times 2 = 4$. There are lots of other binary operators: $ a \le b \le c$. And some more: $A_i \otimes A_j \subseteq A_{i+j}$. ===== frac=Fractions Plain \TeX\ uses an `over' command, while La\TeX\ has a 'frac' command. Just for now, we provide both. $${1\over3} + \frac{1}{6} = \frac{1}{2}$$ ===== contfrac=Continued fractions A good part of the trick here is to use `displaystyle'. $$ a + \frac{1}{\displaystyle b + \frac{1}{\displaystyle c + \frac{1}{d}}}$$ Here's what it looks like without the `displaystyle'. $$ a + \frac{1}{b + \frac{1}{c + \frac{1}{d}}}$$ ===== para=Setting paragraphs Use blank lines to separate paragraphs. Use blank lines to separate paragraphs. Use blank lines to separate paragraphs. Use blank lines to separate paragraphs. Use blank lines to separate paragraphs. Use blank lines to separate paragraphs. Use blank lines to separate paragraphs. Use blank lines to separate paragraphs. ===== cases=Displaying several cases Depending on the value of $d = b^2 -4ac$, a the number $n$ of roots is: $$n = \cases{2&if $d >0$ (two real roots)\cr 1&if $d = 0$ (one double root)\cr 0&if $d <0$ (no real roots)\cr }$$ ===== matrices=Matrices $$A = \pmatrix{a&b&c\cr d&e&f\cr g&h&i\cr}$$ ===== delim=Delimiters that grow Compare $$(q - \frac{1}{p})^n \quad{\rm with}\quad \left(q - \frac{1}{p}\right)^n$$. Compare $$\left\lfloor \sum_{k=1}^n \frac{1}{k} \right\rfloor \quad{\rm with}\quad \lfloor \sum_{k=1}^n \frac{1}{k} \rfloor $$ ===== eqalign=Aligned equations $$\eqalign{ (a+b)(a-b) &= a^2 -ab + ba - b^2\cr &= a^2 - b^2\cr }$$ ===== greek=Greek letters Well there's $\alpha$, $\beta$, $\gamma$ and $\delta$. And $\epsilon$, $\zeta$, $\eta$ and $\theta$. And $\iota$, $\kappa$, $\lambda$ and $\mu$. And quite a few more. A table would be nice.