TEX BY TOPIC, A TEXNICIAN’S REFERENCE VICTOR EIJKHOUT DOCUMENT REVISION 1.5, 2019 Copyright c 1991-2013 Victor Eijkhout. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ”GNU Free Documentation License”. This document is based on the book TEX by Topic, copyright 1991-2019 Victor Eijkhout. This book was printed in 1991 by Addison-Wesley UK, ISBN 0-201-56882-9, reprinted in 1993, pdf version first made freely available in 2001. Cover design (lulu.com version): Joanna K. Wozniak (
[email protected]) Victor Eijkhout – TEX by Topic 1 2 Victor Eijkhout – TEX by Topic Contents License 15 Preface 21 1 The Structure of the TEX Processor 23 1.1 Four TEX processors 23 1.2 The input processor 24 1.2.1 Character input 24 1.2.2 Two-level input processing 24 1.3 The expansion processor 25 1.3.1 The process of expansion 25 1.3.2 Special cases: \expandafter, \noexpand, and \the 25 1.3.3 Braces in the expansion processor 26 1.4 The execution processor 26 1.5 The visual processor 27 1.6 Examples 28 1.6.1 Skipped spaces 28 1.6.2 Internal quantities and their representations 28 2 Category Codes and Internal States 29 2.1 Introduction 29 2.2 Initial processing 29 2.3 Category codes 30 2.4 From characters to tokens 32 2.5 The input processor as a finite state automaton 32 2.5.1 State