# The Not So Short Introduction to LATEX 2ε - PDF

Description
The Not So Short Introduction to LATEX 2ε Or L A TEX 2ε in 92 minutes by Tobias Oetiker Hubert Partl, Irene Hyna and Elisabeth Schlegl Version 3.19, 02 April, 2001 ii Copyright c 2000 Tobias Oetiker and

View again

All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information
Category:

## Automotive

Publish on:

Views: 94 | Pages: 106

Share
Transcript
The Not So Short Introduction to LATEX 2ε Or L A TEX 2ε in 92 minutes by Tobias Oetiker Hubert Partl, Irene Hyna and Elisabeth Schlegl Version 3.19, 02 April, 2001 ii Copyright c 2000 Tobias Oetiker and all the Contributers to LShort. 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 FITNESS 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 L A TEX 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 in Graz no 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/lshort/german 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 get this document into its present shape. I would like to sincerely thank all of them. Naturally, all the mistakes you ll find in this book are mine. If you ever find a word which is spelled correctly, it must have been one of the people below dropping me a line. Rosemary Bailey, Friedemann Brauer, Jan Busa, Markus Brühwiler, David Carlisle, Mike Chapman, Christopher Chin, Chris McCormack, Wim van Dam, Jan Dittberner, Michael John Downes, David Dureisseix, Elliot, David Frey, Robin Fairbairns, Jörg Fischer, Erik Frisk, Frank, Alexandre Guimond, Cyril Goutte, Greg Gamble, Neil Hammond, Rasmus Borup Hansen, Joseph Hilferty, Björn Hvittfeldt, Martien Hulsen, Werner Icking, Jakob, Eric Jacoboni, Alan Jeffrey, Byron Jones, David Jones, Johannes-Maria Kaltenbach, Andrzej Kawalec, Alain Kessi, Christian Kern, Jörg Knappen, Kjetil Kjernsmo, Maik Lehradt, Alexander Mai, Martin Maechler, Aleksandar S Milosevic, Claus Malten, Kevin Van Maren, Lenimar Nunes de Andrade, Hubert Partl, John Refling, Mike Ressler, Brian Ripley, Young U. Ryu, Bernd Rosenlecher, Chris Rowley, Hanspeter Schmid, Craig Schlenter, Christopher Sawtell, Geoffrey Swindale, Josef Tkadlec, Didier Verna, Fabian Wernli, Carl-Gustav Werner, David Woodhouse, Chris York, Fritz Zaucker, Rick Zaccone, and Mikhail Zotov. Preface L A TEX [1] is a typesetting system which is very suitable for 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. Refer to [1, 3] for a complete description of the L A TEX system. L A TEX 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 L A TEX installation is available, ready to use. 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. This Introduction is split into 5 chapters: Chapter 1 tells you about the basic structure of L A TEX 2ε documents. You will also learn a bit about the history of L A TEX. After reading this chapter, you should have a rough picture of L A TEX. The picture will only be a framework, but it will enable you to integrate the information provided in the other chapters into the big picture. Chapter 2 goes into the details of typesetting your documents. It explains most of the essential L A TEX commands and environments. After reading this chapter, you will be able to write your first documents. Chapter 3 explains how to typeset formulae with L A TEX. Again, a lot of examples help you to understand how to use one of L A TEX s main strengths. At the end of this chapter, you will find tables, listing all the mathematical symbols available in L A TEX. Chapter 4 explains index and bibliography generation, inclusion of EPS graphics, and some other useful extensions. vi Preface Chapter 5 contains some potentially dangerous information about how to make alterations to the standard document layout produced by L A TEX. It will tell you how to change things such that the beautiful output of L A TEX begins looking quite bad. It is important to read the chapters in sequential order. The book is not that big after all. Make sure to carefully read the examples, because a great part of the information is contained in the various examples you will find all throughout the book. If you need to get hold of any L A TEX related material, have a look in one of the Comprehensive TEX Archive Network (CTAN) ftp archives. They can be found e.g. at ctan.tug.org (US), ftp.dante.de (Germany), ftp.tex.ac.uk (UK). If you are not in one of these countries, choose the archive closest to you. If you want to run L A TEX on your own computer, take a look at what is available from CTAN:/tex-archive/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 L A TEX novices about which bits of this intro are easy to understand and which could be explained better. Tobias Oetiker Department of Electrical Engineering, Swiss Federal Institute of Technology The current version of this document is available on CTAN:/tex-archive/info/lshort Contents Thank you! Preface iii v 1 Things You Need to Know The Name of the Game TEX L A TEX Basics Author, Book Designer, and Typesetter Layout Design Advantages and Disadvantages L A TEX Input Files Spaces Special Characters L A TEX Commands Comments Input File Structure The Layout of the Document Document Classes Packages Files you might encounter Page Styles Big Projects Typesetting Text The Structure of Text and Language Linebreaking and Pagebreaking Justified Paragraphs Hyphenation Ready made Strings Special Characters and Symbols Quotation Marks viii CONTENTS Dashes and Hyphens Tilde ( ) Ellipsis (... ) Ligatures Accents and Special Characters International Language Support Support for German The Space between Words Titles, Chapters, and Sections Cross References Footnotes Emphasized Words Environments Itemize, Enumerate, and Description Flushleft, Flushright, and Center Quote, Quotation, and Verse Printing Verbatim Tabular Floating Bodies Typesetting Mathematical Formulae General Grouping in Math Mode Building Blocks of a Mathematical Formula Math Spacing Vertically Aligned Material Phantom Math Font Size Theorems, Laws, Bold symbols List of Mathematical Symbols Specialities Including EPS Graphics Bibliography Indexing Fancy Headers The Verbatim Package Downloading and Installing L A TEX Packages Protecting fragile commands CONTENTS ix 5 Customising L A TEX New Commands, Environments and Packages New Commands New Environments Your own Package Fonts and Sizes Font changing Commands Danger, Will Robinson, Danger Advice Spacing Line Spacing Paragraph Formatting Horizontal Space Vertical Space Page Layout More fun with lengths Boxes Rules and Struts Bibliography 81 Index 83 List of Figures 1.1 Components of a TEX System A Minimal L A TEX File Example of a Realistic Journal Article Example fancyhdr Setup Example Package Page Layout Parameters List of Tables 1.1 Document Classes Document Class Options Some of the Packages Distributed with L A TEX The Predefined Page Styles of L A TEX Accents and Special Characters German Special Characters Float Placing Permissions Math Mode Accents Lowercase Greek Letters Uppercase Greek Letters Binary Relations Binary Operators BIG Operators Arrows Delimiters Large Delimiters Miscellaneous Symbols Non-Mathematical Symbols AMS Delimiters AMS Greek and Hebrew AMS Binary Relations AMS Arrows AMS Negated Binary Relations and Arrows AMS Binary Operators AMS Miscellaneous Math Alphabets Key Names for graphicx Package Index Key Syntax Examples Fonts Font Sizes Absolute Point Sizes in Standard Classes xiv LIST OF TABLES 5.4 Math Fonts TEX Units Chapter 1 Things You Need to Know In the first part of this chapter, you will get a short overview about the philosophy and history of L A TEX 2ε. The second part of the chapter focuses on the basic structures of a L A TEX document. After reading this chapter, you should have a rough knowledge of how L A TEX works. When reading on, this will help you to integrate all the new information into the big picture. 1.1 The Name of the Game TEX TEX is a computer program created by Donald E. Knuth [2]. It is aimed at typesetting text and mathematical formulae. Knuth started writing the TEX typesetting engine in 1977 to explore the potential of the digital printing equipment that was beginning to infiltrate the publishing industry at that time, especially in the hope that he could reverse the trend of deteriorating typographical quality that he saw affecting his own books and articles. TEX as we use it today was released in 1982, with some slight enhancements added in 1989 to better support 8-bit characters and multiple languages. TEX is renowned for being extremely stable, for running on many different kinds of computers, and for being virtually bug free. The version number of TEX is converging to π and is now at TEX is pronounced Tech, with a ch as in the German word Ach or in the Scottish Loch. In an ASCII environment, TEX becomes TeX 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. 2 Things You Need to Know.mf METAfont copy editor... ispell emacs.tex... AMS-Package Plain LATEX 2ε.tfm TEX.log.pk.dvi... driver xdvi dvips printer screen PostScript Fonts Typesetting Figure 1.1: Components of a TEX System. In 1994 the L A TEX package was 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 had cropped up since the release of L A TEX 2.09 some years earlier. 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 or Lah-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. Figure 1.1 above shows how TEX and L A TEX 2ε work together. This figure is taken from wots.tex by Kees van der Laan. 1.2 Basics Author, Book Designer, and Typesetter To publish something, authors give their typed manuscript to a publishing company. One of their book designers then decides the layout of the document (column width, fonts, space before and after headings,... ). The book 1.2 Basics 3 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 MS Word or Corel 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. 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 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 the 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 to 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 Advantages and Disadvantages When People from the WYSIWYG world meet people who use L A TEX, they often discuss the advantages of L A TEX over a normal word processor or the 1 What you see is what you get. 4 Things You Need to Know opposite. The best thing you can do when such a discussion starts is to keep a low profile, since such discussions often get out of hand. But sometimes you cannot escape... So here is some ammunition. 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 generated easily. Free add-on packages exist for many typographical tasks not directly supported by basic L A TEX. 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 and free. Therefore the system runs on almost any hardware platform available. L A TEX also has some disadvantages, and I guess it s a bit difficult for me to find any sensible ones, though I am sure other people can tell you hundreds ;-) L A TEX does not work well for people who have sold their souls... Although some parameters can be adjusted within a predefined document layout, the design of a whole new layout is difficult and takes a lot of time. 2 It is very hard to write unstructured and disorganized documents. Your hamster might, despite some encouraging first steps, never be able to fully grasp the concept of Logical Markup. 2 Rumour says that this is one of the key elements which will be addressed in the upcoming L A TEX3 system. 1.3 L A TEX Input Files 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 Spaces Whitespace characters such as blank or tab 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, and a single linebreak is treated as whitespace. 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 left hand side is the text from the input file, and on the right hand side is the formatted output. 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 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 directly in your text, 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 with special commands in mathematical formulae or as accents. The backslash character \ can not be entered by adding another backslash in front of it (\\), this sequence is used for linebreaking. 3 3 Try the$\backslash\$ command instead. It produces a \. 6 Things You Need to Know 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 of letters only. Command names are terminated by a space, a number or any other non-letter. 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. The {} stops L A TEX from eating up all the space after the command name. I read that Knuth divides the people working with \TeX{} into \TeX{}nicians and \TeX perts.\\ Today is \today. I read that Knuth divides the people working with TEX into TEXnicians and TEXperts. Today is 2nd April 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 [ ]. The next examples use some L A TEX commands. Don t worry about them, they will be explained later. You can \textsl{lean} on me! You can lean on me! Please, start a new line right here!\newline Thank you! Please, start a new line right here! Thank you! Comments When L A TEX encounters a % character while processing an input file, it ignores the rest of the present line, the linebreak, and all whitespace at the beginning of the next line. This can be used to write notes into the input file, which will not show up in the printed version. This is an % stupid % Better: instructive ---- example: Supercal% ifragilist% icexpialidocious This is an example: Supercalifragilisticexpialidocious 1.4 Input File Structure 7 The % character can also be used to split long input lines where no whitespace or linebreaks are allowed. For longer comments you should use the comment environment provided by the verbatim package. This is another \begin{comment} rather stupid, This is another example for embedding comments in your document. but helpful \end{comment} example for embedding comments in your document. Note
Related Search
Similar documents

View more...