Description
LaTeX WikibookContents 1 Getting Started 1 1.1 LaTeX/Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.1 What is TeX? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.2 What is LaTeX? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.3 Philosophy of use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.4 Terms regarding TeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.5 What next? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 LaTeX/Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.1 Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.2 Custom installation with TeX Live . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.3 Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2.4 Bibliography management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.2.5 Viewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.2.6 Tables and graphics tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.2.7 Online solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.2.8 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 LaTeX/Installing Extra Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.3.1 Automatic installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.3.2 Manual installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.3.3 Checking package status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.3.4 Package documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.3.5 External resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.3.6 See Also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 LaTeX/Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.4.1 The LaTeX syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.4.2 Our first document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.4.3 Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.4.4 Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.4.5 And what now? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.2 1.3 1.4 2 Common Elements 16 2.1 LaTeX/Document Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.1.1 16 Global structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i ii CONTENTS 2.2 2.3 2.4 2.5 2.1.2 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.1.3 The document environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.1.4 Book structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.1.5 Special pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.1.6 Notes and references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 LaTeX/Text Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.2.1 Spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.2.2 Hyphenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.2.3 Quote-marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.2.4 Diacritics and accents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.5 Margin misalignment and interword spacing . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.6 Ligatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.7 Slash marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.8 Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.9 Formatting macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.10 Text mode superscript and subscript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2.11 Text figures (“old style” numerals) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2.12 Dashes and hyphens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2.13 Ellipsis (…) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2.14 Ready-made strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2.15 Notes and References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 LaTeX/Paragraph Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.3.1 Paragraph alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.3.2 Paragraph indent and break . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.3.3 Line spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.3.4 Manual breaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.3.5 Special paragraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.3.6 Notes and References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 LaTeX/Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.4.1 Adding the color package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.4.2 Entering colored text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.4.3 Entering colored background for the text . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.4.4 Predefined colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.4.5 Defining new colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.4.6 Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 LaTeX/Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.5.2 Font families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.5.3 Emphasizing text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2.5.4 Font encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2.5.5 Font styles 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CONTENTS iii 2.5.6 Local font selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 2.5.7 Arbitrary font size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.5.8 Finding fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.5.9 Using arbitrary system fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.5.10 PDF fonts and properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.5.11 Useful websites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.5.12 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 LaTeX/List Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.6.1 List structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.6.2 Nested lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.6.3 Customizing lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.6.4 Inline lists 33 2.6.5 Easylist package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.6.6 Notes and references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 LaTeX/Special Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.7.1 Input encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.7.2 Escaped codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 2.7.3 Less than < and greater than > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.7.4 Euro € currency symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.7.5 Degree symbol for temperature and math . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.7.6 Other symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.7.7 In special environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 2.7.8 Unicode keyboard input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 2.7.9 External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 2.7.10 Notes and References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 LaTeX/Internationalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 2.8.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.8.2 Babel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.8.3 Multilingual versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.8.4 Specific languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 2.8.5 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 LaTeX/Rotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 2.9.1 The rotating package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 2.9.2 The rotfloat package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.10 LaTeX/Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.10.1 The tabular environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.10.2 Row specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2.10.3 Spanning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2.10.4 Controlling table size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.10.5 Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.10.6 Width and stretching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.6 2.7 2.8 2.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11. . . . . . . . . . . . . .2 The graphicx package . . .5 Including graphics . . . . . . . . . . . .iv CONTENTS 2. . . . . 61 2. . . . . . . . . . . . . . . . . 49 2. . . . . . . .10. . . .11 Widows and orphans . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 2. . .12. . . . .9 Multi-column pages 58 . . . . .10. . . . . . . .15 Floating with table . . . . . . . . . . . . . . . . . . . . . . .8 Text wrapping around pictures . . . . . . .12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2. . . . .1 Raster graphics vs. . . . 55 2.14 The eqparbox package . .12. .7 Table across several pages . . .10. . . . .13 Table with legend . . . . . . . . . . . . . . . .13 LaTeX/Importing Graphics . 61 2. . . . 53 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13. . . . . . . . . . . . . . . 50 2. . . . . . . . . . . . . . .13. . . . . . . . .8 Partial Vertical Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 2. 59 2. . . . . . . . . . . . . . . . . . 2. . . . . . . . . . . . . . . . . . . . . . . . . 58 2. 50 2. . . . . . . . . . . .10. . . . . .16 Using spreadsheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13.10 Including full PDF pages . . . .8 Page background . . . . . . . . . . . 51 2. . . . . . . . . . . . . . . . . . . . . . . .10. . . . . . . . . . . . . . . . . . . . . . . . . . .13. . . . . . . . . . .1 Two-sided documents . . . . . . . . . .5 Page orientation . . . . . . . . . . . . . . . . . . . . . . . . . . 58 2.13. . . . . . . . . . . .12. . . . . . . . . . . . .9 Seamless text integration . .13. .7 Images as figures . . . . . . . . . . . 59 2. . . . . . . . . . . . . . . . . . . . . . 51 2. . . . . . . . . . . . . .4 Margins . .10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 2. . . . . . . . . . . . . . . . .11 LaTeX/Title Creation . 61 2. . . . . . . . . . . . . . . . . . . . . . . 53 2. . . . . . . . . .11. . . . . . . . . . . . . . . 48 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 Margins. . . . . . . . 59 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12. . . . . . . . . . . . . . . . . . . 56 2. . . . . . . . . . . . . . . . . . . . . . . . . . . .7 Page styles . . 56 2.1 Standard Title Pages . . . . . . . . . . . . . . . . . . . vector graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.3 Packages for custom titles . . . . . . . . . . . . . . . . . . . . . 53 2. . . . . . . . . . .12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2. . . . . . . . . . . . . . . . . . . . . .3 Document Options . . . . . . . .12 Sideways tables . . . . . . 51 2. . . . . . . . . . . . . . . . 53 2. . . . . .6 Graphics storage . . . . . . . . . . . . . . 59 2. . . . . . . . . . . . . . .12. . . . . . . . . . 50 2. . . . . . . . . . . . . .18 References . . . . . . . . . . . . . . . . . . . . 60 2. . . . . . . . . . . . . . . . . . page size and rotation of a specific page . . . . . . . . . . . . . . . . . . . . . .13. . . . . .10 Footnotes in tables . . . . . . . . . . . . . . .10. .3 Page size . . . . .13. .10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2. . . . . . . . .12. . . . . . . . . . . . . . .10. . . . . 48 2. 48 2. . . . . . . . 62 .12 LaTeX/Page Layout . . . . . . . . . . . . . . . . . . . . .11. . . . . . . . .4 Notes and References . .13. . . . . . . . . . . . . 59 2. . . . . . . . .10 Manual page formatting . . . . . . . . . . . . . . . . .11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 Vertically centered images . . . . 49 2. . . .12.12. .12 Notes and References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Supported image formats . . . . . . . . . . . . . . . . . . . . .17 Need more complicated features? . . . . . . . . . 58 2. . . . . . . . . . . . . .2 Custom Title Pages . . . . . . .10. . . . . 50 2. . . . . . . . . . . . . . .12. . . . . . . . . . . . . . . . . . . . 61 2. . . . . . . .12. . . . . . . . . . . . .11 Professional tables . . . . . .2 Page dimensions . . . . . .13. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 2. .10. . . . . . . . . . . CONTENTS v 2.13.11 Converting graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 2.13.12 Third-party graphics tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 2.13.13 Notes and References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 2.14 LaTeX/Floats, Figures and Captions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 2.14.1 Floats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 2.14.2 Keeping floats in their place . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 2.14.4 Lists of figures and tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 2.14.5 Labels and cross-referencing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 2.14.6 Wrapping text around figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 2.14.7 Subfloats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 2.14.8 Wide figures in two column documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 2.14.9 Custom floats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 2.14.10 Labels in the figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 2.14.11 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 2.14.12 Notes and references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 2.15 LaTeX/Hyperlinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 2.15.1 Hyperref . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 2.15.2 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 2.15.3 Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 2.15.4 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 2.15.5 Notes and References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 2.16 LaTeX/Labels and Cross-referencing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 2.16.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 2.16.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 2.16.3 The varioref package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 2.16.4 The hyperref package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 2.16.5 The cleveref package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 2.16.6 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 2.16.7 Notes and References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 2.14.3 Captions 3 Mechanics 76 3.1 LaTeX/Errors and Warnings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 3.1.1 Error messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 3.1.2 Warnings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 3.1.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 3.1.4 Software that can check your .tex Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 LaTeX/Lengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 3.2.1 Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 3.2.2 Box lengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 3.2.3 Length manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 3.2.4 LaTeX default lengths 79 3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi CONTENTS 3.3 3.4 3.5 4 3.2.5 Fixed-length spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 3.2.6 Rubber/Stretching lengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 3.2.7 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 3.2.8 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 3.2.9 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 LaTeX/Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 3.3.1 Counter manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 3.3.2 Counter access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 3.3.3 Counter style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 3.3.4 LaTeX default counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 3.3.5 Book with parts, sections, but no chapters . . . . . . . . . . . . . . . . . . . . . . . . . . 81 3.3.6 Custom enumerate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 3.3.7 Custom sectioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 LaTeX/Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 3.4.1 TeX character boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 3.4.2 makebox and mbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 3.4.3 framebox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 3.4.4 framed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 3.4.5 raisebox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 3.4.6 minipage and parbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 3.4.7 savebox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 3.4.8 rotatebox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 3.4.9 colorbox and fcolorbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 3.4.10 resizebox and scalebox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 3.4.11 fancybox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 LaTeX/Rules and Struts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 3.5.1 Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 3.5.2 Struts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 3.5.3 Stretched rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Technical Texts 84 4.1 LaTeX/Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 4.1.1 Mathematics environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 4.1.2 Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4.1.3 Greek letters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4.1.4 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4.1.5 Powers and indices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4.1.6 Fractions and Binomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4.1.7 Roots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.1.8 Sums and integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.1.9 Brackets, braces and delimiters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.1.10 Matrices and arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 CONTENTS 4.2 4.3 4.4 vii 4.1.11 Adding text to equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.1.12 Formatting mathematics symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.1.13 Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 4.1.14 Plus and minus signs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 4.1.15 Controlling horizontal spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 4.1.16 Advanced Mathematics: AMS Math package . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.1.17 List of Mathematical Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.1.18 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.1.19 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.1.20 Further reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.1.21 External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 LaTeX/Advanced Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 4.2.1 Equation numbering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 4.2.2 Vertically aligning displayed mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . 90 4.2.3 Indented Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 4.2.4 Page breaks in math environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 4.2.5 Boxed Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 4.2.6 Custom operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 4.2.7 Advanced formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 4.2.8 Text in aligned math display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 4.2.9 Changing font size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 4.2.10 Forcing \displaystyle for all math in a document . . . . . . . . . . . . . . . . . . . . . . . 93 4.2.11 Adjusting vertical whitespace around displayed math . . . . . . . . . . . . . . . . . . . . 93 4.2.12 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 LaTeX/Theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 4.3.1 Basic theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 4.3.2 Theorem counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 4.3.3 Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 4.3.4 Theorem styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.3.5 Conflicts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.3.6 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.3.7 External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 LaTeX/Chemical Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.4.1 Basic Usage 95 4.4.2 Skeletal Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.4.3 Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.4.4 Lewis Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.4.5 Ions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.4.6 Resonance Structures and Formal Charges . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.4.7 Chemical Reactions 95 4.4.8 Naming Chemical Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 viii CONTENTS 4.4.9 4.5 4.6 4.7 5 Advanced Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 4.4.10 mhchem Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 4.4.11 XyMTeX package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 LaTeX/Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 4.5.1 Typesetting using the algorithmic package . . . . . . . . . . . . . . . . . . . . . . . . . . 97 4.5.2 Typesetting using the algorithm2e package . . . . . . . . . . . . . . . . . . . . . . . . . . 97 4.5.3 Typesetting using the algorithmicx package . . . . . . . . . . . . . . . . . . . . . . . . . . 97 4.5.4 The algorithm environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 4.5.5 Typesetting using the program package . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 4.5.6 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 LaTeX/Source Code Listings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 4.6.1 Using the listings package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 4.6.2 The minted package 4.6.3 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 LaTeX/Linguistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 4.7.1 Enumerated examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 4.7.2 Syntactic trees 4.7.3 Glosses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 4.7.4 IPA characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 4.7.5 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 4.7.6 External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Special Pages 5.1 5.2 5.3 LaTeX/Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 5.1.1 Using makeidx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 5.1.2 Abbreviation list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 5.1.3 Multiple indices 5.1.4 Adding index to table of contents 5.1.5 International indices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 LaTeX/Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 5.2.1 Jump start 5.2.2 Using glossaries 5.2.3 Defining glossary entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 5.2.4 Defining terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 5.2.5 Using defined terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Displaying the Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 5.3.1 5.4 108 Building your document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Example for use in windows with Texmaker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 5.4.1 Compile glossary with xindy - In Windows with Texmaker . . . . . . . . . . . . . . . . . . 113 5.4.2 Document preamble 5.4.3 Glossary definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 5.4.4 Include glossary definitions and print glossary . . . . . . . . . . . . . . . . . . . . . . . . 113 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 6. . . . . . . . . . . . . . 129 LaTeX/Presentations . . . . . . . . . . . . . . 129 6. . . . . . . 134 6. . . . . .1 The example data . .2 Citations . 137 7. . . . . . . . .5 5. . . . . . . . . . . . . .4 Citation . . . . .5. . . . . . . . . .4. . . . . . . . . . . . . . . . . . . . .2 The limits of BibTeX styles . . . . . . . . . . . . . . . . . . .1. . . . .3 Windowed envelopes . . . .1. . . . . . . . . . . . . . . . . . . . .4 Bibliography in the table of contents . . . . . . . .1. . . . . . . . . . . . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .cls commands . . . . . . . . . . . . . . . . . . . . . . . . . .6 Multiple bibliographies . . . . . . . . . . . . . . .3 6. . . . . . . . . . 123 5. . . . . . . . . . .5. . 128 Creating Graphics 7. 125 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Envelopes . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Links . . . . . . . . . . . . . . . . . . . . .3 References . . . . . . . . .1. . . . . . . . . . .3. . . . . . . . . . . . . . . . . .5 References . . . .6. . . . . . . . . . . . . . . . . . . .6. . . . . . 125 Special Documents 6. . . . . . 114 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 5.5. . .2 128 LaTeX/Letters . . . . . . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . . . . . .4. . . . . . . . . . . 128 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 LaTeX/More Bibliographies . . . . . . . . . . .1 The letter class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 6. . . . . . . . . .4. . . . . . . . . . . . . . . 125 5. 135 6. 126 5. . . . . . . . . . . . . . . . . . . . 114 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 6. . . . 135 6. . . . . . . . . . . . . . . . . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . 128 6. . . . . . . . . . . . . . . 137 LaTeX/MetaPost . . . . . . . .2. . . . . . 129 6. . . . . . . . . . . . . . . . . . . . 138 . 115 5. . . 134 LaTeX/Teacher’s Corner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 europecv . . . . . . . . . . . . . . . . . .5. . . . . . . . . . . .4 Multilingual support . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 The Beamer package .4. 136 137 LaTeX/Introducing Procedural Graphics . . . . . . . . . . . . . . . . . . . . . .5. . . . . . . .1 curve .6. . . . . . . . . . . .4. . . . . . . . . . . .3 BibTeX . . . . . . . . . .1 7 ix Overview .5. . . .1 Intro 6. . . . . . . . . .7 Notes and references . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . . . . . . .1 . . . . . . . . . . . . . 129 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 5. . . . 124 5. . . . . . . . . . . . . . . 135 6. .5 biblatex . . . . . .3 References . . . . . . . . . . 134 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. . 126 5. . . . . . . . . . . . . . . . . 135 . . . . . . . .1 Embedded system 5. . . . . . . . . .2 The powerdot package . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . . .CONTENTS 5. .3 Natbib . . 135 6. . . . . . . . . . . . . . . . .4 5. . . . . . 136 6. . . . . . . .4 Reference: letter. . . . . . 135 LaTeX/Curriculum Vitae . . . .1 7. . . . . . . . . . . . . . . . . 113 LaTeX/Bibliography Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 6 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. .5. . . . . . . . . . . . 135 6. . . . . . . . . . . . . . . . . . . . . . . . . . .3.2 6. .2 The exam class . . . . . . . .3 moderncv . . . . . . . . . . . . . . . . . . . . .4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 7. . . . . .4. . . .x CONTENTS 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 8. . . . . . . . . . . . . 139 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 8 LaTeX/PGF/TikZ . . . . . .2 Line segments . . .3. . . . . . . . . . . . . . . . . .4 Grids . . . . . . 151 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 7. . . . .9 Quadratic Bézier curves . . . . . . . . . . . . . . . 148 Programming 8. . .8 Multiple use of predefined picture boxes .1. . . . . . . . . . . . . . . . . . . . . . .5. . . . . . . . 150 8. . . . . . . . . . . . . . . . . . . . . . . . . . . .5. . . . . . . . . . . . 139 7. . . . . .8 Strings 8. . . . . . . . . . . .1 Basic commands . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . .10 Command-line LaTeX . . . . . . 146 7. .1.1 Loading Package. . . . . . . . . . . . . . . . . . . . . . . . . .9 LaTeX Hooks . . . . . . . . . . . . . . . . . . . .7 LaTeX/Creating 3D graphics . . . . . . . .3. . . . . . . . . . . . . . . .4 Nodes 7. . . .3. . .5. . . . . 140 7. . . . . . . . . . . . . . . . 140 7. . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . . 147 7. . . . . . . . . . . . . . . .5 Generic parameters . . . . . . . . . . . . 144 7. . . . . . . . . . . 141 . . . . . . . . . . . .5.1 149 LaTeX/Macros .3.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 8. . . . . . . . . . . . . . . . . . . .2 Specifying Coordinates . . . . . . . . . . . . . . . . 140 7. . . . . . .1. . . . . . . . . . . . . . . . . .1. 139 7. . . . . . . . . . . . . . . . . . .6 \multiput and \linethickness . . . . . . . . .3 declare commands within newenvironment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 Examples . . . . .3 Arrows . . . . . . . . .10 Catenary . . .1. . . . . . . .6 Conditionals . . . . . . . . 138 7. 140 7. . .3.4 Extending the number of arguments . . . . . . 143 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 . . .4. . . . . . . . .tikzpicture environment . . . . . . . . . . . . .5. . . . . . . . . . . . . . . . 139 7. . . . . . . . . . . . . . . . . . .5 Text and formulae . . . . . . . . . . . . . 144 7. .4. . . . . . . . . . . . . . . . 147 7. . . . . .12 The picture environment and gnuplot . . . . . . . . . . . . . . . . . . . . . . . .11 Plotting graphs . . . 151 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. . . .4. . 145 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 The PDFTricks extension . . . . . . . .5 Arithmetic . . . .3 Syntax for Paths 7. . . . . . . . . . 144 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . .1 New commands . . . 150 8. . . . . 139 7. .4. . . . . . . . . . . . . . . . . . . . . . . . 145 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 LaTeX/PSTricks . . . . . . . . . . . . . . . . . .5. .7 Loops . . . . . . . . . . . . . . . . . .3. . . . . . . . 138 7. . .6 Object location . . . . . . . . . . .4 7. . . . .7 Ovals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Text . . . . . . . . . . 139 7. . . . . . . . . . . . . .4 Circles . . . .2 Fundamental objects . . . . . . . . . . . .1 The pspicture environment . . . . . . . . 138 7. . . . Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. . . .6 LaTeX/Xy-pic . . . . . . . . . . . . . . . . . . . . . . . .3. . .2 New environments . . . . . . . . . .1. . . . . . . .3 LaTeX/Picture . . . . . . . . . .3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. . . . .5. . . . . . . . . . . . . . 150 8. . . . . . 138 7. . . . . . . .3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 8. . . . . . . . . . . . . . . . . . . . . . 154 8. . . 158 9. . . . . . . . . . . .11 Notes and References .2. . . . . . . .2. . . . . . . . . . . . . . . .CONTENTS xi 8. . .3 Creating your own class . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . . . . 162 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 Notes and References . . . . . . . . . . . . . . . . . .tex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 makeatletter and makeatother . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . . . .2. . . . . .2 LaTeX/Plain TeX . .2. . . . . . . . . . . . . .3 Plain TeX macros . . . . . . . . . . . . . . . . . 154 8. . . . . . . . . 152 8. . . . . . 163 . . . . . . . 163 9. . 157 8. . . . . . . 151 8. . . . . . . . .3. . . . . . . . . . . . . . . . . . . . . . . .4.3. . . . . . 161 9. . . . . . . . . . . .2 Getting LaTeX to process multiple files 9. . . . . . . . . . . . . 156 LaTeX/Themes . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . . . . . 162 . . . . .2. . . . . . . . .2. . . . . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Miscellaneous 9. .11 Macros defining macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . 156 8. . . . . . . . .3 8. . . . . . . . . . .2. . . . . . . . . . . . . . .2 Creating your own package . . . .3 The file mystyle. . . . . . . . . . . . . . . . . . .sty . . . . . 157 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 Arithmetic . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . . . . . .5 External Links . . . . . . . . . . . . . . . . . . . . . . . .4 The main document document. . . . . . . . . . . . . . . . . . . . . . . .8 Doing nothing . . . . 152 8. . . . . 151 8. . . . . . . . . . . . .7 Managing collaborative bibliographies . . . . . . . . . 157 8. . . . . . . .5 Hosting LaTeX files in Subversion . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . . 161 9. . . . . . . . . . 154 8. . .2. . . . . .4 9 LaTeX/Creating Packages . . . . . . . . . . . . . . . . . . . . . . . .2 158 LaTeX/Modular Documents . . . . . . . . . . . 153 8. .4 Table of contents . . . . . . 155 8. . . . . . . . . . . . . . . . . .3. 154 8.5 Sectioning 8. .1 Vocabulary . . . . .3. . . . . . .1. . . . . . . . . . .2. . . . . . . . . .2. . . . . . . . . . . . . . . . . . 157 . . . 166 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . . . . . . . . . .1 9. .7 Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Introduction 9. . . . . . . . . 163 9. . . . . . . . . . . . . . . . . . . . . . . . . . .4 Registers . . . . . . .4. . . . . . . . . . . . . . . .6 Conditionals . . . . . . .1 Project structure . . . . . . . . .2. . . . . . . . . . .9 TeX characters . . . . . . . . . . 164 9. . . . 157 . . . . . . . . . . . . . . .2. . . . . . 155 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . 162 9. . . . . . . .4 Hooks . . .4. . . . . . . . . . . . . . . . . . . 158 9. . . . . 157 . . . . . . . . . . . . . . . . . . . . . 162 9. . . . . . . . . . . . . . . . . . . .1 Abstract . . . .1.3 Header and footer 8. . . . . . .4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.1. . . . . . .4 The Version Control System Subversion . . . . . . . . . . . . . .1 Introduction . . 158 LaTeX/Collaborative Writing of LaTeX Documents . . . . .10 Verbatim lines and spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4. . . . . . . . . . . . . . 156 8. .2 Package configuration 8. . . . . . . . . . . . . . . . . . . . . . . . . . 156 8. . . . . . . . . . . . . . . . . 155 8. . . . . . . . . .3 Interchanging Documents 9. . . . . . . . . . . . . . . . . .6 Subversion really makes the difference . . . . . . . 154 8. . . . . . . . . .12 Notes and References . . . . . . . . 151 8. . . .2 Catcodes . . . . . . . . . . . . 155 8. . . . . . . . . . . . . . . . 174 10. . . . . . . . . . . 174 10. . . . . . . . .21 Reducing the size of your LaTeX installation . 170 9. . . . . 175 10. . . . . . . . . . . . . .3 Grouping Figure/Equation Numbering by Section . . . . . . . . .1. . . . . . . . . . . .1. . . .e. . . . . . . . . . . . . . . . .1. . . . . . . . . . . . .6 Fonts are ugly/jagged/bitmaps or PDF search fails or Copy/paste from PDF is messy . . . . . . . . . . .1. . . . 168 9. . . . . . . 175 10. . . . . . .19 Tables are easier than you think . . . . . 174 10. . . . . .1. . . .3 Convert to PDF . . . . . . . . . . . . . . . . .g. .14 Learning LaTeX quickly or correctly . . . . . . . .15 Non-breaking spaces . . . . . . . . . . . . . . . . . . . . . . .20 Relieving cumbersome code (lists and long command names) . . . . . . . . . . . . . . . . . . . .3. . . . . . .8 Conclusion . . 173 10. . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . .17 Use vector graphics rather than raster images . . .1 Always writing LaTeX in roman . . . . .1. . . . . . . 174 10. . . . . . . . . . . . . . . . . . . . . . . . . . . 175 10. . . 172 10. . . . . . 172 10. . . . . . . 169 9. . . . . . . . . . . . . . . . . . . . . . . .1. . .1. . . . . . . . . . . . . . . . . . . . 172 10. . . . . . . . . . . . . .18 Stretching tables . . . . . . . . . . . . . . . . . . . . . . . . . . and e. . . . . . . . . . . . . . . . . . . . . .2 Preview mode . . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . . . .3. . . . . . . . . . . . . . . . . . . 172 10. . . . .9 Avoid bold and underline . . . . . . .2. . . 172 10. . . . . . . 169 172 10. . . . . . . . . . . . . . 168 9. .1. . . . . . . . . . . . . . .xii CONTENTS 9. . . . . . . . . . . . . . . . . . . . . . .1. .1. . . . . . . .) . . . . . . . 175 10. . .5 Convert to RTF . . . . . . . 173 10. . . . 168 9. . . . . . . . 167 9. . . . . 175 10. . . . . .8 Convert to plain text . . . . . . . . . . . . . . . . . . . . . . . . . . 172 10. . . . . . . . . . . .2. . . . . . . . . . . . .1 LaTeX/FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Margins are too wide . . . . . . .1 Tools installation .4 Generic header . . . . . . . . . . . . . . . . . . . . . . . . .16 Smart mathematics . . . .1. . . . . . . . . 173 10. . . . . . . . . . . . . . . . . .5 LaTeX paragraph headings have title and content on the same line . . . . . . . . . . . .11 Text stops justifying . . . . . . . . . . . . . . . . . . . . . . . . . . 171 10 Help and Recommendations .6 Convert to HTML 9. . .7 Convert to image formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 10. . . . . . . . .2 id est and exempli gratia (i. . . . . . . . . . . . .1. .10 The proper way to use figures . . . . . . . . . . . . . .3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . . . . .8 Always finish commands with {} .12 Rules of punctuation and spacing . . . . . . . . . . . .2. . . . . . . . . . . . . . . . . 174 10. . . . . . . . . . . . . . . . . . . . . . .2.3 Simplified special character input .3. . . . . . . . . . . . . . . . . . . . . . . . . . . 167 9. . . . . . . . . . . . . . . .3. . . . . . . . .4 Writing the euro symbol directly . . . . .1. . . . . . .5 Graphics and Graph editors . . . . . . . . .10 References . . . .1. . . . . .1. . . . . . . . . . . 172 10. . . . . . . . . . . . . . .3. . . . . . 168 9. . . 169 9. . . . . . 174 10. . . . . . . .2 Avoid excessive double line breaks in source code . . . .13 Compilation fails after a Babel language change .4 Convert to PostScript . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 10. . . . . . . . . . . . . . . . . . . . .2 LaTeX/Tips and Tricks . . . . . . . . . . . . . . . . . . . . . . . . . . .3. . . . . . . .2. . . . . . . . . . . . . . . . . . . . . 173 10. . . . . . . . . . . . . . . . . . . . .3 LaTeX/Export To Other Formats . . . 174 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 10. . . . 172 10. . . . . . . . . .7 Manual formatting: use of line breaks and page breaks . . .1. . .1. . . . . . . 175 . . . .9 Acknowledgements . . . .3. . .1. . . . . 168 9. . . .1. . . . . . . . . . . . . . . . . . . . . . .6. . . . . .CONTENTS xiii 10. . . . 182 11. .1.5. . . . . . . . . . . . . . . . . . . . . . . . . . .1 LaTeX/Authors . . . . . . . . 181 11. . . . .6 Spell-checking and Word Counting . . . . . .1 Included books . . . . . . . . . . . . . . . . . . . . . .2 B . . . . . . . . . . . . . 183 11. . . . . . . . . . . . . .2. . . . . .5.7 New even page . . . . . . .5 LaTeX/Index . . . 182 11. . . . . . . . . . . . . . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5. . . . . . . . . . . . . . . . . . . . . . . . . .5. . .8 Sidebar with information . 181 11. . .5. . . . . . .5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 11. . . .5. . . . . . . . . . . . . .10 L . . . . . . . . . . 184 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 11. . . . . . . . . . . . . . . . . . . . . . . . . . . 177 11 Appendix 179 11.6 LaTeX/Command Glossary . 183 11. . . . .4 LaTeX/Sample LaTeX documents . 184 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 11.14 R . . . . . . . . . . . . . . 183 11. . . . . . . . . .1 # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 11. . . 183 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 LaTeX/Package Reference . . . . . . . . . . . . . . . . 177 10. . . . . . . .5.5. . . . .2 A . . .5 E . . . . . 177 10. . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . . 182 11. . .2 Wiki users . . 179 11. . . . . . . .5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 Q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 11. . . . . . . . . . . .1 A . . . . . . . . . . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 11. . . . .5. . . . . . . .4 D . . . 181 11. . . . . . . . . . . . . . . . . . . 182 11. . . . 183 11. . . . . . . . . . . . . . . . . .9 I . . . . . . . . . . . . . . . . .5 D . . . . . . . .4 C . . . . .2.6 E . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 Hide auxiliary files . . . . . .19 W . . . . . . . . . . . 181 11. .2 LaTeX/Links . . . . . . . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5. . . . . . . . . . . . . . . . . . . . 179 11. . . . .18 V . .5.4. . . . . . . . . . . . . . . . . . . . . .20 X . . . .5. . . . . . . . . . . . 184 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . . . . . 181 11. . . . 182 11. . . . . . . . . . . . . . . . . . . .12 P . . . . . . . . . . . . . . . . .5. . . . . . . . .4. . . . . . . . . . . . . . . . . . . .5. . . . . 180 11. . . . . . . . . .6. . . . . . . 182 11. . . .16 T . . . .6. . . . . . . .5. . . . . . . . . . . . . . . . . . . 183 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 G . . . . . . . . . 183 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Semantics of Programming Languages . . . . . . . . . . . . . .5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 General examples . . . . . . . . . .3 B . . . . . . . . . . .17 U . . . . . . . . .11 M . . .5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 10. . . . . . . . . . . . .6 F . . . 183 11. . . . . . . . . . . . . . . . . . . . . . . . . .5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 H . . . . . . . . . . . . . . .2. 182 11. . . . . . . 179 11. . . . 181 11. . . . . . . . . . . . 181 11. . . . . . . . . . . . . . . . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6. . . . .6. . . . . . . . . contributors. . . . 186 11. 185 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 11. . . . . . . . . 184 11. . . .20 U . . . . . . .6. . . . . . . . . . . . . . . .18 S . . .17 R . . . .16 P . . . . . . .6. . . . . . . . . . .6. . . . .1 Text . . . .11 K . . . . . . . . . . . . . and licenses 188 12. . . . . . . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 12. . . . 186 11. . . . . .21 V . . . . . . . . . . . . . . . . . . . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 11. . . . . . . . .6. . . . . . . . . . . 187 12 Text and image sources.15 O . . . . 185 11. . . . . .xiv CONTENTS 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . 185 11. . . . .6. . . . . . . . . . . . . . . . .7 F . . . . . .19 T . . . . . . . . . . . . .3 Content license . . . . . .10 I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 . . . . . 188 12. . . . . . . . . 184 11. . .8 G . . . . . . . . .12 L . . .9 H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 11. . . . . . . . . . . 187 11. . . . . . . . . . . . . . . . . . . . . .2 Images . . . . . .14 N . 186 11. . 185 11. . . . . . . . . . . . . . . . . . . . . . 185 11. . . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6. . . . . . and chi. Greek for both “art” and “craft”. On the other hand. with a current version number of 3. contor and understood. pre-built macros are time saving. with the final consonant of loch or Bach. The name TeX is intended by its developer to be /'tɛx/.1 1. for running on many different kinds of computers. (Donald E.2 What is LaTeX? What is TeX? LaTeX (pronounced either “Lah-tech” or “Lay-tech”) is a macro package based on TeX created by Leslie Lamport. Fortu• Document sources can be read with any text edinately. Within the typesetting system. Many later authors have contributed extensions.. design flexibility. and automate certain • You can concentrate purely on the structure and conrepetitive tasks and help reduce user introduced errors. • You generally need to know the necessary commands for LaTeX markup. especially for documents containing mathematical formulae. which is also the root word of technical. but you would find it very hard to do anything else but typesetting with it. its name is formatted as LaTeX. These XML formats used with WYSIWYG programs. especially in the hope that he could reverse the trend of deteriorating typographical quality that he saw affecting his own books and articles. to LaTeX. this convenience comes at the cost of complete ficial layout issues. Since LaTeX comprises a group of TeX commands.Chapter 1 Getting Started 1. The TeXbook) The letters of the name are meant to represent the capital Greek letters tau. LaTeX document processing is essentially programming. You create a text file in LaTeX markup. TeX is a low-level markup and programming language created by Donald Knuth to typeset documents attractively and consistently. Some of these are bundled with most TeX/LaTeX software distributions.1. • It can sometimes be difficult to obtain a certain look for the document. tents of the document. etc. like the first syllable of technical.1415926. there are certain advantages to the LaProgramming in TeX generally progresses along a very TeX approach: gradual learning curve. 1. Its purpose is to simplify TeX typesetting. The version numbers of TeX are converging toward π . epsilon. This approach has some disadvantages in comparison with a WYSIWYG (What You See Is What You Get) program such as Openoffice. TeX is renowned for being extremely stable. which LaTeX reads to produce the final document. more can be found in the Comprehensive TeX Archive Network (CTAN). In LaTeX: • You don't (usually) see the final version of the document when editing it. as TeX is an abbreviation of τέχνη (ΤΕΧΝΗ – technē).1. The fine control TeX offers over document structure and formatting makes it a powerful—and formidable—tool. Knuth.1 LaTeX/Introduction ages is called LaTeX. TeX is a programming language in the sense that it supports the if-else construct: you can make calculations with it (that are performed while compiling the document). One of the most popular macro pack1 . Knuth started writing the TeX typesetting engine in 1977 to explore the potential of the digital printing equipment that was beginning to infiltrate the publishing industry at that time. requiring a significant investment of time to build custom macros for text formatting. document preparation systems based on TeX. called packages or styles. unlike the complex binary and sisting of collections of pre-built macros. With the release of 8-bit character support in 1989. English speakers often pronounce it /'tɛk/. and for being virtually bug free. do exist. not get caught up with superhowever. TeX development has been essentially frozen with only bug fixes released periodically.org Writer or Microsoft Word. The engine will determine what kind of source code it can read. ically with any language. or text flow for readability.1. use plain TeX instead.1. Lamport.Therefore before rushing on your favorite web search engine. CTAN is a good place to find many resources regarding • In LaTeX the document structure is visible to the TeX and derivative packages. When the source file is processed by the macro package. problem before may have published their solution as a line heights. Instead you see So the system is the combination of the language and the the logical structure of the document.mentation is most commonly installed along your TeX ures. One way to look at it is that LaTeX is a bundle of macros for TeX that aims to carry out everything regarding document formatting. or may be found on CTAN. 1. LaTeX natively supports DVI and PDF. takes care of them automatically.e. the best doc• The layout. ration system by L. Code written for TeX. can be generated programmat. distributions are an easy way to install what you need to use the engines and the systems you want. engine-specific code (like font for XeTeX) may not One solution to this dilemma is to make use of the mod. Additionally. Knuth and LaTeX: A document prepa• Mathematical formulae can be easily typeset. Engines An engine is an executable that can turn your source code into a printable output format. Distributions usually target specific operating systems. Let’s recap most of the terms ting problem. ular possibilities of LaTeX.distribution.3 Philosophy of use Flexibility and modularity One of the most frustrating things beginners and even advanced users might encounter using LaTeX is the lack of flexibility regarding the document design and layout. throughout the document. Distributions TeX distributions are collections of packages and programs (compilers. Terms regarding TeX Document preparation systems The LaTeX-like approach can be called WYSIWYM. as LaTeX package. then the LaTeX way is at least not worse. and someone who encountered a similar in this table. fonts. What You See Is What You Mean: you can't see what the LaTeX is a document preparation system based on TeX.4 rectly. it also needs to load fonts and macros to fully understand the source code and generate output properly.e. If it is not exactly what you desired.names with a -TeX suffix. PNG. tables and so on are consistent umentation source remains the official manual for every specific package. It is the first place where user. If you really want flexibility. tables. You can build your own When searching for information on LaTeX. with additional markup. LaTeX takes care macros. fig. Keep in mind that LaTeX does the formatting for you. and can be easily copied to another document. final version will look like while typing. All in all. you should begin searching. i. and what format it can output (usually DVI or PDF). In WYSIWYG applications it is often not obvious how a certain formatting was produced. You can use different systems on different engines.be compiled by every engine. LuaTeX or other likely not the first person to face some particular format. fonts. of the formatting for you. and mostly the right way. etc. but sometimes there are restrictions. ConTeXt.. if not better. GETTING STARTED • You don't need to manually adjust fonts. the TeXbook by D. • Indexes. This official docu• Since the document source is plain text. • You are forced to structure your documents cor. Besides internet resources being plentiful. text sizes. footnotes. JPEG.1. so that the writer only needs to care about content. we really urge you to have a look at the package erated easily. and the reference documentation. and macro packages) that enable you to typeset without having to manually fetch files and configure things. documentation that causes troubles. You are also stumble upon XeTeX. it can produce documents in several formats. i. etc. you may have trouble accomplishing this. The engine by itself only handles the syntax. and it might Questions and documentation be impossible to copy it directly for use in another document. LaTeX or ConTeXt are (mostly) not compatible. equations. or use macros developed by others. citations and references are gen. The LaTeX document is a plain text file containing the content of the document. you might macros. If you want to design your document in a very specific way. but by using other software you can easily create PostScript.2 CHAPTER 1. . 1 Distributions TeX and LaTeX are available for most computer platforms. These websites offer collaboration capabilities while allowing you to experiment with LaTeX syntax without having to bother with installing and configuring a distribution and an editor. In the next chapter we will proceed to the installation. 1. It has an easy installer that takes care of setting up the environment and downloading core packages. Download MacTeX. thing.net Community. and a bibliographic management program to manage references if you use them a lot. fonts. the most common distribution used to be teTeX. and the LaTeX macro set. Good sources are: • TeX Live is a major TeX distribution for *BSD. AMSTeX. and macro packages) that enable you to typeset without having to manually fetch files and configure Mac OS X Mac OS X users may use MacTeX. you'll need a TeX distribution. TeX distributions are collections of packages and programs (compilers. a TeX Live-based distribution supporting TeX. do not necessarily include an editor. 1.If your *BSD or GNU/Linux distribution does not have ually would result in downloading and installing multiple the TeX Live packages. TeX Live is naturally available through MacPorts and Fink.[1] The easy way to get TeX Live is to use the package manager or portage tree coming with your operating system. since they were programmed to be very portable. See below. LATEX/INSTALLATION 1. Optional. MiKTeX. *BSD and GNU/Linux In the past. you should report a wish to programs in order to have a suitable computer system that the bug tracking system. unzip it and follow the instructions. Mac OS X and Windows. Acquiring them man.5 What next? 3 things. such as teTeX. Usually it comes as several packages. with some of them being essential. More specifically. it is a language. You might be interested in other programs that are not part of the distribution.1. This . • MiKTeX is a Windows-specific distribution. erating systems are: Throughout this book you should also utilise other means for learning about LaTeX. or MacTeX. LaTeX is just a set of macro packages built for TeX.mpkg. • the #latex IRC channel on Freenode. The recommended distributions for each of the major opThen we will compile our first LaTeX file. The core TeX Live packLaTeX is not a program by itself. GNU/Linux. Further information for Mac OS X users can be found on the TeX on Mac OS X Wiki. When you later feel that you would benefit from having a standalone LaTeX installation.2. • the TeX Stack Exchange Q&A. In that case you will need to can be used to create LaTeX output. LaTeX requires a bunch of tools. you don't even need to install anything.2. They are most commonly installed using a distribution. • and the TeXample. a good text editor and a DVI or PDF viewer. the basic requirement is to have a TeX compiler (which is used to generate output files from source). Using ages should be around 200-300 MB. TeX download TeX Live yourself and run the installer by hand. and recommended installations include an attractive editor to write LaTeX source documents (this is probably where you will spend most of your time). At a minimum. you can return to this chapter and follow the instructions below. For quick testing purpose you may just create a user account with an online LaTeX editor and continue this tutorial in the next chapter. These. LaTeX. ConTeXt. Since Mac OS X is also a Unix-based system. Microsoft Windows Microsoft Windows users can install MiKTeX onto their computer.2 LaTeX/Installation If this is the first time you are trying out LaTeX. As of May 2006 teTeX is no longer actively maintained and its former maintainer Thomas Esser recommended TeX Live as the replacement. fonts. • MacTeX is a Mac OS-specific distribution based on TeX Live. • the TeX FAQ. other optional.1. in that it is a sinYou may wish to install the content of TeX Live more gle step installation process that provides (almost) everyselectively. which will help you in writing and preparing TeX and LaTeX files. Further information for Mac OS X users can be found on the TeX on Mac OS X Wiki. Distributions help the user in this way. however. such as PDFs.zip on the MacTeX page. XeTeX and many other core packages. Don't forget to add the binaries to your PATH as it’s noticed at the end of the installation procedure. 1 collections out of 85. 3.. and simple interfaces to modify settings. • Installation Schemes group collections and packages. except for the Essential programs and files collection. format files are created for system-wide use by the installer.texmf to hide it.” (d) install font/macro doc tree: useful if you are a developer. Change the umask to 022 to make sure other users will have read-only access to the installed distribution. change it if you know what you are doing. Open a terminal in the extracted folder and log in as root. you may have everything you need for less than 100 MB. tlmgr. We will give you general guidelines to install a minimal At this point it should display TeX distribution (i. install or remove extra packages and so on.org/ or a similar space usage. In the latter case format files are stored in user’s directory trees and in some cases have to be re-created when new packages are installed. TeX Live features a manual installation with a lot of possible customizations. 4. such as automatic installation of packages. There is also a port of TeX Live available for Windows. You can get the network installer at tug. otherwise select it. GNU/Linux or *BSD are fine. only for plain TeX). like an installation with a minimum of disk space usage. GETTING STARTED distribution has advanced features. 2.gz and exYou can now proceed to installation: start installation to tract it to a temporary folder. (e) install font/macro source tree: same as above. (c) create format files: targetting a minimal disk space. or any kind of external media. . It may work for Windows but the process must be quite different. Most Unix with a package manager will offer TeX Live as a set of several big packages. Select the minimal scheme (plain only). 2. you may want to jump to the next section.ctan.org. Mac OS X. # umask 022 1. TeX Live is then managed through its own package manager. the best choice depends on whether there is only one user on the system. It is ~/texmf by default. then deselecting it is better. For example you may want to hide your personal macro folder which is located at TEXMFHOME. most of them which you will never use. Picky users may wish to have more control over their installation. You will need a Unix-based operating system for the following. From the help menu: “If this option is set.4 CHAPTER 1. You may want to change the directory options. disk space required: 40 MB 1. You may still configure the list afterwards. TeX Live groups features and packages into different concepts: • Collections are groups of packages that can always be installed individually. Otherwise it allows the TeX engines to call any external program.tar. Now the options: (a) use letter size instead of A4 by default: mostly for users from the USA. You can install collections at any time. Launch install-tl. Replace it by ~/. and you often have to install 300–400 MB for a functional system. such as default paper sizes. 3. You can select only one scheme at a time. It will let you configure the distributions. Leave to default for a traditional installation on the system hard drive. systems/texlive/tlnet/install-tl-unx. Otherwise they will be created automatically when needed. but very space consuming. In fact. Common distributions might be tedious for the user caring about disk space.2. Minimal installation 1.2 Custom installation with TeX Live This section targets users who want fine-grained control over their TeX distribution. hard disk. 5. Select portable installation if you install the distribution to an optical disc. As a result. (f) Symlinks are fine by default. Schemes can only be used at installation time. If it is none of your concern. (b) execution of restricted list of programs: it is recommended to select it for security reasons. MikTeX and MacTeX and packaged TeX Live features hundreds of LaTeX packages.e. Turn it off if you want to save space. Download the installer at http://mirror. This installer allows you to select precisely the packages you want to install. in almost any text editor. etc. except for the cache (like font cache.sanskrit} a complete set of keyboard shortcuts. Note that as of January 2013 not all texconfig features are implemented by tlmgr. spell and error checking and happen to install dependencies manually. TeX compilers will re-generate the cache accordingly on next compilation. not a word processor (Word. By default TeX Live will install in /usr/local/texlive. is rarely too cumbersome.2.TeX and LaTeX source documents (as well as related files) are all text files. LATEX/INSTALLATION 5 First test Note that if you have been using another TeX distribution beforehand. You should use a text editor # tlmgr install latex latex-bin latexconfig latex-fonts (e. tlmgr help Installing LaTeX 1. . letter Still.2. List current installation options: • the system cache goes in /var/lib/texmf. Notepad). and can be opened and modified stall the base packages for LaTeX. you theirs needs. OpenOfIn this case you can omit latexconfig latex-fonts as they fice). tlmgr option • the user cache goes in ~/. It may tocompletion of commands. The distribution is quite proper as it will not write any file outside its folder. because they usually have autlmgr resolves some dependencies.g. If you did not install the documents as told previ. hyphenation patters. You can change the install options: Therefore TeX Live can be installed and uninstalled safely tlmgr option src 1 tlmgr option doc 0 tlmgr option paper by removing the aforementioned folders. but not all. Emacs can provide a complete LaTeX editFor instance. be installed into the Emacs program). document preview and many other features. TeX Live still features this tool. as it contains only generated data. The TeX Live cache is usually stored in the ~/. table of contents for finnish and sanskrit hyphenation patterns. Advanced users can program it (in elisp) Hyphenation to make Emacs the best LaTeX environment that will fit If you are using Babel for non-English documents. In turn beginners may prefer using it in comneed to install the hyphenation patterns for every language bination with AUCTeX and Reftex (extensions that may you are going to use. Configuration Uninstallation Formerly. let’s in. # tlmgr remove <package> Emacs Emacs is a general purpose. You may safely remove this folder You should get a DVI or a PDF file accordingly. spell-checking. # tlmgr install hyphen-{finnish.3 Editors Now we have a running plainTeX environment. Other interesting packages: Cross-platform # tlmgr install amsmath babel carlisle ec geometry graphics hyperref lm marvosym oberdiek parskip pdftex-def BaKoMa TeX BaKoMa TeX is an editor for Windows and Mac OS with WYSIWYG-like features.texliveYYYY.texliveYYYY folder (YYYY world!\bye' stands for the year). extensible text processing system. Depending on your configuration. TeX distributions used to be configured with the texconfig tool from the teTeX distribution. but recommends using its own tool instead: tlmgr. you can still access the tlmgr man page with You may still have to wipe out the folders if you put untracked files in them. Note that generic plain text editors. Only use texconfig when you cannot do what you want with tlmgr. Dedicated LaTeX editors are more useful than are auto-resolved dependencies to LaTeX. TeX Live provides a more convenient way to do this: See the TLMGR(1) man page for more details on its usage. It takes care url of compiling the LaTeX source and updating it constantly If you installed a package you do not need anymore. You need to remove it so that the new $ tex '\empty Hello world!\bye' $ pdftex '\empty Hello packages are taken into account.# tlmgr uninstall ously. Thankfully this handy macros. you may still have hyphenation cache stored In a terminal write in you home folder. view. use to view changes to document almost in real time.).1. They are all packaged individually. By default. use ing environment with auto-completion. *BSD and GNU/Linux-only LyX1. providing a powerful GUI for editing multiple documents it has its own PDF viewer.6. In addition Kile Kile is a LaTeX editor for KDE (cross platform). tomizable build options. with the idea that a simple interface is better than a cluttered one. Mac. Kile can be run in all operating systems that can run KDE. It contains formula and table editors and shows visual clues of the final document on the screen enabling users to write LaTeX documents without worrying about the actual syntax[3] . TeXmaker TeXmaker is a cross-platform editor very similar to Kile in features and user interface. and compiling them with many different TeX compilers. Linux and Mac OS. A variety of extensions exist including LaTeX Box and Vim-LaTeX. a console and cusLaTeX editor forked from Texmaker. TeXworks TeXworks is a dedicated TeX editor that is included in MiKTeX and TeX Live. and Linux Screenshot of TeXworks on Ubuntu 12. Mac OS X and Windows. It was developed LaTeXila LaTeXila is another text editor for Linux . document structure viewer. which have a better initial experience with LaTeX. and thus to make it easier for people in their early days with LaTeX to get to what they want to do: Screenshot of Gummi. GEdit is a cross-platform application for Windows. Kile is based on Kate editor. has a quick access toolbar for TeXstudio TeXstudio is a cross-platform open source symbols. GETTING STARTED gedit-latex-plugin Gedit with gedit-latex-plugin is also worth trying out for users of GNOME. Screenshot of Kile. TeXworks originally came about precisely because a math professor wanted his students to Gummi Gummi is a LaTeX editor for Linux.6 CHAPTER 1. compiles the output of pdflatex in realtime and shows it You can install TeXworks with the package manager of on the right half of the screen[2] . your Linux distribution or choose it as an install option in the Windows or Mac installer. write their documents.3 LyX LyX is a popular LaTeX editor for Windows.10. Vim Vim is another general purpose text editor for a wide variety of platforms including UNIX. permitting the user to select the font. Authorea’s versioning control viewer for Mac OS that is bundled with the MacTeX dis. one for editing the repository). Cross-platform background colour of the editing environment.bib) are most easily edited and modified using a management system. These graphical user TeXnicle TeXnicle is a free editor for Mac OS that in. It offers one-click updating of the preview and allows easy crossfinding between the code and the 1. It also performs code highlighting and the editing window is customisable. Windows-only LEd LEd TeXnicCenter TeXnicCenter is a popular free and open source LaTeX editor for Windows. macro support. one for the preview. ity to execute detailed word counts on documents. and equations (in LaTeX or MathML).nal formats is provided). It has been designed and configured to integrate with TeX Systems such as MiTeX or TeX Live. and one as a console for error messages. live previews. code completion support. Bibliography files (*. Its in-built macro helps in compiling the LaTeX source to the WYSIWYG-like DVI or PDF or PS and also in exporting the document to other mark-up languages as html or XML. WinShell WinShell Web-based Authorea Authorea is not a LaTeX installation per se. It includes a is entered for each reference item. It also has a similar user interface to TeXmaker and Kile.system is entirely based on Git (every article is a Git tribution. integration with sharing services.4 Bibliography management preview by using CMD-click. and PDF and HTML export options.2.2. where information cludes the ability to perform live updates. It uses multiple windows.1. Screenshot of JabRef.interfaces all feature a database form. in addition to PDF (export to numerous jourTeXShop TeXShop is a TeXworks-like editor and pre. Archimedes’s Magic Type feature lets users insert mathematical symbols just by drawing them on their MacBook’s trackpad or Magic Trackpad. and the resulting text code library for the swift insertion of code and the abil. LATEX/INSTALLATION 7 (Gnome).file can be used directly by BibTeX. source. Authorea’s frontend allows you to enter text in LaTeX or Markdown. Archimedes Archimedes is an easy-to-use LaTeX and Markdown editor designed from the ground up for Mac OS X. as well as figures.Mac OS X-only itor with strong predisposition towards creation of LaTeX/TeX documents for Windows. technical documents in collaboration. Mac OS X-only Authorea renders and compiles everything to the web (HTML5). It includes a built-in LaTeX library. Screenshot of BibDesk but an integrated online framework for the creation of . • JabRef • Mendeley WinEdt WinEdt is a powerful and versatile text ed. It is in active development. colour. It offers simultaneous real-time editing and collaboration. it does not aim at being a spreadsheet tool nor a vector graphics tool. Normally LaTeX saves the final document as a . live document preview. Start writing with one click (no signup required) and share the link. Procedural graphics produce state-of-the-art results that integrates perfectly to LaTeX (e. etc.like EtherPad for LaTeX. result with any PDF viewer. The new sign ups are now directed to use ShareLatex. Other tools are better at that.com is a secure.2. and also tools such as dvi2pdf for converting the result automatically to PDF and PS formats. For easier and quicker drawings. GETTING STARTED • BibDesk is a bibliography manager based on a BibTeX file. you may want to use a WYSIWYG tool and export the result to a vector format like PDF.8 CHAPTER 1. The drawback is that it will contrast in • publications. you can puts. • Monkey TeX is free and allows team sharing.com is a secure cloud based LaTeX editor offering unlimited free project.li is a real-time collaborative LaTeX editor. figures. easy to use online LaTeX editor with integrated rapid preview . size. The graphics topic is a bit different since it is possible to write procedural graphics from within your LaTeX document. Dropbox integration.2. 1. The ideal solution is to combine the strength of both tools: build your dynamic table with a spreadsheet. . • Adobe Reader • epdfview • Evince • Foxit • Okular • Sumatra • Zathura 1. but have a steep learning curve and require a lot of time to draw. • ShareLaTeX.dvi use a web-hosted service featuring a full TeX distribution (Device independent file format).7 Online solutions Finally. or a tool like dvi2pdf to conmake the document available through a URL makes vert the DVI file to PDF format. you will need a viewer for the files LaTeX out. no font change). Premium accounts are available for extra features such as version control and Dropbox integration. bibliographies and custom styles.2.6 Tables and graphics tools LaTeX is a document preparation system. It supports real time preview. it will not handle the handy features you could get with a spreadsheet like dynamic cells and calculus.g.com is one of the most mature systems available. It imports references from the internet and makes it easy to organize references using tags and categories[4] . • writeLaTeX. • SpanDeX is a cloud-based LaTeX collaboration platform designed to make collaborating with LaTeX seamless and to reduce the learning curve to LaTeX.com however accounts are still available upon request. with git push and pull access it allows for powerful version control. Then you can view the local download and compilation easily scriptable). See Tables for more details. • LIMSUP is an online LaTeX editor allowing real time collaboration of LaTeX documents (announcement) Here follows a list of various PDF viewers. Merge conflicts can easily resolved by using a built-in merge tool that uses an implementation of the diff-algorithm to generate information required for a successful merge. 1. Practically all LaTeX distributions have a DVI viewer for viewing the default output of latex. • Verbosus is a professional Online LaTeX Editor that supports collaboration with other users and is free to use. If LaTeX can render beautiful tables in a dynamic and flexible manner.To get started without needing to install anything. but you will rarely want and a web LaTeX editor. See Importing Graphics for more details. • Google Documents or LaTeX Lab allows real-time simultaneous collaborative editing of text files for Usually you will use a LaTeX compiler like pdflatex to anyone with a Google account (and its option to produce a PDF file directly. • ScribTeX. and export it to LaTeX to get a beautiful table seamlessly integrated to your document.). DVI files do not contain embedded fonts and many document viewers are unable to open them. it to. Some tools have the capability to export to LaTeX. and a built-in LaTeX resource system.5 Viewers style with the rest of your document (font. which will partially solve this issue. dtx file (which is why you must have 1. A package is a file or collection of files containing extra LaTeX commands and programming which add new styling features or modify those already existing. which combines the package program and its documentation in a single file. When you try to typeset a document which requires a package which is not installed on your system. it means one of two things: • Either the package is part of a much larger bundle which you shouldn't normally update unless you change LaTeXversion of LaTeX. If you cannot find the wanted package with any of the previous methods. The second is the installation routine (much smaller). But many more are available on the net. As a convenient feature. The use of tlmgr is covered in the Installation chapter.2. If the two files are not there.8 References [1] teTeX Home Page (Retrieved January 31. The main place to look for style packages on the Internet is CTAN. They should all be stored in subdirectories of texmf/tex/latex named after each package. you might have to install a package like texlive-lang. use tlmgr to manage packages individually.3 LaTeX/Installing Extra Packages Add-on features for LaTeX are known as packages. There may be ancillary files as well.. See the manual installation.2 Manual installation Downloading packages What you need to look for is usually two files. Once you have identified a package you need that is not in your distribution. MikTeX will automatically prompt to install the missing ones.txt with a brief description of the package. although it depends on how big each package is. That is. Most LaTeX installations come with a large set of preinstalled style packages. The directory name “texmf” stands for “TEX and METAFONT”. This will extract all the files needed from the .ins filename in a command window in your temporary directory.1 Automatic installation both of them present in the temporary directory). To find out what other packages are available and what they do. You can download updates to packages you already have (both the ones that were installed along with your version of LaTeX as well as ones you added).3.sty extension. but there is a configurable limit to the number that can be used inside any one LaTeX document at the same time. For example. There is no limit to the number of packages you can have installed on your computer (apart from disk space!). With TeX Live. upon the compilation of a file requiring noninstalled packages. type latex followed by the . 2007) [2] Gummi [3] LyX [4] BibDesk 1. You must always download both files. in this case. one ending in . Extract the files Run LaTeX on the . Dozens of these are pre-installed with LaTeX and can be used in your documents immediately. or if you prefer.dtx and the other in . use the indexes on any CTAN server to find the package you need and the directory where it can be downloaded from. Installing a package There are five steps to installing a LaTeX package. Note down or print the names of the files created if there are If on an operating system with a package manager or a a lot of them (read the log file if you want to see their portage tree.dtx file. you should use the CTAN search page which includes a link to Graham Williams’ comprehensive package catalogue. it is common to have the distribution packed into a few big packages. There are two main file types: class files with . See the automatic installation. (These steps can also be used on the pieces of a complicated package you wrote yourself. 9 With MikTeX there is a package manager that allows you to pick the package you want individually. • or it’s an older or relatively simple package written by an author who did not use a . LATEX/INSTALLING EXTRA PACKAGES 1. tlmgr install <package1> <package2> . In practice there is no problem in having even a couple of dozen packages active.3. skip straight to Step 3. 1. you can often find packages in repositories.) 1. to install something related to internationalization. LaTeX will warn you with an error message that it is missing. names again). With TeX Live manually installed.. and style files with . see the manual installation. so you can use the package manager of the TeX distribution or the one on your system to manage them. tlmgr remove <package1> <package2> . Download the package files to a temporary directory. open the file in your editor and process it as if it were a LaTeX document (which it is). .ins file.1. You should of course read this file first.ins.3.. There will often be a readme.cls extension.. The first is a DOCTeX file. org/fonts/fontinstall. especially if your TeX installation is old or does not con• MikTeX: Run initexmf --edit-config-file form to the TeX Directory Structure(TDS).map file for the fonts. Packages installed by hand should always be placed in your “local” directory tree. system where she cannot write to a protected directory). For a package like paralist. For a TDS(TeX Directory Structure)-conformant system.ist -o name. move or copy the package files from your temporary directory to the right place[s] in your TeX local installation directory tree. as long as you then register it as a user-managed texmf directory (see http://docs. If there are config. such as old shared Unix syslong in different locations. user.html.glo 3.files: you have to know this. or installer has chosen not to follow the misc along with other unrelated stuff. follow the steps in the indexing section. then run initexmf file is a suitably-named subdirectory of texmf/tex/latex/. There are also systems where directory for the package rather than dump the files into the owner. depending on your distribution: • TeX Live and MacTeX: updmap --enable Map=mapfile. but in the case of is that there are still thousands of installations which do complex packages there may be more. This program comes with every modern version of TeX and has various names depending on the LaTeX distribution you use. you need to update the font mapping files in addition to updating the index. If you prefer to create PDF then run pdfLaTeX instead. If you created a . 5. For example. Update font maps If your package installed any TrueType or Type 1 fonts. The outermost folder should probably be called texmf-local/ or texmf/. or is unable to uration or other files. (Read the documentation that came with your installation to find out which it is. add the line “Map mapfile. the foundry is public. This will create a . and b) avoid your newly-installed files being overwritten when you next update your version of TeX. run your TeX indexer program to update the package database. not in the directory tree containing all the pre-installed packages.miktex.map conformant system. Its location depends on your system: • MacTeX: Users/username/Library/texmf/. or consult http://www. too. The map updating program is usually some variant on updmap.sty file to move. “Suitably-named” means sensible and meaningful (and probably short). In Settings menu choose the first tab and click on Refresh FNDB-button (MikTex will then check the Program Files directory and update the list of File Name DataBase). for exam. For a TDSupdmap.html#id573803) 4. ple. The “right place” sometimes causes confusion.tug.10 CHAPTER 1. • MikTeX: Your local directory tree can be any folder you like. to get the cross-references right (just like any other LaTeX document).tug. Sometimes you will see that a . --mkmaps. • Unix-type systems: Usually ~/texmf/. The reason for having the texmf-local directory (called . After that just verify by clicking 'OK'. Your package author should have included a .See http://www. Create the documentation Run LaTeX on the .dtx file.7 or later versions. • MikTeX: initexmf --update-fndb (or use the GUI) • MiKTeX 2. This is why it is a good idea to create a sub. installed on Windows XP through Windows 7: Start -> All Programs -> MikTex -> Settings.map (if you installed the files in a personal tree) or updmap-sys --enable Map=mapfile.not conform to the TDS. and they may be. In Windows 8 use the keyword Settings and choose the option of Settings with the MiKTex logo. The reason this process has not been automated widely Often there is just a . GETTING STARTED 2.sty to the file that opens.gls name.recommended TDS directory structure. Install the files While the documentation is printing. For most fonts on CTAN.html#fndb): • teTeX. If you want the index to be created properly. it means that the document contains an index. TeX Live. new BibTeX tems and some Microsoft Windows systems. your “local installation directory tree” is a folder and its subfolders.glo (glossary) file has been produced. so there is no packages or font packages will typically have several files way for an installation program to guess where to put the to install. the “right place” for a LaTeX .org/ fonts/fontinstall. read the documentation to find out do so for political or security reasons (such as a shared if there is a special or preferred location to move them to. Run the following command instead: makeindex -s gglo.org/manual/ localadditions.dvi file of documentation explaining what the package is for and how to use it. fpTeX: texhash • web2c: mktexlsr • MacTeX: MacTeX appears to do this for you. Update your index Finally. You might need to run it twice or more. I'd call the directory texmf/tex/latex/paralist.idx as well.map (if you installed the files in a system directory). This is done to a) prevent your new package accidentally overwriting files in the main TeX directories. although other packages (such as BibTeX and font packages) are found in other subdirectories in doc. as well as the commands that tell LaTeX how to typeset You can usually automatically open any installed package the text. You can create it with any text editor. All modern TeX installations should do this anyway. especially if you are a user on a shared or managed system (Unix. . LaTeX converts your source text.1 The LaTeX syntax LaTeX uses a markup language in order to describe document structure and presentation. LATEX/BASICS texmf. but if not.4 Package documentation To find out what commands a package provides (and thus how to use it). txt. To consult the documentation: This tutorial is aimed at getting familiar with the bare bones of LaTeX. It returns the path to the file. • We will first have a look at the LaTeX syntax.dvi files. Before using a package. you need to read the documentation. etc. Your installation must be configured to look in these directories first. You can also have a personal texmf subdirectory in your own login directory. If your installation procedure has not installed the documentation.1. one for every package installed.4. sizes. the documentation for amsmath is found at latex/amsmath/amsdoc. • Then we will take you through how to feed this file through the LaTeX system to produce quality output. The documentation directories have the same name of the package (e. however.4. the DVI files can all be downloaded from CTAN.3.4 LaTeX/Basics The tlmgr tool has lot more options. • Finally we will have a look at the file names and types. You cannot just guess and hope it will work: you have to read it and find out. etc. • We will create our first LaTeX document.6 See Also ages.dvi). most of the packages are in the latex subdirectory.cnf yourself. The input for LaTeX is a plain text file. Additional resources form The TeX Catalogue Online: • Alphabetic catalogue • With brief descriptions • Topical catalogue with packages sorted systematically • Hierarchical mirroring the CTAN folder hierarchy kpsewhich will actually search for files only. In the texmf/doc subdirectory of your installation there should be directories full of . It contains the text of the document. ensure you have LaTeX installed on your computer (see Installation for instructions of what you will need). For the purpose of analogy.tex 11 documentation with the texdoc command: texdoc <package-name> 1. Windows NT/2000/XP. which describes the commands the package makes available.3. especially the subsection usually called “User Interface”. Before starting. For more details on a • LaTeX/Package Reference specific package use the command-line tool tlmgr (TeX Live only): tlmgr info <package> 1.5 External resources The best way to look for LaTeX packages is the already mentioned CTAN: Search. etc. so that any updates to standard packages will be found there before the superseded copies in the main texmf tree.).g.3. $ kpsewhich tikz /usr/local/texlive/2012/texmfdist/tex/plain/pgf/frontendlayer/tikz. The documents generally have the same name as the package. fonts. amsmath).3 Checking package status The universal way to check if a file is available to TeX compilers is the command-line tool kpsewhich. but it is your browser that presents it in its full glory . VMS. which generally have one or more relevant documents in a variety of formats (dvi.3. such as postscript or PDF. 1. but there are exceptions (for example.) where you may not have write-access to the main TeX installation directory tree. combined with the markup. but is typically found in: Generally. 1. tlmgr help 1. This location is distribution-specific. into a high quality document. not for pack. you can edit texmf/web2c/texmf.with different colours.local on some systems) is to provide a place for local modifications or personal updates. Linux.1. web pages work in a similar way: the HTML is used to describe the document. pdf. you should read the documentation carefully. you can use \backslash instead. and that’s where groups come to be very useful. ticular symbols (such as URIs). A switch The 'less than' (<) and 'greater than' (>) characters are the should (almost) never be called outside of any scope. accents. the current group or environment. Comments When LaTeX encounters a % character while processing an input file. That’s why you need braces to specify there is no letter as argument.g. Non-ASCII characters (e. The LaTeX compiler normalises whitespace so that whitespace characters. Command names are terfor line breaking. which has to be given between curly braces { } after the command name. A double line break (an empty line). diacritics) can be typed in directly for most cases. such as [space] or [tab]. they will normally not print.pdf/.dvi/. letter”. and take one of the uments all the same by adding a prefix backslash: following two formats: The backslash character \ cannot be entered by adding • They start with a backslash \ and then have a name another backslash in front of it (\\). but they usually have effect on a wider part of the document. The range of commands put between braces is limited to them. The commands \~ and \^ produce respectively a tilde and • They consist of a backslash \ and exactly one nona hat which is placed over the next letter. which makes its usage safe (no influence on the other parts of the document). Some commands support optional parameters. the line break. For introducing a backslash in math minated by a space. See Special Characters for an explanation Example: and a workaround. are treated uniformly as “space": several consecutive “spaces” are treated as one. You can also use \textasciitilde and \textasciicircum to enter these characters. For source code. Reserved Characters In general. We will tackle this issue in Special Characters. but this feature is not commonly used and so it will be The following symbols are reserved characters that either discussed in more advanced parts of the document.LaTeX commands are case sensitive. . An example of applying these rules is presented below: the left-hand side shows the user’s input (. which are If you want to insert text that might contain several paradded after the command name in square brackets [ ]. Switches have no arguments but apply on the rest of Listings the scope. othonly visible ASCII characters (not reserved) that will not erwise it will apply on the rest of the document. defines the end of a paragraph. commands . For example letter. The internal mechanism of environments defines a group. LaTeX environments Environments in LaTeX have a role that is quite similar to commands. “space” opening a line is generally ignored. it ignores the rest of the current line. If you enter them directly in your text. while the right-hand side depicts the rendered output (. multiple empty lines are also treated as the end of a paragraph. mands and environments. or other Some commands need an argument. you can consider using The general syntax is: the \verb command. a number or any other “nonmode. however. The \begingroup and \endgroup commands are equivalent to Spaces opening brace and closing brace. print correctly.12 CHAPTER 1. and all whitespace at the beginning of the next line. but rather make LaTeX do things you did not intend. Their syntax is: Between the \begin and the \end you can put other commands and nested environments. The other symbols and many more can be printed with special commands in mathematical formulae or as accents.tex).ps). However you must configure the document appropriately. Example: For some commands it is important to restrict their range of action. GETTING STARTED A minimal example looks something like the following LaTeX groups (the commands will be explained later): A group is basically defined by a pair of braces. i. and a single line break also yields “space”. which will be discussed later in the section on formatting. LaTeX commands #$%^&_{}~\ As you will see. environments can accept arguments as well. this sequence is used consisting of letters only. have a special meaning under LaTeX or are unavailable Anything in LaTeX can be expressed in terms of comin all the fonts.e. see Source Code Most standard LaTeX commands have a switch equivalent. \~n gives ñ. these characters can be used in your doc. On the other hand. emacs. the small dark green text under the boxes represents not LaTeX. the blue text on the arrows represents the commands you have to These compilers are basically used to compile Plain TeX. The following diagram shows the relationships between • tex compiler reads a TeX .the image formats that are supported. • pdflatex executable calls pdftex with LaTeX initialization files. Therefore. and therefore will not work with pdflatex.2 Our first document As a matter of fact.3 Compilation Compilation process The general concept is to transform a plain text document into a publishable format.pdf.dvi file to . reads a LaTeX . some packages. PDF files can be created with both pdflatex and dvipdfm. Comments are not classed as a command. reads a LaTeX . to expect some commands. • dvi2pdf converts the . as with Supercalifragilisticexpialidocious above. which will not show up in the printed version.ps (postscript). which are not part of DVI. The boxed red text represents the file formats. since all they tell LaTeX is to ignore the line. which is a free and multi-platform software as well. make sure it bears a . exploit the process of conversion to DVI. What does it all mean? As we have said before. the well known Hello World! approach will TeX distribution. be suitable here. There are two main compilers. the others come with w:Ghostscript. following your operating system latex Now we can create our first document. There is no such LaTeX compiler since La. This is LaTeX’s way of knowing that whenever it sees a backslash.dvi file to . Here are common programs you expect to find in any LaTeX • Open your favorite text-editor. • latex executable calls tex with LaTeX initialization files. the only format it could create was DVI. LATEX/BASICS 13 This can be used to write notes into the input file.tex. You would write your document slightly differently depending on the compiler you are using (latex or pdflatex). and with Ghostscript: • ps2pdf and pdf2ps converts the . which is done by an executable file called a compiler. PS or PDF file. but reemerges when the DVI is converted to another. When picking a name for your file.tex file and creates a .4. and other text editors will have syntax highlighting that will help to write your files. This process is called compilation.pdf (dvi2pdfm is an improved version). use. Some of those packages embed information in the DVI that doesn't appear when the DVI is viewed. while the compiler can handle the translation itself.dvi. Comments never affect the output of the document.dvi Note that the % character can be used to split long input lines that do not allow whitespace or line breaks. If you compile a Plain TeX document with a LaTeX comRefer to multi-line comments for simple workarounds. But as we will see later it is possible to add a sort of abstraction layer to hide the details of which compiler you're using. there through an arrow you lose some information. you .1. mosty a DVI.tex file and creates a from it: . the absolute bare minimum that is needed in order to get Most of the programs should be already within your Lasome output. This is the LaTeX source. The output of pdflatex takes direct advantage of modern features of PDF such as hyperlinks and embedded fonts. distribution: Notepad++. later PDF support was added by pdflatex. each of the LaTeX commands begins with a backslash (\).4. which might are two executables related to the previous compilers: decrease the features of your document. When LaTeX was created. the LaTeX source code and the formats you can create • pdftex compiler reads a TeX .4.ps file to .tex extension. vim.tex file and creates a . • Reproduce the following text in your editor. We will produce and pdflatex are simple scripts or symbolic links. However.tex file and creates a .pdf The core LaTeX language does not have a predefined syntax for commenting out regions spanning multiple lines.pdf and vice-versa. Any time you pass TeX is just a bunch of macros for TeX. piler (such as pdflatex) it will work while the opposite is not true: if you try to compile a LaTeX source with a TeX compiler you will get many errors. newer format. 1. such as PSTricks. • dvi2ps converts the . 1. Passing through DVI imposes limitations of its older format. • Save your file as hello. • PDF needs more disk space and it is slower to creand produces either a DVI or PDF file. but we want to see it nonetheless. already are not very common. the standard document viewers for many Linux distributions are able to view DVI files. Type the command: latex hello (the .14 CHAPTER 1. the last two lines links. However.tex is stored. GETTING STARTED pdftex on Windows you can use a program called yap (yet another previewer). But this will be discussed in the future when it comes up. so here is how links. Various bits of info about LaTeX and its progress bit more complicated if you want to introduce images or will be displayed. so you can consider using it for the final version of your document. days it is the de facto standard for sharing and publishing documents. Various bits of info about LaTeX and its progress will be displayed. jpg) ps2pdf pdf2ps PostScript dvi2ps DVI (eps) dvipdfm should choose the shortest route to reach your target format. Type the command: pdflatex hello (as before. It does not include the fonts within the document. .log. you begin to create complex documents. font expansion and marbased system.log. This will be explained in detail in the next chapters. png. It does not support any interactivity you have ever seen.dvi.dvi (1 page. you can notice that the PDF document is bigger than the DVI.Note. 5548 bytes). This is probably the most convenient way to obtain an output in your desired format anyway. although you can include it if you wish) About now. Now you may view the DVI file. Some LaTeX ate. the . The steps are exactly the same as before. even if it contains exactly the same information. I such as hyperlinks or animated images. but it includes all the necessary fonts within installations feature a graphical front-end where you can the document. if This means that your source file has been processed and the resulting document is called hello. 232 bytes). but with the same source file you can create a PDF document. The main differences between the DVI and PDF formats Chapter Export To Other Formats discusses more about are: exporting LaTeX source to other file formats.tex extension is not required. On other sysportability. does not have a GUI (graphical user interface). you saw you can create both DVI and PDF document from the same source. converting to PostScript only when it is necessary to print the document. Output written on hello. the best way is to use only latex for a DVI output or pdflatex for a PDF output. Please note: this description assumes that gin kerning resulting in more flexibility available to you already have a working LaTeX installation on your the TeX engine and better looking output. so Generating the document if you want the document to be viewed properly on another computer. due to the simplicity of the file. DVI viewers am assuming that you are at a command prompt. but you have to replace the command latex with pdflatex: latex Source formats Output formats PDF (pdf. Starting from a LaTeX source. 1. Tran. since it is just a program that crunches away at your input files. etc. there must be all the necessary It is clearly not going to be the most exciting document fonts installed. Nowacomputer. It supports internal and external hypertems there might be some typing involved. displayed in the console will be: but for now assume you can compile in both DVI and PDF without any problem.) tex pdflatex This way you created the DVI file. so you can consider using it in the directory where hello. you script written on hello. the last two lines displayed in the console will be: Output written on hello. • DVI needs less disk space and it is faster to create. LaTeX itself for previewing your document while typesetting. but it gets a 2. Transcript written on hello. It also supports advanced typographic feato coax LaTeX into compiling your input file on a text tures: hanging punctuation. which takes up 1 page and 232 bytes of space.dvi. LaTeX needs to be executed multiple times to resolve the references. If all went well. (Now evince and okular. On Unix with X11 you can type xdvi foo. so you will not have any problem of click LaTeX into compiling your input file. 1.pdf (1 page. including bibliographies and cross-references. in this instance. only need to run the LaTeX command once. This is true.tex extension is not required) 2. If all went well. bibliographies. the digits 0-9. You can tell LaTeX to follow typography rules of Never. Some Questions and Issues operating systems do not distinguish between upper-case and lower-case letters. Therefore it’s best not We highly urge you to read the FAQ if you have issues to mix them.4. It stores temporary data into these files and use them for the next compilation. It means you can delete them safely.) to separate the file ex. None of these files contains unrecoverable information. or if you want to read essential recAncillary files The TeX compilers are single-pass processes. See the dedicated part. Make filenames as short or as long as you wish. It means that there is no way for a compiler to jump around the document. Stick to lower-case let. so when the table of contents is printed before the upcoming sections. you may have noticed that the output PDF file is not always the same size depending on the engine you used to compile the file. refer to the Tips and Tricks page. many LaTeX commands which Working in a team need to jump use ancillary files which usually have the same file name as the current document but a different See chapter Collaborative Writing of LaTeX Documents. For the more specific questions and issues. There is no need to re-compile if no section moved. They make your documents very dynamic and flexible. Compressed PDF For example. Although your operating system probably on. others do.5 And what now? ps2pdf will usually be much smaller than pdflatex. compiling will regenerate them automatically. If you want pdflatex features along with a small output file size.See Modular Documents for good recommendations tension (somewhat similar to the conventions for a good about the way to organize big projects into multiple files. ommendations.4. use the Q&A page. and only one full point or period (. See Special Characters and Internationalization. latexmk can generate a PDF from most TeX files simply: $ latexmk -pdf file. So to have an upto-date table of contents.part for all the common features that belong to every type sOutputFile="Compressed. Indeed the compiler cannot guess at which page a specific section is going to be printed. but strictly avoid spaces. and so contain spaces. Web URL): it will let you refer to TeX files over the Web more easily and make your files more portable. So latex → dvips → 1.pdf” “Original. For example.4 Files Non-English documents and special characters Picking suitable filenames LaTeX has some nice features for most languages in the world. etc. The following list explains the most common file types you might encounter when working with TeX: For a PDF output.toc. the temporary file for the table of contents data is filename. ease special characters input. supports them.1.tex Note that most editors will take care of it for you. When you work with various capabilities of LaTeX (index. ever use directories (folders) or file names that the target language. which would be useful for the table of contents and references.) you will soon find yourself in a maze of files with various extensions and probably no clue. Compiling using only the latex binary can be quite tricky as soon as you start working on more complex documents as previously stated. To circumvent this issue. extension. Common Elements you can use the Ghostscript command: See Document Structure and the Common Elements $ gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite . glossaries.4. LATEX/BASICS 15 Autobuild Systems ment twice. some don't. Macros for the utmost efficiency The full power of LaTeX resides in macros. the hyphen (–). A number of programs exist to automatically read in a TeX document and run the appropriate compilers the appropriate number of times.pdf” of document. it cannot set the page numbers.Modular document ters without accents (a-z). and they will only cause grief and tears with TeX. you need to compile the docu- . 1. If you cannot find what you want here. about basic features. Normally.} and \be. Packages like making an index.. It is recommended to put this declaration at the very beginning.LaTeX: gin{document} is called the preamble.Chapter 2 Common Elements 2. The options have to be separated by commas. LaTeX is different from other typesetting systems in that you just have to tell it the logical and semantical structure of a text. you would use: ing this soon). if you want a report to be in 12pt type on (where the blank line is in the example above: we'll be us. and will see and feel this structure much better if the typographical form reflects the logical and semantic structure of the content. Such enhancements are called packages. information. who simply provide you with their own class file. Thus every input file must contain layout suitable for double sided printing on A4 paper. When processing an input file. But we'll be happy with the standard article class for now. which is why they have a After the preamble. the text of your document is enclosed lot of options in common. sections. The end of the actual document: most common options for the standard document classes You would put your text where the dots are. Modern TeX distributions come with a large 16 .1. This is specified with the \documentclass command.A4. Example: an input file for a LaTeX document could start with the line which instructs LaTeX to typeset the document as an arWhen LaTeX processes an input file.ticle with a base font size of 11 points. and to produce a low a certain structure. which tells LaTeX how to format your content. the commands Here are some document classes that can be used with The area between \documentclass{. While writing your document. Others are provided 2.2 Preamble separately. The reader will understand the text better if these ideas are well-structured. It is also possible to create your own. 2. but printed one-sided in draft mode. It normally The standard document classes that are a part of LaTeX contains commands that affect the entire document. Some packages come with the LaTeX base distribution. The reason for marking off the end of your text is to provide a place for LaTeX to be programmed to do extra stuff automatically at the end of the document. it expects it to fol. including letters and slides. LaTeX needs to know the type of document the author wants to create. subsections and paragraphs. you will probably find that A useful side-effect of marking the end of the document there are some areas where basic LaTeX cannot solve text is that you can store comments or temporary text unyour problem.. Other classes may have differbetween two commands which identify the beginning and ent options (or none at all). The reason are listed in the following table: for marking off the beginning of your text is that LaTeX allows you to insert extra setup specifications before it For example. The options parameter customizes the behavior of the document class. If you want to include graphics. or knowledge to the reader. class specifies the type of document to be created. as is often done by journal publishers. It then derives the typographical form of the text according to the “rules” given in the document class file and in various style files. third party classes come with some documentation to let you know.1. colored derneath the \end{document} in the knowledge that Latext or source code from a file into your document. are built to be fairly generic. LaTeX allows users to structure their documents with a variety of hierarchical constructs.1 LaTeX/Document Structure Document classes The main point of writing a text is to convey ideas. including chapters. The LaTeX distribution provides additional classes for other documents.1 Global structure Here. you TeX will never try to typeset them: need to enhance the capabilities of LaTeX. All of this type of information within LaTeX is collectively referred to as top matter. then you can use with the several different commands to enter author information. address. in the same way as geometry does. LaTeX allows you to give an optional extra version of the heading text which only gets used in the Table of Contents and any running heads. a book has chapters but an article doesn't. and also information about the authors. add the following line before you begin the abstract environment: Sectioning commands The commands for inserting sections are fairly intuitive. The title and author are usually compulsory (at least if you want LaTeX to write the title automatically). therefore.1. For example. after the top matter. so don't bother adding If you are provided with a class file from a publisher. \author. like geometry shown below: Abstract Many packages can have additional formatting specifications in optional arguments in square brackets. or if them explicitly. Here is a more complicated example: as you can see. author name. you would type: to put whatever you want as a date. For example. which you almost certainly don't want. this would appear in the Table of Contents as well. you must give the package its own separate \usepackage command. to use the color package. such as the title and date. If You can include several package names in one \usepack. Here are some of the structure commands found in simple.tex. for sections. Each section in this table is a subsection of the one above it. and \date commands are selfexplanatory. If you want to change it into anything else. you can use commands as arguments of \title and the others. Read the documentation for the package concerned to find out what can be done. LaTeX will sort that out for you. You always finish the top matter with the \maketitle command. LATEX/DOCUMENT STRUCTURE 17 number of packages pre-installed. your title freely. By default.1. You can pass several options together separated by a comma: 2. Notice that you do not need to specify section numbers.Section numbering Numbering of the sections is permand: formed automatically by LaTeX. command. If you want to create and you can have more than one \usepackage command. then the date is omitted. If you omit \maketitle. “Executive Summary”.braces are left empty. You put the title. LaTeX will use the word “Abstract” as a title for your abstract. like Using this approach. and date in curly braces after the relevant command. If you use these. age command by separating the names with commas. like here. But you are free which lets you typeset in colors. there are predefined commands for telling LaTeX which part of the content makes up the abstract. but not book. or some special line-breaks or unusual font-play. you can create only basic output this: whose layout is very hard to change. The double backslash (\\) is the LaTeX command for forced linebreak. you do not need to use \begin and \end commands to indicate which content belongs to a given block. for example a very long title. such as name. and the \texttt commands options is a list of keywords that trigger special features formats the email address using a mono-spaced font. LaTeX uses today’s date by default. This should appear in its logical order. if you omit the \date command. Also. where package is the name of the package and The email address is at the end.3 The document environment Top matter At the beginning of most documents there will be information about the document itself. As most research papers have an abstract. LaTeX normally decides by itself where to break lines. All the titles of the sections are added automatically to the table of contents (if you decide to insert one). email etc. and it’s usually right. Of course. the titling will never be typeset (unless you write your own). This command is available for the document classes article and report. A simple example: The \title. see the Title Creation section. but sometimes you need to cut a line short. just insert the heading you want between . The in the package. Although never explicitly specified (there is no \topmatter command) you are likely to encounter the term within LaTeX documentation. which tells LaTeX that it’s complete and it can typeset the title according to the information you have provided and the class (style) you are using. built-in command called \today will be replaced with the current date when processed by LaTeX. if they are in effect.2. But if you make manual styling changes to your heading. This optional alternative heading goes in [square brackets] before the curly braces: If there are two authors separate them with the \and com. e. and start a new one. LaTeX provides 7 levels of depth for defining sections (see table below). but before the main sections of the body. Some packages allow optional settings in square brackets.g. in no set order. certain commands are appropriate to different document classes. Packages are activated you use the AMS article class (amsart). You don't have to print a ToC. If you only want parts. ensure that all ToC pagenumber references are correctly calculated.nism to add lines to the List of Figures or List of Tables by substituting lof or lot for toc. you can this: write: Note that if you use PDF bookmarks you will need to add a phantom section so that bookmark will lead to the cor. so you need to re-run LaTeX one extra time to \setcounter command. The blank line means “start a new paragraph here": it You can change the depth of specific section type.). follow the command name The commands \listoffigures and \listoftables work in exwith an asterisk before the opening curly brace: actly the same way as \tableofcontents to automatically All the divisional commands from \part* to \subpara.). By default it is set to 2. they norgraph* have this “starred” version which can be used on mally go after the \tableofcontents command. Note that this solution does not permit changing Paragraphs of text come after section headings. type the text and leave a blank line between paragraphs. Parts get roman numerals (Part I.in the “subsection” style. so you can turn it off selectively. and is imple. The List bered 5. Simply the depth dynamically. could be useful for PDF bookmarks (if you are using the For formatting paragraph indents and spacing between hyperref package) : In order to further tune the display or the numbering of paragraphs. go into the Table of Contents. see the dedicated chapter. For example if you use an contents anyway. and appendices (which are just a special case of chapters. chapters.command \renewcommand{\contentsname}{<New table of contents title>} in your document preamble. We've already seen how to use the optional For example. just add the command \tableofcontents at the point where you want it printed (usually You can change the depth to which section numbering after the Abstract or Summary). For example: lines to the ToC. use the \addcontentsline command like unnumbered section heading command to start a preliminary piece of text like a Foreword or Preface. tocdepth counter. which does not mean you get a blank line in the typeset output. occurs. etc. Table of contents All auto-numbered headings get entered in the Table of Contents (ToC) automatically. but you can add extra entries with the If you want the unnumbered section to be in the table of \addcontentsline command. It can be reset in exactly the body of the document.18 CHAPTER 2. etc. the command \phantomsection in combination also correct page numbering in the ToC): with \clearpage or \cleardoublepage can be used (see also The value where the section numbering starts from can Labels and Cross-referencing): be set with the following command: To change the title of the TOC. of Figures (LoF) and List of Tables (LoT) names can be For more details on counters. you can your document.list all your tables and figures.. to force extra or unnumbered section To get an unnumbered section heading which does not headings to be included. and only down to the level defined by the numbered. and sections Entries for the ToC are recorded each time you process numbered. The levels are defined above on this page. which specifies what depth ToC which is slightly different from the one printed in to take the Table of Contents to. Section number style See Counters. Ordinary paragraphs .This will format an unnumbered ToC entry for “Preface” rect place in the document. not subsections or subsubsections etc. B. chapters and sections get decimal numbering like this document. Depth The default ToC will list headings of level 3 and above. If the hyperref packmented normally as follows: age is used and the link does not point to the correct For chapters you will also need to clear the page (this will chapter. changed by replacing the \contentsname with \listfigurename for LoF and \listtablename for LoT. but if you want to. and reproduced the next time you prochange the value of the secnumdepth counter using the cess it. It is also possible to add extra the same way as secnumdepth. COMMON ELEMENTS the curly braces. if you want to change it to “1": argument to the sectioning commands to add text to the A related counter is tocdepth. To change how deep the table of contents displays automatically the following command can be used in the preamble: This will make the table of contents include everything down to paragraphs. The \phantomsection com. If you use them. and share the same structure) are lettered (A. C. you have to paste this The next section after this command will now be num. refer to the Paragraph Formatting section. The \tablespecial occasions for an unnumbered heading when the ofcontents command normally shows only numbered secsetting of secnumdepth would normally mean it would be tion headings. giving the depth level you wish. Part II. You can use the same mechamand is defined in the hyperref package. Additionally the class provides macros to change the formatting of some places of the document. We will give you some advice on how to use them properly. the second page of the introduction will have TABLE OF CONTENTS printed in the header. Note that the special content like the table of contents is To make it more convenient. since they will be number 0.1. By default a book Mainmatter will be two-sided. etc. Information (copyright notice.2. Title page 4. 19 5.1. like indices. Preface chapter The standard LaTeX book class follows the same layout described above with some additions. Only use the \appendix macro once for all appendices. Page numbers will be printed in arabic numerals. only might consider using only a few. LATEX/DOCUMENT STRUCTURE the table of contents. Since this is a quite complex topic. left and right margins will change according to the page number parity.n because there is no chapter numbering. Empty 3. Furthermore cur1. Half-title 2. Some subordinate chapters Backmatter • The frontmatter chapters will not be numbered. Check the Counters chapter for a fix. The trick is to set the leftmark and the TOC manually: As a general rule you should avoid mixing the command TABLE OF CONTENTS is traditionally printed both left order. ISBN. You may be tempted to put your introductory chapters in • The \appendix macro can be used to indicate that the main matter so that it follows the same numbering as following sections or chapters are to be numbered as the main chapters. we will give you details in the dedicated part Special Pages. This is not how the class was meant appendices. Appendices can be used for the article to be used. 1. right on even pages. LaTeX has two ways of inserting your references into a document: . List of figures (can be in the backmatter too) 2. Page order This is one traditional page order for books. Frontmatter is not supposed to have sections. so you and right. 1.Introductory chapters with main page numbering mand resets the page numbering.1. This is because the starred \chapter* command • The backmatter behaves like the frontmatter. Frontmatter 2. for instance if the appendix should be less detailed. you might use a macro: considered as an unnumbered chapter. And it will not be printed in the table of contents either.4 Book structure 8. Main topic rent chapter and section will be printed in the header. but here we print it like other chapters.[1] 1. It has does not set the leftmark -. doc). Table of contents 7. Dedication if any. Page numbers will be printed in roman numerals. glossaries and bibliographies. Nonetheless all commands are optional.e. The com. If you do not make use of chapters. it is barely useful to Appendix use the book class.see Page Layout. else empty 6. the same issue with section numbering. you can make use of the tocvsec2 package (CTAN. class too: In the above code sample. so you will run into an issue if you don't want the chapter to be numbered.5 Special pages Comprehensive papers often feature special pages at the end. Bibliography 2. i.) Bibliography Any good research paper will have a complete list of references. Glossary / Index • The mainmatter chapters works as usual. as you can have much more control over the presentation of your document if you wish. the setspace package provides the environments singlespace. So. It is often necessary to add emphasis to key words or phrases. care must be exercised so that punctuation marks are not misinterpreted as ends of sentences. You would usually use non-breaking spaces for punctuation marks in some languages. you would put a nonbreaking space before all two-parts punctuation marks. we will focus on the customization of words and sentences for now. it is also very easy to abuse. It’s simpler. Footnotes are useful for providing extra information or clarification without interrupting the main flow of text. for units and currencies. If formatting may also refer to paragraphs and to the page layout. To change line spacing within the document. A backslash in front of a space generates a space that will not be enlarged.6} for “double” line spacing. etc. Frenchspacing can be turned off later in your document via the \nonfrenchspacing command.1. TeX assumes that sentences end with periods. and \linespread{1. LaTeX inserts varying amounts of space between the words. one of the purposes of LaTeX is to take away the stress of having to deal with the physical presentation yourself.) The additional space after periods can be disabled with the command which tells LaTeX not to insert more space after a period than after ordinary character. this is not taken as a sentence ending. If an author wishes to use the wider end-of-sentence spacing. you can change its value by putting the command into the preamble of your document. formatting is very important. letting LaTeX work for you.g. (The practice is found in nineteenth century design and in twentieth century typewriter styles. but not where it is usually unnecessary (e. captions): • you can store them in an external BibTeX file and then link them via a command to your current document and use a Bibtex style to define how they appear.2. onehalfspace. so it makes the list of possible topics quite eclectic: text style. footnotes. it also inserts slightly more space at the end of a sentence. and a document that has been over-done can look and read worse than one with none at all. Although if a period follows an uppercase letter. see although it is available on most WYSIWYG document the Bibliography Management section. It is very important for a consistent reading. Examples: Space between words and sentences To get a straight right margin in the output. question marks or exclamation marks.20 CHAPTER 2. The command \@ in front of a period specifies that this period terminates a sentence even when it follows an uppercase letter. (If you are us- . Besides a non2. for these reasons. processors. Any exception from these assumptions has to be specified by the author. A lot of formatting techniques are required to differentiate certain elements from the rest of the text. spacing. A non-breaking space between two tokens (e. words.stackexchange. for initials. Having said that. etc. LaTeX is so flexible that we will actually only skim the surface. doublespace and spacing: Non-breaking spaces This essential feature is a bit unknown to newcomers. However.g. This way you can create a small database of the references you might use and simply link them. [1] http://tex. Formatting tends to refer to most things to do with appearance. LaTeX uses the '~' symbol as a non-breaking space. so you need not get too carried away! 2. To learn how to add a bibliography to your document. In French typography. However. By default. so the default line spread factor is 1. Normally the lines are not spread.3} for “one and a half” line spacing.com/questions/20538/ what-is-the-right-order-when-using-frontmatter-tableofcontents-mainmatter 2.2 LaTeX/Text Formatting This section will guide you through the formatting techniques of the text.) Most modern typesetters treat the end of sentence space the same as the interword space. (See for example. The setspace package allows more fine-grained control over line spacing. punctuation marks) prevents the processors from inserting a line break between them. but it can be time-consuming if you are writing several papers about similar subjects so that you often have to cite the same books. A tilde ‘~’ character generates a non-breaking space. COMMON ELEMENTS • you can embed them within the document itself. To set “one and a half” line spacing document-wide. Use \linespread{1. since periods after uppercase letters normally occur in abbreviations. the extra space added at the end of sentences is generally considered typographically oldfashioned in English language printing.1 Spacing Line Spacing If you want to use larger inter-line spacing in a document. Bringhurst’s Elements of Typographic Style.6 Notes and references breaking space cannot be enlarged. . There are two packages that can add back flexiSee Lengths for more details. cally hyphenate words containing special characters.2. but in addition there will be a If the hyphenation algorithm does not find the correct hy. Example: The command \. subsections. You'll have to experiment with the command should only contain words built from normal values to achieve the desired effect. LaTeX can break and hyphenate the constituent words. This means that if you place a hyphenation command into the preamble of your document it will influence the English 2.3 Quote-marks language hyphenation. then none of these exceptions need be prevents “FORTRAN”. assuming the compressed syntax. A document which letters.tug. LATEX/TEXT FORMATTING 21 ing \frenchspacing.on most keyboards) gives a left quote mark. No special characters or symbols are allowed in the argument. The argument of the phenpenalty=1000.more frequently than in documents with higher tolerphenation points for several words. For example: \fbox is similar to \mbox.LaTeX treats left and right quotes as different entities. then the hy. If you place the command after the \begin{document} and you are using some pack. The shortcuts option enables a more compressed syntax: Typical usage is as follows. because LaTeX does not automatiFor instance this may be useful in the header.For single quotes. between paragraphs. ation can be set to an extreme value: The command You can change the degree to which LaTeX will hyphencauses the words listed in the argument to be hyphenated ate by changing the value of \tolerance=1000 and \hyonly at the points marked by “-”. Manual spacing is a matter of macro writing and package creation. the penalty for hyphenthe following commands to tell TeX about the exception.2. and . It may be useful for special pages. etc. cented characters). For double quotes. instead of electromagnetic-endioscopy: The extdash package also offers features for controlling the hyphenation of compound words containing dashes — as opposed to the words themselves which it leaves to LaTeX. or rather characters that are considered to be nor. (See a 2008 list: http://www.pdf) will widen the text width and reduce the amount of marThe hyphenation hints are stored for the language that gin overruns. acline so that the rest gets “pushed” toward the right margin.2 Hyphenation LaTeX hyphenates words whenever necessary. see Internationalization. age for national language support like babel.visible box drawn around the content. This command is especially You can insert a horizontal stretched space with \hfill in a useful for words containing special characters (e. and it right. It is against LaTeX philosophy to insert spaces manually and will usually lead to bad formatting. and ' is the ation” to be hyphenated as well as “Hyphenation”. this symbol phenation hints will be active in the language activated is found on the tilde key (adjacent to the number 1 key through babel.org/TUGboat/ word.inserts a discretionary hyphen into a word. Also note that using a higher text width will deceptions is published periodically in the TUGboat jour. is determined automatically by LaTeX. The example below will allow “hyphen. Similarly you can insert vertical stretched space with LaTeX does not hyphenate compound words that contain \vfill. This also becomes the only point where hyphenation is allowed in this word. In both cases.crease the probability of encountering badly hyphenated nal. one should write. 2. See Lengths for more details. bility. ` (on American keyboards. hyphenating words algorithm does not find all correct American English hy. it will not break after the L: One or more words can be kept together on the one line with the standard LaTeX command: This prevents hyphenation and causes its argument to be kept together under all circumstances.) ing hyphenated at all. It is known that the hyphenation erate uneven spacing between words. you can remedy the situation by using To avoid hyphenation altogether.has a low tolerance value will cause LaTeX not to tolmal letters by LaTeX. a dash[1] . but in the latter case. simply double the symbols.g.2. “Fortran” and “fortran” from bespecified. phenation points. This command typesets the dash and then subjects the constituent words to automatic hyphenation. After loadManual spacing ing the package: Stretched spaces The spaces between words and sentences. A log of known ex. is active when the hyphenation command occurs. Hyphenation rules will vary for different languages.2. sections.ances. so if you want to have correct hyphenation rules for your desired language. LaTeX only supports english by default. For example adding Articles/tb29-2/tb92hyf. The hyphenat package supplies the \hyp command. called ligatures.g. "---" to "—".2. spacing Some very long words. Ligatures can be prohibited by inserting {} or. you're better off not using explicit Another solution is to edit the text to avoid long words. This means that if you use the same font changing command in several places in order to typeset a special kind of information. Here is an example: This approach has the advantage that you can decide at some later stage that you want to use some visual representation of danger other than \textit. without trouble. for greater accessibility. with integration to citation mechanisms of. using " for right double quotes will either lead to bad spacing or it being used to produce an umlaut).5 2. the " is redefined to produce an umlaut accent. On British keyboards. diacritics may be which should not be broken over multiple lines. to disable ligatures altogether in the whole document. but long words will be placed properly. does not allow following characters to be “broken” onto new lines. (Don't use the " for right double quotes: when the babel package is used for some languages (e. The use of the / character in keyboard input by configuring the preamble properly.2.4 Diacritics and accents put\slash output”. COMMON ELEMENTS LaTeX will interpret them accordingly. The package csquotes offers a multi-lingual solution to quotations. which allow the line to “break” after Most accents and diacritics may be inserted with direct the slash mark (if needed). {\kern0pt} between the two letters in question. the \DisableLigatures from the microtype package can be used: Note that this will also disable ligatures such as "--" to "–". using those commands. without having to wade through your document.2. some spaces between words may be Even if you can easily change the output of your fonts a bit too large. Another solution is to use the cmap package. commands like this.2.6 Ligatures you should use \newcommand to define a “logical wrapper Some letter combinations are typeset not just by setting command” for the font changing command. etc. One solution for this problem is to use sloppypar envi. For LaTeX should be restricted to units. As a result. German). See Special Characters. This package allows one for example to switch languages and quotation styles according to ba. added to letters by placing special escaped metacharacters before the letter that requires the diacritic. identifying all the occurrences of \textit and then figuring out for each one whether it was used for pointing out danger or for some Some tools are unable to perform search in documents other reason. This might be necessary with words built from two words.2. that contain ligatures (a search for "finally” wouldn't find See Macros for more details. If one desires. If you are using XeLaTeX and OpenType fonts. the string "finally”). 2.8 Fonts Margin misalignment and interword To change the font family. 2. the different letters one after the other.9 Formatting macros ronment.7 Slash marks fered by BibTeX.The normal typesetting of the / character in LaTeX bel language selections. ' ` ' is left of the ' 1 ' key and shares the key with ' ¬ '. if this does not work. symbols unavailable on your keyboard. and sometimes ' ¦ ' or ' | '.2. the fontspec package allows for standard ligatures to be turned off as well as fancy swash ligatures to be turned The right quote is also used for apostrophe in LaTeX on. see Fonts.22 CHAPTER 2. numbers or URLs may not be hyphenated properly and move far beyond the side margin. and other fontrelated issues. but by actually using special symbols (like "ff"). Words that use slash marks. which often create “overfull” errors in output (where letters push off the margin). which will For left bottom quote and European quoting style you help the reader to interpret the ligatures: need to use T1 font encoding enabled by: See Fonts for more details on font encoding. . because they work in opposition to the basic idea of LaTeX. The apostrophe (') key is to the right of the colon/semicolon key and shares it with the ' @ ' symbol.2. such as “mm/year”. which is to separate the logical numbers or urls approaching the side margin. and visual markup of your document.2. emphasize text. such as “input/output” should be typeset as “in2. which tells LaTeX to adjust word spacing less strictly. Of these. the formula for water is written as: Note the use of \<space> to insert a space in math mode. The commands \textendash and \textemdash are also used to produce en-dash (–).2. LATEX/TEXT FORMATTING 2. for example: Use \hyp{} macro from hyphenat package instead of hyphen if you want LaTeX to break compound words between lines. 2. In math mode subscripting is done using dashes. Therefore.2.14 Ready-made strings lows you to use decimal points. you can use the \textsuperscript{} command. These can be set to use text figures by placing some code in your preamble: 2. the math mode must be used.2. For this purposes. On a typewriter. Thus.11 Text figures (“old style” numerals) Many typographers prefer to use titling figures. Instead. This allows you to.2. the textcomp which allows the spacing between the dots to vary. will reset the \thepage comSubscripting in text-mode is not supported by LaTeX mand back to the original. ‘---’(—) em-dash and ‘ − ’(−) minus sign. sometimes called lining figures. Put \usepackage{textcomp} in your preamble. Similarly.include them as well. LaTeX allows this usage through the \oldstylenums{} command: Ellipsis (…) A sequence of three dots is known as an ellipsis. textcomp also al. however. to generate roman text. In math mode.2. or a minus sign (−). if you use the \pagenumalone. You can accomplished in running text by bracketing your text with cess three of them with different numbers of consecutive the $ symbol. when they appear in tables.2. a comma or a period takes the same amount of space as any other letter.15 Notes and References Should you use additional sectioning or paragraphing commands. as the spacing would be wrong.12 Dashes and hyphens tional packages to be implemented. properly formatted dollar There are some very simple LaTeX commands for typesigns. fixltx2e is perhaps the most universal option since it is distributed with LaTeX and requires no addi.g. The names for these dashes are: ‘-’(-) hyphen . and fixltx2e all support this command. script Note To superscript text in text-mode. several packages allow the use of bering command in your document. you can superscript using: A very common use of subscripts within the text environment is to typeset chemical formulae. e. when numerals are interspersed with full caps. and em-dash (—). This package is easy to use.LaTeX knows four kinds of dashes: a hyphen (-). respectively. your \myThePage definition from the code above: KOMA-Script2. If you do not load a package that supports \textsub. using text figures elsewhere. and works with your text fonts (rather than math fonts). and when they appear in equations. use \ce{} with the text-equivalent formula. ‘--’(–) endash . They Note that in math mode text will appear in a font suit. a highly recommended package is mhchem.2. within \oldstylenums{}. etc. See also Chemical Graphics for chemical symbols and 2. for example. for instance. A subsequent use of the \pagenumbering command. bpchem. be sure to reinstate the \textsubscript{} command. which is commonly used to indicate omitted text.(–). you can use the \textellipsis command Some fonts do not have text figures built in. This is easily ac. p3 . you may adapt the previous code listing to [1] hyphenat package documentation. there is a special command for these dots.10 23 Text mode superscript and sub. paragraph. em dash (—).2. To insert a chemical formula. It is called \ldots: Alternatively. these characters occupy only a little space and are set very close to the preceding letter. one would use the \mathrm command: For example. package attempts to remedy this by effectively generating text figures from the currently-selected font.2. setting special text strings: One common use for text figures is in section. typeset 6th as 6th : \pagenumbering{arabic}. you cannot enter ‘ellipsis’ by just typing three dots. en dash script{}.2.have different purposes: able for mathematical variables. In book printing. and page numbers.. The fourth sign is actually not a dash at all—it is the mathematical minus sign: the underscore: _{}. For instance.13 formulas. However. This might come in handy when you start a document with body text and not with a sectioning command. the beginning of any chapter/section is indented by the usual paragraph indentation. It is possible to override it by using the \setlength command.1 Paragraph alignment they don't get too far apart. and also La.3. you can To change the indentation of the last line in a paragraph. You specify this in a \setlength command like this: If you want to indent a paragraph that is not indented. you can use at the beginning of the paragraph. so some give-and-take in vertical space is useful. use the parskip package.3. i. allowing the formatting for subsequent paragraphs to differ ple. Obviously. between paragraphs.3. The space beparagraphs is held in \parskip. The default length that this constant holds is set by the document class that you use.2 Paragraph indent and break By default. the first paragraph after a heading follows the standard Anglo-American publishers’ practice of no indentation. Alternatively. p (paragraph) columns in tabular. which will specify the line spacing for all sections and paragraphs until another command is used. so 2. COMMON ELEMENTS use the indentfirst package: once loaded.to apply the hanging indent after the first line. use Paragraphs in LaTeX are usually fully justified. you can use as the first command of the paragraph. zero. The size of subsequent paragraph indents is determined by a parameter called \parindent. follows. • singlespace: normal line spacing. while making adjustments to the spacing of lists and other structures which use paragraph spacing. For whatever rea. which does this for you. If you want to indent the beginning of every section. All text between the \begin and \end of the specified environment will be justified appropriately. This space is in addition to the indentation added by \parindent and \hangindent. this will only have an effect when \parindent is not set to zero. (While the default behaviour is graph. 2. and applications tend to be for formatting text in want to use the style of having no indentation with a space floats. you run the risk of making various parts of your docuespecially in academic writing. which is also covered in Text Formatting.e. from the overall document margins. this parameter is used elsewhere too.) An example TeX command equivalents.24 CHAPTER 2. \singlespacing and \setstretch{baselinestretch}. there are three environments at hand. 2. this may be changed with the \hangafter command.3 Line spacing To change line spacing in the whole document use the command \linespread covered in Text Formatting. This package provides the commands \doublespacing. the package provides the following environments in order to change line spacing within the document but not document-wide: • doublespace: lines are double spaced. This will set paragraph indents to 1cm: White-space in LaTeX can also be made flexible (what Lamport calls “rubber” lengths).3 LaTeX/Paragraph Formatting tween tered in a similar fashion as above. To create a non-indented paragraph. This is useful on pages in complex documents where not every page may be an exact number of fixed-height lines long. If you know. flush with both the left and right margins. then it means you will need a vertical space between paragraphs in order to make them clear. or other more exotic documents. if you decide to set the indent to with LaTeX with permission from the author. which means Altering the paragraph formatting is not often required. • onehalfspace: line spacing set to one-and-half spacing. use the TeX command \parfillskip. For exam. you can use the \usepackage{setspace} package. The commands The TeX commands \leftskip and \rightskip add addilisted are for use within other environments. However. This page uses material from Andy Roberts’ Getting to grips Be careful.tional space to the left and right sides of each line. . which could be al2. it is useful to ment look very untidy by changing this setting. should you wish to alter the justification of a para. use the TeX son. such as in lists. Furthermore. If you want both indent and break.command \hangindent. however. \onehalfspacing.To indent subsequent lines of a paragraph. This means that values such as extra vertical space inserted before a paragraph \parskip can have a default dimension plus an amount of expansion minus an amount of contraction. change the font size. vironment. ignoring the effect \textbf should have on text. For example. so using spaces in \url arguments There are several ways to introduce text that won't be in. It was designed for 2. The mandatory first line arwrite equations within the alltt enviroment. If you use the verbatim enWhen using this command through the hyperref package. For more control over formatting. that the standard font has no bold TT font. however. you can use line numbers along side the text. Any othfont: ers will be output. only at Verbatim text slashes and full stops. that will comment out all the rest of the line after itself. LATEX/PARAGRAPH FORMATTING • spacing: customizable line spacing. which properly The page breaks are covered in Page Layout. for example: on manual spaces between paragraphs (such as \bigskip) will show this URL exactly as typed (similar to the \verb can be found in Lengths. It can also be used in conjunction with the 2. If you just want to introduce a short verbatim phrase. Here is an {0 0 0} might work if the four zeroes do not. the code: As we have seen.See also Hyperlinks fore \begin{verbatim}. To gin{listing}[step]{first line}. This approach is really time-consuming if you want to insert .3. that spaces are forbidden in URLs. which provides a Verbatim environment (note the capital letter) which lets you draw a how to change the line spacing in lists. everything input between the begin and end the URL is “clickable” in the PDF document. providing an environment with Listing environment This is also an extension of the the same name: verbatim environment provided by the moreverb packRemember to add \usepackage{alltt} to your preamble to age. and even have typographic effects inside the Verbatim environment. Controlling the breaks should be reserved to macro and Typesetting URLs One of either the hyperref or url package writers.3. you can try See the section on customizing lists for information on the fancyvrb package. rule round the verbatim text. and the text is disage. commence.4 Manual breaks fancybox package and it can add reference line numbers LaTeX takes care of the formatting. instead of the usual $. as will using other non-URL-valid characters. All spaces is not linked to the web when using only the url packand new lines are reproduced as given.3. the only comchange the style. how URLs are displayed to the normal mand that will be recognized is \end{verbatim}. but the \url command also performs a hyphenless break at punctuation characters (only in PDFLaTeX. insert pdfborder = {0 0 command will be ignored and handled as plain text. and it can should avoid manual breaking as much as possible. age{moreverb} to the document preamble. you can use gument is for specifying which line the numbering shall \( and \) to enclose them. could lead to very bad formatting.5 Special paragraphs Web URLs. for it even include entire external files.. The font size in the verbatim environment can be adjusted by placing a font size command be. Also when using the hyperref package. to remove played in an appropriate fixed-width font. Bear in mind. breaks included. packages provides the \url command. the only way LaTeX allows you to add comments is by using the special character %. however. so it understands their syntax and will never break mid-way through an unpunctuated word. You (useful for chunks of data or programming). More details typesets URLs. terpreted by the compiler. If this is a problem. The command: \bethe command \normalfont to get back the normal font.will fail. (Alternately pdfborder = is ideal for typesetting program source code. command). Txtfonts has bold fonts: just add \renewcommand{\ttdefault}{txtt} To use this environment. but you can use any character you like except *. note be numbered). The optional step is the step between numbered lines (the default is 1. Any LaTeX the border placed around a URL. not in plain LaTeX+ dvips). but you have Multi-line comments the \verb command: The first character following \verb is the delimiter: here we have used "+". whereas it commands are processed as if by a typewriter. \verb will print verbatim all the text after it until it finds the next delimiter. \begin{spacing}{baselinestretch} . e. The extra functionality it provides is that it can add use it though! Within the alltt environment. remember to add \usepackafter \usepackage{alltt}. \end{spacing}.) example: You can put the following code into your preamble to Note: once in the verbatim environment. you can use the alltt package instead. This 0 0} inside the \hypersetup{}. you don't need to use the whole environment.2.g. 25 will print \textbf{Hi mate!}. Here follows a quick reference. which means every line will When using \textbf{} inside the alltt enviroment.. because it indents the first line of The simplest way to type colored text is by: each paragraph. quotation for use with longer quotations. added to tables by placing the color command just before they have small differences and they are aimed for dif. Here is an example: In scientific publications it is customary to start with an Note that this won’t work inside complex environments. and set the background color of the page. The \usepackage is obvious. new stanzas are created \definecolor. Once in. \\.If you need more colors. you can define a \comment{} command.1 Adding the color package A more robust way of making the TeX engine skip some To make use of these color features the color package part of the source is to use the TeX \if-command with a must be inserted into the preamble. and svgnames allows access to about 150 colors.4. another 64. The typical use is Alternatively.6 Notes and References verbatim text. You can use one of the predefined colors such as white. the only difference is that verbatim text is introduced within the document.26 long comments or just comment out a part of your document that you want to improve later. with LaTeX with permission from the author. and you will need to add your own quota. separated by blank lines. and new lines within a stanza are Another possible way by . to comment out text. Skipping parts of the source 2. produce unwanted spaces in the document. The dvipsnames allows you access to more colQuoting text ors. this offers more than 300 colors. so it may work better to use Adding colors to your text is supported by the color packThen if you supply only one argument to \comment{}. quote for a short quotation. Using this package. See Document Structure.4. verse is for quotations where line breaks are important. however. unless you're using an editor that automates this process. (such as LaTeX commands). COMMON ELEMENTS indicated using the newline command. then you may also want to look at tion marks if you want them. of more than 2. then all subsequent lines are indented until explicitly separated with \\. with a blank line.the table. but you need to make are: sure your xcolor package is the most recent you can download. The provided environments adding the x11names to the initialization section as well. abstract which gives the reader a quick overview of what like math for example. false statement. of the text. you can set the color of the font this has the desired effect without producing extra spaces. one can write: The \if-command compares the two following statements. tional commands like usenames allows you to use names of the default colors. why to expect. where declared-color is a color that was defined before by such as poetry.4 LaTeX/Colors This approach can. (you can also use the comment package instead) you can Abstracts use an environment called comment that will comment out everything within itself. You may be wondering. simply do something like this: 2. the same 16 base colors as used in HTML.2 Entering colored text one paragraph. The initialization of “table” allows colors to be LaTeX provides several environments for quoting text. If a line takes up more than one line on the page. The package loaded here is the xcolor package. Another drawback is that content is still parsed and pos. ferent types of quotations.or yellow. but the initialization of addiso we provide two different (0 and 1). Alternatively. while the comment is This page uses material from Andy Roberts’ Getting to grips just dropped. should I load a package called verbatim to have the possibility to add comments? The answer is straightforward: commented text is interpreted by the compiler just like 2. by adding the following to the document’s preamble: Then. Alternatively.3. to be loaded in the preamble as usual: CHAPTER 2. so you cannot put anything you want in it also possible to color formulas in math-environments. All of them are indented on either margin. red. or you can define your own named colors. It’s sibly expanded. you can use the verbatim package. age. or a series of small quotes. cyan. It will work until the end of the current TeX group. yellow. ((100-20)*0. . by: • color-spec is the description of the color 2. If you are using tikz or pstricks package you must from color mixes: declare the xcolor package before that. but these should be available on all systems. \color and \textIf the predefined colors are not adequate. For example: 2. you can call it as you the text in \textcolor must all be one paragraph and not like contain other environments.3) percent black and (100-30) percent The 68 standard colors known to dvips green. you can use the one where: you prefer. the colors are defined following this The difference between \textcolor and \color is the same scheme: as that between \texttt and \ttfamily. LATEX/COLORS 27 that will switch the standard text color to the color you Method want. the green to one half (0.4. These options The first specifies 20 percent blue and 80 percent white. blue. To achieve this. you may want to play around with rgb values to create your own custom colors. for instance. so that you can already refer to them in the preamble. The \color environment allows the text to run over multiple lines and other text environments whereas • name is the name of the color. in an argument of another package that supports colors as arguments. pictures. but sometimes it is convenient to directly use a colour without naming it first.4. you can use one upon previously defined ones. etc. If you loaded the xcolor package. magenta. • model is the way you describe the color. Using colour specifications directly Normally one would predeclare all the colours as above. such as the listings package. and is one You can change the background color of the whole page of gray. To define a new color. and the blue to the minimum: The following code should give a similar results to the last There may be other pre-defined colors on your system.2. you may wish color have an alternative syntax specifying the model to define your own. rgb. HTML. of the 68 dvips colors.5 Defining new colors Place Creating / Capturing colors Define the colors in the preamble of your document.4. or define your own. you can define colors If you would like a color not pre-defined. Invoke the package with the usenames and dvipsnames xcolor also feature a handy command to define colors option. in square brackets. Among the models you can use to describe the color are the following (several more are described in the xcolor then: manual): There is also \fcolorbox to make framed background color in yet another color: Examples 2. green. which defines orange for you. and cmyk. code chunk. RGB. web pages.3 Entering colored background for the Color Models text If the background color and the text color is changed. red. by setting the red to the maximum. (Reason: do so in the preamble. black.5). follow the following example. Alternatively. otherwise it will not work.) You may want to use colors that appear on another document. are discussed in the following sections the second is a mixture of 20 percent blue and 80 percent black.3) percent blue.4 Predefined colors The predefined color names are white.4. For example: In the abstract. and the last one is a mixture of (20*0. which is useful. and the color specification in curly braces. Arial and Courier.fault variable should not be confused with their respective tem. Below is an example[1] that demonstrates how to change It should be noticed that fonts get generated the first time a specific family.28 CHAPTER 2.5 LaTeX/Fonts Fonts are a complex topic. and Font encoding are really needed.g. If you want/have to stick with the standard compilers.1 Introduction high quality fonts are scalable. and usually have very poor quality. Computer Modern Roman is the default font family for LaTeX. Standard tex compilers will let you use other fonts. In the TeX world.g. Type3 fonts are often used to embed bitmap fonts. which can easily be seen when zooming or printing a document. The external links section below has some useful resources. weight.5.6 Sources able among them. so it is highly discouraged to • The color package documentation change fonts individually rather than the whole family. Bitmap fonts are raster graphics.2 Font families • Apple Macs: Hex Color Picker for creating custom colors and the built-in DigitalColor Meter for capThere are many font families e. there are many ways to specify and control in repositories) fonts. COMMON ELEMENTS Image processing suites like the free GIMP suite for Linux/Windows/Mac offer colour picker facilities to capture any color on your screen or synthesize colors directly from their respective rgb / hsv / hexadecimal values. such as PostScript Type1/Type3 fonts and bitmap fonts. 2.). they are required. Smaller. Mathematical fonts is a more complex matter. Families are meant to be consistent. sans serif (sf) and monospace (tt) (see Typeface for more details). It is a very complex matter in typography. shape. Times. Second specify the new default family if it is not rm. hence the long compilation time.5. with several external links Each font family comes with the default design which falls into one of those categories. however. Type3 is a superset of Type1 and has more functionalities from Postscript. in which case you do not have to load any package. With modern TeX compilers such as xetex and luatex it is possible to make use of such fonts in LaTeX documents. MetaFont is internally a quite complex font sys. The other sections are more useful to macro writers or for very specific needs.4. The three families are defined by their respective variables: • \rmdefault • \sfdefault • \ttdefault The default family is contained in the \familydefault variable. 1. This will turn all the part of the document using the deMetaFont. 2. First specify which family you want to change (rm. You can do it by yourself. and have a wide range of Changing font families usually works in two steps: typographical fine tuning capabilities. etc. Computer Modern. turing colors on screen. the aforementioned font types must first be converted and made available to LaTeX (e. Emphasizing text. only Font families. sf or tt). Those families can be grouped • Online utilities: See here for a Wikipedia article into three main categories: roman (rm) or serif. which is Computer for TeX and friends is called Computer Modern. Fonts in each family also have • The xcolor manual different properties (size. The three default family font variables and the \familydeHowever. See tioned variables as value. and it is meant to have one of the three aforemenThe digital fonts have a long and intricate history. converted to Type1 fonts). For common documents. Type1 are outline fonts (vector graphics) which are commonly used by pdftex. Fonts may come with a package that will take care of defining all three families plus the math fonts. The default is defined like the following assignment: Adobe Font Metrics for some more details. Knuth. These Modern Sans Serif if you did not change the default font. • Linux/BSD: The gcolor2 tool (usually also available In LaTeX. There are many different font types. it is interchange2. and the most popular font systems as of this day are switch: . 2. The default font family fault font to the default sans serif. Originally TeX was conceived to use its own font system. free utilities also exist: Truetype font (ttf) and OpenType font (otf). such as embedding raster graphics. 2. designed by D. • Microsoft Windows: The open-source Color Selector tool. g. it should be used sparingly. that’s why you may want size a word which is already in an emphasized sentence. for example the upright version.Computer Modern Super (cm-super) or Latin Modern erally read before any other text in a paragraph or even on (lmodern).' copy paste) the umlaut 'Ä' via a PDF viewer actually extracts the two characters '"A'. particularly for keywords the reader may be puter Modern font does not support T1. several 8-bit CM-like font sets were created. It is possible to load several encodings simultaneously. you will need to load the package after the T1 encoding has been set: The package ae (almost European) is obsolete. but leaving out some others and including a number that are not in ASCII. itly with \textit{text}.3 Emphasizing text position of Greek text. These are not necessary any more with fonts like lmodern.4 Font encoding A character is a sequence of bytes.2. this approach has some caveats. which Another advantage of using new CM-like fonts is that usually italicizes the text. the improve/enable hyphenation in non-English documents. So the character 'a' has different representations following the used font. which is a bitmap font. For lmodern. 2.5. The following table lists the commands you will need to access the typical font shapes: such as Greek or Cyrillic.5. simplest way is to use the \emph{text} command.they provide fonts of CM families in all weights. Note that changing the font encoding will have some reText may be emphasized more heavily through the use quirements over the fonts being used. the italic version. various weights and heights. besides typographic issues. to say nothing about letters of non-Latin alphabets. This is what is called font encoding. which is what the reader sees. and optically scaled font sizes. side words containing accented characters.5. Because of • \ttfamily the large number of Cyrillic glyphs. Extended Cork (EC) fonts in T1 • \rmfamily encoding contains letters and punctuation characters for most of the European languages based on Latin script. TeX creates them by combining a normal character with an accent. LATEX/FONTS 29 • \normalfont To overcome these shortcomings. T2B. Using the ae package leads to text encoding problems in PDF files generated via pdflatex (e. which are Computer Modern-like fonts with a page. It may also be used in T1 support. By using these fonts you can In order to add some emphasis to a word or a phrase. the glyph. and X2. or font properties. While the resulting output looks perfect. The default LaTeX font encoding is OT1. As bold text is gen. they are arranged into four font encodings—T2A. Italics may be specified explic. . It contains only 128 characters. It provided some workarounds for hyphenation of words with special characters. Upon compilation.All this is not possible with OT1. also known as font styles. • Extracting ('e. Font styles are usually implemented with different font • Searches for words with accents in PDFs will fail. So it is possible to build a new font family by specifying the font styles of different font families. tex will have to choose the right font glyph for every character. When accented characters are required.5. some of Latin letters could not be created Shapes by combining a normal character with an accent. • Besides.g. the encoding of the original Computer Modern TeX text fonts. they will get loaded automatically if you use T1 encoding. The fontenc package tells LaTeX what font encoding to use. and should not be confused with its representation. Font encoding is set with: where encoding is the font encoding. files. If you have none of these. to change the font encoding of your document. The CB bundle contains fonts in LGR encoding for the com2.5 Font styles Each family has its own font characteristics (such as italic • It stops the automatic hyphenation from working inand bold). The default Comof boldface. T2C. Bitmap fonts look rather ugly when zoomed or printed. be generated with the \textbf{text} command. it will be reverted to the upright font. and so on. Bold text can Type3 font such as the Type3 EC. 2. shapes. Note that the \emph command is dynamic: if you empha. text extraction and searching). There is nothing to change in your document to use CM Super fonts (assuming they are installed). it is quite frequent place of italics when using sans-serif typefaces to provide (depends on your TeX installation) that tex chooses a a greater contrast with unemphasized text. You will need trying to find when reading the text. • \sffamily The LH font set contains letters necessary to typeset documents in languages using Cyrillic script. many from ASCII. 30 The commands in column two are not entirely equivalent to the commands in column one: They do not correct spacing after the selected font style has ended. ern computer programs (known as the desktop publish• To underline. This is because underlining is not recommended for typographic reasons (it weighs the text down). There Some font styles are not compatible one with the other.}. But some extra packages will fill this hole. such as OT1 (TeX default) or T1 (extended characters support. you might want to use: \fontencoding The font encoding. part of a formula may be set in a different size by using an \mbox command containing the size command. • For a slash through each individual character 2. use \uline{. use \uwave{. ing point or PostScript point) has 1 pt equal to approximately 0. Although underlining is available via the \underline{. It is highly recommended to enclose the command in a group to cleanly return to the previous font selection when desired. The \selectfont command is mandatory. COMMON ELEMENTS These commands change the size within a given scope. text underlined in this way will not break properly. \seriesdefault and \shapedefault.6 \xout{. add \normalem straight after the document envi. more than one of these size commands may produce the same actual size.} which delimits the unit. size (known as the Didot point) had 1 pt equal to approximately 0.. m=medium.37597151 mm (see: point (typography)). It is unlikely that you wish this to be the desired effect.5. are four font properties you can change.3527 mm while the standard European point • To add a wavy underline. but it may differ for some Document Styles or their options. The default for \normalsize is 10 point (option 10pt). Local font selection You can change font for a specific part of the text. • For a strike-out (strikethrough).}. if an entire paragraph or unit is set in a certain size. Note that the font size definitions are set by the document class.35136 mm.. You should use emph instead.. \familydefault. and does not affect the font in the rest of the document.American point size in which 1 pt is approximately 0. so it is better to stop ulem taking over \emph and simply call the underline command as and when it is needed.. It will work for most parts of the text.. The standard point size used in most modage[normalem]{ulem}. on this table: \fontseries The series: l=light. widely used). Setting back the default font properties can be done with ... points in TeX follow the standard ronment begins. Depending on the document style the actual font size may differ from that listed above.. These commands cannot be used in math mode. • To restore the usual \emph formatting. And not every document class has unique sizes for all 10 size commands. use \sout{. The commands in column one are therefore in general recommended.. simply follow the commands \fontfamily The font family. Sizing text To apply different font sizes. By default..}. \fontshape The shape: it=italic. CHAPTER 2. n=normal.. otherwise the font will not be changed. You can use all these commands in a row: The default values are stored in \encodingdefault. Alternatively. The new size takes effect immediately after the size command. sl=slanted. However. For bold small capitals. for example to draw attention to changes. Stick \usepackage{ulem} in your preamble.As a technical note. However underlining text provides a useful extra form of emphasis during the editing process. b=bold. in some styles. sc=small capitals.}. better PDF support. this overrides the \emph command with the underline rather than the italic style. so for instance {\Large some words} will change the size of only some words. use \usepack.} command. the size command should include the blank line or the \end{. bx=very bold.. You may have noticed the absence of underline. The actual size produced by these commands also depends on the Document Style and. This functionality has to be added with the ulem (underline emphasis) package. 12 References Also you should not load the inputenc or fontenc package.. Instead make sure that your document is encoded as [1] found at the Google discussion group latexlovers .g. tex and xelatex/lualatex you can use the \ifxetex/ \ifluatex macro from the ifxetex/ ifluatex package.11 Useful websites • The Latex Font Catalogue • LaTeX font commands • How to change fonts in Latex • Understanding the world of TEX fonts and mastering the basics of fontinst • Font installation the shallow way “For one-off projects. This ensure the characters are correctly balanced and remain readable at all defined sizes. 2. 2.7 Arbitrary font size The \tiny. and that you need a sufficiently new TeX distribution (TeX Live 2009 should work for XeTeX and Tex Live 2010 for LuaTeX). 2.10 PDF fonts and properties PDF documents have the capability to embed font files. simply load the fontspec package and set the font: • A bash script for installing a LaTeX font family (MikTeX / TeXLive) • LaTeX And TrueType Font • True Type Fonts with LaTeX under Linux + MiKTeX 2.5. This is because the characters actually get magnified. In TeX it is possible to change the magnification of anything.\Huge commands are often enough for most contents. you can use the \use. it will look odd at extreme sizes because of an unbalanced thickness. • Step-by-step guide to manually install a ttf-font for PdfTeX 2.2. In most document processors.5 • Unicode Truetype font installer for LaTeX under Windows + MikTeX • Using TrueType fonts with TeX (LaTeX) and pdfThen compile the document with xelatex or lualatex.26378> not available (Font) size <24.88> substituted on input line 103. you can cut corners with font installation (i. which will take care of the font font{<encoding>}{<family>}{<series>}{<shape>} encoding. These are fixed sizes however.UTF-8 and load fontspec.8 Finding fonts 2. Example: If you are using the default Computer Modern font with OT1 encoding.5.e.5. but highly discouraged for the aforementioned reason. In that case you will notice that the font size cannot be changed beyond \tiny and \Huge. fontinst) and end up with a more manageable set of files and a cleaner TEX installation. For example for xelatex 2. XeTeX also allows using OpenType technology of modern fonts like specifying alternate glyphs and optical size variants.9 Using arbitrary system fonts If you use the XeTeX or LuaTeX engine and the fontspec package. e. and pdffonts to list embedded fonts.. etc. TeX (pdfLaTeX) (for MikTeX) Note that you can only generate . You must switch to a more sizable font. there is a file for every size: cmr10 for Computer Modern Roman 10pt. Many Unix systems make use of the poppler tool set which features pdfinfo to list PDF metadata. cmr12 for Computer Modern Roman 12pt. you may get the following message: LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <142. Changing the font size is made by changing the font file. you can usually choose any size for any font. If it usually looks correct for medium sizes.5. To make your document support both pdflacommand. This article shows how and why” You will find a huge font directory along examples and TrueType (ttf) fonts configurations at TUG Font Catalogue. which might be helpful for font issues. To use the fonts.5.5. hence the name Portable Document Format.pdf files. It makes them portable. You may choose a particular font size with the \fontsize{<size>}{<line space>} command. XeTeX also uses Unicode by default. Many PDF viewers have a Properties feature to list embedded fonts and document metadata. LATEX/FONTS 31 For short. Yes. you'll be able to use any font installed in the system effortlessly.5. common error! All lists follow the basic format: All three of these types of lists can have multiple paragraphs per item: just type the additional paragraphs in the normal way. The Customizing enumerated lists trick is to use \hfill[1] . It is a itemize. such as a glossary. for example using: Alternatively. use the easylist package). List structures in LaTeX are sim. I. Ideal for a series of definitions. but the output is more compact. enumerate and description. As a mark-up language. LaTeX will happily allow you to insert a list environment into an existing one (up to a depth of four—if you need more than four.1 List structures However. So long as they are still contained within the enclosing environment. a. Feel free to skip! Note that in the following when \renewcommand is used Lists often appear in documents.6. use the mdwlist package (included in the mdwtools bundle). is more than between paragraphs: it may look odd if the descriptions are too short. each item is numbered sequentially. ply environments which essentially come in three flavors: Also beware of the spaces in the label definitions. Simply begin the appropriate environment at the desired point within the current list. This cannot easily be done with \\. ous environments. to create a unified look in your document you can redefine the enumerate environment: Another approach is to redefine the \item command globally. it would look odd if you didn't include it!).6. While not necessarily difficult in itself. with a blank line between each. enumerate* and description*. Description The description environment is slightly different. Users of WYSIWYG word processors can sometimes be frustrated by the software’s attempts to determine when they intend lists to begin and end. COMMON ELEMENTS 2. as it must appear after the \begin{document} instruction so their purpose is often to present information in a clear the changes made are taken into account. 2. 2. itemize*. This environment is for your standard bulleted list of which provides compact. Customizing LaTeX is outside the beginners’ domain. and above and below the lists as a whole. Latex will sort out the layout and any The options A.2 Nested lists Using packages The thing people want to change most often with Enumerated lists are the counters. Customizing manually Inside lists you can redefine some length/dimension variables of LaTeX.for both enumerated and itemized lists. LaTeX gives more control over the structure and content of lists. they will automatically be indented to follow underneath their item. in standard LaTeX document classes.3 Customizing lists Convenient and predictable list formatting is one of the many advantages of using LaTeX. moving on to more advanced topics runs the risk of confusion. You can specify the item label by passing it as an optional argument (although optional. use the memoir class and with \tightlists. Sometimes you want a description where the text begins on a new line. . A quick solution to this problem is provided by the enumerate package of David Carlisle[2] . Line spacing As you may have noticed. This is needed and concise fashion.6 LaTeX/List Structures 2. To use any numbering for you.6. anything else is treated as text. it is possible to specify the style of the numbering: \begin{enumerate}[style]. They work exactly in the same way. where by Alternatively. default. Itemize Using packages If you want tightly-packed lists. we shall still include a brief guide on customizing lists. When using enumerate.e. because beginners are already overwhelmed with the array of commands and environments. i and 1 define the style and are selfexplanatory. The enumerate environment is for ordered lists. the vertical spacing between items.32 CHAPTER 2. i. since the tutorial aims at being complete. or the more sophisticated package enumitem by Javier Bezos[3] . Other packages providing compacted Enumerate lists are paralist and enumitem. especially academic. “starred” versions of the previitems. 2.6. LATEX/LIST STRUCTURES 33 of the style tokens as text they can be enclosed in braces, With package paralist e.g. {A} will give a literal A. [4] The paralist package provides the inparaenum environSometimes you may want to place some short text in front ment (with an optional formatting specification in square of the enumeration for example: “Exercise 1, Exercise 2, brackets): Execise 3, ...”. This is possible with the enumitem packTo change the styles of the counter, tokens A, a, I, i, and age: 1 can be used in the optional argument to produce the \bfseries makes it bold, Exercise is the text and \arabic* counter with one of the styles \Alph, \alph, \Roman, \roinserts the counter followed by a colon (:) which is treated man and \arabic. For example: \begin{inparaenum}[(i)] as text again. produces the labels (i), (ii), (iii) ... Manually To go any further and do it yourself instead, With package enumitem a brief introduction to LaTeX counters is required. You should check the dedicated chapter as we will not delve Package shortlst also provides inline lists. into the details for now. There are four individual counters that are associated with 2.6.5 Easylist package itemized lists, each one represents the four possible levels of nesting, which are called: The easylist package [5] allows you to create list using a The counter is incremented by \item before it is printed. more convenient syntax and with infinite nested levels. It is also very customizable. For example to reset enumi use: The command responsible for formatting the various lev- Load the package with the control character as optional argument: els of nesting are The easylist environment will default to enumerations. Example: This simply redefines the appearance of the label, which is It features predefined styles which you can set as optional fine, providing that you do not intend to cross-reference to argument. a specific item within the list, in which case the reference Available styles: will be printed in the original format. This issue does not arise if you redefine the counter printer: • tractatus Customizing itemized lists Itemized lists are not as complex as they do not need to count. Therefore, to customize, you simply change the labels. It can be done manually for each entry with \item[new symbol], eg \item[$\star$]. The itemize labels are accessed via \labelitemi, \labelitemii, \labelitemiii, \labelitemiv, for the four respective levels. The above example would set the labels for the first level to a greater than (>) symbol. Of course, the text symbols available in Latex are not very exciting. Why not use one of the ZapfDingbat symbols, as described in the Symbols section. Or use a mathematical symbol: • checklist - All items have empty check boxes next to them • booktoc - Approximately the format used by the table of contents of the book class • articletoc - Approximately the format used by the table of contents of the article class • enumerate - The default • itemize You can customize lists with the \ListProperties(...) command and revert back the customization with \newlist{}. Yes, that’s parentheses for \ListProperties parameters. The Style parameter sets the style of counters and text, the Style* parameter sets the sytle of counters, and the Itemized list with tightly set items, that is with no vertical Style** parameter sets the style of text. The parameter space between two consecutive items, can be created as Numbers determines the way that the numbers are disfollows. played and the possible values are r or R (for lower and upper case Roman numerals), l or L (for lower and upper case letters), a (for Arabic numbers, the default), and z (for Zapf’s Dingbats). 2.6.4 Inline lists Inline lists can be achieved as follows. The FinalMark parameter sets the punctuation of the final counter (Ex: FinalMark3={)}) while FinalSpace sets 34 CHAPTER 2. COMMON ELEMENTS the amount of space between the item and the item’s text. The rules for producing characters with diacritical marks, The Margin parameter sets the distance from the left mar- such as accents, differ somewhat depending whether you gin (Ex: FinalSpace2=1cm). The Progressive parameter are in text mode, math mode, or the tabbing environment. sets the distance from the left margin of all items in proportion to their level. The {{{1}}} parameter prevents the first n counters from 2.7.1 Input encoding appearing in all levels. If there is a number after a parameter (Ex: Style3*) then this numbers indicates the level A technical matter that it will affect (Ex: Style3=\color{red}). Most of the modern computer systems allow you to input Example of custom enumerate: letters of national alphabets directly from the keyboard. If Note that we put the FinalMark argument between {} to you tried to input these special characters in your LaTeX avoid LaTeX understanding it as the end of the proper- source file and compiled it, you may have noticed that ties list. Now we change the default properties to print a they do not get printed at all. custom itemize: A LaTeX source document is a plain text file. A computer Spaces in Style parameters are important. The Style* stores data in a binary format, that is a sequence of bits parameter acts as a default value and easylist will use a (0 and 1). To display a plain text file, we need a code which tells which sequence of bits corresponds to which medium dash for level 1, 5 and onward. sequence of characters. This association is called input You can also define custom styles using LaTeX macros: encoding, character encoding, or more informally charset. Important note: easylist has some drawbacks. First if you For historical reasons, there are many different input enneed to put an easylist inside an environment using the codings. There is an attempt to unify all the encoding same control character as the one specified for easylist, with a specification that contains all existent symbols that you may get an error. To circumvent it, use the following are known from human history. This specification is Unicommands provided by easylist: code. It only defines code points, which is a number for Besides using easylist along with figures may cause some a symbol, but not the way symbols are reprensented in trouble to the layout and the indentation. LaTeX lists do binary value. For that, unicode encodings are in charge. There are also several unicode encodings available, UTFnot have this problem. 8 being one of them. To use easylist with Beamer, each frame that uses easylist The ASCII encoding is an encoding which defines 128 must be marked as fragile: characters on 7 bits. Its widespread use has led the vast majority of encodings to have backward compatibility 2.6.6 Notes and references with ASCII, by defining the first 128 characters the same way. The other characters are added using more bits (8 [1] http://www.tex.ac.uk/cgi-bin/texfaq2html?label=noline or more). [2] The enumerate package, David Carlisle 1999 This is actually a big issue, since if you do not use the right encoding to display a file, it will show weird characters. What most programs try to do is guess statistically [4] CTAN documentation for enumerate the encoding by analyzing the frequent sequences of bits. Sadly, it is not 100% safe. Some text editors may not [5] easylist documentation bother guessing the encoding and will just use the OS default encoding. You should consider that other people might not be able to display directly your input files on 2.7 LaTeX/Special Characters their computer, because the default encoding for text file is different. It does not mean that the user cannot use anIn this chapter we will tackle matters related to input enother encoding, besides the default one, only that it has coding, typesetting diacritics and special characters. to be configured. For example, the German umlaut ä on In the following document, we will refer to special char- OS/2 is encoded as 132, with Latin1 it is encoded as 228, acters for all symbols other than A-Za-z0-9 and English while in Cyrillic encoding cp1251 this letter does not expunctuation marks. ist at all. Therefore you should consider encoding with care. This chapter is tightly linked with the font encoding issue. You should have a look at Fonts on the topic. The following table shows the default encodings for some Some languages usually need a dedicated input system to operating systems. [3] The enumitem package, Javier Bezos 2011 ease document writing. This is the case for Arabic, Chi- UTF-8 and Latin1 are not compatible. It means that if nese, Japanese, Korean and others. This specific matter you try to open a Latin1-encoded file using a UTF-8 dewill be tackled in Internationalization. coding, it will display odd symbols only if you used ac- 2.7. LATEX/SPECIAL CHARACTERS cents in it, since both encoding are ASCII superset they encode the classic letters the same way. There aren't many advantages in using Latin1 over UTF-8, which is technically superior. UTF-8 is also becoming the most widely used encoding (on the Web, in modern Unices, etc.). Dealing with LaTeX TeX uses ASCII by default. But 128 characters is not enough to support non-english languages. TeX has its own way to do that with commands for every diacritical marking (see Escaped codes). But if we want accents and other special characters to appear directly in the source file, we have to tell TeX that we want to use a different encoding. There are several encodings available to LaTeX: 35 defines those symbols that are known to be available with the current font encoding. You might encounter a situation where using UTF-8 might result in error: ! Package inputenc Error: Unicode char \u8:ũ not set up for use with LaTeX. This is due to the utf8 definition not necessarily having a mapping of all the character glyphs you are able to enter on your keyboard. Such characters are for example ŷŶũŨẽẼĩĨ In such case, you may try need to use the utf8x option to define more character combinations. utf8x is not officially supported, but can be viable in some cases. However it might break up compatibility with some packages like csquotes. Another possiblity is to stick with utf8 and to define the characters yourself. This is easy: where codepoint is the unicode codepoint of the desired • ASCII: the default. Only bare english characters are character. TeX sequence is what to print when the charsupported in the source file. acter matching the codepoint is met. You may find codepoints on this site. Codepoints are easy to find on the web. • ISO-8859-1 (a.k.a. Latin 1): 8-bits encoding. It Example: supports most characters for latin languages, but Now inputting 'ŷ' will effectively print 'ŷ'. that’s it. • UTF-8: a Unicode multi-byte encoding. Supports With XeTeX and LuaTeX the inputenc package is no longer needed. Both engines support UTF-8 directly and the complete Unicode specification. allow the use of TTF and OpenType fonts to support Uni• Others... code characters. See the Fonts section for more information. In the following we will assume you want to use UTF-8. There are some important steps to specify encoding. 2.7.2 Escaped codes • Make sure your text editor decodes the file in UTF8. In addition to direct UTF-8 input, LaTeX supports the composition of special characters. This is convenient if your keyboard lacks some desired accents and other dia• Make sure it saves your file in UTF-8. Most text critics. editors do not make the distinction, but some do, The following accents may be placed on letters. Although such as Notepad++. 'o' letter is used in most of the examples, the accents may • If you are working in a terminal, make sure it is set be placed on any letter. Accents may even be placed to support UTF-8 input and output. Some old Unix above a “missing” letter; for example, \~{} produces a terminals may not support UTF-8. PuTTY is not set tilde over a blank space. to use UTF-8 by default, you have to configure it. The following commands may be used only in paragraph • Tell LaTeX that the source file is UTF-8 encoded. (default) or LR (left-right) mode. To place a diacritic on top of an i or a j, its dot has to be inputenc [2] package tells LaTeX what the text encoding removed. The dotless version of these letters is accomplished by typing \i and \j. For example: format of your .tex files is. The inputenc package allows as well the user to change the encoding within the document by means of the command \inputencoding{'encoding name'}. • \^\i should be used for i circumflex 'î'; • \"\i should be used for i umlaut 'ï'. If a document is to be written completely in a language that requires particular diacritics several times, then using The LaTeX support of UTF-8 is fairly specific: it includes the right configuration allows those characters to be writonly a limited range of unicode input characters. It only ten directly in the document. For example, to achieve easExtending the support 36 CHAPTER 2. COMMON ELEMENTS ier coding of umlauts, the babel package can be configured as \usepackage[german]{babel}. This provides the short hand “o for \"o. This is very useful if one needs to use some text accents in a label, since no backslash will be accepted otherwise. Some keyboard layouts feature the degree symbol, you can use it directly if you are using UTF-8 and textcomp. For better results (font quality) we recommend the use of an appropriate font, like lmodern: More information regarding language configuration can be found in the Internationalization section. 2.7.3 Less than < and greater than > The two symbols '<' and '>' are actually ASCII characters, but you may have noticed that they will print '¡' and '¿' respectively. This is a font encoding issue. If you want them to print their real symbol, you will have to use another font encoding such as T1, loaded with the fontenc package. See Fonts for more details on font encoding. Alternatively, they can be printed with dedicated commands: 2.7.4 Euro € currency symbol When writing about money these days, you need the euro sign. The textcomp package features a \texteuro command which gives you the euro symbol as supplied by your current text font. Depending on your chosen font this may be quite far from the official symbol. 2.7.6 Other symbols LaTeX has lots of symbols at its disposal. The majority of An official version of the euro symbol is provided by eu- them are within the mathematical domain, and later chaprosym. Load it in the preamble (optionally with the offi- ters will cover how to get access to them. For the more cial option): common text symbols, use the following commands: then you can insert it with the \euro{} command. Finally, if you want a euro symbol that matches with the current font style (e.g., bold, italics, etc.) you can use a different option: again you can insert the euro symbol with \euro{}. Alternatively you can use the marvosym package which also provides the official euro symbol. Now that you have succeeded in printing a euro sign, you may want the '€' on your keyboard to actually print the euro sign as above. There is a simple method to do that. You must make sure you are using UTF-8 encoding along with a working \euro{} or \EUR{}command. Complete example: 2.7.5 Not mentioned in above table, tilde (~) is used in LaTeX Degree symbol for temperature and code to produce non-breakable space. To get printed tilde math sign, either write \~{} or \textasciitilde{}. And a visible space ␣ can be created with \textvisiblespace. A common mistake is to use the \circ command. It will For some more interesting symbols, the Postscript ZipfDnot print the correct character. Use the textcomp package ingbats font is available thanks to the pifont package. Add instead, which provides a \textdegree command. the declaration to your preamble: \usepackage{pifont}. For temperature, you can use the same command or opt Next, the command \ding{number}, will print the specifor the gensymb package and write fied symbol. Here is a table of the available symbols: A 'u' symbol should appear. Desktop environments like GNOME and KDE may feature a customizable compose key for more memorizable sequences. see this article on Joel Spolski’s blog. The input of special characters.7. 2. by typing ä instead . especially for languages using an input system (Arab.7. When applying accents to letters i and j. In that case they can be created with the following command: • \a' for an acute accent • \a` for a grave accent • \a= for a macron accent 2. Many X applications (*BSD and GNU/Linux) support the Ctrl+Shift+u combination. LaTeX needs to know how to hyphenate the language(s) to be used. Example: <Ctrl+Shift+u> 20AC <space> will print the euro character. Korean). 3. you can use \imath and \jmath to keep the dots from interfering with the accents: Tabbing environment Some of the accent marks used in running text have other uses in the tabbing environment. The following commands may be used only in math mode. This has to address three main areas: 1. so we suggest you to play a bit with your keyboard. LATEX/INTERNATIONALIZATION 37 compose key.10 Notes and References 2. 2. The user needs to use language-specific typographic rules. It highly depends on the selected layout+variant.8 [1] For a quick explanation on character sets.7 In special environments Math mode Several of the above and some similar accents can also be produced in math mode.9 External links • A few other LaTeX accents and symbols • NASA GISS: Accents • PDF document with a lengthy list of symbols provided by various packages .7. Chinese.2. preceeding every key and dead key with the Alt Gr modifier. Unicode keyboard input It is convenient to be able to insert language-specific speSome operating systems provide a keyboard combination cial characters directly from the keyboard instead of usto input any Unicode code point. the so-called unicode ing cumbersome coding (for example. In French for example.8 LaTeX/Internationalization LaTeX has to be configured and used appropriately when it is used to write documents in languages other than English. Japanese. 2. like Alt Gr. [2] For a detailed information on the package. see complete specifications written by the package’s authors. Type the code point and press enter or space to actually print the character. there is a mandatory space before each colon character (:).7.8. Xorg features advanced keyboard layouts with variants that let you enter a lot of characters easily with combination using the aprioriate modifier. 2. For more details check Font encoding and Special Char. Here comes a simple expieces of text in another language: ample: The starred version of this environment typesets the main \IfLanguageName{ngerman}{Hallo}{Hello} . Remove the language selection from the source and compile with latex '\providecommand\locale{en}\input{mydocument. The enviSome languages require special fonts with the proper font ronment hyphenrules switches only the hyphenation patterns used. You are free to choose the language command names. so that all the other packages you load afterwards will know the language you are using. Since you cannot do this easily in LaTeX.8. especially if you want to generate different version of the document automatically. which simplify the input of special characters. please add some notes about it. 2. This might be convenient 2. You can also add short The current language can also be tested by using the iflang pieces of text in another language using the command package by Heiko Oberdiek (the built-in feature from the Babel also offers various environments for entering larger babel package is not reliable). which might come in handy. providing as an argument name of the language ate language command. is saved using the UTF-8 encoding. Babel also specifies new commands for some languages. in the main language of the document. See Font encoding.38 CHAPTER 2. We will not tackle this issue here: see the keeps the language specific string for ancillary things like Special Characters chapter.1 Prerequisites to keep a consistent sectioning and formatting across the different languages. Example: you want to use (usually its English name. then the last language in the option list will be active (i. Here is a collection of suggestions about writing a LaTeX document in a language other than English. For a convenient writing you will need to set the input encoding and the font encoding properly.e. Babel will automatically activate the appropriate hyphenation rules for the language you choose. Alternative choice using iflang languageB).tex}' to output the english version of your document. If you 2. If your LaTeX format does not support hyphenation in the language of your choice. which has quite a negative effect on the appearance of the typeset document. This can be done by configuring input encod. and you can use the command to change the active language. If you call babel with multiple languages: Language choice on compilation You can choose the language on compilation.2 Babel For an explanation on the Plain TeX code. Preamble The following configuration is optimal for many languages (most latin languages). It is also useful if you make use of Most non-english language will need to input special multiple proper nouns and other untranslated content. see Macros. COMMON ELEMENTS of \"{a}). See Command-line LaTeX for more details.3 Multilingual versions have experience in a language not listed below. The babel package by Johannes Braams and Javier Bezos Usage will take care of everything (with XeTeX and LuaTeX you should consider polyglossia). You can load it in your Very simple: enclose the desired content in the appropripreamble. Make sure your document Add this into the preamble.text according to the rules of the other language. but not always): You should place it soon after the \documentclass command. bibliographies. it can also be used to disallow hyphenation by encoding set. we are going to write it in Plain TeX. figures. characters very often. babel will still work but will disable hyphenation.8. since you are going to use it often. Some of the methods described in this chapter may be The babel manual provides much more information on useful when dealing with non-English author names in these and many other options. Keep it short acters.You can use as many \localedef as you want. but ing properly. See the sections about languages below for more information. using the language name 'nohyphenation'.8. It is possible in LaTeX to typeset the content of one document in several languages and to choose upon compilation which language to output. . The babel encoding. The default behaviour of \Alph and \alph for the Bulgarian language option is to produce letters from the Bulgarian alphabet. Uyghur. 2. including Ara. c. If you are using a package manager or a portage tree. or The Sylfaen font lacks italic and bold. documents are not restricted to a single font without the need of defining own commands. AMS-LaTeX packages should be language. Support for Cyrillic is based in a CJK environment. It must fit the desired inputenc packages. etc. the CJK collection is usually to compile with XeLaTeX.4 Specific languages Arabic script On modern operating systems it is beneficial to use Unicode (utf8 or utf8x) instead of KOI8-RU (koi8-ru) as an input encoding for Cyrillic text. babel following code to your preamble: provides some commands allowing typesetting according You can input text in either romanized characters or na. See the Bulgarian translation of “The Not So Short IntroOnce the text editor is set up to compile with XeLaTeX. especially One possible Chinese support is made available thanks to on how to configure the Unicode supporting text editors the CJK package collection. Russian. and activating some language specific typographic rules (like \frenchspacing). LATEX/INTERNATIONALIZATION 39 This allows to easily distinguish between two languages However. b. since fonts are different for Chinese.to the standards of Bulgarian. which will require you to install a text editor that supports Unicode and will allow you to enter UTF-8 text. and commands to facilitate set Arabic and Persian hyphenation: You may also copy and paste from PDF files produced with Arabi thanks to the support of the cmap package. See Armenian Wikibooks for further details. you also need to load mathtext package before fontenc: • gbsn ( . Persian. Japanese loaded before fontenc and babel. See Special Characters for more details. or Ukrainian lantive Arabic script encodings. Babel will take care of switch\selectlanguage{english} ing to the appropriate font encoding when a different language is selected within the document. a. simplified Chinese) Generally. If you are going to use and Korean. Pashto. provided: the Cyrillic dash for the text (it is little narYou may also use the Arabi package within Babel to type. Armenian The Bulgarian option of babel provides the commands The Armenian script uses its own characters.. a dash for direct speech.7h of babel includes support for the T2* encod. language specific punctuation is See the ArabTeX Wikipedia article for further details. duction to LaTeX” [2] for a method to type Cyrillic letters the fontspec package can be used to write in Armenian: directly from the keyboard using a different distribution..g. Russian and Ukrainian Put the parts where you want to write chinese characters texts using Cyrillic letters[1] . translating automatbic. The Russian and Ukrainian options of babel define the You may use Arabi with LyX. but DejaVu Serif Chinese supports them. which act like \Alph and \alph (commands for turning counters into letters. Use any of the following guages.). quotes. such as Texmaker or WinEdt. add the ically generated text strings.rower than Latin dash and surrounded by tiny spaces).8.acter encoding. For multilingual documents using Cyrillic and language is changed by setting Latin-based languages it makes sense to include Latin font encoding explicitly. but produce capiSee Arabi page on CTAN tal and small letters of Russian or Ukrainian alphabets (whichever is the active language of the document).2. commands and environments to enter in text: For all three languages.. on standard LaTeX mechanisms plus the fontenc and The last argument specifies the font. which make \Alph and \alph produce letters of either Bulgarian or Latin (English) alphabets. ings and for typesetting Bulgarian. babel will automatically choose the default • gkai ( . e. Possible choices for Chinese include: Cyrillics in mathmode. Urdu. Cyrillic script Make sure your document is saved using the UTF-8 charVersion 3. Kurdish. For languages which use the Arabic script.8. simplified Chinese) font encoding. for the above three languages this is T2A. in a separate package because of its size (mainly due to fonts). These text editors should then be configured to compile using XeLaTeX. or with tex4ht to produce commands HTML.In addition to enabling hyphenations. glish and vice versa.}5 Xorg (*BSD and GNU/Linux). we would recommend using frenchb. which allows you to write German input files more You can load French language support with the following quickly even when you don't use the inputenc package. It will let you print numbers the French way. if you have config(section names. A set of new commands also beThe textcomp package will fix it for you. comes available. rectly in your text. etc.latin{english text} and \textgreek{greek text} that both ation marks. A set of new commands also becomes availFrench able. and francais for Parisian French..5. which turns a typesetter’s stomach. traditional Chinese) You can use the numprint package along Babel. however.can get the PDF version on CTAN. All of these also change A major problem arises from the use of commands like all automatic text into French: \chapter prints Chapitre. and acadian and In German books you sometimes find French quotation canadien for new-world French.} described in a previous secnot supported in general (that’s not specific to French).in a particular encoding world. make sure you use the You may want to typeset guillemets and other French T1 encoding.pdf or frenchb. run LaTeX on file frenchb. Note the particular input encoding. which allows you to write Greek input The great advantage of Babel for French is that it will files more easily.g. German typesetters. \flq: If you use the OT1 font encoding (which is the de\today prints the current date in French and so on. uments.. es. A quote in a German book would look not really care. So now you can write: take one argument which is then typeset using the reThe non-breaking space before the euro symbol is still quested font encoding. e. For traditional (“old”) German orthography use or for reform reform (“new”) German orthography use This will also automatically change document language This enables German hyphenation. You can place German quotated text inside \uv. All enable French hyphenation. If you do not know or do marks («guillemets»). This is customizable using the \frenchbsetup command. . With inpucommand: tenc. for use with LaTeX.) to Finnish. use them differently. So following table for inspiration: if you are using this type of quote. traditional Chinese) You will also notice that the layout of lists changes when switching to the French language. For more information Czech on what the frenchb option of babel does and how you can customize its behavior. For the degree character you will get an error like This is the preamble you need to write in the Greek lan! Package inputenc Error: Unicode char \u8:° not set up guage. Packages like ziffer enable input like 0. Use \euro for the Euro symbol. all this becomes moot. like »this«. your LaTeX system accordingly.dvi. A set fault) the guillemets will look like the math symbol " ≪ of new commands also becomes available. Otherwise you can use the comnecessary because currency symbols and other units or mand \selectlanguage{. T1 encoded fonts. . like You will need the T1 font encoding for guillemets to print Greek properly. characters directly if your keyboard have them. if you have configured typesetters use «guillemets» the same way the French do. you may want to use the (not just 0. you to write French input files more easily. one can use the commands \textpecially non-breaking spaces before all two-parts punctu. but your text also is locked There are multiple options for typesetting French doc. frenchb. Check out the on the other hand. Check out the table below for inspiration. This preamble enables hyphenation and changes all automatic text to Greek. do contain the required symbols. there are macros \clqq and \crqq to produce left and right quote. Running Decimal numbers usually have to be written like 0{. “Chapter” becomes “Kapitel”. You UTF-8 allows you to have „czech quotation marks“ di. tion. In order to temporarily switch to Enhandle some elements of French typography for you. Finnish Finnish language hyphenation is enabled with: You can load German language support using either one of the two following commands. Otherwise. depending on the flavor of French: french. ured your LaTeX system accordingly.40 • bsmi ( • bkai ( CHAPTER 2. It also changes all automatic text into German. oss variant which features some nice shortcuts. In the German speaking part of Switzerland. COMMON ELEMENTS .5).dtx and Czech is fine using read the produced file frenchb. which allows ". 2. element in typesetting is a set of welldesigned fonts. An example from the Luatexja documentation : • the CJK package by Werner Lemberg HLATEX and hLATEXp are specific to Korean and provide Korean localization on top of the font support.8. them work for languages with considerably more characters such as Korean or Chinese. The The last argument specifies the font. it took a considerable amount of time and effort to set up a Korean-capable encommands available: vironment under a non-localized (non-Korean) operating To make special characters such as Þ and Æ become system. On the other hand. there are three widely used packages. take a look at Texmaker. Greek and Cyrillic characters and Icelandic and Faroese other symbols and letters drawn from KS X 1001 are The following lines can be added to write Icelandic text: represented by two consecutive octets. a subfont mechanism was developed. LATEX/INTERNATIONALIZATION 41 Hungarian in Korean MS-Windows. or More information in hungarian. It makes additional MSB set. Just add For Korean. The first has its This changes text like Part into Hluti. EUC-JP. Hiraganas. Let us take an example : . but it contains use Korean under non-Korean OS in mid-1990’s. put the following declaration into the preamble of are EUC-KR and its upward compatible extension used your document: You can also use capabilities provided by the Fontspec package and those provided by Luatexja-fontspec to declare the font you want to use in your paper. The T1 encoding contains letters TeX and LaTeX were originally written for scripts with and punctuation characters for most of the European lan.no more than 256 characters in their alphabet. Japanese and Korean). They both can process Korean input text files encoded in EUCKR. To make guages using Latin script. min is an example for Japanese. CP949/Windows-949/UHC. at the beginning of your document and the output of all the commands will be translated properly. Big5. HLATEX can even process input files encoded in CP949/Windows-949/UHC and UTF-8 when used along Use UTF-8 as your encoding. Katakanas. Italian is well supported by LaTeX. See Special Characters for more details. input files in UTF-8 as well as in various CJK encodings Another (but old) possible Japanese support is made including EUC-KR and CP949/Windows-949/UHC. it available thanks to the CJK package collection. 5 different families. Hangul Jamos. Until the mid-1990’s. only the 128 characters. how to do this.net/faq to get a glimpse of what it was like to The default LATEX font encoding is OT1. Ω. Make sure your document is saved using the UTF-8 character encoding. Hanjas (Chinese characters as used in Korea). In case you don't know with Λ. It can process which use UTF-8 by default. Korean To use the HLATEX package for typesetting your Korean The two most widely used encodings for Korean text files text. special Korean fonts as HLATEX. The CJK collection is usually in a separate package because of its package has no Korean localization such as the one offered by HLATEX and it does not come with as many size (mainly due to fonts). Arguably the most important in a CJK environment. The CJK package works with a set of fonts used by earlier versions of HLATEX and it can use Bitstream’s cyberbit True-Type font. In these encodings each US-ASCII character represents its Use the following lines: normal ASCII character similar to other ASCII compatible encodings such as ISO-8859-x. Japanese 10 different families and Munhwabu fonts (TrueType) of and Korean. The ultimate purpose of using typesetting programs like Put the parts where you want to write japanese characters TeX and LaTeX is to get documents typeset in an aesthetically satisfying way. Shift_JIS. Hangul syllables. a LaTeX editor The CJK package is not specific to Korean. If you can be used to typeset documents with multilingual conare using a package manager or a portage tree. It must fit the desired HLATEX distribution includes UHC PostScript fonts of language. • HLATEX by UN Koaunghi Japanese • hLATEXp by CHA Jaechoon One possible way to write in japanese is to use Lualatex and the luatex-ja package. It divides a single CJK font with thousands or Italian tens of thousands of glyphs into a set of subfonts with 256 glyphs each. You can skim through the now much-outdated available just add: http://jshin. since fonts are different for Chinese. the CJK tent (especially Chinese. There are a few additional things one umn package. HLATEX relieves its users from this boring and error-prone process. refer to the HLATEX Guide.archive. subsections. switch them to commas for display or define the column as follows: Connectives Polish has many single letter connectives: The alternative is to use the numprint package. Those classes have much more European typography settings but do not require the use of Polish babel settings or character encoding. it is partially incompatible with the dcolbecomes “rozdział". For more details on typesetting Korean with HLATEX. “z”. To ensure that LaTeX won't set them as last letter in the line. but it cannot be determined which particle to use for references and other automatic text that will change while you edit the document. • mwbk instead of book • and mwrep instead of report. not a dot.. For books: For articles: Alternatively you can use dedicated document classes: • the mwart class instead of article. table of content and table of figures are all translated into Korean and the formatting of the document is changed to follow Korean conventions. The above code merely allows to use Polish letters and translates the automatic text to Polish. “w”. Commas in math According to Polish typography rules. etc. One needs to either use dots in columns with numerical data in the source file and make dcolumn must remember about. In Korean. (It is a bit more complex than this. so that “chapter” Unfortunately.a comma. To make LaTeX not insert additional space in math mode after a comma (unless there is ment. you have to use non breakable space: Further information Refer the Słownik Ortograficzny (in Polish) for additional information on Numerals According to Polish grammar rules. you Polish grammar and typography rules. instead.42 This command turns the Korean localization on.pl/~{}pmazur/LaTeX/mwclsdoc. sections. use the icomma package. use this command: See XePersian page on CTAN Moreover. but it is “a”.ci. section. but this should give you a good picture. Which of any given pair is correct depends on whether the preceding syllable ends with a vowel or a consonant. Polish have to put dots after numerals in chapter. Just add the following code to your preamble: To adjust penalties for hyphenation spanning pages. gine. rules don't allow for them to end a printed line. fractional parts of numbers should be delimited by If you plan to use Polish in your UTF-8 encoded docu. headers.Good extract is available at Zasady Typograficzne Składania Tekstu (in Polish). The headings of chapters. grammar and typography much less convenient. Check out the web site of Indentation It may be customary (depending on publisher) to indent the first paragraph in sections and chapthe Korean TeX User Group (KTUG). there are pairs of post-fix particles grammatically equivalent but different in form. . “u”.pwr. CHAPTER 2. ters: Persian script Hyphenation and typography It’s much more For Persian language.wroc. Simple usage: Full documentation for those classes is available at http://web. “i”. you can put the following (Polish). sub. etc.) Native Korean speakers have no problem picking the right particle.org/web/20040609034031/http:// In case you don't need Korean localization features but www.pages than it is customary in American typesetting. “o”.pdf just want to typeset Korean text. there is a dedicated package called frowned upon to set pages with hyphenation between XePersian which uses XeLaTeX as the typesetting en. section. It takes a painstaking effort to place appropriate particles manually every time you add/remove references or simply shuffle parts of your document around. line in the preamble. Arabic script can be used to type Persian as To adjust penalties for leaving widows and orphans (clubs in TeX nomenclature) use those commands: illustrated in the corresponding section. use the following code a space after the comma). The package also provides automatic particle selection. COMMON ELEMENTS This is achieved by redefining few LaTeX macros. and the output is typically either a comma or a dot. the com.8. Spain and Mexico. 'ľ'. Maksym Polyakov [2] The Not So Short Introduction to LaTeX. you should not combine Slovak needs special signs for 'ď'. as customary. command adds a small space. Refer to the excellent package documentation for details. these options may simplify the way LyX customizes some features of the Spanish layout from inside the GUI.esnolists: some packages and classes are known to collide with Spanish in the way they handle active characters. Once you have loaded it with the standard command in the preamble: you can use three new environments: it will turn the argument of 30 degrees. 2. the command only defines sen. or before. but active characters.6 Support for Cyrillic. you can use The macro \spanishoperators{<list of operators>}{ contains a list of spanish mathematical operators. Include the appropriate Babel option: Tibetan The trick is that Spanish has several options and commands to control the layout. as required by the Mexican Official Norm (NOM) of the Department of Economy for labels in foods and goods. as preferences may be quite different from. and may or Note. and the \.2.5 References ing with LaTeX. Spanish also defines shorthands for the dot and << >> so that they are used as logical markup: the former is used as decimal marker in math mode. as the found on latter is a deviation from standard Babel behavior. the latter is used for quoted text. beware that some option preempt the availability of some Basic settings are fine when left the same as Czech. be redefined at will. but it will not add any extra space. In particular. the following commands are roughly equivalent: One option to use Tibetan script in LaTeX is to add to your preamble and use a slightly modified Wylie transliteration for input. It will leave the necessary space to avoid any overlapping of text.5. Moreover. also rotated.1 The rotating package The options mexico. You can give any angle as an argument. Please. . Two particularly useful commands are If you want to make a float sideways so that the caption is \spanishoperators and \spanishdeactivate. LATEX/ROTATIONS Portuguese Add the following code to your preamble: 43 command supports accented or spaced operators: the \acute{<letter>} command puts an accent. More localizations are in the making.dtx for further details. Moreover: The package rotating gives you the possibility to rotate any object of an arbitrary angle. the following operators are defined by default.9 LaTeX/Rotations Two particularly useful options are es-noquoting. and thus may break other programs (LyX. 'ť'. Bulgarian translation 2. 2.9. to keep you out of trouble if they are redefined by other packages. The Slovak candidates for deactivation are the set {<>. For instance. Therefore. To be able to the es-noquoting option with \spanishdeactivate{<>}.9. say. the former syntax should be preferred. This sideways together with minipage.mexico-com provide support for local custom in Mexico: the former using decimal dot. it will rotate the whole argument by 90 degrees counterclockwise. This allows different typographical conventions with the same input. and the latter allowing decimal comma. For instance. the macro \spanishdeactivate{<list of characby choosing brazilian. ters>} disables some active characters. More information can be On average. they will be placed on a separate page. by defining the command \spanishoptions. and the output is typically either «» or “”."'}. and these options disable the internal workings of Spanish to allow you to overcome these common pitfalls.If you would like to rotate a TikZ picture you could use mand \let\spanishoperators\relax disables them all. The other commands modify the spanish layout after like turn. Spanish Please check the documentation for Babel or spanish. The options may be loaded either at the call to Babel. whether it is positive or negative. loading Babel. You can substitute the language for brazilian portuguese Finally. or type them from keyboard use the following settings: the es-noshorthands with \spanishdeactivate{<>. though. overriding all other definitions. [1] The Not So Short Introduction to LaTeX. latex2rtf) interact2."}. You can use the following letters: duce quality papers and with sufficient practice one can To specify a font format (such as bold.1 The tabular environment ures/sidewaystables clockwise (default).9. The table spec argument tells LaTeX the alignment to be used in each column and the vertical lines to insert. Using p{'width'} package may be used.paragraph of its own. figuresleft In two sided documents all sidewaysfigures/sidewaystables are same orientation (left of fig. It becomes relevant only if your table is not in a table construction in LaTeX is therefore necessary to pro. You can pass without this package. their alignment and the vertical lines to separate them. etc. This is the style preferred by the Chicago Manual of Style (broad. before Default is sidewaysfigures/sidewaystables are oriented de. clockwise In single sided documents turn sidewaysfig. such as \textwidth.2. It is also possible to add vertical lines between the columns here. in these cases. You can find a list in chapter Lengths. it makes sense to use a dedicated tool to build tables and then to export these tables into the document. since tabu works the same way. Once you are comfortable with basic LaTeX tables.) for print beautiful tables of any kind. In the first line you have pointed out how many columns you want. separating between cells and introducFor a long time. an entire column. vided. you can add >{\format} before you Keeping in mind that LaTeX is not a spreadsheet. Let’s rotate a always being compatible with one another. The rotating package takes the following options. LaTeX tables were quite a chaotic topic. Once in the environment. more advanced packages can be very useful. The situation changed recently (2010) with the release of the tabu package which combines the power of longtable.likely break existing documents. works. ure.tex) file. you will not need this used to summarise research results. the second one aligned in the center and with normal font. The H option can not be used around the text as in a normal paragraph. However. Basic tables are not too taxing. declare the alignment.10. such as 'pt' and 'cm'.The number of columns does not need to be specified as it is inferred by looking at the number of arguments proure. Nonetheless. you have to introduce the text you want. and the third aligned to the right and in italic. you might have a look at more advanced packages or the export options of your favorite spreadsheet. Mastering the art of option. if the text in a column is too wide for the page. ing new lines. rotfloat LaTeX won’t automatically wrap it. Then one can use you can define a special type of column which will wrapjust like for normal tables. The “array” package needs to be activated in the preamble for this to work. 2.The first line of the environment has the form: side). In most cases.2 The rotfloat package scribe the table columns (some of them require that the package array has been loaded): When it is desirable to place the rotated table at the exact By default. The tabular environment can be used to typeset tables figuresright In two sided documents all sidewaysfig. but anything more advanced can take a fair bit of construction.attempting to use this package for the first time it will pending on page number in two sided documents (takes be beneficial to understand how the classic environment two passes). ments turn sidewaysfigures/sidewaystables counterclockwise. The following symbols are available to de2. often surrounding text. Thanks to the modular nature of LaTeX. or command lengths. tabularx and much Options more.44 CHAPTER 2. LaTeX deures/sidewaystables are same orientation (left of fig. Note however that the author of tabu will not fix bugs to the current version. the whole process can be automated in a fairly comfortable way.with optional horizontal and vertical lines. Sometimes tabular inside a table for example: you had to make trade-offs. For example \begin{tabular}{ >{\bfseries}l c >{\itshape}r } will indicate a three column table with the first one aligned to the left and in bold font. COMMON ELEMENTS You can also use the \rotatebox command. italic. table now bottom of page). first it is important to know the basics.10 LaTeX/Tables The optional parameter pos can be used to specify the vertical position of the table relative to the baseline of the Tables are a common feature in academic writing. location where it appears in the source (. The commands you have to use are the with dozens of packages doing similar things. The tabu environment is far less fragile and restricted than the older alternatives.termines the width of the columns automatically. and that the next version introduces new syntax that will [1] counterclockwise/anticlockwise In single sided docu. table now at top of page). the width using any unit supported by LaTeX. while not following: . use the m attribute to have the lines aligned you might encounter errors similar to toward the middle of the box or the b attribute to align ! LaTeX Error: Something’s wrong--perhaps a missing along the bottom of the box. have a look at If you use some LaTeX environments inside table cells.Other environments inside tables though it may take some trial-and-error to get the result you want). even if it overruns the width of the page. One is that it will not automatically wrap You may also specify the skip after a line explicitly using text in cells. gorithm when using the p specifier.10. In this case it is easiest to use a \parbox: Basic examples This example shows how to create a simple table in La. Another example is . The tabularx package. of the table: And finally. like verbatim or enumerate: Instead of p. For a more convenient method.2. the only difference is that the graph” (p. any white space inserted between these commands Manually broken paragraphs in table cells is purely down to ones’ preferences. The default value is 6pt. It is a three-by-three table. glue after the line terminator For columns that will contain text whose length exceeds the column’s width. m or b). Here is a table with six centered columns flanked by a single column on each side: Column specification using >{\cmd} and <{\cmd} The column specification can be altered using the array package. LATEX/TABLES 45 Note.of Space between rows course.0. as well as centering (notice the use of the center environment . ter: \begin{tabular}{>{$}c<{$}}. but without any lines. Text wrapping in tables An alternative way to adjust the rule spacing is to add \noalign{\smallskip} before or after the \hline and LaTeX’s algorithms for formatting tables have a few \cline{i-j} commands: shortcomings. or The tabulary package. since the output ment. As an example: to get a column in math mode enis wider than the page width. This is done in the argument of the tabular environment using >{\command} for commands executed right before each column element and <{\command} for commands to be executed right after each column eleNote that the first table has been cropped. while in the first one we didn't specify any width. but rather specify the line breaks by hand. the result of this is not obvious from the preview on this web page): Re-define the \arraystretch command to set the space between rows: Default value is 1. This is particularly useful when your table has many columns. I personally add Sometimes it is necessary to not rely on the breaking alspaces between to make it easier to read. To tweak the space between columns (LaTeX will by deExpanding upon that by including some vertical lines: fault choose very tight columns). Here is a simple example. The following code creates two To solve this problem. change column specifier to “paratables with the same code. one can alter the colTo add horizontal lines to the very top and bottom edges umn separation: \setlength{\tabcolsep}{5pt}.Space between columns TeX. it is recommended that you use the p attribute and specify the desired width of the column (al. Compiling this code: Defining multiple columns You get the following output: It is possible to define many identical columns at once using the *{''num''}{''str''} syntax. to add lines between all rows. last column of the second one has a defined width of 5 centimeters. \item. so the data to be tabulated should be adjusted to the number of decimal places specified. Note the use of \tabularnewline instead of \\ to avoid a meaning that although the decimals may align nicely.. but a simple way to The argument of the > and < specifications must be cor. This means that >{\bfseries} is valid. Note that a decimal aligned column is typeset in math mode. add space. See the dcolumn package the column in a small font. it looks cumbersome in the example above. or numeric column headings. the usual >{\centering} : bold characters are wider than their normal counterparts. In addition.10. Given a basic table. A solution to this is to use the \multicolumn command described below. Sometimes.46 CHAPTER 2. use @{\hspace{''width''}}. as shown below.use dcolumn is as follows. rectly balanced when it comes to { and } characters. Unfortunately the that cell.10. text in a decimal aligned column (for example the header) will be right-aligned before the decimal separator (assuming there’s no decimal separator in the text).} and mal point it is rather harder to do. It is however possible to use normal width bold characters and define a new @-expressions bold column type. instead of the natural varying height that can occur when e. COMMON ELEMENTS changing the font: \begin{tabular}{>{\small}c} to print specifier for floating point data. it is possible to center a column on the decimal separator using the dcolumn package. If there is the need to use the text of the table as an argument (for instance. To need tabu instead. narily this is easy. hence the use of \mathrm for the column heading in the example above. we take a quick look at how point. We will replaces it with whatever is between the curly braces. it will automatically insert that text It might be convenient to apply the same command over into each cell in that column before the actual data for every cell of a row. you must define such a box with \newsavebox{\boxname} and then you can define: This stores the text in a box and afterwards. the first line of the table itself would be Left&Right&Center&\multicolumn{1}{c}{Decimal}\\ This same trick done with \raisebox instead of \underline can force all lines in a table to have equal height. and when appended to a column. just as for column. it may be nice to use bold text. For example to center the header Decimal over its column in the above example.[2] The column separator can be specified with the @{. This works only for some basic LaTeX commands.3 Spanning examples to clarify. and so will require a few 2.g.0cm} . num_cols is the number of subsequent columns to merge. the Misplaced \noalign error. For other commands. you may want to use \usebox{\boxname} instead of \unhbox\boxname.2 Row specification It typically takes some text as its argument. which provides a new column The command for this looks like this: \multicolumn{'num_cols’}{'alignment'}{'contents’}.. 2. Unsurprisingly. A simple example: . spacing between columns. r. This command kills the inter-column space and tabular environment cannot do that by default. documentation for more information.} construct. takes the text out of the box with \unhbox (this destroys the box. while >{\textbf} will not work and >{\textbf{} is not valid. While this may be fine for very short text. Admittedly. And contents is simply the actual data you want to be contained within that cell. The space-suppressing qualities of the @-expression ac.. using the \textbf to produce bold text). this is not that clear. which provides the \rowfont option. c. one should use the \bgroup and \egroup commands: >{\textbf\bgroup}c<{\egroup} produces the intended effect.) A negative argument provided for the number of decimal places in the new column type allows unlimited decimal places. if the box is needed again one should use \unhcopy instead) and passing it to \underline. This can be achieved by doing the following: to generate slightly more complex tables. specifying a single column and its alignment. Rounding is not applied. (For LaTeX2e. figures (for more than 2-−3 digits on one side of the decimal point) will be visibly misaligned. such as \underline to underline text. First. and varying the column descriptions: Rows spanning multiple columns Aligning columns at decimal points using dcolumn Instead of using @-expressions to build columns of decimals aligned to the decimal point (or equivalent symbol). but may result in rather wide columns.the commands necessary have to be embedded within the tually make it quite useful for manipulating the horizontal table data itself. it is necessary to temporarily store the column text in a box using lrbox. Also. math Bold text and dcolumn To draw attention to particular entries in a table. or to have text wrapping specify a width p{5. Orditerms or superscripts occur in the text. alignment is either l. but as dcolumn needs to see the deciHere is an example showing the use of both p{. it is desirable in scientific tables to have the numbers aligned on the decimal To complete this tutorial.. 10. Actually tabu is greatly inspired by those environments. there must always be n − 1 ampersands in each row (unless \multicolumn is also used). Highlighting can be reactivated within the table via the \showrowcolors command.5 Colors you still need the "&" separating it from the next column’s data. If you do not like this default. that may not look quite as intended. otherwise you need The first thing you need to do is add \usepack. since we or do not want the line to be drawn over the text that spans several rows.width specified.Colors of individual Cells ers”. Here is another example exploiting the same ideas to As above this uses the xcolor package. The astute reader will already have deduced that for Alternate row colors in tables a table of n columns. size is not affected. the cells drawn correctly: The command \hiderowcolors is available to deactivate highlighting from a specified row until the end of the table. make the familiar and popular “2x2” or double dichotomy: 2.6 Width and stretching Controlling table size We keep providing documentation for tabular* and tabularx although they are completely eclipsed by the much Resize tables more powerful and flexible tabu environment. which may be after the \begin{table} statement if you use floats. Instead we use the command \cline{2-6} and opt out the first column that contains the text “Pow.for tabularx. Note that we cannot just use \hline to draw horizontal lines. you can change the default font for all the vides the command needed for spanning rows: \multables in your document by placing the following code in tirow{''num_rows’'}{''width''}{''contents’'}. The tabular* environment Resizing table including the caption This is basically a slight extension on the original tabular Alternatively you can use \scalebox{ratio}{object} in the version. The command \rowcolSpanning in both directions simultaneously ors{<''starting row''>}{<''odd color''>}{<''even color''>} Here is a nontrivial example of how to use spanning in has to be specified right before the tabular environment both directions simultaneously and have the borders of starts.10.4 2.10. blank entry must be inserted for each appropriate cell in each subsequent row to be spanned. ular to specify the height and width of a table. see The main thing to note when using \multirow is that a Caption Styles.. although it requires an extra argument (before the same way but with ratios rather than fixed sizes: column descriptions) to specify the preferred width of the table. This then proAlternatively. If while using these commands you experience “misplaced \noalign errors” then use the commands at the very beginning or end of a row in your tabular. Even when combined with \multirow{2}{*}{. The following example shows how to resize a table to 8cm width while maintaining the original width/height ratio. If there is no data for a cell. However.to add a group delimiter.}. when loaded with the table option.2. The command \multicolumn{1}{ is just used to draw vertical borders both on the left and on the right of the cell.10. To compensate for that. so it may The graphicx packages features the command \resize. it still draws vertical borders that only span the first row. we add \multicolumn{1}{ in the following rows spanned by the multirow. particularly box{width}{height}{object} which can be used with tab. LATEX/TABLES 47 Columns spanning multiple rows notesize) in the table scope. The arguthe preamble: ments are pretty simple to deduce (* for the width means See Fonts for named font sizes. just don't type anything. age{multirow} to the preamble[3] . The table caption font the content’s natural width).be worth it to have an idea how they work. The xcolor package provides the necessary commands to produce tables with alternate row colors. but 2.. To control the caption font size. you must Changing font size . The columns are still at their natural width (just wide enough A table can be globally switched to a different font size to fit their contents) while the rows are as wide as the table by simply adding the desired size command (here: \foot. Note that the \multicolumn width (which in this example is 2) should equal the (in this example 1+1) width of the spanned columns: 2. tabulary is a modified tabular* allowing width of columns Or use a parbox to center the image.5 + 0. colsep command. the second and fourth column is adjusted look at its documentation if you want to know more. which.Removing part of a vertical line in a particular cell: type as follows: where since there are 4 columns. Besides. LaTeX can do well with long tables: you can specify a Another option is the use of \newcolumntype in order to header that will repeat on every page. The problem with tabularx is that it leaves much blank if your cells are almost empty. However. The two central columns are posing as one proved version of supertabular. fines a new column specifier. . except that the width is calculated automatically. in a different way (\raggedleft): Alternatively you can try one of the following packages Tabularx with rows spanning multiple columns using supertabular or xtab.first page only. e. If you use the package array. are not fixed. LaTeX has rubber lengths. 2. tabulary will try not to exceed it.5 + 2) must be equal to 4.10.7 Table across several pages to make the table as wide as specified. tune the alignment with its first parameter. Defining a new columntype will keep the image The tabulary package vertically centered. a header for the get selected columns formatted in a different way. Unfortunately this environThe content provided for the boxes is treated as for a ment does not support stretching (X columns). It de. set for equal heights. p column. By using the array package this problem can be solved.48 also explicitly insert extra column space. an example of this is the following. So. 'to \linewidth' specifies the target width. It any >{\cmd} or <{\cmd} command to achieve specific has most of the features of tabu. except that it has a new column specifier X (in uppercase). the sum of the \hsize’s (1 + 0.9 Vertically centered images used by tabularx for \hsize is 1. Within it is the \extra. an extended and somewhat im\multicolumn.g. A fixed width could have been used. new column Adding a partial vertical line to an individual cell: types with arguments can be created with \newcolumn.These are all capitals.. but it will not stretch to it if there is not enough content. In It uses syntax similar to longtable. by using the X@{} option. contrary to tabularx. without exceeding The tabular environment does not handle footnotes properly. The tabu environment The tabularx package It works pretty much like tabularx. by using a rubber length. The column(s) specified with this specifier will be stretched 2.10. which requires a width. or \raggedright\arraybackslash) pability to span multiple pages.values are those from the tabular environment. The default value 2. also allowing to manually finewriting of well balanced tables. The X parameter This package provides a table environment called tabu. the maximum length. plus ning of the column description. it is not easy to have different column sizes. tabulary allows easy and convenient A raisebox works as well. with the additional cabehavior (like \centering. unlike others.10. and the same for the footer. the longtable environment. The longtabular fixes that.can have an optional span factor. the columns are automatically spaced evenly. larx which is similar to the tabular* environment. Inserting images into a table row will align it at the top of the cell. COMMON ELEMENTS The first parameter is the maximum width. you may also apply The tabu packages provides the longtabu environment. CHAPTER 2.8 Partial Vertical Lines In a way analogous to how new commands with arguments can be created with \newcommand.. Possible You will notice the @{.10 Footnotes in tables tabulary tries to balance the column widths so that each column has at least its natural width. such as \fill. so you should have a this example. The second parameter is the column disposition. greatly simplifyLong tables are natively supported by LaTeX thanks to ing the creation of tables. as described previously.} construct added at the begin.10. LaTeX can dynamically decide how long the lengths should be. R (in uppercase). .65 \\ & each & 0.01 \\ age{booktabs} in the preamble). \multicolumn{2}{c}{Item} \\ The following example contrasts the use of booktabs and \cmidrule(r){1-2} two equivalent normal LaTeX implementations (the sec.33 \\ Armadillo & frozen & 8.10.12 Sideways tables Tables can also be put on their side within a document using the rotating or the rotfloat package.\midrule age{dcolumn}. which are regarded as unnec.10. and double-rules Gnu & stuffed & 92.& each & 0.99 \\ The booktabs package is useful for easily providing this \lasthline professionalism in LaTeX tables.11 Professional tables \multicolumn{2}{c}{Item} \\ \cline{1-2} Many professionally typeset books and journals feature Animal & Description & Price (\$) \\ simple tables. Using booktabs In brief.01 \\ case the use of vertical rules (using "|"). %or \usepackage{dcolumn} .. and \bottom.Gnat & per gram & 13. Armadillo & frozen & 8. the package uses \toprule for the uppermost rule (or line). The ctable uses the booktabs package. \begin{tabular}{llr} \firsthline 2.65 \\ & each & 0.99 \\ \hline \end{tabular} Usually the need arises for footnotes under a table (and not at the bottom of the page). Gnu & stuffed & 92. In addition. which have appropriate spacing above and \hline below lines.50 \\ Emu & stuffed & 33. \midrule for the rules appearing in the middle \usepackage{booktabs} of the table (such as under the header). 2.99 \\ \bottomrule Normal LaTeX \end{tabular} \begin{tabular}{llr} \hline \multicolumn{2}{c}{Item} \\ \cline{1-2} Animal & Description & Price (\$) \\ \hline Gnat & per gram & 13.33 \\ essary and distracting in a professionally published form. rule for the lowermost rule.33 \\ Armadillo & frozen & 8.2. Many ex.. and the documentation \end{tabular} also provides guidelines on what constitutes a “good” table.01 \\ Gnu & stuffed & 92.50 \\ Emu & stuffed & 33.10. It provides the option of a short caption given to be inserted in the list of tables. instead of the actual caption (which may be quite long and inappropriate for the list of tables). with a caption properly spaced above the table. \cmidrule \toprule can be used for mid-rules that span specified columns. and almost never use vertical rules.50 \\ (using \hline\hline or "||"). These are addressed by the ctable package.Gnat & per gram & 13.Animal & Description & Price (\$) \\ ond example requires \usepackage{array} or \usepack. This ensures that the rule \begin{tabular}{llr} weight and spacing are acceptable. and the third example requires \usepack. LATEX/TABLES 49 Instead of using longtabular we recommend tabu which Using array handles footnotes properly..Emu & stuffed & 33.65 \\ amples of LaTeX tables (including this Wikibook) show. See the Rotations . both in normal and long ta\usepackage{array} bles.. can be found in Floats.bles using specialized software and exporting them in LaTeX can automate this task by abstracting objects such TeX format. it’s placed at the bottom if possible. A tabular environment helps control where lines should break.}. or by enclosing it with a center enviIn WYSIWYG document processors. its introduction in the source file. Let’s sum it up: Table with legend • tabular is for the content itself (columns.org Calc spreadsheets. which is able to float and add a label and caption. You can set the optional parameter position specifier to define the position of the table. see for a tutorial. using the \centering command just after opening the table environment. In fact. which means that it is by default placed on the top of the page.} statement can be added besides the normal \caption{. tables in the middle of the text. • xtable: a library for R. for instance when one has the same text in two languages and wishes to present these next to each other with lines synching up. You can force LaTeX to use one given position. captions etc. if displayed.10.In the table.. If you really want to place your table manually. Ex. The table environment initiates a type of float just as the environment figure. the two bear a lot of similarities (positioning.10..50 CHAPTER 2. or finally with other floating environments on an extra page. org-mode tables can be used inline in LaTeX documents.15 Floating with table To tell LaTeX we want to use our table as a float. From the point of view of the source code. etc. used.). You might save lots of time by building taguess which page may be appropriate for our table. and deciding for us where they able for some popular software: might fit best. • org-mode: for Emacs users. If that’s not possible.10. captions. but cannot justify the text. pictures.14 The eqparbox package On rare occasions. 2. control its position also. During compilation it bookkeeps which \eqmakebox with a certain tag contains the widest text and can stretch all \eqmakeboxes with the same tag to that width. lines. More information about floating environments. etc. one has no idea on which page For complex or dynamic tables. but it will not be placed there if LaTeX details. Generally.. COMMON ELEMENTS chapter. you may want to use a the current text is going to lie.g you place a table here and this place would be the last line on a page). [!h] forces LaTeX to place it exactly where you place it (Except when it’s really impossible. Figures and Captions. 2. The table environment is also useful when you want to 2. thinks it will not look great. With the caption package a \caption*{. etc. • matrix2latex: for Python and MATLAB. • table is for the location of the table on the document. Default is tbp. which leads to ragged right edges. La. but one can choose to • excel2latex: for Microsoft Office Excel. E. an object that is floated will appear in the vicinity of • calc2latex: for OpenOffice. it is common to put ronment. Centering the table horizontally works like everything else.16 Using spreadsheets so that they do not disrupt the flow. The following plugins and libraries are availas tables. • latex-tools: a Ruby library.g. so now we can refer to it just ample: like any other reference: The normal caption is needed for labels and references. often make it a point to print tables on a dedicated page 2.13 The environment names may now seem quite confusing. however. we used a label. The following characters are all possible placements..10. Using sequences of it define your “wishlist” to LaTeX. we need to place a tabular environment in a table environment. This abstraction is called a float. e.). Combined with the array package. so it is hardly possible to spreadsheet. one can define a column specifier that justifies the text in all lines: have a list of tables at the beginning or end of your document with the command The captions show now up in the list of tables. This is what we have been doing until now.. where it should be placed. Again. do not use the table environment. understand it correctly: it urges LaTeX to put the table at See the documentation of the eqparbox package for more a specific place. Professional documents. • matrix2latex: for MATLAB. it takes a tag. To add a legend to a table the caption package can be plus caption and label support. it might be necessary to stretch every row in a table to the natural width of its longest line. . The eqparbox package provides the command \eqmakebox which is like \makebox but instead of a width argument. 2. rounds. lines One must specify what to fill it with using these commands placed in the top matter: • ctable: allows for footnotes under table and properly spaced caption above (incorporates booktabs pack. generate the source code to a separate file which you can input from your main document file with the \input command. the amsart uses commands such as \address. one may add cells with rounding The \thanks command can also be used in the \title. using a Makefile for example.10. exponent and/or rounded to a given number of digits. For example. • colortbl: make your table more colorful Have a look at one of the following packages: • threeparttable makes it possible to put footnotes 2.11. but longer documents (such as books and reports) often require more involved formatting. • spreadtab: spread sheets allowing the use of formu. while the article document style will place the title on the top of • diagbox: compatible to slashbox. Note that the abstract environment should Live 2011 or later precede the \maketitle command in AMS documents. [3] Package multirow on CTAN 2. use ing a description for both axes. the output of \maketitle is often adequate.com/questions/118458/ decimals-in-table-dont-align-with-dcolumn-when-bolded. \email and more in the title page while other classes may only use \title. in the current mode (text or math) in order to use the correct font. For most Live 2011 or later. http://tex.Commonly the date is excluded from the title page by using \date{}. For maximum flexibility. It defaults to \today if not in the source file. LaTeX format is directly generated as you type. In such cases it is often better columns to create the title from scratch.Normally.2 Custom Title Pages lae Create the title • siunitx: alignment of tabular entries • pgfplotstable: Loads.stackexchange. • numprint: print numbers. document styles. LATEX/TITLE CREATION 51 • Emacs align commands: the align commands can 2. • Online Table generator for LATeX: An online tool for creating simple tables within the browser. and this section will show you how to accomplish this.18 clean up a messy LaTeX table. formats and postpro.1 both within the table and its caption Standard Title Pages • arydshln: creates dashed horizontal and vertical Many document classes will form a title page for you. and longtable environments is supported using all features of numprint It is dependent on the document class which commands are used in the title page generated by \maketitle. 2. We will detail the process here. with separators. \dedicatory.2. tabular(*).com/questions/121841/ is-the-tabu-package-obsolete [2] D Carlisle. Not available in Tex This should go after the preceding commands. copying the generated source code to your document is not convenient at all. rather than in the format na• hhline: do whatever you want with horizontal lines tively supported by LaTeX.17 Need more complicated features? References [1] http://tex.10. While it is possible to change the output of \maketitle.stackexchange. array. tional word processing programs is that LaTeX frees you . tabularx. age) • slashbox: create 2D tables with the first cell contain. However. See Modular Documents for more details. For example.11 LaTeX/Title Creation For documents such as basic articles. you can generate your complete document (table included) in one command. it can be complicated even with • array: gives you more freedom on how to define minor changes to the title.11. There are several situations where you might want to create a title in a custom format.11. this will form a separate page. come with Tex the first page. “Decimals in table don't align Stackexchange. If your speadsheet supports command-line. with dcolumn when bolded”. • dcolumn: decimal point alignment of numeric cells Footnotes within the title page can be specified with the • rccol: advanced decimal point alignment of numeric \thanks command.To form a title page. the benefit of using LaTeX instead of tradicesses numerical tables. \end{center}. As you can see.complicated code will be isolated from all the rest within ics[width=0. \\ command./logo}. So for example: source.its own file title. it will just insert a horizontal line whose length is equal to a line of text and whose thickness is 0. you just want it there where you if you want to write your own title format. Here is what you need to know to write your title: date. Finally the document starts and it simply includes the title. Their width is a bit less than half of page width (as you can see. A practical example All these tips might have made you confused. remember that it is considered like a big box by the TeX engine. it to be floating. In other words. and you can use ment of layout.52 CHAPTER 2. {like this}. If you want to align it differently you can use the environment flushright for right-alignment and flushleft for left-alignment.tex and test_title. Then.tex described above and here is an example of a title. so the output won't change when you include the title in your document. it serves as a template for all other docu. the code looks “dirtier” than standard LaTeX source because you have to take care of the output Images the command for including images is the fol.tex. \tiny. \Large. If you start changing font’s output it will get more lowing (the example is for a small logo. it is exactly placed it. and other typesetting concerns. That is be indented).tex you will see a preview of your title in the test_title. they are exactly 40% of the text width). Call the dummy document Date you can insert the date of the current day with the test_title.) If you want you can change its settings in the definition. On the other hand.tex and write in it: all the things you want to put in the title must be inside the titlepage environment. \\[1cm] will insert 1 cm you don't have to compile the whole document each time.15\textwidth]{. once you have a layout you like. \LARGE. If you put it within the page. Within the minipages I have used different alignments. otherwise it will be indented and you will get an overfull hbox warning equal to the normal indent of a paragraph’s first line. raw HTML with the added step that each time you want \huge. but you can do it: it’s only for the title and your introduce any image of any size): \includegraph. (Note that you will need to precede the command \HRule with \noindent.. COMMON ELEMENTS to concentrate on content by handling margins. the benefit is that once the customized title format has been written. If you do not wish to insert any It is meant to be compiled with pdflatex to create a PDF as its output. keep it blank e. \small.\normalsize is used to create text at the default size for ments that would use the title format you have just made.5 mm. that must be placed in the same directory of our dummy file test_title. the opposite: you have to take care of everything--this time LaTeX will do nothing to help you. Alignment if you want to center some text just use \begin{center} . If you want to add more vertical space.\date{} Filling the page the command \vfill as the last item of your content will add empty space until the page is full. It can be challenging to create your own title format since LaTeX was Text size If you want to change the size of some text just not designed to be graphically interactive in the adjustplace it within brackets. the title and then we'll simply include it within the existing big document we are writing. Using \vfill I could write the date exactly at the bottom of the page. For example. Then a command is defined called \HRule. of empty space before the new line (which will not you only need to take a look at the first page. Using multiple \\ commands will prowhy we'll first create a dummy document for preparing duce Underfull hbox messages.tex and put the following code in it: command \today. you have to re-compile the size.as well. In this case (see the first line) the font size is set to 12pt and the paper size is an A4. same layout without any additional fiddling with layout. \large.g. When handling it. The process is similar to working with the following commands (in order of size): \Huge. Now create the title. While this may seem like a major inconvenience. the document. On the right you can see the output after you compile test_title. do so by First step: since you'll be working only on the first page adding the desired space in square brackets after the of your document and you'll have to compile very often. justificagin{figure} as you usually do because you don't want tion. but you can confused.tex. here is a practical example.tex in PDF: The picture is from a file called logo.pdf file.png that is in the same directory of both title. It is a very basic document. one on left and one on the right. There is no \be. Now if you compile test_title.tex file.tex. The package graphicx is included to insert an image in the title.tex. you will ensure that all the following text will be placed at the bottom of the page. Since I wanted to insert both the author and supervisor names properly aligned I used a trick: I created two small minipages. \footnoteto see how your changes look. you can use it for any other documents where you would like the New lines you can force the start of a new line by \\. Get the test_title.. but take care that it has the same settings of the document you are writing. . Margin notes 2. \marginparsep = 10pt 10. \paperheight is the physical height of the page.12. Don't forget to add the commands \usepackage[pdftex]{graphicx} and \newcommand{\HRule}{\rule{\linewidth}{0. For example. \oddsidemargin = 31pt 4.12 LaTeX/Page Layout Footer LaTeX and the document class will normally take care of page layout issues for you. Articles are by default one-sided. \footskip = 30pt • \marginparpush = 7pt (not shown) • \hoffset = 0pt . this entire topic will be out of your hands. to name but three. one inch + \voffset 3. \headheight = 12pt 2.2.tex.tex} at the top of the document. A page in LaTeX is defined by many internal parameters./title. as the publishers want to control the presentation. If you want to make the article class two-sided. one inch + \hoffset 2. books are two-sided. All sizes are given in TeX points (pt). for example. Each parameter corresponds to the length of an element of the page.2 Page dimensions Assuming that your title page is now contained in a file named title.12.11. Many commands and variables in LaTeX take this concept into account. the input command must be used by placing \input{.3515mm. there are some obvious settings that you may wish to change: margins. page orientation and columns. it must be placed in the same directory as the main document. However. Twosided documents differentiate the left (even) and right (odd) pages.1 Two-sided documents Documents can be either one. \textheight = 592pt 8.or two-sided.12. whereas one-sided do not. for your own documents. For one-sided document. Here you can see a diagram showing all the variables defining the page. The purpose of this tutorial is to show you how to configure your pages. there are 72.4 Body 7 Notes and References 9 [1] Titling package webpage in CTAN 10 3 [2] Frontespizio package webpage in CTAN 8 11 2. The most notable effect can be seen in page margins. \marginparwidth = 35pt 11. Italian users may also want to use the frontespizio package[2] . 6.5mm}} in the preamble section as well. \headsep = 25pt 7.3 Packages for custom titles 6 The titling package[1] provides control over the typesetting of the \maketitle and \thanks commands.27pt in an inch or 1pt ≈ 0. For submission to an academic publication.11. We will often have to deal with TeX lengths in this chapter. LATEX/PAGE LAYOUT 53 Integrating the title page 2. only the odd commands and variables will be in effect. use \documentclass[twoside]{article}. In order to integrate it. 1 1. The titlepages package presents many styles of designs for title pages. You should have a look at Lengths for comprehensive details on the topic. \textwidth = 390pt 9. They are referred to as even and odd. \topmargin = 20pt 5. the top section of your document would look like: 2 4 5 Header 2. .advantage: it will let you change the page dimension anyage and the command of the same name: \usepack. . which can be used here to set the to set the page size.ps # DVI → PS ps2pdf myfile. • legalpaper. \pdfpagewidth and \pdfpageheight if you are using pdftex. • For the DVI and PS ways. using the package geometry usually works. age{layout} .297mm To explicitly change the paper dimensions using the ge. or PDF parameters. . a6paper.. there are basically three ways: to the document. For A4 format: Sadly the PDF output page size may not be completely respectful of your settings. PS and PDF specifiOne of the most versatile packages for page layout is cations. For instance. b1paper.3 Page size pdflatex myfile # TeX → PDF It will not have been immediately obvious . # On Windows: ps2pdf -sPAPERSIZE#a4 . • b0paper. COMMON ELEMENTS • \voffset = 0pt • \paperwidth = 597pt • \paperheight = 845pt • In the preamble. \paperwidth and \paperheight in all cases. • For pdflatex to work fine. In order to create PDF documents with . compared to A4 (which • TeX → DVI → PS → PDF is the standard in almost all the rest of the world)..... b6paper.12..5in.54 CHAPTER 2. [1] If you want US Letter instead. ps2pdf -sPAPERSIZE=a4 .. and slightly latex myfile # TeX → DVI dvipdf myfile # DVI → PDF wider by 8 mm (about 1/4 inch)..because it • TeX → DVI → PDF doesn't really cause any serious problems .. • letterpaper. See the Lengths chapter. replace 210mm. like a4paper.ps myfile. \layout{} To render a frame marking the margins of a document Page size issues you are currently working on. add the following to your preamble: page size appropriately. • After the preamble. add \usepackage{showframe} If you intend to get a PDF in the end. Some of these tools do not have More size options with geometry the same interpretation of the DVI. Thankfully there is a solution to package is that it lets you customize the page size even that: the \special command lets the user pass PostScript with classes that do not support the options. • executivepaper.by 8. While this is not a serious issue (most printers will print the document without any problems).where in the document. the paperwidth and paperheight options letter in command-line parameters. it is possible to specify al. The immediate advantage of this exactly the right size. The current details plus the layout shape can be printed Using the PDF dedicated commands has one immediate from a LaTeX document itself. The geometry package has many pre-defined page sizes. Also replace a4 by ometry package.. can be used.. For example: Page size for tablets Changing size manually Those who want to read on tablets or other handheld digUse the \setlength command to adjust the parameters to ital devices need to create documents without the exthe appropriate dimensions.pdf # PS → PDF ternative sizes as class option. the safest way to always get the right paper size in the end is to add to the tex file. and you may end up with a PDF which has not the geometry package.that the default page size for all standard document classes is US letter. • TeX → PDF 2. Use the layout pack. tra whitespace.11in and a4paper by letter. and to append the appropriate parameters to the processors used during output generation: dvips -t a4 . Others include: • a0paper...latex myfile # TeX → DVI dvips myfile -o myfile. This is shorter by 18 mm (about 3/4 inch). built in. a1paper. 441pt by 666pt (or 6. 2. the easiest way to handle different margins for odd and even pages is to give the twoside option in the document class command and specify the margins as usually. this white space is left in the inner margin with the assumption that the document will be bound. If you are looking for a sensible dimension. don't add the \usepackage commands twice.The top margin above a chapter can be changed using the dardized smaller margins (around an inch): titlesec package. These values are changing orientation. with landscape as an option: obsolete and buggy. The side for the large margin is chosen opposite to the side where pages are joined together.g. relative to the edge of paper (0in) and go inward it. so must the page size. Note that by de.25 inches). Example: For an even greater effect give it the cm option (around The command \titleformat must be used when the spacing of a chapter is changed. without any options) this package already means changing to landscape mode. LATEX/PAGE LAYOUT optimal handheld viewing. Thus. so for a 'standard layout' you default. Top margin above Chapter there are many ways to do so: • Simply use the fullpage package for somewhat stan. 55 Odd and even margins Using the geometry package. separating with a comma: above. Another quick way to eliminate the difference in position between even and odd numbered pages would be setting the values to evensidemargin and oddsidemargin to the half of odd’s default: By default. Therefore.0in or 2. since portrait is the reduces the margins. consider following the paper size used by the Supreme Court of the United States. simply • Edit individual page dimension variables described string all the options together. It is package. the font required by the Supreme Court. You 2. For example. You could also use the Supreme Court’s text field size of 297 pt by 513 pt. They also have aliases inner and outer.12.12. We shall introduce two slightly different styles of may not need to specify anything. Use cm for centimeters and in for inches after each value (e.4 Margins Readers used to perusing typical physical literature are probably wondering why there is so much white space surrounding the text. the value of evensidemargin is larger than oddsidemargin in the two-sided layout. which looks great on tablets. There are various options seen in this paragraph. If you wish to change the margins of your document.2. you can use the same class mands.When you talk about changing page orientation.54cm). not only must the text field and margins be adjusted.125 inches by 9. it usually fault (i. the options left and right are used for the inside and outside margins respectively. using the \addtolength and \setlength com. For instance. See the Lengths chapter. Use geometry package instead Although. if you intend to use geometry to set your paper like this: size. packages available to achieve this.5cm): can be omitted. In case of a section this command 1. the page margins are set to ensure optimal readability. 1. Studies have shown[2][3] that it’s easier to read text when there are 60–70 characters per line—and it would seem that 66 is the optimal number. • Use the geometry package.Using standard LaTeX classes. All you need to do is call the with A4 document size with smaller margins.e. options: . It may be implemented as follows: Change orientation of the whole document or all in a row You can combine the margin options with the page size The first is for when you want all of your document to be in landscape from the very beginning. but this is too wide for fonts other than Century Schoolbook. and excessive margin white space is tolerated as a consequence. Sometimes.5 Page orientation can enter the measures in centimeters and inches as well. on A4 paper a document will typically have 44 mm margin widths on the left and right of the page. This package allows you to specify the 4 margins without needing to remember the particular page dimensions commands. The reason is improved readability. Setting the same value for the inner and outer for geometry will remove the difference between the margins. but the one we prefer • You should not use the a4wide package for a page is the geometry package. leaving about 60% of the page width for text. as one could wish to write notes on the side of the page.12. See the Lengths. This will result in a value of 4cm on all inner margins (left margin for odd number pages and right margin for even pages) and 2cm margin on outer margins. Note that order matters! 2. and \thispagestyle{''style''} will only affect the current page. Again. \chapter or \maketispecific page tle) specify a \thispagestyle{plain}. • Use fancyhdr as described below. the commands \markright (in the standard document classes. If approach is more applicable to books or reports than to you want them to print the actual name of the chapter typical academic publications.12. a landscape environment.12.standard book formatting of the \chaptermark is: side a table environment. without number and without afwill be left in portrait orientation. However. chapter. The possible styles are: The tricky problem when customizing headers and footers is to get things like running section and chapter names in there. and page numbers. COMMON ELEMENTS Change orientation of specific part With myheadings.56 CHAPTER 2. but to the running headers and footers of a document. The \part command. Standard page styles The possibilities of changing the headers in plain Latex are actually quite limited. if you wish to Page styles Page styles in Latex terms refers not to page dimensions. report and article) and \markboth (only in the book class) are used to control the headings. then the style command at each section will override your initial rule. It supplies running page of the document. you use the commands \rightmark and \leftmark to represent the current section and chapter heading. There are special commands containing details on the The lscape package is for this very purpose. These headers typically contain document titles. To achieve the intended result one can follow the new section commands with \thispagestyle{empty}. but also advances to the next page. book. the second for the footer. because it sets the page style. you still want the consistency of your headers and footers appearing the same place as the other pages. It will not be floated! To fix this you need the package rotating. you will see that the table is and the footer: inserted where it is in the code. The scaped page. There are two commands available: \pagestyle{''style''} will apply the specified style to the current and all subsequent pages. and anything inside is basically Note that \leftmark and \rightmark convert the names to rotated. See the Rotations The first line for the header. one must place the tabular environment in. cannot be fixed this way. Change orientation of floating environment Moreover. chapter or section numbers/names. the chances are good that you need to scale the margins and the font size too. 2. For instance it should look like this: Watch out: if you provide long text in two different “parts” only in the footer or only in the header. Using pdflscape instead of without converting it to uppercase use the following comlscape when generating a PDF document will make the mand: page appear right side up when viewed: the single page that is in landscape format will be rotated. So. respectively. whichever was the formatting of the text. This uppercase. Standard LaTeX accomplishes this with a twostage approach. suppress all styles by inserting a \pagestyle{empty} at the beginning of your document. so that \thispagestyle{} cannot be applied to that page. but you have some contents. fecting the formatting. page size and rotation of a major sectioning commands (\part. which is itself inside the landscape environment. the geometry package comes in handy for specifying new margins for a single page only. however. This package will make \pagestyle{plain} have the same effect as \pagestyle{empty}. Two solutions: • simply write \usepackage{nopageno} in the preamble. Note that these redefinitions must Also. to get a table to appear correctly centered on a land. “On page styles” centered and the page number top right: The second method is for when you are writing a document in portrait. like a large diagram or table that would be displayed better on a landscape page. The following commands placed at the beginning of an article document will set the header of all pages to contain “John Smith” top left. effectively suppressing page numbering when it is used. you might see overlapping text. while the rest Now \leftmark and \rightmark will just print the name of the chapter and section.be inserted after the first call of \pagestyle{fancy}. with the following commands you can define the thickness of the decorative lines on both the header If you use the above code. No actual page dimensions are changed. The values of these two commands are overwritten whenever . for those pages only. Setting it to zero means that there will be no line.6 Plain pages issue If you need to rotate the page so that the figure fits.7 An issue to look out for is that the Margins. In the header and footer definition. l. Style customization The styles can be customized An example is the following: with fancyhdr specific commands. need to make a call to the \fancypagestyle command. The styles supported by fancyhdr: it will insert the first argument of \fancyplain. the author of the package produced this documentation. • fancyplain is the same. You can use multiple selectors optionally separated by a \markboth{Chapter/Section name}{} must be used in. Those two styles may be configured directly. For ultimate • You can also use the command \fancyhead for flexibility. use for a two-sided document: . the \chapter command and its friends do not reheader and \fancyfoot for footer. style pages such as chapters and titlepage.} and the argument can contain all the commands explained before. Choose the one you like most. tively.}. The command to use is \fancypagestyle{plain}{. one can use the package fancyhdr written by Piet van Oostrum. fancyhdr provides three interfaces.}{.. Providing empty values will make the field blank..12. it affects the head etc. the same example as above for two-sided is: • You can use the following six commands. you Both the header and footer comprise three elements each can use the command \fancyplain{. and outer. otherwise you will get a warning and possibly formatting issues. you tend to think in terms of inner use them differently. For a more complete guide.2. Plain pages There are two ways to change the style of plain pages like chapters and titlepage.Here is the complete code of a possible style you could tively. This is effectively saying author name is top outer. They all provide the same features. we recommend you start from scratch. several packages provide a solution: • \fancyhf is a merge of \fancyhead and \fancyfoot. hence the name. LATEX/PAGE LAYOUT 57 a chapter or section command is processed. but you • fancy defines a new header for all pages but plain. toHopefully. and current page number is bottom intuitive: if it has head in it. See below for examples. Alternatively you could redefine the plain style. respecthe package titleps). To begin.RO will refer to the center of the even pages and are to be updated. So will just delete the current heading/footer configuration. There are two additional selectors • an alternative one-stage mechanism is provided by H and F to specify the header or the footer.. The \headheight needs to be 13. To customize LaTeX default style you need the \fancyplainstyle command. the behaviour of the above commands is fairly day’s date is top inner. centre or right).. To do so you should erase the current pagestyle. First you can use the fancyplain style. \sectionmark. to the right side of the odd pages. The selectors are the following: side the sectioning command if header and footer lines so CE. They work in the define \rightmark and \leftmark themselves. etc.. you just Examples For two-sided.. Again. If you omit the H and the F. or \subsyntax is: sectionmark) that is responsible for redefining \rightmark and \leftmark. centre and right respec. hdr commands like \lhead{. To set header and footer style.comma. it’s common to mirror the style of opposite pages. whereas for LaTeX styles you In that case you can use any style but fancyplain because it would override your redefinition. for example to have a really plain page when you want. • fancyhdr will handle the process its own way.. c and r means left. For a clean customization. It provides several commands that allow you to customize the header and footer lines of your document. Customizing with fancyhdr To get better control over the headers. So. but for absolutely all pages. in all the other cases it will use the second argument.} inside fancyaccording to its horizontal position (left. it will set the fields for both. add the following lines to your preamble: You can now observe a new style in your document. The another command (\chaptermark. and outer. except if they are starred -.6pt or more. They call yet same way.will get empty header and footer in the title and at the beginning of chapters.. When LaTeX wants to create a page with an empty style. so you can make your own.in such a case. It has the same behavior of the previous code. Using \fancyhf can make it shorter: obviously. so we'll explain only the first one. If you do so. For instance: • the four LaTeX styles. These commands will only work for fancy and fancyplain. To create a typical two-column layout: text with the whole document. Of course.10 Manual page formatting mand applies to the current page only. it is ments. sets the horizontal space between columns and the defaults to 10pt. to a maximum of 10000. since floats Note the capital letters.12.. LaTeX offers the following: can simply pass the optional argument twocolumn to the document class: \documentclass[twocolumn]{article} 2. you should only do this at the very final stage of Using the twocolumn optional class argument producing your document. without having to use \leftmark or \rightmark. You can try to increase these penalties by multicol outputs balanced columns. and you age to ensure adequate space between the page number would probably want to span them anyway. While this approach is useful. However. sets the width of the vertical rule between columns and defaults to 0pt • \columnsep. very similar to fancyhdr. once all the content is comUsing a standard Latex document class. The starred-version of the \AddToShipoutPicture com. Normally it is possible that widows and orphans appear in LaTeX docuImplements a multicols environment. add a backslash after \thep.12. but there’s also an automatic solution. that you tion for a more detailed discussion.2. Here’s a somewhat complicated example for a two-sided book style: • Column environments can be easily customised locally or globally. whereby the putting following commands in your document preamble: columns on the final page will be of roughly equal If this does not help. the command \columnbreak is used. And recall. greater penalty LaTeX will try more to avoid widows and orphans. It can cess to the current page number. Also. 2. even more. This is not hugely problematic. it’s not desirable to have single lines at the beginning or end of a page.11 Widows and orphans which will give the desired effect. like article. 2. that LaTeX will not get all page breaks looking as good as it could. • \columnseprule. which is quite narrow To force a break in a column. such as figure. uations are called 'widows’ and 'orphans’. such as books. recommended to set this value too high.9 Multi-column pages be necessary to manually tweak the page formatting. You can try to deal with them using manual page possible to mix the number of columns within a doc. therefore.58 CHAPTER 2. mands (e. ument. especially in very long documents. However.of the same width as a column may be too small. which takes a one-stage approach. There may be instances. In typesetting such sitCan support up to ten columns. you can try increasing these values length. See this secand 'of'.8 Page background The eso-pic package will let you print content in the background of every page or individual pages. With the other environments. it is not Vertical rules between columns can be customised. which can be set using \setlength: Alternative packages Other packages for page styles are scrpage2. Using multicol package Page n of m The multicol package overcomes some of the shortcomings of twocolumn and provides the multicol environSome people like to put the current page number in con. as setting it to . LaTeX has a parameter for 'penalty' for widows and orAdditionally. when using references. LaTeX only provides acFloats are not fully supported by this environment.ment. It may. it has limitations: • • • • • In professional books. therefore.12. you plete. the environment can be nested inside phans ('club lines’ in LaTeX terminology). have to run LaTeX an extra time to resolve the crossThe multicol package has two important parameters references.12.g. \begin{figure*} ) which makes the float span like this: all columns.formatting. you can use only cope if you use the starred forms of the float comthe lastpage package to find the total number of pages. and titleps. COMMON ELEMENTS Using \fancypagestyle one can additionally define multiple styles for one’s document that are easy to switch between. which is the As explained before. importing your images into your document using LaTeX is fairly simple. vector graphics But.. The result may be even worse pend on the driver that graphicx is using but. again.13.13.piler you are using. which This package accepts as an argument the external driver to might result in strange behavior. so you tween paragraphs: don't have to worry about this. 2. This means you will have to take care that the images you want to include are in the right format to be included. so we will need some extra help: we have to load the At the beginning of this book.com/blog/line-length-readability 2.. you can use the needspace package to re. the image formats you can use decase with most graphics. So you should always prefer PDF or EPS to Consider the following situation: you have added some PNG or JPG..2 The graphicx package you forgot to provide the EPS versions of the pictures you As stated before. however.net/2. Now you want to compile it in DVI.1 Raster graphics vs.3 Document Options The graphics and graphicx packages recognize the draft and final options given in the \documentclass[.13. without any other processing.2 • dvips (default if compiling with latex). (See Document Classes. once printed. because 2. LaTeX just creates a box with the same size as the image you want to include and embeds the picture. 2. tor format. This is not such a hard task because LaTeX supports the most common picture formats around. changing the driver according to the compiler you are using. the latest version of It also helps to have rubber band values for the space be. a topic which will be discussed in the Creating Graphics part. since the driver is automatically chosen according to the compiler.4 Supported image formats Raster graphics will highly contrast with the quality of the document if they are not in a high resolution. Either create them with some special code.12 Notes and References This page uses material from Andy Roberts’ Getting to grips with LaTeX with permission from the author. I fear for many people the biggest effort will be the process of converting their graphics files.} command at the start of the file. which is what we will be discussing here.to understand better how it works. • pdftex (default if compiling with pdflatex).13. Now we will see which formats we can include and then we will see how to do it. to see your document with any PDF viewer.g. 2. you run latex and you get a lot of errors.2. pictures to your document in JPG and you have successfully compiled it in PDF.12. for diagrams) can export in vec.. just in case you want Alternatively.) Using draft as the option will suppress the inclusion of the image in the output file and will replace the contents with the name of the image file that would have been seen. Using final will result in the image being placed in the output file.this package takes care of everything by itself.]{. Still. we had stated that the same graphicx package in the preamble of our document: LaTeX source can be compiled in both DVI and PDF . [1] How to use Ghostscript [2] http://webtypography. if you are compiling with latex to get a DVI and you want to see your document with a DVI or PS viewer. be used to manage pictures.. • dvipdfm. if you are compiling with pdftex to get a PDF that you will see with any PDF viewer.. want to insert.13 LaTeX/Importing Graphics There are two possibilities to include graphics in your document. Strictly speaking... LaTeX cannot manage pictures directly: in order to introduce graphics within documents. (see Introducing Procedural Graphics) or import productions from third party tools. you don't need to pass any option to the package because the default settings are fine in most of the cases. [3] http://baymard. LaTeX can't manage pictures directly. if you are compiling with latex to get a DVI that you want to convert to PDF using dvipdfm. once you have your images in the right format that is! Therefore. The default is final. In many respects. 2. then the allowed image formats will depend on the comMost drawing tools (e. LATEX/IMPORTING GRAPHICS 59 10000 forbids LaTeX from doing this altogether.1. here are the possible serve some lines and thus to prevent page breaking for options you can pass to the package: those lines.13. You can insert: In order to use more than one option at a time.pdf” high quality if it is created properly.13. .g you should first rotate your graphic (with angle) and then specify its width. Depending on your installation.tex (if you use a LaTeX editor. if files with the same basename exist.Also note that the trim option does not work with XeLator and bit-map images. it’s time to see graphicx in action. This is true. you need to give “writing permissions” to your compiler. only. In any case. ing the image for instance may be done by \scalebox instead. etc. there is The star version of the command will work for . since ep. it is widely used for documents but can be inside floating objects. simply sep• JPG. For a more portable solution. arguments in square brackets are optional. PNG or PDF). as long as you always remember to provide the pictures in two formats (EPS and one of JPG. so only the most common are covered below: have a wider choice.dref{<label name>} might not behave as expected. digital cameras. arate each with a comma. a very common format (even if not as much as JPG). If you are compiling with pdflatex to produce a PDF. it makes it easy for systems like La.age. widely used on Internet.g. you The variety of possible attributes that can be set is fairly large. whose syntax is the following: As usual. you can include images with \includegraphics. After you have loaded the graphicx package in your preamble. but it’s not recommended Tex. Scalage. The labels defined by \cmp• EPS can be used with the help of the epstopdf pack. The only format you can include while compiling with whereas arguments in curly braces are compulsory. it’s time to learn how to include them in our document. COMMON ELEMENTS 2. a directory can have “diagram. pdflatex -shell-escape file. Compiling with latex CHAPTER 2.output is DVI. but they will need a which image file is to be used by pdflatex through the preamble command: lot of disk space. • you may just need to have it installed.jpg' you would include the epstopdf documentation for other compil. TeX to arrange the text and the graphics in the best way. PNG or PDF if the output is PDF).60 without any change. • PNG.it like: This simply imports the image. It supports both vec. you need to load it just after should take precedence. It is also possible to used for previewing on the monitor. JPEG. the standard way • if it does not work. used to store images as well. you can still use both compilers with documents with pictures as well.png” can be are able to manage vector graphics. but with different extensions. The order you give the options They are the best choice if you want to insert photos. matters. Write it without the extension. e. This way the Laing it easy for applications to import postscript-based TeX compiler will look for any supported image format graphics into documents. Additionally.crop dimension as extra parameter: stopdf will need to convert the EPS file into a PDF file and store it. the chemnum-package. Say you had a file 'chick. Compiling with pdflatex which specifies the files to include in the document (in order of preference). with programs that for high-resolution printing. disrupt the layout. this can version) and screenshots. Check examples. latex is Encapsulated PostScript (EPS). where you diagrams (if you were not able to generate a vector placed the code.eps files no need to load it in your document. You can specify store bit-map pictures within EPS. it’s a lossless format and it’s the best choice for Included graphics will be inserted just there. Images can be saved in multiple formats for different purEPS is a vector format—this means that it can have very poses. This is done by Examples adding an option to the compiling command. Here are some command in the configuration options). and graphicx is one of those. as JPG or PNG will provide the same Be careful using any options. As we will see in the floats section. for the latter. E. Because an EPS file declares in that directory and will take the best one (EPS if the the size of the image. For example. if you are working with result using less disk space. as long as you don't use particular packages. The argument in the curly braces is the name of the imThe EPS format was defined by Adobe Systems for mak.5 Including graphics Now that we have seen which formats we can include and how we could manage those formats. they usually allow to modify the OK. you'll probably want to place graphics • PDF. without any other proers. while “diagram. The star command will take the the graphicx package. and the compiler will handle them as “big boxes”. of course. or to simply replace spaces with underscores (“chick picThere are many scenarios where you might want to acture. The \graphicspath command takes one argument.. This has now scaled it by half. an example of how to crop an image should Note that you cannot make the graphicx package search you wish to focus on one particular area of interest: directories recursively. If you wish to be more Using absolute paths. in cases where you need some manual alignment. Figures and Captions.g. which can be useful if you store images centrally for use in many different documents. you can use the package grffile which To rotate (I also scaled the image down): will allow you to use spaces in file names. portable.) Spaces in names 2.The figure environment is not exclusively used for images. And finally.pdf. This is done using the figure environment. The easiest solution is to use the picture environment and then simply use the “put” command to put a graphics file inside the picture. LATEX/IMPORTING GRAPHICS 61 cessing. so the border will be placed the image and scaling it to 80% of the width of the text. Again.7 Images as figures If the image file were called “chick picture. centering 0pt to avoid any padding.13. Under Linux/Unix.2.in the same directory as your main tex file. as the trim operation will not achieve a recursive search using the environment variable TEXINPUTS. ensure file of the text on a page (\textwidth) or the height of the text names do not contain spaces or alternatively if you are on a page (\textheight) (pictures not shown): using PDFLaTeX. i. in this case I set it to universally useful.png”. offering a caption and label.6 2. The following code sample shows You can control the border padding with the an extended use of the figure environment which is almost \setlength\fboxsep{0pt} command.5pt} 2.Note that the border around the picture in the above exple shown there should be a directory named “images” ample was added by using \fbox. For example: latex/required/graphics/grfguide. so the contents of the .png”) company an image with a caption and possibly a crossreference. then you need to include the full filename when importing the im. let’s scale it down: RELATIVE addressing.9 Seamless text integration Graphics storage The command \graphicspath tells LaTeX where to look for images. However. You can control the thickness of the border by adjusting the \setlength\fboxrule{0. there should not be any problem with portability. you can Note the presence of clip. There are still some workarounds though./Snapshots// space to your graphics. Here are some examples (trailing / is required): The drawback of importing graphics that were generated with a third-party tool is that font and size will not match with the rest of the document. while using relative paths (like the third examthis is how to go about it: ple). The following code sample shows the bare minimum required Borders to use an image as a figure. e.8 Text wrapping around pictures command. Trick: You can also use negative trim values to add blank export TEXINPUTS=. which specifies the additional paths you want to be searched when the \includegraphics command is used. and doesn't ofimage by using \fbox: fer much functionality. this is ample of how it would look here!) So.ctan. is not a portable method. can be found in Floats. it is very large (so we won't give a ex.13.png” to “chick_picture. In the third exam. More age: information on the figure environment and how to use it One option is to not use spaces in file names (if possible). It is possible to have LaTeX create a border around your The above code extract is relatively trivial. We will only give a short preview of figures here. by setting it to work without it. 2. tightly around the image.13. along with any other desired LaTeX Please see http://www. See Boxes for more details on \framebox and \fbox. before running latex/pdflatex or your TeX-IDE.13.org/tex-archive/macros/ element. \graphicspath makes your file less specific and give actual lengths of the image dimensions.e.13. the width use directory names containing spaces. One can also specify the scale with respect to the width The fourth example uses the “safe” (MS-DOS) form of the Windows MyPictures folder because it’s a bad idea to of a line in the local environment (\linewidth). Figures and Captions./images//:. See Floats. (But this. multiple files can be converted by placing Tools like Inkscape or Xfig have a dedicated LaTeX ex. like TikZ or PSTricks. PNG. You can also inserts pages of several external PDF documents. use is worth it most of the time. Bourne Shell (Unix) this can be done by: $ for i in *. It is capable of inserting entire pages as $ ps2pdf -dEPSCrop foo.eps 2. This process is completely invisible to the user. imgtops is a lightweight graphics utility for conversions between raster graphics (JPG. subject to change.eps input-e2. . to obtain a PDF from a SVG image you can do: epstopdf $ inkscape -z -D --file=input. which using the key = value syntax) reduces the quality of the fonts. but instead to bitmaps.pdf You can convert EPS to PDF with the epstopdf utility.11 Converting graphics Note Inkscape You should also take a look at Export To Other Formats Inkscape can also convert files from and to several forfor other possibilities.bat port feature that will let you use correct font and size for extension) in the same directory as the images: text in vector graphics..eps is and more pages per one page in any layout (e.13.g.10 Including full PDF pages or try using ps2pdf utility which should be installed with Ghostscript (required for any TeX distribution).the following line in a batch file (a text file with a .eps) do epstopdf %%f For a perfect integration of graphics. mats. When all of the above fails. tool (also see next section): • enable-survey: Activates survey functionalities. included in package of the same name.eps. $ eps2eps input. COMMON ELEMENTS border is the picture as generated by the above code. or a simple macro can be used. done pstoedit . For instance.. do epstopdf "$i". but prints a box and before attempting other conversions. for %%f in (*.13. the fonts are Options for key=val (A comma separated list of options NOT converted to lines. This tool is actually called by pdflatex to convert EPS files to PDF in the background when the graphicx package is loaded. either from the GUI or from the command-line.) This will convert all the fonts to pre-drawn images. In Windows. you might consider procedural graphics capabilities of some LaTeX packages which can then be run from the command line. the Template:LaTeX/package package (when running (pdf)latex with the --shell-escape option) can do this using Inkscape’s pdf+tex export option. on the downside. This is the default. 2x3). The package has several options: Options: eps2eps • final: Inserts pages.Stackexchange See Export To Other Formats for more details. imgtops Several PDFs can be placed table-like on one page. There is a great package for including full pages of PDF files: pdfpages. It lets you draw from within a If epstopdf produces whole page with your small graphics document source.eps (Experimental.) and EPS/PS files. In TeX? -. See more information in its documentation. See How to include SVG diagrams in LaYou can batch convert files using the command-line. it somewhere on it. one can simplify the EPS file • draft: Does not insert pages. which is sometimes desirable when submitting manuscripts for The first command is publication. by using the eps2eps the filename instead. While the learning curve is steeper.62 CHAPTER 2. It is possible to run this from within a LaTeX file. However. See #Third-party graphics tools.svg --export-pdf=output. 2. to crop final PDF. $ epstopdf --gsopt=-dEPSCrop foo. LaTeX handles Sometimes pstoedit fails to create the target format (for example when the EPS file contains clipping information). It works with Scalable Vector Graphics (SVG) files.. .eps output. and can convert between most graphics formats.eps input-gray. For instance. PDFCreator is an open source software that can create PDF as well as EPS files. you may want to convert them before importing them. although it can export to many formats that can be included in LaTeX files. PNG alpha channel Acrobat Reader sometimes has problems with displaying colors correctly if you include graphics in PNG format with alpha channel. to get an XfigWe will not tackle the topic of procedural graphics creeditable file. On Linux it can be achieved with convert from the ImageMagick program: convert -alpha off input.13.2. there is a combined PDF/EPS/PS+LaTeX output option. $ pstoedit -f fig input.eps input-e2.svg of photos. It can run natively under Windows. As we have seen before. From version 0..eps output. such as EPS and PDF.the right spot. similar to that offered by Xfig. These three programs operate much the same way. And to get an SVG file (editable with any vector graphics You should prefer vector graphics over raster graphics for tool like Inkscape) you can do: their quality. Unlike Xfig. or generate tex drawn using the tikz package. Raster graphics should only be used in case $ pstoedit -f plot-svg input.48. Inkscape Another program for creating vector graphics is Inkscape. It installs a virtual printer that can be accessed from other software Vector graphics having a “print. Diagrams of any sort should be vectors. Raster graphics converters • Sam2p (convert) or • ImageMagick (convert) or • GraphicsMagick (gm convert). which can import LaTeX objects. Today there is the svg-package[2] which provides an \includesvg command to convert and include svg-graphics directly in your LaTeX document using Inkscape. PSTricks.” entry in their menu (virtually any proDia gram). lines. Ipe also has various snapping modes (for e2. This can be used for inserting mathematical notation or LaTeX fonts into graphics (which may then be imported into LaTeX documents).2.[1] .eps $ pscol −0gray input. Linux or Mac OS X (with X11). See Introducing Procedural Graphics for that. This can be achieved with the eps2eps of the Ghostscript package and programs: Dia is a cross platform diagramming utility which can export eps images. Ipe represents LaTeX fonts in their correct size on the screen which makes it easier to place text labels at $ eps2eps input. Under Windows.png output. you can convert it to an ed. or intersections) that can be used for geometric constructions. If some tools cannot save in those formats. You may have a look at this extended example too. There are instructions on how to save your vector images in a PDF format understood by LaTeX and have LaTeX manage the text styles and sizes in the image automatically.eps example. PDFCreator • EPS and PDF for vector graphics. LATEX/IMPORTING GRAPHICS 63 To properly edit an EPS file. An extremely useful plug-in is textext. Ipe The Ipe extensible drawing editor is a free vector graphics editor for creating figures in PDF or EPS format. • PNG and JPG for raster graphics. do: ated from within LaTeX code here (TikZ.png Converting a color EPS to grayscale Sometimes color EPS figures need to be converted to black-and-white or grayscale to meet publication requirements.13.fig MetaPost and friends). You can solve this problem by dropping the alpha channel.12 Third-party graphics tools itable format using pstoedit. Sam2p however is the most recent of the three and seems to offer both the best quality and to result in the smallest files. snapping to points. EPS. This method. the quotation marks) and press return. If you pret these textboxes when it opens the figure. enter a LaTeX string in a textbox. etc. offers a good deal more flexibility in draw. One method is to export the drawing as a LaTeX document. want to make mathematical plots.GIMP tionality of xfig on Windows computers. on the Generic Mapping Tools (GMT).Server”. such as Adobe Illustrator. has a graphical user interface. and it is multiplatform. just create the graphics in TpX editor and calls the . this chapter rest is saved in . where the picture should be. spreadsheets has SVG. . which is an open source office suite available for Windows.. lines with arrows can only be drawn at angles that are multiples of 45 degrees. WinFIG is an attempt to achieve the func. CHAPTER 2. This tells LaTeX to inter.of highly customisable plots. User of the xfig User Manual may prove helpful. COMMON ELEMENTS 4. which allows TeX annotations to imported graphics. Use the Edit tool to open the properties of each of Gnuplot those textboxes.. then launch “xterm” to bring up a terminal. On Microsoft Windows systems.pdf_t. If the export was into PS/LaTeX. the For more details on using xfig with LaTeX. the file extension to include would be .TpX file to be processed by LaTeX. you need to Adobe Photoshop first start the “Start X .pstex_t instead of . In your LaTeX document. GIMP. However. Go to File -> Export and export the file as in any format. however. Linux and Mac.org It is also possible to export vector graphics to EPS format using OpenOffice. There are many ways to use xfig to create graphics for LaTeX documents. You can get best results when used along PDF/LaTeX (both parts) or PS/LaTeX (both parts). forms. several curves are not supported. PGF/TikZ. used and can read and write EPS figures. these which can be exported to LaTeX. In this terminal type “xfig” (without It can save to EPS. to run Xfig. maps and a wide range other hand. and change the option on the “Special Flag” field to Special. See Labels in the figures.TpX Other tools file from latex file by command \input{. this will require a fast Raster graphics internet connection and about 2 gigabytes of space on your computer. Make sure to include packages graphicx and color in the file. PDF export 2. suffers from various drawbacks: lines can be drawn only at angles that are multiples of 30 and 45 degrees. It can save to EPS and PDF. and FreeHand are commonly Xfig is a basic program that can produce vector graphics. Here’s how it’s done: 1. we use \input. such as a mathematical formula. ing. use the following. where “test” is replaced by the name of the image: Observe that this is just like including a picture. then Gnuplot can save 3. Plots and Charts Generic Mapping Tools (GMT) Exporting a file as PDF/LaTeX or PS/LaTeX.org Draw. Create the drawing in xfig.Gnuplot.TpX}. Wherever you need LaTeX text. Alternatively. It can be installed on products are limited to Windows and Mac OS X platUnix platforms. except that rather than using \includegraphics. With Cygwin. OpenOffice. 5. Gnumeric Gnumeric. Xfig Commercial vector graphics software. Geometric objects are saved into . CorelDRAW.64 lpic Yet another solution is provided by the lpic packages . however. depending on whether you are using pdflatex or psmatplotlib latex to compile your file. Xfig can only be installed using Cygwin-X. like this: TpX And you're done! Vector editor TpX separates geometric objects from text objects. producing scientific graphics since 1986.PDF file. with the \usepackage command right below the \documentclass command. right. LaTeX attempts to place it What we need is a way of defining figures. just having a picture stuck in between para. This can be changed by moving Editing EPS graphics the Table or Figure definition to an earlier or later point in the text. 65 present page. Figures To create a figure that floats. middle.14 LaTeX/Floats. and to be able to cross-reference. Once this possibility is exhausted. statistical and scientific figures. and to help when you really don't want the object here just now. Figures and Captions 2. In is formatted as ASCII. On the other hand. but they're very complicated. “How to include an SVG image in LATEX”. or wherever the designer specifies).scribes the algorithm : graphs does not look professional. or leaves them to the end of the chapter slightly. • If a float is encountered. and a typical example is with its positioning of figures. positioned in a part of the page to themselves (top. FIGURES AND CAPTIONS matplotlib. LaTeX examines this holding queue and tries to empty it as best as possible. converting any image to EPS is very simple. graphics content can be imported control automatic floating. But Authors sometimes have many floats occurring in rapid sometimes you want to edit or retouch these graphics files.13. so it’s not worth considering them. left. C. http://ctan. but separate entities. may also be able to so that they intrude neither on the thread of your arguimport EPS files for subsequent editing. but anything further becomes cumbersome. [2] Philip Ilten. LATEX/FLOATS. there may be times when you disagree. then LaTeX places the float into a holding queue to be reconsidered when the next page is started (but not earlier). “The svg-package on CTAN”. the float is moved to the top of the next page. but you can define new ones of your own (see Custom floats below). use the figure environment. it will . we want a way of adding captions. succession. into LaTeX from outside programs as EPS files. ctan. In a text editor. with PDF and EPS export. LaTeX by default recognizes “table” and “figure” floats. If there is R. not enough room on the current page. The skill is to space them out within your text tor graphics editors.mirrorcatalogs. It would also immediately according to its rules (detailed later) be good if LaTeX could apply principles similar to when • if this succeeds.com. The previous section mentioned how floats are used to allow LaTeX to handle figures. LaTeX stacks them all up and prints them tosimple operations like replacing strings or moving items gether if possible.14.org/tex-archive/graphics/svg.1 Floats Floats are containers for things in a document that cannot be broken over a page. and LaTeX will decide when typesetting your document which of your supThe previous chapter introduced importing graphics. mirrorcatalogs. the importing process set pages. while maintaining the best possible presentation. Floats are not part of the normal stream of text. http: //www. The placement specifier parameter exists as a compromise. 2. For starters.org. well.ctan. There are some tricks to be able to import formats other than EPS into your DVI document. However. 2.com/info/svg-inkscape/ InkscapePDFLaTeX. plied specifiers it thinks is best. which raises the problem of how they are supAn EPS file can be edited with any text editor since it posed to fit on the page and still leave room for text. On the other hand there is a PGF export also. These are simply possibilities. This is where floats come into play. This approach ment or discussion. However. They always have a caption describing them and they are always numbered so they can be referred to R from elsewhere in the text. Floats are there to deal with the problem of the object that won't fit on the • if this does not succeed. and its purpose is to give the author a greater degree of control over where certain floats are placed. For this it will first try to generate as many float pages as possible (in the hope of getting floats off the queue). like Inkscape.13 Notes and References [1] Johan B. or by adjusting some of the parameters which As described above. What you do with these placement permissions is to list which of the options you wish to make available to LaTeX. Frank Mittelbach de[2] However. the float is placed and that deit arranges text to look its best to arranging pictures as cision is never changed. Engelen. may occassionally modify the original EPS image.2. Vecin protest. LaTeX automatically floats Tables and Figures.pdf. you can achieve this case. plotting library written in python. • Once a page has finished.14. bottom. depending on how much space is left on the page at the point that they are processed. nor on the visual balance of the typealso for easier editing. 2 Keeping floats in their place The placeins package provides the command \FloatBarrier. In the process. so you do not need to include this within the caption text. This however means that there is no caption available for into be treated as a float. it may encounter further floats. \FloatBarrier may also be useful to prevent floats intruding on lists created using itemize or enumerate.14. mand{\figurename}{Example} in the figure contents. 2. You have to write the following once It is sometimes desirable to have a caption appear on the at the beginning of the document: side of a float. This can. Let’s give a quick reminder here.horizontally. Use \listoftables to add a list of the tables in the beginning of the document. and outputs all the float environment. use \renewcom. The caption used for each figure will appear in these lists.e. it may environment within a table environment. The location of the caption is traditionally underneath the float. Typically the short description is for the caption listing. • After that. Side captions Figures with borders It’s possible to get a thin border around all figures.g.14. To change the name used in Note that the command \reflectbox{. e. \caption[''short'']{''long''} which is used for the List of Tables or List of Figures. and the long description will be placed beside the figure or table.14. wrap the tabular In some types of document (such as presentations)..66 CHAPTER 2. re-adding them to the holding queue once more). The \caption command also has an optional parameter. Fortunately. Try out the following example to demonstrate this effect: Use \listoffigures to add a list of the figures in the beginning of the document. This can be set by loading the package with the option [section] (\usepackage[section]{placeins}). All you \clearpage is encountered. Therefore. The float package provides the H option to either places them or defers them to a later page (i.} flips its content the caption from Figure to Example. which stops them from floating. which can be used to prevent floats from being moved over it. because you may not want all tables ure environment. respectively. The package even provides an option to change the definition of \section to automatically include a \FloatBarrier. be useful at the beginning of each section. floating environments. need to do is use the \caption{''text''} command within relaxes all restrictive float conditions. and only a “one-liner” is desired . rather than above or below. However. page(s).easy to suppress by just placing the caption text in the Figtions are necessary. It is always good practice to add a caption to any figure or • If the end of the document has been reached or if a table. If you place it before. In some special cases LaTeX won't follow these positioning parameters and additional commands will be necessary. for tables you wish to float. The sidecap package can be used to place a caption beside a figure The border will not include the caption. It looks at all the remaining floats and document. This is particularly useful if the caption is long.. and page numbers that they appear on. along with the figure numbers. LaTeX will automatically keep floats in the holding queue by placing them on float track of the numbering of figures. and the endfloat Captions can be listed at the beginning of a paper or report in a “List of Tables” or a “List of Figures” section by using the \listoftables or \listoffigures commands. The tabular environment that Unnumbered captions was used to construct the tables is not a float by default. without enclosing it in a Caption. then the caption will appear above the float. Floating tables are covered in a separate chapter.. LaTeX starts a new page.4 Lists of figures and tables 2. it is up to you to therefore insert the caption command after the actual contents of the float (but still within the environment). this is very simple in LaTeX. clusion in a list of figures. or table. if one needs to specify an alignment other than centered for a float that sits alone in one page[3] . The following example demonstrates this for a figure by using a SCfigure environment in place of the Tables figure environment.. This is You may feel that it is a bit long winded. like this: not be desirable for figure captions to start Figure:. but such distinc. for example.3 Captions this page. The flafter package can be used to force floats to appear after they are defined. COMMON ELEMENTS next try to place the remaining floats into top and package can be used to place all floats at the end of a bottom areas. it starts processing document material for 2. the \vspace{. [4] should refer to the program pdfcrop. These packages gives the author the ability to have subfigures within figures.) A word of warning: Wrapping figures in LaTex will In this case it may look too shrunk. you can use any unit you want. the width of the figure.TeX installations. If you get an error when the consider using the command \centering instead. Subfloats A useful extension is the subcaption package which uses subfloats within a single float. you could use a layout with two columns for your You can use intextsep parameter to control documents and have no text-wrapping at all. or subtables within table floats.14. Subfloats have their own caption.) ample. including pt. let LaTeX do the work for you! The “wrap” is slightly bigger than the picture. 2. thus removing some Although not normally the case in academic writing. use \protect in front of the \laAnother possibility is adding space within the float using bel command. so the compiler will not return any strange warning and you will have a small white frame between the image and the surrounding text. An ex. An example will best illustrate the usage of the subThe wrapfig package can also be used with user-defined caption package: . you will see the image over the text. LATEX/FLOATS. IEEETran and ACM SIG) that are not compatible with subcaption. spaces the way you like. Here is an example of this us. The uppercase-character allows the figure to float.space that can be avoided if \centering is used instead.. while To remove the white space from a figure once for all.14. This then gives you access to: There is also an alternative to wrapfig: the package floatflt There are overall eight possible positioning targets: . you might need to install additional packages. Using \vspace tends to move the caption author may prefer that some floats do not break the flow of relative to the float while the [lineheight] argument does text. an white space. etc. It specifies the height of the figure in numIf the label picks up the section or list number instead ber of lines of text. included in most The width is. Note that \setlength\intextsep{0pt} wrapfig may not come with the default installation of LaAlternatively you might use the picins package instead TeX. in.too little) white space on the top or bottom. you can simply make use of the optional argument tion for more information.} command.6 Wrapping text around figures gument.floats with float package. mm. put the label inside the caption to center adds some extra white space at its top and bottom. but you can manage require a lot of manual adjustment of your document.5 Labels and cross-referencing Tip for figures with too much white space Labels and cross-references work fairly similarly to the It happens that you'll generate figures with too much (or general case . We did it in terms of the text width: it is always better to use relative sizes in LaTeX. See below in the section on cusage: tom floats. In general. it will add a negative space. to center the image. we just added some negative vertical spaces to shrink everything up: is significantly narrower than the text width. you must first add this to the preamble: without the excess white space out of the box without any hand tuning. FIGURES AND CAPTIONS 67 in the figure/table listing. but instead allow text to wrap around it.7 Note that we have specified a size for both the wrapfigure environment and the image we have included. Before you make the choice of (In this case. and an optional global caption. it is best not to add There are several packages available for the task.see the Labels and Cross-referencing sec. ample: You can also allow LaTeX to assign a width to the wrap by setting the width to 0pt. of the wrapfig package which produces a correct version To use wrapfig. The subfigure and subfig packages are deprecated however they are useful alternatives when used in-conjunction with latex templates (i. one the lowercase version means “exactly here”. Also remember that the environment of the figure number. additional space above and below the figure: Anyway..14. but none any space at all: let LaTeX do the formatting work! of them works perfectly.14. the this effect only looks decent when the figure in question code is exactly the one of the previous case. label is inside the caption. [lineheight]. If you provide a negative ar2. Here is an example using the \vspace command. but if you don't keep the image smaller than the “wrap”. You can change it to get a better result.2. The center environment adds extra make sure you have considered all the options. \begin{wrapfigure}{l}{0pt} 2. we will look at the package wrapfig. (Obviously. not. In such a case. of course. the problem is the use of \begin{center} including figures with text wrapping in your document. The argument is the size of the space you want to add.e templates for journals from Springer and IOP. For ex. ensure correct numbering. that are {figure*} and {table*}.g. If you wish to alter this. • ext . Latex writes the captions to this file.9 Custom floats If tables and figures are not adequate for your needs.the caption appears above the float. followed by a final horizontal rule. it will automatically 1. then You will notice that the figure environment is set up as you always have the option to create your own! Examusual. wider than 0. and \. This effect can be added manually. using the optional specifier [b].ples of such instances could be source code examples. Default is [tbp]. 2.the file name extension of an auxiliary file for the list of figures (or whatever). h still does not work. which are placed in between \bewhere: gin{subfigure} and \end{subfigure}: • type . of several commands. A bad point of those environments is that they can be placed only at the top of the page or on their own page. Declare your new float using: Horizontal spaces between figures are controlled by one \newfloat{type}{placement}{ext}[outer counter]..68 CHAPTER 2. so you will get no overlapping. If you try to specify their position using modifiers like b or h they will be ignored. otherwise you will see the image overlapping with text. p. \.the normal style for Latex floats. b.t. you started your document with something like \documentclass[twocolumn]{article}). the package fixltx2e [5] should be used (e.14. you need to use: maps. • ruled . 3.e. scribed in Placement).the normal style for Latex floats. The package float where the label is inserted. The default name that appears at the start of the caption is the type. ate permitted placements. with rules immediately above and below.8 Wide figures in two column documents If you are writing a document using two columns (i. • boxed . otherwise. Those “starred” versions work like the standard ones. Changing float style can be issued with \floatstyle{style} (Works on all subsequent \newfloat commands. but the caption is always below the content. • plain . for example 'chapter'. • A non-breaking space (specified by ~ as in the example above) can be used to insert a space in between • placement . However. . must be inserted before \newfloat to be effective). • plaintop . but they will be as wide as the page. document by putting the newline command (\\) before the figure you wish to move to a newline. • outer counter . For each subfloat. subcaption will arrange the figures or tables side-by-side providing they can fit. \quad.is your friend for this task. For a program float example. use \floatname{type}{floatname} 4. and not within environment will provide the global caption. You may also use a table environment for subta. one might therefore If you intend to cross-reference any of the subfloats. 2. in this instance. COMMON ELEMENTS To prevent the figures from being placed out-of-order with respect to their “non-starred” counterparts. 'program'. \caption outside the subfigure.the new name you wish to call your float. Add \usepackage{float} to the preamble of your shift subfloats below. or h (as previously dethe subfigs. Add \usepackage{dblfloatfix} to the preamble in order to alleviate this problem with regard to placing these floats at the bottom of a page. \usepackage{fixltx2e}). but the caption is always above the content. the only solution is to use the “starred” variants of the floating environments. If you really have to use such wide elements. see wish to create a float named program. where letters enumer• Math spaces: \qquad. All commands to set up the new float must be placed in the preamble. you might have noticed that you can't use floating elements that are wider than the width of a column (using a LaTeX notation. or bles.a box is drawn that surrounds the float.14.the presence of this parameter indicates that the counter associated with this new float should depend on outer counter.5\textwidth). and the caption is printed below. therefore. the document. • Generic space: \hspace{''length''} • Automatically expanding/contracting space: \hfill 2. Then the float contents. and allows for drawing a white background under the typeset material to overshadow the graphics.tex. Newly created floats with \newfloat can also be used in combination with the wrapfig package from above.14. If you load it. \captionformat and \setcapwidth. use the caption package. . including new lines. However these definitions have limited effect on newly created float environments with the wrap2.pdf [5] http://www. It does so using the package hyperref.g. Alternatively. its name is fairly intuitive! LaTeX will reproduce everything 2.14. you will have the possibility to include interactive external links and all your internal references will be turned to hyperlinks. as this option “pins” the 2.15. one should be careful when embed.ctan. It is good for source code. thus allowing to add TeX annotations to imported graphics. by Frank Mittelbach [3] http://tex. TikZ is a front-end to a drawbelow illustrates. the hard work and tweak the page layouts in order to get While this is useful. title.14.org/tex-archive/macros/latex/contrib/ float/ [2] Float environment positioning.ac. which floats in the text on the right side of the page and is complete with caption. The verbatim environment is an environment that is already part of Latex.ac. One solution might be to use the [H] option (not any other) on the inner float.uk/cgi-bin/texfaq2html?label= 2colfltorder This page uses material from Andy Roberts’ Getting to grips The KOMA script packages have their own caption cus. etc. The compiler pdflatex makes it possible to create PDF files directly from the LaTeX source. that was hopefully see how much easier it is to let LaTeX do all made just for it. In particular. The link given also points to the packages contain other information about a document such as the psfrag and overpic. an index file with the extension . It defines a convenient interface to put TeX over included graphics. resulting format is PDF. and the only way to introduce A very similar package. etc. Finally. It is a better alternative for labels inside of graphics. For example.lob and a customization of the float’s visual layout: Caption styles To change the appearance of captions. you do not have to change text size when rescaling pictures.g. useful when the See this page for more information on counters. There is a LaTeX package lpic to put LaTeX on top of included graphics. tomizing features with e.with LaTeX with permission from the author. and all LaTeX power is available for labels. spaces. numbering.15 LaTeX/Hyperlinks fig package.1 Hyperref The package hyperref[1] provides LaTeX the ability to create hyperlinks within the document. the error LaTeX takes care of all caption and reference numbering is a great time saver.stackexchange.at/packages/tex/macros/latex/ contrib/wrapfig/wrapfig-doc.12 inner float to the outer one. In particular PDF supports hyperlinks. Moreover. you can redefine the \thefigure command: LaTeX enables typesetting of hyperlinks. not in outer par mode may occur. PDF can is pinlabel . 2.2. and the hyperlinks can be folnote that the caption2 package has long been deprecated. with somewhat different syntax.univie. \captionabove.your figures in the best place. lowed. but if you want to introduce a lot of code That concludes all the fundamentals of floats. to make all caption labels small and bold: Notes and references [1] http://www. and PDF supports more features than DVI. them in LaTeX is using hyperref. which can be edited using this same A much more complicated package which can be used package. You will you might consider using the listings package. As always.com/questions/28556/ how-to-place-a-float-at-the-top-of-a-floats-only-page [4] http://ftp.15. the fact that ding the float within another float. It works with pdflatex and also with standard “latex” used with dvips and ghostscript or dvipdfm to build a PDF file.. the following code creates a floating text box. ing library called pgf (which is used to make beamer for instance).10 Labels in the figures 2. It can be used to label figures by adding text An example document using a new program float type: nodes on top of an image node. E. the author.11 Summary you give it. Although not introduced so far. LATEX/HYPERLINKS 69 Float styles can also be customized as the second example in the same way is TikZ. stackexchange. if you click on it. ing links pointing outside the document. too. see Colors). note that the \nolinkurl command documents: just keep on using the standard \label-\ref is fragile and if the hyperlink is inside of a moving argusystem (discussed in the chapter on Labels and Cross. or the \hypersetup command can be used as folopened pointing at my_url. Note that. list of figures/tables and index will be made of hy. etc. (s)he can easily send you an email.1 the following example would result in Hyperlink and Hypertarget It is also possible to create an anchor anywhere in the document (with or without caption) and to link to it. links to local files.15. Following http://tex. hyperref can be used to provide mailto links.8 Big list at hyperref-manual at tug. is displayed at the target location and link location respectively.clicks on it. with hyperref those “connections” will become links and you will be able to click on them to be redirected to the right page.the location of your current document. Note the "*" after \ref where the target caption and link caption are the text that for avoiding nested hyperlinks./ is the current directory. Options have to be in the form: exactly the same format has to be used if you pass those options to the package while loading it. It won't affect the way to write your When using this form.ment. and links to anywhere within the PDF output file. Commands It is possible to use relative paths to link documents near The package provides some useful commands for insert.Local file Files can also be linked using the url or the tents. if 2. see the official documentation). If the lemma labelled as mainlemma was number 4. while the others may only assigned to named colors (which you can define your own. Copy it in your doc- . Just load the package in the preamble: abilities into the displayed text. in order to do so. The standard settings should be fine for most users. that explicit RGB specification is only allowed for the border colors (like linkbordercolor etc.. separate them with a comma. your browser will be opened pointing at it. Here is an example: lows: Both point at the same page.) \hyperref Usage: This will have the same effect as \ref{label_name} but will make the text link text a full link.com/questions/ 46488/link-to-local-pdf-file the version with url does not always work. but if you want to change something. instead. . while in the second case the URL will be hidden. like this: Here is a list of the possible variables you can change (for the complete list. The two can be combined.3 Customization you click on it. referencing)./ is the previous directory. use[2] This will automatically turn all your internal references into hyperlinks.). In order E-mail address A possible way to insert email links is to speed up your customization process. the link stored using \href will not be shown anywhere in the document. if the reader The basic usage with the standard settings is straightfor. Or.the package when it is loaded (the standard way packages ment font but. your browser will be work). To create an anchor. You simply have to add the string run: perlinks. if you print your document.15. The default values are written in an upright font: Checkout 3. use: and to link to it. that is also possible. Please note. it must be preceeded by a \protect command.org Apart from linking to websites discussed above. \url Usage: It will show the URL using a mono-spaced font and. here is a list with by the variables with their default value. to incorporate the url package’s formatting and line breaking ward.href commands. but in the first case the URL will be shown. but href does. use the standard Unix-like notation (. Other possibilities you can pass as many options as you want. The hyperlinks will not show-up if you are at the beginning of the link string: working in draft mode.1. Options can be passed as an argument of It will show the string description using standard docu.70 CHAPTER 2. Moreover the table of con. use: with the hyperlink as expected.2 Usage It just shows your email address (so people can know it even if the document is printed on paper) but. COMMON ELEMENTS 2. There are several variables and two methods to pass those \href Usage: to the package. which are not printed: to stop working. duplicate igPackage hyperref Warning: Token not allowed in a PDFnored DocEncoded string: appear when a counter gets reinitialized. You can use color frames. LATEX/HYPERLINKS 71 ument and make the changes you want.. there is a short explanations of their meaning: “duplicate has been ignored. which replaces the offendprior to the first chapter of the book. The important point is that although the numbers are not visible.. c. lines.tice such problems and put up a warning: tifier (name{page. Messages like the following The error disappears. Latex Error: using the breakurl package to split the url over multiple Paragraph ended before \Hy@setref@link was complete. which will give the title page back references inside bibliography: the label page. here are sists of putting plainpages=false into the hyperref options. you can use this: counter is reset. iv. appear when you use \label inside an align environment. Possible solution: Add the following to your preamble: Problems with bookmarks The text displayed by bookmarks does not always look like you expect it to look. the line identifiers for the second and follow-on different from the erroneous line. or make links black: The best solution is to give each page a unique name by using the \pagenumbering command: When you just want to provide information for the Document Info section of the PDF file. Next to the vari.7. use \pagestyle{empty} . 2.a. \end{eqnarray*} (which is an unnumProblems with Links and Equations 2 bered equation array).1. Some text If your url’s are too long and running off of the page. it By default. some smaller but useful examples. i. 5. It resets the page number counter to 1 text string for the bookmarks. 4. URLs are printed using mono-spaced fonts. e.2. Another more flexible approach is to set the counter to something negative: duplicate ignored appear. If you don't like it and you want them to be printed with By changing the page numbering every time before the the same style of the rest of the text. won't make a difference to the output. for example by using the command \mainmatter provided by the book You can now work around this problem by providing a document class. if you use instead this form: ! Runaway argument? {\@firstoffive }\fi ). 2.15. Because bookmarks are “just text”. The problem can also occur with the algorithms package: because each algorithm uses the same line-numbering Beware that the shown line number is often completely scheme. Possible solution: Place the amsmath package before the The problem occurs with equation identifiers if you hyperref package. But as the preface ing text: of the book also has a page number 1 all links to “page Math expressions are a prime candidate for this kind of Problems with Links and Pages . When creating PDFs This unfortunately only helps with the page counter..15. each page gets a unique name. b. colored links are not a good thing as even more radical solution is to use the option hypertexthey end up in gray in the final output. Hyperref will normally no! pdfTeX warning (ext4): destination with the same iden.7. ! pdfTeX warning (ext4): destination with the same identifier (name{ equation. This is especially important in a multicolumn environment where the line width is greatly shortened. v. \begin{eqnarray*} . try from your document here (\ref {re\ETC.4 Troubleshooting Problems with Links and Equations 1 Messages like the following If you don't want the page numbers to be visible (for example. \pagestyle{plain}. algorithms will be duplicates of the first.. use the *'ed form instead. . hence the notice that ables. each page will have a unique name.1” would not be unique anymore. 3. use \nonumber on every line of an eqnarray environment. much fewer characters are available for bookmarks Messages like the following: than for normal LaTeX text. In this case.” The counter measure conIf you don't need such a high customization.. ii.g. the pages would be numbered a. An destined for printing. but this will cause the page links in the index to read. Since the page number is suppressed. when you have made something like which will give the first pages a unique negative number. making it difficult names=false.30}) has been already used. during the front matter part). In this case. iii. as well as enabling Another solution is to use \pagenumbering{alph} before the command \maketitle.1}) has been already used. 1. and remove the now unnecessary \nonumber commands.. One do not depend on what you are referencing. \label{marker} you give the object you want to reference a marker. you will need to manually include \capstart in those environments.72 problem: CHAPTER 2.tex User Group. url packages”. A workaround exists by using the package hypcap with: WARNING! Please note that if you have activated the “draft"-option in your \documentclass declaration the hyperlinks will not show up in the table of contents!!! Be sure to call this package after loading hyperref. This will give you a much larger selection of characters to pick from when using \texor. must always be set after the caption. upon clicking the user will be If you write your document in unicode and use the unisent to the first frame.5 Notes and References [1] Hyperref package webpage in CTAN [2] “Email link with hyperref. . files formulas). Instead of sending the user to the desired label.to label your frames. COMMON ELEMENTS Problems with footnotes and special characters which turns \section{$E=mc^2$} to E=mc2 in the bookmark area. . incode option for the hyperref package you can use unicode stead of using characters in bookmarks. the figure or table itself will not be visible upon clicking the link[4] . The command \textcolor Problems with Beamer gets ignored but its argument (red) gets printed.com/group/comp.15. you can see it like a name. which. you need to use the option breaklinks when first declaring: This will then cause the links in the \listoffigures to word wrap properly.: Problems with long caption and \listoffigures or long title There is an issue when using \listoffigures with hyperref for long captions or long titles.g. Color changes also do not travel well into See the relevant section. use pdfstring. and they are: can therefore encounter errors like ! Argument of \Hy@setref@link has an extra }.16 LaTeX/Labels referencing and Cross- 2. The commands to be used tex changes when you include the hyperref package.google. This prints the number that was asproblem is to delete all the files that latex uses to get refsigned to the object. e. when the document is typeset with hyperref for the first time and these files already exist.toc. This happens when the captions (or the titles) are longer than the page width (about 7-9 words depending on your settings).dating it whenever necessary.tex/browse_thread/thread/ae160fd2fc5680a5/ 71a5a7c7bfceb3cb?lnk=gst&q=email+url+hyperref# 71a5a7c7bfceb3cb. and reference it with the result will be much more legible. If you Using the command use: is broken when pointed at a label. If you use the wrapfig package[5] mentioned in the "Wrapping text around figures" section of the “Floats.16. Since the caption is usually below a figure or table. Problems with tables and figures Problems with draft mode The links created by hyperref point to the label created within the float environment. bookmarks: produces the string “redRed!". and LaTeX will take care of numbering. http://groups. text. Retrieved 2008. erences right and typeset again. To fix this. The solution to the \ref{marker} you can reference the object you have marked before. figures.ctan. or other similar packages that define their own environments. [3] Other possible values are defined in the hyperref manual [4] http://www. 2.text. Figures and Captions” chapter.org/tex-archive/macros/latex/contrib/ hyperref/README [5] Wrapfig package webpage in CTAN 2.lof and similar Another good point of LaTeX is that you can easily reference almost anything that is numbered (sections. comp. A simple work around exists. as previously described.1 Introduction Problems with already existing . upThe format of some of the auxilliary files generated by la. you might get a bit confused after you have introduced a lot of references. the Following this convention.16. Some packages. bel is then referenced in a different section. 2. LaTeX will calculate the right numbering for the objects in the document. Using the command \pageref{} you can help the reader to find the referenced object by providing also the page number where it can be found. This way. it is a twostep process: first the compiler has to store the labels with the right number to be used for referencing. you have to compile your document twice to see the proper output. If you reference a marker that does not exist.. if you change the order of the objects. You could write some. but the compiler will inform you printing on the screen at the end of the compilation: You could place the label anywhere in the section. If you compile it only once. You are better off describing what the object is about. Then LaTeX will replace the string "\ref{marker}" with the right number that was assigned to the object. Another suggestion: try to avoid using numbers within labels. LATEX/LABELS AND CROSS-REFERENCING 73 \pageref{marker} It will print the number of the page document. you will not have to rename all your labels and their references. then it has to replace the \ref with the right number. As you may have noticed reading how it works.16. LaTeX will use the older information it collected in previous compilations (that might be outdated).2 Examples Here are some practical examples. when you use references. rely on this meta information. Sections \section{Greetings} \label{sec:greetings} Hello! \section{Referencing} I greeted in section~\ref{sec: greetings}.5\textwidth]{gull} \caption{Close-up of a gull} \label{fig:gull} \end{figure} Figure~\ref{fig:gull} shows a photograph of a gull. The laRerun to get cross-references right. but it . however. You are not obligated to use these prefixes. you can use the showkeys package. floating environment.} will return the respective fig/table number. It is common practice among LaTeX users to add a few letters to the label to describe what you are referencing. That is why. Note how LaTeX Warning: Label(s) may have changed. If you want to be able to see the markers you are using in the output document as well. but you will notice that they are all the same because they all use the same commands.. etc. but these prefixes become increasingly useful as your document grows in size.. as suggested before. You can use any string as argument of \label{. this can be very useful while developing your \ref{. the marker starts with sec:. in order to avoid confusion. Here is an example: \begin{figure} \centering \includegraphics[width=0. the marker you have used to label the object will not be shown anywhere in the document.2. such as fancyref. Since you can use exactly the same commands to reference almost anything.Pictures thing like: You can reference a picture by inserting it in the figure See figure~\ref{fig:test} on page~\pageref{fig:test}.. The tilde (~) indicates a non-breaking space. tion. the label of a figure will look like \label{fig:my_figure}. When a label is declared within a float environment. and it will replace "\ref{unknown-marker}" with "??" (so it will be easy to find in the document). it is better to place it immediately after the beginning of the section. For more information see the Packages secwhere the object is. the compilation of the document will be successful but LaTeX will return a warning: LaTeX Warning: There were undefined references.}. it you have to use an environment that adds numbers. as in CHAPTER 2.5\textwidth]{gull} \caption{Close-up tag The \tag{eqnno} command is used to manually set equation numbers where eqnno is the arbitrary text string of a gull} \label{fig:gull} \end{figure} you want to appear in the document. You label an object on page 23 and the \vref output happens As you can see. Therefore the table or figure will numberwithin The amsmath package adds the not be visible. according to the context and the document class. Otherwise. \begin{figure} \centering \includegraphics[width=0. This command has to be used very carefully. whether you are using amsmath or not. ning of the math mode. ate a PDF.things.5 x + 6 = 0 \end{equation} \begin{equation} x_1 = \frac{5 + \sqrt{25 . a plain number as 5. It outputs more than one word. the current section or list number instead of what you in. within{equation}{section} in the preamble will prepend the caption package: the section number to all equation numbers. it will pick up fore any reference. but it adds parentheses so that. If it were on page 23. but sometimes hard-coded equation numbers might offer a useful work-around. This command is used exactly like the basic \ref. for each case.for more information see the amsmath documentation. Note also the eq: prefix in the label. respectively. it would print like the basic ref. the label for any picture or table can go within the \caption{} command. When declared outside. \usepackage[hypcap]{caption} Formulae Here is an example showing how to reference formulae: \begin{equation} \label{eq:solve} x^2 . the label is placed soon after the begin. that is the best choice for one-line formulae. if the object is far away it will print something like “5 on page 25”. and . the algorithm can get confused and cause a loop. This may for inIssues with links to tables and figures handled by stance be useful if you want to repeat an equation that is hyperref In case you use the package hyperref to cre. which produce multi-case equations with a separate equation number and a separate equation number plus a letter. This can be useful to help the reader distinguish between formulae and other Fixing wrong labels The command \label must ap. COMMON ELEMENTS of the times you will be using the equation environment. but it is on both.e. It is normally better to use labels. Most would print “on the previous page”. e. it is \eqref{}. Let’s make an example. it can use more refined sentences like “on the next page” or “on the facing page” automatically.used before.4 \times 6}}{2} = 2 \end{equation} and so we have solved equation ~\ref{eq:solve} cases The cases package adds the \numcases and the \subnumcases commands.4 \times 6}}{2} = 3 \end{equation} \begin{equation} x_2 = \frac{5 . If the object is close. without the need to repeat the word “formula” bepear after (or inside) \caption. To be completely safe. tended. If the object to be referenced is in the same page.3 The varioref package The varioref package introduces a new command called \vref{}. it adds the page number automatically.to stay between page 23 and 24. if it were on page 24.g. it will give the section number. it works just like \ref. i. but it has a different output according to the context. \caption{Close-up of a gull\label{fig:gull}} eqref The amsmath package adds a new command for See the Floats. It works exactly like \ref{}.\sqrt{25 . \tag{\ref{eqn:before}}.74 must occur after the caption. it will print (5). instead of printing about the figure and related environments. 2. which is always below the table or figure itself[1] . If you want the link point to replaces the simple countera by a more sophistiFor example \numberthe top of the image you can give the option hypcap to cated counterb. Figures and Captions section for more referencing formulae. In this case.countera. In order to reference a formula.16. Its output can be changed as desired. if it is above the pointer and one has to \numberwithin{countera}{counterb} command which scroll up in order to see it. the links to tables or figures will point to the caption of the table or figure. so it may happen its output falls on two different pages. so situations like these are likely to happen. the command \autoref{sec:intro} would create a hyperlink to the \label{sec:intro} command. the label points to the current section. Assuming that this label is pointing to a section. Input: \section{MyFirstSection} \label{sec:marker} \section{MySecondSection} In section~\nameref{sec: marker} we defined. You could think that this happens very rarely. on which n is the current section number.org/tex-archive/macros/latex/contrib/ hyperref/README to the current section. as mentioned above. when starting sentences). if you put a label after closing a figure. For example.4”. Note that. be used for other pur. as in: Anchor manual positioning When you define a \label outside a figure. for example. Output: autoref In section MyFirstSection we defined. the hyperlink would contain the text “section 3. This command creates a reference with additional text corresponding to the target’s type. The alternate \labelcref{} command works more like standard \ref{}. not only the number will refer [1] http://www..2. References to pages are This renaming trick can. while there’s an \autoref* command that produces an unlinked prefix (useful if the label is on the same page as the reference).2. LATEX/LABELS AND CROSS-REFERENCING this may cause some strange errors at compiling time that are very hard to be fixed. Note that you can disable the creation of hyperlinks in hy. but the name will refer to the previous environment with a counter. but since the capitalization of autoref names was chosen by the package author. relaxAppendix~{}\char"005C\relax{}ref*\ protect\char"007B\relaxsec:intro}}. If labels are enu• If you would like a hyperlink reference.16. and convert it to vref when the document is close to its final version. For example. and then making adjustments to fix possible problems. but inserts text corresponding to the section name. for instance. you can customize the prefixed text by redefining \typeautorefname to the prefix you want.16. you can do this with a command such matically. The \crefrange{}{} and \cpagerefrange{} commands expect a start and end label in either order and provide a natural language (babel enabled) range. such as a table or a figure. The hyperref package introduces another useful command. the label will still say “figure n”.6 See also perref. 2.. wherever it is. if you write a long document it is not uncommon to have hundreds of references.4 The hyperref package 75 nameref The hyperref package also automatically includes the nameref package. \autoref{}. and just use these commands for automatic text..7 Notes and References an environment with a counter. One way to avoid problems during development is to use the standard ref all the time.. a table. it will sort them and group into ranges autoprovides. It is similar to \autoref{}. all of which will be a hyperlink.16. . or similar (the full list of default names can be found here). of course.16. but merated as a comma-separated list with the usual \cref{} do not want the predefined text that \autoref{} command.5 The cleveref package The cleveref package introduces the new command \cref{} which includes the type of referenced object like \def\sectionautorefname{Section} \autoref{} does. This can be achieved with the command \phantomsection as in this example: %The link location will be placed on the line below. Otherwise. poses as well. unfortunately. or other floating objects.handled by the \cpageref{} command.ctan. and a similarly named command. \phantomsection \label{the_label} 2. • LaTeX/Glossary • Keep in mind that the \label must be placed inside 2. as \hyperref[sec:intro{]}\protect\char"007B\ The format can be specified in the preamble. In some cases.16. this behavior is not what you'd like and you'd prefer the generated link to point to the line where the \label is defined. no alternative \Autoref command is defined to produce capitalized versions (useful. there are other things which can follow the \date command apart from a date in curly braces. so the closing curly brace is seen as one too many (which it is!). for example). it displays the error Newcomers should remember to check the list of special message and pauses. which refers to the line-number in your document file which LaTeX was processing when the error was spotted. type a forward slash instead of a backslash. While it is certainly possible to set LaTeX’s parameters so that the spacing is sufficiently sloppy that you will almost never get a warning about badly-fitting lines or pages. If you find another error message not shown here. This disappears after Some systems (Emacs is one example) run LaTeX with a few days as you get used to them. but be aware that the place where LaTeX spots and reports an error may be later in the file than the place where it actually occurred. say. which try to hide unevennesses in the text (usually unsuc- The reason LaTeX thinks there are too many }'s here is that the opening curly brace is missing after the \date control sequence and before the word December. and you can then run LaTeX again to check you have fixed everything. l. italics. For example if you forget to close a curly brace which encloses.6 \date December 2004} Warnings Warnings don't begin with an exclamation mark: they are just comments by LaTeX about things you might want to look into. a “nonstop” switch turned on. Unlike other systems. LaTeX won't report this until something else occurs which can't happen until the curly brace is encountered (e.1. so it will always process through to the end of the file. forget curly braces. and it’s not clear what you should do. You must type one of the following characters: a very large number of errors when you are learning LaTeX are due to accidentally typing a special letters to continue: character when you didn't mean to.Chapter 3 Mechanics 3. Some of Only a few common error messages are given here: those the most common errors are described in next sections.1 Error messages The format of an error message is always the same. Error messages begin with an exclamation mark at the start of the line. If it encounters something it doesn't understand or can't do. or use a special character by mistake. In fact.3 Examples easily corrected in your editor.1. and other typographical niceties (most of which you can ignore until later). Here’s an example.g. so LaTeX cannot possibly guess that you've missed out the opening curly brace until it finds a closing one! 76 . showing that the user mistyped the \tableofcontents command: ! Undefined control sequence. regardless of errors.6 \tableofcotnetns Most error messages are self-explanatory. LaTeX takes the view that the author or editor should be able to contribute. such as overlong or underrun lines (often caused by unusual hyphenations. it will display a message saying what is wrong. followed by another line starting with the number. Don't panic if you see error messages: it is very common to mistype or misspell commands. you will almost certainly just be delaying matters until you start to get complaints from your readers or publishers. pages running short or long. It may also display warnings for less serious conditions. 3.1 LaTeX/Errors and Warnings LaTeX describes what it is typesetting while it does it. l. Too many }'s 3. When LaTeX finds an error like this. most likely to be encountered by beginners. or until a limit is reached.1. Errors are easily spotted and 3. and give a description of the error. ask for help.2 ! Too many }'s. the end of the document!) Some errors can only be righted by humans who can read and understand what the document is supposed to mean or look like. cessfully) by interfering with the letter spacing. In this case.6 \dtae {December fending line was printed. Mistypings are the most common necessary to pull the linebreak up one line to the end of source of errors. In this case it is about: it’s undefined.. It says what lines of your file it was Missing package ! LaTeX Error: File `paralisy. 9pt is too much to ignore (over 3mm). In this example.. and environments to be inserted using drop-down menus or icons. proLaTeX knows is that \dtae is not a command it knows viding full paragraphs to ragged text.sty' not found. paragraph has ended but \date is not yet finished.. The line on this example is too long by a shade over 9pt. but only a human can detect that fact: all a return before it. The codes separated by slashes are the typeface and font style and size used in the line. and a manual correction needs making (such as a change to the hyphenation). this should be properly typeset as “input\slash output”. Underfull \hbox (badness 1394) in paragraph at lines 28..\end{math} or use the 'quick math mode': \ensuremath{. Type X to quit or <RETURN> to proceed. Normally TeX ignores linebreaks. Runaway argument? {December 2004 \maketitle ! Para. It’s the opposite of the error of too many of the next line).[94] Underfull hbox This is a warning that LaTeX cannot stretch the line wide enough to fit. Some editors allow common commands the previous sentence. <to be read “input/output”. keeping the word on the line would make the spaces smaller than the current limit.}. there are several character encoding formats. Runaway argument [101] Overfull \hbox (9. for example using utf8 without "\usepackage[utf8]{inputenc}" or using iso8859-1 without "\usepackage[latin1]{inputenc}".$ or \begin{math}. and it results in \maketitle trying to format the title units. l. or the flexibility settings need changing. and the number in square brackets is the number of the page onto which the of! Undefined control sequence. so the word is left on the line. and which makes the line go over the edge. except that it can form the end In this error. which should not be page while LaTeX is still expecting more text for the date! broken over multiple lines.11617pt too wide) in paragraph at lines 860-−861 []\LY1/brm/m/n/10 Windows. such as graph ended before \date was complete. The "/" character is typically used in }'s.. for example _ will be interpreted as a subscript operator in mathematics mode. then use $. RJ: \LY1/brm/m/n/10 wide: Ac-count-ing in Busi.. this is detected and LaTeX complains that the previous The warning can also be issued when the \end{document} tag was not included or was deleted. Obviously it’s This comes up if you force a linebreak. e. (Default extension: sty) Enter file name: .g. The use of \slash has the same effect again> \par l. without making the spacing bigger than its currently permitted maximum. As \maketitle creates new paragraphs on the title page. If you did not intend to use mathematics mode.000) indicates how severe this is (here you can probably ignore a badness of 1394).8 as using the "/" character.1. but with the minimum allowed space between words. then perhaps you are trying to use a special character that needs to be entered in a different way. This can also happen if you use the wrong character encoding.If the “overfull” word includes a forward slash. which may be used to avoid these errors. make sure to pick the right one. 2004} Ignore them for the moment. \LY1/brm/m/it/10 see \LY1/brm/m/n/10 X WinAn overfull \hbox means that there is a hyphenation or justification problem: moving the last word on the line to the next line would make the spaces in the line wider than the current limit.. Easily spotting overfull hboxes in the document To easily find the location of overfull hbox in your document. If you intended to use mathematics mode. and you need \_ to get an underscore character. Overfull hbox Not in Mathematics Mode ! Missing $ inserted A character that can only be used in the mathematics was inserted in normal text. The chosen hyphenation point which minimizes the error is shown at the end of the line (Win-). LaTeX is complaining that it has no such command (“control sequence”) as \dtae. The badness (0-10. LATEX/ERRORS AND WARNINGS 77 Undefined control sequence typesetting when it found this.3. Line numbers and page numbers are given as before. or enter new name. the closing curly brace has been omitted of a line (with the following words appearing at the start from the date.you can make latex add a black bar where a line is too −30 [][]\LY1/brm/b/n/10 Bull. The warning is given so that you can find the line in the code that originates the problem (in this case: 860-861) and fix it. and have been mistyped. such as “mm/year” character. \\. org/tex-archive/support/ lacheck) is a consistency checker intended to spot mistakes in code.2. if you get the name right. However.2 Box lengths If you previously set the X language. MECHANICS When you use the \usepackage command to request LaTeX to use a certain package. you will need to download and install it before continuing.org/tex-archive/macros/latex/ contrib/nag) is a LaTeX package designed to indicate the use of obsolete commands. where babel defined your language. This can happen after the LaTeX/Internationalization) usage of: (see 3. but the package is not installed on your machine.[1] in your LaTeX distribution. it will look for a file with the specified name and the filetype . so it’s easy to fix. • a floating point factor followed by a macro that exPackage babel Warning: No hyphenation patterns were pands to a length.aux file. This may seem awkward. Wrong hyphenation rules can decrease the neatness of your document.2. • lacheck (www. The answer lies in the . 3. you will get this error. With this one you can set a new value for an existing length variable: 3. with the aim of finding errors or highlighting bad practice. Here are the most common ones.4 Software that can check your . a length is not from LaTeX. it should work. If you try the compilation a second time. and providing more help to (particularly novice) users than the built-in error messages.aux • height file.3 Length manipulation One common cause of (pdf)LaTeX getting stuck is forgetting to include \end{document} You can change the values of the variables defining the page layout with two commands. It is available as source code or compiled for Windows and OS/2 • chktex (baruch. and you must create a new length before you attempt to set it: You may also set a length from the size of a text with one of these commands: . You can create your own length with the command. as there is obviously no error in your code if • depth you did not change anything. your document. \usepackage[latin]{babel} And here are some less common units. this error is very common and (can) give • a floating point number followed by a unit. All LaTeX units are two-letter abbreviations.2 LaTeX/Lengths Although this is a warning from the Babel package and In TeX.org/proj/chktex/) is a LaTeX semantic checker available as source code for Unixlike systems. then everything will work as usual. but won't compile 3.ctan.sty.[2] Package babel Error: You haven't loaded the option X yet.1.2.tex with this other one. You can The solution is not difficult.1 Units First. just install the used language choose from a variety of units.sty file and put it in the same folder of the document you are compiling.ctan. Package babel Warning: No hyphenation patterns were loaded for the language X • nag (www. you can simply download from Internet the necessary . In this case the user has mistyped the name of the paralist package. delete • width the . See Boxes. No error message. we introduce the LaTeX measurement units. loaded for (babel) the language `Latin' (babel) I will use the patterns loaded for \language=0 instead. If you don't want to affect the global installation of the machine.ev-en. you can add a value to the existing Code one: There are several programs capable of checking LaTeX source.78 CHAPTER 3. and then decided A box in TeX is characterized by three lengths: to switch to Y. If not. optionally some strange hyphenation (word breaking) problems in followed by a stretching value. 3. can be used to typeset text on the last line of a page. The same way. that you want to use as reference if you plan to also display it. \paperheight The height of the page. duplication.5 Fixed-length spaces You can also define stretched values.space. LATEX/LENGTHS 79 When using these commands. if it is un. The lines in a paragraph.2. in connection with \pagebreak. they grow according to the stretch factor. you can stretch vertically: You can also use \fill instead of \stretch{1}. \linewidth The width of a line in the local environment.3. like letters to build a word or words \baselinestretch Multiplies \baselineskip. to build a paragraph. be ignored (or fail) in horizontal mode such as in the middle of a paragraph. To set a length: To view. use: extent tex is authorized to change the length. The \stretch command. A stretching value is a length preceded by plus or minus to specify to what To insert a fixed-length space.2.2. \parskip The extra vertical space between paragraphs. it will raise the length up to a maximum of 15pt. \oddsidemargin The margin for 'odd' pages (think of a printed booklet). To create a new length: TeX features some macros for fixed-length spacing. then you may use To print a length. If such a space should be kept even if it falls at the end or if it is overfull. \bigskip Inserts a big space in vertical mode (between two paragraphs). or to center text vertically on a page. you may duplicate the text \topmargin The size of the top margin. \columnsep The distance between columns. 3. acters. horizontal mode is during the process of assembling boxes “horizontally”. The first token next the a double line\evensidemargin The margin for 'even' pages (think of break is still in vertical mode if it does not expand to chara printed booklet). but if you do. you can use the \the command: Plain TeX It’s important you use the \vspace* command instead of \vspace. You may wish to look at the example below to see how you can use these. use \hspace* instead. latxpar must be placed \vspace*.6 Rubber/Stretching lengths The command: generates a special rubber space where factor is a number. 3. \paperwidth The width of the page. \textheight The height of text on the page. it is the same as with LaTeX. See Boxes for more details. \vspace for vertical It means that tex will try to use a length of 10pt. using the command \the.4 LaTeX default lengths Common length macros are: \smallskip Inserts a small space in vertical mode (between two paragraphs). If you want to add space before minus. otherwise LaTeX can silently ignore the extra space.2. If two \hspace{\stretch{factor}} commands are issued on the same line. the minus values. \textwidth The width of the text on the page. without anything else written before. at the beginning of the document. use the starred version of the command. \baselineskip The normal vertical distance between The vertical mode is during the process of assembling boxes “vertically”. it will lower the length up to a minimum the start of a line. It stretches until all the remaining space on a line is filled up. If the space should be preserved at the top or at the botNote that it is not mandatory to specify both the plus and tom of a page. possibly a float. like paragraphs to build a page. \parindent The normal paragraph indentation. The fact they are vertical mode commands mean they will \columnwidth The width of the column. \tabcolsep The default separation between columns in a tabular environment. of 7pt. . \medskip Inserts a medium space in vertical mode (between two paragraphs). Example: \hspace stands for horizontal space. derfull. 3. instead of \vspace. But LaTeX also provides \savebox to avoid this \unitlength Units of length in picture environment. 9 See also 3.4 LaTeX default counters 3. use: • section • subsection • subsubsection • paragraph • subparagraph • page • equation • figure To increase the counter.3 Counter style Each counter also has a default format that dictates how it is displayed whenever LaTeX needs to print it. Such • University of Cambridge > Engineering Department formats are specified using internal LaTeX commands: > computing help > LaTeX > Squeezing Space in LaTeX 3. For automatic reExample: setting you need to use \stepcounter. There are several ways to get access to a counter.3.gov/tools/latex/ltx-86. 3.nasa. captions.in different manners.3.3.giss. • \hrulefill will produce a rule. but not the others.2. • \hfill will produce empty space.2. use Fill the rest of the line Several macros allow filling the rest of the line -.nasa. either use • table or • footnote . [1] http://www. If you want the counter to be reset to zero every time another counter is increased. lists. To set the counter value explicitly. 3. even with the \the command. with \stretch{1} or \fill): \hfill and \vfill.html 3. • \arabic{NameOfTheNewCounter} will print the formatted counter using arabic numbers. Note that \arabic{NameOfTheNewCounter} may be Use of \savebox to resize an image to the height of the used as a value too. • \value{NameOfTheNewCounter} will return the counter value which can be used by other counters or for calculations. With the command you create a new counter that is automatically set to zero. • \dotfill will produce dots. It is not a formatted string.2.8 References plainTeX equivalents \count and \newcounter\mycounter do abide by the backslash rule. LaTeX counters are not introduced by a backslash in any case.e.80 CHAPTER 3.or 3.3 LaTeX/Counters • part • chapter Counters are an essential part of LaTeX: they allow you to control the numbering mechanism of everything (sections.gov/tools/latex/ltx-86.). here the number can also be negative.giss. so it cannot be used in text.2 Counter access stretching parts of the line -.1 Counter manipulation In LaTeX it is fairly easy to create new counters and even counters that reset automatically when another counter is increased (think subsection in a section for example). text: Strangely enough. MECHANICS There are 'shortcut commands’ for stretching with factor or 1 (i.3.html [2] http://www. etc. 3.7 Examples Resize an image to take exactly half the text width : Make distance between items larger (inside an itemize environment) : • \theNameOfTheNewCounter will print the formatted string related to the counter. or spread first. It simply packs up a series of boxes into another one. 3.1 TeX character boxes 3. both • \fboxrule: the thickness of the rule. for example. but no chapters in the book class : While \parbox packs up a whole paragraph doing line breaking and everything. The command \framebox works exactly the same as Admittedly. LaTeX as if it were a single letter. You just have to make sure that their combined width is not larger than the \tex. \height.4. You can even set the width to 0pt so that TeX: the text inside the box will be typeset without influencing the surrounding boxes. Besides the length expressions. but the point is that TeX operates with glue and boxes.the outside.4.4. 3. letters to form words.5 Book with parts. They are set from values obtained by measuring the typeset text.7 Custom sectioning these horizontal box packers give you ultimate flexibility.2 makebox and mbox sections. this is a very simplistic description of what \makebox. and See the List Structures chapter. The tabular environment and the \includegraphics. LATEX/BOXES • mpfootnote For the enumerate environment: • enumi • enumii 81 • The height is the length between the baseline and the top of the box. though they weren't described as such. One can put virtually everything into a box. • enumiii • enumiv 3. Each box will then be handled by You can tweak the following frame lengths. produce a box. • The width is the width of the box.This prints a thick and more distant frame: twidth. each letter is a little box. This shows the box frame of a letter. alcontent. you can also use \width. Here is an example for recreating something similar to a width defines the width of the resulting box as seen from section and subsection counter that already exist in La. do with the \makebox and \framebox commands: including other boxes. The pos parameter takes LaTeX builds up its pages by pushing around boxes. but with special glue.3.3.4 LaTeX/Boxes in the width parameter. We already know one of them. but it draws a box around the text. which is elastic so that a series of words can be squeezed or stretched as to exactly 3. This means that one can easily arrange two tables or images side by side. \depth and \totalheight 3.4. but no chapters Here follows an example where we want to use parts and 3.3 framebox fill a line on the page. Letters are not the only things that can The following example shows you some things you could be boxes.4 framed TeX characters are stored in boxes like every printed el.6 Custom enumerate terial. • The depth is the length between the baseline and the bottom of the box. there is also a class of boxing commands that operates only on horizontally aligned ma3. At a one letter value: center. • \fboxsep: the distance between the frame and the The past chapters have already dealt with some boxes. flushright. Boxes have three dimensional properties: framed environment (you will need to include the framed . which is then glued to other the text to fill the box.4. sections. This means it can be smaller than the material inside the box.An alternative to these approaches is the usage of the ement.) As you can put boxes inside boxes. These are again glued to other words.3. can be used to prevent LaTeX from breaking two words. it’s called \mbox.3. flushleft. really happens. (See Hyphenation. Do not put another linebreak between the \fbox. and does not display anyYou can use \width. in order to act upon the size of the the placeholder into the document. No problem for LaTeX.4. or bottom to control the vertical alignment of the box. bottom or spread.4. For instance you can observe the difference when embedded 3.7 savebox 3. See Rotations. You can use it as a way to print or manipulate something repeatedly.4. This prevents the overfull badness. Note that the \pbox command takes an optional argument that specifies the vertical position 3. • \shadowbox This should print 3 boxes on the same line.9 colorbox and fcolorbox Most standard LaTeX boxes are not long commands. otherwise you will put the following \fbox in another paragraph on another line. width and height parameters are explained in the Boxes chapter. the command \savebox stores the specicommand lets you define the vertical properties of a box.4.5.10 resizebox and scalebox text \end{minipage} environment. The • \doublebox main difference between a minipage and a \parbox is that you cannot use all commands and environments inside a • \ovalbox parbox.6 minipage and parbox 3.e. This provides an easy way to box a text will be wrapped: paragraph within a document: You can do it manually with a parbox. size around the text.4.8 rotatebox in a framebox. of your choice into a box with either the \parbox[pos][height][contentpos]{width}{text} command or the \begin{minipage}[pos][height][contentpos]{width} 3. \fcolorbox can also be tweaked with \fboxsep graphs. The pos parameter can take one of the letters center.1 Rules You can make use of the long capabilities of minipage The \rule command in normal use produces a simple and parbox to embed paragraphs in non-long boxes.4. 3. The two optional parameters set for the height and depth of the raisebox.5 A \savebox is a reference to a box filled with contents. i.5 LaTeX/Rules and Struts Paragraphs in all boxes 3. top. they do not support breaks nor para. For black box: instance: The depth. t (top). You can also use Here is an example: from the pbox package which will create a box of minimal This is useful for drawing vertical and horizontal lines. top The graphicx package feature additional boxes.See Colors. MECHANICS package to use it). the obvious next step The command \newsavebox creates a placeholder for is to go for the vertical. \depth and \totalheight in the thing in the document. relative to the baseline of the surrounding text. raisebox Now that we control the horizontal.11 fancybox parameter is the height of the parbox or minipage. width takes a length argument specifying the width of the box. while almost anything is possible in a minipage. this is called a strut. can be one of center. and c (center). However you can pack a paragraph and \fboxrule. box inside the text argument. 3. If A special case is a rule with no width but a certain height.4. 3.5. fied text in this placeholder. and \usebox recalls the content of first three parameters. \height. It is used . the In professional typesetting.2 Struts of the text: The valid values are b (bottom).82 CHAPTER 3. The height 3. you specify a length in the first (required) argument. The contentpos parameter is the position of the content and the fancybox package provides additional boxes. The storing a text. You could use it in a tabular environment or in boxes to make sure a row has a certain minimum height. which work like a stretched horizontal space.5. 83 . In LaTeX a strut is defined as 3. See the Lengths chapter. LATEX/RULES AND STRUTS to guarantee that an element on a page has a certain minimal height.3.5.3 Stretched rules LaTeX provides the \hrulefill command. Most spaces and line breaks do not have any significance. but while you are typing within one of those mathby LaTeX. or have to be specified with special commands such as \quad \usepackage{amsmath} or \usepackage{mathtools} 2. but will cause exponents and indices to be • text — text formulas are displayed inline.$$ should be avoided. LaTeX) became so popular within the scientific community. there are some handy shorthands to declaring your formulas. Doing so might cause the line to be taller. It is also a large topic due to the existence of so much mathematical notation.. plain LaTeX has most of the tools that The equation* and displaymath environments are funcyou will need. that contains numerous complicated formulas. Typesetting mathematics is one of LaTeX’s greatest strengths. Unlike most other environments..that has some differences compared to the text mode: ronments to amsmath.. particularly with the AMS-LaTeX macros. it might be convenient to write the \displaystyle class inside the environment. If you are writing a scientific document tionally equivalent.messages may not be helpful. The fact that he succeeded was most probably why TeX (and later on. for ex. such as \lim or \sum to be displayed correctly inside some math environments (read $. Furthermore.Chapter 4 Technical Texts 4. in the preamble of the document. you are said to be in math mode.[2] To use either package. ical formulas. As maths require special environments. while looking professional when printed. special environments have been declared for this purpose. the $\sum$ will print a smaller ∑ Σ and $\displaystyle . \sum$ will print a bigger one 84 . quirks and adds some useful settings. Empty lines are not allowed. and envi. They can be distinguished into two categories depending on how they are presented: Inserting “Displayed” maths inside blocks of text In order for some operators. The following table summarizes them: Suggestion: Using the $$. there are naturally the appropriate environment names you can use in the standard way.. as all spaces are either derived logically from the mathematical expressions. Mathematics environments LaTeX needs to know beforehand that the subsequent text does indeed contain mathematical elements. For examwithin the body of text where it is declared.1. The mathtools package loads the amsmath package and hence there is no need to \usepackage{amsmath} in the preamble if mathtools is used.1 LaTeX/Mathematics • displayed — displayed formulas are separate from the main text. that is.1 3. The mathtools package fixes some amsmath ematical environments. Each letter is considered to be the name of a variable and will be typeset as such. like in equations (This ample. displayed correctly for some math operators. however. include: 1.. you are said to be in text are more powerful and flexible than the ones provided mode. One of the greatest motivating forces for Donald Knuth when he began developing the original TeX system was to create something that allowed simple construction of mathematical formulas. If you want to typeset normal text within a formula (normal upright font and normal spacing) then you have to enter the text using dedicated commands.. I can say that a + a = 2a within this sentence. This is because LaTeX typesets maths notation differently from normal text. Only one paragraph per formula. 4.. symbols.ple.$). the amsmath package[1] introduces several new commands that If you are typing text normally. as it may cause problems. the error If your document requires only a few simple mathemat. Therefore. should a problem occur. 1. surround the power Mathematics has many symbols! One of the most dif. Similarly. ficult aspects of learning LaTeX is remembering how to An underscore (_) can be used with a vertical bar ( | ) to produce symbols.5 Powers and indices Powers and indices are equivalent to superscripts and subscripts in normal text mode. Lowercase epsilon. they should be grouped using curly braces ({ and }). rho. the subscript is command. so they are not mand without the amsmath package: provided by LaTeX (e.1. before \begin{document}). then you will get an uppercase letter. which is useful in longer documents. and played mathematics. Likewise. version is created If this looks a little “loose” (overspaced). it may be more aesthetically pleasing to use powers and kappa. trigonometric functions (sin. whose usage is similar to \sfrac. such as argmax. It is also possible to force this behaviour for all math environments by declaring \everymath{\displaystyle} at the very beginning (i. the nicefrac package provides the \nicefrac For certain operators such as limits. tan). 4.Another way to write fractions is to use the \over compercase Greek letters look like Latin ones. You just have to force the use of the respective styles.It is also possible to use the \choose command without TeX Symbol List” in the external links section below. typeset the binomial coefficient. Continued fractions should be written using \cfrac see custom operators command[3] : . usage of xfrac plete list of Greek symbols. If more than one expression is raised or lowered.indices: ent versions. cos.e.1. the \tbinom and \dbinom commands letter is lowercase. etc. pi. and sigma are provided in two differ. that’s the Fortunately. For powers with more than one digit. There is of course a set of symbols that denote evaluation using subscript notation in mathematcan be accessed directly from the keyboard: ics: +-=! /()[]<>|': Beyond those listed above. if the first letter is uppercase (and only the first letter). or in inline text ab . The alternate. logarithms and ex. especially within the text. The caret (^) character is used to raise something.$x^\frac{1}{2}$ % no error $x^\sfrac{1}{2}$ % error ponentials (log. This package provides \sfrac command to create slanted fractions. phi. \frac{numerator}{denominator} command. \textstyle and \distype the name of the letter after a backslash: if the first playstyle. There are 4. arrows. Usage: If fractions are used as an exponent curly braces have to be used around the \sfrac command: An operator is a function that is written as a word: e.1. a tightened verby adding “var” before the name of the letter: sion can be defined by inserting some negative space Scroll down to #List of Mathematical Symbols for a comIf you use them throughout the document. Look for coefficient (aka the Choose function) may be written [3] “Detexify” in the external links section below.1. just “A” and “B” respectively). set and A fraction is created using the relations symbols. binary operators. placed underneath the operator: For the modular operator there are two commands: Continued fractions \bmod and \pmod: To use operators that are not pre-defined. a fraction is noticeably smaller than in disGreek letters are commonly used in mathematics. package is recommended.6 Fractions and Binomials a great deal of examples such as Greek letters. uppercase Alpha and Beta are For relatively simple fractions. theta.4. the amsmath package: You can embed fractions within fractions: 4.2 Symbols 85 4. distinct commands must be issued in order to display the desired symbols. LATEX/MATHEMATICS only works with AMSMATH package). the binomial search for the command for a specific symbol.3 Greek letters 4.g. there’s a tool that can greatly simplify the top and bottom respectively!). (for For example: those who need their memories refreshed. Another using the \binom command : option would be to look in the “The Comprehensive La. you will get a lowercase Greek letter.1. and the underscore (_) is for lowering.with {}. or variant. LaTeX has many of these defined $x^{\sfrac{1}{2}}$ % no error as commands: Alternatively. The \tfrac and \dfrac commands[3] they are very easy to type in math mode.4 Operators Note that when appearing inside another fraction. Note that some up.g. exp). 86 CHAPTER 4. TECHNICAL TEXTS Multiplication of two numbers mand: However if you want this to apply to ALL integrals, it is To make multiplication visually similar to a fraction, a preferable to specify the intlimits option when loading the nested array can be used, for example multiplication of amsmath package: numbers written one below the other. Subscripts and superscripts in other contexts as well as other parameters to amsmath package related to them are described in Advanced Mathematics chapter. 4.1.7 Roots For bigger integrals, you may use personal declarations, The \sqrt command creates a square root surrounding an or the bigints package [4] . expression. It accepts an optional argument specified in square brackets ([ and ]) to change magnitude: Some people prefer writing the square root “closing” it over its content. This method arguably makes it more clear what is in the scope of the root sign. This habit is not normally used while writing with the computer, but if you still want to change the output of the square root, LaTeX gives you this possibility. Just add the following code in the preamble of your document: 4.1.9 Brackets, braces and delimiters How to use braces in multi line equations is described in the Advanced Mathematics chapter. The use of delimiters such as brackets soon becomes important when dealing with anything but the most trivial equations. Without them, formulas can become ambiguThis TeX code first renames the \sqrt command as \old- ous. Also, special types of mathematical structures, such sqrt, then redefines \sqrt in terms of the old one, adding as matrices, typically rely on delimiters to enclose them. something more. The new square root can be seen in the There are a variety of delimiters available for use in Lapicture on the left, compared to the old one on the right. TeX: Unfortunately this code won't work √ if you want to use multiple roots: if you try to write b a as \sqrt[b]{a} after you used the code above, you'll just get a wrong output. Automatic sizing In other words, you can redefine the square root this way only if you are not going to use multiple roots in the whole Very often mathematical features will differ in size, in which case the delimiters surrounding the expression document. should vary accordingly. This can be done automatically An alternative piece of TeX code that does allow multiple using the \left, \right, and \middle commands. Any of roots is the previous delimiters may be used in combination with However this requires the \usepackage{letltxmacro} these: package Curly braces are defined differently by using \left\{ and \right\}, 4.1.8 Sums and integrals If a delimiter on only one side of an expression is required, then an invisible delimiter on the other side may The \sum and \int commands insert the sum and integral be denoted using a period (.). symbols respectively, with limits specified using the caret (^) and underscore (_). The typical notation for sums is: Manual sizing The limits for the integrals follow the same notation. It’s also important to represent the integration variables with In certain cases, the sizing produced by the \left and \right an upright d, which in math mode is obtained through the commands may not be desirable, or you may simply want \mathrm{} command, and with a small space separating finer control over the delimiter sizes. In this case, the \big, it from the integrand, which is attained with the \, com- \Big, \bigg and \Bigg modifier commands may be used: mand. These commands are primarily useful when dealing with There are many other “big” commands which operate in nested delimiters. For example, when typesetting a similar manner: we notice that the \left and \right commands produce the For more integral symbols, including those not included same size delimiters as those nested within it. This can by default in the Computer Modern font, try the esint be difficult to read. To fix this, we write package. Manual sizing can also be useful when an equation is too The \substack command[3] allows the use of \\ to write large, trails off the end of the page, and must be separated the limits over multiple lines: into two lines using an align command. \left and \right If you want the limits of an integral to be specified above will give errors if the left and right appear on different and below the symbol (like the sum), use the \limits com- lines. 4.1. LATEX/MATHEMATICS 87 Typesetting intervals 4.1.11 Adding text to equations To denote open and half-open intervals, the notations ]a,b[, (a,b), ]a,b], (a,b], [a,b[ and [a,b) are used. If the square bracket notation is used, then the interval must be put between curly braces ({ and }) in order to have correct spacing. Similarly, if a (half-)open interval starts with a negative number, then the number including its minussymbol must also be put between curly brackets, so that LaTeX understands that the minus-symbol is the unary operation. Compare: The math environment differs from the text environment in the representation of text. Here is an example of trying to represent text within the math environment: 4.1.10 Matrices and arrays A basic matrix may be created using the matrix environment[3] : in common with other table-like structures, entries are specified by row, with columns separated using an ampersand (&) and a new rows separated with a double backslash (\\) There are two noticeable problems: there are no spaces between words or numbers, and the letters are italicized and more spaced out than normal. Both issues are simply artifacts of the maths mode, in that it treats it as a mathematical expression: spaces are ignored (LaTeX spaces mathematics according to its own rules), and each character is a separate element (so are not positioned as closely as normal text). There are a number of ways that text can be added properly. The typical way is to wrap the text with the \text{...} command [3] (a similar command is \mbox{...}, though this causes problems with subscripts, and has a less descriptive name). Let’s see what happens when the above equation code is adapted: To specify alignment of columns in the table, use starred The text looks better. However, there are no gaps between the numbers and the words. Unfortunately, you version[5] : are required to explicitly add these. There are many ways The alignment by default is c but it can be any column to add spaces between maths elements, but for the sake type valid in array environment. of simplicity we may simply insert space characters into However matrices are usually enclosed in delimiters of the \text commands. some kind, and while it is possible to use the \left and \right commands, there are various other predefined environments which automatically include delimiters: Formatted text When writing down arbitrary sized matrices, it is common to use horizontal, vertical and diagonal triplets of dots (known as ellipses) to fill in certain columns and rows. These can be specified using the \cdots, \vdots and \ddots respectively: In some cases you may want to have finer control of the alignment within each column, or want to insert lines between columns or rows. This can be achieved using the array environment, which is essentially a math-mode version of the tabular environment, which requires that the columns be pre-specified: Using the \text is fine and gets the basic result. Yet, there is an alternative that offers a little more flexibility. You may recall the introduction of font formatting commands, such as \textrm, \textit, \textbf, etc. These commands format the argument accordingly, e.g., \textbf{bold text} gives bold text. These commands are equally valid within a maths environment to include text. The added benefit here is that you can have better control over the font formatting, rather than the standard text achieved with \text. You may see that the AMS matrix class of environments 4.1.12 Formatting mathematics symbols doesn't leave enough space when used together with fractions resulting in output similar to this: See also: w:Mathematical Alphanumeric Sym5 1 bols, w:Help:Displaying a formula#Alphabets 0 6 6 5 1 and typefaces and w:Wikipedia:LaTeX symM = 6 0 6 1 5 bols#Fonts 0 6 6 To counteract this problem, add additional leading space We can now format text; what about formatting mathewith the optional parameter to the \\ command: matical expressions? There are a set of formatting comIf you need “border” or “indexes” on your matrix, plain mands very similar to the font formatting ones just used, TeX provides the macro \bordermatrix except that they are specifically aimed at text in math mode (requires amsfonts) Matrices in running text These formatting commands can be wrapped around the entire equation, and not just on the textual elements: they To insert a small matrix, and not increase leading in the only format letters, numbers, and uppercase Greek, and line containing it, use smallmatrix environment: other math commands are unaffected. 88 CHAPTER 4. TECHNICAL TEXTS To bold lowercase Greek or other symbols use the \boldsymbol command[3] ; this will only work if there exists a bold version of the symbol in the current font. As a last resort there is the \pmb command[3] (poor mans bold): this prints multiple versions of the character slightly offset against each other. horizontal spacing. In these events, the output is still satisfactory, yet any perfectionists will no doubt wish to finetune their formulas to ensure spacing is correct. These are generally very subtle adjustments. There are other occasions where LaTeX has done its job correctly, but you just want to add some space, maybe To change the size of the fonts in math mode, see to add a comment of some kind. For example, in the Changing font size. following equation, it is preferable to ensure there is a decent amount of space between the maths and the text. This code produces errors with Miktex 2.9 and does not yield the results seen on the right. Use \textrm instead of So what to do when you run out of symbols and fonts? just \text. Well the next step is to use accents: (Note that this particular example can be expressed in more elegant code by the cases construct provided by the amsmath package described in Advanced Mathematics 4.1.13 Color chapter.) Accents The package xcolor, described in Colors, allows us to add LaTeX has defined two commands that can be used anywhere in documents (not just maths) to insert some horcolor to our equations. For example, izontal space. They are \quad and \qquad The only problem is that this disrupts the default LaTeX formatting around the - operator. To fix this, we enclose A \quad is a space equal to the current font size. So, if you it in a \mathbin environment, since - is a binary operator. are using an 11pt font, then the space provided by \quad will also be 11pt (horizontally, of course.) The \qquad This process is described here. gives twice that amount. As you can see from the code from the above example, \quads were used to add some 4.1.14 Plus and minus signs separation between the maths and the text. Latex deals with the + and − signs in two possible ways. The most common is as a binary operator. When two maths elements appear on either side of the sign, it is assumed to be a binary operator, and as such, allocates some space either side of the sign. The alternative way is a sign designation. This is when you state whether a mathematical quantity is either positive or negative. This is common for the latter, as in maths, such elements are assumed to be positive unless a − is prefixed to it. In this instance, you want the sign to appear close to the appropriate element to show their association. If you put a + or a − with nothing before it but you want it to be handled like a binary operator you can add an invisible character before the operator using {}. This can be useful if you are writing multiple-line formulas, and a new line could start with a = or a +, for example, then you can fix some strange alignments adding the invisible character where necessary. A plus-minus sign is written as: Similarly, there exists also a minus-plus sign: OK, so back to the fine tuning as mentioned at the beginning of the document. A good example would be displaying the simple equation for the indefinite integral of y with respect to x: ∫ y dx If you were to try this, you may write: However, this doesn't give the correct result. LaTeX doesn't respect the white-space left in the code to signify that the y and the dx are independent entities. Instead, it lumps them altogether. A \quad would clearly be overkill in this situation—what is needed are some small spaces to be utilized in this type of instance, and that’s what LaTeX provides: NB you can use more than one command in a sequence to achieve a greater space if necessary. So, to rectify the current problem: The negative space may seem like an odd thing to use, however, it wouldn't be there if it didn't have some use! Take the following example: The matrix-like expression for representing binomial coefficients is too padded. There is too much space between the brackets and the actual contents within. This can easLaTeX is obviously pretty good at typesetting maths—it ily be corrected by adding a few negative spaces after the was one of the chief aims of the core TeX system that left bracket and before the right bracket. LaTeX extends. However, it can't always be relied upon In any case, adding some spaces manually should be to accurately interpret formulas in the way you did. It avoided whenever possible: it makes the source code has to make certain assumptions when there are ambigu- more complex and it’s against the basic principles of ous expressions. The result tends to be slightly incorrect 4.1.15 Controlling horizontal spacing 4.1. LATEX/MATHEMATICS 89 a What You See is What You Mean approach. The best thing to do is to define some commands using all the spaces you want and then, when you use your command, you don't have to add any other space. Later, if you change your mind about the length of the horizontal space, you can easily change it modifying only the command you defined before. Let us use an example: you want the d of a dx in an integral to be in roman font and a small space away from the rest. If you want to type an integral like \int x \; \mathrm{d} x, you can define a command like this: in the preamble of your document. We have chosen \dd just because it reminds the “d” it replaces and it is fast to type. Doing so, the code for your integral becomes \int x \dd x. Now, whenever you write an integral, you just have to use the \dd instead of the “d”, and all your integrals will have the same style. If you change your mind, you just have to change the definition in the preamble, and all your integrals will be changed accordingly. 4.1.16 Advanced Mathematics: Math package The default treatment for the various kinds follows American Mathematical Society conventions. Write an equation with the align environment How to write an equation with the align environment with the amsmath package is described in Advanced Mathematics. 4.1.17 List of Mathematical Symbols All the pre-defined mathematical symbols from the \TeX\ package are listed below. More symbols are available from extra packages. Note: To use the Greek Letters in LaTeX that have the same appearance as their Roman equivalent, just use the Roman form: e.g., A instead of Alpha, B instead of Beta, etc. AMS 4.1.18 Summary The AMS (American Mathematical Society) mathematics package is a powerful package that creates a higher layer of abstraction over mathematical LaTeX language; if you use it it will make your life easier. Some commands amsmath introduces will make other plain LaTeX commands obsolete: in order to keep consistency in the final output you'd better use amsmath commands whenever possible. If you do so, you will get an elegant output without worrying about alignment and other details, keeping your source code readable. If you want to use it, you have to add this in the preamble: As you begin to see, typesetting math can be tricky at times. However, because LaTeX provides so much control, you can get professional quality mathematics typesetting with relatively little effort (once you've had a bit of practice, of course!). It would be possible to keep going and going with math topics because it seems potentially limitless. However, with this tutorial, you should be able to get along sufficiently. 4.1.19 Notes [1] http://www.ams.org/publications/authors/tex/amslatex Introducing text and dots in formulas [2] http://www.tex.ac.uk/ctan/macros/latex/contrib/ mathtools/mathtools.pdf amsmath defines also the \dots command, that is a generalization of the existing \ldots. You can use \dots in both text and math mode and LaTeX will replace it with three dots "…" but it will decide according to the context whether to put it on the bottom (like \ldots) or centered (like \cdots). [3] requires the amsmath package [4] http://hdl.handle.net/2268/6219 [5] requires the mathtools package 4.1.20 Further reading Dots • meta:Help:Displaying a formula: Wikimedia uses a subset of LaTeX commands. LaTeX gives you several commands to insert dots in your formulae. This can be particularly useful if you have to type big matrices omitting elements. First of all, here are 4.1.21 External links the main dots-related commands LaTeX provides: • LaTeX maths symbols Instead of using \ldots and \cdots, you should use the semantically oriented commands. It makes it possible to adapt your document to different conventions on the fly, in case (for example) you have to submit it to a publisher who insists on following house tradition in this respect. • detexify: applet for looking up LaTeX symbols by drawing them • amsmath documentation the \overbrace and \underbrace commands may be more useful. For equation number 1. ity to span multiple lines.1 above). 4. in the preamble of the document. it won't reset the equation number with each new (using { and }) specifies the superscript (which can be section.1). which will reference the main equation (1.1a or 1. add the following command The optional arguments set the rule thickness and bracket immediately after \numberwithin{equation}{section}: height respectively: For a numbering scheme using \numberThe \xleftarrow and \xrightarrow commands[1] produce within{equation}{subsection}. which can cause spacing problems. package: Subordinate equation numbering and for harpoons: To number subordinate equations in a numbered equation align and align* environment. they have a different synto have the enumeration go to the subsection level. TECHNICAL TEXTS • LaTeX . number resetting after each new section beginning or with For more extensible arrows. equal sign with H and the provided fraction: To have the enumeration follow from your section or subsection heading.LaTeX math translator and equation ence the sub-equation (1. which will refer• MathLex . It must be used together with manual equation left empty by inserting a blank space). While it is possible to define lines individually. 4. are used for arranging equations of either of two methods: adding a label after the \be.90 CHAPTER 4. use: arrows which extend to the length of the text. Without AmsTex the same the amsmath package) commands to label and reference result of \overset can be obtained with \stackrel.2 LaTeX/Advanced Mathematics 4. before the \\ command.The Student Room gin{subequations} command. or adding a label at the end • The Comprehensive LaTeX Symbol List of each line.2. Yet again. derbracket and \overbracket commands[2] : To remove the duplicate dot. respectively. As with matrices and tables. to use brackets instead of braces use \unexample to be rendered in this way: (1. However. Then enter If the purpose is to make comments on particular parts of to the preamble to get enumeration at the section level or an equation. \ref rebe particularly useful for creating new binary relations: sults in 1 and \eqref results in (1) : or to show usage of L'Hôpital’s rule: Further information is provided in the labels and crossIt is convenient to define a new operator that will set the referencing chapter. This can equations. In particular it makes heavy use of the AMS-LaTeX packages supplied by the An often encountered problem with displayed environments (displaymath and equation) is the lack of any abilAmerican Mathematical Society. the syntax is different: the optional argument (using [ and Note: Though it may look like the \renewcommand works ]) specifies the subscript. \\ specifies . place the part of document containing them in a subequations environment: The align and align* environments. these will not be aligned. tax (and can be aligned with the \vphantom command): If the style you follow requires putting dots after ordiSometimes the comments are longer than the formula benals (as it is required at least in Polish typography) the ing commented on.2 Vertically aligning displayed mathematics This page outlines some more advanced uses of mathematics markup using LaTeX.1..multiple lines.1 Equation numbering The equation environment automatically numbers your Above and below equation: The \overset and \underset commands[1] typeset symbols You can also use the \label and \ref (or \eqref from above and below expressions. \numberwithin{equation}{subsection} command in the These can be removed using the \mathclap command[2] : preamble will result in the equation number in the above Alternatively. available through the Referencing subordinate equations can be done using amsmath package. It is possible to add both labels in case both types of references are builder needed. you must use the amsmath package or which reduces the above example to: use AMS class documents.2.1b above). and the mandatory argument by itself. you must use mathtools the much cleaner \numberwithin. Individual lines may be re. The There are also few environments that don't form a math \nonumber or \notag command can be used to suppress environment by themselves and can be used as building blocks for more elaborate structures: the number for a given line: Notice that we've added some indenting on the second For example: line. Also.. While 0 and \right\}. If you want the entire line or several equations to be Within cases. The following document class and then specify a certain value for the \mathindent variable: example illustrates the alignment rule of align*: Braces spanning multiple lines 4. there are the equation environment. otherwise latex won't create the correct spacing after the + sign. The reason for this is that without 4. align is similar.} before the linebreak. align is a to set it in the normal roman font of the document the replacement for such environments. so there are no unpaired \left and \right commands Alternatively. You can control the size of the braces manually have an optional argument denoting the priority of page with the \big. LaTeX will insert a page break into a long equation if it Using aligned braces for piecewise functions You has additional text added using \intertext{} without any can also use \left\{ and \right\} to typeset piecewise funcadditional commands. pletely separate equation —notice the use of \right.5 Boxed Equations The cases environment[1] allows the writing of piecewise functions: For a single equation or alignment building block.} command before the line. you may enable automatic page breaks in within a line (these aren't needed if the formula is on one math environments with \allowdisplaybreaks.3 Indented Equations the braces. Instead. \Big.. text style math is used with results such as: boxed. by using the dcases equation* environment: environment[2] from mathtools: Note that the align environment must not be nested inside Often the second column consists mostly of normal text. breaks in equations.2. Similarly. but automatically numbers each line like Although align and align* are the most useful. If you want environment you may use the \displaybreak command bea brace to continue across a new line.2. use the \tag{.. 1 means “allow page Alternatively. \bigg.2. LATEX/ADVANCED MATHEMATICS 91 a line break. To force numbering on a specific line. in spite of the use of \left\{ noting the level of desirability of a page break.several other environments which may also be of interest: ferred to by placing a \label{. an equation (or similar) environment. You can prohibit a page break after a given line replicated in the other using the \vphantom command: using \\*. each of which is aligned. It too can line). use \boxed{}: columns.2. and \Bigg commands. we need to insert the double braces ({}) before the + sign.. 4 forces a break. In order to indent an equation. \left.4. and No argument means the same as 4. you can set fleqn in the More complicated alignments are possible. and & is used to indicate the point at which a= the lines should be aligned. align* suppresses numbering. the height of the taller equation can be breaks but avoid them” and 4 means “break whenever you want”. the contents inside dcases* environment may be used:[2] an align are automatically placed in math mode. the sizes of the left and right braces break can take an optional argument between 0 and 4 deare not automatically equal.means “it is permissible to break here”. Just like with \pagebreak. latex interprets the + sign as a unary operator. do the following: fore the line break. This is because each line is typeset as a com.4 Page breaks in math environments Additional &'s on a single line will specify multiple To suggest LaTeX insert a page break inside an amsmath “equation columns”. instead of the binary operator that it really is. \displayIn this construction. use a minipage inside an \fbox{}: . with LaTeX will then take care of defining and or aligning the the tag outside the box. tions: Specific usage may look like this: The cases environment 4. {∫ x dx 2 b The align* environment is used like the displaymath or Display style may be used instead.Other environments break. simply group it. Multiline subscripts However. so that additional leading won't be re. Also. The \operatorname and \operatorname* commands[1] display custom operators. the * version sets the underscored option underneath like the \lim operator: However. use \underset as follows: As you can see. like Similarly one can put subscripts under a symbol that usuwhen in display mode.instead of intertext to reduce the amount of vertical scripts e.9 Changing font size A lim in running text (inside $. they get smaller (although they will not get any smaller as in this example.92 CHAPTER 4. use the \nolimits operator: 4.$) will have its limits placed on the side. the command \shortintertext{} from the mathtools package could have been used There are defaults for placement of subscripts and super. as \sideset command: it can only be used in the document preamble.: (in summation style symbols) with \nolimits: Another approach is to use the \DeclareMathSizes comIt’s impossible to mix them with typical usage of such mand to select your preferred sizes. add the nosumlimits option to the amsmath package. you could declare each fraction While you can place symbols in subscript or superscript to use the display style instead.. but still keeping it in-line. to typeset the argmax operator. The following code prodet. b Limits below and under: A simple approach is to utilize the predefined sizes for To change the default placement of summation-type symmaths elements: bols to the side for every case. it is preferable to define a new operator that can be used through. etc.8 Text in aligned math display header of the document: This defines a new command which may be referred to in To add small interjections in math environments use \inthe body: tertext command: 4. TECHNICAL TEXTS There is also the mathtools \Aboxed{} which is able to If you wish to place them on the corners of an arbitrary box across alignment marks: symbol. e. e. For example. To change the placement for in.However. min. . \textstyle. 4.some control over the size. where ds is the display size. a simple grouping can solve the problem: since a math operator can be used with limits or no limits. vides an example. using text-mode maths. if the operator is frequently used. as the fractions continue. etc. in the above example. below the symbol: Limits To override this behavior. To produce one-sided limits.To produce multiline subscript use \substack command: out the entire document. It is very flexible: for example.7 Advanced formatting Note that any usage of this command does not change the alignment.g. If you want to change its state. You can only define symbols: sizes for \displaystyle. you should use \fourIdx from the fouridx package. The \DeclareMathOperator and \DeclareMathOperator* commands[1] are specified in the 4.g. nonamelimits tinued fractions (though it’s better to use the \cfrac can be used to change the default for named operators like command[1] described in the Mathematics chapter over the method provided below). and then you can have limits and then limits again. like this: ally have them on the side: a .g. If you wanted to keep the size consistent. it’s fairly easy to use: \DeclareMathner of the symbol use this command: Sizes{ds}{ts}{ss}{sss}.6 Custom operators Although many common operators are available in LaTeX. to put letters in each cor. one might use side is that this command sets the global maths sizes. sometimes you will need to write your own. To override this behavior.2. You can make it another math operator if you want.2. use the \limits com. add intlimits to the options.A classic example to see this in use is typesetting contegral symbols. lim. ts is .2. Subscripts and superscripts they have reached the \scriptstyle limit). limits for the lim operator are usually placed whitespace added between the lines. One potential downTo add both prime and a limit to a symbol..There may be a time when you would prefer to have quired. by default a simple fraction will look like this: ab mand. whereas you may prefer to have it displayed larger.2. However it is common for similar types of theorems (e.2 Theorem counters 4.12 Notes [1] Requires amsmath package By default.10 Forcing \displaystyle for all math in It will look like this: a document Definition 3 Here is a new definition Put before with line breaks separating it from the rest of the text. will define the mydef environment. the second argument is the output NB the changes only take place if the value in the first LaTeX will print whenever you use it. in the event of the main font being changed.g. 4. 4. Theorems. The first argument is the name you point (pt) size. to force all math to . horizontally. for example “Theorem 2.1 Basic theorems First of all. will use to reference it.11 Adjusting vertical whitespace Often the counters are determined by section. In this case..3. each theorem uses its own counter.2. make sure you have the amsthm package enabled: \usepackage{amsthm} where counter is the name of the counter to be used.3.3. You can also create a theorem environment that is not numbered by using the newtheorem* command[1] . Lemmas and Corollaries) to share a counter.3 LaTeX/Theorems With "theorem" we can mean any kind of labelled enunciation that we want to look separated from the rest of the text and with sequential numbers next to it. LATEX/THEOREMS 93 the text size. For instance.2.3.2. which will generate definitions without numbering. This approach is commonly used for theorems in mathematics.) at which the numbering is to take place. For example: argument matches the current document text size.3 Proofs The easiest is the following: The proof environment[1] can be used for adding the proof of a theorem. \newtheorem*{mydef}{Definition} defines the mydef environment.g. Usually this will be the name of the master theorem.4. The \newtheorem command may have at most one optional argument. specify the theorem There are four parameters which control the vertical as follows: whitespace around displayed math: \newtheorem{name}{Printed output}[numberby] Short skips are used if the preceding line ends. etc. if you use it like this: E. These parameters must be set where numberby is the name of the section level (secafter tion/subsection/etc. \begin{mydef} Here is a new definition \end{mydef} 4. The values you input are assumed to be put it in the preamble. 4. but can be used for anything. . This requires amsthm package. It \newtheorem{mydef}{Definition} is therefore common to see a set of declarations in the preamble. define subsequent theorems as: \newtheorem{name}[counter]{Printed output} [2] requires the mathtools package 4. before the formula. LaTeX provides a command that will let you easily define any theorem-like enunciation. In this case. 4. The basic usage is: \newtheorem{name}{Printed output} \begin{proof} Here is my proof \end{proof} .3” refers to the 3rd theorem in the 2nd around displayed math section of a document. . for example the following way: The method above does not work with the deprecated en% Fix latex \def\smallskip{\vskip\smallskipamount} vironment eqnarray*.D.\arabic{thm}} \renewcommand{\qedsymbol}{} \def\claim#1{\par\medskip\noindent\refstepcounter{thm}\hbox{\bf \arabic{chapter}.g.D.D.3. symbol. chemfig uses the tikz package to produce its graphics.E.D. which in this case is Topology. If the last line of the proof is displayed math then the Q. include the \begin{definition}[Topology]. Whereas ochem requires Perl to draw chemical structures. symbol. TECHNICAL TEXTS It just adds Proof in italics at the beginning of the text given as argument and a white square (Q. #1.5 Conflicts \begin{proof} Here is my proof: \[ a^2 + b^2 = c^2 The theorem environment conflicts with other environ\qedhere \] \end{proof} ments. " " = normal interword space {headspec}% Manually specify head 4. redefine the \qedsymbol \def\bigskip{\vskip\bigskipamount} % Hand command.g. is important proof \end{proof} always optional. It is an alternative to ochem. also known as a tombstone) at the end of it. use the \qedhere command: 4. All subse. E.: 3pt {bodyfont}% name of font to use in the body of the theorem {indent}% measure of space to indent {headfont}% name of head font {headpunctuation}% punctuation between head and body {headspace}% space after theorem head. just use babel with the right argument and the word Proof printed in the output will be translated accordingly. If you are writing in another language than English. symbol at the end of the last line.3. Here is an example headspec: \thmname{#1}\thmnumber{ #2}:\thmnote{ #3} which would look something like: Definition 2: Topology for the following: If you would like to manually name the proof. Use align* instead.\arabic{section}.\arabic{thm}.4. chemfig is used by adding the following to the preamble: \usepackage{chemfig} .E. name in square brackets: \begin{proof}[Proof of important theorem] Here is my (The note argument. (Any arguments that are left blank will assume their default value). for example wrapfigure.E.} \it\ %\ignorespaces } \def\endclaim{ \par\medskip} \newenvironment{thm}{\claim}{\endclaim} 4.94 CHAPTER 4. anyway. but will not appear by default unless you specify it as above in the head spec).D. symbol will appear on a subsequent empty line. E.E. A work around is to redefine theorem.4 Theorem styles It adds the possibility to change the output of the environ. redemade theorem \newcounter{thm}[section] \refine it to be blank: newcommand{\thethm}{\thesection. To put the Q. \end{thm} Then \theoremstyle{stylename} the argument is the style you want to use.3. symbol altogether.4 LaTeX/Chemical Graphics chemfig is a package used to draw 2D chemical structures. \def\medskip{\vskip\medskipamount} To use a custom Q. in the source the name of the environment remains proof. Here is a list of the possible pre-defined styles: [1] Requires the amsthm package Custom styles To define your own style.: 3pt {spacebelow}% measure of space to leave below the theorem.7 External links • amsthm documentation 4.3.In this case theorem looks like: ments defined by \newtheorem using the \theoremstyle \begin{thm}{Claim}\label{lyt-prob} Let it be.6 Notes quently defined theorems will use this style.E.. To hide the Q. use the \newtheoremstyle command[1] : \newtheoremstyle{stylename}% name of the style to be used {spaceabove}% measure of space to leave above the theorem. command[1] in the header: you know. scribes. but molecules are formed in chemfig by nesting.7 Chemical Reactions Linear molecules (such as methane) are a weak example of this. Chemical reactions can be created with the following commands: 4.4 Lewis Structures Lewis structures use the syntax \lewis{<n1><n2>.4. It is 1. Finally. <angle> is the bond angle between two atoms (or nodes). N(-[:60]O)=[:300]O}\right\}$ <tikz code> includes additional options regarding the color or style of the bond.) or colon (:) after a number will display single and paired electrons respectively. charges can be placed above ions using \chemabove{}{}: 4. <arg1> and <arg2> represent text placed above and below the arrow.6 Resonance Structures and Formal Charges Resonance structures require a few math commands: % see “Advanced Mathematics” for use of \left and \right % add to preamble: % \usep<bond type> describes the bond attaching <atom1> and ackage{mathtools} % \Longleftrightarrow <atom2>. A methane molecule.4.2 Skeletal Diagrams Skeleton diagrams can be produced as follows: 4.4. There are four types of arrows that can be produced with \chemrel{}: A\chemrel{->}B\par A\chemrel{<-}B\par Rings follow the syntax <atom>*<n>(code). where <ni> is a number between 0 and 7 representing the position of the electrons. There are 9 different bond types: $\left\{\chemfig{O-N(=[:60]O)-[:300]O}\right\} \left\{\chemfig{O=N(-[:60]O)<coeff> represents the factor by which the bond’s length \Longleftrightarrow [:300]O}\right\} \Longleftrightarrow \left\{\chemfig{Owill be multiplied. the electrons are represented by a dash (-). 0 to 360. and are represented with the syntax [:<absolute angle>]. consider an acetate ion: fig{}: Because the chemfig commands enters the math mode.4. <name> will be centered relative to the molecule it deLewis structures can also be included within \chemfig{}. Relative angles require the syntax [::<relative angle>] and produce an angle relative to the angle of the preceding bond. .<coeff>. The predefined angles and their corresponding absolute angles are represented in the diagram below.4..3 Rings \chemrel[<arg1>][<arg2>]{<arrow code>} \chemsign+ % produces a + In \chemrel{}.5ex by default. These are produced with the syntax [< predefined angle>].<tikz ion charges can be added as superscripts (one caveat: a negative ion requires that the minus sign be enclosed in code>]<atom2>} brackets.For example. Molecules can be named with the command \chemname[<dim>]{\chemfig{<code molecule>}}{<name>} of the <dim> is inserted between the bottom of the molecule and the top of the name defined by <name>. predefined angles are whole numbers from 0 to 7 indicating intervals of 45 degrees. can be produced with the following code: 4.4.4. respectively.<ni>.5 Ions The primary command used in this package is \chem.4.8 Naming Chemical Graphics 4. \chemfig{<atom1><bond type>[<angle>. Absolute angles give a precise angle (generally. The charge of an ion can be circled by using \oplus and \ominus: Alternatively. though they can also be negative). where “n” A\chemrel{<->}B\par A\chemrel{<>}B indicates the number of sides in the ring and “code” represents the specific content of each ring (bonds and atoms). Appending a period (. There are three types of angles: absolute. and predefined.<atom>}.. 4. relative.4. By default. as in the example).4. for instance.1 Basic Usage 95 4. LATEX/CHEMICAL GRAPHICS 4. adding \\ in <name> will produce a line-break. writ\ce{3H2O} \\ \ce{1/2H2O} \\ \ce{AgCl2-} \\ ten in a real programming language. \usepackage[version=3]{mhchem} . If the charge is neither 1 or −1.{{13}}==\lm molecule>} before the first instance of \chemname{} \put(684.e. TECHNICAL TEXTS \chemname{\chemfig{R-C([:−30]OH)=[:30]O}}{Carboxylic acid} \chemsign{+} \chemname{\chemfig{R’OH}}{Alcohol} \chemrel{->} \chemname{\chemfig{R-C([:−30]OR’)=[:30]O}}{Ester} \chemsign{+} \chemname{\chemfig{H_2O}}{Water} In the reaction above. The 2 in \ce{H2O} is automatically subscripted without requiring additional commands.9 Advanced Graphics For advanced commands and examples.606){\sixunitv{}{2D==O. \documentclass{letter} \usepackage{epic. They provide stylistic enhancements over a uniform style (i. add the following to your preamble: 4.4. This is because the graphic for the first molecule in the reaction (carboxylic acid) extends deeper than the rest of the molecules.96 CHAPTER 4.carom} \pagestyle{empty} \begin{document} \begin{picture}(1000.11 XyMTeX package The following code produces the image for corticosterone below. refer to the chemfig manual. The charge in \ce{AgCl2-} is automatically superscripted. To use this package. where a more thorough and complete introduction to the package can be found. consider the listings \ce{H2_{(aq)}} \\ package described in Source Code Listings. allowing the name to span multiple lines.{{10}}==\lmoiety{H$_{3}$C}.4.5ex plus the depth of the carboxylic acid molecule in between each molecule and their respective names. 4. that constructs such as loops or conditionals are visually For example separated from other text. The phase is not automatically subscripted and needs to be enclosed in parenthesis preceded with a _ as in \ce{H2_{(aq)}. As well as typeset basic 2D chemical structures. 4.4.0){\steroid[d]{3D==O. all in typewriter font) so Chemical species are included using the \ce command. a ^ will superscript it.500) This is fixed by adding \chemnameinit{<deepest \put(0. 1/2 and other fractional amounts are automatically typeset as in \ce{1/2H2O}. Corticosterone as rendered by XyMTeX 4.. The amount of the species precedes the formula. as in \ce{AgCl2}. For typesetting real code.5 LaTeX/Algorithms LaTeX has several packages for typesetting algorithms in form of "pseudocode".1==OH}{cdef}} in a reaction and by adding \chemnameinit{} after the \end{picture} \end{document} reaction: \chemnameinit{\chemfig{R-C(-[:−30]OH)=[:30]O}} \chemname{\chemfig{R’OH}}{Alcohol} \chemsign{+} \chemname{\chemfig{R-C([:−30]OH)=[:30]O}}{Carboxylic acid} \chemrel{->} \chemname{\chemfig{R-C([:−30]OR’)=[:30]O}}{Ester} \chemsign{+} \chemname{\chemfig{H_2O}}{Water} \chemnameinit{} Lastly. A different result is produced by putting the alcohol first: \chemname{\chemfig{R’OH}}{Alcohol} \chemsign{+} \chemname{\chemfig{R-C([:−30]OH)=[:30]O}}{Carboxylic acid} \chemrel{->} \chemname{\chemfig{R-C([:−30]OR’)=[:30]O}}{Ester} \chemsign{+} \chemname{\chemfig{H_2O}}{Water} A few things here are automatically typeset. \chemname{} inserts 1.10 mhchem Package mhchem is a package used to typeset chemical formulae and equations. 1.1 97 Typesetting using the algorithmic and a simple example.. \eIf{understand}{ go to next section\. \TO..5. Declaring a set of keywords(to typeset as functions/operators).[2] 1.01 manual. \begin{algorithmic}[5] will enter the algorithTypically.g. \OR. Like algorithmic. \NOT. caption. Put \usep- ackage{algpseudocode} in the preamble to use the algorithmic environment to write algorithm pseudocode (\begin{algorithmic}. } } \caption{How to write algorithms} \ELSE \STATE{<text>} \ENDIF \FOR{<condition>} \end{algorithm} \STATE{<text>} \ENDFOR \FOR{<condition> \TO <condition> } \STATE{<text>} \ENDFOR which produces \FORALL{<condition>} \STATE{<text>} \ENDFOR \WHILE{<condition>} \STATE{<text>} \ENDWHILE \REPEAT \STATE{<text>} \UNTIL{<condition>} \LOOP \STATE{<text>} \ENDLOOP \REQUIRE <text> \ENSURE <text> \RETURN <text> \PRINT <text> \COMMENT{<text>} \AND.3 as it is a part of their default style sheet.5. LATEX/ALGORITHMS 4. }{ go back to the beginning of \STATE <text> \IF{<condition>} \STATE{<text>} current section\.: Input.5.g. affect the final layout in the document.4. This will not. \While{not at end of this document}{ read than the algorithmicx package.2 Typesetting using the algorithmicx package Typesetting using the algorithm2e The algorithmicx package provides a number of package popular constructs for algorithm designs. ger. layout controls. algorithm2e provides a relatively gin{algorithm}. header text (which appears before the algorithm’s main steps e. current with revtex4-1. The algorithmic package is suggested for IEEE journals 4. You might want to use the algorithm environment (\usepackage{algorithm}) to wrap your algorithmic code in an algorithm environment (\beUnlike algorithmic. \TRUE. the usage between \begin{algorithm} and mic environment and number every fifth line. this package is also not compatible with Revtex-4. dated 2009-08-24.. however. latest updated January 2013 according to the v5.5.[1] 4.0 manual) allows typesetting algorithms with a lot of customization. This may be taken in analogy with writing a latexpreamble before we start the actual document. Basic commands are: section becomes this one\. taken from the v4. Writing the main steps of the algorithm. Below is an example of typesetting a basic algorithm using the algorithmicx package (remember to add the \usepackage{algpseudocode} statement to your document preamble): The package is loaded like The LaTeX source can be written to a format familiar to programmers so that it is easy to read. title. is package \begin{algorithm}[H] \KwData{this text} \KwRe- sult{how to write algorithm with \LaTeX2e } initialThe algorithmic package uses a different set of commands ization\. but with different capitalization. \XOR. E. Most commands are similar to the algorithmicx equivalents. with each step ending with a \. The package algorithms bundle at the ctan repository.\end{algorithmic}). This is not compatible current\. \FALSE Complete documentation is listed at . suiting to the needs of various users. the algorithm floating wrapper (see below) which is designed to wrap around the algorithmic environment. which if given will cause line numbering to occur at multiples of that intecontrols. describes both the algorithmic environment (for typesetting algorithms) and More details are in the manual hosted on the ctan website. \usepackage[]{algorithm2e} \begin{algorithmic} \If {$i\geq maxval$} \State $i\gets 0$ \Else \If {$i+k\leq maxval$} \State $i\gets i+k$ \EndIf \EndIf \end{algorithmic} . \end{algorithm} would be The algorithm2e package (first released 1995..Output) 2. The CTAN-manual The command \begin{algorithmic} can be given the opprovides a comprehensible list of examples and full set of tional argument of a positive integer.\end{algorithm}) to produce a floating huge number of customization options to the algorithm environment with numbered algorithms. The algorithm environment provides this and a few other useful features. The third form accepts as many \ElsIf{} clauses as reWith \algblockdefx you can give the text to be output by quired.ctan.98 CHAPTER 4.and postcondition: \Require <text> \Ensure <text> Functions \Function{<name>}{<params>} <body> \EndFunction \Return <text> \Call{<name>}{<params>} Example: \algblock[Name]{Start}{End} \algblockdefx[NAME]{START}{END}% [2][Unknown]{Start #1(#2)}% {Ending} \algblockdefx[NAME]{}{OTHEREND}% [1]{Until (#1)} \begin{algorithmic} \Start \Start \START[One]{x} \END \START{0} \OTHEREND{\texttt{True}} \End \Start \End \End \end{algorithmic} More advanced customization and other constructions are described in the algorithmicx manual: http://mirror. TECHNICAL TEXTS source. In the text the n-th parameter is referenced by #n.5.4 The algorithm environment It is often useful for the algorithm produced by algorithmic to be “floated” to the optimal point in the document \Comment{<text>} to avoid it being split across pages. there are no limitations as in the old algorithmic package. Note that it is \ElsIf and not \ElseIf. use \If{<condition>} <text> \EndIf \algblock[<block>]{<start>}{<end>} \If{<condition>} <text> \Else <text> \EndIf \If{<condition>} <text> \ElsIf{<condition>} <text> This defines two commands \<start> and \<end> which \Else <text> \EndIf have no parameters. This command will usually be used in conjunction with a org/macros/latex/contrib/algorithmicx/algorithmicx. The text displayed by them is \textbf{<start>} and \textbf{<end>}. Three forms of if-statements: To define blocks beginning with a starting command and ending with an ending command. Renaming things: algorithm to procedure. can also be used in Custom algorithmic blocks front of other commands) The algorithmicx package allows you to define your own \State $x\gets <value>$ environments. the starting and ending command and the number of paLoops: rameters for these commands.pdf \State command as follows: \Function{Increment}{$a$} \State $a \gets a+1$ \State \Return $a$ \EndFunction 4. Note to users who switched from the old algorithmic Include it by adding the package: comments may be placed everywhere in the \usepackage{algorithm} to your document’s preamble. \For{<condition>} <text> \EndFor \ForAll{<condition>} <text> \EndFor \algblockdefx[<block>]{<start>}{<end>} [<startparam\While{<condition>} <text> \EndWhile count>][<default value>]{<start text>} [<endparam\Repeat <text> \Until{<condition>} count>][<default value>]{<end text>} \Loop <text> \EndLoop Pre. require/ensure to input/output \floatname{algorithm}{Procedure} \renewcommand{\algorithmicrequire}{\textbf{Input:}} \renewcommand{\algorithmicensure}{\textbf{Output:}} Basic commands have the following syntax: Statement (\State causes a new line. It is entered into by Comments: . x:=x*x \OD. subsection. subsubsection or nothing (default). maths expressions or programs to indicate a variable name. |print|(z) \ENDPROC \END the “algorithm” environments in the document with the \end{program} corresponding page and the caption. you can add a list of them dure:} \BEGIN \\ % \FOR i:=1 \TO 10 \STEP 1 \DO close to the table of contents. so all the indentation and spacing is done automatically. This is often not desirable. For example: \usepackage[chapter]{algorithm} List of algorithms 4.5. Below is an example of typesetting a basic algorithm using the program package (remember to add the \usepackage{program} statement to your document preamble): \begin{program} \mbox{A fast exponentiation proceWhen you use figures or tables. to state that a particular action system is equivalent to a WHILE loop you can write: More information about all possible commands avail\[ \( \ACTIONS A: A \EQ \IF \B{} \THEN \S{}. \Q. The numbering of algorithms can be influenced by providing the name of the document component within which numbering should be recommenced.5.n) \BODY z:=1. The commands \A. \CALL able at the project page http://developer. p.1$ \ENDIF \ENDWHILE \end{algorithmic} gorithm in a minipage. your document>} \begin{algorithmic} <algorithmic pdf environment> \end{algorithmic} \end{algorithm} Algorithm numbering The default numbering system for the algorithm package is to number algorithms sequentially.5 Typesetting using the program package The program package provides macros for typesetting algorithms. \R. particularly in large documents where numbering according to chapter is more appropriate. Use \origbar to get a normal | symbol in a program. chapter. section. z:=z*x \OD. algorithm>} \label{<your label for references later in org/macros/latex/contrib/algorithms/algorithms. Just put |expt|(x. n:=n/2. An example from the manual This is an example taken from the manual (official manual.The commands \( and \) are redefined to typeset an alarrow N .berlios. eg \S‘‘. \listofalgorithms \DO \IF |odd|(n) \THEN \EXIT \FI.14) \begin{algorithm} % enter the algorithm environment \caption{Calculate $y = x^n$} % give the algorithm a caption \label{alg1} % and a label for \ref{} commands later in the document \begin{algorithmic} % enter the algorithmic environment \REQUIRE $n \geq 0 \vee x \neq 0$ \ENSURE $y = x^n$ \STATE $y \Leftarrow 1$ \IF{$n < 0$} \STATE $X \Leftarrow 1 / x$ \STATE $N \Leftarrow -n$ \ELSE \STATE $X \Leftarrow x$ \STATE $N \Leftarrow n$ \ENDIF \WHILE{$N \neq 0$} \IF{$N$ is even} \STATE $X \Leftarrow X \times X$ \STATE $N \Leftarrow N / 2$ \ELSE[$N$ is odd] \STATE $y \Leftarrow y \times X$ \STATE $N \Left. n:=n-1. \COMMENT{This is a comment statement}. so an algorithm can appear as a \end{algorithm} single box in a formula.i). For example. The legal values for this option are: part. and LaTeX will print a list of \}. \{ n>0 anywhere in the document. \B.de/docman/?group_id= A \ELSE \CALL Z \FI \QE \ENDACTIONS \) \EQT \( 3442 \WHILE \B{} \DO \S{} \OD \) \] . Primes work normally. \DO \IF n=0 \THEN \EXIT \FI.4. \P. The notation |variable_name| can be used within normal text. the algorithm package pro.ctan. \\ |newline|() \OD % \rcomment{This text will be set flush to the right margin} \WHERE \PROC vides a similar command. Each line is set in math mode. LATEX/ALGORITHMS 99 \begin{algorithm} \caption{<your caption for this The official manual is located at http://mirrors. \T and \Z typeset the corresponding bold letter with the next object as a subscript (eg \S1 typesets {\bf S$_1$} etc). \S.|expt|(2. m := 0. The listings package supports highlighting of all the most common languages and it is highly customizable. that means \CALL Z \ENDACTION \ENDACTIONS \END it doesn't recognize the programming language by itself. \begin{program} \seq{|line| := `` ''. http://mirrors.6 LaTeX/Source Code Listings x = 2 \AR y:=y^2 \utdots \BAR x = n \AR y:=\displaystyle\sum_{i=1}^n y_i \FI \DO 2 \origbar x \AND x>0 \AR x:= x/2 \BAR \NOT 2 \origbar x 4. \IF \B2 \THEN \EXIT(2) \FI \OD. that is very useful if you created a \ACTIONEQ % i := i+1. \end{program} You can specify the language while including the file with Here’s the original program: the following command: And here’s the transformed and corrected version: You can also specify a scope for the file. \CALL |inhere| \FI . |write|(|line|) \OD \end{program} This comes in handy if you are sure that the file will not change (at least before the specified lines). '' \concat p \FI . |line| := |line| \concat `` is: '' \concat p. you just have to recompile the LaTeX \CALL |more| \ENDACTION |inhere| \ACTIONEQ % code and your document will be updated.100 CHAPTER 4. m := 0. several dialects are supported. i := i+1. |last| := |item|[i]. This way. modify the source. \ACTIONS |prog|: |prog| \ACTIONEQ % \seq{|line| := `` ''. is to |alldone| \FI . you need: A Reverse Engineering Example. \CALL |inhere| \ENDACTION l Another possibility.pdf Dijkstra conditionals and loops: \begin{program} \IF x = 1 \AR y:=y+1 \BAR 4. \EXIT \FI \OD \end{program} To use the package. If you wish to include pseudocode \S1. Rogério Brito (2009). The command p := |number|[i]. i := i+1 \OD . For age. \CALL |more| \ENDACTION |more| \AC. m := 1. i := 1}. \CALL the full file name.For some of them. \WHILE i \neq n+1 \DO |line| := |item|[i] \concat `` '' \concat |number|[i]. will be highlighted according to your settings.5. \IF \B1 \THEN or algorithms. You may also omit the firstline or lastline parameter: it means everything up to or starting from this point.stackexchange. but it doesn't TIONEQ % \IF (m=1) \THEN p := |number|[i].ctan. refer to the documentation that comes . i := 1}. It will be considered plain text and it l \ENDACTION |alldone| \ACTIONEQ |write|(|line|). |line| := |item|[i]. \IF (i=(n+1)) \THEN \CALL program on several files and you are still editing it.6 References [1] [2] http://tex. |line| := `` ''.1 Using the listings package \AR x:= \modbar{x+3} \OD \end{program} Using the package listings you can add non-formatted text as you would do with \begin{verbatim} but its main aim is Loops with multiple exits: to include the source code of any programming language \begin{program} \DO \DO \IF \B1 \THEN \EXIT \FI. p := 0. you may find Algorithms and Pseudocode useful also. Lines can be numbered by setting \NumberProgramstrue and numbering turned off with \NumberProgramsfalse Package page Package documentation 4. if you |write|(|line|). \WHILE i \neq n+1 \AND |item|[i] = |item|[i-1] \DO |line| := |line| \concat ``. If you just want to write code within your document the package \begin{program} \VAR \seq{m := 0. within your document. '' \concat |number|[i]). |last| := `` provides the lstlisting environment: ''}. This is a basic example for some Pascal code: The package also provides a macro for typesetting a set like this: \set{x \in N | x > 0}.org/ more information. |line| := matter: you can include any file but you have to write |line| \concat ``.6.in the example there is a Python source.com/questions/70181/ revtex4-1-and-algorithm2e-indentation-clash Supported languages It supports the following programming languages: • The official manual for the algorithms pack. \IF |item|[i] \neq |last| \THEN import the code from the source itself. TECHNICAL TEXTS macros/latex/contrib/algorithms/algorithms. 6. i++) { using the caption package.} as you could with any other programming language. a set of settings. puts(“Hello world!"). has ANSI. i. If you add the above By default. the special characters by defining them like so The above table will cover most characters in latin languages. i. In this example.You can have fancy captions (or titles) for your listings ment. it should be within your distribution puts(“LaTeX is also great for programmers!").g. The extendedchar option only works for within the code: 8-bits encodings such as latin1.e. style. . i < N. we create one command to ease source code inclusion.. // Line com. Specification of the dialect is tory for these languages (e. Automating file inclusion If you have a bunch of source files you want to include. Here is an example for listings. In the example above.. The option to write the file name twice thanks to the macro.To handle UTF-8. The C part will print as mandalan- 3. It supports Mathematica code only if you are typing in plain text format. The meaning is explained next to any line. LATEX/SOURCE CODE LISTINGS 101 with the package. check the official docu.4. Objective and Sharp. all the code between the string “A” package. and “B” will be parsed as LaTeX over the current listings See Macros for more details. guage={[x86masm]Assembler}).c} Notes 1. 2. Finally escapeinside={A}{B} will define delimiters for escaping we list all listings with this command from the listings into LaTeX code.4 in the Listings DocThe package lets you define styles. } \end{lstlisting} \lstinputlisting[caption=Scheduler. Style definition In our example. the following can be used to alter the settings for source code. 12 of the listings manual for an overview. style=customc]{hello. the comments for Octave start with %. for example. You can't include *. we only set two options globally: the default style and the escape character. 4.e. profiles specifying umentation. We set the default style to be customc. } return under the name listings-*. 0. in which case they are Encoding issue read as LaTeX (with all LaTeX commands fulfilled) until they're closed with another *).NB files \lstinputlisting{. multiple dialects are supported. This is where macros show their real power. C. Usage: Customizing captions \begin{lstlisting} #include <stdio. and they are going to be printed in the document unless they start with %*. For a more detailed explanation of the usage of the literate option check section 5. Settings You can modify several parameters that will affect how the code is shown. you may find yourself doing the same thing over and over again. Modelica is supported via the dtsyntax package available here. you should tell listings how to interpret mentation. listings does not support multi-byte encoding paragraph.dvi. You can put the following code anywhere in the document (it doesn't matter whether before or after \begin{document}). but Mathematica can export in a pretty-formatted LaTeX source. Another possibility is to replace \usepackage{listings} (in Example the preamble) with \usepackage{listingsutf8}.h> #define N 10 /* Block * comment */ int main() { int i. change it according to your needs. for (i = 0. escapeinside There are many more options. Handel. See p. For these languages. All listings will have their name as caption: we do not have The escapeinside line needs an explanation. Some packages such as the tipa package are effectively standard within the field. • The xy package itself has a steep learning curve. the xlist enviroment is used. TECHNICAL TEXTS The minted package • Attribute-Value Matrices (AVMs): avm minted is an alternative to listings which has become pop• John Frampton’s expex: expex ular. • tikz-qtree has the same syntax as qtree. but uses PGF/TikZ. syntactic trees. while others will vary by author preference. so There are several commonly used packages for creating please have a look at their GitHub repo and their manual. which allows more options for drawing arrows. the kinds of numbered examples that are used in linguistics publications.7. \ex This is the third. \ex \begin{xlist} \ex This is a sub-sub-example.6. the setup require a few more steps than a usual LaTeX package. \ex This is a second sub-sub-example. etc. \end{exe} produces: Some recommended packages[1] : • Glosses: gb4e.2 CHAPTER 4.1 Enumerated examples As the package relies on external Python code.3 References gb4e A lot more detailed information can be found in a PDF by Carsten Heinz and Brooks Moses.102 4. \ex This is a second sub-example. 4. It is based on PGF/TikZ but does not require prior knowledge of TikZ in order to be used productively.6. convenient interface to draw dependency graphs. feature matrices. • Dependency trees and bubble parses: • The TikZ-dependency package provides a high-level. To create nested lists of examples. \begin{exe} \ex This is the first example. xyling is very powerful but not as user friendly as qtree. and each will have its own number. OT tableaux. 4. \begin{exe} \ex This is an example. The gb4e package[2] is called with: Details and documentation about the Listings package \usepackage{gb4e} can be found at its CTAN website. let it be the last \usepackage call in the document’s preamble. but allows a lot of control. Otherwise you may get exceeded parameter stack size error. Multiple examples can be included within the environment. produces: • Alternatively. for simplest trees use the xymatrix feature and arrows.7 LaTeX/Linguistics There are a number of LaTeX packages available for writing linguistics papers. \ex This is the second example. • IPA symbols: tipa. IPA fonts. It uses the external Python library Pygments for code highlighting. \end{xlist} \end{xlist} \end{exe} produces: . Examples for this package are placed within the exe environment. 4. and many other applications. and each example is introduced with the \ex command. Various packages have been created for enumerated examples. \begin{exe} \ex \begin{xlist} \ex This is a sub-example. which as of Nov 2014 boasts over 300 supported languages and text formats. \end{exe} • OT Tableaux: OTtablx. • Syntactic trees: qtree + tree-dvips (for drawing arrows). IMPORTANT: If you use gb4e package. S [. LATEX/LINGUISTICS 103 For notating acceptability judgments. This package uses two main commands. and different LaTeX mal LaTeX documents.NP LaTeX ] [. When including a judgment marker.2 Syntactic trees Often. \item \begin{enumerate} anywhere in the document. linguists will have to illustrate the syntactic structure of a sentence. qtree centers syntactic trees on the page. \eenumsentence{\item This is a sub-example. The former is used for singleton examples. The root of a (sub)tree is always preceded by a . referencing section for more details. qtree Drawing trees with qtree is relatively straightforward. \begin{exe} \ex This sentence is grammatical English.V is ] [. \begin{exe} \ex\label{ex1} Godzilla destroyed the city. \ex[*] {This sentence English in ungrammatical is.7.VP [. \end{exe} produces: 4.4.} For example. The effect of the latter can be \item This is sub-sub-example.} Full documentation can be found here.7.. \item This is a second sub-example. trees available for LaTeX. but (\ref{ex2}) While there are several packages for drawing syntactic contains only one. \end{enumerate} } produces: IMPORTANT: If you use gb4e package.NP fun ] ] ] produces this syntactic tree as output: \enumsentence{This is the first example. \end{exe} Sentence Constituent trees (\ref{ex1}) contains two arguments. This behaviour can be turned off by either specifying the behaviour when loading the package \usepackage[nocenter]{qtree} % do not center trees or via the command Multiply nested examples make use of the normal LaTeX \qtreecenterfalse % do not center trees from here on list environments. \ex\label{ex2} Godzilla roared.} \enumsenNote that the spaces before the closing brackets are tence{This is the second example.} By default. leaf nodes are simply expressed by their labels. is the third. \enumsentence and \eenumsentence. while the latter command is used for nested examples. the following code \Tree [. the corresponding sentence must be surrounded by braces. Further details can be found in the full documentation available here. each (sub-)tree is indicated by brackets [ ]. Unfortunately.} \enumsentence{This mandatory. the qtree package has to be included in the document’s preamble: lingmacros \usepackage{qtree} The lingmacros package[3] created by Emma Pease is an alternate method for example numbering. First. See the labeling and crosspackages are suited for different formalisms. \enumsentence{This is an example. the \ex command can take an optional argument. let it be the last . One device for doing this is through syntactic trees. trees look very different Referencing examples in text works as it does in norin different grammar formalisms. \item This is a second undone by using the command \qtreecentertrue % center trees from here on sub-sub-example. A new tree is started using the \Tree command. this article focuses on the qtree and xyling packages. However. put the make trees grow from left to right \tikzset{every tree node/. change the direction of a single tree. tikz-qtree is another easy-to-use alternative for drawing syntactic trees. it has to be put into a \tikzpicture environment: \begin{tikzpicture} % all changes only affect trees within this environment \tikzset{grow'=right} % To use the tikz-qtree package for drawing trees.V is ] running text.NP LaTeX ] [.VP [. some of qtree’s advanced features are implemented in a different way. put them into a centered envi.NP LaTeX ] [. trees are not centered by Dependency trees can take multiple visual forms.5\tikzleveldistance) node {\textit{This is an example tree. use the following code: \tikzset{grow'=right} % make trees grow from left to right \tikzset{every tree node/. tikz-qtree Using the same syntax as qtree.}}.5cm] child { node {an} } child { node {example} } child { node {.V is ] [. they quite resemble phrase structure trees.NP fun ] ] ] \end{center} For setting the style of trees.NP LaTeX ] [.NP LaTeX ] [. left to right etc. like so: % In the preamble: \usepackage{tikz} % In the document: \begin{tikzpicture} \node (is-root) {is} [sibling distance=3cm] child { node {this} } child { node {tree} [sibling distance=1.VP [.S [. tikz-qtree provides the \tikzset command.) or different styles for edges.monly.NP fun ] ] ] \end{tikzpicture} The syntax of tikz-qtree and result when drawing a simple tree is the same as for qtree.VP [. \path (is-root) +(0. to make a tree grow from left to right instead of from top to bottom.} } child[missing] }. For simple trees. On the other hand. TECHNICAL TEXTS \usepackage call in the document’s preamble.style={anchor=base west}} % allign nodes of the following into the document’s preamble: tree to the left (west) \Tree [. Otherwise you may get exceeded parameter stack size error.−2. other than for qtree. they can be captured by brackets drawn above \begin{center} \Tree [.S [.style={anchor=base west}} % allign nodes of the tree to the left (west) \Tree [. tikz-qtree is completely interchangable with qtree. or not at all.S [.NP fun ] ] ] The above code changes the default orientation for all trees that are defined after \tikzset commands.V is ] [.NP fun ] ] ] Note that.S [.V is \usepackage{tikz} \usepackage{tikz-qtree} ] [. \end{tikzpicture} . To only Two-dimensional Dependency Trees These can be either achieved using the fairly universal drawing package TikZ. For example. To center them.104 CHAPTER 4. Alterronment: natively. [.VP [. Dependency Trees \Tree [. Comdefault. tikz-qtree provides other features such as controlling the direction of the tree’s growth (top to bottom. It gives you fairly good control A dependency tree drawn with TikZ-dependency. of how the brackets are typeset but requires compiling . \\ \end{deptext} \deproot{3}{ROOT} \depedge{2}{1}{ATT} \depedge[edge start x offset=−6pt]{2}{5}{ATT} \depedge{3}{2}{SBJ} \depedge{3}{9}{PU} \depedge{3}{4}{VC} \depedge{4}{8}{TMP} \depedge{5}{7}{PC} \depedge[arc angle=50]{7}{6}{ATT} \end{dependency} This code snippet would produce the following result: A dependency tree created using xyling Dependency Trees as Brackets above Text One way to typeset dependency brackets above running text is using the package xytree.} which gives you a drawing like this: Dependency Trees using TikZ-dependency The package provides high level commands to design and style dependency graphs.} } results in: A dependency tree created using TikZ TikZ has the advantage that it allows for generating PDF directly from the LaTeX source. write the text of the sentence within the deptext environment and use depedge commands to draw the edges. you only need to create a dependency environment. without need for any detour of compiling to DVI using latex.4.U){−2}"_{\small conj}" \xybarconnect(UR.U){2}"^{\small conj}" &~~~& \xybarnode{Mary} &~~~& \xybarnode{bought} \xybarconnect[8](UL. namely xyling.} } \medskip \textit{This is an example tree. Latter is the case of another package based on the package xy. as shown in the following example: % In the preamble: \usepackage{tikz-dependency} % In the document: \begin{dependency}[theme = simple] \begin{deptext}[column sep=1em] A \& hearing \& is \& scheduled \& on \& the \& issue \& today \& . To draw a graph.U){−4}"_{\small subj}" \xybarconnect[13]{6}"^{\small punct}" \xybarconnect[8](UR. LATEX/LINGUISTICS which gives you the following drawing: 105 the LaTeX code to DVI (and perhaps converting to PDF using the tools dvips and ps2pdf later). Global and local optional parameters can be used to style and fine tune the looks of the graph. and then converting to PDF probably via PS using tools such as dvips and A dependency tree above running text created using xytree ps2pdf. The code for a similar tree using xyling might look like: % In the preamble: \usepackage{xytree} % In the document: \Tree{ & \K{is}\B{dl}\B{drr} \\ \K{this} &&& \K{tree}\B{dll}\B{dl}\B{dr} \\ & \K{an} & \K{example} && \K{. An example code: % In the preamble: \usepackage{xytree} % In the document: \xytext{ \xybarnode{Peter} &~~~& \xybarnode{and} \xybarconnect(UL.U){4}"^{\small obj}" &~~~& \xybarnode{a} &~~~& \xybarnode{car} \xybarconnect(UL.U){−2}"_{\small det}" &~~~& \xybarnode{.7. ELA\\ \trans `Pekka became afraid Punctuation marks that are normally used in LaTeX are also rendered faithfully in the IPA environment. The second and third arguments give the text and its gloss respectively.4 IPA characters The tipa package is the standard LaTeX package for International Phonetic Alphabet symbols.E \. TECHNICAL TEXTS Glosses \begin{IPA} text in IPA format here \end{IPA} Below.ELA} representing symbols that don't have other associations. The fourth argument is the translation. because of the/a bear.NOM Basic symbols eat.SG. Alternatively. \textipa{ABCDEFGHIJKLMNOPQRSTUVWXYZ} Vertically aligned glosses are separated by spaces. But after the \ex tag.L \. and items within each column are divided by the usual & tabular separator.ACC\\ \trans `The cat eats The IPA format works by translating ASCII characters sour cream' \end{exe} into corresponding IPA symbols. to be in IPA.B \.Y} produces: There are two methods for getting IPA symbols into a The \: macro produces retroflex symbols. The first way is to use the IPA environment.A \. introduce the example and its gloss using \gll and the translation after it with \trans tag. Its first argument specifies the number of columns in the gloss. This command is similar to other font typesetting commands. For a complete list see the official TIPA Manual[4] . \textipa{\:d \:l \:n \:r \:s \:t \:z} . Lower case letters are rendered as usual. produces: Numerals and @ also have variants in the tipa environment. document.PRS sour-cream. . there are a number of special macros for karhu-sta. \begin{exe} \ex \gll Pekka pel\"astyi karhusta.106 4.3.' \end{exe} \textipa{! * + = ? .G \. This command takes four arguments and builds off the normal tabular environment. \usepackage{tipa} The \. macro preceding a capital letter produces a small caps version of the letter. there is the \textipa command that will format the text in its argument into IPA. it is explained how to make glossed examples with This method is useful for long stretches of text that need different packages.7.3 CHAPTER 4. use the normal exe environment. 4.7. The code will produce the following output: \textipa{abcdefghijklmnopqrstuvwxyz} however capital letters are rendered differently. \textipa{\. \textipa{text in IPA format here} \begin{exe} \ex \gll Кот ест сметану\\ cat. {`Pekka became afraid because of the/a bear.\\ Pekka {became afraid} bear. With gb4e To create a glossed example.I \.} {Pekka & became afraid & bear. / [ ] ( ) ` ' | ||} With lingmacros The lingmacros package uses the \shortex command to introduce glossed examples inside the \enumsentence and \eenumsentence commands. \textipa{1234567890 @} produces: \enumsentence{\shortex{3} {Pekka & pel\"astyi & In addition. so if it’s necessary to include a space in part the gloss.R \.'} } some of which are listed here.H \. simply produces: enclose the connected parts inside braces. 4.7.7. \textipa{\!b \!d \!g \!j \!G \!o} gets you: 4. • The gb4e package page on CTAN.6 External links • LaTeX for Linguists • The qtree package for drawing syntactic trees.7.5 References [1] LaTeX for Linguists presentation [2] The gb4e package on CTAN [3] The lingmacros package on CTAN [4] TIPA manual 4. LATEX/LINGUISTICS gets you: The \! macro produces implosive symbols and the bilabial click. 107 . but this time with the extension . merely use the command It is common to place it at the end of the document. The file has the same name as the LaTeX input file. The makeindex program generates a sorted index with the same base file name. add to command line: -s simpleidx. but a different extension (.ist same index entry.1 LaTeX/Indexing Compiling indices Especially useful in printed books. this sorted index gets included into the document at the point where To enable the indexing feature of LaTeX. likely near the reason for the key. LaTeX supports the creation of indices with its package makeidx. use where key is the index entry and does not appear in the final layout. Type in the command line: makeindex filename Note that filename is without extension: the program will look for filename. each \index command writes an appropriate index entry.1 Using makeidx If now the LaTeX input file is processed again. When the input file is processed with LaTeX.ist” • MakeIndex alone: Options→Execution Modes→Accessories→MakeIndex. package must be loaded in the preamble with: The index created by latex with the default options may and the special indexing commands must be enabled by not look as nice or as suitable as you would like it. 5. 108 • Texify/PDFTexify: Options→Execution Modes→Accessories→PDFTeXify. since it tells LaTeX to create tory structure. usually below the makeindex subdirectory.idx and use that. run it with the command line option: dex. For example. This is quite useful for proofreading a document and verifying the index.ind. Here are some configuration tips for typical tools: can be re-written as to create an entry called 'Fourier Series’ with a reference to the target page. together with the current page number.ist . the text makeindex -s <style file> filename If you use a GUI for compiling latex and index files. usually located somewhere in the tex direcdone within the preamble.To tell makeindex to use a specific style file. add to the Switches: --mkidx-option="-s simpleidx. and its support program makeindex. You can optionally pass filename. Multiple uses of \index with the same MakeIndex settings in WinEdt Say you want to add key on different pages will add those target pages to the an index style file named simpleidx. the makeidx LaTeX finds \printindex. To imputting the prove the looks of the index makeindex comes with a set command into the input file preamble. The showidx package that comes with LaTeX prints out all index entries in the right margin of the text.idx file can then be processed with the makeindex program. an index is an alphabetical list of words and expressions with the pages of the book upon which they are to be found. This should be of style files. the files needed for indexing. To tell LaTeX what to in.idx).Chapter 5 Special Pages 5. To show the index within the document. The default index format is two columns.idx directly to the program as an argument. This . you may have to set this in the options. to a special file. You enter the index commands at the points in the text that you want to be referenced in the index.1. called on some systems makeidx. intoc option can be used when declare the nomencl package.ist -o filename. LATEX/INDEXING 109 Sophisticated indexing saries package described in the Glossary chapter. add you have to add it manually. in the index.e.1.2 Abbreviation list Generating index You can make a list of abbreviations with the package Unfortunately.nlo -s nomencl. as in To add index as a chapter. 5. To combine with the above feature for subentries. Run LaTeX 2 times then makeindex filename. the classified entries will be sorted too. Another option is the package acronym . 10 to every command. so Multiple pages To perform multi-page indexing. The best place for this command is der 'input' (which itself is categorized into 'encodings’). Controlling sorting In order to determine how an index key is sorted.e. ą. append a | and the name of some command which does the formatting. or |. 5. use but now you also have to pass a name as the first argument This will appear in the index as bulldog. i. ¶ or µ. By default. place a value to sort by before the key with the @ as a separator. In most cases the characters are treated as special characters and end up in the same group This rule does not hold for \".) you may find that the sorting “is not quite right”. have your nomenclature list. In most languages that use Latin alphabet index. etc. main section on bulldogs with a bold page number. current version of xindy and hyperref are innomencl . texindy . and on page 10 of the same book you wish to show the This package provides the same commands as makeidx. such that all the bolded entries 5. @.command: ting of a page number. 5. Below are examples of \index entries: To enable the Nomenclature feature of LaTeX.1. ó. For example. use these commands: The entry in the index for the subentry 'History' will be If you use the book class. so one example may be so that the entry in the index will show as ' F⃗ ' but be sorted as 'F'.. which are otherwise escape characters. If you use texindy in place of makeindex.1.nls followed by running LaTeX once again. ture[⟨prefix⟩]{⟨symbol⟩}{⟨description⟩} command for each symbol you want to have included in the would create an index entry with 'cp850' categorized unnomenclature list. you may want to start it on an the range of pages between the two \index commands.1. so to put the letter ä in the as @. The title of the list can be changed using the following Changing page number style To change the format. a |( and |) to the end of the \index command.3 Multiple indices For example. one must quote these characters in the \index command by putting a double quotation mark (") in front of them. This is useful if there is any formatting or math mode. You may also be interested in using the glos.5 International indices If you want to sort entries that have international characters (such as ő. you instead of using the code in Adding Index to Table Of should style the appropriate component(s): Contents section. it’s not correct. Index won't show in Table Of Contents.5. if on page 3 of a book you introduce bullIf you need multiple indices you can use the package dogs and include the command multind . To add the abbreviation list to the table of content. odd page by using \cleardoublepage. these can be Issue the \nomenclamarked off with !. the nomencl package must be loaded in the preamble with: Subentries If some entry has subsections. Put \printnomenclature at the place you want to terminology.compatible. immediately after you introduce the symbol for the first These are called subsubentries and subentries in makeidx time. one may still use \index{a@\"{a}}. Using special characters In order to place values with !. a key for " would be \index{""}). When you use textbf or textit modifiers. 3. ç. This command should only accept one argument. and one can only place a " in the index by quoting it (i.4 Adding index to table of contents will be placed before all others by default.1. Latvian. not only English. Norwegian. beginning of words. generating indices ready to use by LaTeX Outside of Kile Class: Compile Source extension: idx using xindy is a bit more complicated than with makein.xdy from latin2. Hausa. you have to load the definiton style for build the associated glossary. Swedish. Ukrainian and Vietnamese.. as LaTeX internally enPlace \usepackage{glossaries} and \makeglossaries in codes all letters to plain ASCII. Then define any number of \newglossaryentry and if you have. as opposed to makeindex (the default). Klingon. adding it to QuickBuild). Then stops with pepper your writing with \gls{mylabel} macros (and simERROR: Could not find file “tex/inputenc/utf8.2 LaTeX/Glossary package. you have to either redefine the MakeIndex tool in tem than the makeindex system. It supports multiple glossaries.xdy” ilar) to simultaneously insert your predefined text and error. longtabu environment provided by the tabu package.110 will print error message:unknown cross-reference-class `hyperindexformat'! (ignored) and won't add those pages to index. Romanian. one does not need to write: new tool and redefine other tools to use it (for example by to get the Lin entry after LAN and before LZA.xdy iconv -f latin2 -t utf8 latin2. but with Polish. if your . Work-around for this bug is described on the talk page. Lithuanian.idx' Advanced: Type: Run Unfortunately. While it’s not a problem for entries containing polish letters. though if you live. Croatian. Compile Icon: the one you like First. xindy can natively sort indices known to the general population. Finally add a \printglossaries call to locate obvious solution (adding -C utf8) doesn't work. English. Polish. Finnish.[1] Users requiring a simpler solution should consider hand-coding their entries by using the description environment. Hungarian. To generate international index file you have to use texindy instead of makeindex. it is for accented letters at your preamble (after \usepackage{hyperref} if present). Icelandic. Macedonian. → Tools → Build.idx 5. you have to load it explicitly: utf8.ind produced by texindy will be encoded in ISO-8859-2 5.ind file. Russian. This package replaces the glossary package and can be used instead of the nomencl package. Sorbian.tex is saved using UTF-8.xindy in kile To use texindy instead of makeindex in kile. -M lang/polish/utf8 In the end we have to run such command: texindy -L polish -M lang/polish/utf8 filename. acronyms. Second. Settings → Configure Kile. it’s enough to write The xindy definition should look similar to this: But what is much more important.. German. Greek. for example an "średnia” entry. LaTeX doesn't like preamble (recommended) or before first use in your docif part of the file is in UTF-8 and part is in IS-8859-2. instead. Turkish.xdy >utf8. for example in Poland it may be ISO8859-2 or CP-1250. CHAPTER 5. the . SPECIAL PAGES in folder /usr/share/xindy/tex/inputenc (You must have root privileges) xindy is a much more extensible and robust indexing sys. lang/polish/utf8 -I latex '%S. Kurdish. texindy the glossaries list within your document structure. Latin. Mongolian. Hebrew. we need to know which language is prominently Many technical documents use terms or acronyms unused in our document.xdy if you wish to use xindy (recommended) for the indexing phase. Czech. we need to know in what encoding the . French. File processing must now include a call to makeglossaries followed by at least one the headings using -M switch: further invocation of latex or pdflatex. The fix this. Gypsy. or define For example.1 Jump start if you use only -L polish. Italian.Target extension: ind Target file: <empty> Relative dir: <empty> State: Editor Menu: Add tool to Build menu: dex. Serbian Slovak. Portuguese. Check the parameter to the inputenc 5. Estonian. Slovenian. they create new index entry groups. Spanish.tex project file is saved. Georgian. to add a glossary to make such documents more accessiDanish. Esperanto. It is common practice in Albanian. it can properly sort General: Command: texindy Options: -L polish -M index files in many languages. Belarusian. you need . or the I don't know if other languages have similar problems.2 Using glossaries Additional way to fix this problem is use “iconv” to create To use the glossaries package. Bulgarian. The glossaries package can be used to create glossaries. The ument proper. In most cases it will be UTF-8 or ISO-88591. ble.2. Dutch.2. you'll get a \newacronym glossary and acronym entries in your "Ś" encoded in ISO-8859-2 . and symbols. makeglossaries simply provides a con. Therefore it’s needed to extend our example and specify how to sort the word: This command prints the plural of the defined term.5. <abbrv> is the abbreviated form of the you define and how it is going to be used. For such See also Custom Name at the bottom of this page.Note that not all glossary styles show defined symbols.entry in glossary. tion). by adding “s” (we will learn how to use them in next secThis command creates the link as usual. it does it by omitting latex loaded before glossaries it will also be hyperlinked to the macros (\"{\i}) thus incorrectly sorting the above exam. venient interface to makeindex and xindy and is not essential. glossary entries use the command longnewglossaryentry Finally. users who wish to make use of makeglos. to define a computer entry: example. itemized lists.3 Defining glossary entries To define a new acronym you use the \newacronym macro: To use an entry from a glossary you first need to define it. This is not always the case as the Description of commands used in above example: next entry will show: When you define terms. figures.You can also define both a name and a symbol: mally present by default on Microsoft Windows platforms. you need to remember that they This command prints the term associated with <label> will be sorted by makeindex or xindy.2.4 Defining terms When you have defined a term. you can use it in a document. for For example. This command prints the plural form with first letter of You can also specify plural forms.2. Defining acronyms 5. For example. macro: <label> is a unique label used to identify an entry in glossary. other than that it behaves in the same way as gls. This command prints the singular form of the term with the first character converted to upper case. That said. The above example defines an entry that has the same la. tables.Defined entries can also be symbols: saries will need to have Perl installed — this is not nor. place the following command in your document in which the description follows the key-value list. etc. . a description is more complex than just a paragraph. ple as nave. There are many different commands used to refer To define a term in glossary you use the \newglossaryentry to glossary terms. A general reference is used with \gls command.2. Sometimes. if they are not formed the term converted to upper case. you may want to have multiple you need to specify the toc option: paragraphs. because it doesn't understand TeX macros. <settings> are comma separated key=value pairs General references used to define an entry. For example: Note that a defined entry won't be included in the printed Defined acronyms can be put in separate list if you use glossary unless it is used in the document. If the hyperref package was a bit more LaTeX aware.5 Using defined terms 5. While xindy is passed as its argument. It can also take several options Or. the glossary entries have been defined as key-value For the glossary to show up in your Table of Contents. This enables acronym package option: you to create a glossary of general terms and just \include it in all your documents. acronym and <full> is the expanded text. but typesets the tion): alternate text instead. lists. putting it inside symbol class. for acronyms: which changes its default behavior (see the documentaThis will avoid the wrong long plural: Frame per Seconds. In addition. If. where <label> is the unique label identifying the There are few ways to define an entry depending on what acronym. it will interpret the word exactly as it was defined. makeindex won't fare much better. The computer entry then looks like this: preamble in order to generate the glossary: Any links in resulting glossary will not be “clickable” unless you load the glossaries package after the hyperref Defining symbols package. LATEX/GLOSSARY 111 to specify the xindy option: So far.2. you have glossary entries defined as those above. 5. before words beginning with naa.you might use it in this way: bel and entry name. The name of the glossary section can be replaced with a custom name or translated to a different language.then. 9 My suppress the location list within the glossary. invoke makeglossaries — a script which selects the correct character encodings and language settings and which will also run xindy or makeindex if these are specified in your document file .112 CHAPTER 5. define new (dual) entries for glossary and acronym saryentry{<label>}{description={Output of glsdesc}. use : If you just want to print the abbreviation "<abbrv>".} Custom Name Referring acronyms Acronyms behave a bit differently than normal glossary terms. Add the option title to \printglossary to specify the glossary’s title. You may also the first letters of the terms) want to use \usepackage[nonumberlist]{glossaries} to M My First Term Has some long description 7..} tions]{label}{abbrv}{long}{description} This command prints what ever is defined in \newglos. build your LaTeX document — this will also generdefine the acronym with a reference to the glossary entry ate the files needed by makeglossaries like this: Refer to acronym with \gls{OWD} and the glossary with \gls{gls-OWD} To make this easier. The glossary and the list of acronyms can be displayed separately in different places[3] : 5. use this If you just want to print the long version of an acronym code: with the abbreviation "<full> (<abbrv>)". On subsequent uses only the abbreviation will be displayed. On first use the \gls command will display "<full> (<abbrv>)". the default glossary and the list of acronyms will some long description 7.3 Displaying the Glossary A number of pre-built styles are available.[2] If no custom glossaries are A|B|C|D|F|G|I|M|O|R|S|C|D|G|M|P A A First term Has defined. Add the option toctitle to specify a the title used in the table of content (if not used. [4] To reset the first use of an acronym use: or.3. 9 be displayed. list like this: . if you want to reset the use status of all acronyms: If you just want to print the long version of an acronym without the abbreviation "<full>". use Changing Glossary Entry Presentation Using Glos: sary Styles 5. .1 Building your document Dual entries with reference to a glosssary entry from Building your document and its glossary requires three an ancronym It may be useful to have both an acronym steps: and a glossary entry for the same term. SPECIAL PAGES This command prints what ever is defined in \newglos. Second Term Has some long description 7. 9 B Barely missed first Has some long description 7. 1. use : Remove the point To omit the dot at the end of each description.. 9 If all entries are to be printed the command altlistgroup or listgroup (group adds grouping based on can be inserted before \printglossaries. 9 Separate Glossary and List of Acronyms altlisthypergroup or listhypergroup (hyper adds an hyperlinked 'index' at the top of each glossary to jump to a group) \printglossaries will display all the glossaries in the order in which they were defined. and can be changed easily using Commonly used styles include list To display the sorted list of terms you need to add: My Term Has some long description 7. title is used as default). To link these two. we can use this command (modified from example in the official docs): 2... My Term Has some long description 7.Syntax: \newdualentry[glossary options][acronym opsaryentry{<label>}{symbol={Output of glssymbol}. 9 at the place you want the glossary and the list of acronyms altlist (inserts newline after term and indents description) to appear. description={is the rate of deactivation from .html#dx1-35001 [3] http://mirror. if you define glossaries in a file.5 References See description on TeX. You need to restart Texmaker after installation of xindy. that is.ac.3 and 2 twice. and install (original source here).4 Example for use in windows distance}}]{R0}{$R_{0}$}{F\"{o}rster with Texmaker distance} \newglossaryentry{r0}{name=\glslink{R0}{\ensuremath{R_{0}}}.org/ tex-archive/macros/latex/contrib/glossaries/ • Using LaTeX to Write a PhD Thesis.. ckage[xindy]{imakeidx} \makeindex latex doc makeglossaries doc latex doc If your entries are interlinked (entries themselves link to other entries with \gls calls).2 Document preamble In preample should be included (note. and TeX need first do download and install xindy for Win.html#dx1-43001 [4] User Manual for glossaries. EXAMPLE FOR USE IN WINDOWS WITH TEXMAKER 3. and of course xindy for sorting.xindy. 3.C.4 Include glossary definitions and print glossary Include glossary definitions in the preamble (Before "\begin{document}") \loadglsentries[main]{INP-00-glossary} % or using \input: %\input{INP-00-glossary} \begin{document} Print glossaries. Choose command 1 1.. in Texmaker. Command = makeglossaries % Now push Alt+Shift+F1and then ->F1 [1] http://www. ex.org/macros/latex/ contrib/glossaries/glossaries-user. http://tug. hyperref should be loaded before the glossaries): \usepackage[nomain. go to User -> User Commands -> Edit User Commands. near end \appendix \bibliographystyle{plainnat} \bibliography{bibtex} \printindex \printglossaries \end{document} 5.5.log and doc. .emission)}.sty v4.glg Write all your glossaries/acronyms in a file: Ex: INP-00files in a text editor for clues. Talbot.ox. 5.html#sec:printglossary • The glossaries documentation. sort=k} dows.acronym. Glossary definitions If you encounter problems. and also adds the binaries to your windows PATH: Download xindy.4. Nicola L. Then.4.4. you will need to run steps 1 5. and you where latex is your usual build call (perhaps pdflatex) and use \include{INP-00-glossary} \makeglossaries \usepadoc is the name of your LaTeX master file..ox.}..org/macros/latex/ contrib/glossaries/glossaries-user. but users of MiK.uk/sites/ctan. Menuitem = makeglossaries 2.text=$k_{DE In TeX Live xindy is already included. in the following order: 1.ac. glossary.13 http://mirror. 2.org/macros/latex/ contrib/glossaries/glossaries-user.ac. 1. Alexa 488} \newacronym[description={\glslink{r0}{F\"{o}rster 5.text=F\"{o}rster distance. to update PATH references to xindy and Perl binaries. sort=R} \newglossaryenWindows with Texmaker try{kdeac}{name=\glslink{R0}{\ensuremath{k_{DEAC}}}.In distance. view the doc.org/pkg/nomencl [2] http://mirror.4.1 Compile glossary with xindy .02 as of 2014.description={F\"{o}rster where 50\% . This install program includes the Perl interpreter for makeglossaries.tex \newacronym{ddye}{D$_{\text{dye}}$}{donor dye.uk/sites/ctan.uk/sites/ctan. There are two approaches: • The easy one. 2.ox.ctan.4.01.4. 5. But note: This installs deprecated versions of them all! • The more difficult one.toc]{glossaries} % nomain. build your LaTeX document again — to produce a document with glossary entries Thus: 113 5.SE: How to use Xindy with MiKTeX? This way you can update yourself if necessary.ctan. bib).ber itself is not the parameter. I am effectively telling LaTeX that I will only ment need reference labels of one character in length. once again. will show up inside the same brackets. thebibliography is a keyword that LaTeX recognizes as everything between • Glossaries. \TeX{} or \LaTeX{} \cite{lamport94} can be used. The cite_key for citing references. If that author has produced more than one reference for a given year.114 CHAPTER 5. \end{thebibliography} Sometimes you want to refer to a certain page. LaTeX has a variety of features that make dealing Next is the actual reference entry itself.5. so what is going on here? The first thing to notice is the establishment of the environment.2 Citations To actually cite a given document is very easy. that usually means at the very end of your document.you want more than nine. The advantage here. but the number of digits is. incorporating ref. a much more powerful should be a unique identifier for that particular reference. is telling LaTeX how wide the item label will be when printed. which ultimately means no more than nine references in total. This is prewith references much simpler. Therefore. glossaries FAQ OK. C. 'a'. Talbot. Here is a practical Referring more specific example: \begin{thebibliography}{9} \bibitem{lamport94} Leslie Lamport. then I add letters after. flat-file database. you should do whatever works for you.1 Embedded system If you are writing only one or two documents and aren't planning on writing more on the same subject for a long time. such as '56' which allows up to 99 references. If it were totally manual.. 5. and use the following: \cite{cite_key}. etc. 'b'. Nomenclature.5 LaTeX/Bibliography Manage. the citation will be cross-referenced with the bibitems and replaced with the appropriate number citation.ber. where the cite_key is that of the bibitem you wish to cite. lamport94). which I supplied after the begin statement. read many!). 1994. When writing about topic AB. numbers and punctuation symbols (alwith LaTeX). is that LaTeX looks after the numbering for you. (BibLaTeX uses this same syntax. Lists of Symbols and the begin and end tags as being data for the bibliograAcronyms. Nicola L. You need to type it as you want it to be presented. on different lines for readability. that the num5. 215”. Addison Wesley. bibliographies can be split over as many files as one wishes. which replaces the end-of-sentence spacing with a non-breakable inter-word . and flexible solution is achieved thanks to an auxiliary and is often some sort of mnemonic consisting of any setool called BibTeX (which comes bundled as standard quence of letters. typesetting systems like that you have to use where you want the bibliography. such as author. Talbot. 2nd edition. LaTeX provides an environment called thebibliography Instead of WYSIWYG editors. Note the tilde in [p. then input any two-digit numerences into a document is an important task. However.5. both of these files can be linked into the document (perhaps in addition to sources ab. I often use the surname of the first BibLaTeX. a tool configurable within LaTeX syntax. Go to the point where you want the citation to appear. nately. If For any academic/research writing. etc. SPECIAL PAGES • glossaries FAQ. Note however. Nicola L. a centralized bibliography source can be linked to as many documents as desired (write once. so there can be a file containing sources concerning topic A (a. as you would have to re-number all the citations by hand. These linebreaks are ignored by LaTeX. Massachusetts. including built-in support fixed with the \bibitem{cite_key} command. But. Everything after the key is the reference itself. For that you can use the arguments to the \cite command: \cite[p. and citations made to any record that is contained within the file. author. Recently. title.~215]{citation01} The argument. then adding or removing a reference would be a real chore. Fortu. link phy. When LaTeX processes the document. \emph{\LaTeX: a document preparation system}.~215]. you might not want to waste time creating a database of references you are never going to use. Of course. In this case you should consider using the basic and simple bibliography support that is embedded within LaTeX. I wanted the title to be in italics. just before the \end{document} command. 5. This is often more convenient than embedding them at the end of every document written.bib) and another concerning topic B (b. BibTeX has been succeeded by though not a comma). followed by the last two digits of the year (hence BibTeX provides for the storage of all references in an external. “p. figure or theorem in a text book. so I used the \emph{} command to achieve this.bib specific to topic AB). The mandatory argument. C. I have put the different parts of the reference.) This database can be referenced in any LaTeX document. Here’s an example: The command requires six mandatory parameters. These options also allow some other aspect of the bibliography to be controlled.~}. 5. Once done. If you want an extra space. e. (Chomsky 1956. you will see that each reference is numbered and each citation corresponds to the numbers.. 5. There is a command called Multiple citations \bibpunct that can be used to override the defaults and When a sequence of multiple citations are needed.5. An example of a BibTeX override this default and list all authors associated with entry: that citation. and can be seen in the table (right). in 1995 something. order to get LaTeX to use the Natbib package: \usepackage[options]{natbib} Also. There are some other specialized commands @article{greenwade93.3 BibTeX I have previously introduced the idea of embedding references at the end of the document. as it’s not as flexible as it could be. In other disciplines.}{.numerical style. Natbib Using the standard LaTeX bibliography support.citation03} The result will then be shown as citations inside the same brackets. No cite If you only want a reference to appear in the bibliography. al. you need to change the bibliography style file to be used.5. 1. The citations are lowing in the preamble: then separated by commas. You will also notice how Natbib by default will compress references A BibTeX database is stored as a . \cite{citation01. It is a plain text with three or more authors to the more concise 1st sur.bib file.5. 3. it’s a short document and you can learn The first job is to add the following to your preamble in even more about how to use it.author-year style. you can of the file is also quite simple. The symbol that appears between multiple citations. to the basic \cite command.. I want to do a little better than this method. The structure name et al version. So as you can see.numerical superscript style. includes all entries from the database. 4. The symbol for the closing bracket. e. A discussion about which is best will not occur here. I have put the folshould use a single \cite{} command. The numeric style of citation is quite common in scientific writing.. such as Harvard is preferred.g. This argument takes a letter: • n . whether they are referenced in the document or not. 'parenthesized'. title = “The {C}omprehensive {T}ex {A}rchive . this package is quite flexible.g. 1957). it is basically a matter of altering the existing \cite commands to display the type of citation you want. For example. so edit the appropriate line at the bottom of the file so that it reads: \bibliographystyle{plainnat}. LATEX/BIBLIOGRAPHY MANAGEMENT 115 space. and so can be viewed and edited easily.} spaces between the citations. In this tutorial. 2. author = “George D. A special version of the command.. In fact. you change certain settings. Note that you must not use \bibpunct{(}{)}{. 6. in multiple citations when there is a common author.}{a}{.file. The symbol for the opening bracket.citation02. Keep in wade”.” should not be separated from the page and will automatically choose between all authors and et number. \nocite{*}. and then using the \cite command to cite them within the text. Some of the options controlled by \bibpunct are also accessible by passing options to the natbib package when it is loaded. the author-year style. (Roberts. then you need {. as Natbib allows the user to easily switch between Harvard or numeric. The final area that I wish to cover about Natbib is customizing its citation style. • s . • any other letter . for example: Lamport showed \nocite{lamport95}. By adding an asterisk (*).. but not where it is referenced in the main text. The punctuation to appear between the author and the year (in parenthetical case only). and “p. I will concentrate on using The main commands simply add a t for 'textual' or p for BibTeX. listed in the table here. Do have a look at the Natbib manual. but a possible way to get such an output is by the natbib package. then the \nocite{} command can be used. The punctuation used between years. Greenthat Natbib supports. it can supersede LaTeX’s own citation commands. 2003). There are two reasons: end-of-sentence spacing is mind that for instance abbrvnat does not support \citet* too wide. especially as you can easily switch between different citation styles by changing a single parameter. when BibTeX processes and outputs acters with umlauts (ü. It is up to you as to how you wish to label each with the surname. It is this identifier that is achieved easily using curly braces. number. are compound surnames. it needs the ands one opening the field. You do not need to add a comma to the last attribute. I have referred to an article must be careful with a few special names. all the fields. there will only be an 'and' between the penultimate the format \"{o}. address = “Reading. causing an error in the parsing of so that it can keep track of the individual authors.bib file with. You must therefore manually tell tation key. The As we can see from another example: field names on the left are BibTeX keywords. Using \usepackage[utf8]{inputenc} in the preamble to the . I personally use the former. year = “1993”. but remember that Each entry begins with the declaration of the reference the order you input them (or any data within an entry for type. author = “Michel Goossens and followed by an equals sign (=) where the value for that Frank Mittelbach and Alexander Samarin”. it should be clear that what follows are the rele. curly braces have other roles. which is the ci.tex source file can get round this. This for all entries in your bibliography. It “342-−351” } can accept names in forename surname or surname. title = "". So. title.bib file. author = "".done by putting the keyword and in between every author. there is inlike. entry. But as you will soon see. ö. journal. Much of the information contained therein is repeated in the following table for your convenience. since the closing brace @article An article from a magazine or a journal. where there within a journal. however.This book has three authors. This key must be unique BibTeX to keep the 'von' and 'Neumann' together. within attributes.scribed. will tell BibTeX that there are no more attributes for this • Required fields: author. and what fields each type has available (and which ones are required or optional. and each is separated as deing. publisher = bel the beginning and end of each value.plus any middle names. vant fields and data for that particular reference. pages. I personally use “Addison-Wesley”. since you have a comma to reference. for example “John von NeuAfter the type. '}'). %month = "". This allows a consistent Be careful if you copy the following templates. since their notation is in this. and for papers presented at conferences. and the quotation mark will close the and last authors. avoiding the is not valid to comment out lines in bibtex files. you also have the option } of using curly braces ('{'. A notable exception is when you want to use char. In this form. SPECIAL PAGES {N}etwork ({CTAN})".mann”. } them. year. forename. It may be worth bookmarking or printing %volume = "". want to comment out a line.Standard templates out any need for special markup. note. as the accented characters can just be stored in the . common ones are: book. BibTeX knows of practically that matter) is customizable and so you can get BibTeX all types you can think of. but there is a loose standard in which you use separate the surname from the forename. etc). then you proceedings. O Optional fields • Required fields: author/editor. volume = “14”. This is very simply Next. pages = BibTeX can be quite clever with names of authors. title = field is then placed. one follows immediately after the brace. you have to put it outside the Remember that each attribute must be followed by a entry. • Optional fields: volume.116 CHAPTER 5. forename. %pages = "". year = these pages so that they are easily at hand when you need “XXXX”. It can take a while to learn what the reference types are. year = “1993”. in the form of @type. or the BibTeX key. title. comma to delimit one from another. BibTeX assumes that the last word nify the beginning of the reference attributes. you must have a left curly brace '{' to sig. %note = "". number = “3”. although you won't get an error if you do. journal = "". the author’s surname. but within the . there is the issue of how to tell BibTeX when a This is the scheme that I use in this tutorial. Secondly. BibTeX expects you to explicitly la“The LaTeX Companion”. If you need to use braces when there are umlauts to consider. They are @book{goossens93. If you use the forename surname method. In this example. Massachusetts” quotation marks ("). %number = "". This is easily avoided this entry. Of course. reference has more than one author. followed by the year of publication. So the final result you will use within your document to cross-reference it to would be “John {von Neumann}". month. the reference. @book A published book + Required fields. . so I prefer not to use them for this job as they can get more confus. etc). the % sign format to be kept throughout the . and everything before is the forename. year. publisher. journal = Authors “TUGBoat”. look at this entry type reference and also this field reference for descriptions of @article{Xarticle. The first is the surname. artito manipulate the input and then output it however you cle.bib file. %author = "". author = "". thesis ries. note. author = "". booktitle = "". edition. year. title = "". author = "". %address= "". @conference Equal to inproceedings @manual{Xmanual. month. year. %edition= "". month. series. edition. note. %address = "".%month = "". %volume = "".%month = "". note. “diploma thesis”). @misc Template useful for other kinds of publication @inbook A section of a book without its own title. %note = "". %howpub. chapter. %year = “XXXX”. %pages = "". %type = "". • Required fields: title. year = "". %address = "". %address= "". note. %note = "". month. howpublished. %month = "". booktitle= "". title. chapter = "". type. volume/number. title = "". howpublished. %series = "". • Optional fields: author.D. %month = "". @misc{Xmisc. • Optional fields: editor. ings. address. school = "".@inproceedings An article in a conference proceeddress. %address = "". publisher. @booklet{Xbooklet. %type = “diploma thesis”. year. "". pages = "". title = "". year = "". %volume = "".@phdthesis Ph.5. %address = "". %month = "". %number = "". %number = "". year = “XXXX”. address. se. booktitle = "". %month = • Required fields: title. year = "". publisher = "". %series = "". %chapter= @phdthesis{Xphdthesis. month. author = "". • Required fields: none • Optional fields: author. title. } • Required fields: author. type. %edition= "". month. address. %title = "". %address = "". school. title. publisher= "". title. ad. year. title = "". %publisher = "". school. volume/number. %month = "". year = “XXXX”. volume/number. school = "". author = "". series. @incollection{Xincollection. %pages = "". pages. %editor = "". %address = "". %volume = "". %author = "". pages. %note = "". address. • Optional fields: volume/number. @inbook{Xinbook.5. year. address. @mastersthesis{Xthesis. title. title = "". title @booklet A bound work without a named publisher or = "". zation = "". %author = "". sponsor. %note = "". year. keywords. chapter “XXXX”. %series = "". } . %note = "". note. } • Optional fields: author. year. %volume = "". month. note. author = "". month. %keywords = "". %note = "". edition. %organi• Required fields: author. title = "". se. year = “XXXX”. %pages = "". • Optional fields: editor. %edition = "". } • Required fields: author. %address = "". month. note. • Optional fields: editor. @book{Xbook. note.@manual Technical manual lished = "". organization. • Required fields: author. booktitle. } ries. month. %month = "". year = "". publisher. %number = "". %editor = "". editor = "". title = "". %edition = "". %note = "". title. publisher= "". %howpublished = "". } dress. } %month = "". %note = "". • Optional fields: type (eg. address. pages. %volume = "". year. } and/or pages. %note = "". title = "". } @incollection A section of a book having its own title. publisher. year = "". month. booktitle. author = "". %publisher= "". year. %note = "". series. @conference{Xconference. organization. "". %number = "". @inproceedings{Xinproceedings. title. %organization = "". %series = "". ad. %series = "". • Optional fields: address. %editor = "". note. %month = "". booktitle. LATEX/BIBLIOGRAPHY MANAGEMENT 117 • Optional fields: volume/number. year = • Required fields: author/editor. %number = "". publisher. } @mastersthesis Master’s thesis • Required fields: author. organization. edition. note. %type = "". • Required fields: title. %year = "". %month = "". which may help when writing scientific articles for different magazines. To tell BibTeX to keep them. address. organization.for ex. author = "". Firstname format. Karin and Miller. S. conferences with different BibTex styles that do sometimes keep and sometimes not keep the capital letters: title = {{The LaTeX Companion}}. (or letters. year = "". %address = "". As an alternative. title = “Lysis and the interaction between free phages and @electronic infected cells”.it will look odd if a different capitalization format is used: ries. or if “pH” is to be used is a If you have to cite a website you can use @misc. address. title = “The {LaTeX} Companion”. } be to enclose single words in braces. %note = "". %number = "". Patents. and In the event that BibTeX has been set by the chosen style Kreuzer. institution. volume/number. and Mosig. @collection author = “Abedon. for exstyle that capitalises all first letters. Below you will find a few additional examples of bibliog• Required fields: author. and Thomas. and Hyman. ample: . title = "".”. authors in the Surname. as • Optional fields: editor. Gisela to not preserve all capitalization within titles. and Spicer. Eric S.118 CHAPTER 5. title in all caps or small caps. title = "". John W. and the second one deals with the incollection case. %editor = "". book. many people simply put double curly braces. year. and Black.”. curly brackets is the most feasible if using a template unnote. title. %organization = "". Preserving case of letters editor = “Karam. @article{AbedonHymanThomas2003. use the good and Carlson. %volume = "". The first one covers the case of multiple • Optional fields: month. %type = "". title = “Experimental examination of bacteriophage latent-period evolution as a response to bacterial availNot standard templates ability”. raphy entries. note = "". note. as it may mess up the kerning. number. T. } @techreport Technical report from educational. year = “2003”. @unpublished An unpublished article. pages = “397-−405”. %month = "". pages = “7499-−7506” (see Cite Patents with Bibtex for an alternative) }. try other BibTex styles or modify the existing. that lower-case letters may need to be preserved . T. se. Eleanor”. if it’s an acronym) and all will be well! It is even possible publisher = “ASM Press. Jim D. %number = "". • Required fields: author. thesis. S. year. @unpublished{Xunpublished. institution be avoided if possible. @patent BiBTeX entries can be exported from Google journal = “Applied and Environmental Microbiology”. However. title = "{The LaTeX Companion}". such as for journal submissions. %address = "". publisher. P. old curly braces around the letter in question. avoid putting the whole title in curly braces. %month = "". @incollection{Abedon1994. and Kutter. Lindsay W. The approach of putting only relevant text in • Optional fields: type. %publisher = "". Kenneth N. Dwight and Eiserling. C. month. year = pecially with biblatex.[1] so the first step should generally “XXXX”. month. note. booktitle = “Molecular biology of bacteriophage T4”. %series = "". Elizabeth or acronyms. problems and Hall. title = "". year. } author = “Abedon. Washington DC”. title. A few additional examples etc. %note = "". author = "". @proceedings{Xproceedings. Frederick A. For convenience though. can occur. especially if you are referring to proper nouns. der the control of a publisher. es= "". volume = “69”. commercial or standardization institution. Using curly braces around single letters is also to @techreport{Xtreport.year = “1994” ample if a chemical formula is used in a style that sets a }. Karam and Drake. SPECIAL PAGES @proceedings The proceedings of a conference. ) \bibliographystyle{plain} After the first LaTeX run.. The ones I created for this tutorial were called sample1.. However. you will see errors such as: \bibliography{sample1. At the moment.g \bibliography{/some/where/sample} or \bibliography{. pdflatex latex_source_code. url = "http://www. 119 than one reference at the same time. e. you need to place the fol.aux 3.sample2.htm" }. . month = “November”.bib file was elsewhere (which makes sense if you intend to maintain a centralized database of references for all your research). do the following: \cite{ref_key1.bib. year="2010”. You should see output like the folwith BibTeX). LATEX/BIBLIOGRAPHY MANAGEMENT @misc{website:fermentas-lambda.bib file you wish to use. . Rerun to get cross-references right. making sure that the ref_key corresponds exactly to one of the entries in the . latex latex_source_code. bibtex latex_source_code.bib The second command is the one that actually specifies the .bib file The next step is to run bibtex on that same LaTeX source when processed for output.bib file.tex 2. if your .bst (which comes as standard within that document.tex 4. you don't include the file extension. latex latex_source_code. . year = “2008”.bib file) to then define all the references file in this instance is plain.aux The style file: output of this tutorial to see what I mean).5. and the document will be output as expected.. the plain style does a pretty good job (look at the level auxiliary file: latex_source_code. . Bibliography styles are files recognized by BibTeX that tell it how to format the information stored in the . after the content. ref_keyN}.bib.. you need to specify the path as well. As you can guess.tex . it’s almost complete. sample2. but once again. however listed above is declaring which style file to use. If you want a pdf output instead of a dvi output you can use pdflatex instead of latex as follows: 1. Version 0..99c (Web2C 7.aux 3. to type (into command line): publisher="Eggs Ltd. title = “Phage Lambda: description \& restriction map”. latex latex_source_code./sample1} (if the . the .”. which is invoking LaTeX for the second time will see more errors like “LaTeX Warning: Label(s) may have changed. Why won't LaTeX generate any output? The addition of BibTeX adds extra complexity for the processing of the source to the desired output.”.bst extension lowing: when using this command. but before \end{document}). LaTeX Warning: There were the next bib file. undefined references.5. author = “Fermentas Inc..tex At the end of your LaTeX file (that is..bib file is in the same directory as the LaTeX document too. means you have to run LaTeX a number of times. without further problems.3. all you have to do is follow its instructions.tex document that calls it). Don't be alarmed. And so the first command (or more precisely the corresponding AUX file. Despite its This is BibTeX. The \cite{ref_key} is the command you need. bibtex latex_source_code. Here’s what you need journal="Theoretical Easter Physics”. pdflatex latex_source_code. samplen. This @article{blackholes.bib file is in the parent directory of the . 1.1) The topname. ref_key2. This is largely hidden to the user.(Extensions are optional. Each author="Rabbert Klein”. If you wish to cite more The third step.tex Getting current LaTeX document to use your . The style not on the actual . as it is assumed. but because of all the comThe note field comes in handy if you need to add unstrucplexity of the referencing of citations from your source tured information.samplen} % Note the lack of whitespace between the commas and LaTeX Warning: Citation `lamport94' on page 1 undefined on input line 21.. you acsue of the journal has yet to appear: tually need multiple passes to accomplish the task..bib. . You do not need to add the . plain.bib file 4.fermentas. pass will perform a particular task until it has managed to title="Black Holes and Their Relation to Hiding Eggs”.. for example that the corresponding isLaTeX file to the database entries in another file. pdflatex latex_source_code. Now that LaTeX and BibTeX know where to look for the appropriate files.bst Database file #1: sample.”.com/techinfo/nucleicacids/ maplambda.tex note="(to appear)" } 2. and run LaTeX for the third time.. resolve all the citation references. if you put them note that the lowing commands: bibtex command takes the AUX file as input. actually citing the references is fairly trivial. :! pdflatex % 4. url = "http://www. it is much easier to install the Vim-LaTeX plu• Overview of Bibtex-Styles: Filterable list of styles gin from here. I couldn't open file name 'current_file. :! bibtex %:r (without file extension. :! pdflatex % 2. not in insert mode.) Note that if you are editing your source in vim and attempt to use command mode and the current file shortcut (%) to process the document like this: 1.120 CHAPTER 5. . keep in mind that you will need to use the nat. as is shown below: 1. it looks for the AUX file as mentioned above) 3.aux pdflatex latex_source_code. :! pdflatex % plain 2. This allows you to simply type \ll when with preview.com}" Another way is to use special field url and make bibliography style recognise it. SPECIAL PAGES (Extensions are optional.are provided with urlbst. If you need more help about URLs in bibliography.bib pdflatex latex_source_code. :! pdflatex % alpha However.tex bibtex latex_source_code. and all the appropriate commands are automatically executed to compile the document.tex. visit More examples can be found here: FAQ of UK List of TeX. :! bibtex % You will get an error similar to this: 1.tex Note the usage of \url command to ensure proper appearance of URLs. Below you can see three of the styles available with LaStyles provided by Natbib (see below) handle this field.com" Bibliography styles You need to use \usepackage{url} in the first case or \usepackage{hyperref} in the second case. One possibility is to include Internet addresses in howpublished field of @misc or note field of @techreport. To process your document from within vim. abbrv and alpha) However. @article. howpublished = "\url{http://www. bib package to use most of these.pdf: latex_source_code. ModiHere are some more often used styles: fications of three standard styles (plain.example. @book: latex_source_code. Then you can simply create a Makefile and use vim’s make command or use make in shell. you must explicitly abbrv name the file without the file extension for bibtex to work. Another option exists if you are running Unix/Linux or any other platform where you have make.example. and whether or not it has to run bibtex. This is just one of the many nice features of Vim-LaTeX.aux' It appears that the file extension is included by default when the current file command (%) is executed. The Makefile would then look like this: As you can see. if you put them note that the bibtex command takes the AUX file as input. you can read the excellent Beginner’s Tutorial for more about the Including URLs in bibliography many clever shortcuts Vim-LaTeX provides. TeX: other styles can be modified using urlbst program.tex latex_source_code. there is no field for URLs.tex pdflatex latex_source_code. Vim• Preview of several often used styles LaTeX even detects how many times it has to run pdflatex. • Mendeley Mendeley is cost-free academic software make sure the name of the . Once complete. you can layout each bibliography entry acmanuscripts published. it will then output the appropriate style file for \nocite{Name89} % Show Bibliography entry of Name89 you to use. what order to put them in. which means it would be impractical to go through an example in this tutorial. you may find it desirable to adapt the appearance of your bibliography to the document language. to which authors must adhere if they want their Alternatively. and actually asks visible: you a series of questions about your preferences. unless you are using Helpful tools one of the standard style files (such as plain or plainnat. babunsrt. where it For babelbib to take effect. .bst extension!). it is fairly straightforward.5.bst file) for those users of BibTeX. It’s possible to make uncited entries based on your needs. LATEX/BIBLIOGRAPHY MANAGEMENT Customizing bibliography appearance 121 Localizing bibliography appearance When writing documents in languages other than English. At the command line.\usepackage[fixlanguage]{babelbib} lications tend to have their own style of formatting ref. If you are using a custom built . This concerns words such as editors. bababbrv. You will notice how different pub. This is a common theme in LaTeX in general.these will be automatically found in the directories that they are installed. For example. The language of an entry is specified as an additional field It can achieve this because of the nature of the . but nothing about style. then there is a comprehensive manual available.must be used: A bibliography style file (.bst file you want to use is for managing PDFs which can manage a bibliograreflected in the \bibliographystyle{style} command (but phy in Open Office and read BibTeX. Unfortunately. The babelbib package can be used here. don't include the . note that the default answers are pretty sensible). that come bundled with LaTeX . language = {german} } is stored in a structured format. and. Also. babplai3. Google Scholar offers the option to return properly formatted output. and so the resulting BibTex code is prone to a variety of minor errors. making it easy to build your own database. or in as well as a proper typographic layout. One of the main advantages of BibTeX. it is important that LaTeX can find it! So. It is very simple. a bibliography style supported tries as much as possible to keep content and presentaby it . % . Which is why Makebst (also known as custom-bib) is the Showing unused items tool we need. In fact. add people who write many research papers.5. Usually LaTeX only displays the entries which are reMakebst can be used to automatically generate a ..\selectbiblanguage{german} erences. One should be alert to the fact that bibliographic databases are frequently the product of several generations of automatic processing. where all the information about your references @article{mueller08.bst file ferred to with \cite. especially in older entries. You will have to answer quite a few (although. make sure it’s in the same directory as the LaTeX source file. \nocite{*} % Show all Bib-entries It should be installed with the LaTeX distribution (otherwise. to layout the bibliography in German. However. and bababbr3 . which can also be turned on in the settings page. tion separate. babalpha. type: Getting bibliographic data latex makebst LaTeX will find the relevant file and the questioning process will begin.bst file. I'd recommend experimenting with it and seeing what the results are when applied to a LaTeX document.bib in the BibTeX entry: database. you can download it) and it’s very simple to initiate.bst) will tell LaTeX how to for\bibliographystyle{babplain} mat each attribute. is the ability to the following to the header: customize your bibliography to suit the requirements of a given publication..one of babplain. established journals and cording to the language of the cited document: conference organizers often will have created their own bibliography style (. especially for For example. Many online databases provide bibliographic data in BibTeX-Format. creating such a style by hand is not a trivial task. what punc\bibliography{sample} tuation to use in between particular attributes etc. to \usepackage{babelbib} do all the hard work for you. And if you require further guidance. It can export citations in BibTeX format. It features a very usable user interface and provides a number of features like smart folders based on keywords and live tex display. • Citavi Commercial software (with size-limited free demo version) which even searches libraries for citations and keeps all your knowledge in a database. Web queries to Google Scholar. well resolved and never more than a few keystrokes away. starting web queries (e.122 CHAPTER 5.jnlp) • Referencer Referencer is a Gnome application to organise documents or references. • KBibTeX KBibTeX is a BibTeX editor for KDE to edit bibliographies used with LaTeX. PubMer. and ultimately gen- • CiteULike CiteULike is a free online service to organise academic papers. KBibTeX can be embedded into Kile or Konqueror. Export of the database to all kinds of formats is possible. SPECIAL PAGES erate a BibTeX bibliography file. plain text. Based on BiBTeX. g. and PDF files. BibDesk • Zotero Zotero is a free and open reference manager working as a Firefox plugin or standalone application. arXiv & PubMed IDs. arXiv and a number of other services are also supported. Citeseer. and can “scrape” BibTeX data from many popular websites. and slightly different UI. Works together with MS Word and Open Office Writer. sourceforge. • Ebib — a BibTeX database manager for Emacs. As KBibTeX is using KDE’s KParts technology. Moreover plug ins for browsers and Acrobat Reader exist to automatically include references to your project. JabRef • KBib Another BibTeX editor for KDE. JabRef can export in many other output formats such as html.net/jws/jabref. written in Java. Note: This Plugins is vulnerable to an XSS attack -> http://www. Features include comfortable input masks. capable of importing and exporting bib files. or unstandardized bibliographic references from email alerts. Google or PubMed) and exporting to PDF. IEEEXplore and arXiv and feed and manage your BibTeX local databases with your selected articles. • BibDesk BibDesk is a bibliographic reference manager for Mac OS X.org/plugin:bibtex • BibSonomy — A free social bookmark and publication management system based on BibTeX. • JabRef is a Java program (under the GPL license) which lets you search many bibliographic databases such as Medline. It offers a straightforward way to import and export bibliographic records. DOI. .dokuwiki. It can be used online without being installed (http://jabref. • Synapsen — Hypertextual Card Index / Reference Manager with special support for BiBTeX / biblatex. RTF and XML/HTML. MS Word or EndNote. • Bibwiki Bibwiki is a Specialpage for MediaWiki to manage BibTeX bibliographies. Literatur-Generator • cb2Bib The cb2Bib is a tool for rapidly extracting unformatted. Features include BibTeX reference generation from PDF files. It has similar capabilities. PostScript. • Bibtex Bibtex is a DokuWiki plugin that allows for the inclusion of bibtex formatted citations in DokuWiki pages and displays them in APA format. journal Web pages. Other methods sites that people compile as a list of their own publications. It’s not uncommon to find . but it can work section-like) output showing all your references. and allow The first line just terminates the current paragraph and you to view them in a more efficient manner. it will be like the ones created by chapters (second option. use \cleardoublepage to match the style used. See the tocbibind CTAN page for detailed documentaSummary tion. numbering. % Use \clearpage instead if the document class uses the “oneside” argument \renewcommand*{\refname}{} % This will define heading of bibliography to be empty.5. As unnumbered item If you want your bibliography etc. chapter).bib file. include the following code in the preamble: \usepackage[nottoc. List of Tables and the Table of Contents itself import and export Bibtex files. . you'll likely use this way: \cleardoublepage % This is needed if the book class is used. you should also use \phan\end{thebibliography} tomsection command to enable hyperlinking from the taOr. add these lines between \bibliographystyle and \bibitem{bib:one_book} some information \bibliography. to place the anchor in the correct page. Or in those huge.numbib]{tocbibind} • Bibtex Editor . as well as page. and your TeX document will include the \cleardoublepage bibliography by these commands: \phantomsection \bibliographystyle{plain} \addcontentsline{toc}{chapter}{Bibliography} \bibliography{mybibtexfile} This trick is particularly useful when you have to insert Both of these examples will create a chapter-like (or the bibliography in the Table of Contents. And having them in a structured form. and 5. the Table of Contents (first option. it will not be handled quite the same: it will not inserting a new line in the Contents page. document structure etc. % because the bibliography will start on its own page. it’s an efficient way to handle your references.4 Bibliography in the table of contents the third argument will be printed on the corresponding line in the Table of Contents. but you are bibliography using something like: free to write whatever you like. you'll likely insert your ment will automatically write when you use it.bib files. your references will be saved ble of contents to bibliography. If you are using separate \begin{thebibliography}{99} bib file. if you are using BibTeX.). section. The second line will add a line in sort them and check for errors. Although it can take a little time to get to grips with BibTeX. There are a variety of free utilities that can load your . Endnote. in the long term. appear in the Table of Contents.5.5.you're writing an article) lows customizable output is another one. online bibliography databases. in a . or a survey of relevant works within a given topic. just add the following two often find BibTeX versions of publications.. Possible to The tocbibind package can also handle including the List of Figures.(OR \addcontentsline{toc}{section}{Bibliography} if vantage. But even for anything. and then no more \clearpage hassle! \addcontentsline{toc}{chapter}{Bibliography} Having all your references in one place can be a big ad. \bibitem{bib:one_article} other information If you use hyperref package. to fit almost any scenario. If you are writing a book. If you want to have proper Din 1505.bib file. that al.An online BibTeX entry generator and bibliography management system.bib files on web.. it will though the resulting “References” looks like a chapter or record the info as described and the current page number. LATEX/BIBLIOGRAPHY MANAGEMENT 123 • Literatur-Generator is a German-language online This will include the Bibliography in the Table of Contool for creating a bibliography (Bibtex. tents without numbering. Simply include this code in the preamble of your document: \usepackage[nottoc]{tocbibind} As numbered item If you instead want bibliography to be numbered section or chapter. It has many options for numbering. toc). When LaTeX finds the code above. Using tocbibind The most comfortable way of adding your bibliography to the table of contents is to use the dedicated package tocbibind that works with many standard document classes. so . in the Table of Contents. you to be in the table of contents. so it’s a quick lines just before the thebibliography environment: cut-and-paste into your own . here Bibliography was chosen because it’s the same text the thebibliography environIf you are writing a book or report. not say which entry types they can be used with. it is more configurable in its output and provides a multitude of new styles (for output) and fields (for the database) that can be used in a document. For now. biblatex is widely considered the `successor' of BibTeX. eprinttype Multimedia entry types • @inbook = @bookinbook = @suppbook • @collection = @reference • @mvcollection = @mvreference • @incollection = @suppcollection = @inreference • @artwork • @audio • @image • @movie • @online = @electronic = @www • @music • @report = @techreport • @performance • @thesis = @mastersthesis = @phdthesis • @video .. shortjournal.5.. shorthandintro..place a normal Some field types are defined. but will never be used in standard styles: the \renewcommand block: \renewcommand{\refname}{\section{Sources}} % Using “Sources” as the title of the section \begin{thebibliography}{99} . annotation • entrysubtype • file • label • library • nameaddon • origdate. refer to its comprehensive documentation on CTAN. A date can either be given in parts or full. SPECIAL PAGES you can.5 biblatex As we said before. shorthand. 5. but the documentation does section heading before the bibliography entries. Intended as a full replacement for BibTeX.. either lists of person names. • language • pubstate • urldate All physical (print) entry types share further optional field Some entry types are hard to distinguish and are treated types: the same by standard styles: • url. is title. doi • @article is the same as hypothetic *@inperiodical and therefore encompasses existing @suppperiodical • eprint. eprintclass. \end{thebibliography} You may wish to use \renewcommand*{\refname}{\vspace*{−1em}} followed by \vspace*{−1em} to counteract the extra space the blank \refname inserts. origlocation.bib files • addendum. \be. shorteditor. Some field types are lists. • abstract.. reprinttitle. All entry types also require either date or year and they specify which of author and editor they expect or whether they can use both... note The following table shows most field types. page references are provided as ranges and certain special fields contain verbatim code. There are many kinds of titles. indextitle • pagination.124 CHAPTER 5. bookpagination • shortauthor. shortseries shorttitle The only field that is always mandatory.. \section{Bibliography} % . some keys are necessary. • Note: Use \bibname instead of \refname if you use the book or report class. others are literal lists. origpublisher • origtitle. \end{thebibliography} is either because they depend on another field being set to be useful or they can always be used in a user-defined Another even easier solution is to use \section inside of manner. Some field types can optionally be used with any entry type: Entry and field types in . This gin{thebibliography}{99} . If we define our online resources like this: [3] http://ctan. Example with prefix keys. it can be useful to also separate the bibliographies using prefixnumbers such as a. the artiPresuming we have defined our references in a file called cles. subtype=inet] with LaTeX with permission from the author. \printbibliography 5.5. citation in author-date format. File books. @set and @xdata are special. \cite{ColBenh:93} and \cite{Munt:93}. but as sub-sections to the main Bibliography. replace head. subheadings and table of contents As the numbering of the bibliographies are 5. the BibTeX basics. we add this to biblatex by adding the fol. but not yet supported (well). In addition we add a main heading for the bibliographies and This is a gentle introduction to using some of the bibliography functionality available to LaTeX users beyond add that to the table of contents. It is worth noting that Harvard. bibliography for example. and an article: \cite{RouxSmart:95}.6 LaTeX/More Bibliographies independent.of the standard alpha.5. you can generate a bibliography for each chapter.bib is used. . It is associated with an alTo add each of the bibliographies to the table of contents phabetical reference list secondarily ordered on date. \documentclass[11pt]{article} \usepackage{bibtopic} \begin{document} \bibliographystyle{alpha} \section{Testing} Let’s cite all the books: The entry types @bibnote. You can find information about the package on CTAN[2] Using bibtopic The bibtopic-Package[3] is created to differ the citations on more files.bib. we also add \phantomsection before printing each use some existing ones.the only strictly defined element of Harvard style is the ing=subbibliography with heading=subbibintoc.6. This introduction won't be discussing To make Hyperref links point to the correct bibliography how to create new styles or packages but rather how to section.This page uses material from Andy Roberts’ Getting to grips sources}.6 Multiple bibliographies Using multibib This package is for multiple Bibliographies for different sections in your work. is a citation style. LATEX/MORE BIBLIOGRAPHIES • @software and legal entry types • @commentary • @jurisdiction • @legislation • @legal • @letter • @review • @standard 125 5. books and others [1] The biblatex manual If the bib entries are located in multiple files we can add them like this: [2] http://ctan.org/pkg/bibtopic we filter with \printbibliography[title={Online re. and the listing is in plain-format instead references.bib} Just print all entries here with \btPrintAll \begin{btSect}[plain]{internet} \section{References from Print the bibiography with this macro (usually at the end the internet} \btPrintAll \end{btSect} \end{document} of the document body): are defined.bib is used for this listing: \begin{btSect}{books} \section{References Printing bibliography from books} \btPrintCited \end{btSect} Here.org/pkg/multibib We can also filter on other fields.5. so that you can divide the bibliography into more parts. such as entrysubtype. b and c.7 Notes and references Printing separate bibliographies We want to separate the bibliography into papers. \begin{btSect}[plain]{articles} lowing to the preamble: \section{References from articles} \btPrintCited \section{Articles not cited} \btPrintNotCited \end{btSect} \addbibresource{references. For example. The Reference List Alongside these new styles is an extended set of citation commands to provide flexible citation formats. 5. \citet[]{} and \citep[]{} each of which has a number of variants. So. we just note that they can be passed through \usepackage[]{} in Using cite. We assume the use of the round option in these examples.1 CHAPTER 5.126 5. The database used for my examples contains just the fol. and All Natbib styles require that you load the package in your \bibliographystyle{plainnat} document preamble. some bibliography styles. Here are examples Here are the \citet* versions • abbrvnat • unsrtnat \citep and \citep* The \citep command is used where the author name is to appear inside the parentheses alongside the date.6.3 Natbib Natbib is a package created by Patrick Daly as a replacement for the cite.sty package when author-date citation styles are required. But author-date styles . author={Paul Erd\H{o}s and Arend Heyting and Luitzen Egbertus Brouwer}. These are Having dealt with basic varieties of citation. use the commands \citet or \citep in or default author-year format citations and bibliographies your document. never defined “Harvard” . a skeleton LaTeX file with Natbib might look like this: which specifies how the data are to be presented.6.6.are not so easy.sty and BibTeX makes it very easy to produce the preamble of your LaTeX file. It’s true that you can download some . This guide deals with Basic Citation Commands Natbib a supplementary package that can access .6.bib files and has sophisticated functionality for producing custom To cite with Natbib. title = {Some very hard sums}. There are two essential commands \bibliography{mybibliographydatabase} which LaTeX interprets as an instruction to read a bibliographic database file (eg myrefs. . SPECIAL PAGES The example data \documentclass[]{article} \usepackage[round]{natbib} \begin{document} Document body text with citations.bst 5. The Preamble Inserting a correct and correctly formatted bibliography when using Natbib is no different than when using plain BibTeX. which correspond to the three styles available by default in BibTeX where you have a plain numbered style. Among them are: Clearly some of these options require explanation but that will be achieved via examples below. that is to say that author names appear in the text outside of the parenthetical reference to the date of publication.\bibliographystyle{plainnat} \bibliography{myrefs} lowing \end{document} @article{Erdos65.bib) and insert the relevant data here. we turn to the creation of the bibliography or reference list. For now. page numbers etc. journal={Difficult Maths Today}. This command can take options for chapter. Natbib provides three associated bibliography styles: • plainnat \citet and \citet* The \citet command is used for textual citations. The “plain” versions of these commands as well as the numerical styles handled by BibTeX. an Here are the \citep* versions abbreviated numbered style and an unsorted numbered style.for example the often mentioned.4 Citation files from CTAN that will handle some variants but using them is not always straightforward.2 The limits of BibTeX styles 5. pages={30} } in the brackets on the \usepackage command. produced abbreviated lists in the case of multiple authors but both have * variants which result in full author listings. Options Options available with Natbib can be specified year={1930}. 127 . What more is there? This covers the basic functionality provided by the package Natbib. approximately. Providing a gentle guide to harvard. Let us imagine documents bearing citations as in the section about citation above. provide what you are looking for. It may not. LATEX/MORE BIBLIOGRAPHIES Above the three basic Natbib styles were mentioned as analogues of the partially homonymous styles in BibTeX.sty which provides a slighly different set of author-date citation functions. Here is. of course.6. how these citations would appear in plainnat.sty is my next rainy day project. If you don't find what you want here then you should probably next investigate harvard.5. 6. beginning your LaTeX file the following way produces a Here is the example’s code: document which includes the letter and a business-size To move the closing and signature parts to the left.start each one with \begin{letter}{''recipient''} and end with \end{letter}. it doesn't have to be that way because of evolved. However. Closing (like \closing{Yours sincerely. 2. then it will put your name and surname. Note that the envlab package has The amount of space to the left can be adjusted by in.issues displaying characters outside the base ASCII character set. LaTeX allows for very quick letter writing.Chapter 6 Special Documents 6. if you have declared them. For example. Opening (like \opening{Dear Sir or Madam. 1. Thankfully. labels command. A sample letter. You can write multiple letters in one LaTeX file . Additional elements: post scripta. see this bug report for more information. address and telephone. user-friendly templates. 128 .1.1 LaTeX/Letters Sometimes the mundane things are the most painful. creasing the 0pt. carbon copy and list of enclosures. insert (#10) envelope on the following page.}). Main body (written as usual in LaTeX). Using the envlab package If you want your name. with little hassle.1. 6. the following before \begin{document}: Refer to the envlab user guide for more information about \longindentation=0pt this capable package. address and telephone number to appear in the letter. LaTeX will leave some space after closing for your hand-written signature. allowing the user to print on any of an The output letter will look like this: assortment of labels or envelope sizes.2 Envelopes 4. Each letter consists of four parts.}). You can leave recipient blank. 3.} or \opening{Dear Kate. you have to declare them first signaThe envlab package provides customization to the \maketure.1 The letter class To write letters use the standard document class letter. ps Reference: letter.125in envelope. $ pdflatex envelope.6. One user reports that printing envelopes created with envlab is relatively painless. placed into standardized windowed envelopes DIN C6/5.1.age.pdf according the folding marks it can be cally.5 Sources not dvips despite what it says in the geometry manual.dvi file pro. It supports additional features like folding marks and the correct address placement for windowed envelopes. There are several packages for the task. If you use MikThe output is generated via TeX. the PostScript file is sent to the printer.3 Windowed envelopes LaTeX can be used for creating presentations.2. dowed envelopes. DL. C5 or C6. you can use the latex dvi output driver.tex $ pdf2ps envelope.tex && dvips -t unknown -T 9.6. It will never work though unless your printer settings are • KOMA-Script . you may find the following commands useful for printing the A sample letter with folding marks ready for standardized winenvelope. but is also available from CTAN.4 lope.1.In addition to the default. dvips command converts the .The Guide adjusted to the correct page style. Printing The above will certainly take care of the spacing but the actual printing is between you and your printer.5in. In the first line. These settings depend on the printer filter you are using and in CUPS might be available on the lpr command line. LATEX/PRESENTATIONS 129 Using the geometry package Here is a relatively simple envelope which uses the geometry package which is used because it vastly simplifies the task of rearranging things on the page (and the page itself). The documentation explains the features in great . C4.cls commands It is reported that pdflatex creates the right page size but 6.pdf $ lpr -o landscape envelope.ps Alternatively.dvi $ lpr -o landscape enve6. Swiss and Japanese letter formats. A sample envelope to be printed in landscape mode. velopes is to use the letter class from the KOMA package. In the second predefined format definitions for different standardized line. all you have to do is to include the beamer package $ pdflatex koma_env Folding the print of the resulting and let LaTeX download all wanted packages automatifile koma_env. If you use the geometry package. the KOMA-package includes duced by latex into a .2.2 LaTeX/Presentations 6. including the beamer packAn alternative to separately printing addresses on en. Us. 6.4.ps (PostScript) file.1 The Beamer package ing the scrlttr2 document class from the KOMA package The beamer package is provided with most LaTeX distrithe example letter code is: butions. $ latex envelope.1. SPECIAL DOCUMENTS detail. India} \author[Author. . \newblock . \newblock For the actual talk..}. multiple frame phy\\ University There } \date[KPT 2004] % (optional) environments specify the content to be put on each slide.\frame{\titlepage} gin{frame} \frametitle{This is the second slide} \framesubtitle{A bit more information about this} %More content goes here \end{frame} % etc \end{document} Table of Contents The table of contents. Introductory example Document Structure The beamer package is loaded by calling the beamer class: Title page and information You give information about authors. only for long titles) {The Economics of Financial Crisis} \subtitle{Evidence from The usual header information may then be specified. if title and author are set... with the current section highlighted. tle<presentation>{Further Reading} \beTrick: Instead of using \begin{frame}.mathserif. is displayed by: \begin{frame} \frametitle{Table of Contents} \tableofcontents[currentsection] \end{frame} This can be done automatically at the beginning of each section using the following code in the preamble: \AtBeginSection[] { \begin{frame} \frametitle{Table of Contents} \tableofcontents[currentsection] \end{frame} } Or for subsections: \AtBeginSubsection[] { \begin{frame} \frametitle{Table of Contents} \tableofcontents[currentsection.130 CHAPTER 6. proof. {Conference on Presentation Techniques. if you can compile it with pdflatex {\em Introduction to Giving Presentations}. equation. If you want The beamer package also loads many useful packages in. gin{thebibliography}{10} \beamertemplatebookyou can also use \frame{.pdf 3. for multiple Note that if you are compiling with XeTeX then you authors) {F. you add the title page : the first slide} %Content goes here \end{frame} \be. The etc. 2004} \subThe frametitle command specifies the title for each slide ject{Computer Science} (see image): \begin{document} \begin{frame} \frametitle{This is In the document. the. \documentclass{beamer} \title[Crisis] % (optional. Also..to navigate in your presentation. you can use the almost invisible links in the bottom right corner without leaving cluding hyperref. You can also have a look at the PracTex article then you could use a pdf reader with a fullscreen mode. \maketitle is possible to create the \begin{frame}[allowframebreaks] \frametifrontpage. titles and dates in the preamble. enumerate. you can use environments like block.~Autor.currentsubsection] \end{frame} } References (Beamer) Beamer does not officially supThe usual environments (itemize.20). bibitems \bibitem{Autor1990} A.\end{frame}.~Anders\inst{2}} should use \institute[Universities Here and There] % (optional) { \documentclass[xetex. port BibTeX.serif]{beamer} \inst{1}% Institute of Computer Science\\ University Here \and \inst{2}% Institute of Theoretical PhilosoInside the usual document environment..[1] such as Okular. Evince or Adobe Reader. Beamer by example.) may be used. the fullscreen mode. Anders] % (optional..~Author\inst{1} \and S.two entries: orem. Instead bibliography items will need to be partly set “by hand” (see beameruserguide. following example shows a references slide containing Inside frames. Beamer has several themes.bg!90!black} \setbeamercolor{block body example}{bg=normal text. the reference slide will di• tree vide into two and so on. inner themes and outer themes. The outertheme defines the head and the footline of each slide. The ci. • rectangles • circles Style Themes The first solution is to use a built-in theme such as Warsaw.fg=normal text.fg=normal text.fg!75!normal text. Madrid.fg!75!normal text. The full list of themes is: Color themes.bg!90!black} \setbeamercolor{block title alerted}{use={normal text.Then you can add the innertheme: tation call is simply \cite. Frankfurt.bg!75!black} \setbeamercolor{fine separation line}{} \setbeamercolor{frametitle}{fg=brown} \setbeamercolor{item projected}{fg=black} \setbeamercolor{normal text}{bg=black.example text}. 2000.g.fg.fg} \setbeamercolor{palette sidebar secondary}{use=structure.fg=structure. Beamer also supports limited \useinnertheme{rectangles} customization of the way references are presented (see the manual). LATEX/PRESENTATIONS Klein-Verlag.fg} \setbeamercolor{palette sidebar quaternary}{use=structure. fg=green} \setbeamercolor{subsection in sidebar}{fg=brown} \setbeamercolor{subsection in sidebar shaded}{fg=grey} \setbeamercolor{title}{fg=brown} \setbeamercolor{titlelike}{fg=brown} Colors can be defined as usual: .fg=structure.fg=yellow} \setbeamercolor{palette sidebar primary}{use=normal text.fg} \setbeamercolor{section in sidebar}{fg=brown} \setbeamercolor{section in sidebar shaded}{fg=grey} \setbeamercolor{separation line}{} \setbeamercolor{sidebar}{bg=red} \setbeamercolor{sidebar}{parent=palette primary} \setbeamercolor{structure}{bg=black. for example. This Theme Matrix contains the various theme and color combinations included with beamer. Individual items can be cited after adding an 'optional' label to the relevant bibitem stanza. Those who wish to use natbib.2. 1990. \beamertemplatearticlebibitems \bibitem{Jemand2000} S. \end{thebibliography} \end{frame} 131 • sidebar • smoothbars • smoothtree • split As the reference list grows.bg=normal text.~Jemand. 2(1):50-−100.). \newblock On this and that.bg!75!black} \setbeamercolor{block title}{bg=blue} \setbeamercolor{block title example}{use={normal text. The second solution is to specify colors. etc.fg=alerted text. \newblock {\em Journal of This and That}. For more customizing options.bg=normal text.fg=example text. etc.bg!90!black} \setbeamercolor{block body}{bg=normal text. can be specified with \usecolortheme{beaver} The full list of color themes is: The do it yourself solution First you can specify the outertheme. typically with animal names.6. • inmargin • rounded You can define the color of every element: The Built-in solution the following line: To the preamble you can add \usetheme{Warsaw} to use the “Warsaw” theme. have a look to the official documentation included in your distribution of beamer. many of which are named after cities (e. Berlin. through use of the allowframebreaks option.alerted text}.fg} \setbeamercolor{palette sidebar tertiary}{use=normal text. \useoutertheme{infolines} Here is a list of all available outer themes: • infolines • miniframes • shadow \setbeamercolor{alerted text}{fg=orange} \setbeamercolor{background canvas}{bg=white} \setbeamercolor{block body alerted}{bg=normal text. particularly the part Change the way it looks. Here is a list of all available inner themes: with Beamer may need to troubleshoot both their document setup and the relevant BibTeX style file. Berlin.fg. If you wanted the title of the presentation as ren. Clean looking buttons can also be increased size and oldstyle proportional alternate number added. return 0. use the shrink the itemize environment.. Chapter 8 of the beamer manual provides much more detail. the form fragile=singleslide is usable (for details see the manual). return or page down on the keyboard. \frame[plain]{ % . on many more features. it is possible to specify appearoption. Block styles can also be defined: \frame[allowframebreaks]{ % .. ance and disappearance of text by using <a-b> where a \frame[shrink]{ % . \end{frame} Frames Options The plain option.fg!25] \setbeamertemplate{sidebar canvas left}[horizontal shading][left=white!40!black. } \end{lstlisting} ements. SPECIAL DOCUMENTS \definecolor{chocolate}{RGB}{33. Note that the fragile option may not be used with \frame commands since it expects to encounter a \end{frame}. For example: . for example in If you want to include lots of text on a slide.{ printf(“Hello World!").33} The allowframebreaks option will auto-create new frames if there is too much content to be displayed on one. Proportional}}} \beamertemplatenavigationsymbolsempty in the preamble.right=black] You can also suppress the navigation bar: \beamertemplatenavigationsymbolsempty Before using any verbatim environment (like listings). Usually. first concept we introduce originates with Erd\H os.33. \pause The character. } \setbeamertemplate{blocks}[rounded][shadow=true] \setbeamertemplate{background canvas}[vertical shading][bottom=white. use the plain option : Text or figures after \pause will display after one of the following events (which may vary between PDF viewers): pressing space. Pause can be used within \itemize etc.. In that case. \begin{frame}[fragile] \frametitle{Source code} \begin{lstlisting}[caption=First C example] int main() Fonts You may also change the fonts for particular el..\end{frame} dered by \frame{\titlepage} to occur in a serif font instead of the default sanserif. Making items appear on a slide is possible by simply using the \pause statement: \begin{frame} \frametitle{Some background} We but it is not clear if this works for absolutely every math start our discussion with some concepts.. glyphs: By default the beamer class adds navigation buttons in the \setbeamerfont{title}{family=\rm\addfontfeatures{Scale=1. Math Fonts The default settings for beamer use a different set of math fonts than one would expect from creating a simple math article. you should pass the option fragile to the frame environment.18.top=structure. which should be alone on a single line. } and b are the numbers of the events the item is to be displayed for (inclusive).132 CHAPTER 6. } Text animations For text animations. as verbatim environments need to be typeset differently. you would use: \setbeamerfont{title}{family=\rm} Hyperlink navigation You could take this a step further if you are using Open.. bottom left corner. Sometimes you need to include a large figure or a large table and you don't want to have the bottom and the top of the slides. or using the mouse to scroll down or click the next slide button.Internal and external hyperlinks can be used in beamer Type fonts with Xe(La)TeX and specify a serif font with to assist navigation. One quick fix for this is to Animations use at the beginning of the file the option mathserif \documentclass[mathserif]{beamer} Others have proposed to use the command \usefonttheme[onlymath]{serif} The following is merely an introduction to the possibilities in beamer. To remove them one can place Numbers={Lining. you can add an option to the class calling. for them to have both the slides with what you said. Handout mode and you can write your notes about a frame in the field note (many of them if needed).} \end{itemize} 133 only statements. \end{frame} \note{. \end{itemize} and this will hide your slide in both modes.eps}} \only<2>{\includegraphics{pic2.g. you may need to copy the . Using this.eps}} better distinction between the modes. (The order \end{frame} matters. because its purpose is to have only some text or figures at a time and not all of them together. while the second one could be given to those who have followed your presentation or those who missed it.. use \begin{itemize}[<+->]. the full syntax for a frame is backtrack through the sequence. scrolling up. printable version).. The first one is useful when you make a presentation to have only the notes you need. ify precisely the behavior when dealing with only commands in handout mode. LATEX/PRESENTATIONS \begin{itemize} \item This one is always shown \item<1> The first time (i. Blocks and columns can be Now imagine you still have your two pictures with the used inside each other.A last word about the handout mode is about the notes. \begin{frame} . but they cannot be both on the same slide since they are large. \begin{frame}<handout:0> \begin{frame} \frametitle{`Hidden higher-order concepts?'} \begin{itemize}[<+->] \item The truths of arithmetic which are independent of PA in some sense or even.eps}} A simpler approach for revealing one item per click is to The command can also be used to hide frames. the default mode is presentation which makes the slides. you can work in a different \documentclass[12pt. but the second one show the first one plus some other graphs and you don't need the first one to appear in the handout. this makes an issue when working with the only command. Suppose you have a code like Important: the notes=only mode is literally doing only the notes..handout. You can thus precise the handout mode not to include some only commands by: \only<1| handout:0>{\includegraphics{pic1. which divide the slide (horizontally) into This will ensure the handout will make a slide for each headed sections.} \note{. if you have written a frame that you don't want themselves `{contain} essentially {\color{blue}{hidden anymore but maybe you will need it later. you can add a statement to spec. .notes=show]{beamer} This mode is useful to see each slide only one time with all its stuff on it. as soon as the slide loads) \item<2-> The second time \item<1-> Also the first time \only<11> {This one is shown at the first time.) In all these cases..eps}} in another mode before. (vertically) into columns. pressing page up. either In beamer class. The solution is to add the handout statement to have the following: Columns and Blocks \only<1| handout:1>{\includegraphics{pic1. ing the previous slide button in the navigation bar will Actually.. both in the handout. Nevertheless. concepts’??? \item `Truths \begin{frame}<0| handout:0> in the language of arithmetic which \ldots \item That suggests stronger version of Isaacson’s thesis.. but it will hide soon (on the next event after the slide loads). e.. However.eps}} \only<2| handout:2>{\includegraphics{pic2. you can write higher-order}}. Don't put handout:0|beamer:0 or it won't work.eps}} There are two handy environments for structuring a slide: “blocks”.suppress all the animations.aux file from the handout compilation with the These pictures being completely different. and “columns” which divides a slide picture. Thus it requires you to have run the compilation \only<1>{\includegraphics{pic1.handout.} ..e. you want them slides (w/o the notes).notes=only]{beamer} mode that is called handout by setting this option when calling the class: or \documentclass[12pt. This means there will be no output file but the this DVI. If you use separate files for a \only<2>{\includegraphics{pic2.handout]{beamer} \documentclass[12pt. or click. making any \itemize[<+->] environments visible all at once (for instance. Note that the 'handout' option in the \documentclass line If you want to solve this. or infinitary.6.2. Their formatting depends on the theme being used.2 The powerdot package The powerdot package is available from CTAN. headed block of text (a blank heading can be used). This allows to visually distinguish parts of a slide easily.2. Inside the usual document environment. multiple slide environments specify the content to be put on each slide. SPECIAL DOCUMENTS Example \begin{frame}{Example of columns 1} \begin{columns}[c] % the “c” option specifies center vertical alignment \column{. 6.2. There are three basic types of block.png} \end{column} \end{columns} \end{frame} PDF options You can specify the default options of your PDF.5\textwidth} Contents split \\ into two lines \end{columns} \end{frame} \begin{frame}{Example of columns 2} \begin{columns}[T] % contents are top vertically aligned \begin{column}[T]{5cm} % each column can also be its own environment Contents of first column \\ split into two lines \end{column} \begin{column}[T]{5cm} % alternative top-align that’s better for graphics \includegraphics[height=3cm]{graphic.5\textwidth} % column designated by a command Contents of the first column \column{. \begin{document} \begin{slide}{This is the first slide} %Content goes here \end{slide} \begin{slide}{This is the second slide} %More content goes here \end{slide} Blocks Enclosing text in the block environment creates % etc \end{document} a distinct.3 References Simple [1] Andrew Mertz and William Slough Beamer by Example \begin{frame} \begin{block}{This is a Block} This is important information \end{block} \be.[2] Other possible values are defined in the hyperref manual gin{alertblock}{This is an Alert block} This is an important alert \end{alertblock} \begin{exampleblock}{This is an Example block} This is an example 6.134 Columns CHAPTER 6.[2] \hypersetup{pdfstartview={Fit}} % fits the presentation to the window when first displayed 6.2. The powerdot package is loaded by calling the powerdot class: \documentclass{powerdot} The usual header information may then be specified.4 Links \end{exampleblock} \end{frame} • Wikipedia:Beamer (LaTeX) . The documentation explains the features in great detail. ac.2 europecv 6.1 curve Here is an example : \begin{questions} % Begins the questions environment \question[2] What is the solution? % Introduces a new question which is worth 2 points \begin{solution} Here is the solution \end{solution} \question[5] What is your opinion? \begin{solution} This is my opinion \end{solution} \end{questions} 6. 6. . It appears only if \printanswers or answers as an option of the \documentclass are specified in the preamble.3.4. \end{minipage} Intro The backslash after \numquestion prevents the macro LaTeX has specific features for teachers.uk/~{}richard/programming/tex/ exams/msexdoc. • The solution is given in the solution environment. This is a great example of cases where the power of LaTeX comes to the front.would. • The exam is included in the questions environment. writing a CV in LaTeX is as simple as filling the forms. The official package provides some well commented tem\ifprintanswers Only if answers are printed \else Only if plates which may be a good start.8\textwidth} This exam includes \numquestions\ questions. You just have to specify in the preamble if you want the solutions to be printed or not.4.them available from a simple web form: no coding or edets. Of course you can design you own CV by hand. using the \ifprintanswers command. • The command \question introduces a new question. 6.bham. the fonts. Thanks to its strong typographical stance. Preamble In the preamble you can specify the following lines : You can replace the 3 first lines with the following : Document [3] http://mat140. This way.6. We present the from gobbling the following whitespace as it normally exam class[1] which is useful for designing exams and ex.3 moderncv From CTAN: Moderncv provides a documentclass for typesetting modern curriculums vitae. The total number of points is \numpoints. allowing you to define your It is also possible to add stuff only if answers are printed own style by changing the colours. LaTeX is definitely a document processor of choice to write a CV. Interested people could also have a look at the probsoln package[2] or the mathexm document class[3] .3 LaTeX/Teacher’s Corner 6.3 References 6.4 LaTeX/Curriculum Vitae A curriculum vitæ or résumé has a universal requirement: its formatting must be flawless.4. etc. and you are done. ercises with solutions. Otherwise. LATEX/CURRICULUM VITAE • Beamer user guide (pdf) from CTAN • The powerdot class (pdf) from CTAN • A tutorial for creating presentations using beamer 6. A full list of CV packages is available at CTAN.3.pdf 6. \begin{minipage}{. It is fairly customizable. You can find those templates in your distribution (if documentation is installed answers are not printed \fi along packages) or ultimately on CTAN.4. LaTeXCV.org makes 4 of • The number of points is specified in squared brack.3. both in a classic and in a casual style. The exam class is well suited to design exams with solutions. you may want to use a dedicated class for that task. The macro \numpoints gives the total number of points. You can also count the number of points. itor required.2 The exam class [1] examdoc Using the exam document class [2] Probsoln creating problem sheets optionally with solutions We present the exam class.1 135 Introduction The macro \numquestions gives the total number of questions. etc.4 Multilingual support It is especially convenient for résumés to have only one document for several output languages. so we will only provide a crash course. SPECIAL DOCUMENTS We will not repeat the templates here.5 References . since many parts are shared among versions (personal data. See Internationalization.4.). Theme previews • Themes • Banking black theme • Classic green theme 6.136 CHAPTER 6. structure. 6. LaTeX with appropriate macros provide a comfortable way to manage it. You should really have a look at the templates for more details.4. First document Most commands are self-explanatory. “q” ture. see A User’s Manual for MetaPost. the ouput is flawlessly integrated are described in detail in The LaTeX Graphics Companion (not to be confused with The LaTeX Companion). xy-Pic and the process. and catenaries can be satisfactorily One could say that TikZ and Asymptote are to drawing approximated by quadratic Bézier curves. but leads to much bet.the end of this chapter. If a programming mended to use one of these if your LaTeX distribution language like Java is used to generate \qbezier blocks of includes it. Contrary to METAFONT. described in the following sections.1.1 LaTeX/Introducing Procedural Graphics tional graphics files to be dragged along. meaning quadratic. and microtypographic features of pdflatex in graphics directly in LaTeX. MetaPost has the very powerful and tion issue. not reliant LaTeX input files. To generate a PDF document from TeX source. you will learn how to create environment. still reasons for doing so. it is very helpful to use latexmk to manage severely restricted. TikZ is a pure (La)TeX system. although this in LaTeX as LaTeX is to digital typesetting. Many frequently-used curves such TikZ and Asymptote focus more on the what to draw. the picture environment Asymptote systems. pstricks or metapost) focus on the how to draw. The documents thus produced In many cases. the pstricks package has its own drawing elsewhere. tem which integrates seamlessly with (La)TeX. which generates bitmaps. especially for more advanced diagrams. as circles. such as graph. you learned that you power of LaTeX. Knuth’s METAFONT.discussion of LaTeX and TEX strategies for graphics (and vere constraints. One of them is XY-pic. you shows: have to go from TeX to DVI to PDF. In this chapter. See the Importing Graphics for more details on graphics Perhaps the most powerful graphical tool related with importation and some attempts to circumvent to integra. Unfortunately it has one big for typesetting bold text or creating mathematical for. the twin of Donald E. There are several packages supporting the creation of metadata. The from the fact that this package makes extensive use of graphics is marked up using commands similar to those PostScript possibilities. as the radii of circles are restricted to a narrow choice The last but certainly not least are the PGF/TikZ and of values. Furthermore. it are “small” with respect to bytes. For an introducThe picture environment allows programming pictures tion. Packages like epic. MetaPost generates encapsulated PostScript 7. to your document (no contrast in size nor fonts). PGF/TikZ. A wide variety of these packages ter results. as mulas. as the slopes of line segments as well fonts) can be found in TEX Unbound. and greatly strengthen the graphical In the Importing Graphics chapter.Chapter 7 Creating Graphics 7.1 Overview files. epic. there are the compilation steps. numerous packages have been written for Compared to WYSIWIG tools like Xfig or Inkscape. and there are no addi137 . losing hyperlinks. there are rather se. as the following example of embedded graphics such. In addition. If using Although programming pictures directly in LaTeX is Asymptote. the picture environment becomes quite on external software. which can be imported in LaTeX. mathematically sophisticated programming language of METAFONT.While the former two packages just enhance the picture ics that you have created in another program or obtained environment. this specific purposes.shortcoming: it doesn't work together with pdfLaTeX. While the previous systems (picof LaTeX2e brings with it the \qbezier command. On the other hand. described at approach is more time consuming. On the one hand. A very thorough directly in LaTeX. eepic or pstricks enhance the original picture environment. including picture. can import or link graphics into LaTeX. ellipses.LaTeX is MetaPost. The power of pstricks stems or embed graphics directly in a LaTeX document. It’s recommay require some mathematical toil. and often rather tiresome. while Asymptote is an external syspowerful. pspicture. 1 Basic commands arrows pointing to the upper left. such as eepic. within the draws a circle with center (x. ellipses. epic. and there are no additional graphics files to be dragged along. there are rather severe constraints. arbitrary circles and The default value of \unitlength is 1pt. and catenaries can be satisfactorily approximated by quadratic Bézier curves. y) . eepic or pstricks enhance the original picture environment. graphical power of LaTeX.low this limit. one may have to resort to additional packThe numbers x. y. not all diameters are possible. On the other hand. or tikz.4 Circles mands The command or The first pair.. of rectangular space for the picture.3. x0. 7.. y0 are numbers (lengths) in the ages.7. (x. mits diameters up to approximately 14mm. a direction vector. . and greatly strengthen the For arrows. Arrows are drawn with the command Packages like pict2e. . 3. and even beThe optional second pair. The \line command has two arguments: 1. namely to the integers (−4. pstricks. 7. The documents thus produced 7. rather than the length of the segment itself). line segments. . This environment is created with one of the two com. 6) and they have to be coprime (no common divisor except 1). The components of the direction vector are restricted to the integers (−6. CREATING GRAPHICS Bézier curves are an exception. Although programming pictures directly in LaTeX is severely restricted. On the one hand. If one is not afraid of doing the necessary calculations (or leaving them to a program). . y0 ) . as the slopes of line segments as well as the radii of circles are restricted to a narrow choice of values. A picture environment is available in any LaTeX distribution. the picture environment becomes quite powerful. the picture environment of LaTeX2e brings with it the \qbezier command. which can result in not suitable and inconsistent graphics. The figure below illustrates all 25 possible slope values in the first quadrant.2 Line segments Line segments are drawn with the command: 7. although this may require some mathematical toil.3. −5.. 4). “q” meaning quadratic.3 Arrows are “small” with respect to bytes. As in the case of angle. which can be reset any time (but not There is another possibility within the picture environwithin a picture environment) with a command such as ment. and then import the file into the document (see LaTeX/Importing_Graphics). assigns arbitrary co. . Components also have to be coprime (no common divisor except 1).2 LaTeX/MetaPost CHAPTER 7.3. without the need of loading any external package. 5. However most software does not support LaTeX fonts or mathematical notation. See Graphics in LaTeX2e for examples and Java or source files.138 may be easier to draw the graphics using external vector graphics software. There are several solutions to this problem. in addition to numbers relative to \unitlength. y) and diameter (not radius) specified by diameter. the components of the direction vector are even more narrowly restricted than for line segments. a “length” (sort of: this argument is the vertical length in the case of a vertical line segment and in all other cases the horizontal distance of the line. (x0 . Notice the effect of the \thicklines command on the two 7. there are still reasons for doing so.3 LaTeX/Picture The picture environment allows programming pictures directly in LaTeX. Many frequently-used curves such as circles. If a programming language like Java is used to generate \qbezier blocks of LaTeX input files. affects the reservation.. The \circle* ordinates to the bottom left corner of the reserved rect. and often rather tiresome. units of \unitlength.3. ellipses can be patched together from quadratic Bézier Most drawing commands have one of the two forms curves.command produces disks (filled circles). The picture environment only addocument. The length is relative to \unitlength. −3. They are drawn with the command With the package picture absolute dimension (like 15pt) and expression are allowed. 2. While \linethickness{''length''} applies only to horizontal In this figure. each symmetric half of the catenary y = and vertical lines (and quadratic Bézier curves). The error 7. The \oval command had to be used as the \line command does not work if the segment length is less than about 3 mm. Using again to circles and ovals. “bottom”. and S = (x.3. The optional position parameter has the effect of defining the “anchor point” of the savebox.−0.3. r refer to “top”. 2. and the lower left corner is assigned the mathematical coordinates (−3. Boxed pictures can be nested: In this example.3. and can be combined. way: P2 = (x2 . m1 = 1 and P2 = (2.8 Multiple use of predefined picture is barely noticeable. m1 and m2 . the translation vector m2 −m1 from one object to the next. each command or overriding all previous ones. The name argument refers to a LaTeX storage bin and therefore is of a command nature (which accounts for the backslashes in the current example). but neither to oblique line segments. tanh 2) .3.3. 0) . \foldera is used within the definition of \folderb.10 Catenary by two kinds of commands: \linethickness{''length''} on the one hand. The picture is defined in convenient “mathematical” coordinates. This example points out the use of the optional argument of boxes the \begin{picture} command. the slope there having the value m = 3. t.2384. \thinlines and \thicklines on the other. LATEX/PICTURE 7. Again. 0). It does. however.3. being less than one percent.3. nor to circles. 0) and (−1. It also shows that both kinds of commands affect quadratic Bézier curves.−2) (black disk). The positive branch is determined by P1 = (0.6 \multiput and \linethickness The command { 1 x1 −(y2 −y1 ) x = m2 x2 −m has 4 arguments: the starting point.5. See Graphics in LaTeX2e for a Java program which generates the necessary \qbezier command line. we can calculate the intermediate control points.7.6269.11 Plotting graphs top and right. Line thickness can be controlled 7. whereas by the A picture box can be declared by the command command then defined by its lower left corner (marked by the black disk) is assigned and finally arbitrarily often be drawn by the coordinates (−2. m2 = 1/ cosh2 2 . as the example illustrates. text and formulae can be written The command in the environment with the \put command in the usual draws a quadratic bezier curve where P1 = (x1 .9 Quadratic Bézier curves As this example shows. They turn out to be (1. y) and having width w and height h. produces an oval centered at (x.7622). can be obtained from the equations 7. y1 ) . The optional position arguments b.25).3. At least 8 are needed. and y = yi + mi (x − xi ). the picture is defined in mathematically convenient coordinates. equation (*). \thinlines cosh x − 1 is approximated by a quadratic Bézier curve. The other position specifiers are 7. The \linethickness command applies to horizontal and vertical line segments. “right”. the number of objects. In the example it is set to “bl” which puts the anchor point into the bottom left corner of the savebox. The figure again shows the effect of the 7. y2 ) denote the end points. splitting up a circle into 4 quadratic Bézier curves is not satisfactory. The control points of the two Bézier curves were calculated with formulas (*).7 Ovals \linethickness command on horizontal or vertical lines. . and \thicklines apply to oblique line segments as well as The right half of the curve ends in the point (2. l. “left”.2384. apply to quadratic Bézier curves! As this example illustrates. 2 gives same solution) the object to be drawn. The crosses indicate points of the real catenary.5 Text and formulae 139 7. The respective tangent slopes. y) denotes the intermediate control point. (i = 1. and of the \thinlines and the \thicklines commands on The command oblique line segments. \usetikzlibrary{⟨list of libraries separated by commas⟩} 7. “shapes. gnuplot is a powerful piece of software with a vast somewhere in the preamble. TikZ commands are prevalently similar to Metafont. “mindmap”. TikZ can produce portable graphics in both PDF and PostScript formats using either plain (pdf)TEX. Drawing commands have to be enclosed in an tikzpicture environment \begin{tikzpicture}[⟨options⟩] \end{tikzpicture} ⟨tikz commands⟩ or alternatively \tikz[⟨options⟩]{⟨tikz commands⟩} One possible option useful for inlined graphics is Example of graphics done with Tikz.dante. Note the slightly translucent top layer. One possible solution how to draw graphics directly with TeX commands is PGF/TikZ. than is available from other means (such as postscript).140 7.g: and TikZ (“TikZ ist kein Zeichenprogramm”) is the fron.5. “trees”. A full discussion of gnuplot lies be. TikZ focuses more on the what to draw.4 LaTeX/PGF/TikZ Examples for libraries are “arrows”. since this saves having to deal with potentially troublesome postscript files.5 tend layer with a special syntax.net/tikz/ baseline=⟨dimension⟩ Without that option the lower end of the picture is put on the baseline of the surrounding text. One could say that TikZ is to drawing in LaTeX as LaTeX is to digital typesetting. you can specify that the picture should be raised or lowered such that the height ⟨dimension⟩ is on the baseline. or different for height and width. “calendar”. “automata”.4.2 Specifying Coordinates Coordinates are specified in round brackets in an arbitrary TEX dimension either using Cartesian coordinates (comma separated). “backgrounds”. (pdf)Latex or ConTEXt.12 CHAPTER 7.texample. “shadows”. yscale=0.g. “chains”. Another option to scale the entire picture is scale=⟨factor⟩ PGF (“portable graphics format”) is the basic layer.g. 1cm in the x direction and 2pt in the y direction Other packages building on top of TikZ (e.g.. While the previous systems (picture. 7. 7. the option mechanism is similar to PsTricks syntax. epic. “spy”. Libraries tikzpicture environment - Using TikZ in a LaTeX document requires loading the tikz package: \usepackage{tikz} N.2pt) for drawing electrical circuits) can be found here: http://ftp.html#pgftikzsection plot In the following some basics of TikZ are presented. e.de/tex-archive/help/Catalogue/bytopic. See [] for a tutorial. or using polar coordinates (colon separated).B.1 Loading Package. This will automatically load array of commands.xscale=2. It is often far more convenient to plot directly to LaTeX. and of course typesetting ability. It’s recommended to use it if your LaTeX distribution includes it. CREATING GRAPHICS The picture environment and gnu.misc”. “shapes. providing a set of basic commands for producing graphics. It comes with very good documentation and an extensive collection of examples: http://www. 1cm in . Using this option. e. pstricks or metapost) focus on the how to draw. “petri”. “patterns”. The powerful scientific plotting package gnuplot has the capability to output directly to a LaTeX picture environment.geometric”. Plotting scientific data (or. (1cm. making the use of PGF easier.the pgf package. Such pictures can then be added to a document by an \include{} command. To load further libraries use yond the scope of this note. e. indeed. mathematical figures) this way gives much greater control.4.3. “matrix”. 0) “draw=<line color>". The instruction has to end with a semicolon. “out” and “in” option a curved path can created. The "\path” command with these options can be com.2pt.g. \draw (0. of 45 degree at the second coordinate. “use as bounding box”. “yscale=<factor>".. “dashed”. Without an option it corresponds to a straight Line width options: “line width=<dimension>". orange. The first coordinate represents a move-to operation. (5.0) -.in=45]" causes the path to leave at an angle of “thick” for 0.g: “draw”. LATEX/PGF/TIKZ 141 30 degree direction dotted”.8pt.(0. a simplified explanation). For rectangles a special syntax exist. bevel. or several to (2. 7.1). Geometric path options: “rotate=<angle in de. “rounded corners”. "\useasboundingbox” ..in=180] rect. dashed.(0. blue. With "++" the last point of the path becomes the current position. “arrows=<start arrow kind>-<end arrow (3. “shade” (filling.0). E.(2. very thick.0) to[bend right] (3.(2.. use for first horizontal then vertial end of the current scope are clipped against the current path and the size of subsequent paths will not be impor. Here: Move to (0.1) -. Options for path actions are e. ation. gray. magenta.(coordinates)". “pattern=<name>". A further move-to operation in an existing path starts a \path[<options>]⟨specification⟩.1) . like "-. “xshift=<length>". "\shadedraw”.0) -. “dotted”. move to (0. or miter>". \draw (0. “double”. Use a move-to operLine pattern options: “dash pattern=<dash pattern>" (e.1).1). black.0) straight line One instruction can spread over several lines. “fill=<fill color>". Using the breviations “ultra thin” for 0. “loosely dotted”. points. (30:1cm) Options for filling paths are e. Following and (6. tant for the picture size).0) -. “solid”. Relative coordinates to the previous given point are given by adding one or two plus signs in front of the coordinate. "[out=135.0) (0.0) to (3. in which its color changes smoothly from Connecting two points via straight lines that are only horone to another).cycle. “dash of the diagonal corner.0) \draw (1..2). “yshift=<length>". This is followed by a series of “path extension operations”.0) . controls (6. violet and white.(0. “dash- .0) to[out=90.4.0) . lightgray. with "+" the previous point stays the current path position. “densely dotted”.1pt. “opacity=<factor>". The same path with some drawing options: \draw[red. \draw (0. controls (1.1) straight line to (2. “very thick” for 1. “rounded corners=<size>".0) |.Curved paths using a Bezier curve can be created using gree>". “fill”.g.0) (5.g.(0.6pt. “ultra thick” for 135 degree at the first coordinate and arrive at an angle 1. brown.2).4. with one or two control ing=<factor>". which is not connected to the previous part of the path. “semithick” for 0. darkgray. “pattern color=<color>" Without specifying a unit (1. purple. ble minus. “thin” for 0.7. "\clip”. “xscale=<factor>".(1.1): instructions can be put on one line.. the standard one is cm Straight lines are given by coordinates separated by a dou(1cm. "\filldraw”. The last one becomes the new phase=⟨dash phase⟩".2pt. \draw (0.controls() . “pattern”.0) -.6pt. rotate=30] (1. \draw (0.the ". new part of the path. “clip” (all subsequent drawings up to the izontal and vertical. User-defined paths can be created using the “to” operolive. or butt>".0) -| (1.\draw (0. exactly like the double minus command.0) -(0. "\pattern”. cyan . "\shade”. and ab.. \draw (0.0) -. “scal.1) -.(0.2).3 Syntax for Paths A connected path can be closed using the "--cycle” operation: A path is a series of straight and curved line segments(in \draw (1.2).or for first vertical then horizontal bined to: "\draw”. “line join=<type: round. yellow. kind>". green.0) -. Color options for drawing paths: “color=<color name>".1) . teal.2). "\fill”.1).()" command. Line end.4pt (the default width). colors are predefined: red. “very thin” for 0.1).line.2cm). pink. (4. ation to one corner and after “rectangle” the coordinates “dash pattern=on 2pt off 3pt on 4pt off 4pt”). line join options: “line cap=<type: round. lime. Example: 2 standard units to the right of the last point used: ++(2. like “grid”. which is equal to 3.). A loop can be realized by "\foreach ⟨variable⟩ in {⟨list of Often it would be better to have the node to the besides values⟩} ⟨commands⟩". \draw[step=0.\draw [help lines] (−2.0) circle (1. end angle= node[<options>](<name>){<text>} 270] \draw (0.1). sin(\x r).5.(1. y radius=10mm]. \draw (0. functions: \fill[fill=yellow] (0.0mm) arc (0:30:12mm) -.5. \draw (0.(1. max(\x. \shade[top color=yellow.y).1).5cm.5.0) arc (0:270:8mm). Circles and ellipses paths are defined beginning with their center then using the “circle command” either with one An example with two functions: length as radius of a circle or with two lengths as semi.0).0) -.−1). log2(\x).. % old syntax \draw (0. here a selection: factorial(\x). The trigonometric functions assume that x is in degrees.π/2]).−1) cos (4.5) parabola[bend at end] (2. “align=<left_right_center>". \draw (0.−1. end angle= 315] The "(<name>)" is a name for later reference and it is optional. Combinations are also possible.pect=<aspect ratio>".y). gray.4. \filldraw[fill=green!20!white.0) grid (2.0) -. nate[<options>](<name>) \draw[help lines] (0. exp(\x). In the simplest case. A node is centered at the current coordinate by default.0) circle [radius=1.2. after the path has been drawn. 80% white mixed together.(30:20pt).4.0) grid (2.4) grid (1. “text=<color>". \draw [<<->] (2.2). ceil(\x). start angle= 0.cycle. \draw [->] (0. they are added to the picture (0. % old syntax \draw (0. To add arrow tips there are simple options for the drawing Possible options for the node command are e.. “cos” (sine or cosine node[<options>](<name>){} coordicurve in the interval [0. {function}). Nodes (0:315:1. very thin] (−1. draw=green!40!black] (0. chor=south”).0) rectangle (1. cos(\x). Or in an alternative syntax: Inside a path operation use the following syntax after a given coordinate: \draw (0. samples=50] plot (\x.0) rectangle (2.0) arc[radius = 8mm. above (“above” or “an\foreach \x in {0. ++(0. The option “help lines” denotes “fine gray”.0) Writing text along a given path using the node command is shown as simple example: sin (1.(12mm. left (“left” or “anchor=east”).0).2cm and 8mm).0) rectangle (2. like “anchor=north east” or PGF also has a math engine which enables you to plot “below left”. the actual coordinate: Right (“right” or “anchor=west”).5.4). “incommand: ner sep=<dimension>". domain=−2:2] plot (\x. y radius=5mm. a node is \draw (0.(0. “font=". draw=blue] are not part of the path itself.0).0) sin (5. sin(\x). sqrt(\x). {1+cos(pi*\x r}). min(\x. “shape as(180:30:10pt).y. \draw [<->] (1. Two constants The fill color “green!20!white” means 20% green and can be useful: e.(0.0) circle [x radius=1. -. If you only want to name a certain position without There are many more predefined commands for special writing text there are two possibilities: paths. {4-\x*\x}). pow(\x.0) -. abs(\x).1.0) axes of an ellipse. \draw [->] (0.142 CHAPTER 7.4). \filldraw[fill=cyan.++(0.1) node {2nd node} -.10pt). \draw[rotate=30] (0.(0. thick. round(\x).0) sin (3. \draw (0. % old syntax 7. \draw [green.0) arc “minimum size=<dimension>".1).2.0) -.−10pt) -.141592654.0) circle (2cm).75cm. if x is expressed in radians use e.9} \draw (\x.5]. bottom color=black] (0. node[circle. which is equal to 2.0) node {1st node} -.0) parabola (1. \draw [domain=−2:2.1) cos (2. ln(\x). Many functions are possible.0) circle [x radius=1cm.4.0) circle (0.inner sep=0pt. \draw (0.0) node {1st node} -. start angle= 0. \draw[dotted] (0.++(0. tan(x). \draw [->] (−2.g. “sin”. and pi.4 Nodes The command “arc” creates a part of a circle or an ellipse: A node is typically a rectangle or circle or another simple shape with some text on it.(0.0) arc[x radius = 1.2) node {3rd node} -.4. CREATING GRAPHICS current point.1) \draw [domain=<xmin>:<xmax>] plot (\x.. mod(\x.1.0) arc just some text that is placed at some coordinate. \draw (0. floor(\x).y). log10(\x). below (“below” or “anchor=north”). “parabola”. y radius = 1cm.2) .0) ellipse (20pt and 10pt). \draw (0.3).75cm and 1cm).718281828.4).(2.g..10pt) -.draw] {2nd node} -. rotate=30]. “outer sep=<dimension>". 5/\coordinate (x) at (0.0) -.1.{0.4.5]{1/2} node[pos=0.9]{9/10}.(2.4. Having "\path(0.\y cm) -(−1pt. the node at (0.5/\frac{1}{2}.5 Examples Example 1 \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[thick.0) -. “at end” for “pos=1”.fill=white] Equivalent to {$\xtext$}. \draw[->. 7. (x) -. like "(x.1pt) -(\x cm.5/-\frac{1}{2}. \end{tikzpicture} \end{document} The “sloped” option causes the node to be rotated to beExample 2 come a tangent to the curve. the second without: \draw[step=. \draw[very thick.0) node(x) {Hello World!} (3.color=gray] (−0. \draw (0. 0. \draw[rotate=0] (0. such that the \documentclass{article} \usepackage{tikz} \bepath starts at the border of the node’s shape and not from gin{document} \begin{tikzpicture}[domain=0:4] the node’s center. \documentclass{article} gin{document} \begin{tikzpicture}[scale=3] there are special commands for creating paths containing only a node.1.1) \draw[->] (−0. (−1. \draw[->] (0.2) -. node[above.node[below=2pt.3. \draw[->.1) grid (3.125”.(2.0). “midway” for “pos=0.0) node(x) {} (3.{sin(\x r)}) node[right] {$f(x) +(up:1cm) and +(left:1cm) . the first with text ouput. \draw (0.(30:1cm).25”.rounded node}.(0.(0.1. −0.red] (30:1cm) nates.0) node[right] {$x$}.−1.2) -.25) -. \draw[->.fill=white] {$\cos \alpha$} at (3.fill=white] {$\sin \alpha$} (30:1cm defined.2) node[above] {$f(x)$}.(0.0) circle (2pt) node[align=center. LATEX/PGF/TIKZ node[fill=red!20.0) -.(2.cycle.875”. \filldraw[fill=green!20.5”.0). where fraction is a floating point number between 0 representing the previous coordinate and 1 representing the current coordinate.0) coordinate (x axis). node[circle.. \coordinate (y) at (3.below] {label} (y).9. “very near end” for “pos=0.2.0) \filldraw (0. “near end” for “pos=0.2.75”. in {−1.2) grid (1.2.−1.05*exp(\x)}) node[right] {$f(x) = \frac{1}{20} \mathrm e^x$}. To place nodes on a line or a curve use the “pos=<fraction>" option.rounded corners=8pt] (0.0).(1.0) -. 1} \draw (\x cm.1) node[pos=0]{0} node[pos=0. start.(y). There exist some abbreviations: “at start” for “pos=0”.1) node(y) {}. \draw[color=orange] plot (\x. “very near start” for “pos=0. \draw[very thick. −0.7.x axis).5cm.1).(y).−1. \draw \frac{1}{2}.. controls \draw[color=blue] plot (\x.blue] (30:1cm |.(1.(4.(3mm.2) -.1) node(y) {}.0) -.0) node(x) {} (3. (0. Here an example: gin{document} \begin{tikzpicture} \draw (−1. gray. (1. (0.red] (x) -| node[near \draw[color=red] plot (\x.3.(4. \foreach \y/\ytext in {−1." -. A new line is indicated by double backslash "\\".2.sloped] = \sin x$}.2).north)".25) -.double. \draw One can connect nodes using the nodes’ labels as coordi. {label} (y).\y cm) node[anchor=east.0) circle (2pt) node[align=left.(0.(0. \end{tikzpicture} \end{document} Multiline text can be included inside a node.25. \draw (−1.draw=green!50!black] \node[<options>](<name>) at (<coordinate>){<text>}. “near start” for “pos=0.x axis) -.0) ellipse (100pt and 50pt).25) coordinate (y axis).2) -. \foreach \x/\xtext \path (0.1) got a label "(y)".node[left. 143 corners] {3rd Once the node x has been defined.2. below] {test 3\\is right aligned}.(y).orange] (x) .25.0) got the name "(x)" and the one |.0) circle (1cm).9). you can use anchors as defined above relative to (x) as "(x.2.fill=white] {$\ytext$}. Example 4: Some functions Path construction operations try to be clever. very thin] (−1. \usepackage{tikz} \beSince nodes are often the only path operation on paths.0).0) -. below] {test 2\\is centered} -.0) circle (2pt) \end{tikzpicture} \end{document} node[align=right.draw.draw](y) {$\int_1^2 x \mathrm d x$}.(3.1) to[bend right] 1\\is aligned left} -.\x) node[right] {$f(x) =x$}. below] {test to[bend left] (1.1). \draw[>] (0. \draw (x) -. \draw[very thin. \end{tikzpicture} \end{document} .<anchor>)". 1} \draw (1pt.−1.2) -.(2.0) -.blue] (x) -.(0.4.0) -.(8. \draw[->] \coordinate[<options>](<name>) at (<coordinate>).. but additionally Example 3: A Torus you have to specify the alignment using the node option \documentclass{article} \usepackage{tikz} \be“align=".0mm) arc (0:30:3mm) -.−1pt) node[anchor=north.. \path (0. ners.y)(horizontal_axis.Starred version fills the shape.y0).y1) % . Any TeX dimension is allowed. Thus you cannot The starred version prints a filled rectangle.y0) of the radius: bottom-left corner: \pscircle(x. For circles.. ence point of the next character in the LaTeX document.y1) and ending at (x0.0) and is placed at the refer.2..5)(1. Finally. The bottom-left corner is at (0.y1) To get a vector.(xn.5.y1) Use \psbezier to print a Bézier curve with an arbitrary number of control points.y3). The syntax is the same as for fication of source file. Arcs have at most 4 control You can add as many points as you want to get a polyline: points. arc and ellipses ordinates of the upper-right corner of the picture.y0)(x1.y1)(x2. \psline: 7. the starred version prints a filled polyPSTricks commands are usually placed in a pspicture engon. There is also the \psframe[framearc=0.0. if you have installed the package xetex-pstricks. \psline{->}(x0. Rectangles The xcolor extension gets loaded along PSTricks. which makes it feasible to use pdflatex together with PSTricks commands.2 option will print rounded corvironment. other packages may be loaded when required. To get rounded corners.2](x0.y1) \psparabola(x0.y0)(x1.->](0. add an arrow as parameter: will print a symetric parabola with vertical asymptote.1) PSTricks is a set of extensions.yn) trol points and the tangents. add the following option: Use \pscurve to print the interpolation of the given points. Use the showpoints=true option to print the con\psline(x0.y1) % . \end{pspicture} The first argument between parentheses specifies the co. It is still possible to get PDF from PS files thanks to ps2pdf. And the linearc=0. so there is no need to load it manually.5 LaTeX/PSTricks \psline[linearc=0.y3)…(xn.2 Fundamental objects \psellipse(x.y){r}{angle1}{angle2} changed with \psset. .ending angles in trigonometric notation: fault unit for coordinates is centimeters (cm). ellipses: 7.y1) \psframe*(x0.y0)(x1. Polygons However.y1) possibility to use the PDFTricks extension.y0)(x1.0)(0...vertical_axis) Lines and polylines A simple line gets printed with Curves \psline(x0.y0)(x1. Use the foluse the pdftex or pdflatex compilers.5. you need to provide center coordinates and It is also possible to specify the coordinates (x0.y0)(x1..y){r} \begin{pspicture}(x0. this can be \psarc(x.y0)(x1.y1) PSTricks has one technical specification: it uses PostScript internally. CREATING GRAPHICS 7. The \psecurve command omits the first and the last arcs.Circles.Polygons are always closed. append the starting and Thus the size of the picture is (x1-x0)x(y1-y0). \begin{pspicture}(x1. vertex (x1..5.1 The pspicture environment \pspolygon(x0.y0)(x1. The de.yn) As for rectangles. \psframe(x0.y0)(x1. as in \psset{unit=1bp}. you will need to use lowing parameter to get rounded corners: dvips to get your proper document. The base package is pstricks. hence the name. you can use pstricks with xetex or xelatex without modi.144 CHAPTER 7. \end{pspicture} To restrict the drawing to an arc.y1)(x2. Axis If you want to add axes. • \pstribox{text}: triangle.ymin) and (xmax.y){text} The distance parameter is the distance from the coordinate.subgridwidth=value: width of the lines. tr: top center.ymax): prints a grid from (0.0)(1. gridlabels=0pt](−1. bl. Options . • ticksize=value: self-explanatory.e. • \psshadowbox{text}: shaded rectangle.subgridcolor=color: color of graduations and sub-graduations.ymin) to (xmax.ymax): prints a grid from (xmin. \rput{angle}(x. the \psgrid command will print a grid all over the pspicture. • gridlabels=value: size of the label numbers.y0) text} being the intersection.ymin)(xmax. \rput[t]{45}(5. • \pstcirclebox{text}: circle. with a spacing of 0.0)}{triangle \end{pspicture} \be\ps. one of the node is at (x0. Provide an angle to rotate the text. • subgriddots=value: same as griddots but for subgraduations. left and right. • gridcolor=color.ymax) \psaxes(x0.e.ymin) to (xmax. • B.ymax). • griddots=value: the full line of the main graduations is replaced by a dotted line.y0)(xmin. • b. left and right. Example Example: \rput(5. dotted.y){text} You can provide the anchor of the text which will be at the specified coordinate.5){text} Available anchors: • \psgrid(x0.ymin)(xmax. LATEX/PSTRICKS 7. value may be one of solid.0) to (xmax.. • \psdblframebox{text}: double rectangle.5) \psset{linestyle=none} textpath{\psline(0. it is possible to draw a text path. There is also the \uput command with further options: \uput{distance}[angle](x. use the pstricks-add extension To print a text following a path without printing the path.ymax) being the extreme. Br: baseline center. • gridwidth=value.5) Using the pst-text extension. You can specify parameters: \rput(x.3 145 Text 7. tl.ymax). • ticksize=valueneg valuepos: same as above. dashed. \psaxes(xmin. • subgriddiv=value: number of subgraduations between two main graduations. • \psframebox{text}: rectangle.ymin)(xmax. PSTricks features several frame style for text. • \psovalbox{text}: oval. valuepos for positive coordinates.−1)(5.ymax).1)(2. \pstextpath{shape}{text} • \psgrid(xmin.ymax) Example: \usepackage{pst-text} % . ticksize is high). but valueneg specifies the size for negative coordinates. • \psgrid(xmax. • \psdiabox{text}: diamond. Bl.5. left and right. • ticklinestyle=value: self-explanatory. gin{pspicture}(5.ymin)(xmax.5.7.5){\psdiabox*[fillcolor=green]{text}} \psgrid[griddots=5.y0)(xmin.y){text} to print text.ymax): prints a grid from (xmin.4 Grids Use Without any parameter. (x0. 2mm). • t. br: bottom center.(xmin.5.y0).. The value is the number of dots per graduation.2 (i. This is useful for huge graduations (i. subgriddiv=0. with the following commands: you need to use \psset{linestyle=none}. but will not change the width of tor.5]{->}(0.Dx=0. • **: disk.5 Generic parameters • |: bar.y0)(x1. poly\usepackage{pstricks-add} % line. crosshatch*. • o: centered circle. • linecolor=color: color is as defined by the xcolorpackage.2. There is a decent list of available symbols. • cc: rounded extreme.linestyle=dashed. Possible values: crosshatch. etc.0)(3. For closed shape you may define the fillstyle. triangle* • fillstyle=value: pattern.5) symbol2}. Open shapes Example You can define the extreme of an open shape (line. • *: centered disk. solid. hlines*.0){1} • hatchcolor=color.value is a number with or without unit. etc.5.linestyle=dashed. then the default unit is used. • doubleline=true. \pscircle[hatchcolor=blue..146 CHAPTER 7. For example • fillcolor=color.2.−1)(5. Example: • dotstyle=value where value is among: • • • • • • • \psline{|->>}(x0. \begin{pspicture}(−1. vlines. \psset{linewidth=0.3) \end{pspicture} • < or >: arrow. This changes the scale of the drawings.y1) *: disc o: circle Closed shapes +. • linestyle=value: value is one of dashed. • << or >>: double arrow. These are to be added between square brackets.0){1} • unit=value . CREATING GRAPHICS • Dx=value and Dy=value defines the spacing between graduations. This command also lets you change the default unit for Example: lengths.dotted.) with an optional parameter {symbol1. To apply parameters globally: • hatchwidth=value. diamond* triangle.fillstyle=vlines](0. • As for lines. • hatchangle=value. • |< or >|: arrow plus bar. All shapes • |*: centered bar. • xunit=value and yunit=value • comma lets you use the comma as decimal separa.5. {->} adds arrows on axes. • linewidth=value: if value is without unit.0){1} • hatchsep=value. squarre*: starred version is filled. • dotscale=value specifies the size of the points.x: cross square. \psaxes[comma. • oo: circle.. • showpoints=true: highlights points.Dy=0. hlines. • c: centered rounded extreme.linecolor=blue} \pscircle(0.linecolor=blue](0. \pscircle[linewidth=0. diamond. 7. arc. lines. vlines*. 1) \psline{. you can use the \mul. where each diagram element is placed in a matrix slot: With no text but with graphics only. Here. Notice the difference between the following two diagrams: It is required for PDFTricks to run.placed in the arrow. suitable for developing the kind of diagrams discussed here.5) \psline{->}(0.1)} \end{pspicture} 7. which contains links to several other tutorials as well as the reference documentation. \end{document} The \rput and \uput commands can be used to move any Another way to use PSTricks with pdflatex is the pst-pdf object. tips{angle}(x0.yoffset){times}{object} The arrow command is placed on the origin cell for the arrow. To make tips command: this matrix a diagram we just add directed arrows using \multips(x0.y0)(xoffset. yoffset){times}{object} \mul.5.6.simply add the following line to the preamble of your doc>}(1..1){\psline{->}(0. you can repeat directions to make bigger arrows.0)(1. The arguments are the direction the arrow should point to (up.0)(1.To draw an arrow with a hole in it. check the Xypic documentation. we use the common sulimitation. you use these operators as in math mode. but thankfully PDFTricks allows us to bypass this We can draw even more interesting diagrams by adding labels to the arrows. \begin{pspicture}(5. The only difference is that that superscript means “on top of the arrow”.]|\hole. The modifiers between the slashes define how the curves are drawn.6 LaTeX/Xy-pic or xy is a special package for drawing diagrams. use \ar[. we specified two lines and two columns.5.] \end{pspicture} If you are interested in a more thorough introduction then consult the Xy-pic Home Page. is a third operator.. for more information.y0)(xoffset. place all PSTricks commands in a pdfpic en.1)(2. just use more than one direction. 7.2) \end{pspicture} ument: \usepackage[all]{xy} You can repeat the operation with \multirput: \multirput(x0. The original PSTricks package does not work with pdflatex. or changing their appearance The -shell-escape parameter enables shell command calls... it is important to distinguish between dif- Usage • Compile with pdflatex -shell-escape <file>. .0)(1. yoffset){times}{object} where “all” means you want to load a large standard set of functions from Xy-pic. To do this. To use it. right and left).. ferent types of arrows. In vironment. This can be done by putting labels on them.7. down. set){times}{object} yoff. LATEX/XY-PIC 7..The \xymatrix command must be used in math mode. the vertical bar: | It causes text to be • Place all PSTricks extensions in a psinputs environ.. some situations. There • Declare the PDFTricks packages in the preamble. \documentclass{article} \usepackage{pdftricks} \begin{psinputs} \usepackage{pstricks} \usepackage{multido} \end{psinputs} % .The primary way to draw Xy-pic diagrams is over a matrix-oriented canvas. You can use the same options as for \rput: \multirput[reference]{angle}(x0... package. and subscript means “under the arrow”. perscript and subscript operators. Xy-pic offers many ways to influence the Example drawing of curves.10) [. ment.y0)(xoffset..the \ar command.5) \psline{->}(0.1) \rput(1. \begin{pdfpic} \psset{unit=\linewidth} \begin{pspicture}(0.0)(10.7 The PDFTricks extension To make diagonals. As shown.y0)(xoffset. In fact.6 147 Object location \end{pdfpic} % . \begin{document} % . Example \begin{pspicture}(5. mainly because it lacks functionality for identifying the surfaces that are covered by other surfaces and should be excluded from the rendered image.7 LaTeX/Creating 3D graphics For creating three-dimensional graphics. there is basic functionality in the PGF/TikZ package. A package that can handle this correctly is the pstsolides3d package.148 7. CREATING GRAPHICS . Another way to create 3D graphics is to use Asymptote CHAPTER 7. although drawing 3D graphics with PGF/TikZ is very non-flexible. Such your mystyle.sty. There are several different standards. a command could come in handy if you had to write the and write your vectors inside the new \myvec{. While they are not fancy-looking.. LaTeX will not allow you to create a new command that would overwrite an existing one.1 New commands Note When the command is used with an explicit first parameter it is given enclosed with brackets (here "[lots of users]"). but if the command is already defined. The #1 tag gets replaced ten. you have to decide how they will look. To add your own commands. If missing it defaults to 0. these arguments are definition of your \myvec{. i.1 LaTeX/Macros digits cannot be used to name macros — invalid characters will error out at compile-time. then LaTeX is a fairly high-level language compared to Plain the first of the number of arguments specified by num is TeX and thus is more limited. Here is a common example: if you are writing a book about Mathematics and you have to use vectors. It uses the same syntax as the \newcommand command. if absent. use #2 and so on. or the output produced by some existing command may not meet your requirements. But there is a special command in case you explicitly want this: \renewcommand. mand. You can call it as you wish. However. LaTeX will silently ignore the new command. In certain cases you might also want to use the \providecommand command. Then. they obey all the established rules of good typesetting. In this chapter. another common version is to write it The following two examples should help you to get the bold (a).a short name because you will probably write it very ofmand that takes one argument. The next chapter will focus optional with a default value of default. then add the following line in \wbal that will print “The Wikibook about LaTeX”.} comtitle of this book over and over again. there are situations where LaTeX does not provide a command or environment that matches your needs. other people write it underlined (a). the command requires two arguments: the name of the command you want to create. ever you can: this will save you a lot of time and increase Name your new command \wbalTwo and not \wbal2 as the consistency of your document. If the default parameter of \newcommand is present. programming. if you change your mind and you want your by the argument you specify. it is also possible to add a default paramteach LaTeX new tricks and how to make it produce outeter to a command with the following syntax: put that looks different from what is provided by default. Documents produced with the commands you have learned up to this point will look acceptable to a large audience. but you'd better choose The next example illustrates how to define a new com. The num argument in square brackets is optional and specifies the number of arguments the new command takes (up to 9 are possible). some people like to add an arrow over it ( ⃗a ). The first example defines a new command called with an arrow over them. and the definition of the command. Note that the command name can but need not be enclosed in braces. If a is a vector. then all on Plain TeX and will explain advanced techniques for of the arguments are required. used in many books.. use the command.. as you like. Use this approach whenadded in an extra set of brackets. If you wanted to use more vectors to look differently you just have to change the than one argument. 8. It works like \newcommand.e. no argument allowed. which will make them easy to read and pleasant to look at..Chapter 8 Programming 8. 149 . Let us assume you want to write your vectors idea. Basically. we will try to give some hints on how to With LaTex2e.}.1. declaration with \De. The \newenvi.1. LaTeX makes sure that you do not define an environment that already exists.. sourcing. the arguments passed to the \topics macro vironment) is encountered. make sure there is no space vironments. this requires unmatched braces to appear in both the beginning and end portions of the environment declaration.1..Commands declared within the newenvironment refer to mand to create your own environments.2 New environments New commands can be declared within newenvironment. It uses the same syntax as the \newenvironment command. part of the motive behind creating an environment is to surround its body in a grouping of braces.their arguments by doubling the # character. Just as with the \newcommand command. The num argument is used the same way as in the \newcommand command. 8. in the preamble. In the following example. there is a com.1. ronment command: Let’s provide a simple example[1] : Unmatched braces Often. you can use the \renewenvironment command. 8. gument gets processed when the \end{name} command (which ends the environment) is encountered.aux file. Extra space When creating a new environment you may easily get bitten by extra spaces creeping in.If. If a macro works in body text but not in (for between the beginning. it’s worth trying to replace the ment. If you are only using \foreach and not drawing graphics. . We recommend that package developers read The example below illustrates the usage of the \newenvi. a new environment is declared along ronment command uses the following syntax: with a nested command: Again \newenvironment can have an optional argument. 8.! Illegal parameter number in definition of \topics. if you're still having problems with extra space being appended at the end of your environment when using Some commands are fragile. which will prevent the document from compiling. use the TeX synonyms \bgroup and \egroup instead of typing { and } in this case. which can potentially have fatal effects.it. produce text that is written to a . such as: \newcommand{\MyCommand}.or clareRobustCommand{\MyCommand}. The calc package provides the common infix notation.3 declare commands within newenvironment 8. you can use the fp package. PROGRAMMING DeclareRobustCommand Also.message will be thrown: vironment gets processed. With the \ignorespacesafterend LaTeX will issue an \ignorespaces after the special ‘end’ processing has occurred.the \input for external source.1. that is they fail in some en.6 Conditionals LaTeX can use conditionals thanks to the ifthen package. 8.5 Arithmetic LaTeX can manipulate numbers. For high-precision computations. When the \begin{name} command (which starts the en.4 Extending the number of arguments The xkeyval packages will let you define key/value options for commands. and end of the environexample) a figure caption. The package is quite complete and documentation is exhaustive. For example when you want to create a title environment which suppresses its own indentation as well as the one on the following paragraph. However.. The \ignorespaces command in the begin block of the environment will make it ignore any space after executing the begin block.. This is especially true for macros which. when expanded. the following error before argument is processed before the text in the en. 8.1. To solve this issue.1.7 Loops The PGF/TikZ extension provides the \foreach command. by mistake. If you ever want to change an existing command. the material specified in the are defined with a single # character. Alternatively you can check out the multido package. you may instead use the pgffor package directly.150 CHAPTER 8. The material in the after ar. The end block is a bit more tricky as special processing occurs at the end of an environment. 8. you can use the full Plain TeX language within a valid LaTeX document whereas the opposite is false.1. • testing a string’s contents • extracting substrings • substitution of substrings • string length Up to a few exceptions. If you add the following structure to your document: • A control sequence is anything that begins with a \. LaTeX is a set of Plain TeX macros and most packages use Plain TeX code.1 Vocabulary 8. • A primitive is a command that is hard coded in the TeX engine. They are limited in numbers (256 for each type of register). LaTeX Hooks LaTeX provide two hooks: • \AtBeginDocument will let you specify a set of commands that will be executed when \begin{document} is met. From CTAN: While you play with LaTeX macros. These hooks can be called several times. In fact. • A length is a control sequence that contains a length (a number followed by a unit).com • A glue is a certain amount of space that is put between boxes when they are being concatenated.1. does the same For instance. but we hope that it will do it for now.. etc. You may wonder how all these packages you are using every day have been implemented with so little. • A font is a control sequence that refers to a font file. Anything that ends on the paper is a box: letters. It can be useful to override settings that get executed after the preamble. • A group is everything after an opening brace and before the matching closing brace. or a group.e. to (re)definition of control sequences. paralatex '\providecommand{\blackandwhite}{true}\input{test. a control sequence. There may be more terms. See Boxes. See Fonts. Plain TeX is much more low-level. • A command (or function or macro) is a control sequence that may expand to text. you will notice that it is quite limited.2 LaTeX/Plain TeX Strings xstring provides a lot of features. There are also hooks for classes and packages.8 151 8. Creating Packages. you might be using Makefiles or any kind of script to build your LaTeX projects.2. It is not printed as is. See Counters.10 • A token is a character. • A register is the TeX way to handle variables. The commands will be executed in the order they were set. . it is not written in Plain TeX. By setting \blackandwhite to false the color version of the document would be produced.9 To avoid confusion it seems necessary to explain some terms. for This gives you some more flexiblity for macros.2.. i.tex}' graphs. See Lengths. Now you can call LaTeX like this: First the command \blackandwhite gets defined and then the actual file is read with input. • A counter is a register containing a number.1. pages. In that connection it might be interesting to produce different versions of the same document by calling LaTeX with command-line parameters.8. • A box is an object that is made for printing. LATEX/PLAIN TEX 8.1. • \AtEndDocument \end{document}. it has much more capabilities at the cost of a steep learning curve and complex programming. let’s replace the page numbers with oldstylenums: 8. • position of a substring • number of recurrences of a substring Examples: 8.11 Notes and References [1] tex.stackexchange. See Command-line LaTeX If you work on a Unix-like OS. it is expanded by the TeX engine according to its type. better off to change the math shift character. make sure to revert it back at the end of your file. control sequences. There are 16 category codes in TeX. separators included. and #2 matches the first token only. think out the last separator.default.e. Should you redefine any catcode in a class or just changing the catcode: in a style file. If you redefine catcodes in your document. otherwise the compilation will fail. LaTeX changes the catcode of language itself. i. then Plain TeX character. others.3 Plain TeX macros do it after the preamble to prevent clashes with package \newcommand and \renewcommand are LaTeX-specific loading. The syntax is Note that an active character needs to be directly followed You can use (almost) any sequence of character between by a definition. or catcodes for makes use of the catcode to specify a rule: all non-public. let you change the category code of any characters. It means you can use it for macro names. everytime you expect several parameWith this redefinition. For example.e.. It’s up to you to make sure Active characters resemble macros: they are single char. the PDF version of the files. Possible implementation: As a general rule. instead of where the defined macro is used.2. TeX split them into category codes. In TeX the '@' characters belongs to catcode 11 letters by To distinguish between different meanings of the charac. That’s why when you need to access LaTeX internals.. you may be vious.you are not breaking anything. We added the parentheses just to highlight the issue here. and will not print a backslash by default. internal macros that are not supposed to be accessed by short. Example: Dollar and math . The syntax remains the same: The content gets expanded (but not executed. What it basically does is in. the '@' should now introduce ev. A space may seem conputting texinfo. the primitives for macro definition make no check on possible shadowing. They check that no existing command gets shadowed by the new definition. Thus #1 matches all characters ference: all functions are introduced with a @ instead of up to the first point. while the '\' will actually print a backslash If you do not want to play with separators. especially if you are not working alone on your tions with \makeatletter and \makeatother. Each parameter is the shortest possible input sequence that matches the macro definiTexinfo uses a syntax similar to TeX with one major dif.Solution: add a second separator. PROGRAMMING Catcodes In TeX some characters have a special meaning that is not to print the associated glyph. In the document.152 8. \ is used to introduce a control sequence. Active characters In Plain TeX.2. macros are used just as LaTeX macros (without default parameter): Itemize Texinfo Expanded definitions Some may find the LaTeX syntax of list environments a bit cumbersome. which stands itemize: for expanded def. This is not by chance: it actually uses TeX to print i. make sure to 8. since there is no separator after it. ery command. acters that will expand before any other command. All they do is document. a \.tion. arguments. Macro expansion is not always obIf you have many 'dollar' symbols to print.2 CHAPTER 8.ters with specific separators. \makeatletter and \makeatother If you have done a bit of LaTeX hacking. First try: Examples This will print (123. since there is a \catcode function that will '@' to 12. the first character. For instance let’s write a simple macro that will convert the decimal separator from point to comma.tex which redefines the control sequence venient: character. Here is a quick way to define a wiki-like TeX has another definition command: \edef. printed) at the point where \edef is used. \makeatletter and \makeatother. you However this is may be bad practice and lead to unreadmust enclose all the commands accessing private funcable code. you must have encountered those two commands. LaTeX ters.4)56. the end-user contains at least one '@' character in their A powerful feature of TeX is its ability to redefine the name. • \gdef for \global\def This command actually does the opposite of \string which prints a control sequence name without expanding it: • \xdef for \global\edef Controlling expansion Long definitions \expandafter{token1}{token2} will expand token2 beThe previous definition commands would not allow you fore token1. \noexpand is useful to have fine grained control over what You can prefix the definition with the \long command to gets expanded in an \edef.. However it might be convenient sometimes to define a macro inside a group Special control sequence name that remain valid outside the group. contrary to \edef which will expand recursively until no fur• \count0-\count9 are used for page numbering ther expansion is possible. let and futurelet 8. the \par command -..2. sequence. Example: allow multi-paragraph arguments. • font parameters For instance the following code will fail: • registers Outer macros are not allowed to appear in: • ..or double line breaks. Outer macros are meant to be used outside of any context.8. after that TeX processes the <token1><token2>.. It is sometimes needed when token2 expanto use them over multiple paragraphs. ferently.4 Registers Registers are kind of typed variables. Example[1] : Scratch registers (freely available): . is made up of macro names. There are 6 different types: \let<csname><token> is the same as \ex. writable as is. off not using them. ranging from 0 to 255. i.e. works a bit difample. It defines a new control sequence name which is equivalent to the specified token.TeX uses some registers internally. token2 is assigned to csname. Example: Both commands have a shortcut: The last line will print a sentence depending on the \status. hence the name. The token is usually another List of reserved registers: control sequence. They are limited in numbers. Example: Outer definitions \the control sequence will let you see the content of various TeX types: • catcodes • chardef This prefix macro prevent definitions from being used in some context.2. text containing sion is desired but cannot happen because of token1. This is the case of macros whose name You can also use the \global command with \edef. It is useful to consolidate macros and make them less error-prone because of bad contexts. So \futurelet allows you to assign a token while using it right Global definitions after. • \box255 is used for the contents of a page Note that \let will expand the token one time only.. so you would be better pandafter\def\expandafter<csname>\expandafter{<content>}. This is what we call global definitions... LATEX/PLAIN TEX 153 Here the redefinition of \intro will have no effect on \ex..\futurelet<csname><token1><token2>. and until the end of Some macros may have a name that is not directly the document. • macro parameters • internal parameters • lengths Example: • skipped conditional • . Definitions are limited to their scope. The best way to illustrate the use of 8. boolean command. There is two commands for that: \relax and \empty. One version for group A the other one for the rest of people (i. In some case this will be the opposite The arithmetic capabilities of TeX are very limited. \else is used to specify the default case (whenever none of Example: the previous cases have matched). The three main functions: The above code will print TeX ten times.2. alof what you want. With this self defined conditionals you can control the output of your code in an elegant way. The syntax is \ifcase <numYou may use one of the following reservation macro to ber><case0>\or<case1>\or. If number is equal to the case number. A full example is: • \skip0-\skip9 Case statement Assign register using the '=' control character. These commands can not be used inside macros. .154 CHAPTER 8.. These macros use the following syntax: \new*<csname>. The base syntax is The difference between \empty and \relax lies in the exYou can create new conditionals (as a kind of boolean pansion: \empty disappears after macro expansion. muskip or skip. 3.e. its content will be prevent any clash: printed. Sometimes it may be useful to tell TeX that you want to do nothing. For box registers.8 Doing nothing where \if* is one command among the following. \if* refers to any of the conditionals. Example: features. some replace the non-printable characters from that is: ASCII. As always. Note that 8.9 TeX characters conditionals is through an example. Example: Classic example: Self defined conditionals The \relax prevents undesired behaviour if a plus or a minus is encounter after the command. Now we can use our conditional anywhere after in an if control structure. You can print a register using the \the command. The charcode is actually the byte value. In the following way we set a value (true or false) for Most characters correspond to the ASCII value (e. PROGRAMMING • \box0-\box254 • \count255 • \dimen0-\dimen9 • \muskip0-\muskip9 depending on which value we want to set in our conditional. content and true action are arbitrary TeX contents. example 2.\else<defaultcase>\fi. you have to change the condition or to though this base suffice to extend it to some interesting define a new conditional using \newif. Two versions of a document must be generated. char not belonging to group A): We can print all characters using the \char {charcode} 1.e.g. otherwise every call to the macro would reserve another register. dimen.2. It does not make sense for box nor toks.7 Loops counters use the \number command instead.2. register may be of type count. For 8.2. Aour conditional Za-z). For variable). use the \setbox command instead.. variables) with the \newif command. Note that it starts at 0. For boxes The base syntax is use the \box command.6 Conditionals 8. 8.5 Arithmetic there is no false action.2. you cannot put an \else between \if* and \repeat. We use \newif to define our conditional (i. or if you have a lot of • The TeXbook. what we want to do is extremely simple: define a bunch of macros like this: [1] From tex. The syntax is \chardef<control seIt will fail for two reasons. The two last '#1' are supposed to refer to the arguExample: ments of the new macro. newlines as you wrote it: which will result in an error. then the corresponding macro prints its content directly. which will expand to '#1' when the macro is executed. only the \de command in going to output its content. Plain TeX provides some commands to preserve the spacing and will fail because it will redefine \csname to '#1'. • TeX by Topic. sequence name. for example to define lan. That’s what we want..3 LaTeX/Creating Packages the \equal command from the ifthen package. Paul W. There is a command for that: \expandafter{token1}{token2}.com: What is the difference between \let and \edef? In the previous snippet of code. and the We can use the above primitive to print the font encoding \def command will fail as it requires a valid control map. \#1 gets expanded to two tokens: '#' and '1'. These commands are simple: if the argu.12 Notes and References Basicly. This is It is rather confusing to discover (La)TeX treats all what the \csname. Since it is hardly possible to write it in LaTeX. Think this out. but that’s not convenient and it makes it impossible to choose the Babel language • TeX for the Impatient. but they get expanded to the \localedef macro first argument because they are in the body of that macro. we will If you define a lot of new environments and commands. which means that you will probably need to combine your We need to delay the expansion of \def. For problem 2. i.10 Verbatim lines and spaces 8. Font encoding map 2. 1.2. Karl from command line.11 Macros defining macros The solution to problem 1 is simple: use '##1'. Berry and Kathryn A. quence>=<charcode>.. It will expand {token2} before {token1}.. one entry per line: 8. it does nothing.latex '\providecommand\locale{en}\input{mydocument. Finally if we want to set language from command line. Donald Knuth languages.tex}' ment is the value of the \locale variable. the preamble of your document will get quite long. and your command: tell tex to expand the \csname stuff first. Abrahams. Victor Eijkhout You just have to move the #1.8. then to apand then in your tex file: ply \def on it. However whitespace as the same type of spacing glue.stackexchange. . The problem arises when you want to automate the task. then tex will encounter \endcsname.e. What we could be tempted to write is specific char.3. Let’s define a macros that will define language commands And you can compile with for instance. Hargreaves What we are going to do is to define the language commands dynamically following the value of the \locale variable (or any variable of your choice). Otherwise. This can be done with where the end user can write \provdecommand: and make sure it switches to the appropriate Babel lanThe final code is guage. Another version.2. It is possible to tell tex that a specific token is a control sequence. the source code is the default value that can be overridden by the one in the command line. The following sequences do the same thing.2. and you want to change the language selection. which is not what we want. Hence the use of 8.must be able to set the \locale variable so that the one in guage commands as explained in Multilingual versions. In use some Plain TeX. \en and \fr will print nothing Further reading at all.. it is a little bit tricky.\endcsname is used for. to own verbatim environment. LATEX/CREATING PACKAGES 155 chardef and mathchardef Another problem arises: how to define a command whose name is a variable? In most programming languages that’s You can define control sequence to expand to a not possible at all. we This is useful in some case. with different fonts. 8. cls files. it is possible to place the package within $TEXMFHOME (which is ~/texmf by default) accoding to the TeX Directory Structure (TDS). Let’s write • \NeedsTeXFormat{.sty. • \DeclareOption*: the starred version lets you handle non-implemented options. These commands only make sense in a regular document. By default.1 makeatletter and makeatother rectory.} specifies which version of a simple example: TeX or LaTeX is required at least to run your package. we can use it in any docload only one class per document. ument. It will allow you to use your package as detailed above. duo \makeatletter and \makeatother. The process is similar to the creation of your own package. thus making it availneeded in package or class files.3. This way it is possible to protect commands.3. • \ProvidesPackage has to have the same name of the file without the extension. but not from within an end-user document. able for use for any document. Each op.. • \AtEndOfClass • \ProcessOptions\relax terminates the option processing.. The optional date may be used to specify the • \ProvidesClass is the counterpart of \ProvidesPackversion more precisely. That would be Your package can be made available in your document just like any other package: using the \usepackage command. • \RequirePackage is equivalent to \usepackage. 8. $TEXMFHOME/tex/latex/custom/custom. i.156 CHAPTER 8. They are very similar. The file custom. • \AtEndOfPackage • \ExecuteOptions{.2 Creating your own package Let’s write a first custom. Import your new package with the known command \usepackage{mypack}. it is a good idea to create a LaTeX package or class containing all your command and environment definitions. they are not You may have to run texhash (or equivalent) to make your TeX distribution index the new file. age.cls. • Next you may write some TeX or LaTeX code like loading package.. The date is important since it can be used by other package to specify the minimum version requirement they need to use your package. • \PassOptionsToClass and \PassOptionsToPackage are used to automatically invoke the corresponding options when the class or the package is loaded. but write only the bare minimum needed for the package options set below. For a more convenient use. Classes are . you can call your own style file in the preamble of any document by the command: The name of the class file is then myclass.sty However it is possible to override this security with the On Windows '~' is often C:\Users\username. LaTeX will allow the use of the '@' characters for control sequences from within package and class files.. if any. Normally you should define new commands or import other packages. to make them accessible from packages only.3. They behave as the document hooks. • Write whatever you want in it using all the LaTeX commands you know.e. but without it needing to be in the same directory as your document. .sty files.3 Creating your own class • \endinput: this must be the last command. package are stored in .3.sty file as an example package: It is also possible to create your own class file. • \ClassWarning will show the corresponding message in the TeX compiler output.} tells which are the default. the main difference being that you can Once your package is ready.sty and the LaTeX source you are compiling must be in the same di8.There are also hooks for classes and packages. 8. See LaTeX Hooks. Writing a package basically consists of copying the contents of your document preamble into a separate file with a name ending in . PROGRAMMING this situation. It can be made dynamic enough to fit to all your future documents. It tells LaTeX the name of the package and will allow it to issue a sensible error message when you try to include a package twice. 8. • \LoadClass specifies the unique parent class. tion is declared by one such command.4 Hooks • \DeclareOptions are end-user parameters. 4. our document will work with or without the theme. Starred commands will not set the counters (LaTeX detault behaviour).4 Table of contents We redefine commands used by \tableofcontents.8. We define a color option. some efforts.4. This is definitely the most complex part. It is not that hard since the code is almost the same for \section.4. you may use as much as you want. fancyhdr is used to set header and footer. We take care of using the fancy style and to start from scratch by erasing the previous header and footer with \fancyhf{}.5 Sectioning Newcomers to LaTeX often feel disappointed by the lack of visual customization offered by the system. This is a direct application of the Creating Packages chapter. we want it to print in the header.4. • Custom theme (TOC) • Custom theme • Custom theme (red) 8.6 Notes and References .2 Package configuration Nothing much to say here.4.4. This is more a technogical example To handle the PDF bookmarks properly we need the following lines at the end of the definitions. Defining colors with specific names makes it very flexible. You should not use such theme for serious publications. so that make sure following text gets printed properly. Actually this is done on purpose: the LaTeX philosophy takes a point at doing the formatting while the writer focuses on the content.1 Introduction mand differently by resetting the counters for instance. 8.4 LaTeX/Themes 8. a package that sure to end the section printing by a \par command to will only change the appearance of the document. \subsection and \subsubsection. • needspace is used to prevent page break right after a sectioning command. to exhibit LaTeX capabilities. For \subsection we make use of the mirrors option to Note that if it may look eye-candy. LATEX/THEMES 157 8. You can choose to handle starred com8. so we call the \sectionmark command. We preceed the section printing by a \noindent. this is absolutely not a change the appearance accordingly. • tikz is used to draw the fancy material. We load the required packages. we will show what we can achieve with mand in a group where we set a font size since the space we need is \baselineskip which depends on the font size. We also use an option to toggle the fancy reflection effect which might be a little too much! 8. 8. We make In the following we will write the theme.4. Here we changed the behaviour of the starred command over the original LaTeX version. since we define and use the \sectionmarkstar command. We enclose the comIn this chapter. We use \needspace to make sure there is no line break right after a sectioning command. Finally.3 Header and footer We use TikZ to draw a filled semicircle. for \section only. model of typography. if you are writing a book.sty)./img/ a file which contains one or more \input commands.2 Getting LaTeX to process multiple Another important difference is that using \include will files force a page break (which makes it ideal for a book’s As your work grows. say. these files should be in added via \include.1 LaTeX/Modular Documents book. \include . will be explained below./mystyle. or a full-length sections. whereas the \input command does not (which wieldy and confusing. but you might take inspiration from that to create your The differences between these two ways to include files own document. nearly!). \emph etc.1.tex before continuing with the rest of the base file. i. A suggestion would be simply tex and img. the other one for images. ad infinitum (well. however.Chapter 9 Miscellaneous 9. These are all just suggestions. You cannot nest \include statements within a file If you followed all those steps. but the question is: I want to rate . create two other directories inside the root. nothing else. For example. discrete sections. What they have in common is 9. Since you'll have to write their name quite often.tex file./tex/ . This means that the important part of your working process. is kept largely separate from formatting choices (which is one of the main reasons why LaTeX is so good for serious writing!). You can./document. your root directory. one for LaTeX documents.tex . a long article with discrete article with substantial.\include{filename} ument is almost finished. We'll refer to that in the following parts as the root directory 2. differs from the first in some important ways.chapters).1 Project structure Create a clear structure of the whole project this way: 1. When the compiler processes your base file (the file that contains these statements) and reaches the command \input or \include. \inwill help you to keep the code cleaner. your LaTeX file can become un. create your document (we'll call it document. In such cases it is good practice to split your work into several files. keeping a good high-level structure.sty .tex. During this guide we have seen what is possible to do and it makes a lot of sense to write each chapter in a sepahow this can be achieved. create a directory only for the project. that they process the contents of filename. using "/" for each directory: allows you to call files which themselves call other files. on the other hand. it reads filename.tex and processes its content in accordance with the formatting commands specified in the base file.1. 3. This is all about organizing your files and using the modular capabilities of LaTeX. This way you can put all the formatting options in your base file and then \input or \include the files which contain the actual content of your work. but you can use the name you prefer) and your own package (for example mystyle. whereas \input. You will thus be dealing solely with text and very basic commands such as \section. what to do then? Where commands: should I start from? This is a short step-by-step guide \input{filename} about how to start a document properly. especially if you are writing a long in turn makes it ideal for. LaTeX makes this very easy thanks to two write a proper text with LaTeX. which of course are not normally set on a new 158 . Your document will be uncluttered and much easier to work with.e. Please resist the temptation to nest files in this way simply because the system can do it: you will end up with just another kind of complexity! 9. clude{filename}. choose short names. this second file The second method of including a file. This way it will be very easy to make modifications even when the doc. writing. / you refer to a directory which is two steps upwards in the filesystem tree. for example: \documentclass{article} \begin{document} %\input{Section_1} %\input{Section_2} %\input{Section_3} \input{Section_4} %\input{Section_5} \end{document} . Normally LaTeX users only run harddisk).tex} which use backslashes \ in pathnames. a sub-directory of your current directory. etc. using both absolute and relative paths. Mac element specified. The slash / is used to separate the different components of a pathname: directories and filenames.tex} system. it is important to note that the paths place in your system. using absolute paths is inefficient if you are a way which suits your particular set-up. When using relative paths within a LaTeX file imported you need to include a file which is always kept at a specific by \input or \include. ity outlined above. \input{filename. too: However. you file in the base file. Either Compiling the base file leave no spaces or use underscores _ instead. a relative path may simply be a more efficient and elegant way of referring to a file. not to the directory in which the included (or input) \input{/home/user/documents/useful/foo. When you compile your document. \input{/home/user/texfiles/filename. This is likely to be an issue if using a folder per chapter. . an absolute file path is generally used when using \include to read the chapter source into a main Laone has to refer to a file which is quite some way away TeX file in a parent folder. LaTeX implementations for Windows systems perform this conversion If you had created the directory myfiles for your writing for you. however.. you would refer to that file by specifying Using different paths \input{.tex} file is found. by .. however. called myfiles. these will be but if you found it more convenient to put all your files in dealt with below. could refer to that file relatively.. (especially the current directory. sides./myfiles/filename. Do note. you refer to the if you are using bibliographic software such as BiBTeX. that is the one above the current direc. you can in principle refer to any file on your \input{. they can cause ambiguous behaviour. is to comment out the command with a percentage sign. with the figures in each chapter’s folder. tory in the file system tree. in the file system (or perhaps even on a different server!). LATEX/MODULAR DOCUMENTS 159 page)./ you refer to the previous directory. in our example of the absolute path above./filename. in our producing a full draft or the final version./. will have exactly the same effect as writing In either case the ./documents/useful/foo. A relative path is one writer intended./. An absolute path is a full path. you refer to resolve all the page numbers.too). need to make your source portable (to another computer or to a different location of your the like will change according to your use of the \input and \include commands. you may refer to it with an absolute are relative to the directory in which the main . One word of warning: do not leave empty spaces in the filenames..tex} This flexibility. LaTeX uses the it is invariably necessary to run LaTeX twice or more to standard UNIX notation: with a simple dot . for example. previous directory. it will look for it in the same directory. in which case relative paths should be used if you wish to avoid unnecessary rewriting of path names. which ensures that your document will be valid project./. all commonly used file systems – Linux. lets you input files in Obviously.1. references.tex} When the LaTeX compiler finds a reference to an external Indeed.tex might have the full OS X and Windows – also feature the UNIX .and filename with every Of course. Writing \input{./ facilpath. across all installations.9.tex} Working on discrete parts of your documents has consequences for how the base file is compiled.tex} The simplest way to check that one or more of the various components of your work is syntactically robust./ you refer to the current directory. case the one which contains the base file. A full run is generally only performed for which is defined in relation to the current directory. its full path would be.tex filename extension is optional. and by two dots . inherent in the way in which LaTeX is integrated with modern file systems.. If. \input{/home/user/texfiles/myfiles/filename.. So. referring to a file in the current directory. in your texfiles directory. filename. the compiler on parts of the document to check that an individual chapter is syntactically correct and looks as the Or. and In practice. So by . however.. page references and You may. by . that LaTeX uses forward slashes / even on Microsoft Windows platforms.tex file repath. In such cases. . If that was.CTAN. the base document (main.} file{chapter1} %% more of my document content \end{document} only the files specified between the curly braces will be included. you The child documents must start with the following statewould then simply remove all the percentage signs and ments: rerun LaTeX.Standalone The standalone package is designed for tive retains as much of the .tex]{subfiles} \begin{document} sary to resolve all references. child documents This code will process your base file with the article con.aux information as possible moving more of the opposite direction than subfiles.tex' and subfiles.tex]{subfiles} \begin{document} no spaces. an article and a presentation). This package will contain two files subfiles.tex file extension: Some linux distributions don't have subfiles package in \documentclass{book} \in. There are a few packages available to address this problem. page numbers and so on. for example. Importantly.must be loaded as follows: ventions but only the material in the file Section_4.Chapter_4} % compile just TeXLive 2012. the package must be loaded as: In summary. space characters not permitted \be. Using \includeonly and end with: \end{document} Using this command provides more complex.zip from chapters 1 and 4. MISCELLANEOUS Instead of using \input and \include. The child documents contain..needed for this document \begin{document} % Your pile sections of a document using the same preamble as document or picture \end{document} the main document.sty. you may decide that you work better on individual sections of text and wish to edit and compile those separate from the main file.. this alterna.tex will \subfile{filename} be processed.tex). repeating the compiling process as neces\documentclass[main. the package must be loaded as: A disadvantage of solely using \input and \include is that only the base document can be compiled.tex) looks like: \usepackage{subfiles} \documentclass{book} \usepackage{standalone} \begin{document} %% my document content \in- . the base document (main. say.160 CHAPTER 9. since it was not included until cludeonly{Chapter_1.tds. gin{document} %% my document content \sub\includeonly{filename1. It from the previous run. However.filename2.tex) looks like: argument to this command: separate them with a comma. The filename should be written without the .their latex distributions. You can download subfiles. Note that you can have one or more files as the and Chapter 1 (chapter1. and hence more useful possibilities.In summary.g. Move these files to a directory under extension \include{Chapter_2} \include{Chapter_3} the name subfiles in the path /usr/share/texmf/tex/latex. the last thing you needed to check before sending off to that major journal.e.tex and Chapter_4. In the main document. If you include the follow. i.cls gin{document} \include{Chapter_1} % omit the '. Now you are good to go! This code would process the base file but only include the content of the author’s first and fourth chapters (Chapter_1.tex) looks like: ing command in your preamble. documents into the main document. before \be\documentclass{book} \usepackage{subfiles} \begin{document}. so messes up your cross-references provides a means for importing the preamble of child much less than the makeshift suggestion above. \include{Chapter_4} \end{document} This still won't make the package available. allowing for a flexiSeparate compilation of child documents ble way to include text or images in multiple documents (e. \documentclass[main. \usepackage{standalone} Child documents are loaded using \input or \include. %% my chapter 1 content %% %% more of my chapter This requires that there are \include commands in the 1 content \end{document} document which specify these files. the following statements: \documentclass{standalone} % Load any packages Subfiles The subfiles package provides a way to com. the texhash program must be executed first. In the main document. Creating your own style is very simple: create a file called mystyle. the code for it will be in a file called title. all the info about your style will be within one file.pdf: \begin{document} \input{. but it has to end with ". the one you will compile. PDF file into your LaTeX document. Inserting PDF files If you need to insert an existing. LATEX/MODULAR DOCUMENTS 161 put{chapter1} %% more of my document content pasted within your document.. If you don't want them. Moreover. whether or not the included PDF was compiled with LaTeX or another tool. it will be very easy to change it if you change your mind.. so you'll have exactly the same style you have used. Then you import the only package you need.tex Then create a file called document. How to write it is explained in the Title Creation section. whenever you have to take a decision about formatting. We are separating our text from the structural code. that is your mystyle. so you will be able to compile in both DVI and PDF.jpg. include the package: \usepackage[final]{pdfpages} 9. to insert pages 3 to 6 from age{graphicx} \usepackage{ifpdf} \ifpdf % put here some file insertme. \documentclass{standalone} % Preamble \begin{document} %% my chapter 1 content %% %% This is actually the beginning of the process of writing a more of my chapter 1 content \end{document} package. Write at the beginning: \ProvidesPackage{mystyle} Here a lot of code expressed in previous sections has been used...tex) looks like: your mystyle.mps} \usepackage{hyperref} \includepdf[pages=3-6]{insertme. Then tables of contents. unless you want to add other files in the .tex} \input{.3 The file mystyle.tex in the folder called tex we created before.4 The main document document.tex} \input{. It should look like this (it’s the sample code for a report. The good point of doing this is that you will just have to add one single \usepackage in your document. change the value of all the variables you want. put{.9. see the List of Packages section. even if you shouldn't need to edit it very often because you will be working on other files. \end{document} While writing. so we are improving the “What You See is What You Mean” nature of LaTeX. put{./tex/intro.1. etc. At the beginning there is the header discussed in the Tips & Tricks section.tex you won't need will work like the code you put here would be copied and to edit it anymore.tex} %\maketi\includepdf[pages=-]{insertme.a4paper]{report} \usepackwish to include: for example.} as you would do normally. there is no text in document.pdf. define your own command for it and add it to and Chapter 1 (chapter1.pdf} tle \tableofcontents \listoffigures \listoftables \input{. then your document starts. Then the main part of the document in inserted.tex} \end{document} 9. compile the output with pdflatex. Then add all the packages you want with the standard command \usepackage{. so when you will start another document you'll just have to copy that file and include it properly.tex: everything is in other files in the tex directory so that you can easily edit them. As you can see..png.sty”). possibly multi-page.pdf} \else % put here packages only for the DVI: \fi % put all the other packages here: \usepackage{mystyle} To insert the whole of insertme./tex/main_part. just comment out those lines.1.tex./tex/myappendix. but you might easily change it to article or whatever else): This package also allows you to specify which pages you \documentclass[12pt. consider using the pdfpages package.sty:let LaTeX work for you.sty (you could name it as you wish. use: packages only for the PDF: \DeclareGraphicsExtensions{./tex/mybibliography. this will be the main file. If you do so.tex} \appendix \inFor full functionality.tex} % Bibliography: \clearpage Additional information can be found in the chapter \addcontentsline{toc}{chapter}{Bibliography} \inExport To Other Formats.1.sty (note that in the code it has to be imported without the extension). the best way is to load all the packages you need inside another dummy package called mystyle you will create just for your document.pdf. Then it inserts the title: we don't like the output of \maketitle so we created our own. See LaTeX/Macros for more details. figure and tables are inserted. In the preamble. keeping your code much cleaner./tex/conclusions. Then we can see the appendix and finally the Bibliography. For a list of several packages you can use./tex/title. It is in a separate file and it is manually added to the table of contents using a tip suggested in the Tips & Tricks. It Once you have created your document.sty Instead of putting all the packages you need at the beginning of your document as you could. i. 9. Authorea performs most of the actions described in this document. I describe how the collaborative writtion features. you will be able to keep track of all your edits clearly.1. The presented solution is primarbe steeper than that for a web-based solution.2. Germany).com/ep/ pad/export/xxxx/latest?format=txt" && (latex filename. Installation chapter. In Gobby you can write your documents in collaboration with anyone in real time. separating it into as many files as you want and adding many pictures without getting confused: thanks to the rigid structure you gave to the project.1 Abstract such it does not allow you to roll the article back to previous versions.162 CHAPTER 9. IPython notebooks. To compile use the command: wget -O filename. try to avoid using numbers in file-names: if the numbering LaTeX gives them automatically. SVN. ing of LaTeX documents is organised at our department (Division of Agricultural Policy. It allows authors to enter LaTeX or Markdown via a GUI with mathematical notation. • As the LaTeX system uses plain text.5 External Links • Subfiles package documentation • Standalone package documentation • pdfpages package documentation 9. I present GB free storage and versioning system. This coordination can be organised in many different Other Methods ways. but this is not going to happen very often. When naming a file. All content is rendered to HTML5.tug. Works like our software tools. Thus.org/pracjourn/). This is the definitive soluchronisation among authors. University of Kiel. Drop.tex) where 'xxxx' should be replaced by the pad number (something like 'z7rSrfrYcH'). The collaborative preparation of documents requires a considerable amount of coordination among the authors.apache.2 Introduction ware tools and LaTeX packages to organise the collaborative preparation of LaTeX documents. Most of them have collabora. • With a dedicated Linux box with LaTeX & Dropbox it’s possible to use Google docs and some scripting to get automatically generated PDFs on Dropbox from updates on Google Docs. and as gether with their co-authors. and describe how we use them. you can use synchronous collaborative editors like Gobby.In this Wikibook. It has 2 tural Economics. where the best way depends on the specific circum• You can use one of the online solutions listed in the stances. ily based on the version control system Subversion (http: //subversion. but more automated and therefore especially this Wikibook provides some ideas and hints that will be useful for beginning LaTeX users.2. • You can use an online collaborative tool built on top of a versioning control system. MISCELLANEOUS tex directory.9. . such as Authorea. and tables.useful for other LaTeX users who prepare documents tobox is not a true versioning control system.png”. Department of Agricul• Another option for collaboration is dropbox.2 LaTeX/Collaborative Writing of LaTeX Documents Note: This Wikibook is based on the article Tools for Collaborative Writing of Scientific LaTeX Documents by Arne Henningsen that is published in The PracTeX Journal 2007. It is strongly recommended that you use utf8 encoding (especially if there are users on multiple operating systems collaborating) and a stable network (typically wired networks). 9.js plots. number 3 (http://www.tex” or “figure_03. • You can use a distributed version control system Collaborative writing of documents requires a strong synsuch as Mercurial or Git. but in the background (it is built on Git). This Wikibook describes tion for users looking for control and advanced feaa possible way to organise the collaborative preparation tures like branch and merge. think about a short name that can fully explain what is inside the file without being ambiguous. The Wikibook describes how Subversion can be used together with several other soft. Now you can write your document. • TitanPad (or other clones of EtherPad). d3. Authorea also features a commenting system and article-based chat to ease collaboration and review. is different from the one you gave (and this will likely happen) you will get really confused. it will let you save a lot of time as soon as the document gets larger. A suggestion: do not give your files names like “chapter_01. stop for a second. However.tex "http://titanpad. The learning curve will of LaTeX documents. figures.org/). data.e. Second. e. the author who has modified the document can easily attach the document and explain the changes by e-mail as well.org/links. or (re)view the differences between working copy and repository. a version control system is useful even if a single user is working on a project. because virtually all authors have an e-mail account. we have one repository for a common texmf tree. A restrictive firewall policy might prevent the version control system from connecting to the internet. In this sense. which is available in most departments. Third. home). At our department. One possibility is to compose documents by interchanging e-mail messages. modern MS Windows.tigris. Moreover. If many authors modify a document at the same time. The server records all changes a user checks in (usually with a message summarizing what changes the user made) so that other users can easily apply those changes to their own local files. the version control system tries to merge all modifications automatically. we run the SVN server on a GNULinux system. The risk of overwriting each others’ modifications can be eliminated by locking files that are currently edited. However. So.9. As version control systems generally communicate over the internet (e. Authors can also comment their modifications so that the co-authors can easily understand the workflow of this file. this allows the user to easily switch between different computers (e. Each user has a local working copy of a remote repository. So. To set up a SVN version control system. if multiple authors have modified the same line. Unfortunately. Version control systems keep track of all changes in files in a project. Hence. the user can track (and possibly revoke) all previous modifications. SVN operates on a clientserver model in which a central server hosts a project repository that users copy and modify locally. The internet is only used for synchronising the files. because it provides the most usual interface for common users. 163 9. Besides the basic SVN command-line client.g. and then check it back in. In this case. Its structure complies with the TeX Directory Structure guidelines (TDS. The only drawback of a version control system could be that it has to be installed and configured. make changes. For instance.2. com). because they were bought or developed for the internal use at our department.html. and BibTeX styles that are not available in the LaTeX distributions of the users. laptop. see figure 1).g. Additionally. http://www.g. or eSvn--a GUI frontend--with KDiff3 for showing complex differences. tug. users can update changes from the repository to their working copy.org/tds/tds. http://svnbook. because most Linux distributions include it. the SVN server software has to be installed on a (single) computer with permanent internet access.g.html).3 Interchanging Documents There are many ways to interchange documents among authors. LaTeX styles. they will have to use another way to overcome this problem. and the user has to resolve the conflict by deciding manually which of the changes should be kept. Most MS Windows users access the SVN server by the TortoiseSVN client.2. 9. one can use a service like DynDNS to be able to access the server with a static hostname. First. LATEX/COLLABORATIVE WRITING OF LATEX DOCUMENTS 9.4 The Version Control System Subversion Subversion (SVN) comes as a successor to the popular version control system CVS.5 Hosting LaTeX files in Subversion On our Subversion server. commit changes from their own working copy to the repository. installing. This repository provides LaTeX classes. However. they can be used from different computers with internet connections. through TCP/IP connections). and Mac OS X platforms. how can authors access these files? A third possibility is to use a version control system. the modifications cannot be merged automatically.2. All users have a working copy of this repository and have configured LaTeX to . there are very good manuals about SVN freely available on the internet (e. Hence.g. Users do not have to install the SVN server software. (If this computer has no static IP address. there are several Graphical User Interface Tools (GUIs) and plug-ins for accessing the SVN server (see http://subversion. This method has the advantage that common users generally do not have to install and learn the usage of any extra software. In this case. A comprehensive list of version control systems can be found at Wikipedia. on the version control server). a permanent internet connection is not required. Linux users usually use SVN utilities from the command-line. configuring. this is a convenient way to have a backup of the files on other computers (e.red-bean. Furthermore. generally the file server can be only accessed from within a department. there is a problem when two or more authors are working at the same time on the same document.2. office. authors who are out of the building cannot use this method to update/commit their changes. and maintaining SVN is a very simple task. but a SVN “client” software.) It can run on many Unix. how can authors synchronise these files? A second possibility is to provide the document on a common file server. A repository functions similarly to a library in that it permits users to check out the current project. the network administrator has to be asked to open the appropriate port. This is the unique way to access the repositories on the server. *.164 CHAPTER 9.bst) generally should be hosted in the repository of the common texmf tree.tex~ files) generally should be not under version control.log. because this saves disk space on the server and it preserves In this sense.ps. which files should be put under version control. and *.toc files) or by the (LaTeX or BibTeX) editor (e. for presentation at a conference) can be prepared either in an additional subdirectory of /trunk or in a new subdirectory of /branches. In this sense. tories of this text document are in /trunk.red-bean. *. *. 'ineffective' modifications should be avoided. teTeX (http://www.lot. these files are regularly modified so that conflicts are very likely. ing the differences between arbitrary versions of the files. the position of layouts follow the recommendations of the 'Subversion line breaks).lof. *. and BibTeX styles (*.bak.ist. and *.org/) users can add the path of the working copy of the common texmf tree in the 'Roots’ tab of the MiKTeX Options.blg.6 'Refresh FNDB' in the 'General' tab of the MiKTeX Options.eps. *. Typically. all files that are directly modified by the user and that are necessary for compiling the document should be included in the version control system. *. This feature has been proven very useful.dvi. *. if some (external) co-authors do not have access to the common texmf tree. /branches.gls. these are the LaTeX source code (*. All LaTeX classes (*.idx.tug.bix. all files and subdirec. teTeX users have to execute texhash. *. merging. the users have to update their 'file name data base' (FNDB) before they can use these classes and styles.png. it is very important not to change the positions of line breaks without cause.g. On the other hand. *. their output is less clear so that modifications are more difficult to track. Although branching. The Subversion server hosts a separate repository for each Authors are primarily interested in 'effective' modificaproject of our department. For instance. A slightly different version (a branch) of a text document (e. our repository impact on the compiled document (e. MISCELLANEOUS information about the same history of these documents.nav.tps. Furthermore. *.miktex. *. *. Often the question arises. *. *. Moreover. but not in 'ineffective' modifications that have no than for writing source code for software. *. this document).g. it is important always to use the Subversion client (and not the tools of the local file system) for these actions.bib).com). Software tools for comparing text docubook' (http://svnbook. If a single text the effort to find and review the 'effective' modifications. Generally. When creating branches and tags. *. and 'effective' and 'ineffective' modifications. tions of the source code that change the compiled docuand tagging is less important for writing text documents ment.tex) files (the main document and possibly some subdocuments) and all pictures that are inserted in the document (*. If the project yields two or more different text documents. *. Subversion difference really makes the Furthermore.snm. The diff tools wdiff (http://www. *.aut.sav. When a text document is submitted to a journal or a conference.bib~. *.cnf) and set the variable TEXMFHOME to the path of the working copy of the common texmf tree (e.Therefore. because they compare documents word by word. and *. if a single word in the beginning of a paragraph is added or removed. *. BibTeX data bases (*. *. these tools cannot be used directly . because these files are not necessary for compilation and generally do not include additional information.cls). *. both types of modifications. Figure 1: Common texmf tree shown in eSvn's Repository Browser use this as their personal texmf tree. *.org/tetex/) users can edit their TeX configuration file (e.kilepr. *. by TEXMFHOME = $HOME/texmf).ind.jpg. For instance.g. each ments ('diff tools’) generally cannot differentiate between repository has the three directories /trunk. Hence. *. This considerably increases The most important directory is /trunk.g.glo. LaTeX styles (*. MiKTeX (http://www. we create a tag in the directory /tags so that it is easy to identify the submitted version of the document at a later date. document belongs to the project.g. *. MiKTeX users have to click on the button 9. all files that are automatically created or modified during the compilation process (e. *.html) are not affected by the positions of line breaks.nl/dwdiff.tcp.aux. /trunk contains a subdirectory for each text document.bbl. If a new class or style file has been added (but not if these files have been modified).nlo.org/software/ wdiff/) and dwdiff (http://os. the repository contains manuals explaining A great feature of a version control system is that all authe specific LaTeX software solution at our department thors can easily trace the workflow of a project by view(e.g. Otherwise. automatic line wrapping of the users’ LaTeX editors should be turned off and line breaks should be added manually.prj. they highlight /tags. /etc/texmf/web2c/texmf.ilg. all line breaks of this paragraph might change so that most diff tools indicate the entire paragraph as modified. *.pdf files).2. However. *.g. but they could be included in the respective repository. because they compare the files line by line.tmp.ghalkes.sty). *. *.pdf.out.gnu. An example LaTeX code that is formatted according to these guidelines is the source code of the article Tools for Collaborative Writing of Scientific LaTeX Documents by Arne Henningsen that is published (including the source code) in The PracTeX Journal 2007. Put only those files under version control that are directly modified by the user.org/wiki/Newline). If the authors work on different operating systems. This can be achieved with the LaTeX packages svn (http: //www. the revision number or the last author) into the contents of the file itself (see e. The differences between the user’s working copy and the repository can be easily inspected with a single Subversion command or with one or two clicks in a graphical Subversion client. e. Subversion automatically converts all newline characters of this file to the native newline character of the author’s operating system (http://svnbook. 7.4/svn. Start each new sentence in a new line.g. or (preferably) svn-multi (http://www.) We find it very useful to introduce the additional line breaks at logical breaks of the sentence. Subversion has a feature called 'Keyword Substitution' that includes dynamic version information about a file (e.g. svninfo (http://www.ctan.g. Furthermore. Otherwise. Number 3 (http://www. props. authors should verify that their code can be compiled flawlessly before they commit their modifica- Figure 2: Reviewing modifications in KDiff3 tions to the repository. but also in the (compiled) DVI. their LaTeX editors will probably save the files with different newline (end-of-line) characters (http://en.special.advanced. Note that this has an advantage also beyond version control: if you want to find a sentence in your LaTeX code that you have seen in a compiled (DVI. chapter 3). the probability that the same line is modified by two or more authors at the same time increases with the number of modified lines.sourceforge.advanced. 3. However. Directives for using LaTeX with version control systems 1. The most important directives for collaborative writing of LaTeX documents with version control systems are summarised in the following box. Sometimes. it is useful to include these information not only as a comment in the LaTeX source code.com. Furthermore. In this case.props. PS. before a relative clause or a new part of the sentence starts.file-portability.org/tex-archive/macros/latex/contrib/svn-multi/). because it is rather inconvenient to search for (small) differences in long lines.com/en/1. LATEX/COLLABORATIVE WRITING OF LATEX DOCUMENTS 165 with the Subversion command-line switch --diff-cmd. To avoid this type of 'ineffective' modifications.ctan. the LaTeX editor Kile (http://kile. A reasonable convention is to add a line break after each sentence and start each new sentence in a new line.red-bean. There is also another important reason for reducing the number of 'ineffective' modifications: if several authors work on the same file. all users can agree on a specific newline character and configure their editor to use this newline character. Do not change line breaks without good reason. 6. com/posts/show/1033).tug. Verify that your code can be compiled flawlessly before committing your modifications to the repository. Split long sentences into several lines so that each line has at most 80 characters. Hence. Avoid 'ineffective' modifications. 'ineffective' modifications unnecessarily increase the risk of conflicts (see section Interchanging Documents). http://svnbook.2. 4.9. Turn off automatic line wrapping of your LaTeX editor.red-bean.org/tex-archive/macros/latex/ contrib/svninfo/). 5. PS. Another alternative is to add the subversion property 'svn:eol-style' and set it to 'native'. the co-authors have to pay for these mistakes when they want to compile the document. or PDF document. ctan.html#svn. version control systems allow a very effective quality assurance measure: all authors should critically review their own modifications before they commit them to the repository (see figure 2).wikipedia. or PDF) file or on a printout. (Note: For instance.org/pracjourn/2007-3/henningsen/). 2. you can easily identify the first few words of this sentence and screen for these words on the left border of your editor window. . this directive is not only reasonable for version control systems but also for all other ways to interchange documents among authors. we split long sentences into several lines so that each line has at most 80 characters. Furthermore. but a small wrapper script has to be used (http://textsnippets.org/tex-archive/macros/latex/contrib/svn/).net/) can assist the user in this task when it is configured to add a vertical line that marks the 80th column. eol-style). irisson. the users can author the TeX files without a strict line-breaking policy. latexdiff old. As such. style files (Patashnik 1988).bib file).ctan.2.7 Managing collaborative bibliogra. all users can specify this bibliography by only using the file name (without the full path) --. Figure 3: Specify default key pattern in JabRef 9. we have a common bibliographic data base in the BibTeX format (. tex-archive/macros/latex/contrib/custom-bib/). we specify the default pattern for BibTeX keys so that JabRef can automatically generate keys in our desired format.tex new. Other tools. If the users are willing to let go of the built-in diff utility of SVN and use diff tools that are local on their workstations. There is also a command line tool comparepdf based on DiffPDF.g. Hence. As JabRef saves the BibTeX data base with the native newline character of the author’s operating system. Latexdiff comes with a script latexrevise which can be used to accept or decline changes. it is recommended to add the Subversion property 'svn:eol-style' and set it to 'native' (see section 'Subversion really makes the difference'). Fenn 2006).g. Otherwise.fr/bstdatabase/). If no suitable BibTeX style can be found. Use Subversion's diff feature to critically review styles can be found on CTAN (http://www.JabRef is highly flexible and can be configured in many details. BibTeX is an excellent tool for citing references and creating bibliographies (Markey 2005. As JabRef is written in Java.tex are compared and the file visualizing the changes is written to diff. most desired styles can be conveniently as9. As different versions of JabRef generally save files in a slightly different way (e.org) and your modifications before committing them to the on the LaTeX Bibliography Styles Database (http://jo.tex > diff.bib files that solely originate from using different version of JabRef. An example on how to use Latexdiff in the Terminal. or renaming files and folders that are under revision con. This makes it easier to see impact of certain changes or discuss changes with people not custom to LaTeX. however this action requires knowledge of the (unnamed) postfix stack language that is used in BibTeX trol. last stable) version of JabRef. The default is that discarded text is marked as red and added text is marked as blue. MISCELLANEOUS 8.ctan. by introducing line breaks at different positions). Hence. they can put to use such tools that are more tailored to text documents.tex pdflatex diff. The diff tool that comes with SVN was designed with source code in mind. It also supports a mode similar to Changebar which adds a bar in the margin. When using a diff tool that allows convenient views of files with long lines.sourceforge.free. net/).tex # Files old.sh which inserts a bar in the margin indicating parts that have changed.tex and new. repository. BibTeX style files can be created or modified 10. Visualizing diffs in LaTeX: latexdiff and changebar The tools latexdiff and changebar can visualize differences of two LaTeX files inside a generated document. it is built to be more useful for files of short lines. all users should use the same (e. it would be hard to find the real differences between the compared documents.tex # Create a PDF showing the changes The program DiffPDF can be used to compare two existing PDFs visually. Use the Subversion client for copying. This can be done by selecting Options → Preferences → Key pattern and modifying the desired pat- . it runs on all major operating systems.no matter where the user’s working copy of the common texmf tree is located. Furthermore. We make the following changes to the default phies Writing of scientific articles. All users edit our bibliographic data base with the graphical BibTeX editor JabRef (http://jabref. moving. the probability of conflicts would be much higher (see section 'Subversion really makes the difference'). First. there would be many differences between different versions of . Latexdiff allows different styles of visualization. It also has a wrapper script to support version control systems such as the discussed Subversion. reports. Many different BibTeX configuration of JabRef to simplify our work. At our department. Changebar comes with a script chbar.166 CHAPTER 9. It resides in our common texmf tree (see section 'Hosting LaTeX files in Subversion') in the subdirectory /bibtex/bib/ (see figure 1). and books requires the citation of all relevant sources. Furthermore.manually. such as Compare It! allows to conveniently compare text files where each line can span hundreds of characters (such as when each line represents a paragraph). Add a meaningful and descriptive comment when sembled with custombib/makebst (http://www.org/ committing your modifications to the repository. a book or a copy of an article).nl/). our users have different LaTeX distributions that provide a different selection of LaTeX packages and different versions of some packages. we do not include our entire bibliographic data base.) as delimiter) somewhere in the line that starts with General: (see figure 4). the access to the server --. we consider to simplify the solution for a common bibliographic data base. Furthermore. the stored PDF files are available not only from within the department.tug. where the publication is available as hard copy (e.g. . of a publication is available. Therefore. Aigaion (http://www.2. all users who have access 9. Using this solution only requires a computer with internet access and a web browser. and a file server for the PDF files of publications in the data base.) Second.or least the access to the PDF files --. Moreover. and Christian Henning as well as his colleagues for supporting his intention to establish LaTeX and Subversion at their department. If a PDF file documents. and Subversion. the graphical BibTeX editor JabRef. The presented solution is based on the Subversion version control system and several other software tools and LaTeX packages. there are still a few issues that can be improved.2. because these servers provide the data subdirectory in our file server. Currently it is based on the version control system Subversion. but throughout the world.net/). However. we put all PDF files of publications in a specific software packages. where we use the BibTeX not only in BibTeX format. we add the BibTeX field location for information about the location. As the TeX Live distribution (http://www.All readers are encouraged to contribute to this wikibook rectory by selecting Options → Preferences → External by adding further hints or ideas or by providing further soprograms and adding the path of the this subdirectory in lutions to the problem of collaborative writing of LaTeX the field Main PDF directory (see figure 5). we might recommend our users to switch to this LaTeX distribution in the future. dine Henningsen for comments and suggestions that helped him to improve and clarify this paper. because it should be easier to use this bibliographic data base in (other) word processing Third.8 Conclusion [auth:lower{]}{[}shortyear] to get the last name of the first author in lower case and the last two digits of the This wikibook describes a possible way to efficiently year of the publication (see figure 3).9 Acknowledgements to the file server can open the PDF file of a publication by simply clicking on JabRef's PDF icon.9. the file server can be only accessed by local users.org/tex-archive/ biblio/bibtex/utils/bibtools/aux2bib). but extract the relevant entries with the Perl script aux2bib (http://www.org/ texlive/) is available both for Unix and MS Windows operating systems.) Even Non-LaTeX users of our department might benefit from Figure 5: Specify 'Main PDF directory' in JabRef a server-based solution. but also in other formats. We inform JabRef about this subdi. the user can push the Auto button left of JabRef's Pdf field to automatically add the file name of the PDF file.aigaion. LATEX/COLLABORATIVE WRITING OF LATEX DOCUMENTS 167 tern in the field Default pattern. Karsten Heymann for many hints and advices regarding LaTeX. The usage of three different tools for one task is rather challenging for infrequent users and users that are not familiar with these tools. Figure 4: Set up general fields in JabRef Second. This field can be added in JabRef by selecting Options → Set up general fields and adding the word location (using the semicolon (. Arne Henningsen thanks Francisco Reinaldo and GéralIf we send the LaTeX source code of a project to a journal. or refBASE (http://refbase.has to be restricted to members of the department.2.sourceforge. sourceforge. (Depending on the copy rights of the stored PDF files. First. publisher.net/). or somebody else who has no access to our common texmf tree.ctan. For instance. we consider to implement an integrated server solution like WIKINDX (http://wikindx. which makes the usage of our data base considerably easier for infrequent users. Now. We solve this problem by providing some packages on our common texmf tree. (Currently. we use 9. BibTeX. we plan that all users install the same LaTeX distribution. key as file name. This field can contain the name of the user who has the hard copy and where he has it or the name of a library and the shelf-mark. organise the collaborative preparation of LaTeX documents. First. . Directly Nonetheless. LaTeX source can be used to directly erpoint.org/tex-archive/ info/bibtex/tamethebeast/ttb_en.will create my_file. the first one to be supported.org/tex-archive/info/biblio/ (Unix only). The B only): to X of BibTeX. Designing BibTeX styles. If you have the choice. Keynote or LibreOffice Impress. the page layout will depend on the shape of the source code. GNU/Linux and Mac OS X). it is often easier with bibliography with BibTeX. MISCELLANEOUS References Some tools are Unix-specific (*BSD.2 Preview mode This section describes how to generate a screenshot of a 9. Without any of these two. e. for exmats ample.LaTeX page or of a specific part of the page using the LaTeX package preview.g. It doesn't seem logical to create a file with two steps when you can create it straight away. but it may be possible to make them work on • Fenn. • Tools for collaborative paper-writing 9. You can also automate the previewing of specific environments: This will produce a PDF containing only the listing content. 4. Unix systems for command line tools. and can be crucial tools for collaboration with colleagues who do not edit documents pdflatex my_file with LaTeX.dvi them are installed independently of your TeX distribu. See Installing Extra Packgenerate two formats: ages. PNG and JPG for PDF). which dvipng You get a directory if it is OK. Some LaTeX IDE will give you the possibility to generate the PostScript version directly (even if it uses internally a DVI mid-step. Nicolas (2005): Tame the BeaST. http://www.ctan.3. This package is also very useful to export specific parts to other format. Say you want to take a screenshot of • PDF using pdflatex. The PracTEX Journal. you won't get any output. bibtex/contrib/doc/btxhak.org/pracjourn/2006-4/fenn/. Some tools may already be installed. you can obtain the PostScript version using software which is included in your LaTeX distribution.3. π= ∞ √ ∑ (−3)−k 12 . http://www. are installable using your package manager or portage tree http://www. using PGF/TikZ) and then including them in other documents.3 LaTeX/Export To Other For. 2k + 1 k=0 Write this formula in the preview environment: Note the active option in the package declaration and the preview environment around the equation’s code. However. Version 1. you can easily convert DVI and PDF to other document formats. if you want to include a LaTeX generated formula on a presentation using you favorite slideware like PowStrictly speaking. you can check if dvipng is installed and ready to use (Unix • Markey. start by making sure you have preview. Screenshots are useful.168 9. most of dvipdfm my_file.3.g.10 CHAPTER 9. [[w Most of these tools • Oren Patashnik. Jürgen (2006): Managing citations and your Windows.pdf.2. such as RTF (which can be used in Microsoft Word) and HTML.3. and do not implement all the features available for the primary DVI and PDF outputs.ctan. It is also possible to create PDF from DVI and vice versa.pdf. they do work. or to produce graphics (e.3 Convert to PDF interprets the LaTeX files. more recent. For instance. as you remember from the first chapters.1 Tools installation DVI to PDF This chapter features a lot of third-party tools.tug.pdf. 9. Other formats can be produced. these documents are produced from software that parses and 9. • DVI using latex. Another way is to pass through PS generation: tion. Here you will find sections about different formats with description about how to get it. but some users might need it because. In particular. Using other software freely available on Internet. LaTeX → DVI → PS). the format you can generate depends upon the formats of the images you want to include (EPS for DVI. The Windows version has a which is a command-line tool that can manipulate PDFs GUI (l2rshell.latin1.dvi the following command-line command. with the last mac update being from -sOUTPUTFILE=Merged. which may run on any computer platform.pdf through latex2rtf.tables.pdf can be opened by a word processor such as LibreOffice Writer or Microsoft Word.ment.LaTeX can be converted into an RTF file.tex ment title.pdf 2. crop and rearrange their pages using an in.0.3.pdf latex mypaper bibtex mypaper # if you use bibtex latex2rtf mypaper Using pdfLaTeX Note: If you are merging external Both latex and (if needed) bibtex commands need to be PDF documents into a LaTeX document which is comrun before latex2rtf.g. XeLaTeX).pdf 2001.5 Convert to RTF Using Windows gswin32 -dNOPAUSE . which is straightforward to use. inclusion of EPS. which works in the same way as pdflatex: it creates a PDF file directly from LaTeX source. . They include Office.ps that you can from PDF delete. hevea mylatexfile latex2html latex2html -html_version 4. The in many ways.pdf Merging PDF from DVI If you have created different PDF documents and you want to merge them into one single PDF file you can use dvi2ps my_file.rtf. such as standard formatting. XeTeX HEVEA You can also use XeTeX (or.: conversion will create myfile. PNG or JPG graphics.ps 169 9. which in turn sDEVICE=pdfwrite -sOUTPUTFILE=Merged. You need to have Ghostscript installed: 9.3.unicode -split 1 nonavigation -noinfo -title “MyDocument” MyDocuCustomization of PDF output in XeTeX (setting docu. See its Wikipedia entry for more details. e.tex file: pdftk 1. This conversion is done -dBATCH 1. Firth. options to merge several pdf files (pdfjoin). it has some limited support for packages.4 Convert to PostScript you will get also a file called my_file. and natbib. However. more precisely. and can be used on an example mypaper.tations of LaTeX. however is only actively supported on Windows.pdf cat output 123.aux and . many other packmay be avaliable in your Linux distribution’s repository.pdf gram. latex2rtf is simple to use. This program such as varioref.pdf 2. 9.exe).9.pdf 2. which you may open in Three simple shell scripts using the pdfpages package are many word processors such as Microsoft Word or Libreprovided in the pdfjam bundle by D. Using Linux gs -dNOPAUSE -sDEVICE=pdfwrite Linux and BSD.pdf 3. author. because the .pdf -dBATCH 1. use: command-line version is offered for all platforms. and and rotate.) is done using the conTeX4ht figuration of hyperref package. which helps the user to merge or split pdf documents typesetting.dvi ps2pdf myfile. keywords etc. pdf2ps my_file.pdf 3. ages are not supported. LATEX/EXPORT TO OTHER FORMATS dvi2ps myfile. put several pages in one physical sheet (pdfnup) and rotate pages (pdf90). latex2rtf supports most of the standard implemenAlternatively.bbl files are piled with pdflatex.6 Convert to HTML See also Modular Documents There are many converters to HTML. teractive and intuitive graphical interface. a much simpler option is to use the needed to produce the proper output.3. The result of this pdfpages package. some math tion. and mimicking the behaviour of the LaTeX pro3.3. One advantage of XeTeX over standard LaTeX is support for Unicode and modern typography. Another option to check out is pdftk (or PDF toolkit). As well. To merge one or more files. PDF-Shuffler is a small python-gtk applica. The program operates by reading the LaTeX source. you like and save it to any format supported by GIMP. There is still Inkscape is able to convert to SVG. as In some cases it may be sufficient to simply copy a region PNG for example.dvi • Raster graphics define every pixel explicitly. Try different resolutions to JPG is a well known raster formats. This however will not gen. This value will be passed to dvipng using the flag -D. X = 32. If you want. PNG is a raster format.7 Convert to image formats (as all the software used by this script is multiplatform. Raster graphics GIMP Open your file with GIMP. The formula is: <dpi> = <font_px>*72. This last method makes the SVG big and slow.dvi Multiple formats pdftocairo There is pdftocairo featured in the poppler toolset. where X is measure in pixels. bibtex2html pdf2svg file.3.dvipng erally have sufficient resolution for whole pages or large A method for DVI files is dvipng. So either the font will be rendered using a local . PDF. MISCELLANEOUS TeX4ht is a very powerful conversion program. Now. whether you want to use anti-aliasing (choose strong if you want to get something similar to So SVG is great for drawings and a small amount of text.sh can be used 9.170 CHAPTER 9. such as Wikipedia. of a PDF (or PS) file using the tools available in a PDF viewer (for example using LaTeX to typeset a formula for pasting into a presentation). . but 100 dpi should be enough. If the input LaTeX file contains a lot of text which formatting must be preserved.ttf or . To generate the desired png file run the command as follows: pdftocairo also supports various raster graphic formats.27/10. dvisvgm There is two family of graphics: One can also use dvisvgm. Basically a configuration file has to be prepared. It will ask you which page you want to convert. some cases where raster graphics are used: inkscape --export-area-drawing --export-ps=OUTPUT • The target system does not handle vector graphics.pdf output. dvisvgm -n file. not suffer from quality loss.otf font (which will mostly change the output). what you see on the screen).svg Run latex as usual to generate the dvi file. and other vector graphic formats. thus do verts from DVI to SVG. SVG is a vector format. dvipdfm. Usage is the same as areas. or all characters must be turned to vector graphics. SVG is not that great. It is sometimes useful to convert LaTeX output to image this is also possible in Windows. a step-by-step guide formats for use in systems that do not support DVI nor could be written). then the size in dpi corresponds to 231. for instance. we want an X font size formula. EPS. svg=OUTPUT INPUT • SVG can not embed fonts.26 -o foo. ps2svg bibtex2html mybibtexfile Alternatively DVI or PDF can be converted to PS as described before. pdftocairo -svg latexdoc. to dots per inch (dpi). PDF files.pdf file. Once you have the image within GIMP. but its Vector graphics configuration is not straightforward.png foo. You need to convert this. however it is usually fit your needs. an open source utility that con• Vector graphics can be scaled to any size. dvipng -T tight -D 231. you can post-process it as not as good as PNG for text.26.svg For BibTeX. Direct conversion from PDF to SVG can be done using the command line tool pdf2svg. and then the program is pdf2svg called. INPUT inkscape --export-area-page --export-plainonly raster graphics are supported. Inkscape So vector graphics are usually preferred. then the bash script ps2svg. dvi | fmt -u The use of fmt -u (available on most Unices) will remove the justification. The option tight will only include all ink put on the page. you can try a newer version available on Google Code.png. Example: catdvi yourfile. or use HTML conversion first and then copy text from your browser.3.read Tips and Tricks first. ImageMagick The convert command from the ImageMagick suite can convert both DVI and PDF files to PNG.8 Convert to plain text If you are thinking of converting to plain text for spellchecking or to count words. use detex yourfile > yourfile. convert input. 9. It can handle multi-file projects.pdf output. like catdvi. If you want the plain text go to a file. 171 .9. so all you need is to give one command: detex yourfile (note the omission of .tex extension).3.txt If the output from detex does not satisfy you.png optipng You can optimize the resulting image using optipng so that it will take up less space. which strips LaTeX commands. If you want to keep the formating. Most LaTeX distributions come with detex program. you can use a DVI-toplain text converter. The option -o sends the output to the file name foo. LATEX/EXPORT TO OTHER FORMATS The flag -T sets the size of the image. there may be an easier way -. This will output result to standard output. 4 Writing the euro symbol directly Add the following lines in your preamble: Avoid excessive double line breaks 10.1. accents) with OT1 enThis will prevent TeX from seeing another line break— coding (the default). you can easily change them with See Page Layout. To use Latin Modern you need to include the package: 10. The big probin UTF-8.. • If two or more consecutive line breaks are found.1.3 Simplified special character input See Fonts for an explanation. this is a preferred default and improves readability. then you have no Type1 compatible fonts availExample: able.1.6 Fonts are ugly/jagged/bitmaps or You might be tempted to put blank lines all the time to PDF search fails or Copy/paste from improve the readability of your source code.2 10.1 LaTeX/FAQ 10. howTeX starts a new paragraph.g. 10. lem with manual formatting is that it is not dynamic.1.} writes good. the title on the same line as the content. Even 172 .g. • If only one linebreak is found. TeX inserts a space if there is no space directly before or after it.5 LaTeX paragraph headings have tiin source code tle and content on the same line Too many paragraphs of one line or two do not look very Some people do not like the way \paragraph{.1. In most cases. ever. You must be using diacritics (e. There are ways to get around the default behavior. Margins are too wide Avoid using latin1. E. but this will PDF is messy have an impact on formatting.. If you still disagree.7 Manual formatting: characters. Switch to T1 encoding: all characters up to and including the next line break after If you have ugly jagged fonts after the font encoding a comment are ignored. 10. The solution is simple: put a comment at the very beginning of the blank lines. This is actually Remember the TeX rule: fairly common in a lot of documents and not as weird as it may seem at first. you can enter special characters directly rather than entering the TeX commands for diacritics and other extended 10. see \paragraph line break for more information. See Special Characters. The TeX engine is in charge of that..1 • you add the \usepackage[utf8]{inputenc} line in the preamble.1. use of line breaks and page breaks This requires that: You should really avoid breaking lines and pages manu• your text editor supports and is set to save your file ally.1. change. So long as your computing environment supports UTF-8.Chapter 10 Help and Recommendations 10. Install Computer Modern Super or Latin Modern (package name may be lm). LaTeX’s default margins may seem too large. However.8 Always finish commands with {} TeX has an unintuitive rule that if a control sequence (a command) is not followed by a pair of braces (with a parameter in between or not). glossaries. \raggedright or gle space.See Importing Graphics and Floats. placing the picture right at the spot where it was placed in the source. no extra space will be printed. ually. underlining is rarely used in professional environments. LaTeX will not print any space. parts or chapters (although when you start a new part or chapter.13 Compilation fails after a Babel language change and distract the reader. When you start reading a paragraph with a bold word in the middle.other italic text in the regular font.1. it is usually poor practice to tion mark and one space after it. Especially regarding punctuation. bold and underline tend to overweight the text 10. (Technical explanation: a control sequence name can only be composed of characters with catcode 11.1. use a pair of braces after the command. When you do manually insert a page break.) LaTeX has a macro \emph{..information. the content is likely to ren.1. and so on. Italics are less obvious and do the project). The original and more appropriate use of bold and underline is for special parts. Figures and Captions Z and a-z by default. then the following space character(s) are ignored. which is a virtual object that LaTeX can put in places other than the exact location it To fix this. This character is then skipped.12 Rules of punctuation and spacing Example: LaTeX does some work for you. . the index..Wikipedia.. quence name start thanks to the backslash. no space is taken into account. LaTeX will ordinarily do this for you). but you can have a quick look at graph.} for emphasizing text using italics. it will behave just as in a word processor.} because \emph{. The answer is simple: a figure is not a picture! If you use \includegraphics without enclosing it in a figure environment. but not everything. and it knows where it ends when it encounters the first token which is not of catcode 11. LATEX/FAQ 173 if it looks right the first time. 10.These commands are switches—they remain active until namically by using the xspace package. that is A.. The only place where page breaks are recommended is at the upper level of sectioning in your documents. (Actually. then try compiling again. thus spoiling the content and break. even was created. you often read the emphasized part first.} will correctly print emphasized text inside If you absolutely have to insert line or page breaks man.1. Example: with pictures and tables. use bold or underline formats in the middle of a para. such as headers. you should use \clearpage or \cleardoublepage which print currently floating figures before starting a new page. Figures are a type of float. so they are der really badly if you change anything before the point usually a better choice for emphasizing small amounts of you manually formatted. so that you don't later 10.not have more weight than normal characters.10 The proper way to use figures have to come back and update it. Users used to WYSIWYG document processors like Microsoft Word or LibreOffice often get frustrated with figures. In English there is no space before a punctuaTypographically speaking. an extra space will be appended.11 Text stops justifying consecutive spaces have been concatenated into one sinMost likely you have used \raggedleft. TeX knows where the control se.1. which helps to prevent cluttering your text if there are no parameters.. e.This is a limitation of Babel. ditional word processors because these two functions are very easily accessible (along with italics). you should do it after you are sure you have completed your document otherwise. Delete the .1. It is possible to define macros that will insert a space dy. See Paragraph Alignment for more • If there is no brace and a space following the com.aux file (or clean ing the order of the ideas. 10. • If there are braces. the end of the scope.. It should be preferred to \textit{. or until the end of the document if there is no scope. This has become a common habit for users of tra. the TeX or LaTeX logos) are run together with the following word. Since 10. you are pretty free to do what you want.for more details. text.10.1.9 Avoid bold and underline language.) \centering at some point and forgotten to switch it off. Punctuation rules are different for each 10. and the command (say. mand.g.There are a lot of rules. 1. although it is available on most WYSIWYG document processors. When possible. this is generally a poor method which will lead to lack of control.1. For lists you may want to try the easylist package. 10. sure you read its official documentation. will produce much higher quality results. Also. and it quickly Trying to stretch tables with the default tabular environmakes up for the time you would lose if you don't learn ment will often lead to unexpected results. either through LaTeX’s native diagramming tools or by exporting vector formats from your drawing or diagramming tools. Thankfully. HELP AND RECOMMENDATIONS Learning LaTeX quickly or cor. in under 100 MB.20 Example: Note that writing French like this might get really painful. it is the same. Some LaTeX editors feature table assistants. many You usually use non-breaking spaces for punctuation spreadsheet applications have a LaTeX export feature (or marks in some languages.1. particularly when printed. Note that this is different from usual text parentheses. the LaTeX math formatting is perfect. you only need to know a few things about the environment of your choice.19 Tables are easier than you think Even though the Tables chapter is quite long. Really learning LaTeX is not that difficult and does not take that long. for units and currencies.18 Stretching tables mistakes without you understanding why. 10. or SVG graphics If you are getting frustrated with a specific package. etc. Most chapters in this book are dedicated to a specific usage. is rarely as accurate as the official documentation. In the above example. It is very important for consistent reading. you put a nonbreaking space before all two-parts punctuation marks. Content found on the web.174 10. As with every programming language. Althings properly and end up stuck all the time. EPS. initials. unexpected results.16 Smart mathematics Relieving cumbersome code (lists and long command names) LaTeX is sometimes cumbersome to write. you can still use the math The Installation article explains in detail how to manunotation. for plugin).g. if you want to refer to an object A. only the non-breaking space for the euro symbol must remain. The nice tabu package will do what you want and even much more.1. words. and a lot of frustration. See Editors for some interesting choices. For math and a lot of other fields. variables or oth.1. Now All virtual objects designated by letters. Again. 10. including LaTeX and other features. A non-breaking space between two tokens (e.17 Use vector graphics rather than rectly raster images Nowadays it is very common to “learn” on the web by using a search engine and copying and pasting things here and there. LaTeX uses the '~' symbol as a non-breaking space.writing a list is as simple as ers should use a dedicated formatting. you should prefer PDF. so the basics are actually covered very quickly. You can define aliases to shorten some commands: Here the xspace package comes in handy to avoid swallowed spaces. For instance.10.1. 10. In the end. For example. it is worth reading.21 Reducing the size of your LaTeX installation If you refer to a set of objects. 10.1. in French typography. . even in this book.15 Non-breaking spaces This useful feature is unknown to most newcomers. see Tables for more details. punctuation marks) prevents processors from inserting a line break between them. especially if you are not using an adequate editor. Raster (bitmap) graphics scale poorly and often create jagged or low-quality results which clash with the document quality. Inaccurate information might result in causing 10. write If you want to refer to several objects in a sentence. ally install a fully functional TeX environment. ternatively if you cannot use the tabu package you may try tabularx or tabulary packages See Tables.1. Using vector (line-oriented) graphics instead.14 CHAPTER 10. which is usually the best source of information. make over PNG or JPG. Babel with the frenchb option will take care of the non-breaking spaces for all punctuation marks. The time you spend learning is worth it. it could be necessary will output: to make some changes in the source so that it will work TeX capacity exceeded . EPS and PNG) with the same name and link them without writing the extension. There is a simple way to solve this problem: does not work as well. However.” do not need any special attention. The Chicago Manual of Style).g. In this case.1 within{equation}{section} within{figure}{section} \number- Always writing LaTeX in roman The same can be done with similar counter types and docIf you insert the \LaTeX command in an area with a ument units such as “subsection”. For example.e.2.2.\ " or “e.} : 10. LaTeX will treat the periods as end of sentence periods (i. a comma can be used afterwards. To prevent LaTeX from adding space after the last period..e.) \newif\ifpdf \ifx\pdfoutput\undefined \pdffalse \else \ifnum\pdfoutput=1 \pdftrue \else \pdffalse \fi \fi this is plain TeX code. The ifpdf package and this code. full stop) since they are followed by a space.e. and e..5 Graphics and Graph editors 10. all that is related to graphics has to be adapted accordSo you need to create a temporary variable.e. latex \fi Depending on style (e. For very basic documents the source is the same but. you can use this syntax to load different packages or If the command \frenchspacing is used in the preamble. if the documents gets more complicated.2 id est and exempli gratia (i..g.2.2.e. After you have used this code. the space between sentences is always consistent.10. \usepackage{ifpdf} We must use the TeX primitive \let instead. a LaTeX source \renewcommand{\LaTeX}{{\rm \LaTeX}} can be used to generate both a DVI and a PDF file.g.. and add more space before the next “sentence”.g. include the following in the preamble. which is interpreted by LaTeX as part of a sentence. the correct syntax is either \ifpdf % we are running pdflatex \else % we are running “i. if you don't have this package. LATEX/TIPS AND TRICKS 175 10.putting in the same folder pictures in different formats mand{\LaTeX}{{\rm \LaTeXtemp}} (e. a few For long documents the numbering can become cumbersome as the numbers reach into double and triple digits. however. To reset the counters at the start of each section and prefix the numbers by the section number.. you must redefine the function. even if you should use different pictures Sadly. As discussed in the section about floating objects. you can use whenever you want in your document the following syntax: If you simply use the forms “i.2.2. \usepackage{amsmath} .g. For example. since the period is not followed by any space. you can add the following text just after \documentclass[. you may need mathematical formulae or special characters (such as Greek letters). for scientific images. different graphic file formats according to the compiler..g.\ ". for a format but it will not for the other. according to the final format. place after \ifpdf the code you want to insert if you are compiling with pdflatex. you can override this limit \newcommand{\LaTeXtemp}{\LaTeX} \renewcom. non-default font.”. 10.]{. Most vector image edi\number.3 Grouping Figure/Equation NumVector image editors with LaTeX support bering by Section It is often preferable to use the same font and font size in your images as in the document. Both things can be achieved easily if the image editor allows you to use LaTeX code in your image. both define a new if-else you can use to change your code according to the compiler you are using. “i.tors do not offer this option.4 Generic header naive As explained in the previous sections.” or “e. it will be formatted accordingly. If you want to keep LaTeX written in Computer Modern roman shape. ing to the final format.. Moreover.” and “e. There are. the 10. sorry [ grouping levels =255]. \let\LaTeXtemp\LaTeX mand{\LaTeX}{{\rm \LaTeXtemp }} \renewcomor.2 LaTeX/Tips and Tricks 10.. place after \else the code you want to insert if you are compiling with latex. HELP AND RECOMMENDATIONS exceptions.5 0 0 A very versatile vector image editor is Inkscape. In the last case the saved file contains PSTricks/LaTeX code only.eps.tex for your title file. but do myreport.tex in our document: which produces vector images in encapsulated postscript \input{graph1. Owing to that you can include any possible LaTeX code in the picture. including but not limited to mathematical formulae in the image. Using this way text is rendered by the latex compiler itself. The above steps can be automated by the package gnuplottex. set format "$%g$" set title “Graph 3: Dependence of $V_p$ on $R_0$" set xlabel “Resistance $R_0$ [$\Omega$]" set ylabel “Voltage $V_p$ [V]" set border 3 set xtics nomirror set ytics nomirror set terminal epslatex set output “graph1.5 not support LaTeX text by itself. A newer and easier-to-use vector image editor specially tailored to LaTeX use is IPE. separately from the rest of the image (which is put in a . functions. where they can \begin{gnuplot}[terminal=epslatex. this produces poor quality rasterized images. which eliminates the need of exporting your image each time you have edited it.eps and the text in graph.tex} format and supports LaTeX syntax in any textlabels. The second includes Another way to generate vectorgraphics is using the the EPS image. It does 0.176 CHAPTER 10.tex . data.tex.5 0. since the file is rendered by your LaTeX environment directly. . Additionally since version gnuplot can plot various numerical data. These PDF files can be included tions=color. It also gives you some very basic ways of encapsulating LaTeX text and math in the image (setting the text’s 'special flag' to 'special' instead of 'normal').vironment rectly to Microsoft Expression Design 4.eps” plot “graph1. and compiling with latex shell-escape.9.5 2 -1. How.bmp as well as . charts can be copied di. LaTeX users used Xfig for their drawings.5 gin Textext for that. We as. This allows you to put any block of LaTeX code in your image. It allows you to draw basic geometric objects and save the result in a variety of formats including . such as: a free and versatile plotting software.48 you can export to vectorgraphics with texts sepa. \end{gnuplot} in LaTeX. terminalopbe saved as PDF files. linewidth=2 ] . A simple gnuplot script formula and highlight it as such (because of the '$' that is interpreted as part of the latex code).5 1.eps or .jpg.tex.pdf files. scale=0. that the data is in a CSV file (comma separated Some editors will think of all following text as part of a text) in the first and third column. Calc my report. By placing gnuplot commands inside \beGraphs with gnuplot gin{gnuplot}\end{gnuplot}. but you can use the plu1 1. Don't type ever. It allows any LaTeX command. 3 2.solved by making file title only in one word.bution as well as 3D graphs and surfaces rated in a .ps file).) and Failure to access gnuplot from latex for Windows can be include it in the document as a cropped screenshot.. so that we only need to include the file Asymptote language. . all LaTeX text will be put in a . the graphs are created and added into your A simple method to include graphs and charts in LaTeX document. The program saves its files as editable .tex file. LaTeXDraw is a free and open source graphical PSTricks generator and editor.(2*($1)):2 sume.csv” using 1:3 #Plot the data Now gnuplot produces two files: the graph drawing in graph.5 1 -1 -0. This can be avoided to plot the data can look like this: . also allows you to copy-paste the charts into OpenOffice When you are using gnuplottex it is also possible to diDraw and save them as PDF files. that has a special output filter directly for exporting files to LaTeX. error distri0.. documents is to create it within a common spreadsheet software (OpenOffice Calc or MS Office Excel etc. rectly pass the terminal settings as an argument to the enUsing Microsoft Excel 2010. The editor is still used by quite a few people nowadays because it has special 'export to LaTeX' features. This method produces high quality vectorized Using gnuplottex can cause fraudulent text-highlighting in images.tex-file.png. It is a programming language graph. When exporting. In early days. some editors when using algebraic functions on imported An excellent method to render graphs is through gnuplot. . but is not affecting the interpretation of the . so your top directory convert your LaTeX source to plain text and use. If you're using pdflatex you can create a folder in which If you want to count words you can. type the following epstopdf will automatically transform the .2.8 Sidebar with information If you want to put a sidebar with information like copyright and author.If you want it on one page only.pdf 3. we must However. UNIX wc command: pdflatex -output-directory tmp detex yourfile | wc An alternative to the detex command is the pdftotext Please note that the folder tmp should exist.tex \cleardoublepage by the editor. Please note that usage of ing more than a regular \newpage. Gnuplot-mode. or Emacs. and LaTeX will do nothverted PDF graphics is used.. LaTeX will make a new (odd) page. ample.tex the AddToShipoutPicture command at the page you want Both understand LaTeX and will skip LaTeX commands. The following method opens up this.tex file. However if command which extracts an ASCII text file from PDF: you're using a Unix-based system you can do something 1. you might want to use the eso-pic package.10. A crude but effective method. \newevenside \includegraphics{graph1} eps2pdf graph1. and make another new (even) page. it. use LyX or all the output files will be stored.2.2. pdftotext yourfile.eps sed -i s/". Last another option is 10.tex aspell --mode=tex -c yourfile.pdf"/g graph1. or ispell % } } % }% programs. use the starred version of spell -l -t -i utf-8 yourfile.. When using pdfLaTeX instead of simple LaTeX.looks cleaner. the consubsequently an even-side page. in the graph1. To active the new even-side page.tex This way. if we choose to output to PS or DVI.eps"/". 10.txt alias pdflatex='mkdir -p tmp.tex hun. such as LyX. However. page is an even page. \AddToShipoutPic\AtPageLowerLeft{% \rotatebox{90}{% \begin{minipage}{\paperheight} \centerIf you want to spell-check your document.7 New even page #$ \end{gnuplot} In the twoside-mode you have the ability to get a new oddAs it uncomments the dollar sign for the gnuplot inter. If we include a graphics now and leave out the file extension.9 Hide auxiliary files to convert LaTeX source to plain text and open resulting file in a word processor like OpenOffice. Kile. LaTeX doesn't give you the ability to get a new convert the EPS image to PDF and to substitute the name even-side page. Note: Emacs AucTex users might want to check out put in a placeholder. If we are working with a Unix-like The following must be put in your document preamble: shell.6 Spell-checking and Word Counting ture{% ispell yourfile.. pagestyle{empty} % if want no header/footer \newpage Instead of calling eps2pdf directly.org or KOffice. (\AddToShipoutPicture*{. again. the next new page is version is used and if we output to PDF directly.. for ex. Example: \usepackage{eso-pic} . it is simply done using: \usepackage{ifthen} \newcommand{\newevenside}{ \ifthenelse{\isodd{\thepage}}{\newpage}{ \newpage With the included tex file we can work as with an ordinary \phantom{placeholder} % doesn't appear on page \thisimage. pdflatex -output-directory . pdflatex yourfile.2. the EPS If the given page is an odd-side page. we can also include } } the epstopdf package that automates the process.eps-file to PDF where you want the new even-side: and insert it in the text. hunspell (preferably). wc like this: yourfile.2. Generate png screenshots See Export To Other Formats.side page by: preter.tex 2.}) You can also use a LaTeX editor with built-in spell checking. 10. LATEX/TIPS AND TRICKS by ending with: 177 10. you can use ing\textcopyright~\today{} Humble me \end{minipage} the command-line aspell. if the given epstopdf requires compiling with latex -shell-escape. pdflatex -output-directory tmp -interaction=nonstopmode $*.' CHAPTER 10. cp tmp/*.vimrc: " use pdflatex let g:Tex_DefaultTargetFormat='pdf' let g:Tex_MultipleCompileFormats='pdf.178 tmp' Or for vim modify your .pdf . HELP AND RECOMMENDATIONS .dvi' let g:Tex_CompileRule_pdf = 'mkdir -p tmp. That book is • Jtwdog released under the GPL. but they • Alessio Damato never edited directly this wikibook. then that text is double licensed under GPL and GFDL.pdf also at http://web. english/lshort.1 LaTeX/Authors 11.org/web/20010603070337/http: In progress //people. We have Major contributors to the book on Wikibooks are: contacted the authors by email asking for permission: they allowed us to use their material. the same as Wikibooks. so we can include parts of their document as we wish.1. ac.2 Wiki users • Not So Short Introduction to LaTex2e by Tobias Oetiker.archive.ch/ and http://homepage. a beginner’s guide to typesetting with LaTeX. Anyway. • Tobias Oetiker’s Not So Short Introduction to then that part (and only that part) is released under LaTex2e: the terms of GFDL.org/tex-archive/info/lshort/ ibooks.at/partl/ respectively.tex Newsgroup for (La)TeX related ques• David Wilkins’ Getting started with LaTeX. Community • LaTeX Primer from the Indian TeX Users Group.pdf 179 . their websites Here are some other online resources available: are http://it. You can freely copy text from that guide to here. with permission of the author: • Andy Roberts’ Getting to grips with Latex. • UK-TUG The UK TeX Users’ Group • TUGIndia The Indian TeX Users Group • comp. like any other text here on Wikhttp://www.ee.oetiker.Chapter 11 Appendix 11. For more information. Their document is released under the GNU Free Documentation License. For more information about Tobias Oetiker and Hubert Partl.ethz. If you find text on both the original book and here 11. we have contacted Indian TeX Users Group and they allowed us to do it.1. In any case.1 • Peter Flynn’s Formatting information. Included books The following books have been included in this wikibook (or we are working on it!).boku. The original book is released under the GNU Free Documentation License. If you see text on both the original work and here. The tions book is not released under any free license. his personal website is http://silmaril. Hubert Partl and Irene Hyna.ch/~{}oetiker/lshort/lshort. We have contacted him by email asking for permission to use his work. He agreed: his work is still protected but you are alTutorials/FAQs lowed to copy the parts you want on this Wikibook. 11. we • Pierre Neidhardt have the permission of the authors to use their work. but we • CTAN hundreds of add-on packages and programs have contacted the author asking him for the permission to use parts of his book on Wikibooks.2 LaTeX/Links on Wikibooks.ctan. that is not compatible with the GFDL used here in Wikibooks. • The TeX Users Group Includes links to free versions of (La)TeX for many kinds of computers.text.ie/cgi-bin/blog. the same as Wikibooks. html • amsmath users guide (PDF) and related files: http://www.org/tex-archive/info/epslatex. Each package has a short description next to it and.ctan.pdf • Getting to Grips with LaTeX (HTML) Collection of Latex tutorials taking you from the very basics towards more advanced topics http://www.fr/index.tcd. a concise summary of math formula typesetting features http://www.vel. there is a link to a section describing such packhttp://tex.uniyar.maths.nasa.tex.eng.ru/doc/latex2e. single packages.ac.andy-roberts.doc). used by many (La)TeX distributions • Natural Math converts natural language math formulas to LaTeX representation • Obsolete packages and commands • Lamport’s book LaTeX: A Document Preparation System • David Bausum’s list of TeX primitives (these are the Templates fundamental commands used in TeX): http://www.sty.pdf and *.odt (*.pdf Reference • LaTeX Project Site • The Comprehensive TeX Archive Network Latest (La)TeX-related packages and software • TeX Directory Structure.tex. .6.pdf The list is in alphabetical order.nz/Blog/Entries/2009/ 11/4_LaTeX_Document_Preparation_System.ac.org/tex-archive/macros/latex/ required/amslatex/math/ • LaTeX Primer from the Indian TeX Users Group: http://sarovar.gov/latex/ For more information. All of them (unless stated) should be in• Hypertext Help with LaTeX cluded in your LaTeX distribution as package_name.macrotex.html age in detail.co.uk/faq • A template that supports an easy conversion to *. when • The (La)TeX encyclopaedia available.cam.3 LaTeX/Package Reference This is an incomplete list of useful packages that can be used for a wide range of different kind of documents. refer to the documentation of the • EpsLatex: a very comprehensive guide to images.pdf • UCL computer department thesis template • The UK TeX FAQ List of questions and answers that • UT thesis template. figures and graphics http://www.co.html • Chapter 8 (about typesetting mathematics) of the LaTeX companion http://www.ac.rna.org/projects/pdfscreen/ CHAPTER 11.net/texbooks/ latexcomp-ch8.nz/vel.tex http://www. 2006 are frequently posted at comp. html • Peter Flynn’s beginner’s guide (formatting): http://www. *.ie/~{}dwilkins/ LaTeXPrimer/ • PSTricks--fancy graphics exploiting PDF capabilities http://sarovar.uk/help/tpl/ textprocessing/ 11.org/tex/amslatex.180 • Vel’s introduction to LaTeX: What is it.html • Text Processing using LaTeX http://www-h.org/projects/pstricks/ • PDFScreen--create LaTeX PDF files that have navigation buttons used for presentations: http://sarovar. http://www.org/utilities/plain/cseq.text.ctan. 2007 TeX): http://www.ams.org/projects/ltxprimer/ • LaTeX Primer http://www.loria.pdf • The AMS Short Math Guide for LaTeX.nl/tex. APPENDIX • The Comprehensive LaTeX Symbol List (in PDF) http://www.html in one run. who should use it and how to get started: http://www.org/tex-archive/info/symbols/ comprehensive/symbols-a4.ctan.org/tex-archive/info/beginlatex/ beginlatex-3.html • A resource for free high quality LaTeX templates • Leslie Lamport’s manual for the commands that for a variety of applications are unique to LaTeX (commands not used in plain • LaTeX template for writing PhD thesis.net/misc/latex/index. as described in Installing Extra Packages. 2009 • TeX on Mac OS X: Guide to using TeX and LaTeX on a Mac http://www.ctan.tug.giss. why should you use it. 1 A • Ellipsis • Absolute Beginners • em-dash • Abstract • en-dash • Accents • enumerate • Algorithms • Errors and Warnings • Arrays • Euro currency symbol • Authors • Export To Other Formats . The information here is sorted by application area.5..tex. Here is a list of real world latex sources that are freely available on the internet. books.1 General examples Tutorial examples.tex • small2e. includ• Dashes ing a sample file that also demonstrates Didier Remy’s mathpartir package. simple.5 LaTeX/Index 11.4. LATEX/INDEX 181 11..2 Semantics of Programming Languages • Cross-referencing • Customizing LaTeX Articles on programming language research. A good 11.5.3 C • Captions • A short example of how to use LaTeX for scientific reports by Stephen J. The following are latex sources of • description environment some articles. from syntax to semantics. including source code listings.4.11. • e.tex. The “official” sample documents.11.5. and even some category theory.5.tex. type rules.2 B ments • babel The easiest way to learn how to use latex is to look at how other people use it. This paper • Document Classes by Audrey Tang contains nice examples on configuring the listings package to format source code. see Multi-column Pages 11. • caption. or presentations from this field: • Diactrical marks • Pugs: Bootstrapping Perl 6 with Haskell.4 LaTeX/Sample LaTeX docu. books. wrapped. • Bullets • Bullet points 11. • color package • Color • Columns. proof trees.g. • Basics • beamer package • Bibliography Management • BibTeX • Bold 11. • Collaborative Writing of LaTeX Documents • The not so Short Introduction to LaTeX by Tobias Oetiker is distributed with full latex sources.5. Eglen. • Document Structure • Drawings 11.5. (exempli gratia) 11.5 E This is an alphabetical index of the book. and real world uses of LaTeX.4 D place to start is Mitchell Wand’s Latex Resources. so that it is grouped by the scientific communities that use similar notation and LaTeX constructs.tex and sample2e. 5.10 L • Figures • Labels • Floats • Letters • Fonts • Links • Footer.8 H • Header.6 F 11.5.11 M • makeidx package 11.5.9 I • i.5.12 P • Packages • Creating 1 • Page Layout • PDF output • picture • Pictures • PNG output • Presentations • Pseudocode 11. Page • Lists • Footnotes • Formatting 11. Page • HTML output • Hyperlinks • hyperref package • hyphen • Hyphenation 11. (id est) • Images • Importing Graphics • Indexing • Minipage environment example • Multi-column Pages 11.7 G • \maketitle • General Guidelines • Margin Notes • Graphics • Creating Graphics • Creating • Mathematics • Embedding • Matrices • Importing • graphicx package 11.182 CHAPTER 11.5.5.13 Q • LaTeX/Paragraph Formatting#Quoting_text • Internationalization • Introduction 11.5.14 R • Italics • References • itemize • RTF output .5.5.e. APPENDIX 11. 5. LATEX/COMMAND GLOSSARY 11.5.6 LaTeX/Command Glossary \appendix changes the way sectional units are numbered so that information after the command is considered part of the appendix This is a glossary of LaTeX commands—an alphabetical \arabic causes the current value of a specified counter listing of LaTeX commands with the summaries of their to be printed in Arabic numbers effects.15 S 183 11. math mode \.19 W • Word Counting 11. math mode • Tips and Tricks \( start math environment • Title Creation \) end math environment \[ begin displaymath environment 11. See Document Structure "{}" are required arguments. see Length • XY-pic package \addvspace adds a vertical space of a specified height • xy package \alph causes the current value of a specified counter to be printed in alphabetic characters 11. math and text mode • Superscript and subscript: powers and indices \.1 # • Small Capitals / see slash marks • Source Code Listings \@ following period ends sentence • Space Between Words \\[*][extra-space] new line • Spell-checking \. math mode \! negative thin space. see tabbing \< back tab.2 A 11. tabbing \= set tab.hyphenation.5.11.5.) . math mode • Superscript and subscript: text mode • SVG output 11. thick space. (Brackets "[]" are optional arguments and braces \author declares the author(s).6.17 U \] end displaymath environment • URLs 11.5.16 T • Table of contents • Tables \: medium space.20 X \addcontentsline{file}{sec_unit}{entry} adds an entry to the specified list or table \addtocontents{file}{text} adds text (or formatting commands) directly to the file that generates the specified list or table \addtocounter{counter}{value} increments counter the \address{Return address} • XeTeX \addtolength{len-cmd}{len} increments a length command. see tabbing \+ see tabbing • Teletype text \' accent or tabbing • Text Size \` accent or tabbing • Theorems \| double vertical lines. see tabbing \> tab.6.5.18 V • Verbatim Text 11.6. thin space. \emph{This is in italics \bf Boldface typeface \emph{but this isn't} and this is again}. Requires eurosym package. \circle \cite Used to make citations from the provided bibliog. math mode See also \cline.3 CHAPTER 11. \documentclass[options]{style} Used to begin a latex \href Add a link. two successive lines in a paragraph \emph Toggles italics on/off for the text in curly braces \baselinestretch scales the value of \baselineskip following the command e. See Formatting.6. LaTeX/Colors an ordinary character.´) than is the case for \color Specifies color of the text. APPENDIX B 11.6. See Hyperlinks document \dotfill \hrulefill .4 \euro Prints euro € symbol. See Page Layout.9 H \date \hfill Abbreviation for \hspace{\fill}. \bibitem generates a labeled entry for the bibliography \bigskipamount \bigskip equivalent to \vspace{\bigskipamount} \boldmath bold font in math mode \ensuremath (LaTeX2e) Treats everything inside the curly braces as if it were in a math environment. Such as {\em This is in italics \baselineskip a length command (see Lengths).\footnotemark raphy \footnotesize Sets font size.6.g. which \em but this isn't \em and this is again}.6. See Text Formatting. \cleardoublepage \footnotetext \clearpage Ends the current page and causes any floats \frac inserts a fraction in mathematics mode. See Boxes.6.8 G 11. \closing{yours \framebox Like \makebox but creates a frame around sincerely}). \cline Adds horizontal line in a table that spans only to a range of cells. \fnsymbol \footnote Creates a footnote. See Document Structure. \frenchspacing Instructs LaTex to abstain from insertUsed in the Letter class.5 \dashbox D 11. ture and inserts a signature specified by \signature{}. C \cal Calligraphic style in math mode \caption generate caption for figures and tables \cdots Centered dots \centering Used to center align LaTeX environments 11.g. \frame \closing Inserts a closing phrase (e.6. This comspecifies the minimum space between the bottom of mand allows nesting. leaves space for a handwritten signathe box. 11. 11. See \hline and Tables chapter. \ddots Inserts a diagonal ellipsis (3 diagonal dots) in \hline adds a horizontal line in a tabular environment. is \frac{numerator}{denominator}. In order to untoggle this functionality resort to the command \nonfrenchspacing. or an anchor.184 11. ing more space after a period (´. \copyright makes © sign.6 E \backslash prints a backslash \em Toggles italics on/off for the text inside curly braces with the command. Useful when creating commands in the preamble as they will work inside or out of math environments.6. The usage to be printed.7 F \fbox \flushbottom \chapter Starts a new chapter. Requires epigraph package. \boldsymbol bold font for symbols \epigraph Adds an epigraph. Tables chapter. independent from its content. See Labels and Cross-referencing.13 M it’s the output that is added instead of the commands from the other files. \left \lefteqn \line \linebreak Suggests LaTeX to break line in this place.6. See Page Layout.6.6. See Text Formatting. See \newline Ends current line and starts a new one. \maketitle Causes the title page to be typeset. \includeonly \indent \markboth \markright \input Used to read in LaTex files. See Tables.6. \newlength \LaTeXe Prints current LaTeX version logo. \nocite{*} causes all entries in a bibtex database to be added to the bibliography. For more see \mathcal \mathop \it Italicizes the text which is inside curly braces with the command. See Page Layout. \newsavebox \newtheorem \nocite Adds a reference to the bibliography without an inline citation. See Text Formatting. For more see LaTex/Basics \makebox Defines a box that has a specified width. Such as {\it This is in italics}. \multicolumn 11. See Formatting. L \label Used to create label which can be later referenced with \ref.12 N \newcommand Defines a new command. \linethickness \huge Sets font size. \newenvironment Defines a new environment. See New \newcolumntype Defines a new type of column to be used with tables. See Text Formatting. \newfont \LaTeX Prints LaTeX logo. Formatting. \medskip \item Creates an item in a list. 11. Used in list structures. See Text Formatting. \LARGE Sets font size. LATEX/COMMAND GLOSSARY 185 \hspace Produces horizontal space. Similar to TOC \hyphenation{word list} Overrides default hyphenation \listoftables Inserts a list of the tables in the document. using information provided by commands such as \title{} and \author{}. \em is \mbox Write a text in roman font inside a math part generally preferred since this allows nesting. algorithm for specified words. See Text Formatting.11. \newcounter \Large Sets font size.6. Requires graphicx package. \includegraphics Inserts an image.14 ing printed.6. \listoffigures Inserts a list of the figures in the document. \linewidth \Huge Sets font size.10 \location I \include This command is different from \input in that 11. LaTex/Basics. \large Sets font size. New Environments.11 \multiput K \kill Prevent a line in the tabbing environment from be. \newpage Ends current page and starts a new one. See Page Layout. Commands. See Formatting. See Hyphenation Similar to TOC 11. See \ldots Prints sequence of three dots. .11. See Boxes. LaTeX/Boxes. Can be \rule Creates a line of specified width and height. Options : arabic. See Advanced Mathematics. See place.186 CHAPTER 11.17 R \noindent \nolinebreak \raggedbottom Command used for top justified within other environments. Structure. 11.\small Sets font size. \raggedright Command used for left justified within \normalsize Sets default font size. See Document \sf Sans serif.6. after an ordinary character. 11.18 S 11. See Text Formatting. ture. later insertion by \closing. \nonfrenchspacing Setting the command untoggles the command \frenchspacing and activates LaTeX stan\raggedleft Command used for right justified within dards to insert more space after a period (´. See Page Layout. Lengths. \not \ref Used to reference to number of previously declared \label. \scriptsize Sets font size. See Floats. Requires ulem package. \setlength \pagestyle See Page Layout. See Text Formatting. See Labels and Cross-referencing.6. other environments. specifies a signature for paragraph mode. \providecommand (LaTeX2e) See Macros. \overline Draws a line over the argument. \smallskip \protect \sout Strikes out text. \sc Small caps. \nopagebreak Suggests LaTeX not to break page in this \raisebox Creates a box and raises its content. \setcounter Figures and Captions. Roman. alph. \put \space force ordinary space . for example \opening{Dear Sir} \roman \oval \overbrace Draws a brace over the argument. used in displaystyle with superscript to label formulae. \parindent Normal paragraph indentation. roman. P \pagebreak Suggests LaTeX breaking page in this \sbox The short form of \savebox with no optional arguments. \pageref Used to reference to number of page where \section Starts a new section. See Text Formatting.16 \savebox Makes a box and saves it in a named storage bin. \shortstack \parbox Defines a box whose contents are created in \signature In the Letter class. See \sl Slanted. See Document Structure. See Page Layout.6. \pagenumbering Defines the type of characters used for the page numbers. See Boxes. See LaTeX/Rules and Struts.15 O \renewcommand \onecolumn \right \opening Inserts an opening phrase when using the letter \rm class. \settowidth \par Starts a new paragraph \paragraph Starts a new paragraph. place. a previously declared \label is located.6. See Text Formatting. See Document Struc. \slash See slash marks \parskip \part Starts a new part of a book. Alph. gobble (invisible).´) than other environments. APPENDIX 11. \vline \textsl{} Sets slanted font style. \uwave Creates wavy underline. See Entering col. \textrm{} Sets roman font family. \twocolumn \stepcounter Increase the counter.21 V ored text. \stackrel Takes two arguments and stacks the first on \tt top of the second. \vector \textsc{} Sets font style to small caps. \value \textit{} Sets italic font style. See Text Formatting. See Document Structure. \vcenter \textnormal{} Sets normal font. See Formatting. Document Structure.6. age.\vfill ting. See Text For. See \typeout \typein \subsection Starts a new subsection. See Text Formatting. \vphantom \texttt{} Sets typewriter font family. See Formatting. See Text Format. \today Writes current day. See Text Formatting. Requires ulem pack\TeX Prints TeX logo. See Text Formatting. See Text Formatting. See Text Format. See Text Formatting. 11. \vdots Creates vertical dots.19 See T U \uline Underlines text. See Text Formatting. \subparagraph Starts a new subparagraph.6.\vspace ting.6. Sheldon Green’s .20 \subsubsection Starts a new sub-subsection. \textup{} Sets upright shape of a font. but magnitude can \title be given as an optional parameter). 11. See Text Formatting. matting. \vbox{text} Encloses a paragraph’s text to prevent it \textmd{} Sets medium weight of a font. \textcolor{}{} Creates colored text. ting. See Mathematics. See Formatting.This page uses material from Dr. specifies the sender’s tele\usecounter phone number.6.11. See Text Forfrom running over a page break matting. See Text Format\verb Creates inline verbatim text. Requires ulem package. \textsf{} Sets sans serif font family. \underbrace \underline \tableofcontents Inserts a table of contents (based on section headings) at the point where the command \unitlength appears. \textbf{} Sets bold font style. \textwidth \textheight \thanks \thispagestyle \tiny Sets font size. LATEX/COMMAND GLOSSARY 187 \sqrt Creates a root (default square. Hypertext Help with LaTeX. Document Structure.11. \usebox \telephone In the letter class. org/wiki/LaTeX/Colors?oldid=2734898 Contributors: Alejo2083. Reddraggone9 and Anonymous: 79 • LaTeX/Document Structure Source: http://en. Ambrevar. Chisophugis. RubensMatos. Snaxe920. Waldir. Igjimh. Janskalicky. Guzo. LR. Xonqnopp. Michael M Hackett. Derwaldrandfoerster. SamuelLB.wikibooks. Dilaudid.wikibooks. Bgeron. Tazquebec. Igjimh. Selfworm. Henry Tallboys. Jguk. Reddraggone9. LlamaAl. Ppadmapriya. Sgenier.TOPS and Anonymous: 76 • LaTeX/Text Formatting Source: http://en. Velociostrich. ConditionalZenith. Tully.org/wiki/LaTeX/Installation?oldid=2731500 Contributors: 3mta3. Nobelium. Sanderd17. Marcus Cyron. Zzo38. Tisep. Abramsky.wikibooks. Martinkunev. Alejo2083. White gecko. Xania. Crasshopper. Adrignola. Keplerspeed. QuiteUnusual. Waldir. Thenub314. MartinSpacek. Ambrevar. Jtwdog. Dan Polansky. Zrisher.wikibooks. DragonLord. ABCD.wikibooks. ToematoeAdmn. JackPotte. Waldir. ChrisHodgesUK. Kri.org/wiki/LaTeX/List%20Structures?oldid=2720422 Contributors: Panic2k4. Pater Christophorus. Wdcf. Jacho.wikibooks. Withinfocus. MER-C. Kurlovitsch. Rror. Orderud. Tpr. Mcld. Lucasreddinger. Hjsb.Chapter 12 Text and image sources. Benson Muite. JECompton. ABCD. Qeny. Robbiemorrison. Ambrevar. Urhixidur. Ambrevar. PatrickDevlin21. ChrisHodgesUK. Tomato86. Cdecoro. Flamenco108. Latexing. Fishpi. Xania. Benregn. Vog2 and Anonymous: 27 188 .org/wiki/LaTeX/Paragraph%20Formatting?oldid=2725032 Contributors: Ish ishwar.gas.wikibooks.org/wiki/LaTeX/Basics?oldid=2718207 Contributors: Krischik. QuantumEleven. Benjaminevans82.org/wiki/LaTeX/Document%20Structure?oldid=2738665 Contributors: Derbeth. Crissov. InverseHypercube. Derbeth. Snaxe920. Thenub314. E. Nobelium. Elwikipedista. TinyTimZamboni. Kri. Mouselb. Pi zero. CarsracBot. ChristianGruen. Waldir. Tomato86. Dirk Hünniger. Nkour. ChrisHodgesUK. Gyro Copter. Conrad. Alejo2083. MichaelBillington.lewis1. Guyrobbie. Tualha. Pi zero. Jonathan Webley. Kovianyo. Mabdul. Thenub314.Irwin. RainCity471 and Anonymous: 34 • LaTeX/Installing Extra Packages Source: http://en. Kovianyo. Ollydbg. Piksi. Pi zero.wikibooks. SamuelLB. Tully. Ambrevar. Pdelong. PAC2. Alejo2083. Derbeth. BrettMontgomery. QuiteUnusual. Graemeg. Reddraggone9 and Anonymous: 75 • LaTeX/Installation Source: http://en. Ffangs. Vadik wiki. Brammers. contributors. Ambrevar. Nixphoeni. Mwtoews. CrazyTerabyte. Orderud. Zylorian. Mfwitten. Whiteknight. Conighion. Scientific29.1 Text • LaTeX/Introduction Source: http://en. DarkSheep and Anonymous: 20 • LaTeX/Basics Source: http://en. Jraregris. Jtwdog. Wickedjargon. Neoriddle. Tomato86.org/wiki/LaTeX/Text%20Formatting?oldid=2738826 Contributors: Derbeth. Iamunknown. Arthurchy. Spelemann. Derbeth. Mckay. PAC2. Andyr. Anarchyboy. Spag85. Pi zero. C3l. Ntypanski.wikibooks. Henrybissonnette. Goodgerster. Igjimh. Jonathan Webley. Withinfocus. Ambrevar.org/wiki/LaTeX/Introduction?oldid=2705028 Contributors: Ævar Arnfjörð Bjarmason. Immae. Sjlegg. Alejo2083. Waldir. Ambrevar. Kri. Pi zero. EvanKroske. ChrisHodgesUK. Avila. Neet. Halilsen. Gms. Dirk Hünniger. Bilbo1507. GPHemsley. Fishix. Smobbl Bobbl. Hannes Röst. Genethecist. Kurlovitsch. Jason barrington. FlashSheridan. Stephan Schneider. Ambrevar. Arunib. SamuelLB. Chuckhoffmann. Echeban. Kw CUACS. Withinfocus. Tpapastylianou. Derbeth. Honza889 and Anonymous: 49 • LaTeX/Fonts Source: http://en. Trace. Lindhea and Anonymous: 15 • LaTeX/Paragraph Formatting Source: http://en. InverseHypercube. Xania. SamuelLB. Withinfocus. Pi zero. ConditionalZenith.org/wiki/LaTeX/Fonts?oldid=2715993 Contributors: Ish ishwar. OlivierMehani. AllenZh. Nbrouard. Adrianwn. Pi zero. Robbiemorrison. 3mta3. Joaospam. Adrignola. Dirk Hünniger. Adrignola. Patuck. Pi zero. Keplerspeed. Mwtoews. Withinfocus. Constantine. Neet. Rehoot. Henrybissonnette. Wikieditoroftoday. Yez. Dlituiev. Chazz. Lotus noir. Igjimh. TomyDuby. Orderud. Igjimh. Kernigh. Dreaven3. RealSebix. PAC2. Dan Polansky. Xania. Tomato86. BiT.wikibooks. ATC2. Waldir. Scorwin. Lanoxx. ChrisHodgesUK. Vadik wiki. Polytropos Technikos. Daniel Mietchen. Hosszuka. Harrikoo. Incognito668. Akim Demaille. CD-Stevens. Ben9243 and Anonymous: 26 • LaTeX/List Structures Source: http://en. PAC2. and licenses 12. Jomegat. Tomato86. Gmh04. Kejia. LlamaAl. Recent Runes. Kri. Steelangel. 3mta3. QuiteUnusual. Gronau. Nux. Kazkaskazkasako. Hahc21. Astrophizz. Adrignola. Pstar. Robbiemorrison. Stefantauner. TorfusPolymorphus. Xania. Jan Winnicki. Netheril96. Listdata. Kazkaskazkasako. Atallcostsky. Tomato86.org/wiki/LaTeX/Installing%20Extra%20Packages?oldid=2644917 Contributors: Alejo2083. Mwtoews. TortoiseWrath. Gmacar and Anonymous: 139 • LaTeX/Colors Source: http://en. Cerniagigante. Dirk Hünniger. InverseHypercube. Koavf. Dilaudid. Ambrevar. Qzxpqbp. Recent Runes. Thenub314. Adrignola. Xania. Mihai Capotă. Lovibond. Rehoot. Mwtoews.lewis1. BYIST. Dirk Hünniger. Staticshakedown. Frap. Tom Morris. Jtwdog. Pi zero. Wickedjargon. E. Ambrevar. Clebell. Ediahist. Belteshazzar. Piksi. Jomegat. TomyDuby. Yotann and Anonymous: 191 . RealSebix.gas.wikibooks. Benjaminevans82. Waldir. Spag85. Shahbaz Youssefi. Roarbakk. ChrisHodgesUK. Svick. MartinSpacek. Mijikenda.org/wiki/LaTeX/Floats%2C%20Figures%20and%20Captions?oldid= 2694618 Contributors: Derbeth. Jstein. Orderud. Sandrobt. PsyberS. Pi zero. Drevicko. Alejo2083. Waldir. RTPK and Anonymous: 55 • LaTeX/Rotations Source: http://en. Vaffelkake. HenrikMidtiby. TWiStErRob. Withinfocus. Winfree. Ambrevar. Petter Strandmark. Derbeth. Icc97.marcik. Anubhab91. TEXT 189 • LaTeX/Special Characters Source: http://en. Rafopar. Kri. Ambrevar. Briancricks. SamuelLB. ZimbiX. AndreKR and Anonymous: 168 • LaTeX/Title Creation Source: http://en. Robert Borkowski. Hansfn. Bajrangkhichi96. Bsander. Juliabackhausen. Pi zero. Hankwang. Maratonda. Derbeth.Irwin. Skou.1. Olivier. Jer789.org/wiki/LaTeX/Tables?oldid=2731270 Contributors: Marozols. Greenbreen. MartinSpacek. Mandriver. SamuelLB. Wxm29. Adrignola. Derbeth. Jafeluv. Bro4. Adrignola. Swift.wikibooks. Pirround. Infenwe.gas. Tisep. ConditionalZenith. Xonqnopp. Kwetal. Adrignola. Bumbulski. Pi zero. Dilaudid. Kri. Ambrevar. Kevinfiesta. Xonqnopp. Dirk Hünniger. SamuelLB. Tia sáng mặt trời. Ambrevar and Anonymous: 1 • LaTeX/Mathematics Source: http://en. Spirosdenaxas. Alejo2083. Unco. Waldir. Karper.schneider. Maschen. BlackMagic1943 and Anonymous: 52 • LaTeX/Labels and Cross-referencing Source: http://en. Hokiehead. Wp4bl0. Dirk Hünniger.org/wiki/LaTeX/Hyperlinks?oldid=2701628 Contributors: Derbeth. Topodelapradera. Adam majewski. Volvens. Withinfocus. Pi zero. Waldir. Karthicknainar. Germanzs. Martin scharrer. Olaf3142. Dilaudid. Igjimh. Pi zero. Grenouille. Krishnavedala. Neet. SamuelLB. Strpeter.12. QuiteUnusual. Jtwdog. Harp. Prawojazdy. Danielstrong52.org/wiki/LaTeX/Internationalization?oldid=2701422 Contributors: Derbeth. GorillaWarfare. Fmccown. David. ColeLoki. SamuelLB. Lobaluna. JECompton. Zxx117.. Gallen01. Krst. ChrisHodgesUK. Tomato86. Mimo. Nigels. Snoopy67. K. Withinfocus. Tully.org/wiki/LaTeX/Page%20Layout?oldid=2724043 Contributors: Panic2k4. AthanasiusOfAlex. PAC2. ILubeMyCucumbers20. TomyDuby. Lindhe94 and Anonymous: 87 • LaTeX/Importing Graphics Source: http://en. Adouglass. Marra. Ricordisamoa. Ediahist. Chuaprap. Erp and Anonymous: 4 • LaTeX/Tables Source: http://en. Pi zero. Orderud. Ambrevar. Mwtoews. Waldir. Martin von Wittich. Urhixidur. Mwtoews. Ans. Louisix.org/wiki/LaTeX/Lengths?oldid=2657574 Contributors: Panic2k4. Adrignola. Harrywt. Orderud. Komputerwiz. Jodi. Orderud. Willy james. Karcih. Whym. Helptry. Kwpolska. Withinfocus.org/wiki/LaTeX/Rules%20and%20Struts?oldid=2496247 Contributors: Ollydbg. Kovianyo. Adrignola. ChrisHodgesUK. Tomato86. AlanBarrett and Anonymous: 19 • LaTeX/Lengths Source: http://en. Bigwyrm. Spook. Dncarley.wikibooks. Alejo2083. InverseHypercube. Neoriddle. Cengique. Dirk Hünniger. Jluttine. Waldir. Kejia.longo and Anonymous: 104 • LaTeX/Floats. Tosha. Sargas.wikibooks. Fredmaranhao. Anarchyboy. Drewbie. Eudoxos.Nevelsteen. Scientific29. Xonqnopp. Mecanismo. QuiteUnusual. Pi zero. RealSebix.wikibooks. ChrisHodgesUK. Wikieditoroftoday. Wysinwygaa. Chbarts. Joe Schmedley. Mcld. Rajkiran g. Ambrevar. Comput2h.org/wiki/LaTeX/Title%20Creation?oldid=2701285 Contributors: Derbeth. Sandbergja. Ysnikraz. Ojan. Sargas. Hello71. ChrisHodgesUK.wikibooks. Zwiebelleder.org/wiki/LaTeX/Importing%20Graphics?oldid=2725333 Contributors: ZeroOne. Pamputt. Kri. Zyqqh. Dan Polansky. SteveM82. Adrignola. Ambrevar. Thenub314. Ambrevar. Igjimh. Alzahrawi. Bianbum. HenrikMidtiby. Caesura. Cameronc. Pi zero. Qwertyus. Erylaos. Waldir. Wn202. Mwtoews. Mcld. Alejo2083. Alejo2083. Wkdurfee. Jtwdog. Neet. Hroobjartr. Selfworm. Chaojoker. Robbiemorrison. Ambrevar. Orderud. Anthony Deschamps. Bonuama. Alejo2083. Linzhongpeng and Anonymous: 112 • LaTeX/Hyperlinks Source: http://en. Mcld. Neoriddle. Keplerspeed. Mwtoews. Gelbukh. Ysnikraz.wikibooks. Rogerbrent. 3mta3. SamuelLB.org/wiki/LaTeX/Mathematics?oldid=2736437 Contributors: Insaneinside. Yanuzz.a. Crasic. Withinfocus. Adrignola. Pi zero. Dubbaluga. Mwtoews. Sabalka. Elliptic1.wikibooks. LaTeX. NavarroJ. Chazz. Tomato86. Drewbie. Vesal. Jtwdog. Xonqnopp. Je ne détiens pas la vérité universelle. Withinfocus. Collinpark. Matthias M. Jomegat. Atiq ur Rehman. Igjimh. Neet. Deltasun. Xania. Rotlink. Crissov. Arided. Wdcf. Igjimh. Colonel486 and Anonymous: 31 • LaTeX/Page Layout Source: http://en. Xania.hollman. Götz. Սահակ. Jonathan Webley. Franklin Yu. Squigish. Chafe66. Mhue. Ntypanski. Robin. Robbiemorrison. Gryllida. Joeyboi. Xnn.wikibooks. Sargas. Karper. Jtwdog.s. Figures and Captions Source: http://en. Daveturnr. Bcmpinc. Dilaudid. Emreg00. Kri. Hosszuka. Wikieditoroftoday. LR. Thenub314. Yeshua Saves and Anonymous: 40 • LaTeX/Internationalization Source: http://en. SamuelLB. Jtwdog. Drevicko. Alejo2083. Escalator and Anonymous: 52 • LaTeX/Errors and Warnings Source: http://en. Ish ishwar. Courcelles. Ysangkok. Lnkbuildingservices4u. Jonathan Webley. Adrignola. Rdg nz. DavidMcKenzie.wikibooks. Thenub314. Jflycn. Dirk Hünniger. Anthony Deschamps. Recent Runes. DmitriyZotikov. InverseHypercube. Mikhail Ryazanov. Jotomicron. Ambrevar. Mateo. Robbiemorrison. Gelbukh. Robbiemorrison. YuryKirienko. Kri. Ambrevar. SamuelLB. Tweenk. Computermacgyver. Scruss. JenVan. Alejo2083. Igjimh. Ftravers. Mcld. QuiteUnusual. Ollydbg. KlausFoehl. Ambrevar. Wmheric. Dilaudid. Jluttine. Merciadriluca. Mathieu Perrin. Hahc21. Tgwizard. Waldir.wikibooks. Tomato86. Adrignola.descout. Cfailde. Spag85. Gms. Modest Genius. Skarakoleva. Abalenkm. Insaneinside. Robin. Hosszuka.wikibooks. Pi zero. ChrisHodgesUK. Abonnema. Nothing1212. Saippuakauppias. Tom. Dan Polansky. Robbiemorrison. Borgg. Ypey. Jomegat. SamuelLB. DavidMcKenzie. Rogal. PeterAllen. Conrad. SamuelLB. Teles. Mwtoews. Robbiemorrison. Klusinyan. Recent Runes. SciYann. Infenwe. Thietkeweb. Froskoy. ChrisHodgesUK. Recent Runes. Zvika. Geminatea. Tork73.org/wiki/LaTeX/Counters?oldid=2562102 Contributors: Ambrevar and Anonymous: 2 • LaTeX/Boxes Source: http://en. 3mta3. Dendik. Jwchong. Alejo2083. Netheril96. Igjimh. Hdankowski. Bytecrook. Ms2ger. He7d3r. Sargas. Kovianyo.wikibooks. Neet. Derbeth. Dirk Hünniger. Kundor.org/wiki/LaTeX/Special%20Characters?oldid=2703314 Contributors: Mwtoews. Nemoniac. Bro4. Juliusross. QuiteUnusual. Herbythyme. SamuelLB. Syockit. ChrisHodgesUK. RealSebix.wikibooks. Kubieziel. Konteki. Waylesange. Jonathan Webley. MQ978. Canageek. Steindani. Piksi. Tomato86. Niy. Pi zero. LQST. Qwertyus. Alejo2083. Jomegat. BiT. Harrikoo. Calimo.org/wiki/LaTeX/Errors%20and%20Warnings?oldid=2739496 Contributors: Darklama. Hippasus. Janltx. Tomxlawson. Mwtoews. Mwtoews. Wdcf. Jevon. Alejo2083. Avila. SiriusB. QUBot. Basenga. Gibravo. Basenga. Strpeter and Anonymous: 15 • LaTeX/Counters Source: http://en. Pi zero. Adrignola. McSaks.org/wiki/LaTeX/Labels%20and%20Cross-referencing?oldid= 2673141 Contributors: Derbeth. Unlikelyuser. Hagindaz. Dporter. Whym. Ghoti. Louabill. Withinfocus. BiT. Gwpl. Quaristice. Derbeth. Tomato86. Jlrn. DavidMcKenzie. Avila. NavarroJ. MarSraM. Recent Runes.wikibooks. Asmeurer. Kri. Jomegat. Hulten. Justin W Smith.wikibooks. Prispartlow. Cícero. Goldenburg111 and Anonymous: 8 • LaTeX/Rules and Struts Source: http://en. Mwtoews. Otec Stochastik. Ambrevar. Rhalah. Joe Schmedley. Lucasreddinger. Halilsen. Ffangs. Silverpie.org/wiki/LaTeX/Rotations?oldid=2473793 Contributors: Alejo2083. Pi zero. Bibi6. Adrignola. LivingShadow. Jomegat. Fsart. Blacktrumpeter. Tuka. Mecanismo. Byassine52. JV.org/wiki/LaTeX/Boxes?oldid=2739393 Contributors: Selfworm. Hapli. Waldir. Ambrevar. Robbiemorrison. RealSebix. Neoptolemus. Derbeth. Kri. Sanderd17. Matěj Grabovský. Dirk Hünniger. Nobelium and Ambrevar . Sargas. Helptry. Jevon. MichaelBueker.org/wiki/LaTeX/Presentations?oldid=2716327 Contributors: Ish ishwar.wikibooks. Obelyaev. Jayk. TEXT AND IMAGE SOURCES. Debejyo. Kazkaskazkasako. Wikieditoroftoday. Ambrevar. Dirk Hünniger.wikibooks. Dan Polansky. Kurlovitsch. Empirical bayesian. Jacobrothstein. Jonathan Webley. Hankjones. MagnusPI. امیر اعوانی. Bunyk. Jtwdog. Derbeth.wikibooks. Flal. Sonic the goliath. Arthurchy.org/wiki/LaTeX/Bibliography%20Management?oldid=2725103 Contributors: ZeroOne. ChrisHodgesUK. AND LICENSES • LaTeX/Advanced Mathematics Source: http://en. TorfusPolymorphus. PAC2. Kenyon. Hapli and Anonymous: 47 • LaTeX/Teacher’s Corner Source: http://en.wikibooks. Пика Пика. Tomato86. Tlinnet. Pi zero. Pi zero.gas. MartinSpacek.valve. Vaucouleur. Waldir. Jluttine. Ramac. He7d3r.org/wiki/LaTeX/Picture?oldid=2676410 Contributors: Svick. Derbeth. Ambrevar. Uluboz. Flip. SamuelLB and Anonymous: 23 • LaTeX/MetaPost Source: http://en. Ambrevar and Dirk Hünniger • LaTeX/Creating 3D graphics Source: http://en. Espinozahg. SamuelLB. Nemti. Reyk. Mwtoews. Lbailey45. CarsracBot.org/wiki/LaTeX/PSTricks?oldid=2718385 Contributors: ChrisHodgesUK. Drewbie. QuiteUnusual.wikibooks. Tanzaho. Dan Polansky. Saehrimnir. Arthurvogel. Krisrose. Sandman10000. Derbeth. Webinn. Adrignola. Unbitwise.wikibooks. Pi zero.org/wiki/LaTeX/Advanced%20Mathematics?oldid=2705147 Contributors: Sbeyer.190 CHAPTER 12. Codairem. Kri.org/wiki/LaTeX/MetaPost?oldid=2473798 Contributors: Ambrevar • LaTeX/Picture Source: http://en. RealSebix. TorfusPolymorphus. Mcld. Norbert. Ynhockey. Masterpiga and Anonymous: 12 • LaTeX/Indexing Source: http://en. Fishpi. Pmlineditor. RealSebix.lewis1. Kri. Adrignola.wikibooks. QuiteUnusual. Xonqnopp. Nsda. Grj23. Dr0pi. CallumPoole and Anonymous: 9 • LaTeX/Introducing Procedural Graphics Source: http://en. Keplerspeed. Wenzeslaus. Stuples. Alejo2083. GavinMcGimpsey. Bro4. QUBot. Orderud.wikibooks. Nobelium. Pi zero. PAC. Jianhui67. Avila. Jonathan Webley. Igjimh. Topodelapradera. Mariafenrinha. Alejo2083. Vermiculus. Dirk Hünniger. FredrikMeyer.org/wiki/LaTeX/Algorithms?oldid=2721133 Contributors: ZeroOne. Sargas. PhilJohnG.wikibooks. WardMuylaert. Kri. Pi zero.wikibooks. MichaelSchoenitzer. Gkc. Mwtoews. Robbiemorrison. Alejo2083. PaulVanDerWalt.org/wiki/LaTeX/Theorems?oldid=2612071 Contributors: 3mta3. CONTRIBUTORS. Ch605852. Sargas.org/wiki/LaTeX/Creating%203D%20graphics?oldid=2466226 Contributors: Kri. Pandora85. Gladiool. Ambrevar. Qwertyus. SamuelLB. Joe Schmedley. ChrisHodgesUK. Bombcar and Anonymous: 14 • LaTeX/Glossary Source: http://en. Rondenaranja. QuiteUnusual. Silca678. Mwtoews. LinuxChristian. Neoriddle. Jimbotyson.wikibooks. SamuelLB. Thefrankinator. Dan Polansky. Juliabackhausen. Jomegat. Mecanismo. Spag85. Crissov. Adrignola. Jdgilbey. Dan Polansky. Tosha. Dan Polansky. Robbiemorrison. SamuelLB.wikibooks. Nsuwan. Derbeth. Ojan. Kovianyo. Nbrouard. Franzl aus tirol.wikibooks. Amamory. Ambrevar. He7d3r. 3mta3. Karlberry and Anonymous: 1 • LaTeX/Xy-pic Source: http://en. Evin. Goldkatze. Simonjtyler. Leyo. Brevity.org/wiki/LaTeX/Teacher's%20Corner?oldid=2465002 Contributors: PAC. SamuelLB. Jpoosterhuis and Anonymous: 152 • LaTeX/More Bibliographies Source: http://en. QuiteUnusual. ChrisHodgesUK. Matej. Tully. Niel. Avila. Braindrain0000. Ambrevar. Escalator.wikibooks. Eyliu. SamuelLB and Anonymous: 9 • LaTeX/Curriculum Vitae Source: http://en. Nixphoeni. Tomato86. Wickedjargon. Neoptolemus. Tonda. Lavaka. Ambrevar. ChrisHodgesUK.org/wiki/LaTeX/Curriculum%20Vitae?oldid=2696006 Contributors: Jomegat. Ambrevar.org/wiki/LaTeX/More%20Bibliographies?oldid=2715264 Contributors: Adrignola. Dreaven3. Kovianyo. Pmillerrhodes. StevenJohnston. Maartenweyn. Szellmann. Rbonvall. Kcho. Ambrevar.org/wiki/LaTeX/Linguistics?oldid=2721422 Contributors: Neatnate. SamuelLB. MoMaT. Xania. Alejo2083. Pi zero. Tomato86. Geetha nitc. Neet. Xania. Robbiemorrison. Thenub314. Tentotwo and Anonymous: 7 • LaTeX/PGF/TikZ Source: http://en. Karategeek6. Lucasreddinger. BiT. Volvens. Mwtoews. Hendiadyon. Tau Lambda. Billy the Goat II. Berettag. Morelight. Raylu.wikibooks.org/wiki/LaTeX/Glossary?oldid=2721390 Contributors: Panic2k4. Wootery and Anonymous: 14 • LaTeX/Letters Source: http://en. Kri. Edudobay. Tomato86. Kovianyo. Kroolik. 3mta3. Rafaelgr. Mezzaluna. Drevicko. Dirk Hünniger. JenVan.org/wiki/LaTeX/Xy-pic?oldid=2533083 Contributors: ChrisHodgesUK. Harish victory and Anonymous: 84 • LaTeX/Source Code Listings Source: http://en. Rnddim. SamuelLB. Kovianyo. Petter Strandmark. Wxm29.org/wiki/LaTeX/Indexing?oldid=2725281 Contributors: Itai. Tauriel-1. Dirk Hünniger. Ffavela. E. Helptry. Whym. PatrickGalyon. Stephan Schneider. Gmacar. Tomato86. Ambrevar.org/wiki/LaTeX/PGF/TikZ?oldid=2688485 Contributors: JonnyJD.org/wiki/LaTeX/Chemical%20Graphics?oldid=2695051 Contributors: CommonsDelinker. Ambrevar. QuiteUnusual. Oderbolz. Ajmath62. Control. Tosha. Sanderd17. Redirect fixer.org/wiki/LaTeX/Source%20Code%20Listings?oldid=2736940 Contributors: Panic2k4. Tomato86. Yeshua Saves. Rossdub. Adrignola. Mhue. Ambrevar. Bro4.org/wiki/LaTeX/Introducing%20Procedural%20Graphics? oldid=2711314 Contributors: 3mta3. Dlituiev and Anonymous: 7 • LaTeX/PSTricks Source: http://en. Speravir.wikibooks. ChrisHodgesUK. Pi zero. Jessevanassen. Sargas. Glad. Spelemann. Simeon. Mhue. Netheril96. QuiteUnusual. PAC2. Thefrankinator. Gillespie09. Atulya1988. Jomegat.wikibooks. Qwertyus. TheAnarcat and Anonymous: 25 • LaTeX/Presentations Source: http://en.Bowerman.gas. SamuelLB. Xonqnopp. Tdomhan. Goldenburg111 and Anonymous: 44 • LaTeX/Theorems Source: http://en. Olesh. Mwtoews. SamuelLB. Withinfocus. Jflycn. Bhanuvrat. Thenub314. Wxm29. Ambrevar. Robbiemorrison. Alejo2083. Tomato86. Xania. Ambrevar. Jimmaykeepsitreal. Krst. Ambrevar.wikibooks. Ambrevar. Semperos. Garoth. Eyliu. Rajkiran g. NqpZ. Silca678. Tomato86.wikibooks. Stephan Schneider. DmitriyZotikov. Hosszuka. Gmacar. Topodelapradera. Ambrevar. Recent Runes. CtrlAltCarrot and Anonymous: 24 • LaTeX/Chemical Graphics Source: http://en. Daviewales and Anonymous: 4 • LaTeX/Algorithms Source: http://en. Paul2520.beckers. Arbitrarily0. John1923. Austinmohr.korvas. Dirk Hünniger. RasmusWriedtLarsen and Anonymous: 45 • LaTeX/Linguistics Source: http://en.wikibooks. Donok11 and Anonymous: 30 • LaTeX/Bibliography Management Source: http://en. Alejo2083. Mwtoews. Tomato86.wikibooks. Pi zero. Kevang. Franzl aus tirol. ChrisHodgesUK. Ghoti. Literaturgenerator. Pi zero. Blaisorblade. Inductiveload. Mrt doulaty. Banwol. Gms. Writalnaie.org/wiki/LaTeX/Letters?oldid=2668381 Contributors: Derbeth. Jld. wikibooks. Glosser. Ambrevar and Anonymous: 1 • LaTeX/Links Source: http://en. Robbiemorrison. Tully. Robbiemorrison. SamuelLB and Anonymous: 43 • LaTeX/Authors Source: http://en.wikimedia. Tuetschek. Spelemann.org/wiki/LaTeX/Themes?oldid=2504675 Contributors: Ambrevar and Anonymous: 1 • LaTeX/Modular Documents Source: http://en. Bpsullivan.wikibooks. CD-Stevens.. Mike. ChrisHodgesUK. Vesal.org/wiki/LaTeX/Macros?oldid=2739673 Contributors: Risk. TomyDuby. Aadornellesf. Nixphoeni. RaymondSutanto.org/wikipedia/commons/6/62/50_percents.org/wiki/LaTeX/Links?oldid=2695762 Contributors: Derbeth. Pi zero. Adrignola. Russell208. Pi zero.10-screenshot. TomyDuby. Neoriddle.wikimedia. Alejo2083. Pi zero. Mwtoews. Towsonu2003.png License: CC-BY-SA-3. Jonathan Webley. ChrisHodgesUK. Naught101.png Source: http://upload. Robbiemorrison. Pi zero.wikimedia. Orderud. Alejo2083.3.wikibooks.org/wiki/LaTeX/Authors?oldid=2472489 Contributors: Derbeth. Ambrevar. Sargas. Dan Polansky.org/wiki/LaTeX/Modular%20Documents?oldid=2628074 Contributors: Derbeth. Igjimh.wikibooks. Tomato86. SamuelLB. Avila. Keplerspeed.org/wikibooks/en/1/11/Ammonium_sulphate_mhchem. Jmcdon10. Withinfocus.org/wiki/LaTeX/Index?oldid=2500652 Contributors: Derbeth. Pi zero. IMAGES 191 • LaTeX/Macros Source: http://en. Jonathan Webley.wikimedia.org/wikipedia/commons/6/63/BibDesk1.10-screenshot. Royote. Eselmeister and Anonymous: 7 • LaTeX/Package Reference Source: http://en. Ramac. Ambrevar. Dan Polansky.wikibooks. Pi zero. Robbiemorrison. Dmb. Mwtoews. Kri. Tosha. Yeshua Saves and Anonymous: 35 • LaTeX/Plain TeX Source: http://en.png Source: http://upload. Bamgooly. Ambrevar.png License: Cc-by-3.0 Contributors: Own work Original artist: darklama .wikimedia. IrfanAli.wikibooks.png Source: http://upload. Hsmyers.jpg License: Public domain Contributors: My computer Original artist: Myself • File:Blocks_beamer_example. QuiteUnusual. Derbeth. Wickedjargon and Dredmorbius • LaTeX/Sample LaTeX documents Source: http://en. Ediahist. Hosszuka. ChrisHodgesUK.png License: Public domain Contributors: own work Original artist: Mij • File:BibDesk1.svg Source: http://upload.gas. Stefan. Ambrevar and Anonymous: 2 • LaTeX/Index Source: http://en. Stefan.svg License: CC-BY-SA-3.org/wiki/LaTeX/Tips%20and%20Tricks?oldid=2678029 Contributors: Derbeth. Jbsnyder and Anonymous: 36 • LaTeX/Export To Other Formats Source: http://en.0 Contributors: Own work Original artist: Pmillerrhodes • File:Acetate-ion2. Bakken..0 Contributors: Own work Original artist: Israel Buitron • File:Book_important2.wikimedia.3.org/wiki/LaTeX/Export%20To%20Other%20Formats?oldid=2697848 Contributors: Derbeth. Ghostofkendo. Hermine potter. Pstar. Neet.png Source: http://upload. Alejo2083.org/wikipedia/commons/2/20/Blocks_beamer_example. Funkenstern. ChrisHodgesUK. Withinfocus. Dirk Hünniger and Anonymous: 1 • LaTeX/Command Glossary Source: http://en. Adrignola. Jomegat. Go.png License: CC-BY-SA-3. Kayau. Jason barrington. Dmb. Tim Parenti. Zyqqh. Alejo2083. Xin-Xin W. ChrisHodgesUK. Ambrevar. Migueldvb.org/wiki/LaTeX/Package%20Reference?oldid=2620329 Contributors: Dan Polansky. Dirk Hünniger. Rotlink. Xeracles and Anonymous: 29 12.wikibooks.png Source: http://upload. Frakturfreund. Adrignola. Vaffelkake.org/wikibooks/en/c/ce/BibDesk-1.lifeguard. Wikieditoroftoday. Schaber. Mecanismo. Ffangs. Mwtoews. Alejo2083.svg Original artist: Ftiercel • File:Acetate-ion.svg Source: http://upload. Stoettner. Wikieditoroftoday. MaBoehm. Liiiii.wikibooks.wikibooks.wikimedia.12. Pi zero. Mwtoews. Basenga.pbam. Kpym.org/wiki/LaTeX/Sample%20LaTeX%20documents?oldid=2465029 Contributors: Thenub314. SamuelLB.org/wiki/LaTeX/Plain%20TeX?oldid=2716106 Contributors: Blaisorblade.0 Contributors: ? Original artist: ? • File:BibDesk-1. Ambrevar. LR.org/wikipedia/commons/b/b3/Acetate-ion2.2 Images • File:50_percents.org/wikipedia/commons/5/5c/Alltt. Dirk Hünniger. Wgjbeek and Anonymous: 19 • LaTeX/Collaborative Writing of LaTeX Documents Source: http://en.wikibooks.0 Contributors: Own work Original artist: Pmillerrhodes • File:Alltt.svg License: CC0 Contributors: File: 50%.org/wiki/LaTeX/Creating%20Packages?oldid=2718658 Contributors: Ambrevar and Anonymous: 4 • LaTeX/Themes Source: http://en. Pi zero. Jasu. Yeshua Saves and Anonymous: 7 • LaTeX/Creating Packages Source: http://en.wikibooks. Bumbulski. Dredmorbius. Winniehell. AsphyxiateDrake.wikibooks.svg Source: http://upload. Pi zero. Keplerspeed. Pi zero.png License: CC-BY-SA-3. SamuelLB.8.wikibooks.wikimedia.2. Sobjornstad and Anonymous: 11 • LaTeX/Tips and Tricks Source: http://en.qn.org/wiki/LaTeX/Collaborative%20Writing%20of% 20LaTeX%20Documents?oldid=2602612 Contributors: Derbeth.org/wikipedia/commons/9/91/Book_important2. Filip Dominec. Alejo2083.wikibooks. Ambrevar. Waldir. Vinaisundaram.org/wiki/LaTeX/FAQ?oldid=2721122 Contributors: Xania.0 Contributors: Own work Original artist: Dirk Hünniger • File:Ammonium_sulphate_mhchem.svg License: CC-BY-SA3. Dirk Hünniger.jpg Source: http://upload.ca. Arnehe. Jamoroch. Wenzeslaus. Paxinum. Ambrevar. Ambrevar.wikimedia. Madskaddie.wikibooks. Ambrevar.qn and Anonymous: 20 • LaTeX/FAQ Source: http://en. Ambrevar. ChrisHodgesUK.org/wiki/LaTeX/Command%20Glossary?oldid=2605149 Contributors: Robert Horning. Jguk. Limpato. Orderud. Withinfocus. Robbiemorrison. Waldir. SamuelLB.org/wikipedia/commons/2/23/Acetate-ion. Kpym. Brendanarnold.3.3.8. wikimedia.png License: CC-BY-SA-3.0 Contributors: Transferred from en.wikimedia. transferred to Commons by User:Adrignola using CommonsHelper.png Source: http://upload.wikimedia.png License: CC-BY-SA-3.wikimedia.org/wikipedia/commons/1/18/H2O_Lewis_Structure_PNG.0 Contributors: Own work Original artist: Olesh • File:Chemfig_angles.wikibooks.png Source: http://upload.wikimedia.wikimedia.wikimedia.6.png License: CC-BY-SA-3.org/wikipedia/commons/6/67/Gb4e3.svg License: GPL Contributors: Self-made.org/wikipedia/commons/1/1a/Gb4e4.wikimedia.org/wikipedia/commons/1/16/Cat-eats-cream.wikibooks.org/wikipedia/commons/0/0c/Gb4e2.png License: Public domain Contributors: Transferred from en.0 Contributors: Own work Original artist: Hankjones • File:Gb4e3.png Source: http://upload.png License: CC-BY-SA-3.0 Contributors: Own work Original artist: Pmillerrhodes • File:Chick1.wikimedia. transferred to Commons by User:Sanderd17 using CommonsHelper.png Source: http://upload.jpg Source: http://upload.org/wikipedia/commons/2/2b/Enum.png Source: http://upload.wikimedia.png License: ? Contributors: ? Original artist: ? • File:Desc.wikimedia.svg License: CC-BY-SA-3.png Source: http://upload.png Source: http://upload.png Source: http://upload.org/wikipedia/commons/5/5c/Chick2.wikimedia.svg Source: http://upload.wikimedia. transferred to Commons by User:Sanderd17 using CommonsHelper.org/wikipedia/commons/e/eb/Butane-skeletal.wikimedia.wikipedia.org/wikipedia/commons/3/32/Chick4.png Source: http://upload. which was released into the public domain by its creator AzaToth.org/wikipedia/commons/c/cc/Bordermatrix.org/wikipedia/commons/0/0f/Chemfig_bonds.wikipedia • File:Dashes. transferred to Commons by User:FSII using CommonsHelper on Labs.wikibooks.png Source: http://upload.wikimedia.6.0 Contributors: Own work Original artist: Hankjones • File:Gb4e4.wikimedia. png License: CC-BY-SA-3.wikimedia.svg License: CC-BY-SA-3.png License: CC-BY-SA-3.0 Contributors: Transferred from en. Original artist: Original uploader was Arnehe at en. Original uploader was Sanderd17 at en.org/wikipedia/commons/6/67/Gb4e1.org/wikipedia/commons/5/54/Chick1. Original artist: Original uploader was Jtwdog at en. AND LICENSES • File:Bordermatrix.wikibooks • File:Clipboard.org/wikipedia/commons/f/f0/Chick3.0 Contributors: Own work Original artist: Daviewales .wikimedia.png Source: http://upload.png License: CC-BY-SA-3.0 Contributors: Transferred from en.png Source: http://upload.wikibooks • File:Chick2.org/wikipedia/commons/5/55/Example_of_ German_quotation_marks.png Source: http://upload.png Source: http://upload.jpg License: Public domain Contributors: ? Original artist: ? • File:Example_of_French_quotation_marks.png Source: http://upload.wikipedia.0 Contributors: Own work Original artist: Karl Scheel • File:Frametitle_keyword_example. png License: CC-BY-SA-4.png License: CC-BY-SA-3. CONTRIBUTORS.org/wikibooks/en/a/a8/Emph.png License: CC-BY-SA-3. transferred to Commons by User:Sanderd17 using CommonsHelper.192 CHAPTER 12.org/wikipedia/commons/1/15/ESvn-texmf.0 Contributors: Own work Original artist: Israel Buitron • File:Gb4e1.wikimedia.png License: Public domain Contributors: self-made in ChemDraw Original artist: Ben Mills • File:Carbon_Lewis_Structure_PNG.png Source: http://upload. transferred to Commons by User:Sfan00_IMG using CommonsHelper.wikimedia.0 Contributors: Own work Original artist: Pmillerrhodes • File:Chemfig_bonds. Original artist: Original uploader was Iorsh at en.wikibooks • File:Emph.png License: CC-BY-SA-3.png License: CC-BY-SA-3.org/wikipedia/commons/7/7c/Corticosterone_%281%29.0 Contributors: Own work Original artist: Karl Scheel • File:Example_of_German_quotation_marks. Original artist: Original uploader was Jtwdog at en. Based on Image:Evolution-tasks-old.1_screenshot. transferred to Commons by User:Sanderd17 using CommonsHelper.png Source: http://upload. Original artist: Original uploader was Jtwdog at en.png Source: http://upload.0 Contributors: Transferred from en.0 Contributors: Own work Original artist: Lanoxx • File:Envelope.png Source: http://upload.1_screenshot.wikimedia.0 Contributors: Own work Original artist: Dirk Hünniger • File:ESvn-texmf.png Source: http://upload.png License: ? Contributors: ? Original artist: ? • File:Enum. Original artist: Gummi team.svg Source: http://upload.wikibooks • File:Chick3.png.wikimedia.png Source: http://upload.png License: GPL Contributors: Transferred from en.wikimedia.0 Contributors: Own work Original artist: Hankjones • File:Gummi_0.wikimedia.wikipedia • File:H2O_Lewis_Structure_PNG.png Source: http://upload.wikibooks.0 Contributors: Own work Original artist: Daviewales • File:Cat-eats-cream.png License: CC-BY-SA-4.png License: MIT Contributors: Transferred from en.png License: CC0 Contributors: Own work Original artist: jeg • File:Gb4e2. TEXT AND IMAGE SOURCES.wikimedia.wikibooks • File:Chick4. Original artist: Original uploader was Jtwdog at en.org/wikibooks/en/d/dc/Dashes.org/wikipedia/commons/0/0f/Chemfig_angles.org/wikipedia/commons/5/5b/Carbon_Lewis_Structure_ PNG. Original artist: Tkgd2007 • File:Corticosterone_(1).png License: CC-BY-SA-3.wikimedia.svg Source: http://upload.png Source: http://upload.org/wikipedia/commons/3/3a/Enumerate.wikimedia.org/wikibooks/en/e/ef/Envelope.wikibooks.org/wikipedia/commons/1/10/Gummi_0.org/wikipedia/commons/1/1f/Clipboard.wikimedia.png License: CC-BY-SA-3.png License: CC-BY-SA-3.png Source: http://upload.0 Contributors: Own work Original artist: Dirk Hünniger • File:Enumerate.org/wikipedia/commons/0/01/Example_of_French_ quotation_marks.org/wikipedia/commons/8/8c/Frametitle_keyword_example.org/wikipedia/commons/8/84/Example_of_description_environment_result_using_ LaTeX.png License: Public domain Contributors: Own work Original artist: Winfree • File:Butane-skeletal. png License: CC-BY-SA-3.org/wikipedia/commons/b/b7/LaTeX-mathtools-brackets.png Source: http://upload.png Source: http://upload.wikimedia.png License: Cc-by-sa-3.Another proposition” from Wikipedia:Example requests for permission under GFDL license Original artist: gms • File:LaTeX-boxed-equation.wikimedia.3.wikimedia.org/wikipedia/commons/8/84/Jabref-2.0 Contributors: Own work Original artist: Hankjones • File:Ipa3.3.Another proposition” from Wikipedia:Example requests for permission under GFDL license Original artist: Derbeth • File:LaTeX-mathclap-example.0 Contributors: Own work Original artist: Hankjones • File:Ipa4.0 Contributors: Own work Original artist: Tomato86 .png License: GPL Contributors: Transferred from en.png License: GPL Contributors: Transferred from en. png License: CC-BY-SA-3.wikibooks.png License: CC-BY-SA-3.org/wikipedia/commons/0/0d/LaTeX-displaybreak-in-math.org/wikipedia/commons/e/e9/JabRef-ExternalPrograms.org/wikipedia/commons/e/e2/Kile_1.org/wikipedia/commons/2/2e/LaTeX-mathtools-arrows.png Source: http://upload.wikimedia.png License: CC-BY-SA-3.wikimedia.png License: GPL Contributors: Transferred from en.svg License: Public domain Contributors: modified versions from below.png License: CC-BY-SA-3.org/wikipedia/commons/1/1d/Information_icon4.0 Contributors: Own work Original artist: Tomato86 • File:LaTeX-boxed-formula-minipage.png License: CC-BY-SA-3. Original artist: Original uploader was Arnehe at en.wikimedia. transferred to Commons by User:Adrignola using CommonsHelper.wikimedia.png Source: http://upload.wikimedia.wikimedia.org/wikipedia/commons/2/29/Ipa1.wikimedia.0 Contributors: Own work Original artist: Hankjones • File:Ipa2.png Source: http://upload.wikimedia.wikimedia.png License: CC0 Contributors: Own work Original artist: ChrisHodgesUK • File:Itemize.png Source: http://upload.wikibooks.0 Contributors: ? Original artist: ? • File:Ipa1.png License: CC-BY-SA-3.wikibooks.wikimedia.org/wikipedia/commons/9/90/Ipa3. IMAGES 193 • File:Information_icon4.net/misc/latex/tutorial7/dingbats.org/wikipedia/commons/a/ab/ LaTeX-boxed-formula-minipage.2-screenshot.org/wikibooks/en/5/56/LaTeX-dingbats.png Source: http://upload.0 Contributors: Own work Original artist: Hankjones • File:Ipa7.png Source: http://upload.png Source: http://upload.0 Contributors: Own work Original artist: Dirk Hünniger • File:JabRef-ExternalPrograms.2.svg Source: http://upload.0 Contributors: Own work Original artist: Tomato86 • File:LaTeX-mathtools-arrows.png Source: http://upload.org/wikipedia/commons/0/02/LaTeX-boxed-equation.org/wikipedia/commons/2/22/Ipa2.wikibooks • File:JabRef-KeyPattern.0 Contributors: Own work Original artist: Hankjones • File:Ipa5.png Source: http://upload.png Source: http://upload.png Source: http://upload.wikimedia.org/wikipedia/commons/a/a8/Ipa4.png Source: http://upload.png Source: http://upload.org/wikipedia/commons/4/40/Ipa7.png License: ? Contributors: http://andy-roberts.wikimedia.png Source: http://upload.org/ Original artist: penubag (color adjustments) • File:Ion-example.org/wikipedia/commons/9/9f/Ipa5.org/wikipedia/commons/1/10/Ion-example.png Source: http://upload.wikimedia.org/wikipedia/commons/8/87/JabRef-KeyPattern.org/wikipedia/commons/c/c1/Kdiff3-modification.org/wikipedia/commons/a/a9/Itemize.wikibooks • File:Kile_1. Original artist: Original uploader was Arnehe at en.0 Contributors: ? Original artist: ? • File:Kdiff3-modification.png License: CC-BY-SA-3.wikimedia.2-screenshot.svg Source: http://upload. transferred to Commons by User:Adrignola using CommonsHelper.png License: CC-BY-SA-3.0 Contributors: Own work Original artist: Tomato86 • File:LaTeX-dingbats.png Source: http://upload.0 Contributors: Own work Original artist: Tomato86 • File:LaTeX-mathtools-brackets.0 Contributors: Own work Original artist: Tomato86 • File:LaTeX-letter.png License: CC-BY-SA-3.wikimedia.wikimedia. basing on “Formal .org/wikipedia/commons/3/33/LaTeX-mathtools-harpoons.png License: CC-BY-SA-3.png License: CC-BY-SA-3.png License: ? Contributors: own work.org/wikipedia/commons/c/ca/Ipa6.9.org/wikibooks/en/f/f0/LaTeX-letter.org/wikipedia/commons/8/8c/JabRef-GeneralFields.svg License: CC-BY-SA-3.png License: GPL Contributors: ? Original artist: ? • File:Koma_env. basing on “Formal .wikibooks • File:JabRef-GeneralFields.0 Contributors: Own work Original artist: Tomato86 • File:LaTeX-mathtools-harpoons.wikimedia.wikimedia.wikibooks.png Source: http://upload.kde-look.png Source: http://upload.png Source: http://upload.png Source: http://upload. Original artist: Original uploader was Arnehe at en.9.org/wikibooks/en/0/05/Koma_env. Original artist: Original uploader was Arnehe at en.0 Contributors: Own work Original artist: Hankjones • File:Ipa6.png License: CC-BY-SA-3.wikimedia.wikimedia.png License: CCBY-SA-3.wikimedia.png License: GPL Contributors: Transferred from en.png Source: http://upload.0 Contributors: own work.png Source: http://upload.png Original artist: Andrew Roberts • File:LaTeX-displaybreak-in-math.wikibooks • File:Jabref-2.wikimedia. which were modifies of http://www.wikimedia.12. transferred to Commons by User:Adrignola using CommonsHelper.org/wikipedia/commons/c/cd/LaTeX-mathclap-example.png License: CC-BY-SA-3. transferred to Commons by User:Adrignola using CommonsHelper. png License: CC-BYSA-3.svg Source: http://upload.org/wikipedia/commons/2/27/LaTeX_desc-newline.svg License: CC-BY-SA-3.svg License: CC-BY-SA-3.wikimedia.png License: CC-BY-SA-3.svg License: Public domain Contributors: ? Original artist: ? • File:LaTeX_program_package_example01.wikimedia.0 Contributors: Own work Original artist: Tomato86 • File:LaTeXAlternateRowTable.svg License: CC-BY-SA-3.0 Contributors: Own work Original artist: Tomato86 • File:LaTeX-xfrac-example.svg License: CC-BYSA-3.0 Contributors: Own work Original artist: MyName (Gkc (<a href='//commons.png License: Public domain Contributors: own work Original artist: Derbeth .png Source: http://upload.png License: Public domain Contributors: Own work Original artist: Neet • File:LaTeX_Dotsm.org/wikipedia/commons/c/ca/LaTeX_example_sqrt.png Source: http://upload.wikimedia.org/wikipedia/commons/0/07/LaTeX_TabXWidth1.org/wikipedia/commons/0/00/LaTeX_bibliography_abbrv.0 Contributors: Own work Original artist: Dirk Hünniger • File:LaTeX_TabXWidth2.png License: CC-BY-SA-3.png Source: http://upload.wikimedia.0 Contributors: Own work Original artist: Dirk Hünniger • File:LaTeX_TabXWidth1.org/wikipedia/commons/4/42/LaTeX_example_dcolumn.0 Contributors: Own work Original artist: Mwtoews • File:LaTeX_font_example.org/wikipedia/commons/b/bb/LaTeX_bibliography_alpha.wikimedia.wikimedia.org/wikipedia/commons/e/e6/LaTeX_example_dcolumn_ bold.png Source: http://upload.0 Contributors: Own work Original artist: Dirk Hünniger • File:LaTeX_TabWidth2.svg License: CC-BY-SA-3.wikimedia.wikimedia.wikimedia.org/wikipedia/commons/f/fc/LaTeX_-_Indented_Equations.org/wikipedia/commons/f/f7/LaTeX_colour_demo_1.png Source: http://upload.org/wikipedia/commons/6/63/LaTeX-smallmatrix.png License: CC0 Contributors: Own work Original artist: ChrisHodgesUK • File:LaTeX_example_split_gather.org/wikipedia/commons/e/ee/LaTeX_TabXWidth2.0 Contributors: Own work Original artist: Dirk Hünniger • File:LaTeX_bibliography_plain.org/wikipedia/commons/8/8d/LaTeX_animal_table_ with_booktabs.0 Contributors: Own work Original artist: Dirk Hünniger • File:LaTeX_colour_demo_1.svg Source: http://upload.0 Contributors: Own work Original artist: Dirk Hünniger • File:LaTeX_-_Indented_Equations.0 Contributors: Own work Original artist: Dirk Hünniger • File:LaTeX_bibliography_abbrv.org/wikipedia/commons/b/b5/LaTeX_Dotso.wikimedia.wikimedia.png License: CC0 Contributors: Own work Original artist: ChrisHodgesUK • File:LaTeX_example_dcolumn_bold.org/wikipedia/commons/b/b4/LaTeX_TabWidth2.png Source: http://upload.org/wiki/User_talk:Gkc' title='User talk:Gkc'>talk</a>)) • File:LaTeX_sloppypar.org/wikipedia/commons/0/08/LaTeX_bibliography_plain.org/wikipedia/commons/8/87/LaTeX_font_example.svg Source: http://upload.org/wikipedia/commons/4/45/LaTeX_ program_package_example01. TEXT AND IMAGE SOURCES.wikimedia.png License: Public domain Contributors: Own work Original artist: Neet • File:LaTeX_Dotsi.org/wikipedia/commons/5/59/LaTeX_Dotsm.png Source: http://upload.png Source: http://upload.wikimedia.svg License: CCBY-SA-3.svg Source: http://upload.svg Source: http://upload.org/wikipedia/commons/0/0b/LaTeX_example_split_gather.wikimedia.png License: CC0 Contributors: Own work Original artist: ChrisHodgesUK • File:LaTeX_logo.0 Contributors: Own work Original artist: Dirk Hünniger • File:LaTeX_diagram.png Source: http://upload. png License: Public domain Contributors: Own work Original artist: Inductiveload • File:LaTeX_Dotsb.png Source: http://upload.png License: Public domain Contributors: Own work Original artist: Neet • File:LaTeX_Dotso.wikimedia.png Source: http://upload.wikimedia.svg Source: http://upload.org/wikipedia/commons/0/0c/LaTeX_TabWidth1.org/wikipedia/commons/7/79/LaTeX_animal_table. png License: CC0 Contributors: Own work Original artist: ChrisHodgesUK • File:LaTeX_example_sqrt.wikimedia. AND LICENSES • File:LaTeX-smallmatrix.svg License: CC-BY-SA-3.wikimedia.wikimedia.svg Source: http://upload.wikimedia.svg Source: http://upload.0 Contributors: Own work Original artist: Dirk Hünniger • File:LaTeX_animal_table_with_booktabs.png Source: http://upload.0 Contributors: Own work Original artist: Dirk Hünniger • File:LaTeX_bibliography_alpha.wikimedia.png Source: http://upload.svg License: CCBY-SA-3.svg Source: http://upload.org/wikibooks/en/a/ac/LaTeX_sloppypar.png License: CC0 Contributors: Own work Original artist: ChrisHodgesUK • File:LaTeX_desc-newline.wikimedia.png License: Public domain Contributors: Own work Original artist: Neet • File:LaTeX_Dotsc.wikimedia. CONTRIBUTORS.svg Source: http://upload.wikimedia.png Source: http://upload.png Source: http://upload.org/wikipedia/commons/6/60/LaTeX_Dotsb.png License: Public domain Contributors: Own work Original artist: Neet • File:LaTeX_TabWidth1. Original artist: Alessio Damato • File:LaTeX_example_dcolumn.svg Source: http://upload.png License: CC0 Contributors: Own work Original artist: ChrisHodgesUK • File:LaTeX_figure_caption_with_lof_entry.wikimedia.org/wikipedia/commons/e/e7/LaTeXAlternateRowTable.org/wikipedia/commons/9/92/LaTeX_logo.wikimedia.org/wikipedia/commons/5/55/LaTeX_Dotsi.wikimedia.svg Source: http://upload.org/wikipedia/commons/f/f7/LaTeX_figure_ caption_with_lof_entry.svg License: CC-BYSA-3.org/wikipedia/commons/7/78/LaTeX_diagram.wikimedia.wikimedia.svg License: CCBY-SA-3.wikimedia.org/wikipedia/commons/0/0f/LaTeX_Dotsc.wikimedia.svg License: CC-BY-SA-3.svg License: CCBY-SA-3.194 CHAPTER 12.org/wikipedia/commons/9/9c/LaTeX-xfrac-example.0 Contributors: This vector image was created with Inkscape.svg Source: http://upload.png License: CC-BY-SA-3.png Source: http://upload.png Source: http://upload.0 Contributors: Own work Original artist: Dirk Hünniger • File:LaTeX_animal_table. 0 Contributors: part of “the not so short introduction to LaTeX”.org/wikipedia/commons/d/d8/Latex_example_ enumitem_inline_list.korvas • File:Latex-xymatrix.wikimedia.wikimedia.png Source: http://upload.wikimedia.org/wikipedia/commons/0/0a/ Latex-tables-double-dichotomy-example.0 Contributors: it’s from The not so short introduction to LaTeX.svg Source: http://upload. but the image of the gull that’s from commons Image:Gull portrait ca usa. png License: CC0 Contributors: Own work Original artist: Matej.wikimedia.pdf'>The not so short introduction to LaTeX</a>.wikimedia.svg Source: http://upload.png Source: http://upload.0 Contributors: Own work Original artist: Arthurchy • File:Latex_example_figure_referencing.org/wikipedia/commons/0/0c/Latex_example_arrows.svg License: CC-BY-SA-3.0 Contributors: taken as a screenshot of <a data-x-rel='nofollow' class='external text' href='http://www. used with permission of the author Original artist: Tobias Oetiker • File:Latex_example_arrows. used with permission of the author Original artist: Alessio Damato • File:Latex_example_defining_multiple_columns.png Source: http://upload.png Source: http://upload.org/wikipedia/commons/a/a3/Latex_example_circles.png License: CC-BY-SA-3. a GPLed book by Tobias Oetiker. 12 January 2007 (UTC) • File:Latex_example_ligatures.svg Source: http://upload.org/wikipedia/commons/6/61/ Latex-dependency-parse-example-with-tikz-dependency.korvas • File:Latex-xyling-simple-text-with-deptree.org/wikipedia/commons/3/3b/Latex-algorithmic-if-else.png License: CC-BY-SA-3.pdf'>The not so short introduction to LaTeX</a>. used with permission of the author Original artist: Alessio Damato .wikimedia.org/wikipedia/commons/4/41/Latex-xymatrix.0 Contributors: LaTeX / GIMP Original artist: LaTeX / GIMP • File:Latex_caption_example. used with permission of the author Original artist: Alessio Damato • File:Latex_example_box_test.png License: GFDL Contributors: Own work Original artist: Daniele Pighin • File:Latex-intertext.png License: CC0 Contributors: Own work Original artist: ChrisHodgesUK • File:Latex-algorithm2e-if-else.wikimedia.png License: CC-BY-SA-3.wikimedia.org/ tex-archive/info/lshort/english/lshort.org/wikipedia/commons/9/9b/Latex-intertext.0 Contributors: taken as a screenshot of <a data-x-rel='nofollow' class='external text' href='http://www.org/wikipedia/commons/9/96/Latex_example_ defining_multiple_columns.png License: CC-BY-SA-3.png Source: http://upload. IMAGES 195 • File:LaTeX_tabularx_multi.svg License: CC-BY-SA-3.org/wikipedia/commons/d/de/Latex_caption_example.0 Contributors: part of "the not so short introduction to LaTeX".png License: CC-BY-SA-3.org/wikipedia/commons/6/6a/Latex_example_line_ segments.org/wikipedia/commons/9/99/Latex_example_ligatures.org/wikipedia/commons/0/02/Latex_Beamer_-_ Columns_Example_2.org/wikipedia/commons/a/a5/Latex_example_bezier.0 Contributors: part of “the not so short introduction to LaTeX”.wikimedia.wikimedia.png License: CC-BY-SA-3.ctan.png License: CC-BY-SA-3.png License: CC0 Contributors: Own work Original artist: ChrisHodgesUK • File:Latex_Beamer_-_Columns_Example_2. a GPLed book by Tobias Oetiker.png License: CC-BY-SA-3.png Source: http://upload.org/wikipedia/commons/9/96/ Latex-xyling-simple-text-with-deptree.org/wikipedia/commons/2/2c/Latex-tikz-simple-deptree.org/wikipedia/commons/8/8f/Latex-Aboxed-example.wikimedia.wikimedia.png License: Public domain Contributors: Own work Original artist: Nemti • File:Latex-dependency-parse-example-with-tikz-dependency.wikimedia.0 Contributors: Own work Original artist: Alessio Damato 13:31.png Source: http://upload.0 Contributors: Own work Original artist: Flip • File:Latex_Pascal_Listing.2.png Source: http://upload. used with permission of the authors Original artist: Alessio Damato • File:Latex_example_catenary.png License: CC-BY-SA-3.wikimedia.wikimedia.png Source: http://upload.0 Contributors: Own work Original artist: Dirk Hünniger • File:Latex-Aboxed-example.wikimedia.wikimedia.svg License: CC-BY-SA-3.jpg Original artist: Alessio Damato • File:Latex_dashes_example.wikimedia.org/wikipedia/commons/e/ef/Latex_example_figure_ referencing.org/ tex-archive/info/lshort/english/lshort.png Source: http://upload.png Source: http://upload.12.png License: CC-BY-SA-3. used with permission of the author Original artist: Alessio Damato • File:Latex_example_circles.org/wikipedia/commons/3/3e/Latex_Pascal_Listing.wikimedia.png License: CC-BY-SA-3.org/wikipedia/commons/6/6d/Latex-algorithm2e-if-else.png Source: http://upload.wikimedia.0 Contributors: own work.org/wikipedia/commons/3/35/Latex_example_box_test. used with permission of the author Original artist: Alessio Damato • File:Latex_example_bezier.png Source: http://upload.png Source: http://upload.png Source: http://upload.0 Contributors: Own work Original artist: Lavaka • File:Latex-algorithmic-if-else.png License: Public domain Contributors: Own work Original artist: Matěj Korvas • File:Latex-xyling-simple-deptree.org/wikipedia/commons/9/9d/Latex_example_box_test_2.png License: CCBY-3.0 Contributors: Own work Original artist: Dirk Hünniger • File:Latex-tikz-simple-deptree.wikimedia.org/wikipedia/commons/c/ca/Latex_example_catenary.png Source: http://upload.ctan.png Source: http://upload.png License: CC-BY-SA-3. used with permission of the authors Original artist: Alessio Damato • File:Latex_example_box_test_2.wikimedia.0 Contributors: Own work Original artist: Tomato86 • File:Latex-tables-double-dichotomy-example.org/wikipedia/commons/9/97/Latex_dashes_example.0 Contributors: Own work Original artist: Dirk Hünniger • File:Latex_example_enumitem_inline_list. used with permission of the author Original artist: Tobias Oetiker • File:Latex_example_line_segments.0 Contributors: part of “the not so short introduction to LaTeX”.png Source: http://upload.png License: CC-BY-SA-3.svg License: CC-BY-SA-3.png Source: http://upload.png License: CC0 Contributors: Own work Original artist: Matej.wikimedia.wikimedia.png Source: http://upload.wikimedia.svg Source: http://upload.png License: CC-BY-SA-3.org/wikipedia/commons/2/2b/Latex-xyling-simple-deptree.wikimedia.org/wikipedia/commons/8/8c/LaTeX_tabularx_multi.png Source: http://upload.png Source: http://upload.0 Contributors: part of “the not so short introduction to LaTeX”.0 Contributors: it’s from The not so short introduction to LaTeX. wikimedia.org/wikipedia/commons/5/52/Latex_example_xypics_ arrows_2.png License: CC-BY-SA-3.org/wikipedia/commons/6/6e/Latex_example_ newenvironment. AND LICENSES • File:Latex_example_math_referencing.0 Contributors: part of “the not so short introduction to LaTeX”.svg Source: http://upload.png Source: http://upload.png Source: http://upload.png License: CCBY-SA-3.svg License: CC-BY-SA-3.org/wikipedia/commons/7/74/Latex_example_wrapfig.png License: CC-BY-SA-3.png License: CCBY-SA-3.png Source: http://upload. used with permission of the author Original artist: Alessio Damato • File:Latex_example_xypics_arrows_labels.png License: CC-BY-SA-3. used with permission of the author Original artist: Tobias Oetiker • File:Latex_example_text_formulas. used with permission of the author Original artist: Alessio Damato • File:Latex_example_newenvironment.org/wikipedia/commons/d/d6/Latex_example_xypics_basic.svg License: CC-BY-SA-3.org/wikipedia/commons/6/67/Latex_example_rule.org/wikipedia/commons/0/0e/Latex_example_multiple_pics.org/wikipedia/commons/5/5a/Latex_example_xypics_ arrows_3.png Source: http://upload.png Source: http://upload.0 Contributors: part of “the not so short introduction to LaTeX”.wikimedia.svg Source: http://upload.png Source: http://upload.wikimedia. used with permission of the author Original artist: Alessio Damato • File:Latex_example_multiput.png License: CC-BY-SA-3.png Source: http://upload.0 Contributors: Own work Original artist: Alessio Damato • File:Latex_example_wrapped_table.0 Contributors: Own work Original artist: Alessio Damato • File:Latex_example_middle. svg License: CC-BY-SA-3.png License: CC-BY-SA-3.org/wikipedia/commons/3/3d/Latex_example_ovals.org/wikipedia/commons/a/a5/Latex_example_wrapped_ table.org/wikipedia/commons/7/75/Latex_example_paralist.wikimedia.wikimedia.png Source: http://upload.wikimedia.png Source: http://upload.png Source: http://upload.png Source: http://upload.wikimedia. used with permission of the author Original artist: Alessio Damato • File:Latex_example_xypics_arrows_2. a GPLed book by Tobias Oetiker.png Source: http://upload.wikimedia.ctan. used with permission of the authors Original artist: Alessio Damato • File:Latex_example_sidecap. CONTRIBUTORS.wikimedia. used with permission of the author Original artist: Alessio Damato • File:Latex_example_paralist.0 Contributors: part of “the not so short introduction to LaTeX”.png License: CC-BY-SA-3.0 Contributors: part of “the not so short introduction to LaTeX”.pdf'>The not so short introduction to LaTeX</a>.png License: CC-BY-SA-3.0 Contributors: part of “the not so short introduction to LaTeX”. used with permission of the author Original artist: Alessio Damato .0 Contributors: part of “the not so short introduction to LaTeX”.wikimedia.wikimedia.wikimedia.196 CHAPTER 12.pdf'>The not so short introduction to LaTeX</a>.0 Contributors: Own work Original artist: Alessio Damato • File:Latex_example_rule. TEXT AND IMAGE SOURCES.org/wikipedia/commons/5/54/Latex_example_ xypics_arrows_labels. png License: CC-BY-SA-3.svg Source: http://upload.wikimedia.png License: CC-BY-SA-3.org/wikipedia/commons/4/48/Latex_example_math_ referencing.png Source: http://upload.png License: CC0 Contributors: Own work Original artist: ChrisHodgesUK • File:Latex_example_multiple_pics.org/wikipedia/commons/7/74/Latex_example_text_dots.wikimedia.org/tex-archive/info/lshort/english/lshort.org/wikipedia/commons/f/f7/Latex_example_text_formulas.wikimedia.png License: CC-BY-SA-3.0 Contributors: Own work Original artist: User:Mwtoews • File:Latex_example_subfig.org/wikipedia/commons/d/d4/Latex_example_xypics_ arrows_1.org/wikipedia/commons/1/15/Latex_example_middle.wikimedia.png Source: http://upload.png License: CC-BY-SA-3.wikimedia.png License: CC-BY-SA-3. used with permission of the author Original artist: Alessio Damato • File:Latex_example_xypics_basic.png Source: http://upload.0 Contributors: taken as a screenshot of <a data-x-rel='nofollow' class='external text' href='http://www.0 Contributors: part of “the not so short introduction to LaTeX”.org/wikipedia/commons/e/e5/Latex_example_ referencing_section.0 Contributors: Own work Original artist: Dirk Hünniger • File:Latex_example_rapidity.wikimedia.png Source: http://upload.org/tex-archive/info/ lshort/english/lshort.org/wikipedia/commons/d/dc/Latex_example_wrapfig_ vspace.0 Contributors: part of “the not so short introduction to LaTeX”.png Source: http://upload.wikimedia.wikimedia.org/wikipedia/commons/a/a8/Latex_example_xypics_ arrow_list.ctan.png License: CC-BY-SA-3. used with permission of the author Original artist: Alessio Damato • File:Latex_example_wrapfig.wikimedia.png Source: http://upload.png Source: http://upload.wikimedia.wikimedia.png License: CC-BY-SA-3.org/wikipedia/commons/e/e1/Latex_example_tabular_cline.0 Contributors: part of “the not so short introduction to LaTeX”.0 Contributors: Own work Original artist: Dirk Hünniger • File:Latex_example_text_dots.png Source: http://upload.0 Contributors: Own work Original artist: Alessio Damato • File:Latex_example_tabular_cline. png License: CC-BY-SA-3.org/wikipedia/commons/5/59/Latex_example_sidecap. png License: CC-BY-SA-3.0 Contributors: Own work Original artist: Dirk Hünniger • File:Latex_example_xypics_arrow_list.0 Contributors: part of “the not so short introduction to LaTeX”. used with permission of the author Original artist: Alessio Damato • File:Latex_example_xypics_arrows_3.png Source: http://upload.0 Contributors: taken as a screenshot of <a data-x-rel='nofollow' class='external text' href='http://www. used with permission of the author Original artist: Alessio Damato • File:Latex_example_referencing_section.org/wikipedia/commons/e/e5/Latex_example_subfig.0 Contributors: part of “the not so short introduction to LaTeX”.png License: CC-BY-SA-3. used with permission of the author Original artist: Alessio Damato • File:Latex_example_xypics_arrows_1.org/wikipedia/commons/d/dd/Latex_example_rapidity.png License: CC-BY-SA-3. used with permission of the authors Original artist: Alessio Damato • File:Latex_example_ovals.org/wikipedia/commons/b/b7/Latex_example_multiput.0 Contributors: Own work Original artist: Alessio Damato • File:Latex_example_wrapfig_vspace.0 Contributors: it’s from The not so short introduction to LaTeX.wikimedia. wikimedia.0 Contributors: Own work Original artist: Tomato86 • File:Latex_ready-made_strings.png License: CC-BY-SA-3.0 Contributors: File:Mathscr.org/wikipedia/commons/8/8a/Multicolumn.svg Source: http://upload.org/wikipedia/commons/4/42/LyX1.png Source: http://upload.0 Contributors: the layout.wikimedia. used with permission of the author Original artist: Alessio Damato • File:Latex_example_xypics_inarrow_labels.png License: CC-BY-SA-3.6.12.org/wikipedia/commons/d/d2/Literatur-Generator.org/wikipedia/commons/9/97/Latex_example_ xypics_inarrow_labels.org/wikipedia/commons/f/f0/Latex_example_ xypics_curved_arrow.svg License: CC-BY-SA-3.wikimedia.org/wikipedia/commons/b/bd/Latex_new_squareroot.svg Source: http://upload.png Source: http://upload.png Source: http://upload.png Source: http://upload.png Source: http://upload.png License: CC0 Contributors: Own work Original artist: ChrisHodgesUK • File:Latex_qtree_simple_tree.svg License: CC-BY-SA-3.0 Contributors: part of “the not so short introduction to LaTeX”.0 Contributors: Own work Original artist: Dirk Hünniger • File:Partial-vertical-line-remove.org/wikipedia/commons/6/6c/Latex_wikibook_test_title.3.6.bz2 (specifically important_yellow.png Source: http://upload.lyx.org/wikipedia/commons/a/ac/Latex_quote_4.svg Source: http://upload.svg License: CC-BY-SA-3. heavily post-processed by myself Original artist: Alessio Damato • File:Latex_new_squareroot.2.wikimedia.0 Contributors: Own work Original artist: Dirk Hünniger • File:Multirowandcolumnexample.svg License: Nuvola/icons/scalable/emblems/emblem-important.svg Source: http://upload. used with permission of the author Original artist: Tobias Oetiker • File:Latex_showkeys_example.svg License: CC-BY-SA-3.wikimedia. IMAGES 197 • File:Latex_example_xypics_curved_arrow.jpg License: CC-BY3.org/wikipedia/commons/1/1d/Latex_qtree_simple_tree.org/wikipedia/commons/d/d3/Nested.png License: Public domain Contributors: Screenshot taken by myself.org/wikipedia/commons/f/fe/Multirowandcolumnexample.org/wikipedia/commons/4/4b/Listings_Example.wikimedia.png Original artist: Neighbourhood_definition2.wikimedia.org/wikipedia/commons/a/ad/Latex_layout.svg Source: http://upload.png License: CC0 Contributors: Own work Original artist: Philip John Gorinski • File:Latex_quote_3. used with permission of the author Original artist: Alessio Damato • File:Latex_layout.png Source: http://upload.wikimedia.9.wikimedia.png License: CC-BY-SA-3.jpg Source: http://upload.png License: CC-BY-SA-3.org/wikipedia/commons/6/63/Plainnatrefs2.svg Source: http://upload.0 Contributors: it’s from The not so short introduction to LaTeX.0 Contributors: Own work Original artist: Ambrevar • File:Literatur-Generator.0 Contributors: Own work Original artist: Literaturgenerator • File:LyX1.png License: CC-BY-SA3.0 Contributors: Own work Original artist: Dirk Hünniger • File:Neighbourhood_definition2.0 Contributors: Own work Original artist: Jtwdog at en.svg Source: http://upload.wikimedia.png License: CC-BY-SA-3.wikimedia.org/wikipedia/commons/f/ff/Latex_sizes_table.org/wikipedia/commons/3/31/Partial-vertical-line-remove.wikimedia.wikimedia.wikimedia.svg Source: http://upload.wikimedia.svg License: CC-BY-SA-3.0 Contributors: part of “the not so short introduction to LaTeX”.org/wikipedia/commons/a/a3/Latex_quote_3.png Source: http://upload.png Source: http://upload.wikimedia.org/wikipedia/commons/a/aa/Merge-arrow.0 Contributors: Own work Original artist: Dirk Hünniger • File:Listings_Example.wikimedia.png Source: http://upload.wikibooks • File:Latex_wikibook_test_title.org/wikipedia/commons/c/cc/Latex_picture_example.svg Source: http://upload.0 Contributors: Own work Original artist: Alessio Damato • File:Latex_picture_example.wikimedia.png License: CC-BY-SA-3.svg Source: http://upload. Original artist: Modified to look more like the PNG file by Bastique.svg License: CC-BY-SA-3.svg License: CC-BY-SA-3.png Source: http://upload.org/wikipedia/commons/3/33/Methane_chemfig.wikimedia.png License: CC-BY-SA-3.svg) by David Vignoni.png Source: http://upload.org/wikipedia/commons/a/ab/Partial-vertical-line-add.org/wikipedia/commons/2/28/Mathscr_%28A-F%29.0 Contributors: Own work Original artist: Alessio Damato • File:Latex_sizes_table.png: Wegmann • File:Nested.svg License: CC-BY-SA3.svg License: Public domain Contributors: ? Original artist: ? • File:Methane_chemfig.org/wikipedia/commons/2/24/Latex_showkeys_example.org/wikipedia/commons/1/1c/Multirow.sty LaTeX package.0.wikimedia.org/wikipedia/commons/3/3a/Latex_ready-made_strings.png License: CC-BY-SA-3. • File:Partial-vertical-line-add.wikimedia.0 Contributors: Own work Original artist: Thenub314 • File:Latex_quote_4. a GPLed book by Tobias Oetiker.png License: CC-BY-SA3.wikimedia.png Original artist: Waldir • File:Merge-arrow.svg Source: http://upload.wikimedia.png License: CC-BY-SA-3.0 Contributors: Own work Original artist: Dirk Hünniger • File:Plainnatrefs2.wikimedia.png Source: http://upload. Original artist: LyX developer team (see www.org/wikipedia/commons/2/21/Neighbourhood_definition2.wikimedia.svg License: CC-BY-SA-3.png Source: http://upload.org/wikipedia/commons/d/dc/Nuvola_apps_ LGPL Contributors: An icon from gnome-themes-extras-0.svg License: CC-BY-SA-3.0 Contributors: Own work Original artist: Dirk Hünniger • File:Multirow.0 Contributors: Own work Original artist: Jimbotyson .org) • File:Mathscr_(A-F). used with permission of the author Original artist: Alessio Damato • File:Latex_example_xypics_standard_arrow.svg Source: http://upload.tar.wikimedia.0 Contributors: part of “the not so short introduction to LaTeX”.0 Contributors: Own work Original artist: Dirk Hünniger • File:Nuvola_apps_important_yellow.0 Contributors: Own work Original artist: Pmillerrhodes • File:Multicolumn.png Source: http://upload. Recolored by flamurai.org/wikipedia/commons/c/cf/Latex_example_ xypics_standard_arrow.png License: CC-BYSA-3.wikimedia.wikimedia.3.0 Contributors: • Neighbourhood_definition2. ss=1#source'>plot</a>.0 Contributors: Own work Original artist: Pmillerrhodes • File:Ring3_chemfig. Original artist: Alessio Damato • File:Specifier1.wikimedia. Original artist: version 1 by Nohat (concept by Paullusmagnus).png License: CC-BY-SA-3. CONTRIBUTORS.svg Source: http://upload.0 Contributors: Own work Original artist: Dirk Hünniger • File:Specifier4.png License: ? Contributors: ? Original artist: ? • File:TeXworks.w3.png License: CC-BY-SA-3.svg Source: http://upload.svg Source: http://upload.wikimedia.png Source: http://upload.wikimedia.org/wikipedia/commons/e/ed/Verbatim. by Nohat.png Source: http://upload.png License: CC-BY-SA-3.org/wikibooks/en/5/56/Quote1.svg Source: http://upload.wikimedia.&.wikimedia.wikimedia.0 Contributors: Own work Original artist: Dirk Hünniger • File:Specifier2.org/wikipedia/commons/9/97/Simple_sideways_tree.0 Contributors: Own work Original artist: Pmillerrhodes • File:Soliton_2nd_order.wikimedia.</span>. svg.png Source: http://upload.png Source: http://upload.wikimedia. AND LICENSES • File:Quote1.png License: GPL Contributors: Screenshot Original artist: PAC2 • File:Texcharbox.org/wikipedia/commons/a/a3/Ring4_chemfig.org/wikipedia/commons/5/5d/Specifier2.org%2Fwiki%2FSpecial%3AFilepath%2FSoliton_2nd_order.org/wikipedia/commons/d/d1/Specifier4.198 CHAPTER 12.svg License: CC-BY-SA-3.svg Source: http://upload.png Source: http://upload.wikimedia.png License: ? Contributors: ? Original artist: ? • File:Quote2.0 Contributors: This image was created with gnu<a data-x-rel='nofollow' class='external text' href='http: //validator.wikimedia.png License: ? Contributors: ? Original artist: ? • File:Quote4. TEXT AND IMAGE SOURCES.org/wikipedia/commons/6/61/Soliton_2nd_order.wikimedia.org/wikipedia/commons/0/05/Skeletondiagram2.org/wikipedia/commons/c/c4/Texcharbox.0 Contributors: Own work Original artist: Pmillerrhodes • File:Ring_chemfig.org/wikibooks/en/8/88/Quote2.png Source: http://upload.png Source: http://upload.org/wikipedia/commons/a/a1/TeXworks.png Source: http://upload.png License: GFDL Contributors: based on the first version of the Wikipedia logo.svg License: CC-BY-SA-3.png Source: http://upload.wikimedia.wikimedia.svg License: CC-BY-SA-3.<span>.org/wikipedia/commons/0/0c/Ring2_chemfig.svg License: CC0 Contributors: Own work Original artist: Ambrevar • File:Verbatim.3 Content license • Creative Commons Attribution-Share Alike 3.png License: CC0 Contributors: Own work Original artist: Philip John Gorinski • File:Skeletondiagram2.org/wikibooks/en/a/ad/Symbols.org/check?uri=http%3A%2F%2Fcommons.png Source: http://upload.png License: CC-BY-SA-3.svg Source: http://upload.org/wikipedia/commons/6/63/Wikipedia-logo.org/wikipedia/commons/c/cc/Quote4.org/wikipedia/commons/8/8f/Specifier3.0 Contributors: Own work Original artist: Tomato86 • File:Ring2_chemfig.png License: CC-BY-SA3.wikimedia.0 Contributors: Own work Original artist: Dirk Hünniger • File:Wikipedia-logo.wikimedia.0 Contributors: Own work Original artist: Pmillerrhodes • File:Ring4_chemfig.svg License: CC-BY-SA-3.0 Contributors: Own work Original artist: Pmillerrhodes • File:Simple_sideways_tree.wikimedia.png Source: http://upload.png License: CC-BY-SA-3.svg License: CC-BY-SA-3.0 Contributors: Own work Original artist: Dirk Hünniger • File:Specifier3.wikimedia.0 Contributors: Own work Original artist: Dirk Hünniger • File:Symbols.org/wikipedia/commons/2/21/Ring_chemfig.wikimedia. 12.0 .png Source: http://upload.svg Source: http://upload.wikimedia.wikimedia.svg License: CC-BY-SA-3.org/wikipedia/commons/9/92/Specifier1.org/wikipedia/commons/9/95/Ring3_chemfig.
Copyright © 2024 DOKUMEN.SITE Inc.