TeX by Topic, A TeXnician's Reference

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Author(s): Victor Eijkhout
Edition: Revision 1.5
Publisher: Victor Eijkhout, GNU Free Documentation License
Year: 2019

Language: English
Pages: 325

License
Preface
The Structure of the TeX Processor
Four TeX processors
The input processor
Character input
Two-level input processing
The expansion processor
The process of expansion
Special cases: \expandafter, \noexpand, and \the
Braces in the expansion processor
The execution processor
The visual processor
Examples
Skipped spaces
Internal quantities and their representations
Category Codes and Internal States
Introduction
Initial processing
Category codes
From characters to tokens
The input processor as a finite state automaton
State N: new line
State S: skipping spaces
State M: middle of line
Accessing the full character set
Transitions between internal states
0: escape character
1–4, 7–8, 11–13: non-blank characters
5: end of line
6: parameter
7: superscript
9: ignored character
10: space
14: comment
15: invalid
Letters and other characters
The 92par token
Spaces
Skipped spaces
Optional spaces
Ignored and obeyed spaces
More ignored spaces

Control space
`32'
More about line ends
Obeylines
Changing the \endlinechar
More remarks about the end-of-line character
More about the input processor
The input processor as a separate process
The input processor not as a separate process
Recursive invocation of the input processor
The @ convention
Characters
Character codes
Control sequences for characters
Denoting characters to be typeset: \char
Implicit character tokens: \let
Accents
Testing characters
Uppercase and lowercase
Uppercase and lowercase codes
Uppercase and lowercase commands
Uppercase and lowercase forms of keywords
Creative use of \uppercase and \lowercase
Codes of a character
Converting tokens into character strings
Output of control sequences
Category codes of a \string
Fonts
Fonts
Font declaration
Fonts and tfm files
Querying the current font and font names
\nullfont
Font information
Font dimensions
Kerning
Italic correction
Ligatures
Boundary ligatures
Boxes
Boxes
Box registers
Allocation: \newbox
Usage: \setbox, \box, \copy
Testing: \ifvoid, \ifhbox, \ifvbox
The \lastbox
Natural dimensions of boxes
Dimensions of created horizontal boxes
Dimensions of created vertical boxes
Examples
More about box dimensions
Predetermined dimensions
Changes to box dimensions
Moving boxes around
Box dimensions and box placement
Boxes and negative glue
Overfull and underfull boxes
Opening and closing boxes
Unboxing
Text in boxes
Assorted remarks
Forgetting the \box
Special-purpose boxes
The height of a vertical box in horizontal mode
More subtleties with vertical boxes
Hanging the \lastbox back in the list
Dissecting paragraphs with \lastbox
Horizontal and Vertical Mode
Horizontal and vertical mode
Horizontal mode
Vertical mode
Horizontal and vertical commands
The internal modes
Restricted horizontal mode
Internal vertical mode
Boxes and modes
What box do you use in what mode?
What mode holds in what box?
Mode-dependent behaviour of boxes
Modes and glue
Migrating material
\vadjust
Testing modes
Numbers
Numbers and s
Integers
Denotations: integers
Denotations: characters
Internal integers
Internal integers: other codes of a character

Other internal quantities: coersion to integer
Trailing spaces
Numbers
Integer registers
Arithmetic
Arithmetic statements
Floating-point arithmetic
Fixed-point arithmetic
Number testing
Remarks
Character constants
Expanding too far / how far
Dimensions and Glue
Definition of and
Definition of dimensions
Definition of glue
Conversion of to
Registers for \dimen and \skip
Arithmetic: addition
Arithmetic: multiplication and division
More about dimensions
Units of measurement
Dimension testing
Defined dimensions
More about glue
Stretch and shrink
Glue setting
Badness
Glue and breaking
\kern
Glue and modes
The last glue item in a list: backspacing
Examples of backspacing
Glue in trace output
Rules and Leaders
Rules
Rule dimensions
Leaders
Rule leaders
Box leaders
Evenly spaced leaders
Assorted remarks
Rules and modes
Ending a paragraph with leaders
Leaders and box registers
Output in leader boxes
Box leaders in trace output
Leaders and shifted margins
Grouping
The grouping mechanism
Local and global assignments
Group delimiters
More about braces
Brace counters
The brace as a token
Open and closing brace control symbols
Macros
Introduction
Layout of a macro definition
Prefixes
The definition type
The parameter text
Undelimited parameters
Delimited parameters
Examples with delimited arguments
Empty arguments
The macro parameter character
Brace delimiting
Construction of control sequences
Token assignments by \let and \futurelet
\let
\futurelet
Assorted remarks
Active characters
Macros versus primitives
Tail recursion and the \loop macro
Macro techniques
Unknown number of arguments
Examining the argument
Optional macro parameters with \futurelet
Two-step macros
A comment environment
Expansion
Introduction
Ordinary expansion
Reversing expansion order
One step expansion: \expandafter
Total expansion: \edef
\afterassignment
\aftergroup
Preventing expansion
\noexpand
\noexpand and active characters
\relax
\relax and \csname
Preventing expansion with \relax
TeX inserts a \relax
The value of non-macros; \the
Examples
Expanding after
Defining inside an \edef
Expansion and \write
Controlled expansion inside an \edef
Multiple prevention of expansion
More examples with \relax
Example: category code saving and restoring
Combining \aftergroup and boxes
More expansion
Conditionals
The shape of conditionals
Character and control sequence tests
\if
\ifcat
\ifx
Mode tests
Numerical tests
Other tests
Dimension testing
Box tests
I/O tests
Case statement
Special tests
The \newif macro
Evaluation of conditionals
Assorted remarks
The test gobbles up tokens
The test wants to gobble up the \else or \fi
Macros and conditionals; the use of \expandafter
Incorrect matching
Conditionals and grouping
A trick
More examples of expansion in conditionals
Token Lists
Token lists
Use of token lists

Token list registers
Examples
Operations on token lists: stack macros
Executing token lists
Baseline Distances
Interline glue
The perceived depth of boxes
Terminology
Additional remarks
Paragraph Start
When does a paragraph start
What happens when a paragraph starts
Assorted remarks
Starting a paragraph with a box
Starting a paragraph with a group
Examples
Stretchable indentation
Suppressing indentation
An indentation scheme
A paragraph skip scheme
Paragraph End
The way paragraphs end
The \par command and the \par token
Paragraph filling: \parfillskip
Assorted remarks
Ending a paragraph and a group at the same time
Ending a paragraph with \hfill\break
Ending a paragraph with a rule
No page breaks in between paragraphs
Finite \parfillskip
A precaution for paragraphs that do not indent
Paragraph Shape
The width of text lines
Shape parameters
Hanging indentation
General paragraph shapes: \parshape
Assorted remarks
Centred last lines
Indenting into the margin
Hang a paragraph from an object
Another approach to hanging indentation
Hanging indentation versus \leftskip shifting
More examples
Line Breaking
Paragraph break cost calculation
Badness
Penalties and other break locations
Demerits
The number of lines of a paragraph
Between the lines
The process of breaking
Three passes
Tolerance values
Discretionaries
Hyphens and discretionaries
Examples of discretionaries
Hyphenation
Start of a word
End of a word
TeX2 versus TeX3
Patterns and exceptions
Switching hyphenation patterns
Spacing
Introduction
Automatic interword space
User interword space
Control space and tie
More on the space factor
Space factor assignments
Punctuation
Other non-letters
Other influences on the space factor
Characters in Math Mode
Mathematical characters
Delimiters
Delimiter codes
Explicit \delimiter commands
Finding a delimiter; successors
\big, \Big, \bigg, and \Bigg delimiter macros
Radicals
Math accents
Fonts in Formulas
Determining the font of a character in math mode
Initial family settings
Family definition
Some specific font changes
Change the font of ordinary characters and uppercase Greek
Change uppercase Greek independent of text font
Change the font of lowercase Greek and mathematical symbols
Assorted remarks
New fonts in formulas
Evaluating the families
Mathematics Typesetting
Math modes
Styles in math mode
Superscripts and subscripts
Choice of styles
Classes of mathematical objects
Large operators and their limits
Vertical centring: \vcenter
Mathematical spacing: mu glue
Classification of mu glue
Muskip registers
Other spaces in math mode
Generalized fractions
Underlining, overlining
Line breaking in math formulas
Font dimensions of families 2 and 3
Symbol font attributes
Extension font attributes
Example: subscript lowering
Display Math
Displays
Displays in paragraphs
Vertical material around displays
Glue setting of the display math list
Centring the display formula: displacement
Equation numbers
Ordinary equation numbers
The equation number on a separate line
Non-centred displays
Alignment
Introduction
Horizontal and vertical alignment
Horizontal alignments: \halign
Vertical alignments: \valign
Material between the lines: \noalign
Size of the alignment
The preamble
Infinite preambles
Brace counting in preambles
Expansion in the preamble
\tabskip
The alignment
Reading an entry
Alternate specifications: \omit
Spanning across multiple columns: \span
Rules in alignments
End of a line: \cr and \crcr
Example: math alignments
Page Shape
The reference point for global positioning
\topskip
Page height and depth
Page Breaking
The current page and the recent contributions
Activating the page builder
Page length bookkeeping
Breakpoints
Possible breakpoints
Breakpoint penalties
Breakpoint computation
\vsplit
Examples of page breaking
Filling up a page
Determining the breakpoint
The page builder after a paragraph
Output Routines
The \output token list
Output and \box255
Marks
Assorted remarks
Hazards in non-trivial output routines
Page numbering
Headlines and footlines in plain TeX
Example: no widow lines
Example: no indentation top of page
More examples of output routines
Insertions
Insertion items
Insertion class declaration
Insertion parameters
Moving insertion items from the contributions list
Insertions in the output routine
Plain TeX insertions
File Input and Output
Including files: \input and \endinput
File I/O
Opening and closing streams
Input with \read
Output with \write
Whatsits
Assorted remarks
Inspecting input
Testing for existence of files
Timing problems
\message versus \immediate\write16
Write inside a vertical box
Expansion and spaces in \write and \message
Allocation
Allocation commands
\count, \dimen, \skip, \muskip, \toks
\box, \fam, \write, \read, \insert
Ground rules for macro writers
Running TeX
Jobs
Start of the job
End of the job
The log file
Run modes
TeX and the Outside World
TeX, IniTeX, VirTeX
Formats: loading
Formats: dumping
Formats: preloading
The knowledge of IniTeX
Memory sizes of TeX and IniTeX
More about formats
Compatibility
Preloaded fonts
The plain format
The LaTeX format
Mathematical formats
Other formats
The dvi file
The dvi file format
Page identification
Magnification
Specials
Time
Fonts
Font metrics
Virtual fonts
Font files
Computer Modern
TeX and web
The TeX Users Group
Tracing
Meaning and content: \show, \showthe, \meaning
Show boxes: \showbox, \tracingoutput
Global statistics
Execution tracing
Errors, Catastrophes, and Help
Error messages
Overflow errors
Buffer size (500)
Exception dictionary (307)
Font memory (20,000)
Grouping levels
Hash size (2100)
Number of strings (3000)
Input stack size (200)
Main memory size (30,000)
Parameter stack size (60)
Pattern memory (8000)
Pattern memory ops per language
Pool size (32,000)
Save size (600)
Semantic nest size (40)
Text input levels (6)
The Grammar of TeX
Notations
Keywords
Specific grammatical terms

,
`{`} and

Differences between TeX versions 2 and 3
Glossary of TeX Primitives
Tables
Character tables
Computer modern fonts
Plain TeX math symbols
Mathcharacter codes
Delimiter codes
: ordinary symbols
: large operators
: binary operations
: relations
\delimiter macros
Index
Bibliography