Lyx: the Other Way of Writing
Total Page:16
File Type:pdf, Size:1020Kb
LYX, The Other Way of Writing 2018 Edition One of the best tools to work with the most powerful document editor Ricardo G. Berlasso https://frommindtotype.wordpress.com/ LATEX and derivatives such as XƎTEX have the great advantage of their power and the big problem, at least in their “pure” form, of their difficult “learning curve.” LYX solves the difficulty of using LATEX without compromising its power, providing a robust and easy-to-use program that will satisfy both, new and veteran users. In this book we explore the power of LYX, LATEX, XƎTEX and OpenType, showing how far we can go. LYX, The Other Way of Writing Speak documentclass And Enter Ricardo Berlasso 2018 Edition © 2018 Ricardo Gabriel Berlasso This book is distributed under a Creative Commons license Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) (http://creativecommons.org/licenses/by-sa/4.0/) Attribution: Youmust give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. ShareAlike: If you remix, transform, or build upon the material, you must distribute your contribu- tions under the same license as the original. No additional restrictions: You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. Any mark mentioned in this book belongs to its owner. The latest version of this book can be found at: https://frommindtotype.wordpress.com/lyx-book/ Contents Introduction 1 To whom is this book addressed? ................ 1 The structure of this book .................... 3 A bit of history ......................... 4 Minimal requirements ...................... 5 Conventions used in this book .................. 6 Links to have at hand ...................... 7 I The foundations 9 1 Defining LATEX 11 1.1 What is LATEX ....................... 11 1.2 LATEX as a tag language (almost…) ............. 13 1.3 Document classes ..................... 15 1.4 “Building” the document ................. 16 1.5 And OpenType came to LATEX ............... 17 2 Why is LYX so special 19 2.1 The “WYSIWYM” concept ................ 21 2.2 Fonts and “formats” .................... 23 2.3 Main LYX features ..................... 23 2.4 How is working with LYX ................. 24 I II Index 2.5 LyX for LATEX fundamentalists .............. 25 2.6 When yes, when not .................... 26 II Let’s start to set up things 29 3 The graphical interface of LYX 31 3.1 General description .................... 31 3.2 Keyboard shortcuts .................... 34 3.3 Many documents, in many ways .............. 35 4 Building documents 37 4.1 Working with LYX ..................... 37 4.1.1 General format of the document ......... 37 4.1.2 Text ........................ 41 4.1.3 Lists ....................... 42 4.1.4 Math ....................... 43 4.1.5 Tables ....................... 44 4.1.6 “Boxes” ...................... 46 4.1.7 Figures, tables and other “floats” ......... 48 4.1.8 Cross-references .................. 48 4.1.9 Indexes ...................... 50 4.1.10 Generate a “dynamic” PDF: the Hyperref package 52 4.1.11 Navigate and organize the document ....... 54 4.2 Appendixes ........................ 56 4.3 Bibliography ........................ 56 4.4 Language ......................... 57 4.4.1 New in 2.3: “dynamic and ‘nested’ quotation marks” 57 4.4.2 Dictionaries .................... 58 4.4.3 Babel vs. Poliglosia ................ 60 4.4.4 Babel options in LATEX/LYX ........... 60 4.5 Import and export documents ............... 61 4.6 Copy information from other programs .......... 61 4.7 Change tracking ...................... 62 4.8 Working with “branches” ................. 62 4.9 Master documents ..................... 65 Index III III Beyond the basic settings 67 5 Some commands 69 5.1 The LATEX preamble .................... 69 5.2 The TEX box ....................... 70 5.3 A matter of “size” ..................... 71 5.4 A matter of “shape” (typographical) ............ 71 5.5 Numbers! ......................... 73 5.6 Reconfigure! ....................... 74 6 LYX, OpenType and typography 75 6.1 OpenType for the predefined font ............. 76 6.2 Defining a font family ................... 78 6.3 OpenType for the entire document ............ 78 6.4 Different fonts for different “shapes” ........... 79 6.5 Different OpenType options for each “shape” ....... 80 6.6 Apply a stylistic set to a particular character ........ 81 6.7 OpenType for math, 1: unicode-math .......... 82 6.8 OpenType for math, 2: mathspec ............. 84 6.9 Line spacing ........................ 86 6.10 Hyphenation ....................... 88 6.11 Micro-typography ..................... 89 6.11.1 What micro-typography means and its use .... 89 6.11.2 How to apply micro-typography ......... 91 6.12 Sub- and superscripts ................... 91 7 Footnotes and endnotes 95 7.1 Notes numbers without superscript ............ 95 7.2 Footnotes in columns ................... 96 7.3 Footnotes without paragraph breaks ........... 96 7.4 Restart footnote numbering on each page ......... 96 7.5 “Numbering” footnotes with symbols .......... 97 7.6 Change the footnote font ................. 98 7.7 Endnotes ......................... 98 7.8 An extra: margin notes .................. 99 IV Index 8 Modules, local format and math macros 101 8.1 Modules .......................... 101 8.2 Create new instructions .................. 103 8.3 Create character styles in LYX ............... 104 8.4 Paragraph environment? ................. 107 8.5 Math macros ....................... 108 9 Numbered lists 113 9.1 Modify particular lists ................... 113 9.2 Change all lists in the document .............. 114 10 About the Table of Contents and other Indexes 117 10.1 Short titles ......................... 117 10.2 Partial TOCs for each chapter ............... 117 10.3 Correct the spacing in lists of figures and tables ...... 118 10.4 Avoid dotted lines in indexes ............... 119 10.5 Some (few) words about alphabetical indexes ....... 119 11 Headings 121 11.1 Rename the “Part” and “Chapter” environments ..... 121 11.2 Number chapters with Roman numerals ......... 122 11.3 Make the chapter start at any page ............. 122 11.4 Avoid page breaks at the beginning of a chapter ...... 122 11.5 Change the format of titles in LYX documents ....... 123 11.5.1 The packages needed ............... 123 11.5.1.1 xcolor ................ 124 11.5.1.2 titlesec ............... 124 11.5.2 A complete example ............... 124 11.6 Restart the numbering after a “Part” ........... 126 12 Headers and footers, and page styles 129 12.1 Preparations ........................ 129 12.2 The fancyhdr package .................. 130 12.3 An example ........................ 132 12.4 Create and use page styles ................. 133 12.5 First page of the chapter .................. 136 Index V 12.6 Blank pages ........................ 137 12.7 The page style for the “Part” environment ......... 138 13 Drop Caps and similar topics 141 13.1 Something traditional ................... 141 13.2 Be careful with the number of lines! ............ 143 13.3 A variant: a “raised” initial ................ 144 13.4 A challenge ........................ 144 13.5 An alternative: first line of paragraph in small caps .... 145 14 Figures and other floats 147 14.1 Adjust the size of inserted images ............. 147 14.1.1 Manual adjustment of image size ......... 147 14.1.2 Automatically adjust the size ........... 149 14.1.3 Size of the image in the editing window ..... 151 14.1.4 To avoid repetition: graphic groups ....... 151 14.2 “Wrapped” figures ..................... 151 14.3 Center pictures or tables inside floats ........... 153 14.4 Setting the caption text formatting for all floats ...... 154 14.5 Rename floats ....................... 155 14.6 Change the numbering scheme of figures and tables .... 155 15 Extras 157 15.1 Describe keys and menus: the menukeys package ..... 157 15.1.1 What is menukeys ................ 158 15.1.2 Using menukeys in LYX ............. 159 15.2 Side captions for figures/tables .............. 161 15.3 Adding a new float .................... 162 15.4 Colored boxes ....................... 163 15.5 Things I have not talked about .............. 164 15.5.1 BibLATEX support ................. 164 15.5.2 Presenting code with listings ......... 165 15.5.3 PDF forms .................... 165 15.5.4 Sweave and knitr ................ 165 15.5.5 Computer Algebra Systems ............ 165 15.5.6 And much, much more .............. 165 VI Index IV Appendixes 167 A All about typeface 169 A.1 Fonts used in this book .................. 169 A.2 More about typefaces ................... 170 B Local Layout 171 CLATEX preamble 175 D Other formats... and a greeting 179 D.1 Other formats used in this book .............. 179 D.2 And yes, direct formatting ................. 180 D.3 Final greetings ....................... 181 Introduction Many years ago there was a free digital magazine in Spanish about free soft- ware called “Begins.” For that magazine I wrote several articles, some about 1 Writer, some about LYX. Over time, both sets of articles became books, and now those books are being translated into English. As you will soon realize, I am not a native English speaker. If you find any (or many!) error(s) in this text, please let me know! You can use the contact form on my personal blog for that https://frommindtotype.wordpress.com/contact/ And of course, you can always