A not very Short Introduction to L^{A}TEX 2ε

Tobias Oetiker

Hubert Partl Irene Hyna Elisabeth Schlegl

Version 1.1 November 21, 1994

L^{A}TEX[1] is a typesetting system which is most suited to producing scientific and mathematical documents of high typographical quality. The system is also suitable for producing all sorts of other documents, from simple letters to complete books. L^{A}TEX uses TEX[2] as its formatting engine.

This short introduction describes L^{A}TEX 2ε and should be sufficient for most applications of L^{A}TEX. For a complete description of the L^{A}TEX system refer to [1, 3].

L^{A}TEX is available for most computers from the IBM PC upwards. On many university computer networks the system is already installed, ready to operate. Information on how to access the local L^{A}TEX installation should be provided in the Local Guide [4]. If you have problems getting started, ask the person who gave you this booklet. The scope of this document is not to tell you how to install and set up a L^{A}TEX system, but to teach you how to write your documents so that they can be processed by L^{A}TEX.

If you need to get hold of any L^{A}TEX related material, have a look in one of the CTAN ftp archives. For the US it is at ftp.shsu.edu, for Germany it is ftp.dante.de and for the UK it is ftp.tex.ac.uk. If you are not in one of these countries, choose the archive closest to you.

Much of the material used in this introduction comes from an Austrian introduction to L^{A}TEX 2.09 written in German by:

Hubert Partl <partl@mail.boku.ac.at>

Zentraler Informatikdienst der Universität für Bodenkultur Wien

Irene Hyna <bmwf.ac.at>

Bundesministerium für Wissenschaft und Forschung Wien

Elisabeth Schlegl <no email>

in Graz

If you are interested in the German document you can find a version updated

for L^{A}TEX 2ε by Jörg Knappen at CTAN:/tex-archive/info/lkurz

While preparing this document I asked for reviewers on comp.text.tex. I got a lot of response. The following individuals helped with corrections, suggestions and material to improve this paper. They put in a big effort to help me getting this document into its present shape. I would like to sincerely thank all of them.

David Carlisle, Chris McCormack, Rosemary Bailey, Robin Fairbairns, Alexandre Guimond, Neil Hammond, Rasmus Borup Hansen, Eric Jacoboni, Alan Jeffrey, Jörg Knappen, Maik Lehradt, Hubert Partl, John Refling, Mike Ressler, Cris Rowley, and Craig Schlenter.

If you have ideas for something to be added, removed or altered in this document, please let me know. I am especially interested in feedback from L^{A}TEX novices about which bits of this intro are easy to understand and which could be explained better.

Tobias Oetiker <tobias@ife.ee.ethz.ch or oetiker@dmu.ac.uk>

Electronics Laboratory, Swiss Federal Institute of Technology and Network Support Group, De Montfort University Leicester

The current version of this document will be available on

CTAN:/tex-archive/info/lshort

This document has been typeset with the L^{A}TEX 2ε article document class

Contents

1 Things You Need to Know 6

1.1 The Name of the Game . . . . . . . . . . . . . . . . . . . . . . 6 1.1.1 TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.1.2 L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.2 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.2.1 Author, Book Designer, and Typesetter . . . . . . . . 6 1.2.2 Layout Design . . . . . . . . . . . . . . . . . . . . . . 7 1.2.3 Advantages and Disadvantages . . . . . . . . . . . . . 7

1.3 L^{A}TEX Input Files . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3.1 Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3.2 Special Characters . . . . . . . . . . . . . . . . . . . . 9 1.3.3 L^{A}TEX Commands . . . . . . . . . . . . . . . . . . . . . 9 1.3.4 Comments . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.3.5 Input File Structure . . . . . . . . . . . . . . . . . . . 10

1.4 The Layout of the Document . . . . . . . . . . . . . . . . . . 11 1.4.1 Document Classes . . . . . . . . . . . . . . . . . . . . 11 1.4.2 Packages . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.4.3 Page Styles . . . . . . . . . . . . . . . . . . . . . . . . 15

2 Typesetting Text 16

2.1 Linebreaking and Pagebreaking . . . . . . . . . . . . . . . . . 16 2.1.1 Justified Paragraphs . . . . . . . . . . . . . . . . . . . 16 2.1.2 Hyphenation . . . . . . . . . . . . . . . . . . . . . . . 16

2.2 Special Characters and Symbols . . . . . . . . . . . . . . . . . 17 2.2.1 Quotation Marks . . . . . . . . . . . . . . . . . . . . . 17 2.2.2 Dashes and Hyphens . . . . . . . . . . . . . . . . . . . 17 2.2.3 Ellipsis ( …) . . . . . . . . . . . . . . . . . . . . . . . 18 2.2.4 Ligatures . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.2.5 Accents and Special Characters . . . . . . . . . . . . . 18

2.3 International Language Support . . . . . . . . . . . . . . . . . 19 2.4 The Space between Words . . . . . . . . . . . . . . . . . . . . 20 2.5 Titles, Chapters, and Sections . . . . . . . . . . . . . . . . . . 20 2.6 Cross References . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.7 Footnotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.8 Emphasised Words . . . . . . . . . . . . . . . . . . . . . . . . 22 2.9 Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

2.9.1 Quote, Quotation, and Verse . . . . . . . . . . . . . . 23 2.9.2 Itemise, Enumerate, and Description . . . . . . . . . . 24 2.9.3 Flushleft, Flushright, and Center . . . . . . . . . . . . 24 2.9.4 Printing Verbatim . . . . . . . . . . . . . . . . . . . . 25 2.9.5 Tabular . . . . . . . . . . . . . . . . . . . . . . . . . . 25

2.10 Floating Bodies . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3 Typesetting Mathematical Formulae 30

3.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.2 Grouping in Math Mode . . . . . . . . . . . . . . . . . . . . . 31 3.3 Building Blocks of a Mathematical Formula . . . . . . . . . . 31 3.4 Math Spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.5 Vertically Aligned Material . . . . . . . . . . . . . . . . . . . 35 3.6 Math Font Size . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.7 List of Mathematical Symbols . . . . . . . . . . . . . . . . . . 37

4 Specialities 44 4.1 Fonts and Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . 44 4.2 Spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

4.2.1 Line Spacing . . . . . . . . . . . . . . . . . . . . . . . 46 4.2.2 Paragraph Formating . . . . . . . . . . . . . . . . . . . 46 4.2.3 Horizontal Space . . . . . . . . . . . . . . . . . . . . . 47 4.2.4 Vertical Space . . . . . . . . . . . . . . . . . . . . . . . 47

4.3 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 4.4 Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.5 Including EPS Graphics . . . . . . . . . . . . . . . . . . . . . 50

List of Figures

1 A Minimal L^{A}TEX File . . . . . . . . . . . . . . . . . . . . . . 11 2 Example of a Realistic Journal Article . . . . . . . . . . . . . 11

List of Tables

1 Document Classes . . . . . . . . . . . . . . . . . . . . . . . . 12 2 Document Class Options . . . . . . . . . . . . . . . . . . . . . 13 3 Some of the Packages Distributed with L^{A}TEX . . . . . . . . . 14 4 The Predefined Page Styles of L^{A}TEX . . . . . . . . . . . . . . 15 5 Accents and Special Characters . . . . . . . . . . . . . . . . . 19 6 Float Placing Permissions . . . . . . . . . . . . . . . . . . . . 28 7 Math Mode Accents . . . . . . . . . . . . . . . . . . . . . . . 37 8 Lowercase Greek Letters . . . . . . . . . . . . . . . . . . . . . 37 9 Uppercase Greek Letters . . . . . . . . . . . . . . . . . . . . . 37 10 Miscellaneous Symbols . . . . . . . . . . . . . . . . . . . . . . 38 11 BIG Operators . . . . . . . . . . . . . . . . . . . . . . . . . . 38 12 Binary Operators . . . . . . . . . . . . . . . . . . . . . . . . . 38 13 Relation Symbols . . . . . . . . . . . . . . . . . . . . . . . . . 39 14 Arrows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 15 Delimiters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 16 Large Delimiters . . . . . . . . . . . . . . . . . . . . . . . . . 40 17 Non-Mathematical Symbols . . . . . . . . . . . . . . . . . . . 40 18 AMS Delimiters . . . . . . . . . . . . . . . . . . . . . . . . . . 40 19 AMS Negated Arrows . . . . . . . . . . . . . . . . . . . . . . 40 20 AMS Greek . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 21 AMS Hebrew . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 22 AMS Arrows . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 23 AMS Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . 41 24 AMS Binary Operators . . . . . . . . . . . . . . . . . . . . . . 42 25 AMS Binary Relations . . . . . . . . . . . . . . . . . . . . . . 42 26 AMS Negated Binary Relations . . . . . . . . . . . . . . . . . 43 27 Math Alphabets . . . . . . . . . . . . . . . . . . . . . . . . . . 43 28 Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 29 Font sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 30 Math fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 31 TEX Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 32 Index Key Syntax Examples . . . . . . . . . . . . . . . . . . . 49 33 Key Names for graphicx Package . . . . . . . . . . . . . . . . 51

1 Things You Need to Know

1.1 The Name of the Game

1.1.1 TEX

TEX is a computer program by Donald E. Knuth [2]. It is aimed at typesetting text and mathematical formulae.

TEX is pronounced “Tech,” with a “ch” as in the German word “Ach” or in Scottish “Loch.” In an ASCII environment TEX becomes TeX.

1.1.2 L^{A}TEX

L^{A}TEX is a macro package which enables authors to typeset and print their work at the highest typographical quality, using a predefined, professional layout. L^{A}TEX was originally written by Leslie Lamport [1]. It uses the TEX formatter as its typesetting engine.

Recently the L^{A}TEX package has been updated by the L^{A}TEX3 team, led by Frank Mittelbach, to include some long-requested improvements and to reunify all the patched versions which have cropped up since the release of L^{A}TEX 2.09 some years ago. To distinguish the new version from the old, it is called L^{A}TEX 2ε. This documentation deals with L^{A}TEX 2ε.

L^{A}TEX is pronounced “Lay-tech.” If you refer to L^{A}TEX in an ASCII environment you type LaTeX. L^{A}TEX 2ε is pronounced “Lay-tech two e” and

typed LaTeX2e.

1.2 Basics

1.2.1 Author, Book Designer, and Typesetter

To publish something, authors give their typed manuscript to a publishing company. A book designer of the publishing company then decides the layout of the document (column width, fonts, space before and after headings, …). The book designer writes his instructions into the manuscript and then gives it to a typesetter, who typesets the book according to these instructions.

A human book designer tries to find out what the author had in mind while writing the manuscript. He decides on chapter headings, citations, examples, formulae, etc. based on his professional knowledge and from the contents of the manuscript.

In a L^{A}TEX environment, L^{A}TEX takes the role of the book designer and uses TEX as its typesetter. But L^{A}TEX is “only” a program and therefore needs more guidance. The author has to provide additional information which describes the logical structure of his work. This information is written into the text as “L^{A}TEX commands.”

This is quite different from the WYSIWYG^{1} approach which most modern word processors such as Word for Windows or WordPerfect take. With these applications, authors specify the document layout interactively while typing text into the computer. All along the way, they can see on the screen how the final work will look when it is printed.

1What you see is what you get.

When using L^{A}TEX it is normally not possible to see the final output while typing the text. But the final output can be previewed on the screen after processing the file with L^{A}TEX. Then corrections can be made before actually sending the document to the printer.

1.2.2 Layout Design

Typographical design is a craft. Unskilled authors often commit serious formatting errors by assuming that book design is mostly a question of aesthetics—“If a document looks good artistically it is well designed.” But as a document has to be read and not hung up in a picture gallery, the readability and understandability is of much greater importance than the beautiful look of it. Examples:

• The font size and numbering of headings have to be chosen to make the structure of chapters and sections clear to the reader.

• The line length has to be short enough that it does not strain the eyes of the reader, while long enough to fill the page beautifully.

With WYSIWYG systems, authors often generate aesthetically pleasing documents with very little or inconsistent structure. L^{A}TEX prevents such formatting errors by forcing the author to declare the logical structure of his document. L^{A}TEX then chooses the most suitable layout.

1.2.3 Advantages and Disadvantages

A topic often discussed when people from the WYSIWYG world meet L^{A}TEX people, is “the advantages of L^{A}TEX over a normal word processor” or the opposite. The best thing you can do when such a discussion starts, is to keep a low profile, as it often gets out of hand. But sometimes you cannot escape …

The main advantages of L^{A}TEX over normal word processors are the following:

• Professionally crafted layouts are available which make a document really look as if “printed.”

• The typesetting of mathematical formulae is supported in a convenient way.

• The user only needs to learn a few easy to understand commands, which specify the logical structure of a document. They almost never need to tinker with the actual layout of the document.

• Even complex structures such as footnotes, references, table of contents, and bibliographies can be easily generated.

• For many typographical tasks not directly supported by basic L^{A}TEX, there exist free add-on packages. For example, packages are available to include PostScript graphics or to typeset bibliographies conforming to exact standards. Many of these add-on packages are described in The L^{A}TEX Companion [3].

• L^{A}TEX encourages authors to write well structured texts because this is how L^{A}TEX works—by specifying structure.

• TEX, the formatting engine of L^{A}TEX 2ε, is highly portable. Therefore the system runs on almost any hardware platform available.

L^{A}TEX also has some disadvantages:

• More resources (memory, disk-space, computing power) are required to run a L^{A}TEX system than a simple word processor. But things are getting better, as Word for Windows 6.0 needs even more disk space than a normal L^{A}TEX system. When it comes down to processor usage, L^{A}TEX beats any WYSIWYG system, as it only needs a lot of CPU time when a document is actually processed, while WYSIWYG packages hog the CPU all the time.

• Although within a predefined document layout some parameters can be adjusted, the design of a whole new layout is difficult and takes a lot of time.^{2}

1.3 L^{A}TEX Input Files

The input for L^{A}TEX is a plain ASCII text file. You can create it with any text editor. It contains the text of the document as well as the commands which tell L^{A}TEX how to typeset the text.

1.3.1 Spaces

“Whitespace” characters such a blank or the carriage return are treated uniformly as “space” by L^{A}TEX. Several consecutive whitespace characters are treated as one “space.” Whitespace at the start of a line is generally ignored.

An empty line between two lines of text defines the end of a paragraph. Several empty lines are treated the same as one empty line. The text below is an example. On the right hand side is the text from the input file and on the left hand side is the formatted output.

2Rumour says, that this is one of the key elements which will be addressed in the upcoming L^{A}TEX3 system

It does not matter whether you enter one or several spaces after a word.

An empty line starts a new paragraph.

                                  It does not matter whether you
                                  enter one or several     spaces
                                  after a word.
                                  An empty line starts a new
                                  paragraph.

1.3.2 Special Characters

The following symbols are reserved characters, that either have a special meaning under L^{A}TEX or are not available in all the fonts. If you enter them in your text directly, they will normally not print, but rather coerce L^{A}TEX to do things you did not intend.

     $ & % # _{ }  ~  ^\

As you will see, these characters can be used in your documents all the same by adding a prefix backslash:

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

The other symbols and many more can be printed in mathematical formulae or as accents with special commands.

1.3.3 L^{A}TEX Commands

L^{A}TEX commands are case sensitive and take one of the following two formats:

• They start with a backslash \ and then have a name consisting only of letters. Command names are terminated by a space, a number or a special character

• They consist of a backslash and exactly one special character.

L^{A}TEX ignores whitespace after commands. If you want to get a space after a command, you have to put either {} and a blank or a special spacing command after the command name.

I read that Knuth divides the people working with TEX into TEXnicians and TEXperts. Today is November 22, 1994.

                                  I read that Knuth divides the
                                  people working with \TeX{} into
                                  \TeX{}nicians and \TeX perts.\\
                                  Today is \today.

Some commands need a parameter which has to be given between curly braces { } after the command name. Some commands support optional parameters which are added after the command name in square brackets [ ].

You can lean on me!  You can \textsl{lean} on me!

Please, start a new line right here! Thank you!

                                  Please, start a new line
                                  right here!\linebreak[3]
                                  Thank you!

1.3.4 Comments

When L^{A}TEX encounters a % character while processing an input file, it ignores the rest of the present line. This is useful for adding notes to the input file, which will not show up in the printed version.

This is an example.

                                  This is an % stupid
                                  % Better: instructive <----
                                  example.

1.3.5 Input File Structure

When L^{A}TEX 2ε processes an input file it expects it to follow a certain structure. Thus every input file must start with the command

     \documentclass{...}

This specifies what sort of document you intend to write. After that, you can include commands which influence the style of the whole document or you can load packages which add new features to the L^{A}TEX system. To load such a package you use the command

     \usepackage{...}

When all the setup work is done^{3}, you start the body of the text with the command

     \begin{document}

Now you enter the text mixed with some useful L^{A}TEX commands. At the end of the document you add the

     \end{document}

3The area between \documentclass and \begin{document} is called preamble.

command, which tells L^{A}TEX to call it a day. Anything which follows this command will be ignored by L^{A}TEX.

Figure 1 shows the contents of a minimal L^{A}TEX 2ε file. A slightly more complicated input file is given in Figure 2.

1.4 The Layout of the Document

1.4.1 Document Classes

The first information L^{A}TEX needs to know when processing an input file is the type of document the author wants to create. This is specified with the

\documentclass command.
\documentclass[options]{class}

Here class specifies the type of document to be created. Table 1 lists the document classes explained in this introduction. The L^{A}TEX 2ε distribution

          \documentclass{article}
          \begin{document}
          Small is beautiful.
          \end{document}

Figure 1: A Minimal L^{A}TEX File

\documentclass[a4paper,11pt]{article}
\usepackage{latexsym}
\author{H.~Partl}
\title{Minimalism}
\frenchspacing
\begin{document}
\maketitle
\tableofcontents
\section{Start}
Well and here begins my lovely article.
\section{End}
\ldots{} and here it ends.
\end{document}

Figure 2: Example of a Realistic Journal Article provides additional classes for other documents including letters and slides. The options parameter customises the behaviour of the document class. The options have to be separated by commas. In Table 2 the most common options for the standard document classes are listed.

Example: The input file for this booklet starts with the line

     \documentclass[11pt,twoside,a4paper]{article}

it instructs L^{A}TEX to typeset the document as an article with a base fontsize of eleven points and to produce a layout suitable for double sided printing.

1.4.2 Packages

While writing your document, you will probably find that there are some areas where basic L^{A}TEX cannot solve your problem. If you want to include graphics, coloured text or source code from a file into your document, you need to enhance the capabilities of L^{A}TEX. Such enhancements are called packages. Packages are activated with the

 \usepackage[options]{package}

command. Where package is the name of the package and options is a list of keywords which trigger special features in the package. Some packages come with the L^{A}TEX 2ε base distribution (See Table 3). Others are provided separately. You may find more information on the packages installed at your site in your Local Guide [4]. Many important packages are described in The L^{A}TEX Companion [3].

Table 1: Document Classes

article for articles in scientific journals, presentations, short reports, program documentation, invitations, …

report for longer reports containing several chapters, small books, PhD theses, …

book for real books

Table 2: Document Class Options

10pt, 11pt, 12pt Sets the size of the main font for the document. If no option is specified, 10 pt is assumed.

a4paper, letterpaper, … Defines the papersize. The default size is

letterpaper. Besides that, a5paper, b5paper, executivepaper,

and legalpaper can be specified.

fleqn Typesets displayed formulae left-aligned instead centered.

leqno Places the numbering of formulae on the left hand side instead of the right.

titlepage, notitlepage Specifies whether a new page should be started after the document title or not. The article class does not start a new page by default, while report and book do.

twocolumn Instructs L^{A}TEX to typeset the document in two columns.

twoside, oneside Specifies whether double or single sided output should be generated. The classes article and report are single sided and the book class is double sided by default.

openright, openany Makes chapters begin either only on right hand pages or on the next page available. This does not work with the article class, as it does not know chapters. The report class by default starts chapters on the next page available and the book class starts them on right hand pages.

Table 3: Some of the Packages Distributed with L^{A}TEX

doc Allows the documentation of L^{A}TEX programs.

Described in doc.dtx and in The L^{A}TEX Companion [3].

exscale Provides scaled versions of the maths extension font.

Described in ltexscale.dtx.

fontenc Specifies which font encoding L^{A}TEX should use.

Described in ltoutenc.dtx.

ifthen Provides commands of the form ‘if… then do… otherwise do. . ..’ Described in ifthen.dtx and The L^{A}TEX Companion [3].

latexsym To access the L^{A}TEX symbol font, you should use the latexsym package. Described in latexsym.dtx and in The L^{A}TEX Companion [3]

makeidx Provides commands for producing indexes. Described in section refsec:indexing and in The L^{A}TEX Companion [3].

syntonly Processes a document without typesetting it. Described in syntonly.dtx and in The L^{A}TEX Companion [3]. This is useful for quick error checking.

tracefnt Allows you to control how much information about L^{A}TEX’s font loading is displayed. Described in The L^{A}TEX Companion [3].

1.4.3 Page Styles

L^{A}TEX supports three predefined header/footer combinations—so-called page styles. The style parameter of the

 \pagestyle{style}

command defines which one to use. Table 4 lists the predefined page styles.

It is possible to change the page style of the current page with the command

 \thispagestyle{style}

In The L^{A}TEX Companion [3] there is a description how to create your own headers and footers.

Table 4: The Predefined Page Styles of L^{A}TEX

plain prints the page numbers on the bottom of the page in the middle of the footer. This is the default page style.

headings prints the current chapter heading and the page number in the header on each page while the footer remains empty.

empty sets both the header and the footer to be empty.

2 Typesetting Text

2.1 Linebreaking and Pagebreaking

2.1.1 Justified Paragraphs

Often books are typeset with each line having the same length. L^{A}TEX inserts the necessary linebreaks and space between words by optimising the contents of a whole paragraph. If necessary it also hyphenates words that would not fit comfortably on a line. How the paragraphs are typeset depends on the document class. Normally the first line of a paragraph is indented and there is no additional space between two paragraphs. Refer to section 4.2.2 for more information.

In special cases it might be necessary to order L^{A}TEX to break a line: the commands \\ or \newline start a new line without starting a new paragraph. The command \\* additionally prohibits a pagebreak after the forced linebreak. The command \newpage starts a new page.

   The commands: \linebreak[n], \nolinebreak[n], \pagebreak[n]

and \nopagebreak[n] enable the author to influence their actions, with n being the strength of the influence from zero to four.

L^{A}TEX always tries to produce the best linebreaks possible. If it cannot find a way to break the lines which meets its high standards, it rather lets one line stick out on the right of the paragraph. L^{A}TEX then complains (“overfull hbox”) while processing the input file. This happens most often when L^{A}TEX cannot find a suitable place to hyphenate a word. By giving the \sloppy command you can instruct L^{A}TEX to lower its standards a little. It then prevents such over-long lines by increasing the inter-word spacing — even if the final output is not optimal. In this case a warning (“underfull hbox”) is given to the user. In most cases the result does not look too bad.

2.1.2 Hyphenation

L^{A}TEX hyphenates words whenever necessary. If the hyphenation algorithm does not find the correct hyphenation points you can remedy the situation by using the following commands, to tell TEX about the exception.

The command

 \hyphenation{word list}

causes the words listed in the argument to be hyphenated only at the points marked by “-”. This command should be given in the preamble of the input file and should only contain words built from normal letters. The case of the letters is ignored. The example below will alow “hyphenation” to be hyphenated as well as “Hyphenation”. No accented characters or symbols are allowed in the argument.

Example:

     \hyphenation{FORTRAN Hy-phen-a-tion}

The command \- inserts a discretionary hyphen into a word. This also becomes the only point hyphenation is allowed in this word. This command is especially useful for words containing special characters, because L^{A}TEX does not automatically hyphenate words containing accented characters.

I think this is: supercalifragilisticexpialidocious

                                  I think this is: su\-per\-cal\-%
                                  i\-frag\-i\-lis\-tic\-ex\-pi\-%
                                  al\-i\-do\-cious

Several words can be kept together on one line. The command

 \mbox{text}

causes its argument be kept together under all circumstances.

My phone number will change soon. It will be (0116) 2550 943.

The parameter filename should contain the name of the file.

                                  My phone number will change soon.
                                  It will be \mbox{(0116) 2550 943}.
                                  The parameter
                                  \mbox{\emph{filename}} should
                                  contain the name of the file.

2.2 Special Characters and Symbols

2.2.1 Quotation Marks

For quotation marks you should not use the " as on a typewriter. In publishing there are special opening and closing quotation marks.

“Please press the ‘x’ key.”  ``Please press the `x' key.''

2.2.2 Dashes and Hyphens

L^{A}TEX knows four kinds of dashes. You can access three of these with different numbers of consecutive dashes. The fourth kind is the mathematical minus:

daughter-in-law, X-rated pages 13–67 yes—or no? 0, 1 and −1

                                  daughter-in-law, X-rated\\
                                  pages 13--67\\
                                  yes---or no? \\
                                  $0$, $1$ and $-1$

The names for these dashes are: - hyphen, -- en-dash, --- em-dash and $-$ minus sign.

2.2.3 Ellipsis ( …)

On a typewriter a comma or a period takes the same amount of space as any other letter. In book printing these characters occupy only a little space and are set very close to the preceding letter. Therefore you can not enter “ellipsis” by just typing three dots, as the spacing would be wrong. Instead there is a special command for these dots. It is called

 \ldots

Not like that ... but like that: New York, Tokyo, Budapest, …

                                  Not like that ... but like that:\\
                                  New York, Tokyo, Budapest, \ldots

2.2.4 Ligatures

Some letter combinations are typeset not just by setting the different letters one after the other, but actually by using special symbols for these combinations.

ff fi fl ffi… instead of ff fi fl ffi …

These so-called ligatures can be prohibited by inserting a \mbox{} between the two letters in question. This might be necessary with words built from two words.

Not shelfful but shelfful

                                  Not shelfful\\
                                  but shelf\mbox{}ful

2.2.5 Accents and Special Characters

L^{A}TEX supports the use of accents and special characters from many languages. Table 5 shows all sorts of accents being applied to the letter o. Naturally other letters work too.

To place an accent on top of an i or a j, their dots have to be removed. This is accomplished by typing \i and \j.

Hôtel, naïve, élève, smørrebrød, ¡Señorita!, Schönbrunner Schloß Straße

                                  H\^otel, na\"\i ve, \'el\`eve,\\
                                  sm\o rrebr\o d, !`Se\~norita!,\\
                                  Sch\"onbrunner Schlo\ss{}
                                  Stra\ss e

2.3 International Language Support

If you need to write documents in languages other than English, L^{A}TEX must apply different hyphenation rules in order to produce correct output.

For many languages, these changes can be accomplished by using the babel package by Johannes Braams. To use this package, your L^{A}TEX system has to be specially configured. Your Local Guide [4] should give more information on this.

If your system is already appropriately configured, you can activate the babel package by adding the command

 \usepackage[language]{babel}

after the \documentclass command. Which languages your system supports should also be listed in the Local Guide.

For some languages Babel also specifies new commands, which simplify the input of special characters. The German language for example, contains a lot of umlauts (äöü). With Babel you can enter an ö by typing "o instead

of \"o.

Some computer systems allow you to input special characters directly from the keyboard. L^{A}TEX can handle such characters. There exist several packages which add support for special character encodings. When using such a package you should consider, that other people might not be able to display your input files on their computer, because they use a different encoding. For example, the German umlaut ä on a PC is encoded as 132 and on some Unix systems using ISO-LATIN 1 it is encoded as 228. Therefore, use these features with care.

Table 5: Accents and Special Characters

        ò \`o  ó \'o  ô \^o  õ \~o
        ō \=o  ȯ \.o  ö \"o
        ŏ \u o  ǒ \v o  ő \H o  o̧ \c o
        o. \d o    ō \b o oo \t oo
        œ \oe  Œ \OE  æ \ae  Æ \AE
        å \aa  å \aa  Å \AA
        ø \o  Ø \O  ł \l  Ł \L
        ı \i  ȷ \j  ¡ !`  ¿ ?`

2.4 The Space between Words

To get a straight right margin in the output, L^{A}TEX inserts varying amounts of space between the words. At the end of a sentence it inserts slightly more space, as this makes the text more readable. L^{A}TEX assumes that sentences end with periods, question marks or exclamation marks. If a period follows an uppercase letter this is not taken as a sentence ending since periods after uppercase letters are normally for abbreviations.

Any exception from these assumptions has to be specified by the author. A backslash in front of a space generates a space which will not be enlarged. A tilde (~) character generates a space which cannot be enlarged and which additionally prohibits a linebreak. The command \@ in front of a period specifies, that this period terminates a sentence even when it follows a uppercase letter.

Mr. Smith was happy to see her cf. Fig. 5 I like BASIC. What about you?

                                  Mr.~Smith was happy to see her\\
                                  cf.~Fig.~5\\
                                  I like BASIC\@. What about you?

The additional space after periods can be disabled with the command

 \frenchspacing

which tells L^{A}TEX not to insert any more space after a period than after ordinary character. This is very common in non-English languages. In this case the command \@ is not necessary.

2.5 Titles, Chapters, and Sections

To help the reader find his way through your work, you should divide it into chapters, sections, and subsections. L^{A}TEX supports this with special commands which take the section title as their argument. It is up to you to use them in the correct order.

For the article class the following sectioning commands are available:

     \section{...}           \paragraph{...}
     \subsection{...}        \subparagraph{...}
     \subsubsection{...}     \appendix

For the report and the book class you can use two additional sectioning commands:

     \part{...}              \chapter{...}

As the article class does not know about chapters, it is quite easy to add articles as chapters to a book. The spacing between sections, the numbering and the font size of the titles will be set automatically by L^{A}TEX.

Two of the sectioning commands are a bit special:

• The \part command does not influence the numbering sequence of chapters.

• The \appendix command does not take an argument. It just changes the chapter^{4} numbering to letters.

L^{A}TEX creates a table of contents by taking the section headings and page numbers from the previous run of the document. The command

 \tableofcontents

expands to a table of contents at the place where it is issued. A new document has to be processed (“L^{A}TEXed”) at least twice to get a correct table of contents.

All sectioning commands listed above also exist as starred versions. They generate section headings which will not show up in the table of contents and which will not get numbered. The command \section{Help} for example

would become \section*{Help}.

Normally the section headings show up in the table of contents exactly as they were entered in the text. Sometimes this is not possible, because the heading is to long to fit into the table of contents. The entry for the table of contents can therefore be specified as optional argument before the actual heading.

     \chapter[Read it! It's Exciting]{This is a very long
                      and especially boring title}

The title of the whole document is generated by issuing a

 \maketitle

command. The contents of the title has to be defined by the commands

 \title{...}, \author{...} and optionally \date{...}

before calling \maketitle. In the argument of \authors you can supply several names separated by \and commands.

An example for some of the above mentioned commands can be found in Figure 2 on page 11.

4For the article style the section numbering

2.6 Cross References

In books and reports and articles there are often cross references to figures, tables and special segments of text. L^{A}TEX provides the following commands for cross referencing

 \label{marker}, \ref{marker} and \pageref{marker}

Where marker is an identifier chosen by the user. L^{A}TEX replaces \ref by the number of the section, subsection, figure, table, or theorem where the corresponding \label command was issued. \pageref prints the page number of the corresponding \label command. Here also the numbers from the previous run are used.

A reference to this subsection looks like: “see section 2.6 on page 22.”

                                  A reference to this subsection
                                  \label{sec:this} looks like:
                                  ``see section~\ref{sec:this} on
                                  page~\pageref{sec:this}.''

2.7 Footnotes

With the command

\footnote{footnote text}

a footnote will be printed at the foot of the current page.

Footnotes^{a} are often used by people using L^{A}TEX.

aThis is a footnote

                                  Footnotes\footnote{This
                                    is a footnote} are often used
                                  by people using \LaTeX.

2.8 Emphasised Words

In manuscripts produced by typewriter, important words get \underline{underlined}. In printed books these words are emphasised. The command to switch to an emphasised font is called

Its argument is the text to be emphasised.

\emph{text}

If you use emphasising in an already emphasised text, then L^{A}TEX uses an upright font for emphasising.

                                  \emph{If you use
                                    \emph{emphasising} in an
                                    already emphasised text, then
                                    \LaTeX{} uses an
                                    \emph{upright} font for
                                    emphasising.}

2.9 Environments

To typeset special purpose text, L^{A}TEX defines many different environments for all sorts of formatting:

 \begin{name} text \end{name}

Where name is the name of the environment. Environments can be called several times within each other as long as the calling order is maintained.

     \begin{aaa}...\begin{bbb}...\end{bbb}...\end{aaa}

In the following sections all important environments are explained.

2.9.1 Quote, Quotation, and Verse

The quote environment is useful for quotes, important phrases and examples.

A typographical rule of thumb for the line length is:

No line should contain more than 66 characters.

That’s why multicolumn print is often used in newspapers.

                                  A typographical rule of thumb
                                  for the line length is:
                                  \begin{quote}
                                  No line should contain more than
                                  66~characters.
                                  \end{quote}
                                  That's why multicolumn print is
                                  often used in newspapers.

There are two similar environments: the quotation and the verse environments. The quotation environment is useful for longer quotes going over several paragraphs. The verse environment is useful for poems where the line breaks are important. The lines are separated by issuing a \\ at the end of a line and a empty line after each verse.

2 TYPESETTING TEXT 24

I know only one English poem by heart. It is about Humpty Dumpty.

Humpty Dumpty sat on a

wall: Humpty Dumpty had a great

fall. All the King’s horses and all

the King’s men Couldn’t put Humpty to-

gether again.

I know only one English poem by
heart. It is about Humpty Dumpty.
\begin{verse}
\scriptsize
Humpty Dumpty sat on a wall:\\
Humpty Dumpty had a great fall.\\
All the King's horses and all
the King's men\\
Couldn't put Humpty together
again.
\end{verse}

2.9.2 Itemise, Enumerate, and Description

The itemize environment is suitable for simple lists, the enumerate environment for enumerated lists, and the description environment for descriptions.

1. You can mix the list environments to your taste:

• But it might start to look silly.

• If you over-do it.

2. Therefore remember:

Stupid things will not become smart because they are in a list.

Smart things though, can be presented beautifully in a list.

\begin{enumerate}
\item You can mix the list
environments to your taste:
\begin{itemize}
\item But it might start to
look silly.
\item If you over-do it.
\end{itemize}
\item Therefore remember:
\begin{description}
\item[Stupid] things will not
become smart because they are
in a list.
\item[Smart] things though, can be
presented beautifully in a list.
\end{description}
\end{enumerate}

2.9.3 Flushleft, Flushright, and Center

The environments flushleft and flushright generate paragraphs which are either left or right aligned. The center environment generates centred text. If you do not issue \\ to specify linebreaks, L^{A}TEX will automatically determine linebreaks.

This text is left aligned. L^{A}TEX is not trying to make each line the same length.

                                  \begin{flushleft}
                                  This text is\\ left aligned.
                                  \LaTeX{} is not trying to make
                                  each line the same length.
                                  \end{flushleft}

This text is right

aligned. L^{A}TEX is not trying to make each line the same length.

                                  \begin{flushright}
                                  This text is right\\ aligned.
                                  \LaTeX{} is not trying to make
                                  each line the same length.
                                  \end{flushright}

At the centre of the earth

                                  \begin{center}
                                  At the centre\\of the earth
                                  \end{center}

2.9.4 Printing Verbatim

Text which is enclosed between \begin{verbatim} and \end{verbatim}

will be directly printed, as if it was typed on a typewriter, with all linebreaks and spaces, without any L^{A}TEX command being executed.

Within a paragraph, similar functionality can be accessed with

 \verb+text+

The + is just an example delimiter character. You can use any character except * or blank. Many L^{A}TEX examples in this booklet are typeset with this command.

The \ldots command …

10 PRINT "HELLO WORLD ";
20 GOTO 10

                                  The \verb|\ldots| command \ldots
                                  \begin{verbatim}
                                  10 PRINT "HELLO WORLD ";
                                  20 GOTO 10
                                  \end{verbatim}

The verbatim environment and the \verb command may not be used within parameters of other commands.

2.9.5 Tabular

The tabular environment can be used to typeset beautiful tables with optional horizontal and vertical lines. L^{A}TEX determines the width of the columns automatically.

The table spec argument of the

 \begin{tabular}{table spec}

command defines the format of the table. Use an l for a column of left aligned text, r for right aligned text and c for centred text, p{width} for a column containing justified text with linebreaks, and | for a vertical line.

Within a tabular environment & jumps to the next column, \\ starts a new line and \hline inserts an horizontal line.

7C0 hexadecimal
3700 octal
11111000000 binary
1984 decimal

                                  \begin{tabular}{|r|l|}
                                  \hline
                                  7C0 & hexadecimal \\
                                  3700 & octal \\
                                  11111000000 & binary \\
                                  \hline \hline
                                  1984 & decimal \\
                                  \hline
                                  \end{tabular}

Welcome to ‘Paragraph in a box.’ We sincerely hope you’ll all enjoy the show.

                                  \begin{tabular}{|p{4.5cm}|}
                                  \hline
                                  Welcome to `Paragraph in a
                                  box.' We sincerely hope
                                  you'll all enjoy the show.\\
                                  \hline
                                  \end{tabular}

With the @{...} construct it is possible to specify the column separator. This command kills the intercolumn space and replaces it with whatever is included in the curly braces. One common use for this command is explained below in the decimal alignment problem. Another possible usage is to suppress leading space in a table with @{}.

                                  \begin{tabular}{@{} l @{}}
                                  \hline
                                  no leading space\\\hline
                                  \end{tabular}

                                  \begin{tabular}{l}
                                  \hline
                                  leading space left and right\\
                                  \hline
                                  \end{tabular}

no leading space leading space left and right

Since there is no built-in way to align numeric columns on a decimal point^{5}, we can “cheat” and do it by using two columns: a right-aligned integer and a left-aligned fraction. The @{} command in the \begin{tabular} line replaces the normal intercolumn spacing with just a “.”, giving the appearance of a single, decimal-point-justified column. Don’t forget to replace the decimal point in your numbers with a column separator (&)! A column label can be placed above our numeric “column” by using the \multicolumn command.

Pi expression  Value
π  3.1416
π^{π}  36.46
(π^{π})^{π}  80662.7

                                  \begin{tabular}{c r @{.} l}
                                  Pi expression       &
                                  \multicolumn{2}{c}{Value} \\
                                  \hline
                                  $\pi$               & 3&1416  \\
                                  $\pi^{\pi}$         & 36&46   \\
                                  $(\pi^{\pi})^{\pi}$ & 80662&7 \\
                                  \end{tabular}

2.10 Floating Bodies

Today most publications contain a lot of figures and tables. These elements need special treatment because they cannot be broken across pages. One method would be to start a new page every time a figure or a table is too large to fit on the present page. This approach would leave pages partially empty which looks very bad.

The solution to this problem is to ‘float’ any figure or table, which does not fit on the current page, to a later page while filling the current page with body text. L^{A}TEX offers two environments for floating bodies. One for tables and one for figures. To take full advantage of these two environments it is important to understand approximately how L^{A}TEX handles floats internally. Otherwise floats may become a major source of frustration because they will simply never end up where where you want them to be.

Let’s first have a look at the commands L^{A}TEX supplies for floats:

Any material enclosed in a figure or table environment will be treated as floating matter. Both float environments support an optional parameter

\begin{figure}[placement specifier] or \begin{table}[placement specifier]

called the placement specifier. This parameter is is used to tell L^{A}TEX about the locations the float is allowed to go. A placement specifier is constructed by building a string of float placing permissions. See Table 6.

5If the ‘tools’ bundle is installed on your system, have a look at the dcolumn package

A table could be started with the following line for example

     \begin{table}[!hbp]

The placement specifier [!hbp] allows L^{A}TEX to place the table right here (h) or at the bottom (b) of some page or on a special floats page (p) and all that even if it does not look that good (!). If no placement specifier is given, the standard classes assume [tbp].

L^{A}TEX will place every float it encounters according to the placement specifier supplied by the author. If a float cannot be placed on the current page it is deferred either to the figures or the tables queue. When a new page is started, L^{A}TEX first checks if it is possible to fill a special ‘float’ page with floats from the queues. If this is not possible, the first float on each queue is treated as if they had just occurred in the text: L^{A}TEX tries again to place them according to their respective placement specifiers (except ‘h’ which is no longer possible). Any new floats occurring in the text get placed into the appropriate queues, because L^{A}TEX strictly maintains the original order of appearance for each type of float.

From the things said above it becomes clear, why a figure which cannot be placed, pushes all the further figures to the end of the document. Therefore:

If L^{A}TEX is not placing the floats as you expected, it is often only one float jamming one of the two float queues.

Having explained the difficult bit, there are some more things to mention about the table and figure environments. With the

\caption{caption text}

command you can define a caption for the float. A running number and the string “Figure” or “Table” will be added by L^{A}TEX.

Table 6: Float Placing Permissions

Spec Permission to place the float …

h here at the very place in the text where it occurred. This is

useful mainly for small floats.

t at the top of a page
b at the bottom of a page
p on a special page containing only floats.

! without considering most of the internal parameters^{a} which could stop this float from being placed.

aSuch as the maximum number of floats allowed on one page

The two commands

 \listoffigures and \listoftables

operate analogously to the \tableofcontents command, printing a list of figures or tables respectively. In these lists, the whole caption will be repeated. If you tend to use long captions, you must have a shorter version of the caption going into the lists. This is accomplished by entering the short version in brackets after the \caption command.

     \caption[Short]{LLLLLoooooonnnnnggggg}

With \label and \ref you can create a reference to a float within your text.

     Figure~\ref{white} is an example of Pop-Art.
     \begin{figure}[!hbp]
     \makebox[\textwidth]{\framebox[5cm]{\rule{0pt}{5cm}}}
     \caption{Five by Five in Centimetres} \label{white}
     \end{figure}

In the example above^{6} L^{A}TEX will try really hard (!) to place the figure right here (h). If this is not possible, it tries to place the figure at the bottom (b) of the page. Failing to place the figure on the current page, it determines if it is possible to create a float page containing this figure and maybe some tables form the tables queue. If there is not enough material for a special float page, L^{A}TEX starts a new page and once more treats the figure as if it had just occurred in the text.

Under certain circumstances it might be necessary to use the

 \clearpage

command. It orders L^{A}TEX to immediately place all floats remaining in the queues and then start a new page.

6assuming the figure queue is empty

3 TYPESETTING MATHEMATICAL FORMULAE 30

3 Typesetting Mathematical Formulae

3.1 General

L^{A}TEX has a special mode for typesetting mathematics. Mathematical text within a paragraph is entered between \( and \), between $ and $ or between

\begin{math} and \end{math}.

Add a squared and b squared to get c squared. Or using a more mathematical approach: c^{2} = a^{2} + b^{2}

Add $a$ squared and $b$ squared
to get $c$ squared. Or using
a more mathematical approach:
$c^{2}=a^{2}+b^{2}$

TEX is pronounced as τϵχ.

100 m^{3} of water

This comes from my ♡

\TeX{} is pronounced as
$\tau\epsilon\chi$.\\[6pt]
100~m$^{3}$ of water\\[6pt]
This comes from my $\heartsuit$

Larger mathematical equations or formulae are preferably typeset on separate lines. Therefore you enclose them between \[ and \] or between

\begin{displaymath} and \end{displaymath}. This produces formulae

which are not enumerated. If you want L^{A}TEX to enumerate them, you can use the equation environment.

Add a squared and b squared to get c squared. Or using a more mathematical approach:

c^{2} = a^{2} + b^{2}

And just one more line.

Add $a$ squared and $b$ squared
to get $c$ squared. Or using
a more mathematical approach:
\begin{displaymath}
c^{2}=a^{2}+b^{2}
\end{displaymath}
And just one more line.

With \label and \ref you can reference an equation within the text.

ϵ > 0  (1)

From (1) we gather …

\begin{equation} \label{eps}
\epsilon > 0
\end{equation}
From (\ref{eps}) we gather \ldots

The are diffrences between math mode and text mode. For example, in math mode:

1. Most spaces and linebreaks do not have any significance, as all spaces are either derived logically from the mathematical expressions or have to be specified using special commands such as \,, \quad or \qquad.

∀x ∈ R : x^{2} ≥ 0 (2)

                                     \begin{equation}
                                     \forall x \in \mathbf{R}:
                                     \qquad x^{2} \geq 0
                                     \end{equation}

2. Empty lines are not allowed. Only one paragraph per formula.

3. Each letter is considered to be the name of a variable and will be typeset as such. If you want to typeset normal text within a formula (normal upright font and normal spacing) then you have to enter the text using the \textrm{...} commands.

x^{2} ≥ 0 for all x ∈ R (3)

                                     \begin{equation}
                                     x^{2} \geq 0\qquad
                                     \textrm{for all }x\in\mathbf{R}
                                     \end{equation}

3.2 Grouping in Math Mode

Most math mode commands act only on the next character. So if you want several characters affected by a command you have to group them together using curly braces: {...}.

a^{x} + y ≠ a^{x+y} (4)

                                  \begin{equation}
                                  a^x+y \neq a^{x+y}
                                  \end{equation}

3.3 Building Blocks of a Mathematical Formula

In this section the most important commands used in mathematical typesetting will be described. For a list of all symbols available take a look at section 3.7 on page 37.

Lowercase Greek letters are entered as \alpha, \beta, \gamma, …, uppercase letters^{7} are entered as \Gamma, \Delta, …

7There is no uppercase Alpha defined in L^{A}TEX 2ε because it looks the same as a normal roman A. Once the new math coding is done, things will change.

λ, ξ, π, μ, Φ, Ω  $\lambda,\xi,\pi,\mu,\Phi,\Omega$

Exponents and Subscripts can be specified using the ^and the _ character.

a_{1}  x^{2}  e^{−αt}  a_{ij}^{3} e^{x^{2}} ≠ e^{x}^{2}

                                  $a_{1}$ \qquad $x^{2}$ \qquad
                                  $e^{-\alpha t}$ \qquad
                                  $a^{3}_{ij}$\\
                                  $e^{x^2} \neq {e^x}^2$

The square root sign is entered as \sqrt, the n^{th} root is generated with \sqrt[n]. The size of the root sign is determined automatically by L^{A}TEX.

\sqrt{x}  \sqrt{x^{2} + \sqrt{y}}  ^{3} \sqrt{2}

                                  $\sqrt{x}$ \qquad
                                  $\sqrt{ x^{2}+\sqrt{y} }$
                                  \qquad $\sqrt[3]{2}$

The commands \overline and \underline create horizontal lines directly over or under an expression.

\overline{m + n}  $\overline\{m+n\}$

The commands \overbrace and \underbrace create horizontal braces over or under an expression.

\underbrace{a + b + · · · + z}_{26}  $\underbrace\{ a+b+\cdots+z \}_\{26\}$

To add mathematical accents such as small arrows or tilde signs to variables you can use the commands given in Table 7. Wide hats and tildes, covering several characters are generated with \widetilde and \widehat. With the ' symbol you enter a dash.

y = x^{2}  y′ = 2x  y′′ = 2

                                  \begin{displaymath}
                                  y=x^{2}\qquad y'=2x\qquad y''=2
                                  \end{displaymath}

Often vectors are specified by adding small arrow symbols on top of a variable. This is done with the \vec command. To denote the vector from A to B the two commands \overrightarrow and \overleftarrow are useful.

a⃗ \overrightarrow{AB}

                                  \begin{displaymath}
                                  \vec a\quad\overrightarrow{AB}
                                  \end{displaymath}

Names of log-like functions are often typeset in an upright font and not italic as variables. Therefore L^{A}TEX supplies the following commands to typeset the most important function names:

\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

lim_{n→0} \frac{sin x}{x} = 1

                                  \[\lim_{n \rightarrow 0}
                                  \frac{\sin x}{x}=1\]

For the modulo function there are two commands: \bmod for the binary operator “a mod b” and \pmod for expressions such as “x ≡ a (mod b).”

A built-up fraction is typeset with the \frac{...}{...} command. Often the slashed form 1/2 is preferable, because it looks better for small amounts of ‘fraction material.’

1\frac{1}{2} hours \frac{x^{2}}{k + 1}  x^{\frac{2}{k+1}}  x^{1/2}

                                  $1\frac{1}{2}$~hours
                                  \begin{displaymath}
                                  \frac{ x^{2} }{ k+1 }\qquad
                                  x^{ \frac{2}{k+1} }\qquad
                                  x^{ 1/2 }
                                  \end{displaymath}

To typeset binominal coefficients or similar structures you can use either

the command {... \choose ...} or {... \atop ...}. The second com-

mand produces the same output as the first one, but without braces.

\binom{n}{k} {x \atop y + 2}

                                  \begin{displaymath}
                                  {n \choose k}\qquad {x \atop y+2}
                                  \end{displaymath}

The integral operator is generated with \int, the sum operator with \sum. The upper and lower limits are specified with ^and _as with subscripts and superscripts.

∑_{i=1}^{n} ∫0^{\frac{π}{2}}

                                  \begin{displaymath}
                                  \sum_{i=1}^{n} \qquad
                                  \int_{0}^{\frac{\pi}{2}} \qquad
                                  \end{displaymath}

For braces and other delimiters there exist all types of symbols in TEX (e.g. [ ⟨ ∥ ↕). Round and square braces can be entered with the corresponding keys, curly braces with \{, all other delimiters are generated with special commands (eg. \updownarrow).

a, b, c ≠ {a, b, c}

                                  \begin{displaymath}
                                  {a,b,c}\neq\{a,b,c\}
                                  \end{displaymath}

If you put the command \left in front of an opening delimiter or \right in front of a closing delimiter, TEX will automatically determine the correct size of the delimiter.

1 + (\frac{1}{1 − x^{2}} )^{3}

                                  \begin{displaymath}
                                  1 + \left( \frac{1}{ 1-x^{2} }
                                      \right) ^3
                                  \end{displaymath}

In some cases it is necessary to specify the correct size of a mathematical delimiter by hand, therefore you can use the commands \big, \Big, \bigg and \Bigg as prefixes to most delimiter commands^{8}.

((x + 1)(x − 1))^{2}_{(((( }}}} ∥∥∥∥}

                                  $\Big( (x+1) (x-1) \Big) ^{2}$\\
                                  $\big(\Big(\bigg(\Bigg($\quad
                                  $\big\}\Big\}\bigg\}\Bigg\}$\quad
                                  $\big\|\Big\|\bigg\|\Bigg\|$

To enter theer dots into a formula you can use several commands. \ldots typesets the dots on the baseline, \cdots sets them centred. Beside that there are the commands \vdots for vertical and \ddots for diagonal dots.

x_{1}, …, x_{n} x_{1} + ⋯ + x_{n}

                                  \begin{displaymath}
                                  x_{1},\ldots,x_{n} \qquad
                                  x_{1}+\cdots+x_{n}
                                  \end{displaymath}

3.4 Math Spacing

If the spaces within formulae chosen by TEX are not satisfactory, they can be adjusted by inserting special spacing commands. The most important are: \, for a tiny space, \ for a medium sized space (␣ stands for a “space” character), \quad and \qquad for large spaces and \! which shrinks a space.

8These commands do not work as expected if a size changing command has been used, or the 11pt or 12pt option has been specified. Use the exscale or amstex packages to correct this behaviour

∫∫_{D} dx dy instead of ∫ ∫_{D} dxdy

                                  \begin{displaymath}
                                  \int\!\!\!\int_{D} dx\,dy \quad
                                  \textrm{instead of} \quad
                                  \int\int_{D} dx dy
                                  \end{displaymath}

3.5 Vertically Aligned Material

To typeset arrays, use the array environment. It works somewhat similar to the tabular environment. The \\ command is used to break the lines.

X = ( \begin{matrix}x_{11} & x_{12} & … \\ x_{21} & x_{22} & … \\ ⋮ & ⋮ & ... \end{matrix} )

                                  \begin{displaymath}
                                  \mathbf{X} =
                                  \left( \begin{array}{ccc}
                                  x_{11} & x_{12} & \ldots \\
                                  x_{21} & x_{22} & \ldots \\
                                  \vdots & \vdots & \ddots
                                  \end{array} \right)
                                  \end{displaymath}

For formulae running over several lines or for equation systems you can use the environments eqnarray and eqnarray* instead of equation. In eqnarray each line gets a equation number. In the eqnarray* no line numbers are produced. For equation systems which should get one common number you can use the \nonumber command on all the lines which should not get a number.

The eqnarray and the eqnarray* environments work like a 3-column table of the form {rcl}, where the middle column can be used for the equal sign or the non-equal sign. The \\ command breaks the lines.

f(x) = cos x  (5)
f′(x) = − sin x (6)
∫_{0}^{x} f(y)dy = sin x  (7)

                                  \begin{eqnarray}
                                  f(x) & = & \cos x       \\
                                  f'(x) & = & -\sin x     \\
                                  \int_{0}^{x} f(y)dy &
                                   = & \sin x
                                  \end{eqnarray}

Long equations will not be automatically divided into neat bits. The author has to specify where to break them and how much to indent. The following two methods are the most common ones to achieve this.

sin x = x − \frac{x^{3}}{3!} + \frac{x^{5}}{5!} −_{− \frac{x^{7}}{7!} + ⋯ (8)}

                                  \begin{eqnarray}
                                  \sin x & = & x -\frac{x^{3}}{3!}
                                       +\frac{x^{5}}{5!}-{}
                                                      \nonumber\\
                                   & & {}-\frac{x^{7}}{7!}+{}\cdots
                                  \end{eqnarray}

cos x = 1 − \frac{x^{2}}{2!} +_{+ \frac{x^{4}}{4!} − \frac{x^{6}}{6!} + ⋯ (9)}

                                  \begin{eqnarray}
                                  \lefteqn{ \cos x = 1
                                       -\frac{x^{2}}{2!} +{} }
                                                      \nonumber\\
                                   & & {}+\frac{x^{4}}{4!}
                                       -\frac{x^{6}}{6!}+{}\cdots
                                  \end{eqnarray}

The \nonumber command causes L^{A}TEX not to generate a number for this equation.

3.6 Math Font Size

In math mode TEX normally switches the font size according to context. Superscripts for example get typeset in a smaller font. If you want to add roman text to an equation and use the \textrm command, the font size switching mechanism will not work, as \textrm temporarily escapes to text mode. Use \mathrm instead to keep the size switching mechanism active. But pay attention, \mathrm will only work well on short items. Spaces are still not active and accented charactes don’t work^{9}.

2nd 2^{nd} (10)

                                  \begin{equation}
                                  2^\textrm{nd} \quad
                                  2^\mathrm{nd}
                                  \end{equation}

Sometimes you need to tell L^{A}TEX about the correct font size nevertheless. In math mode the fontsize is set with the four commands:

\displaystyle (123), \textstyle (123), \scriptstyle (123) and
\scriptscriptstyle (123).

9The AMS-L^{A}TEX package makes the \textrm command work with size changing.

3.7 List of Mathematical Symbols

In the following tables you find all the symbols, normally accessible from math mode.

To use the symbols^{10} listed in Tables 18–26, the package amssymb must be loaded in the preamble of the document and the AMS math fonts must be installed on the system. If you want to install the AMS package, have a

look at CTAN:/tex-archive/macros/latex/packages/amslatex

Table 7: Math Mode Accents

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

Table 8: Lowercase Greek Letters

          α \alpha  ι \iota  ϱ \varrho
          β \beta  κ \kappa  σ \sigma
          γ \gamma  λ \lambda  ς \varsigma
          δ \delta  μ \mu  τ \tau
          ϵ \epsilon  ν \nu  υ \upsilon
          ε \varepsilon  ξ \xi  ϕ \phi
          ζ \zeta  o o  φ \varphi
          η \eta  π \pi  χ \chi
          θ \theta  ϖ \varpi  ψ \psi
          ϑ \vartheta  ρ \rho  ω \omega

Table 9: Uppercase Greek Letters

      Γ \Gamma  Ξ \Xi  Φ \Phi  Δ \Delta
      Π \Pi  Ψ \Psi  Θ \Theta  Σ \Sigma
      Ω \Omega Λ \Lambda Υ \Upsilon

10These tables were derived from symbols.tex by David Carlisle

3 TYPESETTING MATHEMATICAL FORMULAE 38

Table 10: Miscellaneous Symbols

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

aUse the latexsym package to access this symbol

Table 11: BIG Operators

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

Table 12: Binary Operators

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

3 TYPESETTING MATHEMATICAL FORMULAE 39

Table 13: Relation Symbols

You can produce corresponding negations by adding a \not command as prefix to the following symbols.

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

aUse the latexsym package to access this symbol

Table 14: Arrows

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

aUse the latexsym package to access this symbol

3 TYPESETTING MATHEMATICAL FORMULAE 40

Table 15: Delimiters

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

Table 16: Large Delimiters

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

Table 17: Non-Mathematical Symbols

These symbols can also be used in text mode.

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

Table 18: AMS Delimiters

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

Table 19: AMS Negated Arrows

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

Table 20: AMS Greek

            𝟋 \digamma κ \varkappa

3 TYPESETTING MATHEMATICAL FORMULAE 41 Table 21: AMS Hebrew

                     ℶ \beth ℸ \daleth ℷ \gimel

Table 22: AMS Arrows

−−→ \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 23: AMS Miscellaneous

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

3 TYPESETTING MATHEMATICAL FORMULAE 42

Table 24: AMS Binary Operators

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

Table 25: AMS Binary Relations

≦ \leqq  ⩽ \leqslant  ⪕ \eqslantless
≲ \lesssim  ⪅ \lessapprox  ≊ \approxeq
⋖ \lessdot  ≪ \lll  ≶ \lessgtr
⋚ \lesseqgtr  ⪋ \lesseqqgtr  ≑ \doteqdot
∽ \backsim  ⋐ \Subset  ≓ \risingdotseq
⋍ \backsimeq  ⫅ \subseteqq  ≒ \fallingdotseq
⊏ \sqsubset  ≼ \preccurlyeq ⋞ \curlyeqprec
≾ \precsim  ≾ \precapprox  ◁ \vartriangleleft
⊨ \vDash  ⊪ \Vvdash  ⊴ \trianglelefteq
⌣ \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
⊩ \Vdash  ∣ \shortmid  ⊵ \trianglerighteq
≬ \between  ⋔ \pitchfork  ∥ \shortparallel
∝ \varpropto  ∴ \therefore  ◀ \blacktriangleleft
϶ \backepsilon  ∵ \because  ▶ \blacktriangleright

3 TYPESETTING MATHEMATICAL FORMULAE 43

Table 26: AMS Negated 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 27: Math Alphabets

Example Command  Required package

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

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

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

𝔸𝔹ℂ  \mathbb{ABC}  amsfonts or amssymb

4 Specialities

In this chapter we will describe some of the untold wonders of the L^{A}TEX system. A more complete menu of specialities “provided” by L^{A}TEX is described in the L^{A}TEX Manual [1] and The L^{A}TEX Companion [3].

4.1 Fonts and Sizes

L^{A}TEX chooses the appropriate font and font size based on the logical structure of the document (sections, footnotes, …). In some cases one might like to change fonts and sizes by hand. Therefore you can use the commands listed in Tables 28 and 29.

The small and bold Romans ruled

all of great big Italy.

                                  {\small The small and
                                  \textbf{bold} Romans ruled}
                                  {\Large all of great big
                                  \textit{Italy}.}

In math mode you can use the font changing commands to temporarily exit math mode and enter some normal text. If you want to switch to another font for math typesetting there exists another special set of commands. Refer to Table 30.

In connection with the font size commands, curly braces play a significant role. They are used to to build groups. Groups limit the scope of most L^{A}TEX commands.

He likes large and small letters.

                                  He likes {\LARGE large and
                                  {\small small} letters}.

The font size commands also change the line spacing, but only if the paragraph ends within the scope of the font size command. The closing

Table 28: Fonts

  \textrm{...} roman  \textsf{...} sans serif
  \texttt{...}  typewriter
  \textmd{...} medium  \textbf{...} bold face
  \textup{...} upright  \textit{...} italic
  \textsl{...} slanted  \textsc{...} small caps
    \emph{...} emphasised  \textnormal{...} document font

curly brace } should therefore not come too early. Note the position of the \par command in the next two examples.

Don’t read this! It is not true. You can believe me!

                                 {\Large Don't read this! It is not
                                 true. You can believe me!\par}

This is not true either. But maybe I am lying.

                                 {\Large This is not true either.
                                 But maybe I am lying.}\par

To conclude this journey into the land of fonts and font sizes, here is a little word of advice^{11}:

\underline{Remember!} The MO RE fonts you use in a document the more readable and beautiful it becomes.

11Attention: This is a bit of satire. I hope you realise that!

Table 29: Font sizes

\tiny  tiny font
\scriptsize  very small font
\footnotesize quite small font
\small  small font

\normalsize  normal font

\large  large font

\Large larger font
\LARGE very large font

                 \huge huge

\Huge largest

Table 30: Math fonts

Command  Example  Output

\mathcal     $\mathcal{B}=c$  B = c
\mathrm      $\mathrm{K}_2$  K_{2}
\mathbf      $\sum x=\mathbf{v}$  ∑ x = v
\mathsf      $\mathsf{G\times R}$  G × R
\mathtt      $\mathtt{L}(b,c)$            L(b, c)
\mathnormal  $\mathnormal{R_1}=R_1$  R_{1} = R_{1}
\mathit      $finder\neq\mathit{finder}$ finder ≠ finder

4.2 Spacing

4.2.1 Line Spacing

If you want to use larger interline spacing in a document, you can change its value with the command:

 \linespread{factor}

Use the command \linespread{1.3} for “one and a half” line spacing, and \linespread{1.6} for “double” line spacing. Normally the lines are not spread, therefore the default linespread factor is 1.

4.2.2 Paragraph Formating

In L^{A}TEX, there are two parameters influencing paragraph layout. By placing a definition like

     \setlength{\parindent}{0pt}
     \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}

in the preamble of the input file^{12} the appearance of paragraphs can be changed. These two lines increase the space between two paragraphs while setting the paragraph indent to zero. In continental Europe, paragraphs are often separated by some space and not indented.

If you want to indent a paragraph which is not indented, you can use

 \indent

at the beginning of the paragraph^{13} . Obviously this can only work, when \parindent is not set to zero.

To create a non indented paragraph you can use

 \noindent

as the first command of the paragraph. This might come in handy, when you start a document with body text and not with a sectioning command.

12Between the \documentclass and the \begin{document} commands

13To indent the first paragraph after each section head, use the indentfirst package in the ‘tools’ bundle

4.2.3 Horizontal Space

L^{A}TEX determines the spaces between words and sentences automatically. To add your own spaces in a place, you can use:

 \hspace{length}

If such a space should be kept even if it falls at the end or the start of a line, use \hspace* instead of \hspace. The length is in the simplest case just a number plus a unit. The most important units are listed in Table 31.

This is a space of 1.5 cm.

                                  This\hspace{1.5cm}is a space
                                  of 1.5 cm.

The command

 \stretch{n}

generates a special rubber width. It stretches, until all the remaining space on a line is filled up. If two \hspace{\stretch{n}} commands are issued on the same line, they grow according to the stretch factor.

x  x  x

                                  x\hspace{\stretch{1}}
                                  x\hspace{\stretch{2}}x

4.2.4 Vertical Space

The space between paragraphs, sections, subsections, … is determined automatically by L^{A}TEX. If necessary, additional vertical space between two paragraphs can be added with the command:

 \vspace{length}

This command should normally be used between two empty lines. If the space should be preserved at the top or at the bottom of a page, use the starred version of the command \vspace* instead of \vspace.

The \stretch command in connection with \pagebreak can be used to typeset text on the last line of a page, or to centre text vertically on a page.

     Some text \ldots
     \vspace{\stretch{1}}
     This goes onto the last line of the page.\pagebreak

Table 31: TEX Units

mm millimeter ≈ 1/25 inch
cm centimeter = 10 mm
in inch ≈ 25 mm
pt point ≈ 1/72 inch ≈ \frac{1}{3} mm
em approx width of an m in the current font
ex approx height of an x in the current font

Additional space between two lines of the same paragraph or within a table is specified with the

\\[length]

command.

4.3 Bibliography

With the thebibliography environment you can produce a bibliography. Each entry starts with

 \bibitem{marker}

The marker is then used to cite the book within the document.

 \cite{marker}

The numbering of the entries is generated automatically. The parameter after the \begin{thebibliography} command sets the maximum width of these numbers.

Partl [1] has proposed, that …

References

[1] H. Partl: German TEX, TUGboat Vol. 9, No. 1 (1988)

                                  Partl~\cite{pa} has
                                  proposed, that \ldots
                                  \begin{thebibliography}{99}
                                  \bibitem{pa} H.~Partl:
                                  \emph{German \TeX},
                                  TUGboat Vol.~9, No.~1 (1988)
                                  \end{thebibliography}

4.4 Indexing

A very useful feature of many books is their index. With L^{A}TEX and the support program makeindx^{14} indexes can be generated quite easily. In this introduction, only the basic index generation commands will be explained. For a more in depth view please refer to The L^{A}TEX Companion [3].

To enable the indexing feature of L^{A}TEX the makeidx package must be loaded in the preamble with:

 \usepackage{makeidx}

The special indexing commands must be enabled with:

 \makeindex

The contents of the index is specified with

 \index{key}

commands. Where key is the index entry. You enter the index commands at the points in the text where you want the final index entries pointing to. Table 32 explains the syntax of the key argument with several examples.

When the input file is processed with L^{A}TEX, each \index command writes an appropriate index entry together with the current page number to a special file. The file has the same name as the L^{A}TEX input file, but a different extension (.ind). This .ind file can then be processed with the

makeindx program.
 makeidx filename

The makeindx program generates a sorted index with the same base file

14On systems supporting filenames longer than 8 characters, the program may be called

makeindex.

Table 32: Index Key Syntax Examples

Example  Index Entry Comment
\index{hello}  hello, 1  Plain entry
\index{hello!Peter}  Peter, 3  Subentry under ‘hello’

  \index{Sam@\textsl{Sam}} Sam, 2  Formated entry
  \index{Lin@\textbf{Lin}} Lin, 7  Formated entry

\index{Jenny|textbf}  Jenny, 3  Formated page number
\index{Joe|textit}  Joe, 5  Formated page number

name, but this time with the extension .idx. If now the L^{A}TEX input file is processed again, this sorted index gets included into the document at the point where L^{A}TEX finds

 \printindex

The showidx package which comes with L^{A}TEX 2ε prints out all index entries in the left margin of the text. This is quite useful for proofreading a document and verifying the index.

4.5 Including EPS Graphics

With the figure and the table environment L^{A}TEX provides the basic facilities to work with floating bodies such as images or graphics.

There are also several possibilities to generate the actual graphics with basic L^{A}TEX or a L^{A}TEX extension package. But most users find them quite difficult to understand. Therefore this will not be explained any further in this manual. For more information on that subject please refer to The L^{A}TEX Companion [3]and the L^{A}TEX Manual [1].

A much easier way to get graphics into a document, is to generate them with a specialised software package^{15} and then include the finished graphics into the document. Here again, L^{A}TEX packages offer many ways to do that. In this introduction, only the inclusion of Encapsulated PostScript (EPS) graphics will be discussed, because it is quite easy to do and widely used. In order to use pictures in the EPS format, you must have a PostScript printer^{16} available for output.

A good set of commands for inclusion of graphics is provided in the graphicx package by D. P. Carlisle. It is part of a whole family of packages called the “graphics” bundle^{17}.

Assuming you are working on a system with a PostScript printer available for output and with the graphicx package installed, you can use the following step by step guide to include a picture into your document:

1. Export the picture from your graphics program in EPS format.

2. Load the graphicx package in the preamble of the input file with

      \usepackage[driver]{graphicx}

driver is the name of your “dvi to postscript” converter^{18}. This information is required by the package because the actual graphics inclusion is done by the printer driver. Knowing the driver, the graphicx package inserts the correct commands into the .dvi file for the printer driver to include the desired EPS graphics.

15Such as XFig, CorelDraw!, Freehand, GNU Plot, …

16Another possibility to output PostScript, is the GhostScript program available from CTAN:/tex-archive/support/ghostscript

17CTAN:/tex-archive/macros/latex/packages/graphics

18The most widely used program is called dvips.

3. Use the command

 \includegraphics[key=value, . . .]{file}

to include file into your document. The optional parameter accepts a comma separated list of keys and associated values. The keys can be used to alter the width, height and rotation of the included graphic. Table 33 lists the most important keys.

Table 33: Key Names for graphicx Package

width scale graphic to the specified width
height scale graphic to the specified height
angle rotate graphics clockwise

The following example code will hopefully make things clear:

\begin{figure}
\begin{center}
\includegraphics[angle=90, width=10cm]{test.eps}
\end{center}
\end{figure}

This includes the graphic stored in the file test.eps. The graphic is first rotated by 90 degrees and then scaled to the final width of 10 cm. The aspect ratio is 1.0 because no special height is specified.

For more information please refer to [8].

References

[1] Leslie Lamport. L^{A}TEX: A Document Preparation System. Addison-Wesley, Reading, Massachusetts, second edition, 1994, ISBN 0-201-52983-1.

[2] Donald E. Knuth. The TEXbook, Volume A of Computers and Typesetting, Addison-Wesley Publishing Company (1984), ISBN 0-201-13448-9.

[3] Michel Goossens, Frank Mittelbach and Alexander Samarin. The L^{A}TEX Companion. Addison-Wesley, Reading, Massachusetts, 1994, ISBN 0-201-54199-8.

[4] Each L^{A}TEX installation should provide a so-called L^{A}TEX Local Guide, which explains the things which are special to the local system. It should be contained in file called local.tex. Unfortunately some lazy sysops do not provide such a document. In this case, go and ask you local L^{A}TEX guru for help.

[5] L^{A}TEX3 Project Team. L^{A}TEX 2ε for authors. Comes with the L^{A}TEX 2ε distribution as usrguide.tex.

[6] L^{A}TEX3 Project Team. L^{A}TEX 2ε for Class and Package writers. Comes with the L^{A}TEX 2ε distribution as clsguide.tex.

[7] L^{A}TEX3 Project Team. L^{A}TEX 2ε Font selection. Comes with the L^{A}TEX 2ε distribution as fntguide.tex.

[8] D. P. Carlisle. Packages in the ‘graphics’ bundle. Comes with the ‘graphics’ bundle as grfguide.tex, available form the same source your L^{A}TEX distribution came from.

Index

\!, 34 ", 17 $, 30 ', 32 \(, 30 \), 30 \,, 31, 34 -, 17 −, 17 \-, 17 –, 17 —, 17 ., space after, 20 …, 18 \@, 20 \[, 30 \\, 16, 23, 24, 26, 48

\\*, 16

\ , 31 \], 30 ^, 32 _, 32 |, 26 ~, 20

A4 paper, 13 A5 paper, 13 accent, 18 acute, 19 advantages of L^{A}TEX, 7 æ, 19 amssymb, 37 amstex, 34

\and, 21
\appendix, 20, 21
array, 35

arrow symbols, 32 article class, 12

\atop, 33
\author, 21
\authors, 21

B5 paper, 13 babel, 19 backslash, 9 base font size, 13

                                 \begin, 23
                                 \bibitem, 48

bibliography, 48

                                 \Big, 34
                                 \big, 34
                                 \Bigg, 34
                                 \bigg, 34
                                 \bmod, 33

bold face, 44 book class, 12 braces, 33

                                 \caption, 28
                                 \cdots, 34
                                  center, 24
                                 \chapter, 20
                                 \choose, 33
                                 \cite, 48
                                 \clearpage, 29

coloured text, 12 comma, 18 commands, 9 \!, 34 \(, 30 \), 30 \,, 31, 34 \-, 17 \@, 20 \[, 30 \\, 16, 23, 24, 26, 48

                                      \\*, 16

\ , 31 \], 30

                                      \and, 21
                                      \appendix, 20, 21
                                      \atop, 33
                                      \author, 21

\authors, 21
\begin, 23
\bibitem, 48
\Big, 34
\big, 34
\Bigg, 34
\bigg, 34
\bmod, 33
\caption, 28
\cdots, 34
\chapter, 20
\choose, 33
\cite, 48
\clearpage, 29
\date, 21
\ddots, 34
\displaystyle, 36
\documentclass, 11, 12

\emph, 22, 44

\end, 23
\footnote, 22
\footnotesize, 45
\frac, 33
\frenchspacing, 20
\hline, 26
\hspace, 47
\Huge, 45
\huge, 45
\hyphenation, 16
\includegraphics, 51
\indent, 46
\index, 49
\int, 33
\item, 24
\label, 22, 30
\LARGE, 45
\Large, 45
\large, 45
\ldots, 18, 34
\left, 34
\linebreak, 16
\linespread, 46
\listoffigures, 29
\listoftables, 29

                                  \makeindex, 49
                                  \maketitle, 21
                                  \mathbf, 45
                                  \mathcal, 45
                                  \mathit, 45
                                  \mathnormal, 45
                                  \mathrm, 36, 45
                                  \mathsf, 45
                                  \mathtt, 45

\mbox, 17, 18

                                  \multicolumn, 27
                                  \newline, 16
                                  \newpage, 16
                                  \noindent, 46
                                  \nolinebreak, 16
                                  \nonumber, 35, 36
                                  \nopagebreak, 16
                                  \normalsize, 45
                                  \overbrace, 32
                                  \overleftarrow, 32
                                  \overline, 32
                                  \overrightarrow, 32
                                  \pagebreak, 16
                                  \pageref, 22
                                  \pagestyle, 15
                                  \paragraph, 20
                                  \parindent, 46
                                  \parskip, 46

\part, 20, 21

                                  \pmod, 33
                                  \printindex, 50
                                  \qquad, 31, 34
                                  \quad, 34

\ref, 22, 30

                                  \right, 34
                                  \scriptscriptstyle, 36
                                  \scriptsize, 45
                                  \scriptstyle, 36
                                  \section, 20
                                  \setlength, 46
                                  \sloppy, 16
                                  \small, 45
                                  \sqrt, 32
                                  \stretch, 47

\subparagraph, 20
\subsection, 20
\subsubsection, 20
\sum, 33
\tableofcontents, 21
\textbf, 44
\textit, 44
\textmd, 44
\textnormal, 44
\textrm, 36, 44
\textsc, 44
\textsf, 44
\textsl, 44
\textstyle, 36
\texttt, 44
\textup, 44
\thispagestyle, 15
\tiny, 45
\title, 21
\underbrace, 32
\underline, 32
\usepackage, 12, 19
\vdots, 34
\vec, 32
\verb, 25
\vspace, 47
\widehat, 32
\widetilde, 32

comments, 10 cross references, 22 curly braces, 10, 44

dash, 17, 32

\date, 21

dcolumn, 27

\ddots, 34

decimal alignment, 26 delimiters, 33

description, 24

diagonal dots, 34 dimensions, 47

displaymath, 30
\displaystyle, 36

document font size, 13 document title, 13

                              \documentclass, 11, 12

dotless ıand ȷ, 19

double line spacing, 46

double sided, 13

ellipsis, 18 em-dash, 18 \emph, 22, 44 emphasise, 22

                               empty, 15

en-dash, 18

Encapsulated PostScript, 50

                              \end, 23
                               enumerate, 24

environment, 23 environments

                                  array, 35
                                  center, 24
                                  description, 24
                                  displaymath, 30
                                  enumerate, 24
                                  eqnarray, 35
                                  equation, 30
                                  figure, 27, 28
                                  flushleft, 24
                                  flushright, 24
                                  itemize, 24
                                  math, 30
                                  quotation, 23
                                  quote, 23

table, 27, 28

                                  tabular, 25
                                  thebibliography, 48
                                  verbatim, 25
                                  verse, 23
                               eqnarray, 35
                               equation, 30

equation system, 35 executive paper, 13 exponent, 32 exscale, 34

                               figure, 27, 28

floating bodies, 27

flushleft, 24
flushright, 24

font, 44 font encoding, 14 font size, 44, 45 footer, 15

\footnote, 22
\footnotesize, 45

formulae, 30

\frac, 33

fraction, 33

\frenchspacing, 20

German, 19 GhostScript, 50 graphics, 12, 50 graphicx, 50 grave, 19 Greek letters, 31 grouping, 44

header, 15 textttheadings, 15

\hline, 26

horizontal brace, 32 dots, 34 line, 32 space, 47

\hspace, 47
\Huge, 45
\huge, 45

hyphen, 18

\hyphenation, 16

hyphenation rules, 19

\includegraphics, 51
\indent, 46

indentfirst, 46 index, 49

\index, 49

input file, 11

\int, 33

integral operator, 33 international, 19 italic, 44

                                 \item, 24
                                  itemize, 24

Knuth, Donald E., 6

                                 \label, 22, 30

Lamport, Leslie, 6

language, 19

                                 \LARGE, 45
                                 \Large, 45
                                 \large, 45

L^{A}TEX 2.09, 6 L^{A}TEX 2ε, 6 L^{A}TEX3, 6, 8

                                 \ldots, 18, 34
                                 \left, 34

left aligned, 24 legal paper, 13 letter paper, 13 ligature, 18 line spacing, 46 linebreak, 16

                                 \linebreak, 16
                                 \linespread, 46
                                 \listoffigures, 29
                                 \listoftables, 29

long equations, 35

makeidx, 49

makeidx package, 49

                                 \makeindex, 49

makeindex program, 49

                                 \maketitle, 21
                                  math, 30

math font size, 36 math spacing, 34

                                 \mathbf, 45
                                 \mathcal, 45

mathematical accents, 32 delimiter, 34 functions, 33 minus, 17 mathematics, 30

\mathit, 45
\mathnormal, 45
\mathrm, 36, 45
\mathsf, 45
\mathtt, 45

\mbox, 17, 18 minus sign, 18 Mittelbach, Frank, 6 modulo function, 33

\multicolumn, 27
\newline, 16
\newpage, 16
\noindent, 46
\nolinebreak, 16
\nonumber, 35, 36
\nopagebreak, 16
\normalsize, 45

œ, 19 option, 12 optional parameters, 10

\overbrace, 32

overfull hbox, 16

\overleftarrow, 32
\overline, 32
\overrightarrow, 32

package, 10, 12 packages

amssymb, 37 amstex, 34 babel, 19 dcolumn, 27 exscale, 34 graphicx, 50 indentfirst, 46 makeidx, 49 showidx, 50

page style, 15

empty, 15
headings, 15
plain, 15
\pagebreak, 16

\pageref, 22
\pagestyle, 15

paper size, 13

\paragraph, 20

parameter, 10

\parindent, 46
\parskip, 46

\part, 20, 21 period, 18 placement specifier, 28

plain, 15
\pmod, 33

PostScript, 50 preamble, 10

\printindex, 50
\qquad, 31, 34
\quad, 34
quotation, 23

quotation marks, 17

quote, 23

\ref, 22, 30 report class, 12 reserved characters, 9

\right, 34

right aligned, 24 roman, 44

sans serif, 44 scandinavian letters, 19

\scriptscriptstyle, 36
\scriptsize, 45
\scriptstyle, 36
\section, 20
\setlength, 46

showidx, 50 single sided, 13 slanted, 44

\sloppy, 16
\small, 45

small caps, 44 space, 8 special character, 18

\sqrt, 32

square brackets, 10 square root sign, 32

\stretch, 47

structure, 10

\subparagraph, 20

subscript, 32

\subsection, 20
\subsubsection, 20
\sum, 33

sum operator, 33

table, 25 table, 27, 28 table of contents, 21

\tableofcontents, 21
 tabular, 25
\textbf, 44
\textit, 44
\textmd, 44
\textnormal, 44
\textrm, 36, 44
\textsc, 44
\textsf, 44
\textsl, 44
\textstyle, 36
\texttt, 44
\textup, 44
 thebibliography, 48

theer dots, 34

\thispagestyle, 15

tilde, 32 tilde (~), 20

\tiny, 45

title, 13, 21

\title, 21

two column, 13

umlaut, 19

\underbrace, 32

underfull hbox, 16

\underline, 32

units, 47, 48 upright, 44

\usepackage, 12, 19

                                  \vdots, 34
                                  \vec, 32

vectors, 32

                                  \verb, 25
                                   verbatim, 25
                                   verse, 23

vertical dots, 34 vertical space, 47

                                  \vspace, 47

whitespace, 8 after commands, 9 at the start of a line, 8

                                  \widehat, 32
                                  \widetilde, 32

WYSIWYG, 6, 7