A User's Guide to the Lout Document Formatting System
Total Page:16
File Type:pdf, Size:1020Kb
A User’s Guide to the Lout Document Formatting System Jeffrey H. Kingston Version 3.40 June 2013 Copyright 1991, 2013 Jeffrey H. Kingston, School of Information Technologies, The University of Sydney 2006, Australia. ISBN 0 86758 9515. Preface This User’s Guide brings together in one document everything needed for the day-to-day use of Version 3 of the Lout document formatting system. There are three other documents describing Lout: the Expert’s Guide [5], which you need if you want to add new features to Lout; a journal paper on the design and implementation of Lout [3]; and a set of overhead transparencies [4]that cover much the same ground as this Guide. These documents are all distributed with the software. Lout is distributed free of charge under the GNU Public License. The primary source is ftp://ftp.it.usyd.edu.au/jeff/lout containing a gzipped tar file of the current version, and various other things including a PostScript version of this guide. The distribution contains source code, libraries,documentation, license, and installation instructions. A mailing list has been set up for discussion of all topics related to Lout. To subscribe (or unsubscribe), visit http://lists.nongnu.org/mailman/listinfo/lout-users After subscribing, to post an item send email to [email protected]; it will be forwarded to all subscribers via email. There is also a web site at http://savannah.nongnu.org/projects/lout. Lout began in 1984 as a research project into the design of a high-level language for document formatting. At that time my name for the subject was ‘document layout,’ and this terminology survives in the name ‘Lout’. The initial design was strongly influenced by Brian W. Kernighan and Lorinda L.Cherry’s eqn equation formatter [2], and also by Brian K.Reid’s Scribe system [9]. That research phase ended in October 1991 with the first public release. Since then the system has been steadily improved and extended. Optimal paragraph break- ing and automatic hyphenation were copied from Donald E. Knuth’s TEX system [6], and the optimal paragraph breaking algorithm was applied to the problem of producing optimal page breaks. The first implementations of horizontal galleys and optimal page breaking were by my student Gabor Inokai. Vincent Tan contributed the PDF back end. Ludovic Courtès contributed the @Math package and set up the current mailing list. ValeriyE. Ushakov smoothed the path for many people,by his contributionsto improving Lout’s robustness,and his tirelessmanagement of and responses to the Lout mailing list. The number of other people who have offered comments and suggestions to me is so great that it is quite out of my power to acknowledge them individu- ally. I hope that seeing their ideas adopted will be thanks enough. Jeffrey H. Kingston School of Information Technologies The University of Sydney 2006, Australia [email protected] Contents Preface .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ii Chapter 1. The Basics .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 1 1.1. Getting started .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 1 1.2. Objects, symbols, options, and lengths .. .. .. .. .. .. .. .. .. .. 3 1.3. Spaces and braces .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 5 1.4. Characters .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 7 1.5. The empty object .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 12 1.6. Fonts and font sizes .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 12 1.7. Headings .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 16 1.8. Starting a new line, paragraph, or page .. .. .. .. .. .. .. .. .. .. 17 1.9. Paragraph breaking .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 18 1.10. Line spacing .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 23 1.11. Hyphenation .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 23 1.12. Margin kerning .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 24 1.13. Underlining .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 24 1.14. Languages other than English .. .. .. .. .. .. .. .. .. .. .. .. 25 1.15. The current date and time .. .. .. .. .. .. .. .. .. .. .. .. .. 27 1.16. Superscripts and subscripts .. .. .. .. .. .. .. .. .. .. .. .. 28 1.17. Verbatim and piped text .. .. .. .. .. .. .. .. .. .. .. .. .. 28 1.18. Drop capitals .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 30 1.19. Alternative conventions for white space .. .. .. .. .. .. .. .. .. 31 Chapter 2. Documents With Structure .. .. .. .. .. .. .. .. .. .. .. .. 33 2.1. Displays .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 33 2.2. Lists .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 34 2.3. Footnotes and endnotes .. .. .. .. .. .. .. .. .. .. .. .. .. .. 40 2.4. Margin notes and arbitrary placement .. .. .. .. .. .. .. .. .. .. 43 2.5. Theorems, lemmas, corollaries, definitions, propositions, examples, and claims .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 45 2.6. Figures and tables .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 46 2.7. Large-scale structure: chapters, sections, etc. .. .. .. .. .. .. .. .. 50 2.8. Cross references and links .. .. .. .. .. .. .. .. .. .. .. .. .. 53 2.9. Tables of contents .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 57 2.10. Glossaries .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 58 2.11. Indexes .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 61 2.12. Multiple columns .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 69 2.13. Defining new symbols .. .. .. .. .. .. .. .. .. .. .. .. .. .. 69 Chapter 3. Types of Documents .. .. .. .. .. .. .. .. .. .. .. .. .. .. 72 3.1. Ordinary documents .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 72 3.2. Technical reports .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 76 3.3. Books .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 81 3.4. Overhead transparencies .. .. .. .. .. .. .. .. .. .. .. .. .. .. 89 3.5. Stand-alone illustrations .. .. .. .. .. .. .. .. .. .. .. .. .. .. 93 3.6. Plain text documents .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 95 3.7. PDF (Adobe Portable Document Format) documents .. .. .. .. .. .. 96 3.8. Organizing large documents .. .. .. .. .. .. .. .. .. .. .. .. .. 97 Chapter 4. Changing the Overall Format .. .. .. .. .. .. .. .. .. .. .. .. 99 4.1. Setup files .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 99 4.2. Page size and page orientation .. .. .. .. .. .. .. .. .. .. .. .. 102 4.3. Page margins, page boxes, and page backgrounds .. .. .. .. .. .. .. 104 4.4. Page numbers and running headers .. .. .. .. .. .. .. .. .. .. .. 107 Chapter 5. References .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 112 5.1. Setting up a bibliographic database .. .. .. .. .. .. .. .. .. .. .. 112 5.2. Citation .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 113 5.3. Labelled (as opposed to numbered) references .. .. .. .. .. .. .. .. 115 5.4. Constructing database entries .. .. .. .. .. .. .. .. .. .. .. .. 116 5.5. Changing the appearance of citations and the reference list .. .. .. .. 119 5.6. Creating your own entry types and formats .. .. .. .. .. .. .. .. .. 122 Chapter 6. Tables .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 125 6.1. Getting started .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 125 6.2. Changing the appearance of cells .. .. .. .. .. .. .. .. .. .. .. 127 6.3. Changing the appearance of rows .. .. .. .. .. .. .. .. .. .. .. 129 6.4. Rules .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 130 6.5. Margins .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 132 6.6. Cell width and height .. .. .. .. .. .. .. .. .. .. .. .. .. .. 133 6.7. Indenting and struts .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 134 6.8. Aligned columns .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 134 6.9. Spanning columns and rows .. .. .. .. .. .. .. .. .. .. .. .. .. 136 6.10. Vertical alignment of tables .. .. .. .. .. .. .. .. .. .. .. .. 139 iv 6.11. Multi-page tables .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 140 6.12. Plain text tables .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 142 6.13. Changing the overall format .. .. .. .. .. .. .. .. .. .. .. .. 144 6.14. Summary of options .. .. .. .. .. .. .. .. .. .. .. .. .. .. 145 Chapter 7. Mathematics .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 148 7.1. Getting started .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 148 7.2. Commonly used symbols .. .. .. .. .. .. .. .. .. .. .. .. .. 149 7.3. Matrices .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 150 7.4. Displaying equations .. .. .. .. .. .. .. .. .. .. .. .. .. .. 153 7.5. Defining new mathematical symbols .. .. .. .. .. .. .. .. .. .. 155 7.6. Summary .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 156 Chapter 8. Basic Graphics .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 165 8.1. Colour .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 165 8.2. Textures .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 166 8.3. Boxes and rules .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 168 8.4. Outlined words .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 172 8.5. Rotation .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 172 8.6. Scaling .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 173 8.7. Clipping .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 175 8.8. Mirror reflections .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 176 8.9. Including an illustration .. .. .. .. .. .. .. .. .. .. .. .. .. .. 176 8.10. Precise object placement .. .. .. .. .. .. .. .. .. .. .. .. .. 177 Chapter 9. Diagrams .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 182 9.1. Introduction