GNU TeXmacs User Manual Joris Van Der Hoeven
To cite this version:
Joris Van Der Hoeven. GNU TeXmacs User Manual. 253 pages. 2013.
HAL Id: hal-00785535 https://hal.archives-ouvertes.fr/hal-00785535 Submitted on 6 Feb 2013
HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements tag">d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. GNU TEXMACS user manual
Joris van der Hoeven & others
Table of contents
1. Getting started ...... 11 1.1. Conventionsforthismanual ...... 11 Menuentries ...... 11 Keyboardmodifiers ...... 11 Keyboardshortcuts ...... 11 Specialkeys ...... 11 1.2. Configuring TEXMACS ...... 12 1.3. Creating, saving and loading documents ...... 12 1.4. Printingdocuments ...... 13
2. Writing simple documents ...... 15 2.1. Generalities for typing text ...... 15 2.2. Typingstructuredtext ...... 15 2.3. Content-basedtags ...... 16 2.4. Lists ...... 17 2.5. Environments ...... 18 2.6. Layoutissues ...... 18 2.7. Thefontselectionsystem ...... 19 2.8. Masteringthekeyboard ...... 19 2.8.1. Generalprefixrules ...... 19 2.8.2. Keyboard shortcuts for text mode ...... 20 2.8.3. Hybrid commands and LATEXsimulation ...... 21 2.8.4. Dynamicobjects ...... 22 2.8.5. Various useful keyboard shortcuts ...... 22
3. Mathematical formulas ...... 23 3.1. Incorporating mathematical formulas into documents ...... 23 3.2. Typing mathematical symbols ...... 24 3.3. Main mathematical constructs ...... 25 3.4. Typinglargedelimiters ...... 26 3.5. Typingbigoperators ...... 26 3.6. Wide mathematical accents ...... 27 3.7. Semantic editing facilities ...... 28 3.8. Common errors and syntax correction ...... 29 3.9. Semantics of mathematical symbols ...... 30 3.10. Customized mathematical semantics ...... 32
4. Tabular material ...... 33 4.1. Creatingtables ...... 33 4.2. Theformattingmode ...... 34 4.3. Specifying the cell and table alignment ...... 34 4.4. Specifying the cell and table size ...... 35 4.5. Borders, padding and background color ...... 35
3 4 Table of contents
4.6. Advancedtablefeatures ...... 35
5. Links and automatically generated content ...... 37 5.1. Creating labels, links and references ...... 37 5.2. Insertingimages ...... 37 5.3. Generating a table of contents ...... 38 5.4. Compilingabibliography ...... 38 5.5. Generatinganindex ...... 39 5.6. Compilingaglossary ...... 39 5.7. Books and multifile documents ...... 39
6. Creating technical pictures ...... 41 6.1. Startinganewpicture ...... 41 6.2. Insertingnewobjects ...... 41 6.3. Editingobjects ...... 43 6.4. Specification of style properties ...... 43 Color ...... 44 Fillcolor ...... 44 Opacity ...... 44 Pointstyle ...... 44 Linewidth ...... 44 Linedashes ...... 44 Linearrows ...... 45 Textalignment ...... 45 6.5. Editinggroupsofobjects ...... 45
7. Advanced layout features ...... 47 7.1. Flows ...... 47 7.2. Floatingobjects ...... 47 7.3. Pagebreaking ...... 47
8. Editing tools ...... 49 8.1. Cutandpaste ...... 49 8.2. Searchandreplace ...... 49 8.3. Spellchecking ...... 50 8.4. Undoandredo ...... 51 8.5. Structuredediting ...... 51 8.6. Structured cursor movement ...... 52 Structured traversal of the document ...... 52 Traversal of tags which are similar to the innermost tag ...... 52 Movements inside the innermost tag ...... 52 8.7. Structuredvariants ...... 53 8.8. Positioningandresizingobjects ...... 53 8.9. Versioningtools ...... 54 Comparingtwoversions ...... 54 Visualizationofthedifferences ...... 54 Retainingaspecificversion ...... 55 Grain control and reactualizing the differences ...... 55 Table of contents 5
Using external programs for version control such as Subversion . . . 55
9. Laptop presentations ...... 57 9.1. Beamerstyles ...... 57 9.2. Traversalofapresentation ...... 57 9.3. Decorations ...... 58 9.4. Animations ...... 58
10. Using GNU TEXMACS as an interface ...... 61 10.1. Creatingsessions ...... 61 10.2. Editingsessions ...... 61 10.3. Selectingtheinputmethod ...... 62 10.4. Plug-ins as scripting languages ...... 63 10.5. Spreadsheets ...... 64
11. Writing TEXMACS style files ...... 67 11.1. Writing a simple style package ...... 67 11.2. Rendering of style files and packages ...... 69 11.2.1. ASCII-based or tree-based editing: an intricate choice ...... 69 11.2.2. Globalpresentation ...... 70 11.2.3. Localcustomization ...... 73 11.3. Thestyle-sheetlanguage ...... 74 11.3.1. Assignments ...... 74 11.3.2. Macroexpansion ...... 74 11.3.3. Formatting primitives ...... 75 11.3.4. Evaluationcontrol ...... 77 11.3.5. Flowcontrol ...... 78 11.3.6. Computationalmarkup ...... 79 11.4. Customizing the standard TEXMACS styles ...... 80 11.4.1. Organization of style files and packages ...... 80 11.4.2. General principles for customization ...... 81 11.4.3. Customizing the general layout ...... 81 11.4.4. Customizing list environments ...... 82 11.4.5. Customizing numbered textual environments ...... 84 Definingnewenvironments ...... 84 Customizationoftherendering ...... 84 Customizationofthenumbering ...... 85 11.4.6. Customizing sectional tags ...... 85 11.4.7. Customizing the treatment of title information ...... 87 11.5. Furthernotesandtips ...... 88 11.5.1. Customizing arbitrary tags ...... 88 11.5.2. Standardutilities ...... 89
12. Customizing TEXMACS ...... 91 12.1. Introduction to the Guile extensionlanguage ...... 91 12.2. Writing your own initialization files ...... 91 12.3. Creating your own dynamic menus ...... 92 12.4. Creating your own keyboard shortcuts ...... 93 12.5. Otherinterestingfiles ...... 93 6 Table of contents
13. The TEXMACS plug-in system ...... 95 13.1. Installingandusingaplug-in ...... 95 13.2. Writingyourownplug-ins ...... 95 13.3. Example of a plug-in with Scheme code ...... 97 The world plug-in ...... 97 Howitworks ...... 97 13.4. Example of a plug-in with C++ code ...... 97 The minimal plug-in ...... 97 Howitworks ...... 98 13.5. Summary of the configuration options for plug-ins ...... 98
14. The TEXMACS format ...... 101
14.1. TEXMACS trees ...... 101 Internal nodes of TEXMACS trees ...... 101 Leafs of TEXMACS trees ...... 101 Serialization and preferred syntax for editing ...... 102 14.2. TEXMACS documents ...... 102 14.3. Defaultserialization ...... 103 Mainserializationprinciple ...... 103 Formattingandwhitespace ...... 104 Rawdata ...... 105 14.4. XMLserialization ...... 105 Theencodingforstrings ...... 105 XML representation of regular tags ...... 105 Specialtags ...... 105 14.5. Scheme serialization ...... 106 14.6. Thetypesettingprocess ...... 107 14.7. Data relation descriptions ...... 108 TherationalebehindD.R.D.s ...... 108 Current D.R.D. properties and applications ...... 109 Determination of the D.R.D. of a document ...... 109 14.8. TEXMACS lengths ...... 109 Absolutelengthunits ...... 110 Rigidfont-dependentlengthunits ...... 110 Stretchable font-dependent length units ...... 111 Boxlengths ...... 111 Otherlengthunits ...... 111 Differentwaystospecifylengths ...... 112
15. Built-in environment variables ...... 113 15.1. General environment variables ...... 114 15.2. Specifyingthecurrentfont ...... 116 15.3. Typesetting mathematics ...... 118 15.4. Paragraphlayout ...... 119 15.5. Pagelayout ...... 123 Paperspecificvariables ...... 123 Screenspecificvariables ...... 124 Table of contents 7
Specifyingthemargins ...... 125 Pagedecorations ...... 126 15.6. Tablelayout ...... 127 Layoutofthetableasawhole ...... 127 Layoutoftheindividualcells ...... 128 15.7. Editingsourcetrees ...... 130 15.8. Miscellaneous environment variables ...... 131
16. Built-in TEXMACS primitives ...... 133 16.1. Fundamental primitives ...... 133 16.2. Formatting primitives ...... 134 16.2.1. Whitespaceprimitives ...... 134 16.2.2. Line breaking primitives ...... 136 16.2.3. Indentation primitives ...... 136 16.2.4. Page breaking primitives ...... 137 16.2.5. Box operation primitives ...... 138 16.3. Mathematical primitives ...... 140 16.4. Tableprimitives ...... 143 16.5. Linkingprimitives ...... 144 16.6. Miscellaneous physical markup ...... 145
17. Primitives for writing style files ...... 147 17.1. Environment primitives ...... 147 17.2. Macroprimitives ...... 148 17.3. Flow control primitives ...... 151 17.4. Evaluation control primitives ...... 152 17.5. Functionaloperators ...... 153 17.5.1. Operationsontext ...... 154 17.5.2. Arithmeticoperations ...... 155 17.5.3. Booleanoperations ...... 155 17.5.4. Operationsontuples ...... 156 17.6. Transientmarkup ...... 156 17.7. Miscellaneous style-sheet primitives ...... 159 17.8. Internalprimitives ...... 159
18. The standard TEXMACS styles ...... 163 18.1. Generalorganization ...... 163 18.1.1. Standard TEXMACS styles ...... 163 18.1.2. Standard TEXMACS packages ...... 164 18.2. The common base for most styles ...... 165 18.2.1. Standardmarkup ...... 165 18.2.2. Standardsymbols ...... 168 18.2.3. Standard mathematical markup ...... 169 18.2.4. Standardlists ...... 169 18.2.4.1. Using list environments ...... 169 18.2.4.2. Customization of list environments ...... 170 18.2.5. Automatic content generation ...... 171 18.2.5.1. Bibliographies ...... 171 18.2.5.2. Tablesofcontents ...... 172 18.2.5.3. Indexes ...... 173 8 Table of contents
18.2.5.4. Glossaries ...... 174 18.2.6. Utilities for writing style files ...... 174 18.2.7. Counters and counter groups ...... 176 18.2.8. Special markup for programs ...... 178 18.2.9. Specialmarkupforsessions ...... 178 18.3. Standardenvironments ...... 179 18.3.1. Definingnewenvironments ...... 179 18.3.2. Mathematical environments ...... 180 18.3.3. Theorem-like environments ...... 181 18.3.3.1. Using the theorem-like environments ...... 181 18.3.3.2. Customization of the theorem-like environments ...... 181 18.3.4. Environments for floating objects ...... 182 18.3.4.1. Using the environments for floating objects ...... 182 18.3.4.2. Customization of the environments for floating objects ...... 183 18.4. Headersandfooters ...... 183 18.4.1. Standardtitles ...... 183 18.4.1.1. Entering titles and abstracts ...... 183 18.4.1.2. Customizing the global rendering of titles ...... 185 18.4.1.3. Customizing the rendering of title fields ...... 186 18.4.2. Standardheaders ...... 188 18.5. LATEXstylesections ...... 188 18.5.1. Usingsectionaltags ...... 188 18.5.2. Customization of the sectional tags ...... 189 18.5.3. Helper macros for rendering section titles ...... 190
19. Compatibility with other formats ...... 193 19.1. Converters for LATEX ...... 193 19.1.1. Introduction ...... 193 A 19.1.2. Conversion from TEXMACS to L TEX ...... 194 A 19.1.3. Conversion from L TEX to TEXMACS ...... 195 19.1.4. Limitations of the current LATEXconverters ...... 196 A Limitations of the TEXMACS to L TEX converter ...... 196 A Limitations of the L TEX to TEXMACS converter ...... 197 19.2. Converters for Html and MathML ...... 197 Html generation ...... 197 Customized Html generation ...... 197 Htmlimportation ...... 198 19.3. Adding new data formats and converters ...... 198 Declaringnewformats ...... 198 Declaringnewconverters ...... 199
Appendix A. Configuration of TEXMACS ...... 201 A.1. Userpreferences ...... 201 A.2. Keyboardconfiguration ...... 202 Standardconformance ...... 202 Potentialconflicts ...... 203 System-wide shortcuts which may take precedence ...... 203 User-definedshortcuts ...... 204 A.3. Notes for users of Cyrillic languages ...... 204 Table of contents 9
A.4. Notes for users of oriental languages ...... 206
Appendix B. About GNU TEXMACS -1.0.7.17 ...... 207 B.1. Summary ...... 207 B.2. The philosophy behind TEXMACS ...... 207 B.2.1. A short description of GNU TEXMACS ...... 207 B.2.2. Why freedom is important for scientists ...... 208 B.3. The authors of TEXMACS ...... 208 B.3.1. Developers of TEXMACS ...... 208 B.3.2. Authors and maintainers of plugins for TEXMACS ...... 210 B.3.3. Administration of TEXMACS andmaterialsupport ...... 211 B.3.4. Porting TEXMACS tootherplatforms ...... 211 B.3.5. Contributors to TEXMACS packages ...... 212 B.3.6. Internationalization of TEXMACS ...... 212 B.3.7. Othercontributors ...... 213 B.3.8. Contactingus ...... 214 B.4. Important changes in TEXMACS ...... 215 B.4.1. Improved spacing inside formulas (1.0.7.10) ...... 215 B.4.2. Auto-matching brackets (1.0.7.9) ...... 215 B.4.3. More context dependent interface (1.0.7.8) ...... 216 B.4.4. Default look and feel (1.0.7.7) ...... 216 B.4.5. Linkingtool(1.0.6.3) ...... 216 B.4.6. Type 1 fonts become the default (1.0.5.10) ...... 216 B.4.7. New multi-part document mechanism (1.0.5.6 – 1.0.5.7) ...... 217 B.4.8. Improved scheme interface (1.0.5.1 – 1.0.5.6) ...... 217 B.4.9. Improved titles (1.0.4.1) ...... 217 B.4.10. Improved style sheets and source editing mode (1.0.3.5) ...... 217 B.4.11. Renaming of tags and environment variables (1.0.2.7 – 1.0.2.8) . . . . . 217 B.4.12. Macro expansion (1.0.2.3 – 1.0.2.7) ...... 217 B.4.13. Formatting tags (1.0.2 – 1.0.2.1) ...... 218 B.4.14. Keyboard (1.0.0.11 – 1.0.1) ...... 218 B.4.15. Menus(1.0.0.7–1.0.1) ...... 218 B.4.16. Stylefiles(1.0.0.4) ...... 219 B.4.17. Tabular material (0.3.5) ...... 219 B.4.18. Documentformat(0.3.4) ...... 219
Appendix C. Contributing to GNU TEXMACS ...... 221
C.1. Use TEXMACS ...... 221 C.2. Making donations to the TEXMACS project ...... 221 Making donations to TeXmacs through the SPI organization . . . . . 221 Detailsonhowtodonatemoney ...... 221 Importantnotes ...... 222 C.3. Contribute to the GNU TEXMACS documentation ...... 222 C.3.1. Introduction on how to contribute ...... 222 C.3.2. Using SVN ...... 223 C.3.3. Conventions for the names of files ...... 223 C.3.4. Specifying meta information for documentation files ...... 223 C.3.5. Traversing the TEXMACS documentation ...... 224 C.3.6. Usingthetmdocstyle ...... 224 C.3.6.1. Explanations of macros, environment variables, and so on ...... 225 10 Table of contents
C.3.6.2. Graphical user interface related markup ...... 225 C.3.6.3. Commonannotations ...... 226 C.3.6.4. Miscellaneous markup ...... 226 C.4. Internationalization ...... 227 C.5. Writingdataconverters ...... 227 C.6. Porting TEXMACS tootherplatforms ...... 227 C.7. Interfacing TEXMACS withothersystems ...... 228 C.8. TEXMACS over the network and over the web ...... 228 C.9. Become a TEXMACS developer ...... 228
Appendix D. Interfacing TEXMACS with other programs ..... 229 D.1. Introduction ...... 229 D.2. Basicinput/outputusingpipes ...... 229 D.3. Formatted and structured output ...... 231 The formula plug-in ...... 231 The markup plug-in ...... 232 D.4. Output channels, prompts and default input ...... 233 The prompt plug-in ...... 233 D.5. Sending commands to TEXMACS ...... 234 The menus plug-in ...... 234 D.6. Backgroundevaluations ...... 235 The substitute plug-in ...... 235 The secure plug-in ...... 236 D.7. Mathematical and customized input ...... 237 The input plug-in ...... 237 D.8. Tab-completion ...... 239 The complete plug-in ...... 240 D.9. Dynamiclibraries ...... 241 The dynlink plug-in ...... 242 D.10. Miscellaneousfeatures ...... 243 Interrupts ...... 243 Testing whether the input is complete ...... 243 D.11. Writingdocumentation ...... 244 D.12. Plansforthefuture ...... 244
Index ...... 245 Chapter 1 Getting started
1.1. Conventions for this manual
Menu entries.
Throughout the TEXMACS manual, menu entries will be typeset using a sans serif font, like in Document, File Load or Format Font shape Italic. → → → Keyboard modifiers.
TEXMACS makes use of the following keyboard modifiers:
ç . For shift key combinations.
. For control key combinations.
% . For alternate key combinations.
. For meta key combinations.
ç X
For instance, stands for the action which consists of simultaneously pressing the
ç X three keys , and .
Keyboard shortcuts.
More complex keyboard shortcuts are obtain by pressing several keys or “modified keys” in