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.38 October 2008 Copyright 1991, 2008 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 directory ftp://ftp.it.usyd.edu.au/jeff/lout containing a gzipped tar file of the current version (currently lout-3.38.tar.gz), 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.planix.com/mailman/options.cgi/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 Lout web site at http://lout.wiki.sourceforge.net/. 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 of Lout. 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 opti- mal 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. Valeriy E. Ushakov smoothed the path for many people, by his contributions to improving Lout’s robustness, and his tireless management of and responses to the Lout mailing list. The current mailing list maintainer is Greg Woods. 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 acknowl- edge them individually. 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 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 6 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 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 24 1.12. Margin kerning .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 24 1.13. Underlining .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 25 1.14. Languages other than English .. .. .. .. .. .. .. .. .. .. .. .. 26 1.15. The current date and time .. .. .. .. .. .. .. .. .. .. .. .. .. 28 1.16. Superscripts and subscripts .. .. .. .. .. .. .. .. .. .. .. .. 29 1.17. Verbatim and piped text .. .. .. .. .. .. .. .. .. .. .. .. .. 29 1.18. Drop capitals .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 31 1.19. Alternative conventions for white space .. .. .. .. .. .. .. .. .. 31 Chapter 2. Adding Structure to Documents .. .. .. .. .. .. .. .. .. .. .. 33 2.1. Displays .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 33 2.2. Lists .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 34 2.3. Footnotes and endnotes .. .. .. .. .. .. .. .. .. .. .. .. .. .. 41 2.4. Margin notes and arbitrary placement .. .. .. .. .. .. .. .. .. .. 43 2.5. Theorems, lemmas, corollaries, definitions, propositions, examples, and claims .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 45 2.6. Figures and tables .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 47 2.7. Large-scale structure: chapters, sections, etc. .. .. .. .. .. .. .. .. 51 2.8. Cross references and links .. .. .. .. .. .. .. .. .. .. .. .. .. 54 2.9. Tables of contents .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 57 2.10. Glossaries .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 59 2.11. Indexes .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 62 2.12. Multiple columns .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 70 2.13. Defining new symbols .. .. .. .. .. .. .. .. .. .. .. .. .. .. 70 Chapter 3. Types of Documents .. .. .. .. .. .. .. .. .. .. .. .. .. .. 74 3.1. Ordinary documents .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 74 3.2. Technical reports .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 78 3.3. Books .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 84 3.4. Overhead transparencies .. .. .. .. .. .. .. .. .. .. .. .. .. .. 92 3.5. Stand-alone illustrations .. .. .. .. .. .. .. .. .. .. .. .. .. .. 96 3.6. Plain text documents .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 98 3.7. PDF (Adobe Portable Document Format) documents .. .. .. .. .. .. 99 3.8. Organizing large documents .. .. .. .. .. .. .. .. .. .. .. .. .. 100 Chapter 4. Changing the Overall Format .. .. .. .. .. .. .. .. .. .. .. .. 102 4.1. Setup files .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 102 4.2. Page size and page orientation .. .. .. .. .. .. .. .. .. .. .. .. 105 4.3. Page margins, page boxes, and page backgrounds .. .. .. .. .. .. .. 107 4.4. Page numbers and running headers .. .. .. .. .. .. .. .. .. .. .. 110 Chapter 5. References .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 115 5.1. Setting up a bibliographic database .. .. .. .. .. .. .. .. .. .. .. 115 5.2. Citation .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 116 5.3. Labelled (as opposed to numbered) references .. .. .. .. .. .. .. .. 118 5.4. Constructing database entries .. .. .. .. .. .. .. .. .. .. .. .. 119 5.5. Changing the appearance of citations and the reference list .. .. .. .. 123 5.6. Creating your own entry types and formats .. .. .. .. .. .. .. .. .. 126 Chapter 6. Tables .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 129 6.1. Getting started .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 129 6.2. Changing the appearance of cells .. .. .. .. .. .. .. .. .. .. .. 131 6.3. Changing the appearance of rows .. .. .. .. .. .. .. .. .. .. .. 133 6.4. Rules .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 134 6.5. Margins .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 136 6.6. Cell width and height .. .. .. .. .. .. .. .. .. .. .. .. .. .. 137 6.7. Indenting and struts .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 138 6.8. Aligned columns .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 138 6.9. Spanning columns and rows .. .. .. .. .. .. .. .. .. .. .. .. .. 140 6.10. Vertical alignment of tables .. .. .. .. .. .. .. .. .. .. .. .. 143 iv 6.11. Multi-page tables .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 144 6.12. Plain text tables .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 147 6.13. Changing the overall format .. .. .. .. .. .. .. .. .. .. .. .. 148 6.14. Summary of options .. .. .. .. .. .. .. .. .. .. .. .. .. .. 149 Chapter 7. Mathematics .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 153 7.1. Getting started .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 153 7.2. Commonly used symbols .. .. .. .. .. .. .. .. .. .. .. .. .. 154 7.3. Matrices .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 155 7.4. Displaying equations .. .. .. .. .. .. .. .. .. .. .. .. .. .. 158 7.5. Defining new mathematical symbols .. .. .. .. .. .. .. .. .. .. 160 7.6. Summary .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 161 Chapter 8. Basic Graphics .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 170 8.1. Colour .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 170 8.2. Textures .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 171 8.3. Boxes and rules .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 173 8.4. Outlined words .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 177 8.5. Rotation .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 178 8.6. Scaling .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 178 8.7. Clipping .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 180 8.8. Mirror reflections .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 181 8.9. Including an illustration .. .. .. .. .. .. .. .. .. .. .. .. .. .. 182 8.10. Precise object placement .. .. .. .. .. .. .. .. .. .. .. .. .. 183 Chapter