The Not So Short Introduction to LATEX2e - v4.31

The Not So Short Introduction to LATEX2e - v4.31

(Parte 1 de 10)

The Not So Short Introduction to LATEX2ε

Or LATEX2ε in 154 minutes by Tobias Oetiker Hubert Partl, Irene Hyna and Elisabeth Schlegl

Copyright ©1995-2010 Tobias Oetiker and Contributors. All rights reserved. This document is free; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This document is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fittness for a particular purpose. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this document; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Thank you!

Much of the material used in this introduction comes from an Austrian introduction to LATEX 2.09 written in German by:

Hubert Partl <> Zentraler Informatikdienst der Universität für Bodenkultur Wien

Irene Hyna <> Bundesministerium für Wissenschaft und Forschung Wien

Elisabeth Schlegl <noemail> in Graz

If you are interested in the German document, you can find a version updated for LATEX2ε by Jörg Knappen at CTAN://info/lshort/german iv Thank you!

The following individuals helped with corrections, suggestions and material to improve this paper. They put in a big effort to help me get this document into its present shape. I would like to sincerely thank all of them. Naturally, al the mistakes you’l find in this book are mine. If you ever find a word that is spelled correctly, it must have been one of the people below dropping me a line.

Eric Abrahamsen, Rosemary Bailey, Marc Bevand, Friedemann Brauer, Barbara Beeton, Salvatore Bonaccorso, Jan Busa, Markus Brühwiler, Pietro Braione, David Carlisle, José Carlos Santos, Neil Carter, Mike Chapman, Pierre Chardaire, Christopher Chin, Carl Cerecke, Chris McCormack, Diego Clavadetscher, Wim van Dam, Jan Dittberner, Michael John Downes, Matthias Dreier, David Dureisseix, Eilinger August, Elliot, Rockrush Engch, Hans Ehrbar, Daniel Flipo, David Frey, Hans Fugal, Robin Fairbairns, Jörg Fischer, Erik Frisk, Mic Milic Frederickx, Frank, Kasper B. Graversen, Arlo Griffiths, Alexandre Guimond, Andy Goth, Cyril Goutte, Greg Gamble, Frank Fischli, Morten Høgholm, Neil Hammond, Rasmus Borup Hansen, Joseph Hilferty, Björn Hvittfeldt, Martien Hulsen, Werner Icking, Jakob, Eric Jacoboni, Alan Jeffrey, Byron Jones, David Jones, Nils Kanning, Tobias Krewer, Johannes-Maria Kaltenbach, Andrzej Kawalec, Sander de Kievit, Alain Kessi, Christian Kern, Tobias Klauser, Jörg Knappen, Kjetil Kjernsmo, Michael Koundouros, Matt Kraai, Maik Lehradt, Rémi Letot, Flori Lambrechts, Mike Lee, Axel Liljencrantz, Johan Lundberg, Alexander Mai, Hendrik Maryns, Martin Maechler, Aleksandar S Milosevic, Henrik Mitsch, Claus Malten, Kevin Van Maren, Stefan M. Moser, Richard Nagy, Philipp Nagele, Lenimar Nunes de Andrade, I. J. Vera Marún, Manuel Oetiker, Urs Oswald, Lan Thuy Pham, Martin Pfister, Breno Pietracci, Demerson Andre Polli, Nikos Pothitos, Maksym Polyakov Hubert Partl, John Refling, Mike Ressler, Brian Ripley, Young U. Ryu, Bernd Rosenlecher, Kurt Rosenfeld, Chris Rowley, Risto Saarelma, Hanspeter Schmid, Craig Schlenter, Gilles Schintgen, Baron Schwartz, Christopher Sawtell, Miles Spielberg, Matthieu Stigler, Geoffrey Swindale, Laszlo Szathmary, András Salamon, Boris Tobotras, Josef Tkadlec, Scott Veirs, Didier Verna, Fabian Wernli, Carl-Gustav Werner, David Woodhouse, Chris York, Fritz Zaucker, Rick Zaccone, and Mikhail Zotov.


LATEX [1] is a typesetting system that is very suitable for producing scientific and mathematical documents of high typographical quality. It is also suitable for producing all sorts of other documents, from simple letters to complete books. LATEX uses TEX [2] as its formatting engine.

This short introduction describes LATEX2ε and should be sufficient for most applications of LATEX. Refer to [1, 3] for a complete description of the LATEX system.

This introduction is split into 6 chapters:

Chapter 1 tells you about the basic structure of LATEX2ε documents. You will also learn a bit about the history of LATEX. After reading this chapter, you should have a rough understanding how LATEX works.

Chapter 2 goes into the details of typesetting your documents. It explains most of the essential LATEX commands and environments. After reading this chapter, you will be able to write your first documents.

Chapter 3 explains how to typeset formulae with LATEX. Many examples demonstrate how to use one of LATEX’s main strengths. At the end of the chapter are tables listing all mathematical symbols available in

Chapter 4 explains indexes, bibliography generation and inclusion of EPS graphics. It introduces creation of PDF documents with pdfLATEX and presents some handy extension packages.

Chapter 5 shows how to use LATEX for creating graphics. Instead of drawing a picture with some graphics program, saving it to a file and then including it into LATEX you describe the picture and have LATEX draw it for you.

Chapter 6 contains some potentially dangerous information about how to alter the standard document layout produced by LATEX. It will tell you how to change things such that the beautiful output of LATEX turns ugly or stunning, depending on your abilities.

vi Preface

It is important to read the chapters in order—the book is not that big, after all. Be sure to carefully read the examples, because a lot of the information is in the examples placed throughout the book.

LATEX is available for most computers, from the PC and Mac to large UNIX and VMS systems. On many university computer clusters you will find that a LATEX installation is available, ready to use. Information on how to access the local LATEX installation should be provided in the Local Guide [5]. 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

LATEX system, but to teach you how to write your documents so that they can be processed by LATEX.

If you need to get hold of any LATEX related material, have a look at one of the Comprehensive TEX Archive Network (CTAN) sites. The homepage is at

You will find other references to CTAN throughout the book, especially pointers to software and documents you might want to download. Instead of writing down complete urls, I just wrote CTAN: followed by whatever location within the CTAN tree you should go to.

If you want to run LATEX on your own computer, take a look at what is available from CTAN://systems.

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

LATEX novices about which bits of this intro are easy to understand and which could be explained better.

Tobias Oetiker <>

OETIKER+PARTNER AG Aarweg 15 4600 Olten Switzerland

The current version of this document is available on CTAN://info/lshort


Thank you! i Preface v

1.1 The Name of the Game1
1.1.1 TEX1
1.1.2 LATEX2
1.2 Basics2
1.2.1 Author, Book Designer, and Typesetter2
1.2.2 Layout Design2
1.2.3 Advantages and Disadvantages3
1.3 LATEX Input Files4
1.3.1 Spaces4
1.3.2 Special Characters5
1.3.3 LATEX Commands5
1.3.4 Comments6
1.4 Input File Structure6
1.5 A Typical Command Line Session7
1.6 The Layout of the Document9
1.6.1 Document Classes9
1.6.2 Packages9
1.6.3 Page Styles10
1.7 Files You Might Encounter13
1.8 Big Projects14

1 Things You Need to Know 1

2.1 The Structure of Text and Language17
2.2 Line Breaking and Page Breaking19
2.2.1 Justified Paragraphs19
2.2.2 Hyphenation20
2.3 Ready-Made Strings21
2.4.1 Quotation Marks21
2.4.2 Dashes and Hyphens2
2.4.3 Tilde (∼)2
2.4.4 Degree Symbol (◦)2
2.4.5 The Euro Currency Symbol (e)23
2.4.6 Ellipsis () . . . . . . . . . . . . . . . . . . . . . . . 23
2.4.7 Ligatures24
2.4.8 Accents and Special Characters24
2.5 International Language Support25
2.5.1 Support for Portuguese27
2.5.2 Support for French28
2.5.3 Support for German29
2.5.4 Support for Korean29
2.5.5 Writing in Greek32
2.5.6 Support for Cyrillic3
2.5.7 Support for Mongolian3
2.6 The Space Between Words35
2.7 Titles, Chapters, and Sections35
2.8 Cross References38
2.9 Footnotes38
2.10 Emphasized Words39
2.1 Environments39
2.1.1 Itemize, Enumerate, and Description40
2.1.2 Flushleft, Flushright, and Center40
2.1.3 Quote, Quotation, and Verse41
2.1.4 Abstract41
2.1.5 Printing Verbatim42
2.1.6 Tabular42
2.12 Floating Bodies45
2.13 Protecting Fragile Commands48


3.1 The AMS-LATEX bundle49
3.2 Single Equations49
3.2.1 Math Mode51
3.3 Building Blocks of a Mathematical Formula52
3.4 Single Equations that are Too Long: multline57
3.5 Multiple Equations58
3.5.1 Problems with Traditional Commands58
3.5.2 IEEEeqnarray-Environment60
3.5.3 Common Usage61
3.6 Arrays and Matrices64
3.7 Spacing in Math Mode65
3.8 Fiddling with the Math Fonts6
3.8.1 Bold Symbols67
3.9 Theorems, Lemmas,68
3.9.1 Proofs and End-of-Proof Symbol69
3.10 List of Mathematical Symbols72


4.1 Including Encapsulated PostScript81
4.2 Bibliography83
4.3 Indexing85
4.4 Fancy Headers86
4.5 The Verbatim Package8
4.6 Installing Extra Packages8
4.7 Working with pdfLATEX89
4.7.1 PDF Documents for the Web90
4.7.2 The Fonts91
4.7.3 Using Graphics92
4.7.4 Hypertext Links93
4.7.5 Problems with Links95
4.7.6 Problems with Bookmarks96
4.7.7 Source Compatibility Between LATEX and pdfLATEX96
4.8 Creating Presentations97

4 Specialities 81

5.1 Overview101
5.2 The picture Environment102
5.2.1 Basic Commands102
5.2.2 Line Segments104
5.2.3 Arrows105
5.2.4 Circles106
5.2.5 Text and Formulas107
5.2.6 \multiput and \linethickness107
5.2.7 Ovals108
5.2.8 Multiple Use of Predefined Picture Boxes109
5.2.9 Quadratic Bézier Curves110
5.2.10 Catenary1
5.2.1 Rapidity in the Special Theory of Relativity12
5.3 The PGF and TikZ Graphics Packages112

5 Producing Mathematical Graphics 101

6.1 New Commands, Environments and Packages117
6.1.1 New Commands118
6.1.2 New Environments119
6.1.4 Commandline LATEX120
6.1.5 Your Own Package121
6.2 Fonts and Sizes121
6.2.1 Font Changing Commands121
6.2.2 Danger, Will Robinson, Danger124
6.2.3 Advice124
6.3 Spacing125
6.3.1 Line Spacing125
6.3.2 Paragraph Formatting125
6.3.3 Horizontal Space126
6.3.4 Vertical Space127
6.4 Page Layout128
6.5 More Fun With Lengths130
6.6 Boxes131
6.7 Rules133


A.1 What to Install135
A.2 TEX on Mac OS X136
A.2.1 Get a TEX Distribution136
A.2.2 Picking an Editor136
A.2.3 Treat yourself to PDFView136
A.3 TEX on Windows136
A.3.1 Getting TEX136
A.3.2 A LATEX editor137
A.3.3 Document Preview137
A.3.4 Working with graphics137
A.4 TEX on Linux137

A Installing LATEX 135 Bibliography 139

Index 141

1.1 A Minimal LATEX File7
1.2 Example of a Realistic Journal Article8
4.1 Example fancyhdr Setup87
4.2 Sample code for the beamer class9
6.1 Example Package121
1.1 Document Classes10
1.2 Document Class Options1
1.3 Some of the Packages Distributed with LATEX12
1.4 The Predefined Page Styles of LATEX12
2.1 A bag full of Euro symbols23
2.2 Accents and Special Characters24
2.3 Preamble for Portuguese documents28
2.4 Special commands for French28
2.5 German Special Characters29
2.6 Preamble for Greek documents32
2.7 Greek Special Characters32
2.8 Bulgarian, Russian, and Ukrainian34
2.9 Float Placing Permissions46
3.1 Math Mode Accents72
3.2 Greek Letters72
3.3 Binary Relations73
3.4 Binary Operators73
3.5 BIG Operators74
3.6 Arrows74
3.7 Arrows as Accents74
3.8 Delimiters75
3.9 Large Delimiters75
3.10 Miscellaneous Symbols75
3.1 Non-Mathematical Symbols75
3.12 AMS Delimiters76
3.13 AMS Greek and Hebrew76
3.14 Math Alphabets76
3.15 AMS Binary Operators76
3.16 AMS Binary Relations7
3.17 AMS Arrows78
3.19 AMS Miscellaneous79
4.1 Key Names for graphicx Package82
4.2 Index Key Syntax Examples85
6.1 Fonts122
6.2 Font Sizes122
6.3 Absolute Point Sizes in Standard Classes123
6.4 Math Fonts123

Chapter 1 Things You Need to Know

The first part of this chapter presents a short overview of the philosophy and history of LATEX2ε. The second part focuses on the basic structures of a LATEX document. After reading this chapter, you should have a rough knowledge of how LATEX works, which you will need to understand the rest of this book.

1.1 The Name of the Game

1.1.1 TEX

(Parte 1 de 10)