Inessential L^{A}TEX ^{∗}

(Revision 4.26)

                          http://stuff.mit.edu/sipb/ilatex

The Student Information Processing Board

May 17, 2007

∗Copyright \begin{matrix}c \\ ◯ \end{matrix} 1987–2007 Student Information Processing Board of the Massachusetts Institute of Technology

Inessential L^{A}TEX

Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 What is L^{A}TEX ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 L^{A}TEX on Athena . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 3 Creating your Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3.1 In the Beginning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.2 Title Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3.3 Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.4 Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.5 Ending the Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Processing your Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4.1 Running L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4.2 Previewing the Final Output . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4.3 Printing the File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4.4 Producing PDFs and Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . 9

4.4.1 pdflatex limitations and specifics . . . . . . . . . . . . . . . . . . . . 9 4.4.2 Web documents from LaTeX source . . . . . . . . . . . . . . . . . . 9

4.5 Landscape (or Sideways) Mode . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.6 Using Both Sides of the Paper: Duplex and Tumble Modes . . . . . . . . . . 10

5 Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5.1 L^{A}TEX errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.2 TEX errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.3 Warnings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

6 Other useful things to know about . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6.1 Margins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6.2 Type Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6.3 Type Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6.4 Footnotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6.5 Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6.6 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

7 Documents in Foreign Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 8 Mathematical Text and other Special Symbols . . . . . . . . . . . . . . . . . . . . . 17 9 Pretty Pictures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

9.1 Including PostScript and PDF Files . . . . . . . . . . . . . . . . . . . . . . . 25 9.2 L^{A}TEX picture Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

10 Citations and References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 11 Setting Page Layout Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 12 Where to Get More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 13 Converting from L^{A}TEX 2.09 to L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . 29 14 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 15 List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 16 List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

Revision 4.26  ii  MIT SIPB

1 Introduction

1.1 What is L^{A}TEX ?

L^{A}TEX is a complex text-processing system often recommended by the SIPB and used for scholarly publishing all over academia, and by many of your professors.

There are L^{A}TEX manuals available for use in the SIPB office, and you’re welcome to drop by the office with a question. There are also manuals available for short-time loan from the OLC (On-Line Consultants) office (N42) and some available for withdrawal from the MIT Libraries. There is also plenty of documentation online (see Section 12 on p. 27).

If you have any comments, additions or corrections to this manual, please send them to sipb@mit.edu or drop by the SIPB office (W20-557) and let us know.

L^{A}TEX works by processing a text source file containing formatting commands, and produces high-quality output. This source file is created by you, using a text editor. This separation between editing and processing is a major difference between L^{A}TEX and word processors like Microsoft Word or OpenOffice, as well desktop publishing software like Adobe InDesign or Quark XPress, all of which are “WYSIWYG”^{1} tools.

A major advantage to L^{A}TEX’s non-WYSIWYG interface is the ability to manage your document as raw text under a revision control system such as RCS or CVS, as well as the ability to exercise precise control over the output in ways that WYSIWYG systems often do not allow. It is also much easier to produce complex equations.

1.2 L^{A}TEX on Athena

You can run L^{A}TEX on any Athena workstation. Instructions for setting up your environment and running L^{A}TEX on these platforms are given in Section 4 (p. 8) of this document. To get more information on using other software available on the Athena workstations, see the Getting Started on Athena document available from MIT Copy Tech, and the Inessential Guide to Athena available from the SIPB office (W20-557).

Versions of L^{A}TEX can be obtained many other types of machines. However, many L^{A}TEX distributions for popular platforms are commercial packages, and their features and usage may differ. Hopefully, your L^{A}TEX package will come with some instructions for setting it up and running it.

The version of L^{A}TEX described in this document is version L^{A}TEX 2ε, which is the version currently supported by Athena and SIPB. Version 2.09 is still available in the newtex locker under the name latex209. Section 11 of this document describes the differences between the two versions.

2 Getting Started

This section describes how to typeset a simple paper in the standard way for processing by L^{A}TEX. All of the information here is also presented elsewhere in this document, but with a lot more detail; think of this section as “the short form” to using L^{A}TEX.

1What You See Is What You Get

The first thing you need to do is to create your L^{A}TEX source file. This file contains all the text for your paper as well as L^{A}TEX commands (to be described shortly). You can use any editor you wish to create the file; documentation on how to use text editors is available from Athena. Emacs includes special code set up to make using L^{A}TEX easier, and is a good first choice. You can name your L^{A}TEX file anything you wish; the only requirement is that it end with the four characters .tex.

The general format of a L^{A}TEX file is shown in the following example.

\documentclass{article}
\usepackage[doublespacing]{setspace}
\usepackage{fullpage}
\title{A Sample Paper}
\author{Melissa I. Thompson}
\date{June 16, 1904}
\begin{document}
\maketitle
It was a dark and stormy night, and all of the Athena fileservers had
crashed.  Poor me, I had to write a paper for one of my HASS-D
classes.
Luckily, I was able to use a wonderful text formatting program called
\LaTeX{}, and everything worked out fine.
\end{document}

Here is a description of each part.

• The first line of every L^{A}TEX file contains a \documentclass command. This command tells L^{A}TEX the general style of your document as well as the style “options” you wish to use. The word in between {curly braces} is the main style. You can specify options for the style in square brackets before the main style. For example, \documentclass[12pt]{article} would use article document class in 12 point type.

• The \usepackage commands specifies additional packages or to use. For example, the doublespace package tells L^{A}TEX to doublespace your document, and the fullpage option says to set the margins so you have one inch of blank space on all sides. You can supply options to these packages in square brackets as well: \usepackage[doublespacing]{setspace}

• The \title, \author, and \date commands are used to specify the title, author and creation date of the document. The default date is \today (meaning that you don’t need to give the \date command if you just want to use the current date).

• The \begin{document} line marks the beginning of the main part of the document. The section before this line is called the preamble. More on this later.

• The \maketitle line tells L^{A}TEX to insert a title page in the beginning of your document. The data from each of the \title, author, and \date commands is used here.

• \LaTeX{} is a special command in L^{A}TEX, used to represent the appropriate magic so that you see “L^{A}TEX” instead of “LaTeX.”

• The \end{document} line marks the end of the main part of the document. In L^{A}TEX, something between \begin{foo} and \end{foo} is said to be in the foo environment (more on environments later).

3 Creating your Document

For L^{A}TEX to know that you are writing a document, you have to give it some information first. This section describes what you need to have in a file to run it through L^{A}TEX.

3.1 In the Beginning…

A typical file, such as a term paper, will begin like this:

\documentclass{article}
\begin{document}

This tells L^{A}TEX the following things:

• This example is an article. The article style may be used for any kind of standard paper. An article is shorter than a report.^{2} The book style also exists. It is meant for real books. These options control section headings and tables of contents and other things.

• The main text is printed in a 10 point font by default. There are several text sizes available: 10, 11, and 12 point. This document is printed in 11 point. The various type sizes within a document are relative to this base size, as described in subsection 6.3 (p. 14). If no base size is specified, 10 point is assumed. To change to a base size of 11 point or 12 point, change the document class with an optional parameter, placed inside square braces immediately after the command name, like this:

\documentclass[11pt]{article}

• There are many other optional parameters which can be used, some of which will be mentioned later. They are all entered inside the square brackets and are separated by commas, with no spaces in between. For example,

\documentclass[twoside,11pt]{report}
\usepackage[doublespacing]{setspace}

sets the document up as an 11-point, double-spaced, double-sided report.

2This L^{A}TEX guide is a report.

• The space between the \documentclass and the \begin{document} commands is called the header area or preamble. Various control parameters, such as the layout of the title page (if you want one) go here. The actual text of your document begins after the \begin{document}.

There are many packages and options which may be included with the \usepackage line or as an option to \documentclass. Packages can also take options, which are specified in square brackets before the package name. You can include multiple packages with a single \usepackage command. For example, \usepackage[red,blue]{foo,bar} would include the packages foo and bar, giving the red and blue options to both. Some of the common packages are:

setspace Allows for doublespaceing; defines \doublespacing, \singlespacing, and

\onehalfspacing for changing document spacing. Also allows them as options. fullpage Sets up 1 inch margins.^{3} geometry Enables commands to simplify modifying the margins. This gives more flexibility than

th fullpage package. graphicx Allows you to include PostScript graphics. See Section 9.1 (p. 25 or texdoc grfguide). latexsym Defines several symbols not defined by default in L^{A}TEX 2ε. See Figure 5 (p. 19) for a

list of these symbols, or texdoc symbols. quiet Will tell L^{A}TEX to run in “quiet” mode, suppressing warning messages.

mathptmx To format the entire document (with math) in Times Roman font. times To format the non-math portions of the document in Times Roman font. palatino To format the non-math portions of the document in Palatino font. helvet To format the non-math portions of the document in Helvetica font. ncs To format the non-math portions of the document in New Century Schoolbook font. avantgarde To format the non-math portions of the document in Avant-Garde font. bookman To format the non-math portions of the document in Bookman font.

For detailed documentation on most packages, try texdoc packagename . For an overview of most installed packages, see texdoc index.html. For details on the fonts, texdoc psnfss2e.

Some standard options for L^{A}TEX’s documentclasses:

twocolumn Will print text in two vertical columns, side by side.

3.2 Title Page

To put a title page into a document, you could type the following:

\documentclass{report}
\title{Inessential \LaTeX{}}
\author{The Student Information Processing Board}
\date{January 1, 1969} % If you use \today, the date may change inadvertently.

3Both fullpage and simplemargins (see below) are explained in detail in Section 6.1, p. 13.

\begin{document}
\maketitle

Creating a title page is a two step process in L^{A}TEX. First you give it the information you want it to put on the title page and then you tell it to make the title page. The \title, \author and \date commands do not generate text—they merely specify what \maketitle will place on the title page. If you use \maketitle, you must specify a \title, but any or all of the others may be omitted. The \maketitle command generates the title page. You must place it after the \begin{document}. In the article document style, the title block is at the top of the first page of the document. To put the title block on a page by itself place a \newpage command after the \maketitle. In the report and book styles, it is on a separate page at the beginning.

L^{A}TEX will automatically number pages, but often you don’t want a page number on the title page. To eliminate the page number on the first page, put \thispagestyle{empty} before the

\maketitle.

It is possible to number pages alphabetically or with Roman numerals. It is also possible to change the current page number. See the section of the L^{A}TEX manual on page styles.

You can also generate a title page using the titlepage environment. Anything placed in this environment will be placed on the title page (which will be a separate page even if you are using the article document class). Another good way to create a title page is to do it yourself, probably using commands like \begin{center}, \large{}, and \newpage. Using this method, L^{A}TEX won’t know the difference between your title page and any other page, but it may be easier to get what you want.

3.3 Body

The body of the document can be normal text. Paragraphs are separated by completely blank lines or by the \par command.

Special characters When entering normal text, you must watch out for a few things. Some characters are reserved for commands to L^{A}TEX, and are treated as such unless you tell L^{A}TEX to treat them as normal characters. To use the characters

# $ % & _{ }

outside of a verbatim environment (see Section 6 for more information on environments, p. 13), you must precede them with a backslash (\), like this:

\# \$ \% \& \_\{ \}

These characters are also reserved:

~ ^\ < >

Often, if you think you want one of these characters, you probably want to do something else.

• ~ can be produced in several ways. If you want a tilde over a character, like ñ, you can type \~{n} or \~n. If you want a mathematical ∼ you can type $\sim$ (which stands for similar to). More often you will want the ∼ within another math expression anyhow; for more detail see Section 8, p. 17.

• ^can likewise mean circumflex, as in ô which is produced with \^{o} or \^o. In math mode you would use \hat{o} to indicate a unit vector.

• \ is not used very often in normal writing, but you can type $\backslash$ if you want to use it.

• < and > can be written as $<$ and $>$. If you insert these symbols in your document without quoting them as described here, they will appear as upside-down exclamation points (¡) and question marks (¿).

Quotation Marks Ever notice how typeset material always has nice quotation marks, for example, “this” instead of ”this”? L^{A}TEX can generate these fancy quotes with just a little effort on your part. The “ character, used to start a quotation, is made by typing ``. Note that these are reverse quote, or “back-tick” characters, usually found on the upper-left hand side of PC-style keyboards (however, Sun keyboards puts it in the upper right). The ” character is made by typing ''. In Emacs, the default mode for L^{A}TEX files (called tex-mode) will generate the proper characters when you press the " key. Emacs’s latex-mode is automatically loaded when you load a file ending in .tex that has a \documentclass command near the top.

Divisions Text can be divided into parts, chapters,^{4} sections, subsections, subsubsections, paragraphs, and subparagraphs. Each division has its own L^{A}TEX command (\section, \subsection, etc.). These commands produce the appropriate headings and entries in the table of contents, as well as numbering the divisions. For normal use, you probably want to use section, subsection, and paragraph. The section paragraph is different from the command \par. A section command places the title you give it in bold at the beginning of the paragraph. The \par command simply marks the beginning of the paragraph, as would a blank line.

For example, in this document you are currently reading:

\section{Creating Your Document}
... things that are in the section ...
\subsection{Body}
... things that are in the subsection ...
\paragraph{Divisions}
... things that are in the paragraph ...

If you don’t want the division to be numbered in the document, include an asterisk (*) after the division name (e.g. \subsection*{Body}).

4Chapters are available within book and report but not in article, so that an article can be included as a chapter.

Table of Contents Since L^{A}TEX already has all of this information about the structure of the document, it can easily collect it and build a table of contents. It will only do this if you explicitly tell it to. L^{A}TEX will put the table of contents wherever you include the line: \tableofcontents

To put the table of contents at the beginning (where people expect to find it) just put it in after the \maketitle command. You should run L^{A}TEX at least twice after you add the table of contents, since it takes two or three tries to get the table of contents right—once to write all the page numbers out to a file^{5}, and a second time to include those numbers at the beginning of the document, and possibly a third time if the number of pages the table of contents occupies changes.

When you make major changes, L^{A}TEX may tell you that you need to run it twice. It is always a good idea to do this before you print the final version of a document, just to make sure everything is correct.

3.4 Environments

You can change how L^{A}TEX treats a certain section of text (for instance changing the type style). In L^{A}TEX lingo, you need to indicate the scope of the command you are using to change the environment. For small sections of text, this is done by starting the environment with a left curly brace { character, followed by the command to change the defaults, and ending with the right curly brace } character.

For example, to make appear in a larger font, you could type {\Large larger font}. This limits the scope of the large command to the environment within the braces.

An environment can also be delimited with a begin–end pair. This is quite useful for larger sections of text. For example, to center multiple lines of text (here on the left), you could use the commands on the right:

like these two,

                                          \begin{center}
                                          like\\
                                          these two,
                                          \end{center}

The \\ at the end of the second line tells L^{A}TEX to break the line at that point, rather than filling the text completely between the two margins like it normally does. It allows you to force lines to end when you want them to, rather than when L^{A}TEX wants them to.

3.5 Ending the Document

The last thing to put in the document is the line: \end{document}

L^{A}TEX ignores anything which follows the \end{document} command. The only text after this should be comments, since you have now finished your document.

5This information is stored in the file ending in .aux, which some people remove between invocations of L^{A}TEX.

This causes L^{A}TEX to have to repeat a lot of work, so you should avoid doing this until you’re sure that you won’t be re-running L^{A}TEX again in the near future.

4 Processing your Document

Once you have written your file and entered all the necessary L^{A}TEX commands, you have to process the file before previewing or printing it.

A graphical frontend to L^{A}TEX named LyX is also available in the lyx locker.

4.1 Running L^{A}TEX

You can process a L^{A}TEX file by typing: latex filename.tex where filename.tex is the name of your file that you want to process. L^{A}TEX produces an output file named filename.dvi (a device independent file), which can be converted and printed on various types of printers.

4.2 Previewing the Final Output

It is usually convenient to preview your document before printing it. Running xdvi filename& creates a window which shows you what the file will look like when it is printed on the printer. After you position the xdvi window on your screen, it should show the first page of the document. You can use this like the more command: hit space to go forward a page, and b to go back a page. This way you can go back and forth between the xdvi previewer and the L^{A}TEX source, rerunning L^{A}TEX and looking at the xdvi display each time (xdvi automatically notices that you’ve changed something, and displays the newest output).

4.3 Printing the File

When you are ready to print out the file, you must convert from dvi format to the format of the printer you are using. To translate filename.dvi to PostScript^{6} and send it to your default printer,

use the command: dvips filename.dvi

If you have no default printer^{7} or you want to send the printout to a specific printer use the

command: dvips -Pprintername filename.dvi

replacing printername with the name of the printer to which you want to send your document.

It is possible to obtain the intermediate PostScript file with the command:

dvips -o filename.ps filename.dvi

It is possible to select particular pages out of a document, if you are making changes and want to see what they will look like on paper (note that xdvi gives a very accurate rendition, and should be enough for most purposes). The command:

dvips -pfirst -llast -Pprintername filename.dvi

will print from the page numbered “first” to the page numbered “last.”

For more information on dvips, type man dvips (for the manual page, brief), or texdoc dvips (for the full documentation). The older dvi2ps program no longer exists on Athena.

6PostScript is the “language” understood by Athena printers, and many others.

7You can check this by typing lpq and noting what printer it lists.

4.4 Producing PDFs and Web Pages

The Adobe Portable Document Format is now the lingua franca of much of the world; L^{A}TEX has several way to produce PDF documents (whichever you choose, be sure to inspect the PDF file to make sure it came out ok):

1. Typing pdflatex filename.tex will run a special version of the L^{A}TEX interpreter that handles PDF files and produce filename.pdf. It the easiest choice, but it has some limitations with respect to included images; see below.

2. If the other methods gets a symbol wrong (as may happen), try the longer approach of creating a PostScript file and producing the PDF from that. Create the PostScript file with dvips -P pdf -G/ 0 file.dvi. On Sun machines, you can create the PDF with Adobe’s commercial software with add acro; distill file.ps; on other machines, you must use the free software equivalent, add gnu; ps2pdf file.ps.

3. The dvipdfm utility will produce a PDF file from a DVI file. First latex filename.tex to produce the DVI file, and then dvipdfm filename.dvi to produce the PDF. See texdoc dvipdfm for the full documentation^{8}; it cannot include most PostScript images without special care.

4.4.1 pdflatex limitations and specifics

See texdoc pdftex for a full explanation of pdflatex. The most striking limitation is that pdflatex cannot import PostScript images – instead, you need an image in PDF, PNG, JPEG, or TIFF format.

To put figures in your document, you can make them available to pdflatex as their own PDFs, using epstopdf (see Section 9.1, p. 25).

To encode hypertext references in your PDF, you can use the hyperref package and use \href{URL}{text} in the same way you write the equivalent HTML prose.

   To put in your own PDF bookmarks, use \pdfbookmark[n]{title}{internal label}, with

internal label serving as a label for any \ref references you want to put in.

4.4.2 Web documents from LaTeX source

The latex2html program, available on the Web and on Athena in the infoagents locker, is a Perl script that generates a set of HTML pages from a Latex document. It can make a single Web page, or a set of them, with a page for each section, subsection or so on and so forth. To generate a Web page set based in the directory dstdir, from a document file.tex, type latex2html -d dstdir file.tex. This will generate a whole tree of HTML files for each subsection. The control how deep the tree should go, there is the -split option. For a single HTML page, set it as -split 0. For more information, type latex2html -help.

8Do not confuse dvipdfm with the dvipdf program in the ghostscript locker, which actually runs dvips and ps2pdf.

4.5 Landscape (or Sideways) Mode

If you want to print your document “sideways,” with the text running parallel to the long edge of the paper, simply include

\special{landscape}

in the preamble of your document. You also need to set the margins to correspond to this new paper size (11x8.5′′ instead of 8.5x11′′). See Section 6.1 for details on changing them, p. 13.

4.6 Using Both Sides of the Paper: Duplex and Tumble Modes

Two-sided printing has two modes. In duplex printing, the pages are printed such that the pages read correctly when turned over the long axis (as in a book). In tumble mode (also known as shortedge duplexing), pages read correctly when turned upwards (as in a legal notepad). The orientation will obviously be somewhat different if the printout is landscape mode instead of portrait mode. For most uses, the duplex mode is the more fitting.

With dvips, you can print in duplex or tumble mode by using the -h option:

dvips -h duplex filename.dvi
or dvips -h tumble filename.dvi

If you always want your document to be printed two-sided, you can include one of the following commands in your document preamble:

\special{header=duplex}
\special{header=tumble}

5 Error Messages

The error messages produced by L^{A}TEX are the most confusing part of using it. Most people have trouble understanding what L^{A}TEX is telling them. This section describes some of the more common errors, what they mean, and how you can fix the problem.

In general, when an error occurs you should hit return to see if L^{A}TEX will keep on going, or enter x to exit. If L^{A}TEX is asking for a filename, Control-D will help exit L^{A}TEX. If x, ^C, and ^D do not return you to your athena% prompt, type ^Z. In order to kill the stopped process you need to do the following (assuming that you use csh or one of its descendants):

athena% kill %latex
athena%
[1]  + Terminated           latex
athena%

By hitting return when you get your prompt back you should get the message that L^{A}TEX was indeed killed.

5.1 L^{A}TEX errors

There are two kinds of errors: L^{A}TEX errors and TEX errors. TEX is the language in which L^{A}TEX is written, and some of the basic errors come from there. All errors have an error message which starts with an exclamation point. A L^{A}TEX error can be distinguished from a TEX error by the following:

! LaTeX error: <error message here>
See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

The error message is printed on the next line, which starts with a number and then the text of the line that caused the error. The part of the number after the decimal point is the line number where the error occurred. If you cannot figure out what the problem is by looking at the error message, you can go to the offending line in the original document and look at it. The problem may lie a few lines above the one which L^{A}TEX complained about. The error message should make more sense after you have looked at the offending text.

Some of the more common error messages are:

! \begin{...} ended by \end{...}.

This is usually caused by forgetting to end an environment which was started by a \begin command.

!  Can be used only in preamble.

Certain commands can only be entered before the \begin{document} statement. This part of the file is called the preamble. Move the offending statement to the preamble and try again.

!  Environment ... undefined.

An environment defined in a \begin or \end statement is not recognized. This is usually caused by a spelling error.

!  Missing \begin{document}.

All files must have a \begin{document} before any text which is intended to be printed.

5.2 TEX errors

!  I can't find file `...'.

This often indicates that the file name was mistyped or that you are not in the correct directory. TEX will wait for you to type in a file name. If a mistake was made, and you want to abort the command, you will need to hit ^D which will cause an “Emergency stop” when TEX is waiting for you to type something.

!  Missing { inserted.
!  Missing } inserted.

!  Missing $ inserted.

This usually occurs if a command was typed which can only be used in math mode. L^{A}TEX can be allowed to continue, but the output will look strange. The offending command should be put into math mode by surrounding it with dollar signs, like: $\sum$

! Undefined control sequence.
l.7 \auhtor{The Student Information Processing Board}

The command \auhtor on line seven is misspelled and so L^{A}TEX does not recognize it. If L^{A}TEX does not recognize a command you used, but you think it exists, check the documentation again to make sure you are using the command correctly.

If you cannot figure out what is wrong, give the SIPB office a call,^{9} or try the Athena Consultants.^{10} The Zephyr help class is also often useful; see the document Inessential Zephyr for more details on using zephyr classes and instances.

5.3 Warnings

Warnings do not cause L^{A}TEX to stop processing the document, but preview the output before printing your final version to make sure the output is acceptable. Below are some common warnings, followed by explanations. In general, TEX is probably more of a perfectionist about wanting to get your spacing right than you are, so you shouldn’t worry if it complains about overfull/underfull when it looks fine to you.

Overfull \hbox (24.30751pt too wide) in paragraph at lines 6--9

This occurs whenever a line is too wide the available horizontal space (e.g. margins, or special boxes). L^{A}TEX will produce a line that is too wide when it cannot find an acceptable place to insert a line break. Use xdvi to look at the output, then change the file if necessary.

Underfull \hbox (badness 10000) in paragraph at lines 6--18

9Our phone number is 253-7788, or stop by W20-557—just outside the Student Center cluster.

10On-line, type olc or call 253-4435.

This error is similar to Overfull \hbox. It occurs when L^{A}TEX is forced to put lots of space between words to justify the text. This usually happens when a paragraph is not properly ended before certain kinds of environments (like forcing a carriage return with \\). Inserting a blank line or a \par command after the offending paragraph should fix it.

LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.

This occurs when page numbers change from one running of L^{A}TEX to another. Simply re-run L^{A}TEX to resolve the problem. Occasionally, L^{A}TEX will have to be run twice in a row to clear up the problem.

6 Other useful things to know about

L^{A}TEX is very powerful. There are commands to do almost anything. This guide is an attempt to explain many of the commonly used commands. Below you will find information that should help you produce papers with L^{A}TEX.

6.1 Margins

L^{A}TEX has very large default margins—almost two inches wide on each side. Most people don’t like them.^{11} Fortunately, L^{A}TEX’s margins can be changed. An easy way to use more of the page is to use the fullpage option to documentclass (see Section 3.2, p. 5).

   To set uniform margins, use the geometry package: \usepackage[margin=1.5in]{geometry}

For nonuniform margins, these options are available:

\usepackage[top=.8in,bottom=.8in,left=1in,right=2.54cm]{geometry}

For full details, see texdoc geometry.

6.2 Type Styles

There are several different type styles available in L^{A}TEX: bold (textbf), sans serif (textsf), slanted (textsl), small caps (textsc), typewriter (texttt), italic (textit), and the default, roman (textrm). In general, italics should be produced with \emph{} rather than \textit{}.^{12}

To use one of these type styles simply use the appropriate command as shown in the following example.

The following lines: Are produced by:

This is bold type.  \textbf{This is bold type.}
This is sans serif type.  \textsf{This is sans serif type.}
This is italic type.  \textit{This is italic type.}

11… but people writing books or theses often need them.

12This is because \emph{} is about logical structure, and \textit{} is about a visual property. In some contexts, the visual properties associated with emphasis may change, and text formatted as \emph{} will change appropriately.

This is slanted type.  \textsl{This is slanted type.}
This is Small Caps type.  \textsc{This is Small Caps type.}
This is typewriter type.       \texttt{This is typewriter type.}
This is normal, roman, type.  \textrm{This is normal, roman, type.}

You will notice that there is no underline style. This is intentional, since underlining is not normally used in a typeset document. Titles (and other text normally underlined in hand-written documents) are properly emphasized with the \emph command.^{13}

6.3 Type Sizes

The type size can be controlled as well. If you want to change the size as well as the style, you must set the size first, and then the style; to get a large bold type style, type {\large\bf text}.

The following sizes: Are produced by:

This is tiny type.  {\tiny This is tiny type.}
This is scriptsize type.  {\scriptsize This is scriptsize type.}
This is footnotesize type.  {\footnotesize This is footnotesize type.}
This is small type.  {\small This is small type.}
This is normalsize type.  {\normalsize This is normalsize type.}
This is large type.  {\large This is large type.}
This is Large type.  {\Large This is Large type.}
This is LARGE type.  {\LARGE This is LARGE type.}
This is huge type.  {\huge This is huge type.}
This is Huge type.  {\Huge This is Huge type.}

6.4 Footnotes

Footnotes are very easy in L^{A}TEX. You simply place the footnote text where you want the reference to appear and L^{A}TEX takes care of everything else. This sentence and footnote^{14} were created by typing the following:

This sentence and footnote\footnote{See? It's a footnote.} were created
by typing the following.

Don’t use footnotes for citations though. See Section 10 (p. 26) for details.

6.5 Tables

L^{A}TEX has a simple method for generating all sorts of tables. You give it one command to tell it how to set up the table and then give it the data. You specify how many columns the table is going to have, what to do to the data within each column as well as how to separate each column. When you enter the data you give one row at a time. The character “&” comes after each data field and “\\” marks the end of a row. Here are several examples of what is possible and how to create them.

13If you really want to get \underline{underlining}, L^{A}TEX supports \underline\{text to be underlined\}, but that command is “fragile” and doesn’t break across lines. A better choice is \usepackage{ulem}, which defines \uline{text}, and several others. For detailed documentation, see less `kpsewhich ulem.sty`.

14See? It’s a footnote.

a b  c
aa bb cccccc
aaa bbb  ccc

                                          \begin{tabular}{clr}
                                          a& b& c\\ aa& bb& cccccc\\
                                          aaa&
                                          bbb& ccc\\
                                          \end{tabular}

This is a table with three columns. In the first column the data are centered, in the second they are left justified and in the third they are right justified. This was done by entering {clr}. Changing what is in these curly braces changes the number of columns and how each one is formatted. Notice that the line breaks in the typed text make no difference to L^{A}TEX. Rows are separated by the \\ character and the columns within the rows are separated by the & character.

You can also have boxes around the table and lines separating the columns if you like. L^{A}TEX will put vertical lines wherever you put a | in the column specifications. L^{A}TEX has two commands for creating horizontal lines in tables. \hline creates a horizontal line across the whole table. \cline{m-n} creates a horizontal line from the beginning of column m to the end of column n.

a b  c
aa bb  cc
aaa bbb ccc

                                          \begin{center}
                                          \begin{tabular}{||c|l||r||}\hline
                                          a& b& c\\ \cline{2-3} aa& bb& cc\\
                                          \hline aaa&
                                          bbb& ccc\\ \hline\hline
                                          \end{tabular}
                                          \end{center}

6.6 Lists

There are four different types of lists in L^{A}TEX. The following is an example containing all four.

Enumerate will give you a numbered list.

1. You can nest lists in L^{A}TEX (a) You can even sub-nest lists

(b) and it changes how they are

counted

2. up to four levels deep

Itemize produces a list with bullets

• Some people like bullets.

• Others do not.

Description is what you use when you want to describe a list of items. This list of list environments is an example of a description. Notice that it will make the items you are describing appear in bold faced type.

List If you do not like any of these possibilities you can modify the list environment to create your own. See the L^{A}TEX manual for more information.

The following text was used to create the previous example (the entire example is columnized with the multicol package; see texdoc multicol). We have broken it up to add comments and explanations of some of the more obscure commands.

% The percent sign is the comment character in LaTeX.  LaTeX ignores
% everything on a line following a % character.
\begin{description}
% Notice the brackets and braces; {} are very different from [] in LaTeX
\item [Enumerate] will give you a numbered list.
\begin{enumerate}
\item You can nest lists in \LaTeX{}
\begin{enumerate}
\item You can even sub-nest lists
\item and it changes how they are counted
\end{enumerate}
\item up to four levels deep
\end{enumerate}
\item [Itemize] produces a list with bullets
\begin{itemize}
\item Some people like bullets,
\item while others do not.
\end{itemize}
\item [Description] is what you use when you want to describe a
list of items.  This list of \verb+list+ environments is an example of
a \verb+description+.
\item [List] If you do not like any of these possibilities you can
modify the \verb+list+ environment to create your own.  See the
\LaTeX{}  manual for more information.
\end{description}

7 Documents in Foreign Languages

L^{A}TEX is very useful for writing documents in foreign languages. L^{A}TEX can theoretically support any language. However, in reality, there is hyphenation support for only a few dozen. The standard version of L^{A}TEX supports the English language, and it can hyphenate most English words correctly. The English version can be used to produce foreign language documents, but be warned that hyphenation will be according to rules of the English language.

International characters Many Western languages use symbols and accents that do not appear in normal English. L^{A}TEX provides a convenient method of generating accents and other symbols.

Figure 1 shows accents that can be placed on any existing character—simply replace the o in the curly braces with the letter you wish to accent.

     ó \'{o} ò \`{o} ô \^{o} ö \"{o} õ \~{o} ō \={o} ȯ \.{o}
     ŏ \u{o} ǒ \v{o} ő \H{o} oo \t{oo} o̧ \c{o}  o. \d{o}  ō \b{o}

Figure 1: Accents

Some other foreign characters are encoded directly, when they cannot be built as combinations. Figure 2 shows foreign-language symbols which are available, and Figure 3 shows some special non-English symbols. Note that these characters cannot immediately be followed by other characters, so you must follow them with a space or with empty curly braces, as in:

Łukasiewicz invented prefix (Polish) notation.

which is produced by

\L{}ukasiewicz invented prefix (Polish) notation.

                    œ \oe Œ \OE æ \ae Æ \AE å \aa
                    Å \AA ø \o Ø \O ł \l Ł \L
                    ß \ss ¿ ?` ¡ !`

Figure 2: Foreign language symbols

           † \dag ‡ \ddag § \S ¶ \P  \begin{matrix}c \\ ◯ \end{matrix} \copyright £ \pounds

Figure 3: Special Language Symbols

8 Mathematical Text and other Special Symbols

Equations can be inserted into your text in several ways. Placing $… $ or \(… \) or \begin{math} … \end{math} around the mathematical expression or special symbol allows you to place it in a line of normal text. This will use the variable-sized symbols (see Table 7, p. 21; and Figure 6, p. 19), and adjust the size of the formula as necessary. It will also adjust other things. For example, to place ∑_{i=1}^{n} in a line of text, L^{A}TEX puts the “i = 1” to the right of the ∑ instead of underneath. Placing \[… \] or \begin{displaymath}… \end{displaymath} around the expression will center it and set it off from the rest of the text, using the larger symbols.

To create a simple equation, for example F = ma, you need only type $ F=ma $. For more advanced formulæ, like E = mc^{2}, you need to tell L^{A}TEX to superscript the 2. The ^character instructs L^{A}TEX to raise a superscript, and the _character instructs L^{A}TEX to lower a subscript.

For example, $ E=mc^2 $ is used to produce E = mc^{2}. Likewise $ x_{k+1} $ is used to produce x_{k+1}.

If you want to put more than one character in the superscript or subscript, you need to group them, using { and } as in the examples above. To print something with both superscripts and subscripts, like _{238}U^{+4}, just type $ _{238}U^{+4} $. Anything can go into the brackets, and L^{A}TEX will figure out what to do with it: x_{1997}^{35+9^{yz} +4_{z}} requires the hideous expression $x^{35+9^{y_{z}}+4_{z}}_{1997}$, but if you look carefully it should be clear what is happening. To get the prime (′) symbol in math mode, type an apostrophe ('). Try some complex expressions of your own, and see how easy they are to create. There are many symbols not found on the keyboard to help you in formatting just about any kind of formula. See Tables 2, 3, 5 and 6 (pp. 20-21) for symbols not found on the keyboard, like ±, ≥, and ℘.

Of course, not all expressions are polynomials. L^{A}TEX uses two special cases, \sqrt and \frac to create square roots (radical sign surrounding the entire expression) and fractions (one expression

over another with a dividing bar between them) respectively. The term \sqrt{1 − \frac{v^{2}}{c^{2}}} , commonly used in Lorentz transformations, is expressed as $\sqrt{1-\frac{v^2}{c^2}} $ in line. You might want it displayed as

\sqrt{1 − \frac{v^{2}}{c^{2}}}

instead, which is generated with \[\sqrt{1-\frac{v^2}{c^2}} \].

If the equation is more interesting, or if you want to refer to it later on, you might want to assign it a number by using the equation environment. The quadratic formula

x = \frac{−b ± \sqrt{b^{2} − 4ac}}{2a}  (1)

is displayed by

\begin{equation}
x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
\end{equation}

You can supply an optional argument to \sqrt, specifying a different root than 2. For example, the fourth root, \sqrt[4]{1024}, is expressed as \sqrt[4]\{1024\}.

Often in a mathematical equation you will want to use symbols instead of the standard italicized letters for variable names. You can add Greek letters by typing the command associated with the particular letter—see Table 1 on page 19.

Note that if you want to use Greek letters in normal text mode, you must place them in a math environment by surrounding them with $… $. You can also create function names with the 𝒞𝒜ℒℒℐ𝒢ℛ𝒜𝒫ℋ𝒴 font. This is treated like any type style change, such as \bf, but like the Greek letters, you can use it only in math mode, and you only have the 26 upper-case letters available (see Table 29, p. 25).

Sometimes, a formula contains text that should be set in roman type. For example, in the formula “log xy = log x + log y,” the word “log” is not italicized like the variables x and y. It would be inconvenient to have to exit math mode to type the text in normal roman type, so the most common function names are defined as special commands. If the desired command isn’t defined, you can use something like $x = \textrm{foo}$ to produce x = foo rather than x = foo. A formula such as cos^{2} x + sin^{2} x = 1 would be entered as $\cos^2 x + \sin^2 x = 1$. See Table 8 (p. 21) for a list of all the special commands which are typeset like this.

The modulus function is slightly different from the other special commands—it has two forms, a binary and a parenthesized one. See Figure 4 for an example of their usage. There are also various types of brackets and other delimiters available in math mode, as shown in Table 9 (p. 21). Certain accents and other diacritical marks are available in math mode. Some of these math mode accents are only available in math mode, while others are modified to work better in math mode. See Table 11 (p. 21) for examples.

                    a mod b  a \bmod b
                  (mod a + b) \pmod{a+b}

Figure 4: Modulus functions

The symbols in Figure 5 were provided by L^{A}TEX 2.09, but not by L^{A}TEX 2ε. You can access them by using the latexsym package.

℧ \mho  ⋈ \Join  □ \Box ◇ \Diamond ⇝ \leadsto
⊏ \sqsubset ⊐ \sqsupset ⊲ \lhd ⊴ \unlhd  ⊳ \rhd
⊵ \unrhd

Figure 5: Symbols available in the latexsym package

All of the tables on the succeeding pages are available online as texdoc symbols. Those whose captions refer to AMS require \usepackage{amsmath}.

α \alpha  θ \theta  o o  τ \tau
β \beta  ϑ \vartheta π \pi  υ \upsilon
γ \gamma  ι \iota  ϖ \varpi  ϕ \phi
δ \delta  κ \kappa  ρ \rho  φ \varphi
ϵ \epsilon  λ \lambda  ϱ \varrho  χ \chi
ε \varepsilon μ \mu  σ \sigma  ψ \psi
ζ \zeta  ν \nu  ς \varsigma ω \omega
η \eta  ξ \xi
Γ \Gamma  Λ \Lambda  Σ \Sigma  Ψ \Psi
Δ \Delta  Ξ \Xi  Υ \Upsilon Ω \Omega
Θ \Theta  Π \Pi  Φ \Phi

Table 1: Greek Letters

∫∫ ∫∫ \iint  ∫∫∫ ∫∫∫ \iiint  ∫ · · · ∫ ∫ ··· ∫ \idotsint

Figure 6: Variable-sized symbols only in amsmath

± \pm  ∩ \cap  ⋄ \diamond  ⊕ \oplus
∓ \mp  ∪ \cup  △ \bigtriangleup  ⊖ \ominus
× \times ⊎ \uplus  ▽ \bigtriangledown ⊗ \otimes
÷ \div  ⊓ \sqcap  ◁ \triangleleft  ⊘ \oslash
∗ \ast  ⊔ \sqcup  ▷ \triangleright  ⊙ \odot
⋆ \star  ∨ \vee  ⊲ \lhd^{∗}  ◯ \bigcirc
∘ \circ  ∧ \wedge  ⊳ \rhd^{∗}  † \dagger
• \bullet \ \setminus ⊴ \unlhd^{∗}  ‡ \ddagger
· \cdot  ≀ \wr  ⊵ \unrhd^{∗}  ⨿ \amalg
+ +  − -

∗ Not predefined in L^{A}TEX 2ε. Use one of the packages latexsym, amsfonts or amssymb. Table 2: Binary Operation Symbols

≤ \leq  ≥ \geq  ≡ \equiv ⊧ \models
≺ \prec  ≻ \succ  ∼ \sim  ⊥ \perp
⪯ \preceq  ⪰ \succeq  ≃ \simeq | \mid
≪ \ll  ≫ \gg  ≍ \asymp ∥ \parallel
⊂ \subset  ⊃ \supset  ≈ \approx ▷◁ \bowtie
⊆ \subseteq  ⊇ \supseteq    ≅ \cong  ⋈ \Join^{∗}
⊏ \sqsubset^{∗} ⊐ \sqsupset^{∗} ≠ \neq  ⌣ \smile
⊑ \sqsubseteq ⊒ \sqsupseteq  ≐ \doteq ⌢ \frown
∈ \in  ∋ \ni  ∝ \propto = =
⊢ \vdash  ⊣ \dashv  < <  > >
: :

∗ Not predefined in L^{A}TEX 2ε. Use one of the packages latexsym, amsfonts or amssymb. Table 3: Relation Symbols

    , ,  ; ;  : \colon . \ldotp · \cdotp

Table 4: Punctuation Symbols

← \leftarrow  ⟵ \longleftarrow  ↑ \uparrow
⇐ \Leftarrow  ⟸ \Longleftarrow  ⇑ \Uparrow
→ \rightarrow  ⟶ \longrightarrow  ↓ \downarrow
⇒ \Rightarrow  ⟹ \Longrightarrow  ⇓ \Downarrow
↔ \leftrightarrow  ⟷ \longleftrightarrow ↕ \updownarrow
⇔ \Leftrightarrow  ⟺ \Longleftrightarrow ⇕ \Updownarrow
↦ \mapsto  ⟼ \longmapsto  ↗ \nearrow
↩ \hookleftarrow  ↪ \hookrightarrow  ↘ \searrow
↼ \leftharpoonup  ⇀ \rightharpoonup  ↙ \swarrow
↽ \leftharpoondown  ⇁ \rightharpoondown  ↖ \nwarrow
⇌ \rightleftharpoons ⇝ \leadsto^{∗}

∗ Not predefined in L^{A}TEX 2ε. Use one of the packages latexsym, amsfonts or amssymb. Table 5: Arrow Symbols

Revision 4.26  20  MIT SIPB

. . . \ldots · · · \cdots     ⋮ \vdots  ... \ddots
ℵ \aleph ′  \prime  ∀ \forall  ∞ \infty
ℏ \hbar ∅ \emptyset ∃ \exists  □ \Box^{∗}
ı \imath ∇ \nabla  ¬ \neg  ◇ \Diamond^{∗}
ȷ \jmath √ \surd  ♭ \flat  △ \triangle
ℓ \ell  ⊤ \top  ♮ \natural  ♣ \clubsuit
℘ \wp  ⊥ \bot  ♯ \sharp  ♢ \diamondsuit
ℜ \Re  ∥ \|  \ \backslash ♡ \heartsuit
ℑ \Im  ∠ \angle  ∂ \partial  ♠ \spadesuit
℧ \mho^{∗} .  .  | |

∗ Not predefined in L^{A}TEX 2ε. Use one of the packages latexsym, amsfonts or amssymb. Table 6: Miscellaneous Symbols

         ∑ \sum  ⋂ \bigcap  ⨀ \bigodot
         ∏ \prod  ⋃ \bigcup  ⨂ \bigotimes
         ∐ \coprod ⨆ \bigsqcup ⨁ \bigoplus
         ∫ \int  ⋁ \bigvee  ⨄ \biguplus
         ∮ \oint  ⋀ \bigwedge

Table 7: Variable-sized Symbols

 \arccos  \cos   \csc  \exp  \ker     \limsup  \min  \sinh
 \arcsin  \cosh  \deg  \gcd  \lg      \ln      \Pr   \sup
 \arctan  \cot   \det  \hom  \lim     \log     \sec  \tan
 \arg     \coth  \dim  \inf  \liminf  \max     \sin  \tanh

Table 8: Log-like Symbols

  ( (  ) )  ↑ \uparrow  ⇑ \Uparrow
  [ [  ] ]  ↓ \downarrow  ⇓ \Downarrow
  { \{  } \}  ↕ \updownarrow ⇕ \Updownarrow
  ⌊ \lfloor ⌋ \rfloor ⌈ \lceil  ⌉ \rceil
  ⟨ \langle ⟩ \rangle / /  \ \backslash
  | |  ∥ \|

Table 9: Delimiters

} \rmoustache  { \lmoustache  } \rgroup     { \lgroup
| \arrowvert   ‖ \Arrowvert   | \bracevert

Table 10: Large Delimiters

â \hat{a}    á \acute{a}  ā \bar{a}  ȧ \dot{a}   ă \breve{a}
ǎ \check{a}  à \grave{a}  a⃗ \vec{a}  ä \ddot{a}  ã \tilde{a}

Table 11: Math mode accents

MIT SIPB  21  Revision 4.26

             ãbc \widetilde{abc}      âbc  \widehat{abc}
             \overleftarrow{abc} \overleftarrow\{abc\}  \overrightarrow{abc}  \overrightarrow\{abc\}
             \overline{abc} \overline\{abc\}       \underline{abc}  \underline\{abc\}
             \overbrace{abc} \overbrace\{abc\}      \underbrace{abc} \underbrace\{abc\}
             \sqrt{abc} \sqrt\{abc\}           \sqrt[n]{abc} \sqrt[n]\{abc\}
             f′  f'                   \frac{abc}{xyz}  \frac\{abc\}\{xyz\}

Table 12: Some other constructions

             ⌜ \ulcorner ⌝ \urcorner ⌞ \llcorner ⌟ \lrcorner

Table 13: AMS Delimiters

−−→ \dashrightarrow  ←−− \dashleftarrow  ⇇ \leftleftarrows  ⇆ \leftrightarrows
⇚ \Lleftarrow  ↞ \twoheadleftarrow ↢ \leftarrowtail  ↫ \looparrowleft
⇋ \leftrightharpoons  ↶ \curvearrowleft  ⟲ \circlearrowleft ↰ \Lsh
⇈ \upuparrows  ↿  \upharpoonleft  ⇃ \downharpoonleft ⊸ \multimap
↭ \leftrightsquigarrow ⇉ \rightrightarrows ⇄ \rightleftarrows ⇉ \rightrightarrows
⇄ \rightleftarrows  ↠ \twoheadrightarrow ↣ \rightarrowtail  ↬ \looparrowright
⇌ \rightleftharpoons  ↷ \curvearrowright  ⟳ \circlearrowright ↱ \Rsh
⇊ \downdownarrows  ↾  \upharpoonright  ⇂ \downharpoonright ⇝ \rightsquigarrow

Table 14: AMS Arrows

 ↚ \nleftarrow  ↛ \nrightarrow  ⇍ \nLeftarrow ⇏ \nRightarrow
 ↮ \nleftrightarrow ⇎ \nLeftrightarrow

Table 15: AMS Negated Arrows

                           𝟋 \digamma κ \varkappa

Table 16: AMS Greek

                        ℶ \beth ℸ \daleth ℷ \gimel

Table 17: AMS Hebrew

 ℏ \hbar  ℏ \hslash  △ \vartriangle ▽ \triangledown
 □ \square  ♢ \lozenge  Ⓢ \circledS  ∠ \angle
 ∡ \measuredangle ∄ \nexists  ℧ \mho  Ⅎ \Finv
 ⅁ \Game  𝕜 \Bbbk  ‵ \backprime  ∅ \varnothing
 ▲ \blacktriangle ▼ \blacktriangledown ■ \blacksquare ♦ \blacklozenge
 ⋆ \bigstar  ∢ \sphericalangle  ∁ \complement ð \eth
 ⧸ \diagup  ⧹ \diagdown

Table 18: AMS Miscellaneous

 ∔ \dotplus  ∖ \smallsetminus ⋒ \Cap  ⋓ \Cup
 ⊼ \barwedge  ⊻ \veebar  ⩞ \doublebarwedge ⊟ \boxminus
 ⊠ \boxtimes  ⊡ \boxdot  ⊞ \boxplus  ⋇ \divideontimes
 ⋉ \ltimes  ⋊ \rtimes  ⋋ \leftthreetimes ⋌ \rightthreetimes
 ⋏ \curlywedge ⋎ \curlyvee  ⊝ \circleddash  ⊛ \circledast
 ⊚ \circledcirc ▪ \centerdot  ⊺ \intercal

Table 19: AMS Binary Operators

≦ \leqq  ⩽ \leqslant  ⪕ \eqslantless  ≲ \lesssim
⪅ \lessapprox  ≊ \approxeq  ⋖ \lessdot  ≪ \lll
≶ \lessgtr  ⋚ \lesseqgtr  ⪋ \lesseqqgtr  ≑ \doteqdot
≓ \risingdotseq  ≒ \fallingdotseq  ∽ \backsim  ⋍ \backsimeq
⫅ \subseteqq  ⋐ \Subset  ⊏ \sqsubset  ≼ \preccurlyeq
⋞ \curlyeqprec  ≾ \precsim  ≾ \precapprox  ◁ \vartriangleleft
⊴ \trianglelefteq  ⊨ \vDash  ⊪ \Vvdash  ⌣ \smallsmile
⌢ \smallfrown  ≏ \bumpeq  ≎ \Bumpeq  ≧ \geqq
⩾ \geqslant  ⪖ \eqslantgtr  ≳ \gtrsim  ⪆ \gtrapprox
⋗ \gtrdot  ≫ \ggg  ≷ \gtrless  ⋛ \gtreqless
⪌ \gtreqqless  ≖ \eqcirc  ≗ \circeq  ≜ \triangleq
∼ \thicksim  ≈ \thickapprox  ⫆ \supseteqq  ⋑ \Supset
⊐ \sqsupset  ≽ \succcurlyeq  ⋟ \curlyeqsucc  ≿ \succsim
≿ \succapprox  ▷ \vartriangleright ⊵ \trianglerighteq ⊩ \Vdash
∣ \shortmid  ∥  \shortparallel  ≬ \between  ⋔ \pitchfork
∝ \varpropto  ◀ \blacktriangleleft ∴ \therefore  ϶  \backepsilon
▶ \blacktriangleright ∵ \because

Table 20: AMS Binary Relations

≮ \nless  ≰ \nleq  ⩽̸ \nleqslant  ≦̸ \nleqq
⪇ \lneq  ≨ \lneqq  ≨ \lvertneqq  ⋦ \lnsim
⪉ \lnapprox  ⊀ \nprec  ⪯̸ \npreceq  ⋨ \precnsim
⪹ \precnapprox  ≁ \nsim  ∤ \nshortmid  ∤ \nmid
⊬ \nvdash  ⊭ \nvDash  ⋪ \ntriangleleft ⋬ \ntrianglelefteq
⊈ \nsubseteq  ⊊ \subsetneq  ⊊ \varsubsetneq ⫋ \subsetneqq
⫋ \varsubsetneqq ≯ \ngtr  ≱ \ngeq  ⩾̸ \ngeqslant
≧̸ \ngeqq  ⪈ \gneq  ≩ \gneqq  ≩ \gvertneqq
⋧ \gnsim  ⪊ \gnapprox  ⊁ \nsucc  ⪰̸ \nsucceq
⪰̸ \nsucceq  ⋩ \succnsim  ⪺ \succnapprox  ≇ \ncong
∦ \nshortparallel ∦ \nparallel  ⊭ \nvDash  ⊯ \nVDash
⋫ \ntriangleright ⋭ \ntrianglerighteq ⊉ \nsupseteq  ⫆̸ \nsupseteqq
⊋ \supsetneq  ⊋ \varsupsetneq  ⫌ \supsetneqq  ⫌ \varsupsetneqq

Table 21: AMS Negated Binary Relations

            ⟅ \Lbag  ⟆ \Rbag  ⟅ \lbag  ⟆ \rbag
            \llceil        \rrceil        \llfloor     \rrfloor
            ⟦ \llbracket ⟧ \rrbracket

Table 22: stmaryrd Delimiters

⟸ \Longmapsfrom  ⟹ \Longmapsto  ⤆ \Mapsfrom  ⤇ \Mapsto
↗  \nnearrow  ↖  \nnwarrow  ↘ \ssearrow  ↙ \sswarrow
↓  \shortdownarrow ↑  \shortuparrow ← \shortleftarrow  → \shortrightarrow
⟵ \longmapsfrom  ↤ \mapsfrom  ⇽ \leftarrowtriangle ⇾ \rightarrowtriangle
⚡  \lightning  ⦈  \rrparenthesis      \leftrightarroweq ⇿ \leftrightarrowtriangle

Table 23: stmaryrd Arrows

                  \Arrownot    \Mapsfromchar    \Mapstochar
                  \arrownot    \mapsfromchar

Table 24: stmaryrd Extension Characters

\Ydown                  \Yleft                \Yright  ⅄ \Yup
⏀ \baro  ⑊ \bbslash  & \binampersand  ⅋ \bindnasrepma
⧆ \boxast  ◫ \boxbar  ⧈ \boxbox  ⧅ \boxbslash
⧇ \boxcircle  ⊡ \boxdot  □ \boxempty  ⧄ \boxslash
\curlyveedownarrow      \curlyveeuparrow      \curlywedgedownarrow      \curlywedgeuparrow
\fatbslash  ⨟ \fatsemi              \fatslash  ⫴ \interleave
⪦ \leftslice  ⩕ \merge  ⦵ \minuso                   \moo
\nplus  ⌽ \obar  □ \oblong  ⦸ \obslash
⧁ \ogreaterthan  ⧀ \olessthan            \ovee                     \owedge
⪧ \rightslice  ⫽ \sslash  ⫾ \talloblong  ◯ \varbigcirc
⋎ \varcurlyvee  ⋏ \varcurlywedge  ⊛ \varoast  ⦶ \varobar
⍉ \varobslash  ⊚ \varocircle  ⊙ \varodot  ⧁ \varogreaterthan
⧀ \varolessthan  ⊖ \varominus  ⊕ \varoplus  ⊘ \varoslash
⊗ \varotimes              \varovee              \varowedge  ⨉ \vartimes

Table 25: stmaryrd Binary Operators

          □ \bigbox  ⋎ \bigcurlyvee  ⋏ \bigcurlywedge
          ⫼ \biginterleave      \bignplus  ∥ \bigparallel
          ⨅ \bigsqcap  ▽ \bigtriangledown △ \bigtriangleup

Table 26: stmaryrd Large Binary Operators

\inplus          \niplus  ⪿ \subsetplus               \subsetpluseq
⫀ \supsetplus      \supsetpluseq ⊴ \trianglelefteqslant ⊵ \trianglerighteqslant

Table 27: stmaryrd Binary Relations

               ⋬ \ntrianglelefteqslant ⋭ \ntrianglerighteqslant

Table 28: stmaryrd Negated Binary Relations

Required package

             ABCdef \mathrm{ABCdef}
             ABCdef \mathit{ABCdef}
             ABCdef \mathnormal{ABCdef}
             ABC  \mathcal{ABC}

𝒜ℬ𝒞  \mathcal{ABC}  euscript with option: mathcal
\mathscr{ABC}  euscript with option: mathcr

             𝔄𝔅ℭ𝔡𝔢𝔣 \mathfrak{ABCdef}  eufrak

𝔸𝔹ℂ  \mathbb{ABC}  amsfonts or amssymb

Table 29: Math Alphabets

9 Pretty Pictures

9.1 Including PostScript and PDF Files

To import picture files into L^{A}TEX, you need to generate files in the Encapsulated PostScript format. Many programs, e.g. Matlab will create EPS files for you. Otherwise, the utility ps2epsi will convert any PS file into an EPS one for you (just type ps2ps filename.ps filename.eps).

Having done so, you have many packages at your disposal to import the file into your L^{A}TEX document. We recommend the graphicx package. An example of how it is used is below:

\usepackage{graphicx}
... ... ...
\begin{figure}
\label{ndas}
\includegraphics[scale=0.5]{ndas}
\caption{Nude, descending a staircase.}
\end{figure}

The scale directive is an example of one of the many things the includegraphics directive lets you do. The trim argument lets you make a picture of only a cropped portion of the imported file, and the angle and origin arguments let that cropped portion be rotated. For the full details,

see texdoc grfguide.

When latex looks at this section, it will go and find the file ndas.eps and put it in the image. For documents created with pdflatex, you can include other PDF files as figures, as well as .png, .gif, and .jpeg images. Conveniently enough, the above piece of L^{A}TEX code will prompt pdflatex to find the file ndas.pdf for making the image. You can use the epstopdf utility to convert PS to PDF. Matlab can also export PDF.

9.2 L^{A}TEX picture Environment

You can create pictures within L^{A}TEX using a limited set of picture symbols. These include vector, line, oval, and others. They are fairly difficult to use, and you have to set them up by hand. Fortunately, the xfig drawing utility (add graphics) and the dia diagram program (add dia) let you create such figures with your mouse and generate the L^{A}TEX code that will create them. Just use the export button and copy the resulting file into your L^{A}TEX document. For more information you should refer to the L^{A}TEX manual, and also SIPB’s Inessential Graphics on Athena.

This picture was made with the following L^{A}TEX

code.

   \begin{picture}(80,80)(0,0)
   \put(60,77){\vector(1,0){7}}
   \put(60,85){$\theta^+$}
   \put(60,40){\line(1,5){10}}
   \put(60,40){\line(0,1){50}}
   \put(60,40){\oval(40,40)[l]}
   \put(60,20){\line(0,1){40}}
   \put(0,40){\vector(1,0){40}}
   \put(0,43){flow}
   \end{picture}

[figure: θ^{+}; flow]

Another way to get pictures in your L^{A}TEX document is to use plain TEX commands. See The TeXbook and/or ask for more information.

10 Citations and References

Your document may require references from one section to another, references to figures, tables, or references to other documents in a bibliography. Once you begin to edit and re-edit your document, L^{A}TEX can keep track of those references better than you can yourself. For internal references, you start by using \label{foo22} anywhere you will later want to put a reference. In the source code for this guide, this section is marked \label{sec:cite}. The label must be unique. The conventional label for a section is the mark ‘sec’, then the semicolon, then a relevant keyword.

Once the section is labeled, you can put “Section~\ref{sec:cite} (p. \pageref{sec:cite})”

anywhere and it will always refer to Section 10 (p. 26) no matter how things get rearranged.

To build a bibliography of external references, some people use the BibTEX tool, but it is overkill for most users^{15}. Instead, use the thebibliography environment (the parameter in curly braces after \begin{thebibliography} should be the widest label you use, so L^{A}TEX can size the indentation appropriately.):

Practitioners of quantum gravity should read \cite{sokalhoax}.

⋮

\begin{thebibliography}{Sokal 96}
\bibitem[Sokal 96]{sokalhoax} Sokal, Alan. ``Transgressing the

15See texdoc btxdoc and man bibtex for details; BibTEX is most useful when citing the same references in multiple documents.

Boundaries, towards a formative hermeneutics of quantum gravity''.
\emph{Lingua Franca}: 1996.
\bibitem{1066} Sellar, W.C. \& R.J. Yeatman. \emph{1066 and
all that: a memorable history of England}. 1953. New York: E.P. Dutton.
\end{thebibliography}

Which then appears as:

Practitioners of quantum gravity should read [Sokal 96].

⋮

[Sokal 96] Sokal, Alan. “Transgressing the Boundaries, towards a formative hermeneutics of quantum gravity”. Lingua Franca: 1996.

[1] Sellar, W.C. & R.J. Yeatman. 1066 and all that: a memorable history of England. 1953. New York: E.P. Dutton.

If the optional [Sokol 96] label is omitted, then L^{A}TEXwill number your \bibitem entries for you.

11 Setting Page Layout Parameters

L^{A}TEX uses many parameters to layout a page. These parameters set the distance between the main text and margin notes, headers, and footers, among other things. To change the value of one of these parameters, you can use the \addtolength commands described in subsection 6.1 (p. 13). Figure 7 shows the layout for a printed page reduced to 65% of full size.

12 Where to Get More Information

For a detailed overview and links to common packages, try: texdoc index.html

For quick lookups of L^{A}TEX packages, use the texdoc command: texdoc packagename

L^{A}TEX: A Document Preparation System: User’s Guide & Reference Manual (Lamport) is a very useful book which goes into much more detail than we have attempted here, for those who wish to delve deeper into the intricacies of L^{A}TEX. It is highly recommended, and not very expensive, at least as far as reference books go (˜ $30). A Guide to L^{A}TEX: Document Preparation for Beginners and Advanced Users (Kopka and Daly) is also quite useful, and substantially more detailed.

Since Athena officially supports L^{A}TEX, you can ask questions about it using olc ask latex, and look through the OLC Stock Answers for the answers to other commonly asked questions (olc

answers or on the Web at http://web.mit.edu/answers/).

You may also wish to look at the online version of the L^{A}TEX user’s guide, which is particularly useful when converting documents to L^{A}TEX 2ε format: texdoc usrguide. The Not So Short Introduction to L^{A}TEX 2ε is also recommended: texdoc lshort.

If you’re looking for special symbols, the ones in this document are also available by typing texdoc symbols. The Comprehensive L^{A}TEX Symbol List, a 98-page wonder, is also avail-

[figure: 1in; 1in; A line of text. . .; Next line of text. . .; \baselinestretch×\baselineskip; \oddsidemargin; \evensidemargin; Page Text; Page Footer; \footheight; \footskip; \textwidth; \textheight→; \headheight; \headsep; \topmargin; Page Header; Margin note A; \marginparpush; Margin note B; \marginparwidth; \marginparsep]

Figure 7: Page layout parameters. able. SIPB’s office has a bound copy, and you can view it online (PDF or PS) by running texdoc symbols.html and clicking on the folder icon.

You can come by the SIPB office (in W20-557, just outside the Student Center cluster), or call us on the phone (617-253-7788), particularly if you have a more obscure or complicated question. As a last resort, The TEXbook describes the TEX typesetting system, which forms the basis for L^{A}TEX. It is significantly harder to understand than the L^{A}TEX manual.

CTAN, the Comprehensive TeX Archive Network, centered at http://www.ctan.org, is another good resource for L^{A}TEX information, and for such things as the L^{A}TEX templates required by various publishers and academic organizations.

13 Converting from L^{A}TEX 2.09 to L^{A}TEX 2ε

Converting documents from L^{A}TEX 2.09 format to L^{A}TEX 2ε format is fairly simple. The primary differences are that \documentstyle has been replaced with \documentclass, and that outside packages are included \usepackage.

Another change is that the commands such as {\tt} have been superseded by the commands of the form \texttt{}. L^{A}TEX 2ε also added the \textsuperscript command for use in normal text as an alternative to using math mode to generate superscripted text. See Section 12, above, for several additional sources of information which are useful in converting documents.

Running Previous Versions of L^{A}TEX The supported version of L^{A}TEX on Athena is currently L^{A}TEX 2ε, but there are usually separate installations of older versions available. Currently, L^{A}TEX 2.09 is available in the newtex locker. You can access it by typing:

add newtex
latex209 filename.tex

14 Acknowledgments

The original version of this document was written by Mark Eichin to give people a handy reference to the many symbols that L^{A}TEX supports, especially the math mode symbols. Most of his text and all of his tables were included in the guide that you are holding now.

The rest of the first edition of the guide was written and edited by Nancy Gilman, David Jedlinsky and Mary Vogt, with lots of comments (flamage) from SIPB members and other people who experimented with the early versions of the guide. Robert French perfected this document to produce Revision 1.

Later, Chee Chew, added more changes (with more input/flamage from SIPB members) to produce Revision 2.

Revision 3 was updated by Mark Eichin to cover the replacement of dvi2ps by the superior dvips, to acknowledge Athena’s support of L^{A}TEX, and to include further SIPB member comments. Subsequent changes have been made by Richard Barbalace, bert Dvornik, and Chad Brown, with the cheerful support of many SIPB members and prospectives.

Revision 4 was updated by Alex Rolfe to reflect the adoption of L^{A}TEX 2εas the default version on Athena. John Hawkinson made numerous edits and is the current document maintainer.

Thanks to John Kohl and Jean Marie Diaz for getting most of the original TEX and L^{A}TEX system running on Athena in the first place; without their efforts, this guide would be useless.

And, of course, thanks to Don Knuth, the author of TEX, and Leslie Lamport, the author of L^{A}TEX; they have done an incredible job.

15 List of Figures

1 Accents . . . . . . . . . . . . . . . . . 17 2 Foreign language symbols . . . . . . . 17 3 Special Language Symbols . . . . . . . 17 4 Modulus functions . . . . . . . . . . . 19 5 latexsym Symbols . . . . . . . . . . . 19 6 Variable-sized symbols only in amsmath 19 7 Page layout parameters. . . . . . . . . 28

16 List of Tables

1 Greek Letters . . . . . . . . . . . . . . 19 2 Binary Operation Symbols . . . . . . . 20 3 Relation Symbols . . . . . . . . . . . . 20 4 Punctuation Symbols . . . . . . . . . . 20 5 Arrow Symbols . . . . . . . . . . . . . 20 6 Miscellaneous Symbols . . . . . . . . . 21 7 Variable-sized Symbols . . . . . . . . . 21 8 Log-like Symbols . . . . . . . . . . . . 21 9 Delimiters . . . . . . . . . . . . . . . . 21 10 Large Delimiters . . . . . . . . . . . . 21 11 Math mode accents . . . . . . . . . . . 21 12 Some other constructions . . . . . . . 22 13 AMS Delimiters . . . . . . . . . . . . . 22 14 AMS Arrows . . . . . . . . . . . . . . 22 15 AMS Negated Arrows . . . . . . . . . 22 16 AMS Greek . . . . . . . . . . . . . . . 22 17 AMS Hebrew . . . . . . . . . . . . . . 22 18 AMS Miscellaneous . . . . . . . . . . . 22 19 AMS Binary Operators . . . . . . . . 23 20 AMS Binary Relations . . . . . . . . . 23 21 AMS Negated Binary Relations …. 23 22 stmaryrd Delimiters . . . . . . . . . . . 24 23 stmaryrd Arrows . . . . . . . . . . . . 24 24 stmaryrd Extension Characters …. 24 25 stmaryrd Binary Operators . . . . . . . 24 26 stmaryrd Large Binary Operators … 24 27 stmaryrd Binary Relations . . . . . . . 24 28 stmaryrd Negated Binary Relations . . 25 29 Math Alphabets . . . . . . . . . . . . 25