10:14 am    08/20/17

    August 2017       
Su Mo Tu We Th Fr Sa  
       1  2  3  4  5  
 6  7  8  9 10 11 12  
13 14 15 16 17 18 19  
_2_0 21 22 23 24 25 26  
27 28 29 30 31        
LaTEX is a document preparation system. I recommend using it to prepare any documents you expect people to read; its great strength over other systems is in typesetting mathematical equations.

I learned LaTEX from Diller's LaTEX: Line by Line, first edition. Unfortunately, it is somewhat old and only covers LaTEX 2.09. I haven't seen the second edition, but I am told that it is current and covers LaTEX 2ε.

In general, the best place to find anything LaTEX related is CTAN. The second place to look is TUG (the TeX Users Group). Don't forget to try google. If none of those places have what your looking for, I suggest you read the rest of this page.

Here is a large PDF file that lists many of LaTEX's symbols.

One of LaTEX's most useful environments that nobody knows about is tabbing. Here's a quick overview.

A great package for making diagrams within LaTEX is xypic. It has something of a learning curve, but it's worth the effort. Here is a tutorial and here is the full reference manual.
I've been looking pretty hard for (free) documentation of the TEX core, but I haven't had much luck yet. I tried Don Knuth's page and found nada. I found this page (mirror) which describes the TEX primitives. I still don't understand how the system comes together... if anyone has a good reference, please contact me.
To get inline math to look like display math, use \displaystyle. E.g.:
$\sum_{i=0}^\infty {1 \over i^2}$
$\sum\limits_{i=0}^\infty {1 \over i^2}$
$\displaystyle \sum_{i=0}^\infty {1 \over i^2}$

Here is the LaTEX code I include in the preamble of almost every LaTEX file I write to improve the margins:

If you want your LaTEX files to make nice PDFs with Type 1 fonts, searchable/highlightable text, etc., this is what you do:
1. Add ONE of the following lines to the preamble of your document:

This selects the font to use.

2. latex your file the normal way
   $ latex file.tex
3. Convert your DVI to PS using this command:
   $ dvips -Pcmz file.dvi -o
4. Convert your PS to PDF the normal way:
   $ ps2pdf output.ps
Without Type 1 fonts:

With Type 1 fonts:

Multiple-line subscripts and superscripts (shamelessly stolen from http://www.nada.kth.se/~carsten/latex/amsldoc/node51.html).

Include the amsmath package to use this!
The substack command can be used to produce a multi-line subscripts or superscripts:

\sum_{\substack{0\le i\le m\\ 0<j<n}} P(i,j)

produces a two-line subscript underneath the sum.

A slightly more general form is the subarray environment which allows you to specify that each line should be left-aligned instead of centered, as here:

\sum_{\begin{subarray}{l} i\in\Lambda\\ 0<j<n \end{subarray}} P(i,j)


I wrote a little package to help typeset pseudo-code in once. Percy has used it, so it must be good. It's based on that tabbing environment I mentioned above. Please enjoy: and let me know if you want any other features.