This document is free; you may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;. The first part of this chapter presents a brief overview of the philosophy and history of LATEX 2ε.
The Name of the Game
TEX
After reading this chapter you should have a rough understanding of how LATEX works, which you will need to understand the rest of this book.
L A TEX
Basics
Author, Book Designer, and Typesetter
When using LATEX, it is usually not possible to see the final output while typing text, but you can preview the final output on the screen after processing the file with LATEX.
Layout Design
Advantages and Disadvantages
Even complex structures such as footnotes, references, table of contents and bibliographies can be created easily. Although some parameters can be adjusted within a default document layout, designing a completely new layout is difficult and time-consuming.3.
L A TEX Input Files
- Spaces
- Special Characters
- L A TEX Commands
- Comments
The other symbols and many more can be printed with special commands in mathematical formulas or as accents. This can be used to write notes in the input file, which will not appear in the printed version.
Input File Structure
When LATEX encounters a % character while processing an input file, it ignores the rest of the current line, the line break, and all whitespace at the beginning of the next line. When all the essay work is done,4 you start the body of the text with the assignment.
A Typical Command Line Session
Open a shell or cmd window, cd to the directory where your input file is located and run LATEX on your input file. When your input file has an error, LATEX will tell you about it and stop processing your input file.
The Layout of the Document
Document Classes
If you're lucky, your LATEX system even comes with thedvipdftool, which allows you to convert your .dvi files directly to pdf.
Packages
This doesn't work with the article class, as it doesn't know about chapters. In addition, by default, chapters start on the next available page and the book class starts them on right-hand pages.
Page Styles
Files You Might Encounter
If you are processing a .dtx file, you will get documented macro code for the LATEX package contained in the .dtx file. It is read into the next compiler run and used to produce the table of contents.
Big Projects
In the following sections, you will learn how to force line breaks with e.g.\\ and paragraph breaks with e.g. If a completely new thought appears in the same paragraph, then it should be interrupted.
Line Breaking and Page Breaking
Justified Paragraphs
If you really want to start a "new line" or a "new page", use the corresponding command. If you use the drafti\documentclasscommand option, these lines will be marked with a thick black line in the right margin.
Hyphenation
Ready-Made Strings
Special Characters and Symbols
- Quotation Marks
- Dashes and Hyphens
- Tilde (∼)
- Slash (/)
- Degree Symbol (◦)
- The Euro Currency Symbol ( e )
- Ellipsis (
- Ligatures
- Accents and Special Characters
With the textcomp package, the degree symbol is also available as \textdegree or combined with C using \textcelsius. If you prefer the euro symbol to match your font, use the gen option instead of the official option.
International Language Support
- Support for Portuguese
- Support for French
- Support for German
- Support for Korean
- Writing in Greek
- Support for Cyrillic
- Support for Mongolian
- The Unicode option
Due to the large number of Cyrillic glyphs, they are arranged in four font encodings: T2A, T2B, T2C and X2.5. The CB bundle contains fonts in LGR encoding for the composition of Greek text. If you don't need Korean localization features, but just want to put Korean text, put the following line in the preamble instead.
The Space Between Words
SBL Hebrew is free for non-commercial use and available at http://www.sbl-site.org/educational/. The command \@ before a period indicates that this period ends a sentence, even if it follows a capital letter.
Titles, Chapters, and Sections
LATEX generates the table of contents by taking the section headings and page numbers from the last translation cycle of the document. You can then specify the index entry as an optional argument before the actual title.
Cross References
An example of some of the above commands can be found in Figure 1.2 on page 9. LATEX replaces \ref with the number of the section, subsection, figure, table, or statement after which the corresponding \label command was issued.
Footnotes
Emphasized Words
Environments
- Itemize, Enumerate, and Description
- Flushleft, Flushright, and Center
- Quote, Quotation, and Verse
- Abstract
- Printing Verbatim
- Tabular
The pos argument specifies the vertical position of the table relative to the baseline of the surrounding text. Use one of the letters t, b, and c to specify top, bottom, or center alignment of the table.
Floating Bodies
If LATEX does not position the floats as you expected, it is often just one float blocking one of the two floats. If the figure is not placed on the current page, it is determined if it is possible to create a floating page with this figure and perhaps some tables from the table queue.
Protecting Fragile Commands
In the example above, LATEX will really try (!) to place the figure right here (h).26. You will learn how to include PostScript drawings in your LATEX 2ε documents later in this introduction. in the body of the document).
The AMS -L A TEX bundle
Single Equations
Math Mode
Most spaces and line breaks have no meaning, since all spaces are either logically derived from the mathematical expressions, or must be specified with special commands such as \, \quad or \qquad (we'll come back to them later, see section 3.7). If you want to type normal text inside a formula (normal upright font and normal spacing) then you must enter the text using the \text{..} command (see also section 3.8 on page 76).
Building Blocks of a Mathematical Formula
Mathematicians can be very picky about which symbols are used: it would be conventional here to use the 'blackboard bold' font, which is obtained with \mathbb from the packageamssymb.4 The last example becomes. Round and square brackets can be entered with their corresponding keys and braces with \{, but all other separators are generated with special commands (e.g. \updownarrow).
Single Equations that are Too Long: multline
Here it is actually the RHS that is too long to fit on one line.
Multiple Equations
Problems with Traditional Commands
This is better than (3.5), but this has the disadvantage that the equals sign loses its natural greater meaning relative to the plus operator before k. This is still not optimal, as the gaps around equality are too large.
IEEEeqnarray Environment
The power of IEEEeqnarray is the ability to specify the number of columns in the comparison array. In addition, in addition to l, c, r, L, C, R for math mode input, there are also s, t, u for left, centered, and right text mode input.
Common Usage
If a particular line should not have an equation number, you can suppress the number by using \nonumber (or \IEEEnonumber). Place the marks just before the line break \\ or next to the equation it belongs to.
Arrays and Matrices
If a label \label{eq:..} is defined on such a line, then this label is passed on to the next equation number that is not suppressed. The maximum number is 10, but it can be customized (although it is not very often that you need 10 columns!):.
Spacing in Math Mode
Phantoms
You can use the \phantomcommand to reserve space for characters that do not appear in the final output. If you want to enter a lot of isotopes as in the example, the themhchem package is also very useful for entering isotopes and chemical formulas.
Fiddling with the Math Fonts
Bold Symbols
If you want to change the appearance of the chapter name in the title bar, all you need is the "renew"\chaptermark command. The full document is \href{manual.pdf}{here}. which produces the text "The whole document is here".
Theorems, Lemmas,
Proofs and End-of-Proof Symbol
The reason for this is the internal structure of IEEEeqnarray: it always puts two invisible columns on either side of the array, which only contain stretching space. This column will only be needed on the last line if the \qedhere command is inserted there.
List of Mathematical Symbols
To use images in the EPS format, you must have a PostScript printer2 available for output. A good set of commands for including graphics is provided in the graphicx package by D.
Bibliography
The graphic is first rotated by an angle of 90 degrees and then scaled to the final width of 0.5 times the width of a standard paragraph. This allows you to maintain a bibliographic database and then pull out the references relevant to things you have cited in your paper.
Indexing
You enter the index commands at the points in the text that you want the final index entries to point to. The showidx package provided with LATEX 2ε prints all index entries in the left margin of the text.
Fancy Headers
To get the sorting correct, use the @ character as shown in the Käse and école examples above. In any case, I suggest you pick up the documentation for the package at the address mentioned in the footnote.
The Verbatim Package
Installing Extra Packages
Note that you may need to run LATEX several times before it gets the right cross-references. Don't forget to run LATEX on the .dtx one last time before proceeding to step 5.
Working with pdfL A TEX
- PDF Documents for the Web
- The Fonts
- Using Graphics
- Hypertext Links
- Problems with Links
- Problems with Bookmarks
- Source Compatibility Between L A TEX and pdfL A TEX
On systems where LATEX is not called from the command line, you may find a dedicated button in the TEX GUI. In the example above, I've included the hyperref package, even in the non-pdf version.
The Fonts
If you installed TeXLive, you already have some on ../texmf-dist/. fonts/opentype, just install them in your operating system. If you rarely need an exotic character, you can just choose it from the character palette.
The number of characters in a font has grown, but the number of keys on a regular keyboard has not. If you write a large amount of text in a foreign language, you can install a keyboard for that language and print out the character positions.
Creating Presentations
The options allow us to choose the size of the panel (22 mm in this case) and its location (on the right side of the body). >), it allows us to suppress a certain frame in one of the versions of the presentation.
Overview
Furthermore, a large number of LATEX extensions have been designed to overcome these limitations. A very thorough discussion of LATEX and TEX strategies for graphics (and fonts) can be found in TEX Unbound [16].
The picture Environment
- Basic Commands
- Line Segments
- Arrows
- Circles
- Text and Formulas
- Ovals
- Multiple Use of Predefined Picture Boxes
- Quadratic Bézier Curves
- Catenary
- Rapidity in the Special Theory of Relativity
The second optional pair, (x0, y0), assigns arbitrary coordinates to the lower left corner of the reserved rectangle. Notice the effect of the \thicklines command on the two arrows pointing to the upper left.
The PGF and TikZ Graphics Packages
- New Commands
- New Environments
- Extra Space
- Commandline L A TEX
- Your Own Package
You may have noticed that all the commands I introduce in this book are listed in a box and that they appear in the index at the end of the book. This is short for "Not So Short Introduction to LATEX 2ε". Such a command could be useful if you had to repeatedly type the title of this book.
Fonts and Sizes
Font Changing Commands
ProvidesPackage tells LATEX the name of the package and allows it to issue a meaningful error message when you try to include the package twice. Font-size commands also change line spacing, but only if the paragraph ends within the range of the font-size command.
Danger, Will Robinson, Danger
Advice
Spacing
- Line Spacing
- Paragraph Formatting
- Horizontal Space
- Vertical Space
If a space needs to be preserved at the top or bottom of the page, use the star version of the command, \vspace*, instead of \vspace. The extra space between two lines of the same paragraph or within a table is specified by.
Page Layout
This is because it is difficult for the eyes to move from the end of one line to the start of the next. This second command is actually more useful than the \setlength command because it works against the existing settings.
More Fun With Lengths
Experience shows that reading becomes difficult as soon as there are more characters on a single line. The following 3 commands allow you to determine the width, height and depth of a text string.
Boxes
The pos parameter can take one of the letters c, t, or b to control the vertical alignment of the box, relative to the baseline of the surrounding text. You can even set the width to 0pt so that the text inside the box is printed without affecting the surrounding boxes.
Rules
Now that we control the horizontal, the obvious next step is to go after the vertical.6 No problem for LATEX. The license that comes with TEX lets you do whatever you want with the source, but you can only call the result of your work TEX if the program passes a set of tests that Knuth also provided.
What to Install
TEX on Mac OS X
Get a TEX Distribution
Picking an Editor
Treat yourself to PDFView
TEX on Windows
Getting TEX
A L A TEX editor
Document Preview
Working with graphics
TEX on Linux
- A Minimal L A TEX File
- Example of a Realistic Journal Article
- Example fancyhdr Setup
- Sample code for the beamer class
- Example Package
- Layout parameters for this book
- 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 for Portuguese documents
- Special commands for French
- German Special Characters
- Preamble for Greek documents
- Greek Special Characters
- Bulgarian, Russian, and Ukrainian
- Float Placing Permissions
- Math Mode Accents
- Greek Letters
- Binary Relations
- Binary Operators
- BIG Operators
- Arrows
- Arrows as Accents
- Delimiters
- Large Delimiters
- Miscellaneous Symbols
- Non-Mathematical Symbols
- AMS Delimiters
- AMS Greek and Hebrew
- Math Alphabets
- AMS Binary Operators
- AMS Binary Relations
- AMS Arrows
- AMS Negated Binary Relations and Arrows
- AMS Miscellaneous
- Key Names for graphicx Package
- Index Key Syntax Examples
- Fonts
- Font Sizes
- Absolute Point Sizes in Standard Classes
- Math Fonts
- TEX Units
Packages in the 'graphics' bundle. graphics' bundle asgrfguide.tex, available from the same source from which your LATEX distribution came. Comes with the 'tools' bundle as verbatim.dtx, available from the same source your LATEX distribution came from.