The Book Class, Which Adds Support for Right and Left Page Masters, Running Headers, Footnotes, and Chapter, Section and Subsection Headings
Total Page:16
File Type:pdf, Size:1020Kb
The Book for SILE version v0.10.2 Simon Cozens Table of Contents What is SILE? . 2 SILE versus Word . 2 SILE versus TeX . 3 SILE versus InDesign . 4 Conclusion . 5 Getting Started . 6 A Basic SILE Document . 6 Installing . 7 Installing Preconfigured Packages . 7 Installing From Source . 7 Notes for Windows users . 8 Running SILE . 9 Let’s Do Something Cool . 9 SILE’s Input Language . 10 Defining the paper size . 10 Ordinary text . 11 Commands . 13 Environments . 14 The XML Flavour . 14 Some Useful SILE Commands . 18 Fonts . 18 Document Structure . 19 Chapters and Sections . 19 Footnotes . 20 Indentation and Spacing . 20 Breaks . 20 Hyphenation and Language . 21 Including Other Files and Code . 22 SILE Packages . 26 image . 26 rules . 28 color . 28 background . 28 rotate . 29 features . 29 unichar . 30 bidi.............................................30 pullquote . 31 raiselower . 31 grid.............................................32 linespacing . 33 verbatim . 34 font-fallback . 35 Packages usually used by other packages . 36 footnotes . 36 counters . 36 pdf....................................................37 frametricks . 37 insertions . 38 twoside . 38 masters . 39 infonode . 39 inputfilter . 40 SILE Macros and Commands . 42 A simple macro . 42 Macro with content . 43 Nesting macros . 44 SILE Settings . 46 Spacing Settings . 46 Typesetter settings . 48 Linebreaking settings . 49 Settings from Lua . 50 The Nitty Gritty . 52 Boxes, Glue and Penalties . 52 From Lua . 53 Frames . 54 Designing Basic Class Files . 58 Defining Commands . 60 Output Routines . 62 Exports . 64 Advanced Class Files 1: SILE As An XML Processor . 66 Handling Titles . 66 Sectioning . 68 Other Features . 69 Further Tricks . 72 Parallel Text . 72 Sidenotes . 75 SILE As A Library . 79 Debugging . 80 Conclusion . 82 Chapter 1 What is SILE? SILE is a typesetting system. Its job is to produce beautiful printed documents from raw content. The best way to understand what SILE is and what it does is to compare it to other systems which you may have heard of. 1.1 SILE versus Word When most people produce printed documents using a computer, they usually use desktop oriented word processing software such as Microsoft Word, iWork Pages, or LibreOffice Writer. SILE is not a word processor; it is a typesetting system. There are several important differences. The job of a word processor is to produce a document that looks exactly like what you type on the screen. By contrast the job of a typesetting system is to take raw content and produce a docu- ment that looks as good as possible. The input for SILE is a text document that includes instructions about how the content should be layed out on a page. In order to obtain the typeset result the input file must be processed to render the desired output. Word processors often describe themselves as WYSIWYG—What You See Is What You Get. SILE is cheerfully not WYSIWYG. In fact, you don’t see what you get until you get it. Rather, SILE documents are prepared initially in a text editor—a piece of software which focuses on the text itself and not what it looks like—and then run through SILE in order to produce a PDF document. For instance, most word processors are built roughly around the concept of a page with a central content area into which you type and style your content. The overall page layout is controlled by the page size and margins and more fine tuning is done by styling the content itself. You typically type continuously and when you hit the right margin, your cursor will automatically jump to the next line. In doing so the user interface shows you where the lines will break. In SILE the overall page layout is defined with a paper size and a series of one or more content frames. These frame descriptions provide the containers where content will later be typeset includ- ing information about how it might flow from one frame to the next. Content is written separately and automatically flowed from frame to frame and page to page. When preparing content for SILE you don't know where the lines.