A Practical Guide to LATEX Tips and Tricks
Total Page:16
File Type:pdf, Size:1020Kb
Luca Merciadri A Practical Guide to LATEX Tips and Tricks October 7, 2011 This page intentionally left blank. To all LATEX lovers who gave me the opportunity to learn a new way of not only writing things, but thinking them ...Claudio Beccari, Karl Berry, David Carlisle, Robin Fairbairns, Enrico Gregorio, Stefan Kottwitz, Frank Mittelbach, Martin M¨unch, Heiko Oberdiek, Chris Rowley, Marc van Dongen, Joseph Wright, . This page intentionally left blank. Contents Part I Standard Documents 1 Major Tricks .............................................. 7 1.1 Allowing ............................................... 10 1.1.1 Linebreaks After Comma in Math Mode.............. 10 1.2 Avoiding ............................................... 11 1.2.1 Erroneous Logic Formulae .......................... 11 1.2.2 Erroneous References for Floats ..................... 12 1.3 Counting ............................................... 14 1.3.1 Introduction ...................................... 14 1.3.2 Equations For an Appendix ......................... 16 1.3.3 Examples ........................................ 16 1.3.4 Rows In Tables ................................... 16 1.4 Creating ............................................... 17 1.4.1 Counters ......................................... 17 1.4.2 Enumerate Lists With a Star ....................... 17 1.4.3 Math Math Operators ............................. 18 1.4.4 Math Operators ................................... 19 1.4.5 New Abstract Environments ........................ 20 1.4.6 Quotation Marks Using ”........................... 21 1.4.7 Titlepages ........................................ 22 1.5 Drawing ................................................ 24 1.5.1 A Block Quote With Quotation Marks ............... 24 1.5.2 A Box On Every Digit Of an Integer ................. 25 1.5.3 A Centered Slash on Math Symbols .................. 26 1.5.4 A Colored Front Cover ............................. 27 1.5.5 A (Single/Double) Linked List ...................... 28 1.5.6 A Personalized overline ........................... 29 1.5.7 Boxes In align-like Environments ................... 30 1.5.8 Cases With Square Brackets ........................ 31 1.5.9 Closed Square Roots ............................... 32 VIII Contents 1.5.10 Correct Circuits ................................... 32 1.5.11 Dependency Arrows ............................... 34 1.5.12 Diagonally-Cut Cells ............................... 34 1.5.13 Graph Paper...................................... 34 1.5.14 Logic Gates....................................... 37 1.5.15 Over and Under Braces on Same Elements............ 42 1.5.16 Rightmost Braces ................................. 43 1.5.17 Tables With Dashed Lines, Shaded Cells and Arrows Pointing At a Row and a Column ................... 44 1.6 Finding ................................................ 45 1.6.1 Symbols’ Commands ............................... 45 1.7 Fixing Errors ........................................... 45 1.7.1 Dimen ........................................... 45 1.7.2 Fncychap ......................................... 46 1.7.3 LATEX ............................................ 46 1.7.4 PDF compatibility ................................ 47 1.8 Incorporating ........................................... 47 1.8.1 MATLAB Graphics ................................ 47 1.8.2 Spreadsheets ...................................... 50 1.8.3 References ........................................ 50 1.9 Modifying .............................................. 50 1.9.1 Captions ......................................... 50 1.9.2 Margins and Marginpar Notes ...................... 50 1.9.3 The Zoom of a Document .......................... 52 1.10 Printing ................................................ 52 1.10.1 Empty Pages ..................................... 52 1.10.2 Monochrome ...................................... 52 1.11 Sizing .................................................. 53 1.11.1 Boxed Minipages Depending On the Text............. 53 1.11.2 \left and \right to Produce Smaller Brackets ....... 53 1.12 Splitting ............................................... 54 1.12.1 algorithm Environments on Multiple Pages .......... 54 1.13 Using .................................................. 55 1.13.1 \centering and the center Environment Accordingly . 55 1.13.2 \scalebox ....................................... 55 1.13.3 The Enumerate Package ............................ 56 1.14 Writing ................................................ 56 1.14.1 Aligned Systems of (In)Equations ................... 56 1.14.2 (a) Bold \ell ..................................... 57 1.14.3 A Symmetric Matrix ............................... 57 1.14.4 Code Depending On the Processor ................... 58 1.14.5 Dancing Text ..................................... 59 1.14.6 Dash Integrals .................................... 60 1.14.7 Dashed And Underlined Text ....................... 60 1.14.8 Date and Time .................................... 61 Contents IX 1.14.9 Diagonal (Inverse) Dots ............................ 61 1.14.10Different Slides .................................... 62 1.14.11Enumerations With Textcircled Numbers ............. 63 1.14.12Footnotes In Boxes ................................ 63 1.14.13Footnotes In tabular .............................. 65 1.14.14Footnotes With a New Number At Each Section ...... 65 1.14.15Footnotes Without Any Number .................... 66 1.14.16Fractions ......................................... 66 1.14.17Indented Text, But Not the First Line ............... 66 1.14.18Integrals Adapted to the Context .................... 67 1.14.19Links ............................................ 70 1.14.20Logic Inferences ................................... 71 1.14.21Matrices ......................................... 72 1.14.22Minitocs ......................................... 78 1.14.23Product Integrals .................................. 79 1.14.24Roman Numbers .................................. 79 1.14.25Simplifications .................................... 80 1.14.26Small mathcal Letters ............................. 80 1.14.27Stacks (In Equations) .............................. 81 1.14.28Standard Display of Date and Time ................. 82 1.14.29Subequations with Braces .......................... 82 1.14.30Tables ........................................... 83 1.14.31Tabular Packages: What are Their Respective Purposes, and Which Ones Conflict? ................. 83 1.14.32Text On the Same Line as an Equation .............. 85 1.14.33Text Below an Image .............................. 86 1.14.34Two Itemizations on the Same Line .................. 86 1.14.35Verbatim in Center ................................ 87 1.14.36Verbatim In tabular .............................. 87 1.14.37Verbatim In Footnotes ............................. 87 1.14.38Verbatim In Hierarchy ............................. 87 1.14.39Vertically Aligned Itemize Environments ............. 88 2 Fine Tuning ............................................... 89 2.1 Avoiding ............................................... 90 2.1.1 Color In TOC And TOFs........................... 90 2.2 Counting ............................................... 91 2.2.1 Pages And Tables ................................. 91 2.2.2 Paragraphs ....................................... 92 2.3 Defining ................................................ 92 2.3.1 A Turning Page Text .............................. 92 2.3.2 Bold Index Numbers ............................... 93 2.3.3 Useful Commands ................................. 93 2.4 Managing .............................................. 94 2.4.1 Beamer Presentations and Articles................... 94 X Contents 2.4.2 Big Documents ................................... 96 2.4.3 Floats ........................................... 97 2.4.4 Indentation ....................................... 99 2.4.5 Index ............................................ 99 2.5 Modifying .............................................. 99 2.5.1 QED Square ...................................... 99 2.6 Using ..................................................101 2.6.1 Cleardoublepage Command Correctly ................101 2.6.2 Crops ............................................101 2.6.3 Microtype ........................................101 2.6.4 Pedagogical Tools .................................102 2.6.5 Units From the SI .................................102 2.7 Writing ................................................103 2.7.1 Comments In an Effective Way ......................103 2.7.2 Derivatives and Such Symbols In a Better Way ........103 2.7.3 Letters With the lettre Documentclass Without a Big Space ........................................104 2.7.4 Letters With the lettre Documentclass Without the Line Bending .....................................104 2.7.5 MATLAB Code ...................................105 2.7.6 Messages on Would-Be Blank Pages .................106 2.7.7 Unhabitual Punctuation Marks .....................107 2.8 Referring to \labels by long names .......................108 2.8.1 Code ............................................108 2.8.2 Example .........................................109 2.9 Personalizing The Index ..................................109 2.9.1 Standard Personalization ...........................109 2.9.2 French Tricks .....................................109 2.9.3 Insensitive Letter Sort .............................110 2.9.4 Special Letter Sort ................................110 2.9.5 German Letter