The Not So Short Introduction to LATEX 2ε - PDF

Description
The Not So Short Introduction to LATEX 2ε Or L A TEX 2ε in 129 minutes by Tobias Oetiker Hubert Partl, Irene Hyna and Elisabeth Schlegl Version 4.12, 13 April, 2003 ii Copyright Tobias Oetiker

Please download to get full document.

View again

of 23
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:

Music & Video

Publish on:

Views: 25 | Pages: 23

Extension: PDF | Download: 0

Share
Transcript
The Not So Short Introduction to LATEX 2ε Or L A TEX 2ε in 129 minutes by Tobias Oetiker Hubert Partl, Irene Hyna and Elisabeth Schlegl Version 4.12, 13 April, 2003 ii Copyright 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 iv Thank you! 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 that is spelled correctly, it must have been one of the people below dropping me a line. Rosemary Bailey, Marc Bevand, Friedemann Brauer, Jan Busa, Markus Brühwiler, Pietro Braione, David Carlisle, José Carlos Santos, Mike Chapman, Pierre Chardaire, Christopher Chin, Carl Cerecke, Chris McCormack, Wim van Dam, Jan Dittberner, Michael John Downes, Matthias Dreier, David Dureisseix, Elliot, 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, 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, Michael Koundouros, Andrzej Kawalec, Alain Kessi, Christian Kern, Jörg Knappen, Kjetil Kjernsmo, Maik Lehradt, Rémi Letot, Johan Lundberg, Alexander Mai, Martin Maechler, Aleksandar S Milosevic, Henrik Mitsch, Claus Malten, Kevin Van Maren, Philipp Nagele, Lenimar Nunes de Andrade, Urs Oswald, Demerson Andre Polli, Maksym Polyakov Hubert Partl, John Refling, Mike Ressler, Brian Ripley, Young U. Ryu, Bernd Rosenlecher, Chris Rowley, Risto Saarelma, Hanspeter Schmid, Craig Schlenter, Baron Schwartz, Christopher Sawtell, Geoffrey Swindale, Laszlo Szathmary, Boris Tobotras, Josef Tkadlec, Scott Veirs, 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 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. 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. 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 roughly understand how L A TEX works. 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. Many examples demonstrate how to use one of L A TEX s main strengths. At the end of the chapter are tables listing all mathematical symbols available in L A TEX. Chapter 4 explains indexes, bibliography generation and inclusion of EPS graphics. It introduces creation of PDF documents with pdfl A TEX and presents some handy extension packages. Chapter 5 shows how to use L A TEX for creating graphics. Instead of drawing a picture with some graphics program, saving it to a file and then including it into L A TEX you describe the picture and have L A TEX draw it for you. Chapter 6 contains some potentially dangerous information about how to alter 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 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. 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 [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 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 at one of the Comprehensive TEX Archive Network (CTAN) sites. The homepage is at All packages can also be retrieved from the ftp archive ftp://www.ctan.org and its various mirror sites all over the world. They can be found e.g. at ftp://ctan.tug.org (US), ftp://ftp.dante.de (Germany), ftp://ftp.tex.ac.uk (UK). If you are not in one of these countries, choose the archive closest to you. 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 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 Information Technology and 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 A Typical Command Line Session The Layout of the Document Document Classes Packages Page Styles Files You Might Encounter Big Projects Typesetting Text The Structure of Text and Language Line Breaking and Page Breaking Justified Paragraphs Hyphenation Ready-Made Strings Special Characters and Symbols viii CONTENTS Quotation Marks Dashes and Hyphens Tilde ( ) Degree Symbol ( ) The Euro Currency Symbol () Ellipsis (... ) Ligatures Accents and Special Characters International Language Support Support for Portuguese Support for French Support for German Support for Korean Support for Cyrillic 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 Protecting Fragile Commands Typesetting Mathematical Formulae General Grouping in Math Mode Building Blocks of a Mathematical Formula Math Spacing Vertically Aligned Material Phantoms Math Font Size Theorems, Laws, Bold Symbols List of Mathematical Symbols Specialities Including Encapsulated PostScript Graphics Bibliography Indexing CONTENTS ix 4.4 Fancy Headers The Verbatim Package Downloading and Installing L A TEX Packages Working with pdfl A TEX PDF Documents for the Web The Fonts Using Graphics Hypertext Links Problems with Links Problems with Bookmarks Creating Presentations with pdfscreen Producing Mathematical Graphics Overview The picture Environment Basic Commands Line Segments Arrows Circles Text and Formulas The \multiput and the \linethickness command Ovals. The \thinlines and the \thicklines command Multiple Use of Predefined Picture Boxes Quadratic Bézier Curves Catenary Rapidity in the Special Theory of Relativity XY-pic 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 x CONTENTS 6.6 Boxes Rules and Struts Bibliography 115 Index 117 List of Figures 1.1 A Minimal L A TEX File Example of a Realistic Journal Article Example fancyhdr Setup Example pdfscreen input file 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 A bag full of Euro symbols Accents and Special Characters Preamble forportuguese documents Special commands for French German Special Characters Bulgarian, Russian, and Ukrainian 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 xiv LIST OF TABLES 4.2 Index Key Syntax Examples Fonts Font Sizes Absolute Point Sizes in Standard Classes Math Fonts TEX Units Chapter 1 Things You Need to Know The first part of this chapter presents a short overview of the philosophy and history of L A TEX 2ε. The second part 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, which you will need to understand the rest of this book. 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 that 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. These days L A TEX is maintained by Frank Mittelbach. 2 Things You Need to Know 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. 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 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 to describe 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 that 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. They can see on the screen how the final work will look when it is printed. When using L A TEX it is not normally 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 much more important 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. 1 What you see is what you get. 1.2 Basics 3 The line length has to be short enough not to 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 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. Users only need to learn a few easy-to-understand commands that 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 ;-) 4 Things You Need to Know 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. 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 that 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 line break 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. # $ % ^ & _ { } ~ \ 2 Rumour says that this is one of the key elements that will be addressed in the upcoming L A TEX3 system. 1.3 L A TEX Input Files 5 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 line breaking 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 non-letter. 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 13th 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
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks