0% found this document useful (0 votes)
13 views209 pages

LyX User Guide

The LYX User's Guide provides comprehensive instructions for using LYX version 2.4.x, covering topics from basic setup to advanced document formatting. It includes sections on file operations, editing features, document types, and typography. Users are encouraged to provide feedback or corrections to the documentation via the provided mailing list.

Uploaded by

AJ Rush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views209 pages

LyX User Guide

The LYX User's Guide provides comprehensive instructions for using LYX version 2.4.x, covering topics from basic setup to advanced document formatting. It includes sections on file operations, editing features, document types, and typography. Users are encouraged to provide feedback or corrections to the documentation via the provided mailing list.

Uploaded by

AJ Rush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 209

The LYX User’s Guide

by the LYX Team∗

Version 2.4.x

May 13, 2024

∗ Ifyou have comments on or error corrections to this documentation, please send them
to the LYX Documentation mailing list: [email protected]
Contents
1. Getting Started 1
1.1. What is LYX? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2. How LYX Looks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3. HELP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4. Basic LYX Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.5. LATEX Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2. How to work with LYX 3


2.1. Basic File Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2. Safety Nets: Rescuing Files If Things Go Awry . . . . . . . . . . . . . 4
2.2.1. Backup Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.2. Auto-Save Snapshots . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.3. Emergency Files . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.4. Backup Files from Old LYX Versions . . . . . . . . . . . . . . 5
2.2.5. When to Use Which File? . . . . . . . . . . . . . . . . . . . . 5
2.3. Basic Editing Features . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.4. Undo and Redo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5. Mouse Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.6. Navigating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.6.1. The Outliner . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.6.2. Horizontal Scrolling . . . . . . . . . . . . . . . . . . . . . . . . 10
2.7. Input/Word Completion . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.8. Basic Key Bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3. LYX Basics 15
3.1. Document Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.2. Document Classes . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.3. Document Layout . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.1.4. Paper Size and Orientation . . . . . . . . . . . . . . . . . . . 19
3.1.5. Margins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.1.6. Important Note . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2. Paragraph Indentation and Separation . . . . . . . . . . . . . . . . . 20
3.2.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.2. Paragraph Separation . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.3. Fine-Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

i
Contents

3.2.4. Line Spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . 21


3.3. Paragraph Environments . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3.2. Standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3.3. Document Title . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3.4. Headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3.5. Quotes and Poetry . . . . . . . . . . . . . . . . . . . . . . . . 25
3.3.6. Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.3.7. Customized Lists . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3.8. Letters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.3.9. Academic Writing . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.3.10. Special Environments . . . . . . . . . . . . . . . . . . . . . . . 35
3.4. Nesting Environments . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.4.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.4.2. What You Can and Can’t Nest . . . . . . . . . . . . . . . . . 38
3.4.3. Nesting Other Things: Tables, Math, Floats, etc. . . . . . . . 39
3.4.4. Usage and General Features . . . . . . . . . . . . . . . . . . . 41
3.4.5. Some Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.4.6. Separate Nestings . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.5. Spacing, Pagination and Line Breaks . . . . . . . . . . . . . . . . . . 46
3.5.1. Non-Breaking Space . . . . . . . . . . . . . . . . . . . . . . . 46
3.5.2. Horizontal Space . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.5.3. Vertical Space . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.5.4. Paragraph Alignment . . . . . . . . . . . . . . . . . . . . . . . 50
3.5.5. Forced Page Breaks . . . . . . . . . . . . . . . . . . . . . . . . 50
3.5.6. Forced Line Breaks . . . . . . . . . . . . . . . . . . . . . . . . 51
3.5.7. Horizontal Lines . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.6. Characters and Symbols . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.7. Fonts and Text Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.7.1. Font Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.7.2. LATEX font support . . . . . . . . . . . . . . . . . . . . . . . . 53
3.7.3. Document Font and Font size . . . . . . . . . . . . . . . . . . 54
3.7.4. Math Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.7.5. Using Different Text Styles . . . . . . . . . . . . . . . . . . . . 56
3.7.6. Tweaking Text with the Text Properties Dialog . . . . . . . . 59
3.8. Printing and Previewing . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.8.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.8.2. Output file formats . . . . . . . . . . . . . . . . . . . . . . . . 63
3.8.3. Previewing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.9. A few Words about Typography . . . . . . . . . . . . . . . . . . . . . 66
3.9.1. Hyphens, Dashes and Minus Signs . . . . . . . . . . . . . . . . 66
3.9.2. Dashes and Line Breaks . . . . . . . . . . . . . . . . . . . . . 67
3.9.3. Hyphenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.9.4. Punctuation Marks . . . . . . . . . . . . . . . . . . . . . . . . 70

ii
Contents

3.9.5. Ligatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.9.6. LYX and LATEX Logos . . . . . . . . . . . . . . . . . . . . . . . 73
3.9.7. Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.9.8. Widows and Orphans . . . . . . . . . . . . . . . . . . . . . . . 73

4. Notes, Graphics, Tables and Floats 75


4.1. Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4.2. Footnotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4.3. Marginal Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
4.4. Graphics and Images . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
4.4.1. Image Formats . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4.4.2. Grouping of Image Settings . . . . . . . . . . . . . . . . . . . 78
4.5. Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
4.5.1. Table Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
4.5.2. Multi-page Tables . . . . . . . . . . . . . . . . . . . . . . . . . 79
4.5.3. Table Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
4.6. Floats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
4.6.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
4.6.2. Figure Floats . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
4.6.3. Table Floats . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.6.4. More Information . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.7. Minipages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

5. Mathematical Formulas 87
5.1. Basic Math Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.1.1. Navigating in Formulas . . . . . . . . . . . . . . . . . . . . . . 87
5.1.2. Selecting Text . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.1.3. Exponents and Subscripts . . . . . . . . . . . . . . . . . . . . 88
5.1.4. Fractions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.1.5. Roots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.1.6. Operators with Limits . . . . . . . . . . . . . . . . . . . . . . 89
5.1.7. Math Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.1.8. Altering Spacing . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.1.9. Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.1.10. Accents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.2. Brackets and Delimiters . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.3. Arrays and Multi-line Equations . . . . . . . . . . . . . . . . . . . . . 92
5.4. Formula Numbering and Referencing . . . . . . . . . . . . . . . . . . 93
5.5. User defined math macros . . . . . . . . . . . . . . . . . . . . . . . . 94
5.6. Fine-Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.6.1. Typefaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.6.2. Math Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5.6.3. Font Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

iii
Contents

5.7. AMS-LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
5.7.1. Enabling AMS-Support . . . . . . . . . . . . . . . . . . . . . . 96
5.7.2. AMS-Formula Types . . . . . . . . . . . . . . . . . . . . . . . 96

6. More Tools 97
6.1. Cross-References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.2. Table of Contents and other Listings . . . . . . . . . . . . . . . . . . 99
6.2.1. Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . 99
6.2.2. List of Figures, Tables, Listings and Algorithms . . . . . . . . 100
6.3. URLs and Hyperlinks . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
6.3.1. URLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
6.3.2. Hyperlinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
6.4. Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
6.5. Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
6.6. Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
6.6.1. The Bibliography Environment . . . . . . . . . . . . . . . . . 102
6.6.2. Bibliography databases . . . . . . . . . . . . . . . . . . . . . . 104
6.6.3. Opening cited documents from within LYX . . . . . . . . . . . 108
6.7. Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
6.7.1. Grouping Index Entries . . . . . . . . . . . . . . . . . . . . . . 109
6.7.2. Page Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
6.7.3. Cross Referencing . . . . . . . . . . . . . . . . . . . . . . . . . 110
6.7.4. Index Entry Order . . . . . . . . . . . . . . . . . . . . . . . . 111
6.7.5. Index Entry Formatting . . . . . . . . . . . . . . . . . . . . . 111
6.7.6. Special Characters in Index Entries . . . . . . . . . . . . . . . 112
6.7.7. Convenience Functions for Index Handling . . . . . . . . . . . 112
6.7.8. Index Processor . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6.7.9. Multiple Indexes . . . . . . . . . . . . . . . . . . . . . . . . . 114
6.8. Nomenclature/Glossary . . . . . . . . . . . . . . . . . . . . . . . . . 114
6.8.1. Nomenclature Definition and Layout . . . . . . . . . . . . . . 115
6.8.2. Sort Order of Nomenclature Entries . . . . . . . . . . . . . . . 115
6.8.3. Nomenclature Options . . . . . . . . . . . . . . . . . . . . . . 116
6.8.4. Printing the Nomenclature . . . . . . . . . . . . . . . . . . . . 117
6.8.5. Nomenclature Program . . . . . . . . . . . . . . . . . . . . . . 117
6.9. Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
6.10. PDF Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
6.11. TEX Code and the LATEX Syntax . . . . . . . . . . . . . . . . . . . . . 121
6.11.1. TEX Code Boxes . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.11.2. The LATEX Syntax . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.12. Customized Page Headers and Footers . . . . . . . . . . . . . . . . . 123
6.12.1. Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
6.12.2. Default header/footer . . . . . . . . . . . . . . . . . . . . . . . 124
6.12.3. Appearance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
6.12.4. This example . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

iv
Contents

6.13. Previewing Snippets of your Document . . . . . . . . . . . . . . . . . 126


6.13.1. Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
6.13.2. Enabling previews . . . . . . . . . . . . . . . . . . . . . . . . 126
6.13.3. Selected document parts . . . . . . . . . . . . . . . . . . . . . 126
6.13.4. LATEX source code . . . . . . . . . . . . . . . . . . . . . . . . . 127
6.14. Advanced Find and Replace . . . . . . . . . . . . . . . . . . . . . . . 127
6.14.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
6.14.2. Basic usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
6.15. Spell Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
6.15.1. Further Settings . . . . . . . . . . . . . . . . . . . . . . . . . . 131
6.16. Thesaurus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
6.16.1. Setting up the thesaurus . . . . . . . . . . . . . . . . . . . . . 132
6.16.2. Using the thesaurus . . . . . . . . . . . . . . . . . . . . . . . . 133
6.17. Change Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
6.18. Comparison of Documents . . . . . . . . . . . . . . . . . . . . . . . . 135
6.19. International Support . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
6.19.1. Language Options . . . . . . . . . . . . . . . . . . . . . . . . . 135
6.19.2. Keyboard mapping configuration . . . . . . . . . . . . . . . . 136

A. The User Interface 137


A.1. The File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
A.1.1. New . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
A.1.2. New from Template . . . . . . . . . . . . . . . . . . . . . . . . 137
A.1.3. Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
A.1.4. Open Recent . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
A.1.5. Open Example . . . . . . . . . . . . . . . . . . . . . . . . . . 137
A.1.6. Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
A.1.7. Close All . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
A.1.8. Save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
A.1.9. Save As . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
A.1.10. Save As Template . . . . . . . . . . . . . . . . . . . . . . . . . 138
A.1.11. Save All . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
A.1.12. Revert to saved . . . . . . . . . . . . . . . . . . . . . . . . . . 138
A.1.13. Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . 138
A.1.14. Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
A.1.15. Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
A.1.16. Fax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
A.1.17. New and Close Window . . . . . . . . . . . . . . . . . . . . . 141
A.1.18. Exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
A.2. The Edit Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
A.2.1. Undo and Redo . . . . . . . . . . . . . . . . . . . . . . . . . . 141
A.2.2. Cut, Copy, Paste, Paste Recent, Paste Special . . . . . . . . . 141
A.2.3. Select Whole Inset . . . . . . . . . . . . . . . . . . . . . . . . 142
A.2.4. Select All . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

v
Contents

A.2.5. Find & Replace (Quick) . . . . . . . . . . . . . . . . . . . . . 142


A.2.6. Find & Replace (Advanced) . . . . . . . . . . . . . . . . . . . 142
A.2.7. Move Paragraph Up/Down . . . . . . . . . . . . . . . . . . . . 142
A.2.8. Paragraph Settings . . . . . . . . . . . . . . . . . . . . . . . . 142
A.2.9. Text Properties . . . . . . . . . . . . . . . . . . . . . . . . . . 142
A.2.10. Custom Text Styles . . . . . . . . . . . . . . . . . . . . . . . . 143
A.2.11. Table and Rows & Columns . . . . . . . . . . . . . . . . . . . 143
A.2.12. Dissolve Inset . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
A.2.13. Settings or Math . . . . . . . . . . . . . . . . . . . . . . . . . 143
A.2.14. Increase/Decrease List Depth . . . . . . . . . . . . . . . . . . 143
A.3. The View Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
A.3.1. Open/Close all Insets . . . . . . . . . . . . . . . . . . . . . . . 143
A.3.2. Unfold/Fold Math Macros . . . . . . . . . . . . . . . . . . . . 143
A.3.3. Outline Pane . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
A.3.4. Source Pane . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
A.3.5. Messages Pane . . . . . . . . . . . . . . . . . . . . . . . . . . 144
A.3.6. Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
A.3.7. Split View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
A.3.8. Close Current View . . . . . . . . . . . . . . . . . . . . . . . . 145
A.3.9. Fullscreen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
A.4. The Insert Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
A.4.1. Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
A.4.2. Special Character . . . . . . . . . . . . . . . . . . . . . . . . . 145
A.4.3. Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
A.4.4. Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
A.4.5. List/Contents/References . . . . . . . . . . . . . . . . . . . . 147
A.4.6. Float . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
A.4.7. Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
A.4.8. Branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
A.4.9. Custom Insets . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
A.4.10. File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
A.4.11. Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
A.4.12. Citation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
A.4.13. Cross-Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 148
A.4.14. Label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
A.4.15. Caption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
A.4.16. Index Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
A.4.17. Nomenclature Entry . . . . . . . . . . . . . . . . . . . . . . . 149
A.4.18. Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
A.4.19. Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
A.4.20. URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
A.4.21. Hyperlink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
A.4.22. Footnote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
A.4.23. Marginal Note . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

vi
Contents

A.4.24. Separate <Name> (Above/Below) . . . . . . . . . . . . . . . 150


A.4.25. Short Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
A.4.26. TEX Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
A.4.27. Program Listing . . . . . . . . . . . . . . . . . . . . . . . . . . 150
A.4.28. Preview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
A.5. The Navigate Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
A.5.1. Bookmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
A.5.2. Next Note, Change, Cross-reference . . . . . . . . . . . . . . . 151
A.5.3. Go to Label . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
A.5.4. Forward Search . . . . . . . . . . . . . . . . . . . . . . . . . . 151
A.6. The Document Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
A.6.1. Change Tracking . . . . . . . . . . . . . . . . . . . . . . . . . 151
A.6.2. LaTeX Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
A.6.3. Start Appendix Here . . . . . . . . . . . . . . . . . . . . . . . 152
A.6.4. View [<output format>] . . . . . . . . . . . . . . . . . . . . . 152
A.6.5. View (Other Formats) . . . . . . . . . . . . . . . . . . . . . . 152
A.6.6. Update [<output format>] . . . . . . . . . . . . . . . . . . . . 152
A.6.7. Update (Other Formats) . . . . . . . . . . . . . . . . . . . . . 152
A.6.8. View Master Document . . . . . . . . . . . . . . . . . . . . . 153
A.6.9. Update Master Document . . . . . . . . . . . . . . . . . . . . 153
A.6.10. Compressed . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
A.6.11. Disable Editing . . . . . . . . . . . . . . . . . . . . . . . . . . 153
A.6.12. Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
A.7. The Tools Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
A.7.1. Spellchecker . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
A.7.2. Thesaurus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
A.7.3. Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
A.7.4. Check TeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
A.7.5. TeX Information . . . . . . . . . . . . . . . . . . . . . . . . . 154
A.7.6. Compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
A.7.7. Reconfigure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
A.7.8. Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
A.8. The Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
A.9. Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
A.9.1. Standard Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . 155
A.9.2. Extra Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
A.9.3. View/Update Toolbar . . . . . . . . . . . . . . . . . . . . . . 157
A.9.4. Other Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . 158

B. The Document Settings 159


B.1. Document Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
B.2. Child Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
B.3. Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
B.4. Local Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

vii
Contents

B.5. Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160


B.6. Text Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
B.7. Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
B.8. Page Margins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
B.9. Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
B.10.Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
B.11.Change Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
B.12.Numbering & TOC . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
B.13.Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
B.14.Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
B.15.PDF Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
B.16.Math Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
B.17.Float Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
B.18.Listings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
B.19.Bullets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
B.20.Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
B.21.Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
B.22.LaTeX Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

C. The Preferences Dialog 171


C.1. Look and Feel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
C.1.1. User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
C.1.2. Document Handling . . . . . . . . . . . . . . . . . . . . . . . 172
C.1.3. Screen Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
C.1.4. Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
C.1.5. Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
C.2. Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
C.2.1. Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
C.2.2. Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
C.2.3. Keyboard/Mouse . . . . . . . . . . . . . . . . . . . . . . . . . 176
C.2.4. Input Completion . . . . . . . . . . . . . . . . . . . . . . . . . 177
C.3. Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
C.4. Identity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
C.5. Language Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
C.5.1. Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
C.5.2. Spellchecker . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
C.6. Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
C.6.1. General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
C.6.2. LaTeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
C.7. File Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
C.7.1. Converters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
C.7.2. File Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182

D. Units available in LYX 183

viii
Contents

Bibliography 185

Bibliography 2 189

Index 193

ix
1. Getting Started

1.1. What is LYX?


LYX is a document preparation system. It is a tool for producing beautiful manu-
scripts, publishable books, business letters and proposals, even poetry. It is unlike
most other “word processors” in the sense that it uses the paradigm of a markup
language as its core editing style. That means that when you type a section header,
you mark it as a “Section”, not as “Bold, 17 pt type, left justified, 5 mm space below”.
LYX takes care of the typesetting for you; so you deal only with concepts, not with
mechanics.
This philosophy is explained in greater detail in the Introduction manual. If you
haven’t read it yet, you need to. Yes, we mean now.
The Introduction manual describes several things in addition to LYX’s philosophy:
most importantly, the format of all of the manuals. If you don’t read it, you will have
a difficult time navigating the manuals. Additionally it provides a high level content
description of the other manuals giving the user an idea of where to look for specific
information.

1.2. How LYX Looks


Like most applications, LYX has the familiar menu bar across the top of its window.
Below it is a toolbar with a pulldown box and various buttons. There is of course a
work area for editing documents complete with a vertical scrollbar.
Note that there is no horizontal scrollbar. This is not a bug or an oversight, it is
intentional. When you read a book, you expect the end of a line to wrap around to
the next line. Text overflows onto new pages in a vertical fashion, hence the need for
only a vertical scrollbar.
There are three cases where you might want a horizontal scrollbar. The first case
is large images. To avoid images being displayed larger than your screen, left click
on the image and use the option Scale on Screen in the tab LATEX and LYX options.
The second and third cases are tables and equations which are wider than the LYX
window. You can use the arrow keys to scroll horizontally through both.

1
CHAPTER 1. GETTING STARTED

For a brief description of all LYX menus and toolbar buttons, have a look at Ap-
pendix A.

1.3. HELP
The help system consists of the LYX manuals. You can read all of the manuals from
inside LYX. Just select the manual you want to read from the Help menu.

1.4. Basic LYX Setup


Almost all features of LYX can be configured via the menu Tools ▷ Preferences. LYX
is able to inspect your system to see what programs, LATEX document classes, and
LATEX packages are available. It uses this knowledge to give reasonable defaults for
the preferences settings. Although this configuration was performed when LYX was
installed on your system, you might have some items that you installed locally, e. g.
new LATEX classes, which are not seen by LYX. To force LYX to re-inspect your system
use Tools ▷ Reconfigure. Then restart LYX to ensure that the changes are taken into
account.

1.5. LATEX Setup


You can edit documents in LYX without having LATEX installed but you will not be
able to create PDFs. Even without LATEX every LYX document can still be output as
plain text, as Docbook or as XHTML.
Some document classes may depend upon specific LATEX classes or packages. Such
document classes can be used even if you do not have the required files installed, but
you will not be able to produce certain kinds of output.
The LATEX packages that LYX finds on your system are listed in a file you can view
from the menu Help ▷ LaTeX Configuration. If you are missing needed packages then
you must install them and then reconfigure LYX (menu Tools ▷ Reconfigure). See
section Installing new LATEX files in the Customization manual for more information
on installing additional LATEX packages.

2
2. How to work with LYX

2.1. Basic File Operations


Under the File menu and in the standard toolbar are basic operations common to any
word processor as well as some more advanced operations:
• New, Ctrl+N or
• New from Template, Ctrl+Maj+N
• Open, Ctrl+O or
• Open Recent
• Open Example
• Close, Ctrl+W
• Close All
• Save, Ctrl+S or
• Save As, Ctrl+Maj+S
• Save As Template
• Save all
• Revert to saved
• Exit, Ctrl+Q
They all do pretty much the same thing as other word processors, with a few minor
differences. The File ▷ New from Template command lists the available templates. Se-
lecting a template will automatically set certain layout features and possibly propose
text fragments for the document, features and text you would otherwise need to set
or enter manually. They can be of use for certain classes, especially those for writing
letters (see section 3.1.2). You can also add your own templates to this list by means
of storing a LYX file with the File ▷ Save As Template function.
Note: There is no “default file” or document named “Untitled” or “scratch.” Unless
you tell LYX to open a file or create a new one, that big blank space on the screen is
just that — a big blank space.

3
CHAPTER 2. HOW TO WORK WITH LYX

Revert to saved and Version Control are useful if multiple people work on the same
document at the same time.1 Revert to saved will reload the document from disk.
You can of course also use it if you regret that you changed a document and want to
restore it to the last saved version. With Version Control you can register the changes
you made to a document so that others can identify them as your changes.

2.2. Safety Nets: Rescuing Files If Things Go Awry


LYX lays much stress on safety. We know how much effort you invest in your work,
and thus the last thing we want is that this work gets lost. However, we cannot
completely prevent bad things from happening: LYX might crash (although we put
in all effort that it doesn’t), you might face a power outage while you are working
on a document with unsaved changes, disks might get corrupt or files might get lost
or damaged during synchronization or simply because you deleted it by mistake. For
such cases, LYX provides a multi-layered safety net that will hopefully prevent you
from major hassles. This means that LYX does not simply make a backup file, it
makes several such files that might be useful in different scenarios. Parts of this
multi-layered net can be switched off, if you prefer to go a bit more risky over having
multiple files (see section C.1.2.2), but all measures are on by default to provide you
with most possible security.

In what follows, we elaborate on the diverse files and when they might become useful.

2.2.1. Backup Files


By default, LYX makes backup copies of files when they are saved. Normally, these
files are stored in the same directory than the original file and with the same file
name but the extension .lyx~ (e. g., myfile.lyx~). If you prefer to have all backups
in a central place (and maybe on a separate disk), you can specify a Backup Path in
preferences (see section C.3), then all backups are stored there. In order to prevent
file name clashes, the files then do not simply have the original file name, but also
the path in their name, separated by “!” (e. g., !home!paula!work!myfile.lyx~).

Note that some file managers hide backup files by default, and you need to enable
“Show hidden files” in order to see them.

Backup files provide the latest saved version of a document. They are never deleted
by LYX, but overwritten if new changes are saved in the original file.

1
If you plan to do this, you should check out the Version Control feature in LYX. Refer to section
Version Control in LYX in the Additional Features help manual.

4
2.2. SAFETY NETS: RESCUING FILES IF THINGS GO AWRY

2.2.2. Auto-Save Snapshots


By default, LYX also makes automatic snapshots of all opened documents that have
unsaved changes in a regular time interval (which can be adjusted in preferences, see
section C.1.2.2). As opposed to the backup files, these also contain unsaved changes
and thus might be newer than the backups.
These files are always stored in the same directory than the original file and with the
same name, but embraced by “#” (e. g., #myfile.lyx#). Auto-save snapshots are
deleted when a document is closed normally, i. e., with all changes saved. They are
left on disk in case of non-normal termination (e. g., program crash or power outage),
and this is when they might become useful.

2.2.3. Emergency Files


If LYX crashes and documents have unsaved changes, the program furthermore tries
to write an emergency file, which is a version of the document containing all unsaved
changes, even those that have been made after the latest snapshot.
These files are always stored in the same directory than the original file and with
the same name but the extension .lyx.emergency (e. g., myfile.lyx.emergency).
When the respective document is reopened with LYX next time, the application
recognizes the emergency file and asks you whether it should try to recover your file
to that last state. If you agree, it will do so, and if this succeeds it will ask you next
whether the emergency file can be deleted. Agree on this only after you checked that
everything has been correctly recovered!

2.2.4. Backup Files from Old LYX Versions


If you open a LYX document for the first time with a new major version of LYX, it
gets converted to the new file format (allowing for new features). In such cases, LYX
keeps a copy of the old version, named as <filename>-lyxformat-<n>.lyx, where
<n> is the old format (e. g., myfile-lyxformat-474.lyx). Those files are stored at
the same location than the backup files, that is alongside the original document or,
if specified, in the backup directory.
As with backup files, these files are never deleted by LYX.

2.2.5. When to Use Which File?


Now why all these files? Because they have different purposes. Generally spoken:
If LYX terminates unexpectedly,

5
CHAPTER 2. HOW TO WORK WITH LYX

1. first try to restore from the emergency file (by reopening the document in LYX).
This file has the latest changes, even changes you made after the last auto-save
snapshot has been made.
2. If the rescue file way did not work because there is no rescue file (e. g., after
a power outage) or the rescue file is damaged (it might happen in mean cases
that the rescue files contains just that latest addition that makes LYX crash!),
look if there is an auto-save snapshot. If so, remove the trailing # so that the
file can be opened with LYX (not the first # in order to keep the original file
until you checked the snapshot) and see if that works for you. If so, you will
have lost five minutes of work in the worst case (with the default settings at
least).
3. If there is no auto-save snapshot or this one is garbled as well, use the backup
file. It does not have all the unsaved changes, but it might still be the most
recent you can get. This is particularly the case if the original file itself got lost
or is damaged.
The fourth type of file, the backup file from old versions, is useful if the conversion
process did not work and results in a non-working document (although we put in all
efforts to prevent this) or if you mistakenly opened and saved a document with a
newer version (such as a development version) and actually want to keep on using
the old version.
So much for the safety net. We hope you will not need it, but if so, that it catches
you as high up as possible. Now let us return to the actual writing process.

2.3. Basic Editing Features


Like most modern word processors, LYX can perform cut and paste operations on
blocks of text, can move by character, word, or page of text, and can delete whole
words as well as individual characters. The next four sections cover the basic LYX
editing features and how to access them. We will start with cut and paste.
As you might expect, the Edit menu and the standard toolbar have the cut and paste
commands, along with various other editing features. Some of these are special and
covered in later sections. The basic ones are:
• Cut, Ctrl+X or
• Copy, Ctrl+C or
• Paste, Ctrl+V or
• Paste Recent
• Paste Special

6
2.3. BASIC EDITING FEATURES

• Find & Replace, Ctrl+F or


The first three are self-explanatory. You can also copy text between LYX and other
programs using Cut, Copy and Paste. Cut and Copy put two versions of text into the
clipboard (formatted and unformatted) so that other programs can choose the most
suitable form. Paste supports formatted and unformatted text as well as graphics.
It tries to interpret the clipboard contents in an intelligent way. For example if
the clipboard contains text in a Comma Separated Values (CSV) format and the
cursor is inside a table, the text will be pasted into individual cells. The submenu
of Paste Recent shows you a list of the last several strings you have pasted. You can
insert one at the current cursor position by clicking on a list entry.
The submenu Paste Special may also contain optional items for specific formats de-
pending on the clipboard contents. Possible formats include HTML, LATEX, PDF,
Linkback PDF2 , PNG, JPEG and EMF. These menu items are useful if the clip-
board contains the same contents in different formats and you want to select one
format explicitly. (E. g. some programs put an image into the clipboard as graphics
and as a short text which is often meaningless.)
The menu item Paste Special ▷ Plain Text, Join Lines is equivalent to Paste with the
only difference being that it acts on text only. It will paste the text in the clipboard
such that the whole text selection is inserted as one paragraph. A new paragraph is
only started where there is a blank line in the text. Without Join Lines, line breaks
in the text will start a new paragraph. This is useful when copying contents of
tables from webpages to a table in LYX. The items Paste Special ▷ Selection, Join Lines
and Paste Special ▷ Selection paste from the primary selection. This is normally the
currently selected text.
The Edit ▷ Find & Replace item opens the Find and Replace widget. Once you have
found a word or expression, LYX selects it. You can click the Find > button (or the
Return key or the F3 shortcut) to skip the currently selected word, or < Find (or
Shift+Return or the Maj+F3 shortcut) to search backwards. Even if you close the
widget, F3 and Maj+F3 will search further.
Hitting the Replace button replaces the selected text with the contents of the Re-
place with field and searches the next match. Hit Replace All to replace all occurrences
of the text in the document automatically.
Furthermore, the following options are available:
• Case sensitive can be used if you want the search to consider the case of the
search word. If the toggle is set, searching for “Test” will not match the word
“test”.
• Whole words can be used to force LYX to only find complete words, e. g. search-
ing for “star” will not match “starlet”.
2
OS X only

7
CHAPTER 2. HOW TO WORK WITH LYX

• Selection only will limit search and replace, or replace all, to the current cursor
selection.
• Search as you type starts searching (forwards) immediately on input, without
pressing the Find > key.
• Wrap starts from the beginning/end of the document if the end/beginning has
been reached without asking. If this is not checked, a dialog will pop up asking
you what to do. Note that responding to this dialog makes the cursor leave the
search widget, so you need to put it back manually.
The widget also has a Minimize button that lets you shrink the widget to only the first
row (the search widget), hiding replace and options. If done so, an Expand button
brings you back to the full size.
LYX also offers an advanced Find & Replace feature that is described in section 6.14.
Things like notes, floats, etc. (the so called “insets”) can be dissolved. This means
that the inset is deleted and its content is left as normal text. Dissolving an inset is
done by setting the cursor to the beginning of an inset and pressing Backspace or by
setting the cursor to the end and pressing Delete.
Using the shortcut Ctrl+A while the cursor is in normal text selects the whole doc-
ument. When the cursor is inside an inset Ctrl+A selects the content of the inset.
Using Ctrl+A consecutively will increase the selection scope to the whole inset and
then to the whole document. The shortcut Ctrl+Alt+A selects the whole document
in every case and puts the cursor to the end of the document.

2.4. Undo and Redo


If you make a mistake, you can easily recover from it. LYX has a large-capacity
undo/redo buffer. Select Edit ▷ Undo or the toolbar button to undo a mistake. If
you accidentally undo too much, use Edit ▷ Redo or the toolbar button to “undo the
undo.” The undo mechanism is currently limited to 100 steps to minimize memory
overhead.
Undo and Redo work on almost everything in LYX. However they will not undo or
redo text character by character, but by blocks of text.

2.5. Mouse Operations


These are the most basic mouse operations.
1. Motion

8
2.6. NAVIGATING

• Click the left mouse button once anywhere in the edit window. The cursor
moves to the text under the mouse.
2. Selecting Text
• Hold down the left mouse button and drag the mouse. LYX highlights the
text between the old and new mouse positions. Use Edit ▷ Copy to create
a copy of the text in LYX’s buffer (and the clipboard). You can also use
the context menu triggered by right clicking on the selected text.
• Re-position the cursor and then paste the text back into LYX using Edit ▷
Paste.
3. Insets (Footnotes, Notes, Floats, etc.)
Right-click on them to set their properties. Check the appropriate section of
this manual for more details.

2.6. Navigating
LYX offers you several ways to navigate in documents:
• The Navigate menu lists all sections of the document as submenu entries that
you can click to jump to the corresponding document part.
• The “Outline”, which is accessed either by the menu View ▷ Outline Pane or by
the toolbar button .
• You can set bookmarks in your document under Navigate ▷ Bookmarks and use
the same menu to return to them. Note that bookmarks are saved between
sessions.
The toolbar button (also Navigate ▷ Bookmarks ▷ Navigate Back) jumps to the po-
sition in the document where you recently changed something. This is useful when
you have a large document and have navigated or scrolled to another document part
to look for something and want to go back to your last editing position.
By pressing the F5 key the cursor will be vertically centered in LYX’s main window.

2.6.1. The Outliner


In the pull-down box at the top of the outline window you can choose between
several different lists including other TOC-like objects such as lists of tables and
figures, footnotes, labels and cross-references (see section 6.1), notes, or citations (see
section 6.6). Clicking on any of these will take you to the corresponding object in
your document.

9
CHAPTER 2. HOW TO WORK WITH LYX

In many cases right clicking on elements in the Outline opens a context menu that
will allow for direct modification of those elements. For example with citations, the
context menu allows you to open the citation dialog and to modify the citation.
The Filter field at the top allows you to filter which entries appear in the outline. For
example, if you are displaying the list of Labels and References and wish to see only
references to subsections, you can enter the text “sub” in the filter and only entries
containing that text will be displayed.
At the bottom of the outline are several buttons that allow you to further control the
display. The Sort option sorts the current list alphabetically. Otherwise the elements
appear in the order in which they occur in the document. The Keep option keeps
it in the current view state. Keeping means that when you have the subsections of
sections 2 and 4 displayed and click on section 3, the subsections of sections 2 and 4
will still be displayed. Without the Keep option they will be hidden to highlight the
clicked section 3. Finally, the slider at the left can be used to open the Outline to a
given “depth”. It is best just to experiment with it to see how it works.
The button refreshes the TOC (useful while editing if you have changed sections
in the document). Next to it are buttons that allow you to change the position of
sections in your document. The and buttons move sections up and down in
the document. For example, you can move section 2.5 before section 2.4 or after sec-
tion 2.6. LYX will then automatically renumber the sections to the new order. With
the buttons and (or the corresponding key bindings Tab and Shift-Tab) you can
change the level of sections. You can make section 2.5 chapter 3 or subsection 2.4.1.
By right-clicking on a section in the outliner you can select the whole section to copy,
cut or delete it.

2.6.2. Horizontal Scrolling


LYX does not have a horizontal scrollbar because standard output page formats such
as ISO A4 are not as wide as PC or laptop screens. Therefore you will have trouble
with the output of your document if document parts exceed the width of the LYX
main screen.
There are of course exceptions where horizontal scrolling is necessary. For example
• LYX is used on a small tablet computer
• Wide tables that are rotated 90° to fit a whole page3
• Math constructs with long command names
For these cases LYX has an mechanism that scrolls automatically when the cursor is
moved. As an example shrink the LYX window so that table 2.1 is wider. You will
3
See section Rotated Floats of the Embedded Objects manual.

10
2.7. INPUT/WORD COMPLETION

now see a dotted red line on the right and/or left side of the table. Put the cursor into
the table and move it with the Tab or the arrow keys to see the horizontal scrolling
of the table.

Table 2.1.: Horizontal scrolling test.

a b c

2.7. Input/Word Completion


LYX provides completion of words by scanning all documents that are currently
opened. Every word that appears in these documents is added to a database that is
used to propose completions.

Input completion can be activated in the LYX preferences (menu Tools ▷ Preferences)
in the section Editing ▷ Input Completion. With the option Automatic inline comple-
tion the proposed completion is shown directly after the cursor. With the option
Automatic popup the completions are always shown in a popup. The cursor com-
pletion indicator can be turned off by deselecting the option Cursor indicator. With
the general options you can define the delay time for the inline and popup comple-
tion, you can set the minimal number of characters a word must have that it will be
taken into account for a completion and you can choose if long completions should
be abbreviated.

LYX displays a small triangle after the cursor as an indicator that there are com-
pletions available. Press the Tab key to accept a proposed completion. If several
completions are possible, a popup is opened showing them. You can select a comple-
tion in the popup using the mouse or the arrow keys and accept the chosen completion
by pressing Return.

The completion options for math in the preferences do the same as the correspond-
ing options for text. Additionally, the special math option Autocorrection enables
characters to be composed. For example, if you want to insert the character ⇒, you
can input the characters “=>” in a formula to create it. This is a quick alternative
to the insertion of commands or the use of the math toolbar. A list of supported
character combinations can be found in the file autocorrect located in LYX’s instal-
lation folder. Note that using Undo after autocorrection has done its magic leaves
the un-corrected sequence. In the example above, Undo leads to “=>”, and a second
Undo yields “=”.

11
CHAPTER 2. HOW TO WORK WITH LYX

2.8. Basic Key Bindings


There are at least two different primary binding maps: cua and emacs. LYX’s default
is cua, which can be changed in the LYX preferences under Editing ▷ Shortcuts. (You
can list or change any key bindings as explained in section C.2.2.1.)
Some keys, like Page Up, Page Down, Left, Right, Up and Down, do exactly what you
expect them to do. Other keys don’t:
Tab There is no such thing as a tab stop in LYX. If you do not understand
this, go read sections 3.2.1 and 3.3, especially section 3.3.6, right now. Yes,
right now. If you are still confused, look in the Tutorial.
In LYX the Tab key is only used to accept proposed input completions, to
move the cursor in tables or math matrices or to change the nesting level
in Itemize or Enumerate.
Esc This is the “cancel key.” It is used, generically, to cancel operations. Other
parts of the manual will go into greater detail about this.
Home/End These move the cursor, respectively, to the beginning and end of a line,
unless you are using the Emacs bindings where they jump to the beginning
or end of the file.
There are three modifier keys:
Control (Denoted by “Ctrl” in the documentation files) This has a couple of different
uses depending on which keys it is used in combination with:
• Backspace or Delete, it deletes an entire word instead of a single char-
acter.
• Left and Right, it moves by words instead of characters.
• Home and End, it moves to the beginning and the end of the document,
respectively.
Shift (Denoted by “Shift” in the documentation files) Use this with any of the
arrow keys to select the text between the old and new cursor positions.
Alt (Denoted by “Alt” in the documentation files) This is the Alt key on many
keyboards, unless your keyboard has a distinct Meta key. If you have both
keys, you will need to try out which one actually performs the Alt+ func-
tion.
This key does many different things, but it also activates the menu ac-
celerator keys. If you use this in combination with any of the underlined
letters in a menu or menu item, it selects that menu item.
For example, the sequence “Alt e s c” brings up the “Text Style” dialog.
Typing “Alt f” opens the File menu.

12
2.8. BASIC KEY BINDINGS

The Shortcuts manual lists all other things bound to the Alt key.
You will learn more key bindings and short-cut keys as you use LYX because most
actions will prompt a small message in the status bar at the bottom of LYX’s main
window describing the name of the action you have just triggered and any existing key
bindings for that action. LYX menus also list the defined key bindings. The notation
for the key bindings is very similar to the notation used in this documentation so you
should not have any problems understanding it. However notice that Shift-modifiers
are explicitly mentioned, so “Alt+P Shift+A” means Alt+P followed by a capital A.

13
3. LYX Basics

3.1. Document Types


3.1.1. Introduction
Before you do anything else, before you ever start writing a document, you need to
decide what type of document you want to edit. Different types of documents use
different types of spacing, headings, numbering schemes, and so on. Additionally,
different documents use different paragraph environments, and format the title of
your document differently.
A document class describes a group of properties common to a particular set of
documents. By setting the document class, you automatically select these properties,
making it easier to create the type of document you want. If you don’t choose a
document class, LYX picks one for you by default. So it is up to you to change the
class of your document.

3.1.2. Document Classes


You can select a class using the Document ▷ Settings ▷ Document Class dialog. Select
the class you want to use, and make any fine tunings of the options you may need.

3.1.2.1. Overview
There are four standard document classes in LYX. They are:
Article for basic articles
Report for basic reports
Book for writing a book
Letter for US-style letters
There are also some non-standard classes, which LYX only uses if you have installed
the corresponding LATEX class files, though most LATEX distributions will include many
of these. Here are some of the classes. The full list with detailed explanations can
be found in chapter Special Document Classes in the Additional Features manual:

15
CHAPTER 3. LYX BASICS

A&A Journal articles in the style and format used in Astronomy & Astrophysics
AMS Layouts for articles and books in the style and format used by the American
Mathematical Society (AMS). There are three article layouts available. The
standard one uses a typical numbering scheme for theorems etc., that prepends
the section number to the number of the result. All result-type statements
(propositions, corollaries, and so on) are sequenced together, but definitions,
examples, and the like have their own sequence. The “sequential numbering”
scheme does not place the section number with each result, but numbers them
throughout the article in a single sequence. Each type of result gets its own
sequence. There is also a layout that dispenses with numbering of statements
altogether.
Beamer Layout for presentations
Broadway Layout for writing plays. It is not an existing LATEX document class, but
a new one that is distributed with LYX.
Chess Layout to write about chess games
Curriculum vitae classes to create curriculum vitae
Elsevier Layout for journals of the Elsevier publishing group
Foils Used to make transparencies
Hollywood Used to type spec scripts for the US film industry. It is not an existing
LATEX document class, but a new one that is distributed with LYX.
Kluwer Layout for journals of the Kluwer publishing group
KOMA-Script a replacement for the standard classes, offers many useful features
like caption formatting, automatic print space calculation etc. (Is used by this
document.)
Memoir another replacement for the standard classes
Powerdot Layout for presentations
REVTeX is used to write articles for the publications of the American Physical
Society (APS), American Institute of Physics (AIP), and Optical Society of
America (OSA). This class is not completely compatible with all LYX features.
Slides Used to make transparencies
Springer Layouts for journals of the Springer publishing group
We will not go into detail about how to use these different document classes here.
You can find details about the non-standard classes in chapter Document Classes of
the Additional Features manual. Here, we will settle for a list of some of the common
properties of all of the document classes.

16
3.1. DOCUMENT TYPES

3.1.2.2. Availability
You will probably find that many of the document classes listed under Document ▷
Settings ▷ Document Class are marked as “Unavailable”. If you open a document that
uses such a class, you will receive a warning saying that there are files that are
required to produce output that are not installed. So it may seem that something is
wrong.
Nothing is wrong. LYX includes many more document classes than you will ever
need to use, and some of them are highly specialized. LYX tries to support as many
different types of documents as possible, and it includes almost one hundred different
layout files, with a growing number. No LATEX distribution will install by default all
files that might be needed by some document class. There are just too many of them.
That is why some of the document classes are unavailable.
If there is a document class you would like to use that is marked as “Unavailable”,
you just need to install the appropriate package files. The easiest way to find out
which files you need to install is to use that document class for a new file. LYX will
display a dialog that will list the missing files. See section Installing new LATEX files
in of the Customization manual for information on how to install them.

Although LYX provides support for many different sorts of documents, it does not
include support for every document class people might want to use. For example,
many universities provide LATEX class files to be used for dissertations submitted to
those universities. The LYX team cannot write layout files to support every one
of these. There are too many. Fortunately, users can write their own layout files,
and many users have done so. Chapter Installing New Document Classes of the
Customization manual contains information on how to create layout files.

3.1.2.3. Modules
Modules load additional features that are not by default available in the chosen
document class. For example you might want to write Braille (embossed printing)
in a document. This is not available in any document class, so you have to load
the corresponding module in the Modules section of the Document ▷ Settings dialog.
Highlighting a module in the dialog will bring up a description of what it does.
Some modules require LATEX packages or file format converters that are not always
installed by default. LYX will warn you if you do not have a required package or
converter, and it will tell you what exactly you are missing. You can still use the
module while editing your file, but you will not be able to export to PDF or print
your document, since LYX will not be able to compile the LATEX file without the
missing prerequisites. If you want to be able to produce this kind of output, then you
need to install the missing prerequisites and then reconfigure LYX by selecting Tools ▷
Reconfigure. See section Installing new LATEX files of the Customization manual for
more information on installing required packages.

17
CHAPTER 3. LYX BASICS

Note: Some modules require other modules, and some pairs of modules are incom-
patible. LYX will advise you about these things.

3.1.2.4. Local Layout


Modules are to LYX much as packages are to LATEX: They are intended to be used in
a variety of different documents. If you often find yourself needing the same sort of
thing in different documents, you should consider writing a module for this purpose.
Sometimes, however, a particular document has very special needs, but you need
a specific inset or text style only that one time. You want something that is like
a document’s own LATEX preamble. What you want is LYX’s “Local Layout”. See
section Local Layout of the Customization manual for information on how to use it.

3.1.2.5. Properties
Each class has a default set of options. Here’s a quick table describing them:

Page style Sides Columns Max. sectioning level


article Plain One One Section
report Plain One One Chapter
book Headings Two One Chapter
letter Plain One One none

You’re probably also wondering what “Max. sectioning level” means. There are
several paragraph environments used to create section headings. Different document
classes allow different types of section headings. Only two use the Chapter heading;
the rest do not and begin instead with the Section heading. Some document classes,
such as the ones for letters, don’t use any section headings. In addition to Chapter
and Section headings, there are also Subsection headings, Subsubsection headings, and
so on. We will describe these headings fully in section 3.3.4.

3.1.3. Document Layout


The most important properties of document classes are set in the menu Document ▷
Settings. There in the Class options field under Documents Class, you can enter special
options for your document class in a comma-separated list. This is only necessary if
LYX doesn’t support special options you want to use for your document. To learn
more about your favorite LATEX-class and its options, you have to read its manual.
The drop box Page style in the Document ▷ Settings dialog under Page Layout controls
what sorts of headings and page numbers go on a page. You can choose between the
following five options:

18
3.1. DOCUMENT TYPES

Default Use default page style of current class.


empty No page numbers or headings.
plain Page numbers only.
headings Page numbers and either the current chapter or section title and number.
Whether LYX uses the current chapter or the current section depends on
the maximum sectioning level of the class.
fancy This allows you to define fully customizable headers and footers if you have
the LATEX-package fancyhdr installed. How they are defined is explained
in section 6.12.
The separation of paragraphs is described in section 3.2.2.

3.1.4. Paper Size and Orientation


You can find the following options in the menu Page Layout of the Document ▷ Settings
dialog:
Paper Format What size paper to print on. The choices are
• Default
• A0 – A6
• B0 – B6
• C0 – C6
• US letter, US legal, US executive
• JIS B0 – JIS B6
• Custom
Orientation To choose whether to output as Landscape or as Portrait.
Two-sided document Adjusts the print space to print both sides of paper. That means
that the print space for odd- and even-numbered pages is different.

3.1.5. Margins
Paper margins are set in the menu Document ▷ Settings.
If you use a KOMA-Script document class, you can use the default settings because
KOMA-Script calculates the print space automatically by taking the paper format
and the font size into account.

19
CHAPTER 3. LYX BASICS

3.1.6. Important Note


If you change a document class, LYX has to convert everything into the new class.
That includes the paragraph environments. Some paragraph environments are stan-
dard, in so far as all of the document classes have them; but some classes have special
paragraph environments. If this is the case, and you change the document class, LYX
will mark the paragraphs whose styles it no longer understands as “unknown”. The
name of the style is retained, in case you should want to go back to the old class.
But these paragraphs will be output with no special formatting, so you will either
need to create a new style yourself or else convert these paragraphs manually to a
style present in your new document class.

3.2. Paragraph Indentation and Separation


3.2.1. Introduction
Before describing all of the various paragraph environments, we’d like to say a word
or two about paragraph indentation.
Everyone seems to have their own convention for separating paragraphs. Most Amer-
icans indent the first line of a paragraph. Others don’t indent but put extra space
between the paragraphs. If you choose indentation for paragraphs the first paragraph
of a section, or after a figure, an equation, a table, a list, etc., is not indented. Only
a paragraph following another paragraph gets indented. Note that the indentation
behavior is different when you use another document language than English. LATEX
takes care that the indentation follows the rules of the language used.
The space between paragraphs, like the line spacing, the space between headings and
text — in fact, all the spacing for just about everything —is pre-coded into LYX. As
we said, you don’t worry about how much space to add between what. LYX takes
care of that. In fact, these pre-coded vertical spacings aren’t a single number but a
range. That way, LYX can squish or stretch the space between lines to make sure
figures fit on a page with text, so that sections don’t start at the bottom of a page,
and so on.1 However, pre-coded doesn’t mean you can’t change them. LYX gives
you the ability globally to change all these pre-coded spacings. We will explain more
later.

3.2.2. Paragraph Separation


Select Indentation or Vertical space in the submenu Text Layout of the dialog Doc-
ument ▷ Settings to indent paragraphs or to add extra space between paragraphs,
respectively.
LT
1 A
EX does this when LYX goes to produce a printable file.

20
3.3. PARAGRAPH ENVIRONMENTS

3.2.3. Fine-Tuning
You can also change the separation method of a single paragraph. Open the Edit ▷
Paragraph Settings dialog and toggle the Indent Paragraph option to change the state
of the current paragraph (shortcut Alt+A I). If paragraphs have no indentation but
use extra space for separation, this button will be ignored (you can’t indent a single
paragraph by toggling this).
You should only need to change the indentation method for a single paragraph if you
need to do some fine-tuning.

3.2.4. Line Spacing


In the Document ▷ Settings dialog you can set the line spacing for the whole document
in the submenu Text Layout.2 You can set it for a single paragraph in the Edit ▷
Paragraph Settings dialog but this should be used very exceptionally because vertical
spacing is normally defined in the environment’s style.

3.3. Paragraph Environments


3.3.1. Overview
Paragraph environments correspond to the
\begin{environment} . . . \end{environment}
command sequence in LATEX files. If you don’t know LATEX, or the concept of a
paragraph environment is totally alien to you, we urge you to read the Tutorial. The
Tutorial also contains many more examples than this section does.
A paragraph environment is simply a “container” for a paragraph which gives that
paragraph certain properties. This can include a particular style of font, different
margins, a numbering scheme, labels, and so on. Additionally, you can “nest” the
different environments inside one another, allowing one environment to inherit some
of the properties of another. The different paragraph environments totally replace
the need for messy tab stops, on the fly margin adjustment, and other hangovers from
the days of typewriters. There are several paragraph environments that are specific
to a particular document type. We will only be covering the most common ones here.

To choose a new paragraph environment, use the pull-down box at the


left end of the toolbar. LYX will change the environment of the entire paragraph in
which the cursor sits. You can also change the environment of an entire group of
paragraphs if you select them before choosing the new environment.
2
You need to have the LATEX-package setspace installed to use this feature.

21
CHAPTER 3. LYX BASICS

Note that entering Return will typically create a new paragraph using the Standard
paragraph environment. We say “typically” because if you are in one of these envi-
ronments:
• Quote
• Quotation
• Verse
• Itemize
• Enumerate
• Description
• List
LYX keeps the old paragraph environment when you enter Return, rather than re-
setting it to Standard. Also the nesting depth is preserved (for more on nesting see
section 3.4).

3.3.2. Standard
The default paragraph environment is Standard for most classes. It creates a plain
paragraph. If LYX resets the paragraph environment, this is the one it chooses. In
fact, the paragraph you’re reading right now (and most of the ones in this manual)
are in the Standard environment.
You can nest a paragraph using the Standard environment in just about anything
else, but you can’t really nest anything in a Standard environment.

3.3.3. Document Title


A LATEX title page has three parts: the title itself, the name(s) of the author(s) and a
“footnote” for thanks or contact information. For certain types of documents, LATEX
places all of this on a separate page along with today’s date. For other types of
documents, the title “page” goes at the top of the first page of the document.
LYX provides an interface to the title page commands through the paragraph envi-
ronments Title, Author, and Date. Here’s how you use them:
• Put the title of your document in the Title environment.
• Put the author name in the Author environment.
• If you want the date to have a certain appearance, want to use a fixed date, or
want other text to appear in place of today’s date, put that text in the Date
environment. Note that using this environment is optional. If you don’t provide

22
3.3. PARAGRAPH ENVIRONMENTS

any, LATEX will automatically insert today’s date. If you don’t want a date, use
the option Suppress default date on front page in the menu Document ▷ Settings ▷
Document class.
You can use footnotes to insert “thanks” or contact information.

3.3.4. Headings
There are several paragraph environments for producing section headings. LYX takes
care of the numbering for you.

3.3.4.1. Numbered Headings


There are 7 numbered types of section headings. They are:
1. Part
2. Chapter
3. Section
4. Subsection
5. Subsubsection
6. Paragraph
7. Subparagraph
LYX labels each heading with a series of numbers, separated by periods. The num-
bers describe where in the document you are. Unlike the other headings, parts are
numbered with Roman numerals.
Headings all subdivide your document into different pieces of text. For example,
suppose you’re writing a book. You group the book into chapters. LYX does a
similar grouping:
• Part is divided into either Chapters or Sections
• Chapters are divided into Sections
• Sections are divided into Subsections
• Subsections are divided into Subsubsections
• Subsubsections are divided into Paragraphs
• Paragraphs are divided into Subparagraphs
Note: Not all document types use the Chapter heading as the maximum sectioning
level. In that case the Section is the top-level heading.

23
CHAPTER 3. LYX BASICS

So, if you use the Subsubsection environment to label a new sub-subsection, LYX
labels it with its number, along with the number of the subsection, section and, if
applicable, chapter that it’s in. For example: the fifth section of the second chapter
of this book has the label “2.5”.

3.3.4.2. Unnumbered Headings


The unnumbered section headings have a “*” at the end of their name. They work
the same as their numbered counterparts but will not appear in the table of contents,
see section 6.2.

3.3.4.3. Changing the Numbering


You can also alter which sectioning levels get numbered and which ones appear in
the Table of Contents. Now, this doesn’t remove any of the levels; that’s preset
in the document class. Just as certain classes start with Chapter and go down to
the Subparagraph level. Others start at Section. Similarly, not all document classes
number all sectioning levels. Most don’t number Paragraph or Subparagraph. This is
something you can change.
Open the Document ▷ Settings dialog. Under Numbering & TOC you will see two
counters. The one named Numbering controls how far down in the sectioning hierarchy
LYX numbers a section heading. The other one controls the appearance of the section
headings in the table of contents.

3.3.4.4. Short Titles of Headings


Some section or chapter titles, such as this one, can get quite long. This can cause
trouble when there is limited horizontal space. For example, if the header of the
page is set to show the current section title, a long title will protrude over the page
margins and look awful.
LATEX allows you to specify a short title for section headings. This short title is used
in the header and in the actual table of contents, avoiding the problem mentioned.
To specify a short title, set the cursor behind the title and use the menu Insert ▷
Short Title. This will insert a box labeled “Short Title” which you can use to enter
the short title text. This also works for captions inside floats. There can only be one
short title per title.
The title of this section is a good example of using this feature.

3.3.4.5. Special Information


The following information applies to all section headings:

24
3.3. PARAGRAPH ENVIRONMENTS

• You cannot do any nesting with these environments.


• You cannot use a margin note in any of these environments.
• You can only use inline math in these environments.
• You can use labels and cross-references to refer to their numbers.

3.3.5. Quotes and Poetry


LYX has three paragraph environments for writing poetry and quotations. They are
Quote, Quotation, and Verse. Forget the days of changing line spacing and twiddling
with margins. These three paragraph environments already have those changes built-
in. They all widen the left margin and add a bit of extra space above and below the
text they contain. They also allow nesting, so you can put a Verse in a Quotation, as
well as in some other paragraph environments.
There is another feature of these three paragraph environments: they do not reset
to Standard when you start a new paragraph. So, you can type in that poem and
merrily enter Return without worrying about the paragraph environment changing on
you. Of course, that means that, once you are done typing in that poem, you have
to change back to the Standard environment yourself.

3.3.5.1. Quote and Quotation


Now that we’ve described the similarities of these three environments, it’s time for
the differences. Quote and Quotation are identical except for one difference: Quote
uses extra spacing to separate paragraphs and never indents the first line. Quotation
always indents the first line of a paragraph and uses the same line spacing throughout.
Here’s an example of the Quote environment:
This is in the Quote environment. I can keep writing, extending this line
out further and further until it wraps. See – no indentation!
Here’s the second paragraph of this quote. Again, there’s no indentation,
but there is extra space between me and the other paragraph.
Here’s another example, this time in the Quotation environment:
This is in the Quotation environment. If I keep writing, you will see
the indentation. If your country uses a writing style that indicates new
paragraphs by indenting the first line, then Quotation is the environment
for you! Well, you’d use it if you were quoting other text.
Here’s a new paragraph. I could ramble on and on, like a politician at
election time. If I did that, though, you’d get bored.

25
CHAPTER 3. LYX BASICS

As the examples show, Quote is for those people who use extra space to separate
paragraphs. They should put quotes in the Quote environment. Those who use in-
dentation to mark a new paragraph should use the Quotation paragraph environment
for quoted text.

3.3.5.2. Verse
Verse is a paragraph environment for poetry, rhymes, verses, and so on. Here’s an
example:
This is in Verse
Which I did not rehearse!
It could be much worse. This line could be long, very long, oh so long,
so very long that it wraps around. It looks okay on screen, but in the
printed version, the extra lines are indented a bit more than the first.
Okay, so it’s turned to prose and doesn’t rhyme anymore. So sue me.
To break a line
And make things look fine
Use Ctrl+Retour.
As you can see, Verse does not indent both margins. Each stanza of the verse or
poem is in its own paragraph. To separate the individual lines of a stanza, use the
shortcut Ctrl+Retour.

3.3.6. Lists
LYX has four different paragraph environments for creating different kinds of lists. In
the Itemize and Enumerate environments, LYX labels your list items with bullets or
numbers, respectively. In the Description and List environments, LYX lets you provide
your own label. We will present the individual details of each type of list next after
describing some general features of all four of them.

3.3.6.1. General Features


The four paragraph environments for lists differ from the other environments in sev-
eral ways. First, LYX treats each paragraph as a list item. Hitting Return does not
reset the environment to Standard but keeps the current environment and creates a
new list item. The nesting depth is thereby kept. If you want to keep the paragraph
environment but reset the current nesting depth, you can use Alt+Retour. If you do
this at the top level of a list, it returns you to the Standard environment.
You can nest lists of any type inside one another. In fact, LYX changes the labels on
some list items depending on how it is nested. If you intend to use any of the list

26
3.3. PARAGRAPH ENVIRONMENTS

paragraph environments, we suggest you read all of section 3.4.

3.3.6.2. Itemize
The first type of list we will describe in detail is the Itemize paragraph environment.
It has the following properties:
• Each item has a particular bullet or symbol as its label.
– LYX uses the same symbol for all of the items in a given nesting level.
– The symbol appears at the beginning of the first line.
• The items can have any length. LYX automatically offsets the left margin of
each item. The offset is always relative to whatever environment the Itemize
list may be in.
• If you nest an Itemize environment inside another Itemize environment, the label
changes to a new symbol.
– There are four different symbols for up to a four-fold nesting.
– LYX always shows the same symbol on screen.
– See section 3.4 for a full explanation of nesting.
Of course, that explanation was also an example of an Itemize list. The Itemize
environment is best suited for lists where the order doesn’t matter.
We said that different levels use different symbols as their label. Here’s an example
of all four possible symbols.
• The label for the first level Itemize is a large black dot, or bullet.
– The label for the second level is a dash.
∗ The label for the third is an asterisk.
· The label for the fourth is a centered dot.
∗ Back out to the third level.
– Back to the second level.
• Back to the outermost level.
These are the default labels for an Itemize list. You can customize how these labels
are displayed in the output in the Document ▷ Settings dialog in the submenu Bullets.
These customizations are not displayed in LYX.
Notice how the space between items decreases with increasing depth. We will explain
nesting and all the tricks you can do with different depths in section 3.4.

27
CHAPTER 3. LYX BASICS

3.3.6.3. Enumerate
The Enumerate environment is used to create numbered lists and outlines. It has
these properties:
1. Each item has a numeral as its label.
a) The label type depends on the nesting depth.
2. LYX automatically counts the items for you and updates the label as appropri-
ate.
3. Each new Enumerate environment resets the counter to one.
4. Like the Itemize environment, the Enumerate environment:
a) Offsets the items relative to the left margin. Items can have any length.
b) Reduces the space between items as the nesting depth increases.
c) Uses different types of labels depending on the nesting depth.
d) Allows up to a four-fold nesting.
Unlike the Itemize environment, Enumerate shows the different labels for each item in
LYX. Here is how LYX labels the four different levels in an Enumerate:
1. The first level of an Enumerate uses Arabic numerals followed by a period.
a) The second level uses lower case letters surrounded by parentheses.
i. The third level uses lower-case Roman numerals followed by a period.
A. The fourth level uses capital letters followed by a period.
B. Again, notice the decrease in the spacing between items as the
nesting depth increases.
ii. Back to the third level
b) Back to the second level.
2. Back to the outermost level.
You can customize the type of numbering used in the Enumerate environment, see
section 3.3.7. Such customization only shows up in the printed version, not in LYX.
There is more to nesting Enumerate environments than we’ve stated here. You should
read section 3.4 to learn more about nesting.

3.3.6.4. Description
Unlike the previous two environments, the Description list has no fixed label. Instead,
LYX uses the first “word” of the first line as the label. Here’s an example:

28
3.3. PARAGRAPH ENVIRONMENTS

Example: This is an example of the Description environment.


LYX typesets the label in boldface and puts extra space between it and the rest of
the line.
With the first “word” it is meant that the first usage of the Space key ends the label
if you are at the beginning of the first line of an item. If you need to use more than
one word in a label use a Non-Breaking Space. (Use either Ctrl+Espace or the menu
Insert ▷ Formatting ▷ Non-Breaking Space; see section 3.5.1 for more information.) Here
is an example:
Second Example: This one shows how to use a Non-Breaking Space in the label of a
Description list item.
Usage: You should use the Description environment for things like definitions and
theorems. Use it when you need to make one word in particular stand out in
the text that describes it. It’s not a good idea to use a Description environment
when you have an entire sentence that you want to describe. You’re better off
using Itemize or Enumerate and nesting several Standard paragraphs into them.
Nesting: You can nest Description environments inside one another, nest them in
other types of lists, and so on.
Notice that after the first line, LYX indents subsequent lines, offsetting them from
the first line.

3.3.6.5. Labeling
The Labeling environment is a LYX extension to LATEX.
Like the Description list the Labeling list has user-defined labels for each list item but
it provides some additional features. Here are its properties:
item labels LYX uses the first “word” of each line as the item label. The first Space
after the beginning of the first line of an item marks the end of the label.
If you need to use more than one word in an item label, use a non-breaking
space as described above.
margins As you can see, LYX uses different margins for the item label and the body
of the item text. The body of the text has a larger left margin, which is
equal to the default label width plus a little extra space.
label width LYX uses the width of the label, or the default width, whatever is larger.
If the label width is larger, the label “extends” into the first line. In other
words, the text of the first line isn’t aligned with the left margin of the
rest of the item text.
default width You can set the default label width to ensure that the text of all items
in a Labeling environment has the same left margin.

29
CHAPTER 3. LYX BASICS

To change the default width, select all items in the list. Now open the
Edit ▷ Paragraph Settings dialog (toolbar button ). The text in the box
Longest label determines the default label width. You can use the text
of your largest label here, but you can also use the letter “M” multiple
times instead. M is the widest character and is a standard unit of widths
in LATEX. By using “M” as the unit of width you don’t need to keep
changing the contents of Longest label every time you alter a label in a List
environment.
The predefined default width is the length of “00.00.0000” (equal to 6 M).
You should use the Labeling list the same way as the Description list: When you need
one word to stand out from the text that describes it. The Labeling environment
gives you another way to do this, using a different overall layout.
You can nest Labeling lists inside one another, nest them in other types of lists, and
so on. They work just like the other list paragraph environments. Read section 3.4
to learn about nesting.
There is yet another feature of the Labeling list: As you can see in the examples,
LYX left-justifies the item labels by default. You can use additional Horizontal Fills
to change how LYX justifies the item label. Horizontal Fills are documented in sec-
tion 3.5.2. Here are some examples:
Left The default for Labeling item labels.
Right One Horizontal Fill at the beginning of the label right justifies it.
Center One Horizontal Fill at the beginning of the label and one at the end centers
it.

3.3.7. Customized Lists


The features described in this section require that the module Customisable Lists
(enumitem) is loaded in the document settings. The module uses the LATEX-package
enumitem.

3.3.7.1. Custom Enumerate Lists


The default numbering of numbered lists can be changed by adding an optional
argument (menu Insert ▷ Enumerate Options) to the first item of each level in the list.
There you add the command
label=\roman{enumi}
in TEX Code (shortcut Ctrl+L).3 enumi is hereby the first level counter of the enu-
meration. The command \roman outputs the counter as a small Roman numeral.
3
For more about TEX Code, look at section 6.11.

30
3.3. PARAGRAPH ENVIRONMENTS

For capital Roman numerals replace \roman with \Roman in the command above.
For Arabic numerals use \arabic. To “number” items with capital or small Latin
letters use \Alph or \alph, respectively.
Note: You can only number 26 items with Latin letters, because this numbering is
limited to single letters.
To change the numbering for the list sublevels, replace the ’i’ in the command by the
small Roman numeral of the level (enumi, enumii, enumiii, enumiv).
Here is a list with custom numbering:
#A# Level 1
A.1 Level 2
A.2 Level 2
1 Level 3
i) Level 4
For this list these commands were used:
label=\#\Alph{enumi}\#
label=\Alph{enumi}.\arabic{enumii}
label=\bfseries{\arabic{enumiii}}
label=\emph{\roman{enumiv})}
where the command \emph{} makes the label emphasized and \bfseries{} makes
it bold.
Note: When you change the label of a list level, it will be used for all following lists
until you change the definition.

3.3.7.2. Resumed Enumeration


Enumerations can be resumed after intermediate paragraphs:
1. first
2. second
regular text
3. resumed
To resume an enumeration, use the style Enumerate-Resume.
Note: If there is no previous enumeration to resume, you will get a LATEX error.
Perhaps you might want to resume the list with a different number from the next one.
Or you want to start a new enumeration with a defined number. This is possible by

31
CHAPTER 3. LYX BASICS

adding an optional argument to the first list item of a normal enumeration. There,
insert the command
start=number
where number is the number with which you want to resume the list. An example:
1. first item
2. second item
Enumeration starting at a given value:
4. This enumeration starts at 4

3.3.7.3. List Spacing


In some cases you might want less or more vertical space between the items of a list.
For example if the default space is too much in your opinion in this case:
• A bullet list
• with standard spacing
You can decrease the space by adding an optional argument to the first item of the
list. Add there the command nolistsep to get no additional list space like in this
example:
• A bullet list
• without additional
• vertical space
To add space you can use several other commands provided by the LATEX-package
enumitem. For more information see its documentation, [17].
There are also many commands available to change the horizontal spacing and in-
dentation. Here is an example where the indentation was changed to that of the
paragraphs in the document and the label separation was set to 2 cm so that the
number is in the page margin:
1. An enumeration
2. with negative indentation

3.3.7.4. Further Customization


You can also change the style of description lists. The command
font=definition
changes the description label font, the command

32
3.3. PARAGRAPH ENVIRONMENTS

style=definition

sets the list style.

An example where the command

font=\itshape, style=nextline

is used:

Ionizing radiation:
Ionizing radiation consists of particles or electromagnetic waves that are ener-
getic enough to detach electrons from atoms or molecules, therefore ionizing
them.

Reference counting:
In computer science, reference counting is a technique of storing the number
of references, pointers, or handles to a resource such as an object, block of
memory, disk space or other resource.

There are many more commands and features provided by the LATEX-package enu-
mitem. For more information see its documentation [17].

3.3.8. Letters
3.3.8.1. Address and Right Address: An Overview
Although LYX has document classes for letters, we’ve also created two paragraph
environments called Address and Right Address. To use the letter class, you need to
use specific paragraph environments in a specific order, otherwise LATEX gags on the
document. In contrast, you can use the Address and Right Address paragraph environ-
ments anywhere with no problem. You can even nest them inside other environments,
though you can’t nest anything in them.

Of course, you’re not limited to using Address and Right Address for letters only.
Right Address, in particular, is useful for creating article titles like those used in some
European academic papers.

3.3.8.2. Usage
The Address environment formats text in the style of an address, which is also used for
the opening and signature in some countries. Similarly, the Right Address environment
formats text in the style of a right-justified address, which is used for the sender’s
address and today’s date in some countries. Here’s an example of each:

33
CHAPTER 3. LYX BASICS

Right Address
Who I am
Where I am
When is it? What is today?

That was Right Address. Notice that the lines all have the same left margin, which
LYX sets to fit the largest block of text on a single line. Here’s an example of the
Address environment:
Who are you
Where do I send this
Your post office and country

As you can see, both Address and Right Address add extra space between themselves
and the next paragraph. If you enter Return in either of these environments, LYX
resets the nesting depth and sets the environment to Standard. This makes sense,
since Return is the paragraph-break function, and the individual lines of an address
are not paragraphs. Thus, you have to use break-line (Ctrl+Retour or Insert ▷
Formatting ▷ Ragged Line Break) to start a new line in an Address or Right Address
environment.

3.3.9. Academic Writing


Most academic writing begins with an abstract and ends with a bibliography or list
of references. LYX contains paragraph environments for both of these.

3.3.9.1. Abstract
The Abstract environment is used for the abstract of an article. Technically, you could
use this environment anywhere, but you really should only use it at the beginning of
the document, after the title. Also, don’t bother trying to nest Abstract in anything
else or vice versa. It will not work. The Abstract environment is only useful in the
article and report document classes. The book document classes ignores the Abstract
completely, and it’s utterly silly to use Abstract in a letter document class.
The Abstract environment does several things for you. First, it puts the centered
label “Abstract” above the text. The label and the text of the abstract are separated
by some extra vertical space. Second, it typesets everything in a smaller font, just as
you’d expect. Lastly, it adds a bit of extra vertical space between the abstract and
the subsequent text. Well, that’s how it will appear on the LYX screen. The actual
appearance in the output depends on the document class you are using.

34
3.3. PARAGRAPH ENVIRONMENTS

Abstract

This is an abstract. As you can see, it is


printed in a smaller font size than the other
paragraph types.
Also several paragraphs are possible in the
abstract.

This is a “Standard” paragraph to visualize the differ-


ences in the font size.

Figure 3.1.: Paragraph in the Abstract environment

Starting a new paragraph by entering Return does not reset the paragraph environ-
ment. The new paragraph will still be in the Abstract environment. So, you will have
to change the paragraph environment yourself when you finish entering the abstract
of your document.

We would love to demonstrate the Abstract environment, but since this document is
in the “book” class, we can’t do this. We inserted it therefore as figure 3.1. If you
have never heard of an “abstract” before, you can safely ignore this environment.

3.3.9.2. Bibliography
The Bibliography environment is used to list references. Technically, you could use this
environment anywhere, but you really should only use it at the end of the document.
Nesting Bibliography in anything else or vice versa will not work.

When you first open a Bibliography environment, LYX adds a large vertical space,
followed by the heading “Bibliography” or “References,” depending on the document
class. The heading is in a large boldface font. Each paragraph of the Bibliography en-
vironment is a bibliography entry. Thus, entering Return does not reset the paragraph
environment. Each new paragraph is still in the Bibliography environment.

There is another, usually better way to include references in your document by using
a BibTEX database. For more information on that, and for a detailed description of
LYX’s bibliography handling, have a look at section 6.6.

3.3.10. Special Environments


LYX provides two environments that can be used to emulate the behavior of a com-
puter console/terminal and a typewriter.

35
CHAPTER 3. LYX BASICS

3.3.10.1. LYX-Code
The LYX-Code environment is a LYX extension. It type-sets text in a typewriter-style
font. It also treats the Space key as a fixed whitespace.4 LYX-Code, Verbatim and
Verbatim* are the only environments in which you can type multiple whitespaces
in LYX. If you need to insert blank lines, you will still need to use Ctrl+Retour
(the break-line function). Return breaks paragraphs. Note, however, that Return
does not reset the paragraph environment. So, when you finish using the LYX-Code
environment, you will need to change the paragraph environment yourself. Also, you
can nest the LYX-Code environment inside of others.
There are a few quirks with this environment:
• You cannot use Ctrl+Retour at the beginning of a new paragraph (i. e. you can’t
follow Return with a Ctrl+Retour).
• You cannot follow a Ctrl+Retour with a Space but with a Ctrl+Espace.
• You cannot have an empty paragraph or an empty line. You must put at least
one Space in any line you want blank. Otherwise, LATEX generates errors.
• You cannot get the typewriter double quotes by typing " since that will insert
real quotes. You get the typewriter double quotes with undefined.
Here is an example:
#include <stdio.h>

int main(void)
{
printf("Hello World!\n");
return 0;
}
This is just the standard “Hello world!” program.
LYX-Code has one purpose: to typeset code, such as program source, shell scripts and
so on. Use it only in those very special cases where you need to generate text as if you
used a typewriter. For longer parts of programming code, use the listings inset that
is described in the chapter Program Code Listings of the Embedded Objects manual.

3.3.10.2. Verbatim
The Verbatim environment is similar to the LYX-Code environment with the difference
that its content will be treated like a computer console text. Verbatim does therefore
not have paragraphs so that Return breaks lines. Compared to LYX-Code the Space
4
In the LYX-Code environment, the Space key is treated as a Non-Breaking Space instead of an
end-of-word marker.

36
3.4. NESTING ENVIRONMENTS

key is treated like a normal space in text (not as a non-breaking space) and you can
have empty lines. In contrary to LYX-Code, Verbatim cannot
• have a certain language and a text style
• contain hyperlinks, boxes, foot- and margin notes, notes, math, citations, index-
and nomenclature entries, labels, tables, graphics, listings, floats and TEX Code
Because of these properties Verbatim works like a typewriter. Here is an example:
This is Verbatim.
The following 2 lines are empty:

Almost everything is allowed in Verbatim:"%&$§#~’‘\}][{|


The Verbatim* environment is identical to Verbatim with the difference that spaces
appear in the output as the character ’␣’. An example:
This␣is␣Verbatim*.

3.4. Nesting Environments


3.4.1. Introduction
LYX treats text as a unified block with a particular context and specific properties.
This allows you to create blocks that inherit some of the properties of another block.
For example you have three main points in an outline, but point #2 also has two
subpoints. In other words, you have a list inside of another list, with the inner list
“attached” to item #2:
1. one
2. two
a) sublist – item #1
b) sublist – item #2
3. three
You put a list inside a list by nesting one list inside the other. Nesting an environment
is quite simple: Select Edit ▷ Increase List Depth or Decrease List Depth to change the
nesting depth (the status bar will tell you how far you are nested). Instead of the
menu, you can also use the toolbar buttons and or the key bindings Tab and
Shift+Tab or Alt+Maj+Droite and Alt+Maj+Gauche. The change will work on the
current selection, if you have made one (allowing you to change the nesting of several
paragraphs at once), or the current paragraph.

37
CHAPTER 3. LYX BASICS

Note that LYX only changes the nesting depth if it can. If it is invalid to do so,
nothing happens if you try to change the depth. Additionally, if you change the
depth of one paragraph, it affects the depth of every paragraph nested inside of it.
Nesting isn’t limited to lists. In LYX, you can nest just about anything inside any-
thing else, as you’re about to find out. This is the real power of nesting paragraph
environments.

3.4.2. What You Can and Can’t Nest


Before we fire a list of paragraph environments at you, we need to tell you a little bit
more about how nesting works.
The question of nesting a paragraph environment is a bit more complicated than a
simple yes or no. There are three types of paragraph environments:
• Completely unnestable
• Fully nestable, you can nest them inside things and you can also nest other
things inside them.
• A third type, you can nest them into other environments, but you can’t nest
anything into them.
Here’s a list of the three types of nesting behavior, and which paragraph environments
have them:
Unnestable Can’t nest them. Can’t nest into them.
• Bibliography
• Abstract
• Title
• Author
• Date
Fully Nestable You can nest them. You can nest other things into them.
• Verse
• Quote
• Quotation
• Itemize
• Enumerate
• Description

38
3.4. NESTING ENVIRONMENTS

• List
• LYX-Code
• Verbatim
• Verbatim*
Nestable-Inside You can nest them inside other things. You can’t nest anything
into them.
• Standard
• Part
• Chapter
• Section
• Subsection
• Subsubsection
• Paragraph
• Subparagraph
• Part*
• Chapter*
• Section*
• Subsection*
• Subsubsection*
• Right Address
• Address
Note: Although it is possible, for example, to nest numbered section headings like
Chapter, Section, etc. into lists, it is highly recommended not to do this because the
aim is to create well-structured documents following typesetting guidelines whereas
nested section headings violate this.

3.4.3. Nesting Other Things: Tables, Math, Floats, etc.


There are several things that aren’t paragraph environments, but which are affected
by nesting anyhow. They are:
• equations
• tables

39
CHAPTER 3. LYX BASICS

• figures
(Note: Figures and tables in Floats are not affected by this. Have a look at section 4.6
for more information about Floats.)
LYX can treat these three objects as either a word or as a paragraph. If a figure,
table, or an equation is inline, it goes wherever the paragraph it is in goes.
On the other hand, if you have an equation, figure or table in a “paragraph” of its
own, it behaves just like a “nestable-inside” paragraph environment. You can nest it
into any environment, but you obviously can’t nest anything into it.
Here’s an example with a table:
1. Item One
a) This is (a) and it’s nested.

a b
c d

b) This is (b). The table is actually nested inside (a).


2. Back out again.
If we hadn’t nested the table at all, the list would look like this:
1. Item One
a) This is (a) and it’s nested.

a b
c d

1. This is (b). The table is not nested inside (a). In fact, it’s not nested at all.
2. Back out again.
Notice how item (b) is not only no longer nested, but is also the first item of a new
list!
There’s another trap you can fall into: Nesting the table, but not going deep enough.
LYX then turns anything after the table into a new sublist.
1. Item One
a) This is (a) and it’s nested.

a b
c d

40
3.4. NESTING ENVIRONMENTS

1. This is (b). The table is actually nested inside Item One, but not inside (a).
2. Back out again.
As you can see, item (b) turned into the first item of a new list, but a new list inside
item 1. The same thing would have happened to a figure or an equation. So, if you
nest tables, figures or equations, make sure you go to the right depth!

3.4.4. Usage and General Features


Speaking of levels, LYX can perform up to a six-fold nesting. In other words, “level
#6” is the innermost possible depth. Here’s an example to illustrate what we mean:
1. level #1 – outermost
a) level #2
i. level #3
A. level #4
• level #5
– level #6
There are two exceptions to the six-fold nesting limit, and you can see both of them
in the example. Unlike the other fully-nestable environments, you can only perform
a four-fold nesting with the Enumerate and Itemize environments. For example, if we
tried to nest another Enumerate list inside item “A.”, we would get errors.

3.4.5. Some Examples


The best way to explain just what you can do with nesting is by illustration. We
have several examples of nested environments. In them, we explain how we created
the example, so that you can reproduce them.

3.4.5.1. Example 1: The Six-fold Way and Mixed Nesting


#1-a This is the outermost level. It’s a List environment.
#2-a This is level #2. We created it by using Alt+Retour followed by Alt+Maj+Droite.
#3-a This is level #3. This time, we just enter Return, then used
Alt+Maj+Droite twice in a row. We could have also created it
the same way as we did the previous level, by entering Alt+Retour
followed by Alt+Maj+Droite.
This is actually a Standard environment, nested inside of “#3-
a”. So, it’s at level #4. We did this by entering Alt+Retour,

41
CHAPTER 3. LYX BASICS

then Alt+Maj+Droite, then changing the paragraph environment


to Standard. Do this to create list items with more than one para-
graph — it also works for the Description, Enumerate, and Itemize
environments!
Here’s another Standard paragraph, also at level #4, made with
just a Alt+Retour.
#4-a This is level #4. We enter Alt+Retour and changed the
paragraph environment back to List. Remember — we can’t
nest anything inside a Standard environment, which is why
we’re still at level #4. However, we can keep nesting things
inside “#3-a”.
#5-a This is level #5. . .
#6-a . . . and this is level #6. By now, you should
know how we made these two.
#5-b Back to level #5. Just enter Alt+Retour followed by
a Alt+Maj+Gauche.
#4-b After another Alt+Retour followed by a Alt+Maj+Gauche,
we’re back at level #4.
#3-b Back to level #3. By now it should be obvious how we did this.
#2-b Back to level #2.
#1-b And last, back to the outermost level, #1. After this sentence, we will enter
Return and change the paragraph environment back to Standard to end the list.
We could have also used the Description, Quote, Quotation, or even the Verse envi-
ronment in place of the List environment. The example would have worked exactly
the same.

3.4.5.2. Example 2: Inheritance


This is the LyX-Code environment, at level #1, the outermost
level. Now we will enter Return, then Alt+Maj+Droite, after
which, we will change to the Enumerate environment.
1. This is the Enumerate environment, at level #2.
2. Notice how the nested Enumerate not only inherits its
margins from its parent environment (LyX-Code), but also
inherits its font and spacing!
We ended this example by entering Return. After that, we needed to reset the para-
graph environment to Standard and reset the nesting depth by using Alt+Maj+Gauche
once.

42
3.4. NESTING ENVIRONMENTS

3.4.5.3. Example 3: Labels, Levels, and the Enumerate and Itemize


Environments
1. This is level #1, in an Enumerate paragraph environment. We’re actually going
to nest a bunch of these.
a) This is level #2. We used Alt+Retour followed by Alt+Maj+Droite. Now,
what happens if we nest an Itemize environment inside of this one? It will
be at level #3, but what will its label be? An asterisk?
• No! It’s a bullet. This is the first Itemize environment, even though
it’s at level #3. So, its label is a bullet. (We got here by using
Alt+Retour, then Alt+Maj+Droite, then changing the environment to
Itemize.)
– Here’s level #4, produced using Alt+Retour, then Alt+Maj+Droite.
We will do that again. . .
i. . . . to get to level #5. This time, however, we also changed
the paragraph environment back to Enumerate. Notice the type
of numbering, it is lowercase Roman, because we are in the
thirdfold Enumerate environment (that is, it is an Enumerate
inside an Enumerate inside an Enumerate).
ii. What happens if we don’t change the paragraph environment,
but decrease the nesting depth? What type of numbering does
LYX use?
iii. Oh, as if you couldn’t guess by now, we’re just using Alt+Retour
to keep the current environment and depth but create a new
item.
iv. Let’s use Alt+Maj+Gauche to decrease the depth after the next
Alt+Retour.
i. This is level #4. Look what type of label LYX is using!
i. This is level #3. Even though we’ve changed levels, LYX is still using
a lowercase Roman numeral as the label.Why?
ii. Because, even though the nesting depth has changed, the paragraph
is still a thirdfold Enumerate environment. Notice, however, that LYX
did reset the counter for the label.
b) Another Alt+Retour Alt+Maj+Gauche sequence, and we’re back to level
#2. This time, we not only changed the nesting depth, but we also moved
back into the twofold-nested Enumerate environment.
2. The same thing happens if we do another Alt+Retour Alt+Maj+Gauche sequence
and return to level #1, the outermost level.

43
CHAPTER 3. LYX BASICS

Lastly, we reset the environment to Standard. As you can see, the level number
doesn’t correspond to what type of labeling LYX uses for the Enumerate and Itemize
environments. The number of other Enumerate environments surrounding it deter-
mines what kind of label LYX uses for an Enumerate item. The same rule applies for
the Itemize environment, as well.

3.4.5.4. Example 4: Going Bonkers


1. We’re going to go totally nuts now. We will not nest as deep as in the other
examples, nor will we go into the same detail with how we did it. (level #1:
Enumerate)
(Return, Alt+Maj+Droite, Standard: level #2) We will stick an encapsulated
description of how we created the example in parentheses someplace. For ex-
ample, the two key bindings are how we changed the depth. The environment
name is the name of the current environment. Either before or after this, we
will put in the level.
2. (Return, Enumerate: level #1) This is the next item in the list.
Now we will add verse.
It will get much worse.
(Return, Alt+Maj+Droite, Verse: level #2)
Fiddle dee, Fiddle doo.
Bippitey boppitey boo!
(Alt+Retour)
Here comes a table:

one-fish two-fish
red-fish blue-fish
(Alt+Retour, Table, Alt+Maj+Droite 3 times, Alt+Retour, Verse,
Alt+Maj+Gauche)
3. (Return, Enumerate: level #1) This is another item. Note that selecting a Table
resets the nesting depth to level #1, so we increased the nesting depth 3 times
to put the table inside the Verse environment.

We’re now ending the Enumerate list and changing to Quotation. We’re
still at level #1. We want to show you some of the things you can do
by mixing environments. The next set of paragraphs is a “quoted letter.”
We will nest both the Address and Right Address environments inside of
this one, then use another nested Quotation for the letter body. We will
use Alt+Retour to preserve the depth. Remember that you need to use

44
3.4. NESTING ENVIRONMENTS

Ctrl+Retour to create multiple lines inside the Address and Right Address
environments. Here it goes:
1234 Nowhere Rd.
Moosegroin, MT 00100
9-6-96

Dear Mr. Fizlewitz:

We regret to inform you that we cannot fill your order for 50 L


of compressed methane gas due to circumstances beyond our
control. Unfortunately, several of our cows have mysteriously
exploded, creating a backlog in our orders for methane. We will
place your name on the waiting list and try to fill your order
as soon as possible. In the meantime, we thank you for your
patience.
We do, however, now have a special on beef. If you are inter-
ested, please return the enclosed pricing and order form with
your order, along with payment.
We thank you again for your patience.
Sincerely,
Bill Hick

That ends that example!


As you can see, nesting environments in LYX gives you a lot of power with just a
few keystrokes. We could have easily nested an Itemize list inside of a Quotation or
Quote, or put a Quote inside of an Itemize list. You have a huge variety of options at
your disposal.

3.4.6. Separate Nestings


It is sometimes necessary to have two consecutive environments of the same type.
For example you need two different enumerations:
1. Hello
a) this is an
i. enumeration
• itemize list
1. Hi
2. this is another

45
CHAPTER 3. LYX BASICS

3. enumeration
To split an existing list into two lists, set the cursor at the end of a list item and
use the menu Insert ▷ Separated <Name> Above or Insert ▷ Separated <Name> Below.
This inserts a plain separator (red line in LYX) and before or behind it the new list.
Inside nested environments, it is also possible to split the outer environment.
By right-clicking on a separator one can change it into a paragraph separator (red
arrow in LyX). The difference between both separator types is that the plain separator
only splits the list and not the current paragraph.
In general, you get an environment separator when you press Retour in a Standard
environment immediately after a non-Standard one.

3.5. Spacing, Pagination and Line Breaks


What is a space? While you might be used to pressing the space key anytime you
want to separate two words in ordinary word processors, LYX offers you more spaces:
spaces of different widths and spaces which can or cannot be broken at the end of
a line. The following sections will show you some examples where those spaces are
useful.

3.5.1. Non-Breaking Space


The non-breaking space: It is used to tell LYX (and LATEX) not to automatically
break the line at that point. This may be necessary to avoid unlucky line breaks, like
in:
Further documentation is given in section
6.6.
Obviously, it would be a good thing to put a non-breaking space between “section”
and “6.6”. A non-breaking space is set with Insert ▷ Formatting ▷ Non-Breaking Space
(shortcut Ctrl+Espace).

3.5.2. Horizontal Space


All horizontal spaces can be inserted with the menu Insert ▷ Formatting ▷ Horizontal
Space. The length units are listed in Appendix D.

3.5.2.1. Normal Space


With the introduction of typewriters, it became conventional in some countries to
type two spaces after a period to mimic the wider spaces used by typesetters at

46
3.5. SPACING, PAGINATION AND LINE BREAKS

the ends of sentences. There is no need to do this as LYX automatically takes care
about this. However, you do not want an end of sentence space after an abbreviation
followed by a period; see section 3.9.4.1 for examples. To insert a normal space, select
Insert ▷ Formatting ▷ Normal Space (shortcut Ctrl+Alt+Espace).

3.5.2.2. Non-Breaking Thin Space


A “non-breaking thin space” is a blank which has half the size of a normal space
(and it is also “non-breaking”). The typographical conventions in a lot of languages
propose the use of thin spaces in cases where normal spaces would be too wide, for
instance, inside abbreviations:
D. E. Knuth has developed our beloved typesetting program.
or between values and units. Compare for example this:
10 kg (thin space)
10 kg (normal space)
You can insert thin spaces with the menu Insert ▷ Formatting ▷ Non-Breaking Thin Space
(shortcut Ctrl+Maj+Espace).

3.5.2.3. More Spaces


You can also insert the following space types:
Medium space A line with a → ← medium space between the arrows.
Thick space A line with a → ← thick space between the arrows.
Negative thin space A line with a →← negative thin space between the arrows.
Negative medium space A line with a →← negative medium space between the
arrows.
Negative thick space A line with a →← negative thick space between the arrows.
Half Quad (0.5 em) A line with an → ← half quad (0.5 em) space between the
arrows.
Quad (1 em) A line with a → ← quad (1 em) space between the arrows.
Double Quad (2 em) A line with a → ← double quad (2 em) space between the
arrows.
Custom space A line with → ← 2 cm space between the arrows.
Table 3.1 lists the different space sizes.

47
CHAPTER 3. LYX BASICS

Table 3.1.: Width of the different horizontal spaces.

Space Width
Normal 1/3 em
Non-breaking Normal 1/3 em
Thin 1/6 em = 3 mu
Medium 4 mu
Thick 5 mu
Negative thin -3 mu
Negative medium -4 mu
Negative thick -5 mu
Half Quad (1/2 em) 1/2 em = 1 en
Quad (1 em) 1 em
Double Quad (2 em) 2 em

3.5.2.4. Horizontal Fills


Horizontal fills (HFills) are a special LYX feature for adding extra space in a uniform
fashion. An Horizontal Fill is actually a variable length space, whose length always
equals the remaining space between the left and right margins. If there is more
than one Horizontal Fill on a line, they divide the available space equally between
themselves.
Here are a few examples of what you can do with them:
This is on the left side This is on the right
Left Middle Right
Left 1/3 Left Right
That was an example in the Quote environment. Here→ ←is one in
a standard paragraph. It may or may not be apparent in the printed text, but it is
sitting in-between the two arrows.
Horizontal Fills can be made visible when you choose one of the Fill Patterns in the
space dialog: The following patterns are available:
Dots: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Rule:
Left arrow: ←−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
Right arrow: −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−→
Down brace (= opened downwards): z }| {

48
3.5. SPACING, PAGINATION AND LINE BREAKS

Up brace (= opened upwards): | {z }

Note: If an Horizontal Fill is at the beginning of a line, and not in the first line in
a paragraph, LYX ignores it. This prevents Horizontal Fills from accidentally being
wrapped onto a new line. If you need space in this case anyway, set the Non-Breaking
option in the space dialog.

3.5.2.5. Phantom Space


Sometimes you want to insert space with exactly the length of a phrase. For example,
you want to create the following multiple choice question:

What is correct English?:

Mr. Edge would have been jumps the gun.


has to be jumped
jumps

so that the choices appear exactly after the phrase “Mr. Edge ”. To get this, you
can use the phantom insets available via the menu Insert ▷ Formatting ▷ Phantom. In
our case insert a horizontal phantom at the beginning of the last two lines and insert
“Mr. Edge ” into the phantom inset (note the space after “Edge”). A phantom
insets prints only the space of its content (like a placeholder). That is why it is
named “phantom”. The normal phantom outputs the width and height of the content
as space, while the horizontal and vertical variant only outputs the corresponding
dimension.

3.5.3. Vertical Space


To add extra vertical space above or below a paragraph, use the Insert ▷ Formatting ▷
Vertical Space dialog. There you find the following sizes:
Small Skip, Medium Skip and Big Skip are LATEX sizes which depend on the font
size of the document. Default Skip is the skip adjusted in the dialog Document ▷
Settings ▷ Text Layout for the paragraph separation. If you use indentation to separate
paragraphs Default Skip is equal to Medium Skip.
Half line height and Line height equal to the height, or half the height, of a line in the
current font size including line spacing.
Vertical Fill is a variable space, set so that the space is maximal within one page. An
example: you have only two short paragraphs on one page with a Vfill between them.
Then the first paragraph is placed at the top of the page and the second one at the
bottom, because the space between them is then maximal. Vertical Fills work like

49
CHAPTER 3. LYX BASICS

Horizontal Fills: they fill the remaining vertical space on a page with blank space.5
If there are several Vertical Fills on a page, they divide the remaining vertical space
equally between themselves. You can therefore use Vertical Fills to center text on a
page, or even place text 2/3 down a page.
Custom are custom spaces in units explained in Appendix D.
Note: If the extra vertical space would be in the output at the top/bottom of a
page, the space is only added if you have also checked the option Protect.

3.5.4. Paragraph Alignment


You can change the paragraph alignment with the Edit ▷ Paragraph Settings dialog
(toolbar button ). There are five possibilities:
• Justified (shortcut Alt+A J)
• Left (Alt+A L)
• Right (Alt+A R)
• Center (Alt+A C)
• Default (Alt+A E)
The default in most cases is justified alignment, in which the inter-word spacing
is variable and each line of a paragraph fills the region between the left and right
margins. The other three alignments should be self-explanatory, and look like this:
This paragraph is right aligned,
this one is centered,
this one is left aligned.

3.5.5. Forced Page Breaks


If you don’t like the way LATEX does the page breaks in your document, you can
force a page break where you want one. Normally this will not be necessary, because
LATEX is good at page breaking. Only if you use a lot of Floats, LATEX’s page breaking
algorithm can fail.
We recommend you not to use forced page breaks until the text is finished and you
have checked in the preview to see if you really have to change the page breaking.
There are two types of page breaks: One that ends the page without any special
action. This can be inserted above or below a paragraph via the menu Insert ▷
Formatting ▷ New Page. The second type, that is inserted via the menu Insert ▷
5
Horizontal Fills are described in section 3.5.2.

50
3.5. SPACING, PAGINATION AND LINE BREAKS

Formatting ▷ Page Break, ends a page but stretches the content of the page, so that
it fills out the complete page. This type is useful to avoid whitespace when a page
break produces a page on which only the last few lines are absent.
You might try to use a page break to ensure that a figure or table appears at the
top of a page. This is, of course, the wrong way to do it. LYX gives you a way of
automatically ensuring that your figures and tables appear at the top of a page (or
the bottom, or on their own page) without having to worry about what precedes or
follows your figure or table. See chapter 4 to learn more about Floats.

3.5.5.1. Clear Page Breaks


Rather than forced page breaks where the content behind the break is placed directly
on the next page, you can also clear pages while breaking them. That means that the
current paragraph is terminated and everything, including unprocessed floats, from
the earlier part of the document are placed after it, if necessary by adding pages.
You can insert a clear page break with the menu Insert ▷ Formatting ▷ Clear Page.
When you have a two-sided document like a book, you can use the menu Insert ▷
Formatting ▷ Clear Double Page to insert a clear page break that assures that the next
page is a right-hand page (odd-numbered), if necessary by adding a page.

3.5.5.2. Suppressing Page Breaks


To discourage page break at a certain point you can use Insert ▷ Formatting ▷ Prevent
Page Break. This is typically useful for paragraphs which should stay together or
when you want to keep close the description for tables and pictures in case using
floats or boxes is not appropriate.

3.5.6. Forced Line Breaks


Similar to page breaks there are two types of line breaks: one simply breaks the line.
You can force this line break within a paragraph by selecting Insert ▷ Formatting ▷
Ragged Line Break or with Ctrl+Retour. Another type that is inserted via the menu
Insert ▷ Formatting ▷ Justified Line Break or with Ctrl+Maj+Retour breaks the line and
stretches it so that it fills out the whole space between the page margins. This is
useful to avoid “fringes” in justified paragraphs due to possible whitespace introduced
by line breaks.
You shouldn’t use forced line breaks to correct LATEX’s line breaking, as LATEX is
very good at line breaking. There are, however, a number of situations where it is
necessary to set a line break actively, for example, in a poem or for an address (see
sections 3.3.5.1, 3.3.5.2 and 3.3.8.2).

51
CHAPTER 3. LYX BASICS

3.5.7. Horizontal Lines

In the dialog Insert ▷ Formatting ▷ Horizontal Line you can insert horizontal lines. The
line offset is the vertical distance between the line and the baseline of the current
text line or the paragraph. The line settings can be changed by left-clicking on the
line.

3.6. Characters and Symbols


You can directly enter all characters that are available on your keyboard. You can
also use special keyboard maps to be able to enter, for example, characters needed
for French with an English keyboard. See section 6.19.2 for information on how this
is done.
For the case where you need a character that is not on your keyboard, you can use
the Symbols dialog via the menu Insert ▷ Special Character ▷ Symbols.
Note: Maybe not all symbols inserted with the symbols dialog can be displayed when
you are using a special screen font in LYX’s preferences. But the inserted symbols
will in every case be displayed in the output.

3.7. Fonts and Text Styles


3.7.1. Font Types
There are two types of fonts:
Vector fonts are built from outlines of the single glyphs (e. g. characters) in the
font. This means that each glyph is defined using mathematical curves that are
well suited for scaling to any requested size. This mathematical definition is
interpreted by the font renderer and the curve is filled out with pixels according
to the size and glyph. This means that vector fonts will look pretty good in
all sizes. Only at very small sizes where each pixel has to be very carefully
computed to provide a good image might it be hard to provide a good rendering.
That could mean that one only needs to define one font size and scale them. But
to achieve a better quality, many fonts define several font sizes. That improves
the appearance because you need more details at large font sizes than at small
ones.
The font types TrueType, OpenType, and Type 1 are vector fonts.

52
3.7. FONTS AND TEXT STYLES

Bitmap fonts on the other hand, are defined by bitmap graphics from the start; so
they will look good at all the sizes they are meant for. However, they don’t
scale well, because in order to scale a glyph, each pixel is enlarged into several
pixels. It is the same effect that happens if you try to enlarge a picture in an
image manipulation program. In order to mitigate this effect, bitmap fonts are
typically provided in several fixed sizes typically from around 8 pixels high up
to 34 pixels or so high in steps according to what is believed to be useful. The
advantage of bitmap fonts is that no complicated computations are necessary to
display each glyph; so bitmap fonts display therefore more quickly than scalable
fonts. The disadvantage is that sizes that don’t exist as fixed versions have to
be scaled by doubling pixels, and thus look bad.
Bitmap fonts are named Type 3 in PostScript- and PDF-documents.
The result of all this is that bitmap fonts are best for the size they are designed
for, while scalable fonts are good for nearly all sizes. So one needs fewer font size
definitions for scalable fonts. That’s the reason why nearly all text rendering and
typesetting programs use scalable fonts.
To see which fonts are used in a PDF-document, look at its document properties.
Many modern typesetting and markup languages have begun to move towards spec-
ifying text styles rather than specifying a particular font. For example, instead of
changing to an italicized version of the current font, to emphasize text you use an
“emphasized style”. This concept fits in perfectly with LYX. In LYX, you do things
based on contexts, rather than focusing on typesetting details.

3.7.2. LATEX font support


Traditionally, LATEX used its own fonts. That is to say, you cannot directly access the
fonts installed on your operating system, but you have to use specific fonts provided
by your LATEX distribution. The reason is that LATEX needs some extra information
about the fonts, which have to be provided by additional files and packages. The
downside of this is that your font choice is somewhat limited compared to a word
processor. On the other hand this comes with the advantage that the provided fonts
are generally of very good quality, and that LATEX files are very portable across differ-
ent machines. Also, the range of fonts supported by traditional LATEX has increased
a lot in the meantime; so you can find packages for many free and commercial fonts.
LYX supports the fonts that are under a free license via the user interface (see sec-
tion 3.7.3 for details). Other fonts are available if you enter the relevant LATEX code
in the document preamble (please refer to the documentation of your desired font).
Recent developments brought some new LATEX engines that are also able directly to
access fonts that are installed for your operating system, namely XeTEX and LuaTEX.
Both engines are supported by LYX. By using them, you can theoretically use any
OpenType or TrueType font that is installed on your system. The next section

53
CHAPTER 3. LYX BASICS

describes how to use these fonts.


Note: In practice, some fonts might fail due to a legacy (non Unicode) font encoding,
bad metrics, or other font deficiencies; so you might have to experiment.

3.7.3. Document Font and Font size


You can set the document fonts in the Document ▷ Settings dialog. In the Fonts section
of the dialog, you can specify which font should be used for the three different font
shapes — roman (serif), sans serif and typewriter (monospaced) — and you can
specify the base font size and scaling factors for (some) sans serif and typewriter
fonts if this is necessary to fit with the roman font.
If you select Use non-TeX fonts, you will have access to the fonts installed on your
operating system. This requires that you use PDF (XeTeX), PDF (LuaTeX) or DVI
(LuaTeX) as the output format, i. e. you will have to have either XeTEX or LuaTEX
installed (see section 3.7.2). You will then not have access to TEX’s own fonts. Note
that LYX then lists all available fonts in each of the three lists (roman, sans serif,
and typewriter), since LYX cannot determine the family. Also note that the output
might fail with some of the listed fonts, due to the encoding of the fonts and/or font
failures. LYX cannot determine this in advance, so you might need to experiment.
If you use TEX fonts (which is the default), the possible options for the font include
Default and a list of fonts available with your LATEX distribution. If you select Default,
the font that is preset by the current document class is used. With LyX’s automatic
font encoding, this is, depending on the document language, either the standard TEX
font “Computer Modern” (cm) or a look-alike of this font: either “cm-super” or the
bitmap font “European Computer Modern” (ec). However, some classes set different
default fonts.
As ec is a bitmap font, it looks pixelated in PDF output, especially when you read
the PDF in a zoomed size.6 To get rid of pixelated fonts, you have to use a vector
font. Depending on how your document should look, you can either:
• select the Latin Modern fonts, which is the recommended choice if you want to
keep the look of cm/ec. Latin Modern was developed for the LATEX community
in order to replace cm as the default font. It covers a huge range of glyphs
and several font shapes. Except for some details, where the appearance was
improved, Latin Modern looks identical to cm.7
• If you do not like the look of cm/ec, you can of course select one of the other
vector fonts provided, e. g. Times Roman or Palatino. Most roman vector fonts
6
This problem is less severe if you read PDFs in Adobe Reader version 6 or later, because this
program includes a special bitmap font renderer.
7
One difference is improved kerning.

54
3.7. FONTS AND TEXT STYLES

will automatically select matching sans serif and typewriter fonts,8 but you can
also select your own.
The differences between roman, sans serif and typewriter fonts are explained
in section 3.7.6.
The font Times Roman was originally designed for newspapers. Its glyphs are
thus smaller than glyphs from other fonts in order to fit into the small newspaper
columns. Therefore Times Roman is not the optimal choice for larger documents
like books.
For the font size there are generally four possible values: Default, 10, 11 and 12.
Some classes provide additional sizes. The size of Default depends on the class you
are using. In the standard classes it is equal to the font size 10.
Note that the font size is the base size. That means that LYX scales all other possible
font sizes (such as those used in footnotes, super-, and subscripts) by this value. You
can fine-tune the font size of text parts via the Text Style dialog if needed. The
possible font sizes for text parts are explained in section 3.7.6.
The Default Family selection lets you specify whether the base font of your document
should be roman, sans serif or typewriter. The Default selection uses what is preset
by the class, the other selections override this. In most cases, Default is equal to
roman, but some classes (such as presentation classes) use other defaults.
The LaTeX font encoding selection is an expert setting which lets you change the
value passed to the LATEX-package fontenc. Normally, you do not need to change
(or even understand) this. Unless you have specific reasons, use Automatic.
With some fonts, the checkboxes Use Old Style Figures and Use True Small Caps are
available. These are extra features some fonts provide. If Use Old Style Figures is
checked, old style figures (also known as medieval or text figures) are used. Old style
figures are the numerals (0 – 9) with ascenders and descenders, which makes them fit
nicely with lowercase letters. Use True Small Caps determines that real small caps are
used instead of faked small caps made of scaled capitals. Real small caps are often
part of expert font sets; they generally look better than faked small caps but might
have to be purchased separately.
Furthermore, with some fonts, you can add additional (comma-separated) options
provided by the font package (or the fontspec package, if you use non-TeX fonts),
into the Options field. This presupposes that you are familiar with the respective
LATEX font package.
The field CJK allows users of the languages Chinese, Japanese, Korean (CJK) to
specify a font to display the script characters.9
8
These are sometimes just matching other fonts (e. g., Times Roman selects Helvetica for sans serif
text), or different shapes of the same font, i. e. a real font family (e. g. in case of Latin Modern
oder Computer Modern).
9
The font will be the argument for the commands of the LATEX-package CJK. So this has no effect

55
CHAPTER 3. LYX BASICS

The option Enable micro-typographic extensions activates extensions such as character


protrusion and font expansion via the LATEX-package microtype.
The option Disallow line breaks after dashes outputs en- and em-dashes as literal
characters10 instead of ligatures (--, ---) (see section 3.9.2).

Note: When you choose a new font or font size, LYX does not change the screen font!
You will only see a difference in the printed output; this is part of the WYSIWYM
concept. LYX’s screen fonts can be adjusted in the Tools ▷ Preferences dialog, see
section C.1.3.

3.7.4. Math Fonts


In LATEX the font used for characters in equations is different from the document
font. For the case that you use TEX fonts for your document, you can explicitly
choose a math font in the dialog Document ▷ Settings. The default setting is that
LYX automatically selects a math font. For most cases this will be LATEX’s default
– the math variant of LATEX’s default font family “Computer Modern”. LYX will
automatically only load another math font if a math variant of the document font is
available.
Note that the math font will not be used for mathematical text (which is inserted
with the shortcut Alt+C Espace or by the insertion of the command \text into a
formula). Also note that some math fonts are sans serif. Your document might
therefore look strange when the document text has serifs while the math characters
do not. Sans serif math fonts make therefore in most cases only sense if you select
Sans Serif for the Default family in the document font settings.
If you use non-TEX fonts for the document, you can only choose for math to use
either the document’s class default TEX font (in most cases “Computer Modern”)
or to use the non-TEX variant of the document’s class default font (in most cases
“Latin Modern”).

3.7.5. Using Different Text Styles


As we’ve already seen, LYX automatically changes the style for certain paragraph
environments. In this section, we will explain how the style of selected text passages
can by changed. This is where we meet the concept of text styles.
By default, LYX supports two text styles, Emphasized and Noun. These are builtin,
i. e., available with all document classes. On top of that, some document classes and

for the document language Japanese that does not use CJK.
10
Or LATEX macro, if the literal character is not supported by the LATEX input encoding.

56
3.7. FONTS AND TEXT STYLES

modules provide custom text styles for specific purposes. We describe both types of
text styles in a minute.

Before we do that, though, allow us just a few words of what we mean by text
styles in contrast to text properties. Traditional word processors used to focus on so-
called formal markup: if you wanted to emphasize a word, you selected it and chose
e. g. “bold style” — you customized the text properties. Modern processors, LYX
among them, encourage the use of semantic (or logical) markup instead (although
formal markup is still possible; see section 3.7.6). Rather than fiddling with text
properties, they encourage the use of text styles, who are defined with regard to their
function (e. g., ‘emphasize’), not their form (‘bold’). There are many advantages of
the semantic approach. To begin with, using functional categories keeps you thinking
about why you are actually marking up, if your markup is consistent and systematic,
and whether this particular markup makes sense. On a more practical level, it is easy
to change the appearance if needed. Consider the case when you are writing a paper
and set all proper names in small caps via formal markup. Now if the publisher
requests to have names appear differently (e. g., in normal font, or ALL-CAPS), you
would have to change any single occurrence. With a semantic markup (such as noun;
see below), you’d just need to change the definition of Noun once and for all. It’s
a ten second change (if you know how to change the LATEX definition). Moreover,
semantic markup even allows you to produce different versions of a document, using
different markup semantics.

With that in mind, we now turn to the semantic text styles that are provided by
LYX.

3.7.5.1. Builtin Text Styles


The two builtin text styles can be activated via the Text Properties dialog, key bind-
ings, and the toolbar.

To activate the Noun style, do one of the following:

• click on the toolbar button

• use the key binding Alt+C C

• use the Text Properties dialog (Édition ▷ Propriétés du texte ▷ Personnaliser... or


) under Semantic Markup.

This command is a toggle. That is, if Noun style is already active, they deactivate it.

One typically uses the Noun style for proper names. For example: “Matthias
Ettrich is the original author of LYX.”

By default, Noun is producing text in Small Caps, but the definition can be changed.

57
CHAPTER 3. LYX BASICS

A more widely used text style is the Emphasized style. You can activate (or deactivate
— it’s also a toggle) the Emphasized style by:

• clicking on the toolbar button


• using the keybindings Ctrl+E
• use the Text Properties dialog (Édition ▷ Propriétés du texte ▷ Personnaliser... or
) under Semantic Markup.
Normally the Emphasized style is equivalent to an italic font but some document
classes or LATEX packages use a different font, and you can also customize it yourself
by changing the LATEX definition.
We’ve been using the Emphasized style all over the place in this document. Here’s
one more example:

Do not overuse text styles!


It’s also a warning in addition to an example. One’s writing should parallel ordinary
conversation. Since we don’t all constantly scream at each other, we should also avoid
the common tendency to overuse text styles.
In contrast to the custom text styles, the builtin styles are represented only as font
changes and integrated in the Text Properties dialog. You can therefore always reset to
the default font using the key binding Alt+C Espace or that dialog (Édition ▷ Propriétés
du texte ▷ Personnaliser... or ).

3.7.5.2. Custom Text Styles


Custom text styles can be provided by the document class, a module (see sec-
tion 3.1.2.3), or local layout settings (see section 3.1.2.4). As the two builtin styles,
they provide semantic markup for specific functions. For instance, LYX ships a Lin-
guistics module that provides, among other things, some custom text styles to markup
linguistic levels: expressions, concepts, and ‘meanings’.
These styles can be found, if available, in the Edit ▷ Custom Text Styles menu.
For the purpose of demonstration, we have loaded in this document the optional
module Logical Markup that replicates and extends the two builtin styles. By example
of the emphasized style, we can see the differences in look and feel (although the
result in the typeset output is the same): while the builtin emphasized style appears
as normal font change, the custom text style Emph appears as an inset, with a label
below that identifies its semantics. This is the way all custom text styles look and
feel like. For instance, the three others from the module we have loaded are: Code,
Strong, and Noun. Note that custom text styles might (as in the example) or might
not emulate on screen their formal appearance.

58
3.7. FONTS AND TEXT STYLES

3.7.6. Tweaking Text with the Text Properties Dialog


There are always occasions when you will need to do some formal fine-tuning; so
LYX gives you a way to customize the properties of text passages. For example, an
academic journal or a corporation may have a style sheet requiring a sans-serif font
be used in certain situations. Also, writers sometimes use a different font to offset a
character’s thoughts from ordinary dialog.
If there are no custom text styles provided by the document class or a module for this
purpose (which is, as written above, generally the better way of handling such issues),
you often find yourself wanting to quickly tweak the properties of the respective text
passages. That’s where formal markup comes in as a last resort.
Before we document how to tweak the text properties, we want to issue a warning
yet again: Don’t overuse that!
Documents that overuse different fonts and sizes are not easy to read and tend to
look as if someone has knocked huge holes in them.
To tweak text properties, open the Édition ▷ Propriétés du texte ▷ Personnaliser... dialog
or press the toolbar button . There are several combo boxes in this dialog, each
corresponding to a different text property that you can choose. You can choose
an option for one of these properties, or select No change, which keeps the current
state of that property. The item Default will reset the property to whatever is the
default. You can use this to reset attributes across a bunch of different paragraph
environments all at once.
The Text Properties, and their options (in addition to No change and Default) are:
Family The “overall look” of the font. The possible options are:
Roman This is the Roman font family. Normally a serif font. It’s also
the default family. (key binding Alt+C R)
Sans Serif This is the Sans Serif font family. (key binding Alt+C S)
Typewriter This is the Typewriter font family. (key binding Ctrl+Maj+P)
The general differences of these families are:
• Serif fonts use characters with serifs. These are the small “appendices”
at the ends of the strokes that form the character. The following
example shows the difference:
text with serifs
text without serifs
Serifs facilitate quick and easy reading. These fonts are therefore used
as default (named roman).
• Sans serif is not recommended for use as a base type. This font type
is therefore often only used for headings and short texts. We use it

59
CHAPTER 3. LYX BASICS

in this document to highlight menu names.


• Typewriter is a so called “monospaced” font, which means every char-
acter has the same width; the “i” is as wide as the “m”. Here is an
example
typewriter text
no typewriter text
Series This corresponds to the print weight. Options are:
Medium This is the Medium font series. It’s also the default series.
Bold This is the Bold font series. (key binding Ctrl+Alt+B)
Shape As the name implies. Options are:
Upright This is the Upright font shape. It’s also the default shape.
Italic This is the Italic font shape.
Slanted This is the Slanted font shape (although it might not be visible
in LYX, this is different from italic).
Small Caps This is the Small caps font shape.
Size Alters the size of the font. You won’t find numerical values here; all possible
sizes are actually proportional to the document font size. Once again, you
don’t feed LYX the details, but a general description of what you want to
do. The options are:
Tiny This is the “Tiny” font size. (key bindings Alt+S T, Alt+S 1)
Smallest This is the “Smallest” font size. (key binding Alt+S 2)
Smaller This is the “Smaller” font size. (key bindings Alt+S Maj+S, Alt+S 3)
Small This is the “Small” font size. (key bindings Alt+S S, Alt+S 4)

Normal This is the “Normal” font size. It’s also the default size. (key
bindings Alt+S N, Alt+S 5)
Large This is the “Large” font size. (key bindings Alt+S L, Alt+S 6)
Larger This is the “Larger” font size. (key bindings Alt+S Maj+L, Alt+S 7)
Largest This is the “Largest” font size. (key binding
Alt+S 8)

Huge This is the “Huge” font size. (key


bindings Alt+S H, Alt+S 9)

60
3.7. FONTS AND TEXT STYLES

Huger This is the “Huger” font size. (key


bindings Alt+S Maj+H, Alt+S 0)
Increase This increases the size by one step (for instance, from “Largest”
to “Huge”). (key binding Alt+S +)
Decrease This decreases the size by one step (for instance, from “Normal”
to “Small”). (key binding Alt+S -)
We warn you yet again: don’t go crazy with this feature. You should
almost never need to change the font size. LYX automatically changes the
font size for different paragraph environments — use those instead. This
is here for fine-tuning only!
Another combo box allows to tweak Decoration:
Color Alters the text color. Note that not all DVI viewers are able to display
colors. Besides (Without), which means that the document default color set
in Document ▷ Settings ▷ Color for Main text is used, you can select Black,
White, Red, Green, Blue, Cyan, Magenta, Yellow, Brown, Darkgray, Gray,
Lightgray, Lime, Orange, Olive, Pink, Purple, Teal and Violet text.
Underlining Here you can have text passages being underlined. Avoid using underlin-
ing if you can! It is a hangover from the typewriter days, when you could
not change fonts. One no longer needs to emphasize text by underscoring
characters. This is only possible in LYX because some people may need it
in order to follow style sheets for journal submissions. Options are:
(Without) Don’t use underlining.
Single This is text with Single underlining on. (key binding Ctrl+U, Alt+C U)

Double This is text with Double underlining on. (key binding Alt+C D).
Wavy This is text with Wavy underlining on. (key binding Alt+C W)
::::::::::::::::::::::::::::::::::::::::
Use this only if a journal absolutely insists on it. Keep antinau-
sea pills handy.
Strikethrough lets you strike-through text passages in two ways:
(Without) Don’t use strikethrough.
Single This is text with Single strikethrough on. (key binding Ctrl+Maj+O)
This is frequently used to indicate an older version of text that
has been changed in the meantime.
With / //////
This// is//////
text///////
with////////////////////
/-strikethrough/////
on.
This is used to make text hardly readable.
A drop-down menu allows to change the parameters for the

61
CHAPTER 3. LYX BASICS

Language This is used to mark regions of text as having a different language from
the language of the document. Text marked in this way will be underlined
in the LYX workarea in blue to indicate the change.
If you have for example, an extract of German text in a non-German
document, LATEX respects the German hyphenation rules automatically.
When using the spell checking (see section 6.15) the German-marked text
will be checked according to the German dictionary.
If you do not want text passages to be spellchecked, activate Exclude from
Spellchecking. Passages marked like this will still be hyphenated correctly.
In addition to all the formal markup described above, the dialog also provides you
access to the two builtin semantic text styles (see section 3.7.5.1) under Semantic
Markup:
• Emphasized: This is text with emphasize on.
• Noun: This is text with Noun on.
So you have a huge number of combinations to select from. Once you have applied
a text property via the Édition ▷ Propriétés du texte ▷ Personnaliser... ( ) dialog, the
settings are temporarily saved. You can activate the last applied properties by using
the toolbar button . The button lets you apply those even when the dialog isn’t
visible. A press on the button will apply the most recent setting again, a press on
the down-arrow will open a menu with the (max. 20) most recently applied settings,
from which you can select one.
To completely reset the text properties of a selection to the default, use either
Alt+C Espace or select Reset to default from the menu of the toolbar button .
We conclude this section with the same warning once again: Do not overuse the fonts!
They are, more often than not, a kludge and a bad substitute for good writing.

3.8. Printing and Previewing


3.8.1. Overview
Now that we have covered some of the basic features of document preparation using
LYX, you probably want to know how to print out your masterpiece. Before we tell
you that, we want to give you a quick explanation of what goes on behind-the-scenes.
We cover this information in much greater detail in the Additional Features manual
as well.
LYX uses the program LATEX as its backend. LATEX is just a macro package for the
TEX typesetting system, but to prevent confusion, we will only refer to LATEX. LYX is
what you use to do your actual writing. Then, LYX calls LATEX to turn your writing
into printable output. This happens in two stages:

62
3.8. PRINTING AND PREVIEWING

1. First, LYX converts your document to a series of text commands for LATEX,
generating a file with the extension, “.tex”.
2. Next, LYX calls LATEX to use the commands in the .tex file to produce printable
output.

3.8.2. Output file formats


3.8.2.1. Plain text
This file type has the extension “.txt”. It contains your document as plain text in
UTF-8 encoding.
You can export your document to plain text with the menu File ▷ Export ▷ Plain text.
However, this will not export any externally generated material such as a BibTEX bib-
liography (section 6.6.2). If your document includes such material, use File ▷ Export ▷
More Formats & Options and then select Plain text (ps2ascii). This will first internally
export your document to PostScript (generating thereby the external material) and
then do the conversion to plain text.

3.8.2.2. LATEX
This file type has the extension “.tex” and contains all commands that are necessary
for the LATEX program to process your document. If you know LATEX, you can use
it to find out LATEX-Errors or to process it manually with console commands. The
LATEX-file is automatically created in LYX’s temporary directory whenever you view
or export your document.
You can export your document as a LATEX-file using the menu File ▷ Export ▷ LaTeX.
The different LATEX export variants are explained in section A.1.15.

3.8.2.3. DVI
This file type has the extension “.dvi”. It is called “device-independent” (DVI),
because it is completely portable; you can move them from one machine to another
without needing to do any sort of conversion. DVIs are used for quick previews and
as a pre-stage for other output formats, like PostScript.
DVI files do not contain images, they only link to them. So don’t forget to deliver the
images together with your DVIs. Because the DVI-viewer has to convert the images
in the background to make them visible when you scroll the DVI, this can slow down
your computer when you view the DVI. So we recommend using PDF for files with
many images.
You can export your document to DVI by the menus File ▷ Export ▷ DVI or File ▷
Export ▷ DVI (LuaTeX). The latter option uses the program LuaTEX. LuaTEX is an

63
CHAPTER 3. LYX BASICS

engine that provides direct Unicode support and support for direct font access (see
section 3.7.2). LuaTEX is still a work in progress, but it might develop into the next
standard TEX processor.

3.8.2.4. PostScript
This file type has the extension “.ps”. PostScript was developed by the company
Adobe as a printer language. The file therefore contains commands that the printer
uses to print the file. PostScript can be seen as a “programming language”; you can
calculate with it and draw diagrams and images.11 As a result of this, the files are
often bigger than PDFs.
PostScript can only contain images in the format “Encapsulated PostScript” (EPS,
file extension “.eps”). As LYX allows you to use any known image format in your
document, it has to convert them in the background to EPS. If, for example, you
have 50 images in your document, LYX has to do 50 conversions when you view or
export your document the first time. This might slow down your workflow with LYX.
So if you plan to use PostScript, you can insert your images directly as EPS to avoid
this problem.
You can export to PostScript using the menu File ▷ Export ▷ PostScript.

3.8.2.5. PDF
This file type has the extension “.pdf”. The “Portable Document Format” (PDF)
developed by Adobe was derived from PostScript. It is more compressed and it uses
fewer commands than PostScript. As the name “portable” implies, it can be processed
on any computer system and the printed output looks exactly the same.
PDF can contain images in its own PDF format and in the formats “Joint Pho-
tographic Experts Group” (JPG, file extension “.jpg” or “.jpeg”) and “Portable
Network Graphics” (PNG, file extension “.png”). You can also use any other image
format, because LYX converts them in the background to one of these formats. But
as described in the section about PostScript, the image conversion will slow down
your workflow. So we recommend using images in one of the three formats mentioned
above.
You can export your document to PDF via the menu File ▷ Export in different ways:
PDF (pdflatex) This uses the program pdftex which converts your file directly to
PDF.
PDF (LuaTeX) This uses the program LuaTEX which converts your file directly to
PDF. LuaTEX is a new engine, derived from pdflatex, that also provides direct
Unicode support and support for direct font access (see section 3.7.2). LuaTEX
11
If you are interested in learning more about this, have a look at the LATEX-package pstricks.

64
3.8. PRINTING AND PREVIEWING

is still a work in progress, but it might develop into the next standard TEX
processor.
PDF (XeTeX) This uses the program XeTEX that converts your file directly to PDF.
XeTEX is a new engine that provides direct Unicode support and support for
direct font access (see section 3.7.2). It is particularly good at typesetting
different scripts, for example, vertically written Japanese.
PDF (cropped) This is the same as PDF (pdflatex) but the result is a PDF with
cropped page margins. This is for example useful if you want to use LYX to
generate good-looking formulas to use them in other programs like for presen-
tations.
PDF (dvipdfm) This uses the program dvipdfm that converts your file in the back-
ground to DVI and in a second step to PDF.
PDF (ps2pdf) This uses the program ps2pdf that creates a PDF from a PostScript-
version of your file. The PostScript-version is produced by the program dvips
which uses a DVI-version as intermediate step. So this export variant consists
of three conversions.
We recommend using PDF (pdflatex) because pdftex supports all the features of ac-
tual PDF-versions, is quick, stable, and works without problems. If you rely on
multiscript support and/or specific OpenType fonts, you might want to try out
PDF (XeTeX) or PDF (LuaTeX) instead, bearing in mind that these two programs
are not yet as mature as pdflatex.

3.8.2.6. XHTML
This file type has the extension “.xhtml”. It is a file suitable for viewing in web
browsers. It does not itself contain images and the like but only links to them. When
LYX produces XHTML, it also generates corresponding images in formats suitable for
the purpose. For the math output you can choose in the menu Document ▷ Settings ▷
Output between different formats, which are described in section Math Output in
XHTML of the Additional Features manual.
XHTML output remains “under development”, and not all LYX features are sup-
ported yet. See the chapter LYX and the World Wide Web, in the Additional Features
manual, for more information.
You can export your document as an XHTML file using the menu item File ▷ Export ▷
LyXHTML.

3.8.3. Previewing
To get a look at the final version of your document, with all of the page breaks
in place, the footnotes correctly numbered, and so on, use the menu Document and

65
CHAPTER 3. LYX BASICS

choose View or use the toolbar button . A viewing program will pop up showing the
output in the defined default output format, which is globally set in the preferences
(see section C.7.2) and can also be altered for single documents in the document
settings (see section B.21). Further output formats can be selected via Document ▷
View (Other Formats) or the toolbar button .
If you have changed your document, you can refresh the output in the same viewer
window using the menu Document ▷ Update or Document ▷ Update (Other Formats),
respectively.
When you preview a file, the output file is only generated in LYX’s temporary direc-
tory. To have a real output, export your document.

3.9. A few Words about Typography


3.9.1. Hyphens, Dashes and Minus Signs
In LYX, the “-” symbol comes in four variants: the hyphen, the en dash, the em dash,
and the minus sign:

name output inserted with

hyphen - “-” in text

en dash – system key combinationa or “--” in text

em dash — system key combination or “---” in text

minus sign − “-” in math mode


a
On Mac and Linux, the en dash is entered with Opt+“-” and the em dash with Shift-Opt+”-”
(Opt is the Mac label for the right Alt key).

Dashes can also be inserted with Insert ▷ Special Character ▷ Symbols or using the
unicode-insert LYX function with the Unicode code point as argument (2013 for
the em dash and 2014 for the en dash).
Hyphen and dashes are distinct from the minus sign, which appears in math mode
and has a length of its own. Here are some examples:
1. line- and page-breaks (hyphen)
2. A–Z; pages 369–378 (en dash)
3. The em dash is used without spaces: Oh—there’s a dash. (em dash)
4. x2 − y 2 = z 2 (minus sign)

66
3.9. A FEW WORDS ABOUT TYPOGRAPHY

See also the Wikipedia entry on dashes.

3.9.2. Dashes and Line Breaks


Whether line breaks before or after dashes are allowed depends on the use case and
locale, e. g.:
• In English, line breaks are generally allowed after the dash, but no line break
should occur if only a single character follows the dash (as in A–Z).
• In English, dashes used to set off parenthetical statements should not start a
new line.
• In French and Spanish, dashes around parenthetical statements are treated
similar to brackets: line breaks are not allowed on the inner side.
By default, dashes are output by LYX to LATEX as “ligature dashes” (-- and ---). LATEX
allows line breaks after hyphens and these en-dashes and em-dashes.
1. Line breaks before spaced en dashes – common in British English and generally
recommended by The Elements of Typographic Style – can be prevented using
non-breaking spaces.
2. Unwanted line breaks after dashes must be prevented by wrapping in a make-
box12 or preceding with \nobreakdash in TEX code, a non-breaking space
does not suffice. Examples13 :
• Pages 36–39
• Les incises – même si tout le monde ne les aime pas – sont très utiles.
• En una frase —un inciso con rayas— se escribe así.
An incorrect line break is easily overlooked because – in contrast to an overfull line –
it does not trigger a warning in the LATEX log.
If you want to globally disable line breaks after dashes, you can select the option
Document ▷ Settings ▷ Fonts ▷ Disallow line breaks after dashes:
1. Line breaks are still allowed after spaced dashes. They can be prevented using
non-breaking spaces (without need for a makebox or TEX code). Example:
• Les incises – même si tout le monde ne les aime pas – sont très utiles.
2. Line breaks after unspaced dashes can be allowed via the menu
Insert ▷ Formatting ▷ Optional line break:
12
See section Prevent Hyphenation of the Embedded Objects manual.
13
It is generally recommended to set the correct language for text parts not in the document
language. We don’t do this here to prevent a dependency on LaTeX support for French and
Spanish.

67
CHAPTER 3. LYX BASICS

• Em-dashes without spaces—common in American English—should be fol-


lowed by a line break opportunity.
This also allows hyphenation of the word following the dash (see section 3.9.3).
3. With this setting, LATEX hyphenates words also if immediately followed by em
or en dashes (see section 3.9.3).

3.9.2.1. Changes and Backwards Compatibility


Up to LYX 2.1, consecutive hyphen characters (-- and ---) in the LyX source were
merged to en or em dashes by LaTeX. These “ligature dashes” retain the line-break
properties of hyphens while literal dash characters are regarded by LATEX as non-
breakable.
Since LYX 2.2, consecutive hyphens in the LyX source are exported to LATEX in a
way that prevents ligation to dashes. “Ligature dashes” in documents from earlier
versions are converted to literal dash characters (except in typewriter font); typed
in consecutive hyphens are merged to dash characters immediately after the input
(unless the current text font is typewriter).14
LYX 2.3 outputs breakable dashes by default. When opening documents edited with
LYX 2.2 or earlier and containing literal dash characters not followed by whitespace,
the setting Document ▷ Settings ▷ Fonts ▷ Disallow line breaks after dashes is active to
prevent changes to the line breaks.Warning: If you used both literal and “ligature”
dashes in pre-LYX 2.2 documents, you may need to enable or prevent individual line
breaks as shown above to restore the correct line breaking behavior.

3.9.3. Hyphenation
Words are not hyphenated within LYX but automatically in the output. Hyphenation
is done by the LATEX-package babel following the rules of the document language.
LATEX does not hyphenate text in the typewriter font and words immediately preceded
or followed by hyphens or dashes.
LATEX hyphenates almost perfectly; it only has problems with text in the typewriter
font and with unusual constructs, like “h3knix/m0n0wall”. If LATEX cannot break
a word correctly, you can set hyphenation points manually. This is done with the
menu Insert ▷ Formatting ▷ Hyphenation Point. Note that adding hyphenation points
disables the default ones: The word will no longer break at the places it previously
would have. Note also that, other than with “soft hyphens” that are common in word
processors, these added hyphenation points are only recommendations to LATEX. If
14
The behavior was changed since “lyx --help” became “lyx –help” in PDF, Postscript, and DVI
output. An unintended consequence of these changes was that all dashes were output as non-
breakable dashes. This also resulted in changed line breaks in some older documents.

68
3.9. A FEW WORDS ABOUT TYPOGRAPHY

no hyphenation is necessary or the automatic hyphenation is disabled, LATEX will


ignore them.
If there is a word you use often that LATEX does not hyphenate correctly, you can
tell LATEX how to hyphenate it by adding the command \hyphenation{<patterns>}
to the preamble which takes as its argument one or more words with their hyphenation
points marked by a hyphen, e. g.: \hyphenation{dis-quo-ta-tion dis-quo-ta-tions}
You can also use this to prevent hyphenation of a word, e. g. \hyphenation{unbroken}.
If there are a lot of these hyphenation exceptions, you can collect them in a single
file (say, myhyphens.sty) and then import the file via: \usepackage{myhyphens}.
Make sure to put the file somewhere LATEX can find it (see the section Installing new
LATEX files in the Customization manual).
Note that \hyphenation{<patterns>} applies to the language that is current when
the command is issued (in the preamble, this is usually the main language of the doc-
ument). If you want to define patterns for specific languages without knowing which
language is in effect, the language packages babel and polyglossia provide specific
variants of the command:
• babel: \babelhyphenation[<language 1>, <language 2>, ...]{<patterns>}
• polyglossia: \pghyphenation[<language options>]{<language>}{<patterns>}
So you can use, depending on which language package you are using:
• \babelhyphenation[german,ngerman,austrian,naustrian,swissgerman,
nswissgerman]{Ma-de}
• \pghyphenation{german}{Ma-de}
in order to define the hyphenation points for all German varieties, or only
• \babelhyphenation[naustrian]{Ma-de}
• \pghyphenation[variant=austrian]{german}{Ma-de}
in order to define them only for the Austrian variety of German.
These commands only work after the language package has been loaded, which
is usually after the user preamble. So it is advised that you embrace them in
\AtBeginDocument{...}, which causes them to be issued at the end of the LATEX
preamble instead.
Sometimes you want to prevent words or constructs from being hyphenated. Imagine
that you are describing keybindings/shortcuts in your document in the form “A-b c”.
LATEX would then see the hyphen “-” as a line break possibility. A line break at this
point would look ugly. To prevent the shortcut from being broken, you can use a
non-breaking hyphen (Insert ▷ Special Character ▷ Non-Breaking Hyphen) or put it into
a makebox as described in the section Prevent Hyphenation of the Embedded Objects
manual.

69
CHAPTER 3. LYX BASICS

3.9.4. Punctuation Marks


3.9.4.1. Abbreviations and End of Sentence
When LYX calls LATEX to generate the final version of your document, LATEX au-
tomatically distinguishes between words, sentences, and abbreviations. LATEX then
adds the “appropriate amount of space.” That means sentences get a little bit more
space between the period and the next word. Abbreviations get the same amount of
space after the period that a word gets after another word.

Unfortunately, the algorithm for figuring out what’s an abbreviation does not work
in all cases. If a “.” is at the end of a lowercase letter, it’s the end of a sentence; if
it’s at the end of a capitalized letter, it’s an abbreviation.

Here are some examples of correct abbreviations and of the end of a sentence:

• M. Butterfly

• Don’t worry. Be happy.

And here is an example of the algorithm going wrong:

• e. g. this is too much space!

• This is I. It’s okay.

You will not see anything wrong until you view a final version of your document.

To fix this problem, use one of the following:

1. Use an Inter-word Space after lowercase abbreviations (see section 3.5.2.1).

2. Use a Thin Space between two tokens of an abbreviation (see section 3.5.2.2).

3. Use an End of sentence period found under the Insert ▷ Special Character menu
to force the use of inter-sentence spacing. This function is also bound to Ctrl+.
for easy access.

With the corrections, our earlier examples look like this:

• e. g. this is too much space!

• This is I. It’s okay.

Some languages don’t use extra spacing between sentences. If your language is such
a language, you don’t need to worry, because LATEX will take care of this.

For those that do need to bother, there is help to catch those sneaky errors: Check
out the Check TEX feature described in the section Checking TEX of the Additional
Features manual.

70
3.9. A FEW WORDS ABOUT TYPOGRAPHY

3.9.4.2. Quotation Marks


LYX usually sets quotation marks correctly. Specifically, it will insert an opening mark
at the beginning of quoted text, and use a closing mark at the end. For example,
“open close”. The keyboard character, ", generates this automatically.
You can specify what character the " key produces by using the submenu Language of
the Document ▷ Settings dialog and switching the Quote Style (note that LYX makes
a sensible proposal for the selected main language). There are 15 choices:
“Outer” and ‘inner’ Produces “these outer” and ‘these inner’ quotation marks (as
common, e. g., in the US)
”Outer” and ’inner’ Produces ”these outer” and ’these inner’ quotation marks (as
common, e. g., in Sweden)
„Outer“ and ‚inner‘ Produces „these outer“ and ‚these inner‘ quotation marks (as
common, e. g., in Germany)
„Outer” and ‚inner’ Produces „these outer” and ‚these inner’ quotation marks (as
common, e. g., in Poland)
«Outer» and ‹inner› Produces «these outer» and ‹these inner› quotation marks (as
common, e. g., in Switzerland)
»Outer« and ›inner‹ Produces »these outer« and ›these inner‹ quotation marks (as
common, e. g., in Denmark)
"Outer" and 'inner' Produces "these outer" and 'these inner' quotation marks (so-
called plain or non-typographical quotation marks)
‘Outer’ and “inner” Produces ‘these outer’ and “these inner” quotation marks (as
common, e. g., in Great Britain)
«Outer» and “inner” Produces «these outer» and “these inner” quotation marks (as
common, e. g., in France)
«Outer» and «inner» Produces «these outer» and «these inner» quotation marks (an-
other style common in France)15
«Outer» and „inner“ Produces «these outer» and „these inner“ quotation marks (as
common, e. g., in Russia)
»Outer» and ’inner’ Produces »these outer» and ’these inner’ quotation marks (an-
other style common in Sweden)
„Outer” and »inner« Produces „these outer” and »these inner« quotation marks (as
common in Hungary)
15
Maybe you wonder why one does not simply use only outer marks in this case, since these look
identical to the inner marks. The answer is that you cannot easily switch to another style then
(where the inner marks differ).

71
CHAPTER 3. LYX BASICS

⌈Outer⌋ and VinnerU Produces ⌈these outer⌋ and Vthese innerU quotation marks (as
common, e. g., in Japan)16
⟨⟨Outer⟩⟩ and ⟨inner⟩ Produces ⟨⟨these outer⟩⟩ and ⟨these inner⟩ quotation marks (as
common, e. g., in North Korea and China)16
”Outer„ and ’inner‚ Produces ”these outer„ and ’these inner‚ quotation marks (as
common in Israel)
Inner quotation marks17 for quotations inside quotations (and other tasks in some
languages, such as ‘scare quotes’) can be obtained by means of the shortcut Alt+"
and via the Insert ▷ Special Characters menu.
By default, the quotation mark styles are persistent. That is to say, a quotation mark
maintains the style that was current when it was inserted, even if the document-
wide style changes. This allows you to enter marks of different style. If you check
the setting Use dynamic quotation marks in Document ▷ Settings ▷ Language, however,
special quotation marks will be inserted (in the LyX window, they appear in a special
color). These marks will automatically adapt to the main style (and its changes).
Such quotation marks make it easy to alter the quotation mark style in one step
(e. g., if your publisher requests a different style).
Individual quotation marks (i. e., their level [inner, outer], side [opening, closing], and
style) can be easily switched by a context menu that pops up if you right-click on a
mark.

3.9.5. Ligatures
It is standard typesetting practice to group certain letters together and print them
as single characters. These groups are known as ligatures. Since LATEX knows about
ligatures, your documents will contain them too in the output. Here are the standard
ligatures:
• ff
• fi
• fl
• ffi
• ffl
16
Note that these characters are just emulated with similar-looking math symbols in many encodings
that do not cover these glyphs.
17
In many writing cultures, these are single quotation marks. But as the British and French styles
show, this is not necessarily the case (and specifically the British style shows that “outer” does
not necessarily mean “double”). This is why we call them ‘inner’ as opposed to “outer” quotation
marks.

72
3.9. A FEW WORDS ABOUT TYPOGRAPHY

Some languages uses other ligatures if the document font supports them.
Sometimes, you don’t want a ligature in a word. While a ligature may be okay in
the word, “graffiti,” it looks really weird in compound words, such as “cufflink” or
the German “Dorffest.” To break a ligature, use Insert ▷ Formatting ▷ Ligature Break.
This changes “cufflinks” to “cuff‌links” and “Dorffest” to “Dorf‌fest”.

3.9.6. LYX and LATEX Logos


Via Insert ▷ Special Characters ▷ Logos, LYX provides the following program logos with
special formatting:
LYX The name of the game.
TEX The typesetting engine used by LYX.
LATEX The TEX macro collection used by LYX.
LATEX 2ε The current version of LATEX.
You might wonder why the LATEX version is “2ϵ”. It is an old tradition in the TEX
world to give programs geek version numbers. For example the version number of
TEX converges to the number π: The actual version is “TEX-3.141592”, the previous
one was “TEX-3.14159”.

3.9.7. Units
Generally the space between units and the number is smaller than the normal space
between two words. As you can see in the example below, it looks better when the
space is smaller. To get such a “half space” for units use the menu Insert ▷ Formatting ▷
Thin Space (shortcut Ctrl+Maj+Espace).
Here is an example to show the differences:
24 kW·h space between number and unit
24 kW·h half space between number and unit

3.9.8. Widows and Orphans


In the early days of word processors, page breaks went wherever the page happened
to end. There was no regard for what was actually going on in the text. For example
the heading for a new section was printed at the very bottom of the page, the first line
of a new paragraph all alone at the bottom of a page, or the last line of a paragraph
at the top of a new page. These bits of text became known as widows and orphans.
Clearly, LYX can avoid breaking pages after a section heading. That’s part of the
advantage of paragraph environments. But what about widows and orphans, where

73
CHAPTER 3. LYX BASICS

the page breaks leave one line of a paragraph all alone at the top or bottom of a page?
There are rules built into LATEX governing page breaks, and some of those rules are
there specifically to prevent widows and orphans. If they appear nevertheless and
you don’t like them, you can add the commands
\widowpenalty=10000
\clubpenalty=10000
to the LATEX preamble of your document to avoid them. Some LATEX books (such
as [1] or [2]) have more information about the technical details of LATEX’s page break
mechanism.

74
4. Notes, Graphics, Tables and Floats
The issues of this chapter are described in detail in the Embedded Objects manual.
There you will also find tips and tricks for special cases.

4.1. Notes
LYX offers you a few types of notes to add to your document:
LYX Note This note type is for internal notes that will not appear in the output.

Comment This note also doesn’t appear in the output but it does appear as a LATEX-
comment when you export the document to LATEX via the menu File ▷ Export ▷
LaTeX (xxx).

Greyed Out This note will appear in the output as text in a color which you can set
in the document settings under Colors ▷ Greyed-out notes.

This is the text1 of a comment that appears in the output.

As you can see in the example, greyed out notes can have footnotes.
Notes are inserted with the toolbar button or the menu Insert ▷ Note. Right-click
on the note box that appears to select the note type.

4.2. Footnotes
LYX uses boxes to display footnotes: When you insert a footnote using the menu
Insert ▷ Footnote or the toolbar button , you will see a box like this: This
box is LYX’s representation of your footnote. If you left-click on the “foot” label,
the box will be opened and you can enter the footnote text into it. Clicking on the
box label again will close the box. If you want to turn existing text into a footnote,
simply highlight it and click on the footnote toolbar button.
1
This is an example footnote within a greyed out note. In this document the color of this note
type is set to blue.

75
CHAPTER 4. NOTES, GRAPHICS, TABLES AND FLOATS

Here is an example footnote:2


The footnote will appear in the output as a superscript number at the text position
where the footnote box is placed. The footnote text is placed at the bottom of the
current page. The footnote number is calculated by LYX according to the document
class. LYX does not yet support a particular numbering scheme, but you can get other
schemes using special LATEX-commands. They are described in the Embedded Objects
manual.

4.3. Marginal Notes


Marginal notes look and behave just like footnotes in LYX. When you insert a margin
note via the menu Insert ▷ Marginal Note or the toolbar button , you will see a box
with the label “margin” appearing within your text. This box is LYX’s representation
of your marginal note.
This is a At the side of this sentence is an example marginal note.
marginal
note. Marginal notes appear at the right side in single-sided documents. In double-sided
documents they appear in the outer margin – left on even pages, right on odd pages.
For further information about marginal notes see the section Margin Notes in the
Embedded Objects manual.

4.4. Graphics and Images


To insert an image in your document, place the cursor at the text position you want
and click on the toolbar icon or select Insert ▷ Graphics from the menu. Then a
dialog will appear to choose the file to load.
This dialog has numerous mostly self-explanatory parameters. The Graphics tab
allows you to choose your image file. The image can be transformed by setting a
rotation angle and a scaling factor. The scaling units are explained in Appendix D.
In the tab Clipping it is possible to set image coordinates to adjust the height and
width of the image in the output. The coordinates can also be calculated automati-
cally by pressing the button Get from file. The option Clip to bounding box will only
print the image region within the given coordinates. Normally you don’t need to take
care about image coordinates and can ignore the tab Clipping.
In the LaTeX and LyX options tab LATEX experts can specify additional LATEX options.
In this tab you can also specify the appearance of the image inside LYX. The option
2
To close a footnote, click on the footnote box label.

76
4.4. GRAPHICS AND IMAGES

Draft mode has the effect that the image doesn’t appear in the output, only a frame
with the image size is printed.
The graphics dialog can be called at any time by clicking on an image. Images will
appear in the output exactly at the position where they are in the text. This is an
example image within a separate, horizontally centered paragraph:
1 5500

50

5000
100

150
4500

200

256 4000
1 50 100 150 200 256

If you need image captions or want to reference images, you have to put the image
into a float, see section 4.6.2.

4.4.1. Image Formats


You can insert images in any known file format. But as we explained in section 3.8.2,
every output document format allows only a few image formats. LYX therefore uses
the program ImageMagick in the background to convert the images to the right
format. To increase your workflow by avoiding these conversions in the background,
use only the image formats listed in the subsections of section 3.8.2.
Similar to fonts there are two types of image formats:
Bitmap images consist of pixel values, often in a compressed form. They are there-
fore not fully scalable and look pixelated in large zooms. Well-known bitmap
image formats are “Graphics Interchange Format” (GIF, file extension “.gif”),
“Portable Network Graphics” (PNG, file extension “.png”), and “Joint Photo-
graphic Experts Group” (JPG, file extension “.jpg” or “.jpeg”).
Scalable images consist of vectors and can therefore be scaled to any size without
data loss. The scaling ability is desired if you want to create presentations,
because presentations are always scaled by the beamer. Scaling is also useful
for online documents to let the user zoom into diagrams.
Scalable image formats can be “Scalable Vector Graphics” (SVG, file exten-
sion “.svg”), “Encapsulated PostScript” (EPS, file extension “.eps”), and
“Portable Document Format” (PDF, file extension “.pdf”). We say “can be”,
because you can convert any bitmap image format to PDF or EPS and the
result will not be scalable. In this case only a header with the image properties
is added to the original image.3
3
In the case of PDF, the original image is additionally compressed.

77
CHAPTER 4. NOTES, GRAPHICS, TABLES AND FLOATS

Normally one cannot convert a bitmap image into a scalable one, only vice versa.

4.4.2. Grouping of Image Settings


Each image can define a new group of image settings or join an existing group.
Images within such a group share their settings, so adjusting one image of the group
automatically also adjusts all other images of the group in the same way. So you
can for example change the size for a bunch of images without the need to manually
change each of them.
A new group can be set by pressing the button Open new group in the Graphics dialog
in the LaTeX and LyX options tab. Joining an existing group can be done using the
context menu of the image and checking the name of the desired group.

4.5. Tables
You can insert a table using either the toolbar button or the menu Insert ▷ Table.
A dialog will appear, asking you for the number of rows and columns, and you can
select a specific (border) style. The default table has lines around any cell and the
first row appears separated from the rest of the table. This separation appears due
to a double line: The cells of the first row have a line below them and the cells of the
second row have a line above them. Here is an example table:
1 2 3
A
B
C
This corresponds to the “Grid with Head” table style listed in the style selection.
Other available styles include:
• A “simple grid” which looks line the above table, but without the first row
being separated via double line,
• a border-less table with no lines at all,
• and a so-called “formal table” as often used in professional publishing with
horizontal lines only and bold top/bottom lines (see Embedded Objects manual,
section Formal Tables). It is also possible to have an horizontal (thin) Footline
above the last line.
The default style used in the dialog as well as the style used by the toolbar button
can be changed in Document ▷ Settings ▷ Text Layout. So if the default style above is
not the one you need, you should alter this setting.

78
4.5. TABLES

4.5.1. Table Dialog


You can alter a table by clicking on it with the right mouse button and then choosing
More ▷ Settings. This brings up the table dialog. Here you can adjust the settings of
the cell, row and/or column where the cursor is placed currently. Most of the dialog
options also work on selections. This means that if you select more cells, columns or
rows the action is done on all of your selection.
In addition to the table dialog, the table toolbar helps you in setting table properties.
It appears if the cursor is inside a table.
In the tab Table Settings of the table dialog you can set the alignment for the current
row. If you add a row or column, it will be inserted right beside or below the current
cell respectively. The vertical alignment of a column can only be adjusted when a
column width is given. A given width will allow the cell to have line breaks and
multiple paragraphs of text, see section 4.5.3.
You can mark multiple cells of one row/column as a multicolumn/row cell using the
check box Multicolumn or Multirow. This will merge the cells to one cell, spread over
more than one column/row. Multicolumn cells are treated as own rows, so that the
alignment, width, and border settings affect only the multicolumn cell. Here is an
example table with a multicolumn cell in the first row and one in the last row without
the upper border:
abc def ghi jkl
A B C D
1 2 3 4
Adept users can declare special LATEX-arguments for the table. They are necessary for
special table formatting, such as the multirow cells, explained in the chapter Tables
of the Embedded Objects manual. You can also rotate the current cell or the whole
table. These rotations are not visible in LYX but are visible in the output.
Note: Most DVI-viewers are not able to display rotations.
The Borders tab allows you to add and delete border lines for the current row/column.
The button Default adds lines for all cell borders.

4.5.2. Multi-page Tables


If the table is too long to fit on one page, you can use the option Use multi-page table
in the tab Multi-page table of the table dialog to split the table automatically over
more pages. Doing this enables some check boxes and you can now define:
Header: The current row and all rows above, that don’t have any special options
defined, are defined to be the header rows of all pages of the longtable. Except
for the first page, if First header is defined.

79
CHAPTER 4. NOTES, GRAPHICS, TABLES AND FLOATS

First header: The current row and all rows above, that don’t have any special options
defined, are defined to be the header rows of the first page of the longtable.
Footer: The current row and all rows below, that don’t have any special options
defined, are defined to be the footer rows of all pages of the longtable, except
for the last page, if Last footer is defined.
Last footer: The current row and all rows below, that don’t have any special options
defined, are defined to be the footer rows of the last page of the longtable.
Caption: The first row is reset as a single column. You can now insert there the table
caption via the menu Insert ▷ Caption. More about multi-page table captions can
be found in the Embedded Objects manual.
You can also specify a row where the table is split. If you set more than one option in
the same table row, you should be aware that then only the first option is used; the
others will be defined as empty. In this context, first means first in this order: Footer,
Last footer, Header, First header; see the following longtable to see how it works:

Example Phone List (ignore the names)


NAME TEL.
Annovi Silvia 111
Bertoli Stefano 111
Bozzi Walter 111
Cachia Maria 111
Cachia Maurizio 111
Cinquemani Giusi 111
Colin Bernard 111
Concli Gianfranco 111
Dal Bosco Carolina 111
Dalpiaz Annamaria 111
Feliciello Domenico 111
Focarelli Paola 111
Galletti Oreste 111
Gasparini Franca 111
Rizzardi Paola 111
Lassini Giancarlo 111
Malfatti Luciano 111
Malfatti Valeriano 111
Meneguzzo Roberto 111
Mezzadra Roberto 111
continue ...

80
4.5. TABLES

Example Phone List


NAME TEL.
Pirpamer Erich 111
Pochiesa Paolo 111, 222
Radina Claudio 111
Stuffer Oskar 111
Tacchelli Ugo 111
Tezzele Margit 111
Unterkalmsteiner Frieda 111
Vieider Hilde 111
Vigna Jürgen 111
Weber Maurizio 111
Winkler Franz 111

Annovi Silvia 555


Bertoli Stefano 555
Bozzi Walter 555
Cachia Maria 555
Cachia Maurizio 555
Cinquemani Giusi 555
Colin Bernard 555
Concli Gianfranco 555
Dal Bosco Carolina 555
Dalpiaz Annamaria 555
Feliciello Domenico 555
Focarelli Paola 555
Galletti Oreste 555
Gasparini Franca 555
Rizzardi Paola 555
Lassini Giancarlo 555
Malfatti Luciano 555
Malfatti Valeriano 555
Meneguzzo Roberto 555
Mezzadra Roberto 555
Pirpamer Erich 555
Pochiesa Paolo 555, 222
continue ...

81
CHAPTER 4. NOTES, GRAPHICS, TABLES AND FLOATS

Example Phone List


NAME TEL.
Radina Claudio 555
Stuffer Oskar 555
Tacchelli Ugo 555
Tezzele Margit 555
Unterkalmsteiner Frieda 555
Vieider Hilde 555
Vigna Jürgen 999
Weber Maurizio 555
Winkler Franz 555
End

4.5.3. Table Cells


A table cell can contain text, inline equations, a figure, or another table. All these
kinds of objects can be placed in the same cell. Font sizes and shapes can also be
altered. But you can’t put a special environment in a cell (like Section*, etc.), nor
set spacing options for the cell’s paragraph.
To have multi-line entries in table cells, you have to declare a fixed width for the
column in the table dialog. Your text is then automatically split into multiple lines
and the cell is enlarged vertically when the length of the text exceeds the given width.
An example:
1 2 3
4 This is a multi- 5
line entry in a
table.
6 This is longer 7
now.
8 This is a multi- 9
line entry in a
table. This is
longer now.
Cutting and pasting between tables and table cells works reasonably well. You can
even cut and paste more than one row.4 Selection with the mouse or with Shift plus
4
Note that you cannot paste into a multicell selection because it would not be clear what to do

82
4.6. FLOATS

the arrow keys works as usual. You can also copy and paste the entire table as a
single unit by starting the selection from outside the table.

4.6. Floats
4.6.1. Introduction
A float is a block of text associated with some sort of label, which doesn’t have a
fixed location. It can “float” forward or backward a page or two, to wherever it fits
best. Footnotes and Margin Notes are also floats, because they can float to the next
page when there are too many notes on the current page.
Floats make it possible to get a high quality layout. Images and tables can be
distributed evenly over the pages to avoid whitespace and pages without text. As
the floating often destroys the spatial context between the text and the image/table,
every float can be referenced in the text. Floats are therefore numbered. Referencing
is described in section 6.1.
To insert a float, use the menu Insert ▷ Float. A box with a caption will be inserted
into your document. The label will automatically be translated to the document
language in the output. After the label you can insert the caption text. The image
or table is inserted above or below the caption in a separate paragraph within the
float. To keep your LYX-document readable, you can open and close the float box by
left-clicking on the box label. A closed float box looks like this: – a gray
button with a red label.
You should insert floats in a separate paragraph to avoid possible LATEX-errors that
can occur when the surrounding text is specially formatted.

4.6.2. Figure Floats


Figure 4.1 was created using the menu Insert ▷ Float ▷ Figure (toolbar button ). The
image was inserted by setting the cursor above the caption label and using the menu
Insert ▷ Graphics (toolbar button ). The image in the float was horizontally centered
by putting the cursor to the left or right of the image and using the menu Edit ▷
Paragraph Settings (toolbar button ).
This figure float also shows how to set a label and create a cross-reference to it: Insert
a label into the caption using the menu Insert ▷ Label (toolbar button ) and refer
to it using the menu Insert ▷ Cross-Reference (toolbar button ). It is important to
use cross-references to figure floats rather than using vague references like “the figure
above”, because, as LATEX will reposition the floats in the final document, it might
not be “above” at all. For more about cross-references, see section 6.1.
when pasting a single word in a selected 2×3.

83
CHAPTER 4. NOTES, GRAPHICS, TABLES AND FLOATS

Figure 4.1.: A star in a float.

Table 4.2.: A table float.

1 2 3
Joe Mary Ted
" #
a b
x2 dx 1+1=2
R
c d

Normally only one image is inserted in a figure float, but sometimes you might want
to use two images with separate subcaptions. This can be done by inserting image
floats into existing image floats. Note that only the main caption of the float is added
to the List of Figures as described in section 6.2.2. Figure 4.2 is an example of a
figure float with two images set side by side. You can also set the images one below
the other. Figure 4.2a and 4.2b are the subfigures.

4.6.3. Table Floats


Table floats can be inserted using the menu Insert ▷ Float ▷ Table or the toolbar button
. They have the same properties as figure floats except that the table in the float
is normally placed below the caption and not above like for figures and that the label
begins with “tab:”. Table 4.2 is a table float.

84
4.7. MINIPAGES

(a) Undefinable (b) Star

Figure 4.2.: Two images.

4.6.4. More Information


LYX offers you further float types as well as rotated floats. It also allows you to
change the float numbering scheme, to control the float placement and to change the
formatting and placement of the float caption. All these features are explained in
detail with many examples in the chapter Floats in the Embedded Objects manual.

4.7. Minipages
LATEX provides a mechanism essentially to produce a page within a page, called a
minipage. Within a minipage, all the usual rules of indentation, line wrapping, etc.
apply.
Minipages in LYX have their own collapsible box inserted via the menu Insert ▷ Box.
Right-clicking on the box label allows you to alter the width of the minipage and its
alignment within the page.
This is a minipage. The
text is set in an italic
style.
Minipages are often used
for text in another lan-
guage or text that needs
another formatting.

If you place two minipages side-by-side, you can use Horizontal Fills as described in

85
CHAPTER 4. NOTES, GRAPHICS, TABLES AND FLOATS

section 3.5.2:

This is a minipage This is a minipage


with some stupid with some stupid
dummy text. This dummy text. This
dummy text is used dummy text is used
to increase the size to increase the size
of the minipage. of the minipage.

When you right-click on a minipage box, you can transform the box to another box
type. All box types and their settings are explained in detail in chapter Boxes of the
Embedded Objects manual.

86
5. Mathematical Formulas
The issues of this chapter are described in detail in the Math manual. There you will
also find tips and tricks for special cases.

5.1. Basic Math Editing


To create a math formula, you can just click on the toolbar icon (shortcut Ctrl+M).
That will create a little blue rectangle, with purple markers around its corners. That
blue rectangle is the formula itself; the purple markers indicate what level of nesting
within the formula you are at. You can also choose a particular formula type to insert
via the Insert ▷ Math menu.
Editing the parameters of a formula and adding math constructs can be done with
the math toolbar, that appears if the cursor is in a formula.
There are two main types of formulas, inline formulas and display formulas. Inline
formulas appear within a text line, like this one:
This is a line with an inline formula A = B in it.
Displayed formulas appear outside the text like if they were in a separate paragraph,
like this one:
A=B
You can only number and reference displayed formulas.
LYX also supports many LATEX math commands. For example, typing “\alpha”,
followed by a space, in a formula will create the Greek letter α. Typing commands
might sometimes be faster than using the Math Panel.

5.1.1. Navigating in Formulas


The best control over the cursor position within an existing formula is achieved with
the arrow keys. LYX uses small rectangles to indicate places where something can
be inserted. The arrow keys can be used to navigate between √ parts of a formula.
Pressing Space will#leave a formula construct (a square root 2, or parentheses (f ),
1 2
"
or a matrix ). Pressing Escape will leave the formula, placing the cursor after
3 4

87
CHAPTER 5. MATHEMATICAL FORMULAS

the formula. Tab can be used to move horizontally in a formula; for example, through
the cells of a matrix or the positions in a multi-line equation.

Space, printed in this document as “␣”, seems to do nothing in a formula, since it


does not add a space between characters, but it does exit a nested structure.√For this
reason, you have to be careful about using Space. For example, if you want 2x + 1,
type \sqrt␣2x+1 and not \sqrt␣2x␣+1,
√ since in the latter case only the 2x will
be under the square root sign: 2x + 1.

You can leave many parts of a formula, like this matrix, partially filled in, such as:
 
λ1
..
.
 
 
 
λn

If you leave a fraction only partially filled in, or a subscript with nothing in it, the
results will be unpredictable, but most constructs don’t mind.

5.1.2. Selecting Text


You can select text within a formula in two different ways. Place the cursor at one
end of the string of text you want, and press Shift and a cursor movement key to
select text. It will be highlighted as with regular text selection. Alternatively, you
can select text with the mouse in the usual way. That text can then be cut or copied,
and then pasted within any formula, but not in a normal text region in LYX.

5.1.3. Exponents and Subscripts


You can use the math panel to add super- or subscripts (buttons and ), but it
is often much easier to use a command. To get x2 , type in a formula x^2␣. The final
Space puts the cursor back down on the base line of the expression. If you type x^2y,
you will get x2y , to get x2 y, type x^2␣y. If you use characters in the superscript,
that could be accented with the circumflex “^”, you have to use an extra Space to
separate the circumflex and the character. For example, if you want xa , type x^␣a.
Subscripts are similar: To get a1 , type a_1␣.

5.1.4. Fractions
Create a fraction either with the command \frac or by using the icon in the
Math Panel. You will be presented with an empty fraction. The cursor is above the
fraction line. To move it to the bottom, simply press Down. To move back up, press

88
5.1. BASIC MATH EDITING

Up. Any math structure can be placed in a fraction, as this example shows:
 

1
 
 
 
2 3
 !
 
 
4 5

5.1.5. Roots
Roots can be created using the Math Panel buttons or or the commands \sqrt
or \root. With the command \root you can produce roots of higher orders, like
cube roots, while \sqrt always produces a square root.

5.1.6. Operators with Limits


Sum ( ) and integral ( ) operators are very often decorated with limits. These limits
P R

can be entered in LYX by entering them as you would enter a super- or subscript,
directly after the symbol. The sum operator will automatically place its “limits” over
and under the symbol in displayed formulas, and to the side in inline formulas, as in
n=0 n! = e, versus
P∞ 1

1
=e
X

n=0 n!

Integral signs, however, will place the limits to the side in both formula types.
All operators with limits will be automatically re-sized when placed in display mode.
The placement of the limits can be changed by placing the cursor directly behind the
operator and using the menu Edit ▷ Math ▷ Change Limits Type or entering Alt+M L.
Certain other mathematical expressions also have this “moving limits” feature, such
as
lim f (x),
x→∞

which will place the x → ∞ underneath the “lim” in display mode. In inline formulas
it looks like this: limx→∞ f (x).
Note that the lim-function was entered as the function macro \lim. Have a look at
section 5.1.9 for an explanation of function macros.

5.1.7. Math Symbols


Most math symbols can be found in the Math Panel under one of several categories;
including Greek, Operators, Relations, Arrows. There are also the additional symbols
provided by the American Mathematical Society (AMS).

89
CHAPTER 5. MATHEMATICAL FORMULAS

If you know the LATEX-command for a construct or symbol you wish to use, you don’t
have to use the Math Panel; you can type the command directly into the formula.
LYX will convert it to the corresponding symbol or construct.

5.1.8. Altering Spacing


You may want to create spaces that differ from the standard spacing that LATEX
provides. To do this, press Ctrl+Espace or use the Math Panel button . This
generates a small space, and shows a small marker on the screen. For example, the
sequence a Ctrl+Space b: a b appears in LYX as . You can change the space
to different sizes when you set the cursor behind the space marker and enter space
again several times. With every space enter the size will be changed. Some markers
for the space size appear red in LYX, because they are negative spaces. Here are two
examples:
a Ctrl+Space b and 3×Space: a b
a Ctrl+Space b and 5×Space: ab

5.1.9. Functions
The Math Panel contains under the button a number of function macros, such
as sin, lim, etc. (you can also insert them in a formula by typing \sin etc.). Stan-
dard mathematical practice is that functions are printed upright to avoid confusions,
because sin does normally mean s · i · n.
Using the function macros will also produce correct spacing around the function:
a sin x is different from asinx.
For some mathematical objects, like limits, the macro changes where subscripts are
placed, as described in section 5.1.6.

5.1.10. Accents
In a formula you can insert accented characters in the same way as in text mode. This
may depend on your keyboard, or the bindings file you use. You can also use LATEX
commands, for example, to enter â even if your keyboard doesn’t have the circumflex
enabled. Our example is entered by typing \hat␣a in a formula. Table 5.1 shows
the equivalences between the accent names and the commands.
You can choose one of the accents by selecting an item from the Frame decorations
symbol set button in the math panel; this will apply to any selection you have
made within a formula too.

90
5.2. BRACKETS AND DELIMITERS

Table 5.1.: Accent names and the corresponding commands.

Name Command Example


circumflex \hat â
grave \grave à
acute \acute á
umlaut \ddot ä
tilde \tilde ã
dot \dot ȧ
breve \breve ă
caron \check ǎ
macron \bar ā
vector \vec ⃗a

5.2. Brackets and Delimiters


There are several brackets available through LYX. For some purposes, using just the
keys []{}()|<> should suffice. But if you want to surround a large structure, like a
matrix or a fraction, or if you have several layers of brackets, it is better to use the
math toolbar delimiter icon . For example, if you construct the brackets around a
matrix in this way:
1 2
" #

3 4
it makes it easier to see the layers of parentheses. Below, the expression on the left
was entered using the delimiter icon and the expression on the right was entered
using the () keys.
1 1
(1 + ( 1+( 1 1 ) ))

1+ 1+(
1
1
1+x ) 1+x

If you use the delimiter icon, the parentheses, and other brackets from that menu
will automatically re-size to accommodate the size of what is inside.

To construct brackets click on the button for the bracket you want on the left side
and right side. If you use the option Keep matched, the selected bracket type will be
used for the left and the right side. The selection will be shown as TEX code. If you
want one side not to have a bracket, use (none). It will appear in LYX with a dotted
line, but nothing will be printed.

If you want to place brackets around existing math structures, like a square root,
you can do so by first highlighting (selecting) the structure that is to go inside the

91
CHAPTER 5. MATHEMATICAL FORMULAS

brackets. Then choose the appropriate brackets for left and right and click on Insert.
The most common bracket combinations (parentheses, square brackets, and braces,
on both sides) can be entered more quickly using keyboard shortcuts. For example,
to insert a pair of parentheses, select the structure and enter Alt+M (.

5.3. Arrays and Multi-line Equations


Matrices are entered in LYX using the Math Panel matrix button . It will open a
dialog for you to choose the number of rows/columns. Here is an example:

1 2 3
 

 4 5 6 
 
 
7 8 9

The parentheses aren’t automatic, but you can add them as described in section 5.2.
When you construct the matrix, you can decide whether the column entries will be
left-, right-, or center-justified. This alignment is set in the box Horizontal with the
letters “l”, “r”, and “c”. LYX proposes a “c” for every column as default. For example,
the sequence “lcr” means that the first column will be left-justified, the second will be
centered, and the third column will be right-justified, because each letter corresponds
to the relevant column. The result will look like this:

this this column this column


column has has right .
has lef t alignment center alignment alignment

You can add more rows to an existing matrix by entering Ctrl+Retour while the cursor
is in the matrix. Adding or deleting columns can be done via the menu Edit ▷ Math
or the math toolbar.
There are other arrays used in formulas, such as distinctions of cases. It can be
created with the menu Insert ▷ Math ▷ Cases Environment or the command \cases.
Here is an example: 



−1 x<0
f (x) =

0 x=0
1 x>0


Multi-line formulas are created when you press Ctrl+Retour within a formula. In an
empty formula you can see that three blue boxes appear, one for each column. When
you press Ctrl+Retour in a non-empty formula, the part before the relation sign (equal
sign “=” etc.) will be inserted automatically in the first column, the relation sign is in

92
5.4. FORMULA NUMBERING AND REFERENCING

the second column, and the rest in the third column. A new row is created by every
further entry of Ctrl+Retour. Multi-line formulas are always displayed formulas. Here
is an example:

a2 = (b2 + c2 )(b2 − c2 )

a = b4 − c 4 (5.1)

Note that the middle column is designed for relation signs so structures in this column
will be printed in a smaller size:
A A A
B
B B

The multi-line formula type described here is called eqnarray. There are other
multi-line types more suitable for certain situations, for example if you want a better
inter-line spacing than in formula (5.1). The other types are described in section 5.7.2.

5.4. Formula Numbering and Referencing


To number a formula, set the cursor in the formula and use the menu Edit ▷ Math ▷
Number Whole Formula or the shortcut Alt+M N. The formula number appears in
LYX within parentheses. The number shown is temporary and may be different when
the output is generated. The placement and format of the formula number in the
output depends on the document class. In this document the number is printed
together with the chapter number, separated by a dot:

1+1=2 (5.2)

Using Alt+M N in a numbered formula will switch off the numbering. You can only
number displayed formulas.
Multi-line formulas can be numbered line by line: Using the menu Edit ▷ Math ▷
Number This Line or the shortcut Alt+M Maj+N will only toggle the numbering of
the line where the cursor is:

1 = 3−2 (5.3)
2 = 4−2
4 ≤ 7 (5.4)

To number all lines use the shortcut Alt+M N.

Every displayed formula can be referenced by its number using a label. A label is
inserted with the menu Insert ▷ Label (toolbar button ) when the cursor is in the
formula. This opens a dialog to enter the label. It is recommended that you use the

93
CHAPTER 5. MATHEMATICAL FORMULAS

suggested “eq:” as the first part of the label, because this helps later to identify the
label type when you have many labels in your document. We inserted in the following
example the label “eq:tanhExp” in the second line:

sinh(x)
tanh(x) =
cosh(x)
e2x − 1
= 2x (5.5)
e +1
Every labeled line is automatically numbered. Therefore the label is shown behind
the formula number. You can reference a labeled formula using the menu Insert ▷
Cross Reference (toolbar button ). A dialog appears to choose a label you want
to refer to. The reference appears in LYX as a gray cross-reference box and in the
output as the formula number:
This is a cross-reference to equation (5.5).
The properties of LYX’s cross-reference box are described in section 6.1. To delete a
label, set the cursor at the end in the labeled formula and press Del.

5.5. User defined math macros


LYX allows you to define macros for formulas which is very useful when you have
equations of the same form in a document several times. Math macros are explained
in section Math Macros of the Math manual.

5.6. Fine-Tuning
5.6.1. Typefaces
The standard font for text is italic, for numbers the standard is roman. To set a font
in a formula, use the Math Panel button , or enter its command, listed in table 5.2,
directly.
Note: You can only print capital letters in the typefaces Blackboard, Double stroke,
Script and Calligraphic.
When you use a typeface, a blue box is inserted in the formula. Every character in
this box will be printed in this typeface. Pressing Space within the box will set the
cursor outside, so that you have to use a non-breaking space when you need a space
in the box. Here is an example where “N” in Blackboard denotes the set of numbers:

f (x) = x ; x ∈ N

94
5.6. FINE-TUNING

Table 5.2.: Typefaces and the corresponding commands.

Font Command
Roman \mathrm
Bold \mathbf
Italic \mathit
Typewriter \mathtt
BLACKBOARD \mathbb
DOUBLESTROKE \mathds
Fraktur \mathfrak
CALLIGRAPHIC \mathcal
S C RI PT \mathscr
SansSerif \mathsf

The typefaces are nestable, which can cause confusion. You can, for example, put a
character in Fraktur in a box for Typewriter: abcde
So it is better not to use this feature.
The typefaces have no effect on Greek letters: abcδe
You can only print them emboldened using the command \boldsymbol, which works
like the other typeface commands: αβγαβγ
\boldsymbol works for all symbols, letters, and numbers.
A number of other font options are available as well, in the menu Edit ▷ Math ▷
Text Style.

5.6.2. Math Text


Typefaces are useful for entering some characters in some given font, but not for text.
For typing longer pieces of text use the math text, which is obtained using the entry
Normal text mode of the Math Panel button . Math text appears in LYX in black
instead of blue. You can use spaces and accents in math text as in normal text. Here
is an example:
if I say so

x
f (x) = 
−x under Umständen

5.6.3. Font Sizes


There are four font styles (relative sizes) used in math-mode, which are automat-
ically chosen in most situations. These are called textstyle, displaystyle, scriptstyle,
and scriptscriptstyle. For most characters, textstyle and displaystyle are actually the

95
CHAPTER 5. MATHEMATICAL FORMULAS

same size, but fractions, superscripts and subscripts, and certain other structures,
are set larger in displaystyle. Except for some operators, which resize themselves to
accommodate various situations, all text will be set in the styles that LATEX thinks
are appropriate. These choices can be overridden by using the math panel button .
A box for the size will be created in which you can insert the math structure. For
1
example, you can set 12 , which is normally in textstyle, larger in displaystyle: . The
2
four styles are used in the following example:
displaystyle, textstyle, scriptstyle, .
scriptscriptstyle

All these math-mode font sizes are relative so that if the whole math inset is set in a
particular size with the menu Edit ▷ Text Style, all sizes in the formula will be adjusted
relative to this size. Similarly, if the base font size of the document is changed, all
fonts will be adjusted to correspond. As an example here is a formula in the font size
“largest”:

1
e = P∞
n=0 n!

5.7. AMS-LATEX
LYX supports the packages provided by the American Mathematical Society (AMS)
that are in common use.

5.7.1. Enabling AMS-Support


You can make the facilities of the AMS-packages explicitly available in the document
by setting Load always for amsmath and amssymb packages in the Document ▷
Settings dialog under Math Options. AMS is needed for many math-constructs; so
when you get LATEX-errors in formulas, ensure that you have enabled AMS.

5.7.2. AMS-Formula Types


AMS-LATEX provides a selection of different formula types. LYX allows you to choose
between align, alignat, flalign, gather, and multline. We refer you to the
AMS-documentation, [15], for an explanation of these formula types.

96
6. More Tools

6.1. Cross-References
One of LYX’s strengths is cross-references. You can reference every section, float,
footnote, formula, and list in the document. To reference a document part, you have
to insert a label into it. The label is used as an anchor and a name for the reference.
We want for example to refer to the second item of the following list:
1. First item
2. Second item
3. Third item
First we insert a label into the second item with the menu Insert ▷ Label or by pressing
the toolbar button . A gray label box like this: is inserted and the
label window pops up asking for the label text. LYX offers as text the first words
of the item with a prefix, in our case the text “enu:Second-item”. The prefix “enu:”
stands for “enumerate”. The prefix depends on the document part where the label
is inserted; for example, if you insert a label into a section heading, the suggested
prefix will be “sec:”.
To reference the item, we refer to its label using the menu Insert ▷ Cross-Reference or
the toolbar button . A gray cross-reference box like this: is in-
serted and the cross-reference window appears showing all the labels in the document.
We can now sort the labels alphabetically and then choose the entry “enu:Second-
item”. At the position of the cross-reference box the item number will appear in the
output.
As an alternative to Insert ▷ Cross-Reference, you can right-click on a label and in the
popup menu select Copy as Reference. The cross-reference to this label is now in the
clipboard and can be pasted to the actual cursor position via the menu Edit ▷ Paste
(shortcut Ctrl+V).
Here is our cross-reference: Item 2
It is recommended to use a non-breaking space1 between the cross-reference name
and the cross-reference to avoid ugly line breaks between them.
1
described in section 3.5.1

97
CHAPTER 6. MORE TOOLS

There are eight formats of cross-references:


<reference>: prints the number, this is the default: 4.2
(<reference>): prints the number within two parentheses, this is the style normally
used to reference formulas, especially when the reference name “Equation” is
omitted: (5.5)
<page>: prints the page number: Page 85
on page <page>: prints the text “on page” and the page number: on page 85
If the label is on the same page, it prints “on this page”; if the label is on a
facing page in a two-sided document, it prints “on the facing page”; if it is on
the previous page which is not a facing page, it prints “on the previous page”;
if it is on the next page which is not a facing page, it prints “on the next page”.
The wording of the printed text also depends on the used document class.
<reference> on page <page>: prints the number, the text “on page” and the
page number: 4.2 on page 85
If the label is on the same page, this format behaves like <reference>; other-
wise it behaves like on page <page>.
Formatted reference: prints a self defined cross-reference format.
Note: This feature is only available when you have the LATEX-package pret-
tyref or refstyle installed.
You can select which LATEX-package should be used for this feature by setting
the option Use refstyle (not prettyref) for cross-references in the menu Document ▷
Settings ▷ Document Class. The package refstyle is the default and preferred
because prettyref supports only English documents. The format is specified
by using the command \newref‌format (prettyref) or \newref (refstyle) in
the LATEX preamble of the document. For example redefining all references to
figures (which have the label shortcut “fig”) can be done for refstyle with this
command:
\newref{fig}{refcmd={Image on page \pageref{#1}}}
Note that neither prettyref nor refstyle predefines reference formats for all
available types. This is especially true for the wide variety of mathematical
‘theorem’ environments. So if you want to make formatted references to, say,
Propositions, then you will need to define the relevant format yourself. For
prettyref, you might do so as follows:
\newref‌format{prop}{Proposition \ref{#1}}
For more information about defining formatted references, have a look at the
package documentation [22, 23].
The options Plural and Capitalized will be available with formatted references
only if you are using the refstyle package.
If you activate the option Format cross-references in work area, LYX will at-
tempt to display the formatted reference as it would appear in output, e.g., as
“Theorem 1”, rather than just displaying the label.

98
6.2. TABLE OF CONTENTS AND OTHER LISTINGS

Textual reference: prints the caption or the name of the reference: Two images.
Label only: prints only the LATEX label for the reference: fig:Two-images
This allows for customization, using TEX Code, if you want to issue a command
that LYX does not support. If you are using refstyle, then you may want
to use the No Prefix option, which will output only the part of the reference
following the “:” separator. This is the form needed for e. g. refstyle’s range
commands.The number and current page of the referenced document part in
the output is automatically calculated by LATEX. The varieties are adjusted in
the field Format of the cross-reference window, that appears when you click on
the cross-reference.
You can only use the style <reference> to reference numbered document parts, while
the reference style <page> is always possible.
If you want to reference a section, put the label in the section heading; for floats put
the label in the caption; for footnotes put the label in it. Referencing formulas is
explained in section 5.4.
Right-clicking on a cross-reference opens a context menu. The entry Go to Label sets
the cursor before the referenced label (Ctrl-clicking on a cross-reference will also take
you to its corresponding label). This entry will be renamed in the context menu of the
label to Go Back so that you can use it to set the cursor back to the cross-reference.
You can also go back with the toolbar button or, using the menu: Navigate ▷
Bookmarks ▷ Navigate Back.
You can change labels at any time. References to the changed label will automatically
be updated so that you do not need to change them all manually.
If a cross-reference refers to a non-existent label, you will see in LYX “BROKEN”
in the cross-reference label and two question marks in the output instead of the
reference.
References are described in detail in the section Referencing Floats of the Embedded
Objects manual.

6.2. Table of Contents and other Listings


6.2.1. Table of Contents
The Table of Contents (TOC) is inserted with the menu Insert ▷ List/Contents/References ▷
Table of Contents. It is displayed in LYX as a gray box. If you click on it, the Outline
window appears, showing you the TOC entries as outline, which allows you to move
and rearrange sections in your documents. So this operation is an alternative to the
menu View ▷ Outline Pane that is described in section 2.6.1.

99
CHAPTER 6. MORE TOOLS

The TOC in the document output lists every numbered section automatically. If you
have declared a short title for a section heading, as described in section 3.3.4.4, it will
be used in the TOC instead of the section heading. Section 3.3.4.3 describes how the
level is adjusted that defines which section types are listed in the TOC. Unnumbered
sections are not listed in the TOC.

6.2.2. List of Figures, Tables, Listings and Algorithms


Table, figure, listings and algorithm lists are very much like the table of contents. You
can insert them via the Insert ▷ List/Contents/References submenus. The list entries
are the float captions and the float number.

6.3. URLs and Hyperlinks


6.3.1. URLs
Links to web pages or email addresses can be inserted via the menu Insert ▷ URL.
Here is an example URL: LYX’s homepage: https://www.lyx.org
By default, the URL text will always be in the style Typewriter. You can globally
change the formatting by putting to Document ▷ Settings ▷ LaTeX Preamble:
\urlstyle{<xx>}
where <xx> is either rm (Roman), sf (Sans Serif), tt (Typewriter), or same (use
whatever the current text font is). To have italicized URLs, use this instead:
\def\UrlFont{\rmfamily\itshape}
URLs will break between lines at certain characters, namely:
. @ \ / ! _ | ; > ] % ) , ? & ’ + = #
It does not break at a hyphen (-) by default, but you can change that by adding
hyphens to Document ▷ Settings ▷ Document Class ▷ Class Options ▷ Custom. If this still
does not break URLs suitably to you, a last resort is to put \usepackage{xurl}
to Document ▷ Settings ▷ LaTeX Preamble; this will cause URLs to be broken at every
character.
Note: URLs must not end with a backslash, otherwise you get LATEX errors.

6.3.2. Hyperlinks
Hyperlinks can be inserted with the menu Insert ▷ Hyperlink or with the toolbar button
. The appearing dialog has two fields: Target and Name. The name is the printed

100
6.4. COUNTERS

text for the hyperlink. The hyperlink type can be a weblink like this: LyX’s home-
page, an Email address like this: lyx-docs mailing list, a link to a file or any other
valid URI (such as tel:<phone no.>). The option Literal in the hyperlink settings
dialog allows to input TEX code to the Name field.
You can start applications via a hyperlink when you insert a weblink by adding the
prefix “run:” to the link target, but note that most PDF viewers disable such links
for security reasons.
Hyperlinks will automatically be hyphenated if necessary in the PDF output, and
become clickable in the DVI and PDF-output. To set the format of the link text,
highlight the hyperlink inset and use the text style dialog. This is for example a
hyperlink with bold sans serif text: LyX’s homepage
The link text color can be changed, when the option Color links is set in the PDF
Properties dialog (menu Document ▷ Settings ▷ PDF Properties). The link text is for
example set in this document to blue by adding the option
urlcolor=blue
to the field Additional options in the PDF Properties dialog.
To open the link while editing in LYX you can use context menu (or directly via Ctrl
+ right mouse button click).

6.4. Counters
One powerful feature of LATEX is its ability to manage counters. Mostly, this is
handled automatically, but there are times one wants to modify counters directly.
This can be done in LYX using the counter inset, which is accessible from the Edit
menu. This allows one to set a counter’s value; to reset it (to zero);2 to add to the
value (or subtract from it, since the value added can be negative); to save it; to
restore the saved value; and to print the value. These effects can also be limited to
LYX itself. And they will appear in HTML and DocBook output, as well as in LATEX.
There are five commands you can use:
1. Set counter: Allows you to assign a specific value to a counter
2. Increase counter: Allows you to add some specified amount to a counter (or to
subtract, if you choose a negative number)
3. Reset to zero: Sets the value of the counter to 0.
4. Save value of counter: Saves the value of the counter so that it can later be
restored.
2
Note that the section counter, e.g., starts with its value at zero and then is incremented to one
when the first section is created. So, if you want the next section to be section five, say, then
you need to set the section counter to four.

101
CHAPTER 6. MORE TOOLS

5. Restore value of counter: Restores the previously saved value.


The dialog allows you to choose which counter you wish to modify from all those that
are available in the current document class.

6.5. Appendices
Appendices are created with the menu Document ▷ Start Appendix Here. This menu
sets the document from the current cursor position to the end as the appendix part
of the book. This part is marked with a red borderline.
Every chapter (or section) within the appendix part is treated as an appendix, num-
bered with a capital Latin letter. The appendix subsections are numbered with this
letter followed by a dot and the subsection number. All appendix sections can be
referenced as if they were normal sections, here two examples:
Appendix D; Appendix A.1.15

6.6. Bibliography
There are two ways of generating the bibliography in a LYX document. You can
include a bibliography database, which is explained in sec. 6.6.2, or you can insert
the bibliography manually, using the paragraph environment Bibliography, which is
described in the following section (but see also sec. 3.3.9.2). If you want anything
other than the numerical citations that are used in this document, such as author-
year citations, and if you have more than a handful of references, then you should
seriously consider using a bibliography database.
In order to demonstrate the difference between these two approaches, we use two
bibliographies in this document, a Bibliography environment and a database-generated
bibliography. As you can see, the bibliography that is created from a database lists
only the database entries that are referenced in the document. In other words, the
database approach relieves you, amongst other things, from the burden to check
which entries you have actually cited.

6.6.1. The Bibliography Environment


Within the Bibliography environment, every paragraph begins with a gray bibliogra-
phy box labeled with a number. If you click on it, you will get a dialog in which
you can set a Key and a Label. The key is the symbolic name by which you will
refer to this bibliography entry. Each entry needs to be given a unique key, which is

102
6.6. BIBLIOGRAPHY

one word consisting of ASCII characters only.3 For example, our second entry in the
bibliography is a book about LATEX and we used “latexcompanion”, a short form of
its title, as the key.
If you set a Label for the entry, references to it will appear with this label instead of
the number of the entry. The option Literal in the bibliography items settings dialog
allows to input TEX code to the Label field.

You can cross-reference a bibliography entry using the menu Insert ▷ Citation or the
toolbar button . A citation reference box is inserted and a citation window will
appear containing the available citations. Select one or more keys from the list
and Add them. Then press OK. The citation reference box will be labeled with the
referenced key(s). If you click on the box, the citation window will appear and you
can change the reference.

Citation references appear in the output as the number or the label of the bibliography
entry with surrounding brackets. Here are two examples; the first without a label,
the second with the label “Credits”:

Have a look at the LATEX Companion Second Edition: [1]

The LYX-Team members are listed in the Credits: [Credits]

You can also produce author-year or author-number citations, using the LATEX pack-
age natbib. In order to do so, select Natbib (BibTeX) in the document settings dialog
under Bibliography ▷ Style format (see 6.6.2.4). Once you have done that, the Bibli-
ography item settings dialog has three input fields instead of the Label field: Author
Names, Year and All Author Names. The first one takes the Author list as it should be
displayed in the citation reference, the second the year (without parentheses). These
two are madatory. If there are multiple authors and you want to both refer to them
as a full list (Baker, Jones, and Williams) and in abrreviated form (Baker et al.),
add the abbreviated form to Author Names and the full list to the optional All Author
Names field. If specified like this, you can select between different author-year or
author-number styles in the Insert ▷ Citation dialog, and if All Author Names is spec-
ified, toggling “All authors” in the citation dialog or the citation context menu will
switch between full and abbreviated list. Note that the author and year specified in
the dialog are only used for the citation references. In the bibliography entry, author
and year must be added manually.

To align all entries in the bibliography environment you can set a longest label via
the menu Edit ▷ Paragraph Settings (toolbar button ). All entries are then indented
in the output by the width of the given label.

3
ASCII means this set of characters:
https://en.wikipedia.org/wiki/ASCII#Character_set

103
CHAPTER 6. MORE TOOLS

6.6.2. Bibliography databases


Bibliography databases are useful if you use the same references in different doc-
uments.4 It also makes it very easy to have a uniform layout for all bibliography
entries. You can collect the bibliography of all relevant books and articles of your
working field in a database. This database can be used for different documents, and
by default only the entries cited in a particular document will appear in the bibliog-
raphy list for that document. This relieves you of the need to keep track of which
articles and books you have cited.
The database is a text file with the file extension “.bib”, containing the bibliography
in a special format. The format is explained in [8] and in the LATEX books ([MG04,
KD03, Lam94]). The file can be created using any text editor, but normally one uses a
special program to create and edit the entries in the database. A list of such programs
is maintained on the LYX Wiki at https://wiki.lyx.org/BibTeX/Programs.
LYX supports two different approaches to use bibliography databases in a document.
BibTEX is the classic technique that has been the only way to use such databases
for a long time. It is quite established and mature and there is a huge range of
existing styles available. But it has its drawbacks, especially when it comes to more
complex bibliographic needs and support for specific languages and scripts. Those are
addressed by biblatex. It reads the same database format than BibTEX (although
it has been significantly extended beyond BibTEX’s scope)5 , but it uses a different
framework to generate citations and references from it.
To select if BibTEX or biblatex should be used, set in the document settings (menu
Document ▷ Settings) under Bibliography the Style format to a BibTEX or a Biblatex
format.

6.6.2.1. BibTEX
To access a database via BibTEX, use the menu Insert ▷ List/Contents/References ▷
Bib(la)TeX Bibliography. A window will appear in which you can add one or more
databases and select a BibTEX style file. The option Add bibliography to TOC adds a
table of contents entry for the bibliography. In the Content drop box you can select
whether to include all the entries in the database in the document or just the cited
references. The Encoding drop box lets you specify the encoding of the database(s),
should this differ from the encoding of the document.
The BibTEX style file is a text file with the file extension “.bst” that controls how
the bibliography entries will appear. Your LATEX distribution should provide several
4
They are also useful for keeping a database of articles and notes concerning them. Most of the
database programs mentioned below allow you to store annotations and reviews along with
bibliographical information.
5
Meaning: While Biblatex can handle any classic BibTEX database, BibTEX might conversely
fail to correctly handle databases that use specific Biblatex features.

104
6.6. BIBLIOGRAPHY

of these, and many publishers provide their own style files, so that you don’t have to
take care of the layout. It is of course possible to write your own style file, but this is
something for experts.6 In this document we used the BibTEX style alpha.bst, which
provides an alpha-numeric style.
Inserting a citation reference works as described in the previous section.

6.6.2.2. Biblatex
Accessing a database via biblatex is almost identical to BibTEX: use the menu
Insert ▷ List/Contents/References ▷ Bib(la)TeX Bibliography. In contrary to BibTEX you
cannot select a style file at this place. The other dialog options are the same as with
BibTEX. As for the styles, note the following.
biblatex has two different style files: a bibliography style file (text file with the file
extension “.bbx”) controls how the bibliography entries will look like and a citation
style file (text file with the file extension “.cbx”) controls the look of the citation
references in the text. Usually such style files come in pairs and it makes sense to
use matching styles. It is nevertheless possible to mix any citation style with any
bibliography style.
biblatex styles are not set in the Bib(la)TeX Bibliography dialog, but in the document
settings. However, in the dialog in the Options field, which is only visible if you use
biblatex, you can enter options that determine how the bibliography is printed (for
example how its heading will appear). These options are described in detail in the
biblatex manual, [9].
Inserting a citation reference works as described in section 6.6.1.

6.6.2.3. Bibliography Processors


To generate the bibliography from a database, LYX uses a bibliography processor,
that is an external program that reads the database, sorts the citations and pro-
cesses the data in a way it can be included in the document. The classic program is
called BibTEX. It has the advantage that it is very mature and widespread, but the
disadvantage that it has severe limitations, due to its age.
Meanwhile, some alternatives have been developed that address some of these limi-
tations. LyX natively supports some of them and lets you select a custom processor.
You can do this on a general level in Tools ▷ Preferences ▷ Output ▷ LaTeX or for in-
dividual documents in Document ▷ Settings ▷ Bibliography. The following variants are
available by default:
6
For information on how this is done, have a look at
https://www.ctan.org/tex-archive/biblio/bibtex/contrib/doc/btxhak.pdf.

105
CHAPTER 6. MORE TOOLS

biber a specific, modern processor developed exclusively for biblatex (it does not
work with BibTEX!). biber provides full Unicode support, unlimited memory
and many specific features biblatex makes use of; if you use the biblatex
approach, it is strongly recommended to use biber.
bibtex the standard; does not allow special characters in bibliography entries that
are not possible to encode in a 7-bit encoding, limited memory, works with all
bibliography packages, although it will probably fail with biblatex bibliogra-
phies due to the limited memory.
bibtex8 allows all characters that are possible to encode in an 8-bit encoding (but
no Unicode support), larger memory than bibtex, works with all bibliography
packages, although more complex biblatex bibliographies will exceed its limits,
and not all biblatex features are supported.
By default (with the Processor set in Document ▷ Settings ▷ Bibliography and with Auto-
matic as setting for the Processor in Tools ▷ Preferences ▷ Output ▷ LaTeX), LYX selects
an appropriate (available) processor for the current bibliography approach (biber
for biblatex, bibtex for BibTEX-based bibliography styles). This should suit most
needs.
In Japanese documents, a specific processor is used. By default this is pBibTEX (in
LYX pbibtex), a BibTEX variant specifically aimed at Japanese. You can adjust it in
Tools ▷ Preferences ▷ Output ▷ LaTeX.
Selected bibliography processors can be controlled with options that you can add
below the selection. Before adding options, it is strongly recommended that you read
the manual of BibTEX or biber, [7, 10].

6.6.2.4. Customizing
LYX supports some specific tasks such as sectioned bibliographies and multiple bib-
liographies. These are explained in detail in section Customizing Bibliographies with
BibTEX or Biblatex of the Additional Features manual.Citation Format
Many different citation formats are common, e. g. numerical citation (as “1” like in
this document), alpha-numerical citations (as “Mil08”) or author-year citations (as
“Miller (2008a)”). LYX supports these formats via specific citation packages and
their style files.
By default a simple numeric citation style is used. In Document ▷ Settings ▷ Bibliography
you have a range of other options, depending on your preferred bibliography approach.
With the Bibliography environment your only choice besides manual formatting of the
bibliography labels, is there to use Natbib (BibTeX) as Style format which gives you
author-year and author-numerical citations (see above 6.6.1 for details).
With a bibliography database (see 6.6.2) one has in contrary to the Bibliography

106
6.6. BIBLIOGRAPHY

environment full access to the formatting styles. These style formats are available:
Basic (BibTeX) the default BibTEX-based approached without any additional pack-
ages (simple numeric citations).
Biblatex loads the package biblatex and lets you select a style in the dropdown
boxes Biblatex citation style and Biblatex bibliography style below. Options to
the package biblatex can be entered in the Options field.
Biblatex (natbib mode) loads the package biblatex with the natbib compatibility
mode. This is a specific variant for users who switch an existing document that
uses natbib or want to emulate the natbib behavior very closely. Compared
to normal Biblatex this option has some additional styles. All biblatex styles
are also supported by this variant.
Jurabib (BibTeX) loads the package jurabib which provides author-year styles par-
ticularly suited for law studies.
Natbib (BibTeX) loads the package natbib which provides citation styles particu-
larly suited for the humanities.
The Biblatex and Natbib style formats provide the choice between author-year and
author-numerical citation styles. You have to select one style in the dropdown box
Variant. Note that for the Biblatex formats, this only affects the appearance in the LYX
workarea. Whether the output uses numerical, author-year or another format such as
alpha-numerical depends only on the selected Biblatex citation style. However, when
switching between Author-year and Author-number, a suitable style is proposed.
With Natbib, on the other hand, the dialog selection will ultimately determine the
style.
For any author-year and author-numerical selection, multiple style variants are avail-
able in the Citation dialog. Some selections also provide further options like the
option to uppercase a name prefix such as “van Beethoven” (to “Van Beethoven”) or
to expand or reduce the number of displayed others (i. e. use or don’t use “et al.”).
In the citation dialog you can also set text to appear after a citation reference, e. g.
page numbers, which will then be formatted according to the style’s needs (e. g. with
or without “pp.”). The option Literal in the citation dialog allows to input TEX code
to the fields Text before and Text after. Here is a simple example where the text
“Chapter 3” appears after the reference:
Have a look at [1, Chapter 3].
All styles except for Basic (BibTeX) also provide the feature to add text that precedes
the reference (such as “cf.”). This text is then also included in the parentheses, if the
style requires this.
Note that these pre- and postnotes apply to the whole citation. So if you refer to
multiple references at once, the prenote will precede the first citation in the list, the

107
CHAPTER 6. MORE TOOLS

postnote will follow the last. Some Biblatex styles allow to add pre- and postnotes to
any individual reference in a multi-citation (so-called “qualified citation lists”). LYX
supports this. If you use such a style and if the current reference includes multiple
items the Citation dialog will display three columns in the field Selected Citations:
Text before, Cite key and Text after. If you double-click on an item’s Text before or
Text after field, you can add such individual pre- and postnotes. In the General text
before and General text after fields you can add pre- and postnotes that apply to the
whole list.

6.6.3. Opening cited documents from within LYX


LYX supports opening documents selected citations point to via the Try to Open Ci-
tation Content. . . context menu if specific conditions are met:
• If citation entries include any of the fields url or doi for BibTeX and BibLaTeX,
eprint for BibLaTeX (covering arXiv, JSTOR, PubMed, HDL, Google Books
eprinttype), the action will launch a web browser with the appropriate link.
• If citation entries include any of the fields file (filled by JabRef and Zotero) or
localfile (filled by KBibTeX) containing an URL that points to a file on your
local drive, the action will launch an appropriate file viewer. At the moment
only absolute paths are accepted.
In addition to that, LYX also searches7 your disk for matching files if you enable
Search drive for cited files in Tools ▷ Preferences. . . ▷ Edit ▷ Control. It uses the tokens
supplied at Pattern in the same preferences section (by default: year and authors8 ).
Any of the tokens in the pattern must occur in the name of the file (at arbitrary
position). LYX opens the first matching file it finds. This might or might not be
the file you are looking for; the more systematic your file naming is, and the less
ambiguous keywords you use, the greater the chance this works for you.
The pattern syntax uses specific keywords. These are basically BibTEX fields (such
as title) embraced in %, but there are also special keys, which are documented in
the Customization manual, sec. Cite format description.

6.6.3.1. Security implications


Note that any document (or mainly .bib file in this case) coming from a third party
might contain malicious links or otherwise malformed URLs and we suggest you do
7
By default we provide python script lyxpaperview.py for the search, but you can use any mod-
ified script by setting \citation_search_view variable in the file preferences in your local
configuration directory (please refer to the respective section at Help ▷ Customization). The de-
fault setting is to be found in the file lyxrc.defaults in the same directory and can be copied
and modified for this purpose.
8
Provided by token sequence %year% %abbrvciteauthor%. Note that some constituents (“and”,
“et al.”, commas) are automatically stripped from the result.

108
6.7. INDEX

not use this feature for other documents than those you prepared yourself.
For that reason the searching on disk is disabled by default and you will be asked for
confirmation of viewing all the links (both can be bypassed, but beware what you
are doing).

6.7. Index
An index entry is created if you use the menu Insert ▷ Index Entry or the toolbar button
(but see section 6.7.7 for some advanced methods). A collapsible inset with green
label is inserted; this holds the text that appears in the index (if you read this in
LYX, see the “Index generation” index inset in the heading above for example). The
word where the cursor is in, or the currently highlighted text, is proposed by LYX as
index entry (i. e., copied into the inset).
The index list (which prints out the index in your document) is inserted via the
menu Insert ▷ List/Contents/References ▷ Index List. A light blue box labeled “Index”
will show the place where the index will be printed. By default, the index list box is
not clickable like other LYX insets, as there are no settings to make. This changes if
you select “Use multiple indexes” (see section 6.7.9). In this case, the box turns gray
and can be clicked (as there are now settings that can be made).
By default, an index entry is simply a word or phrase in the (alphabetically ordered)
index list with a reference to the page or pages where the index entry has been inserted
in the document. However, you can customize index entries to look different. You
can group index entries hierarchically, let the index list refer to a range of pages
rather than a single page, let it refer to another entry in the index list rather than,
or additionally to, a page, you can format the page reference (e. g., make it bold for
specific pages), and you can determine the order of an entry in the list. These features
are available in LYX either as “subinsets” via the menu Insert ▷ Index Properties that
appears if the cursor is in an index entry or via the index settings dialog which can
be opened via right mouse click on the index inset.
We describe these features in turn in the next subsections. For a detailed description
of LATEX’s index mechanism, have a look at one of the LATEX books [1, 2, 3].

6.7.1. Grouping Index Entries


Index entries are often hierarchically grouped to offer the reader a fast search in the
index and to hold categories together (e.g., Fruits ▷ Apples ▷ Pink Lady). This can
be done in LYX via Insert ▷ Index Properties ▷ Subentry or, more easily, by pressing the
Enter key in an index. Both methods insert a subinset in which you can enter the
subentry. Maximally two such subentry insets, i. e., three levels of grouping in total,
are allowed per index entry. Note that it does not matter where you insert these

109
CHAPTER 6. MORE TOOLS

subentry insets in the index inset, but the order of them matters and determines the
grouping hierarchy. In the LYX file, the index entry in the header above shows an
example for a two-level grouped entry (and you can see the result in the index of this
document at the entry Index ▷ Grouping).

In the output, each subentry is on a new line and indented a bit more. Note that
the higher levels only get their own page references if they have also a separate entry
(without subentry).

Note also that in LATEX, subentries are indicated by a preceding exclamation mark
character “!”. This also works in LYX, although you have to take care that the
character is not formatted. For this reason, a real exclamation mark has to be
inserted to an index entry in a specific way. See section 6.7.6 for details.

6.7.2. Page Ranges


By default, an index entry refers to single pages where the index entries have been
inserted. If you want to refer to a page range instead, you can do this by inserting
two index entries: one that marks the beginning of the range, the other that marks
its end. Both need to contain the same index entry (and possibly subentries) text.
To mark start and end, select the respective Page Range option in the index inset
settings dialog. Range starts and ends are indicated in the index inset label via “(“
and “)”.

Note that you have to take care that range markers are complete. If a range start
without a respective end (or vice versa) is found, the index processor might terminate
and not produce an index without informing you about the reason.

6.7.3. Cross Referencing


It is also possible to refer to another index entry rather than, or in addition to, a page.
This might be useful if you anticipate that your readers might look for an entry at
different places, e. g., Graphics or Images (which could be resolved by a cross reference
“Images, see Graphics”) or also if you use hierarchical grouping (section 6.7.1), as in
“Apples, see Fruits”.

This is possible in LYX via Insert ▷ Index Properties ▷ See.

If you want a cross-reference and page references, you can use Insert ▷ Index Proper-
ties ▷ Seealso. This outputs “see also” instead and makes more sense if you also add
entries that are referred to by page number as in “Apples, 3, 12, 22, see also Fruits”.

110
6.7. INDEX

6.7.4. Index Entry Order


Sometimes the automatic ordering of index entries is not the one you want. This
might be the case with some index processors (such as makeindex) if you use accented
characters in the index entry or if you use macros.
To accommodate for that, you can use Insert ▷ Index Properties ▷ Sortkey. The sortkey
you enter here is not output in the index, it is just used for sorting (instead of the
actual entry). For instance, you can pass the sort key “zizek” to sort the name Žižek
should your index processor be incapable to sort Slovenian postmodern philosophers
correctly.
Note that in LATEX, sortkeys are separated from the actual entry by the character
“@”. This also works in LYX, although you have to take care that the character is not
formatted. For this reason, a real @ character has to be inserted to an index entry
in a specific way. See section 6.7.6 for details.

6.7.5. Index Entry Formatting


The appearance of index entries can be formatted as usual via the text style dialog,
the toolbar or shortcuts. Entries will appear in the index list in the way they are
formatted in the index entry. Note that this also means that two differently formatted
otherwise identical entries, e. g. Bananas and Bananas, will be listed separately.
To format a page reference, use the Format option in the index entry settings dialog.
You can either select one of the proposed formatting options (Bold, Italic, Emphasized)
or Custom. With the latter, you are supposed to enter a valid LATEX macro without
leading backslash, e. g. a self-defined command myformat or an existing macro such
as textsf.
In general, we encourage you to use self-defined commands. This makes it easier to
change the formatting, should you or your publisher decide to do that later. For
instance, add a formatting macro for index entries that refer to the page(s) where
the indexed term is defined by putting the following in the preamble
\newcommand*\IndexDef[1]{\textit{#1}}
and add the custom formatting IndexDef to the respective entry settings dialog.
This will cause all page references that use this custom format to be printed in italics.
If you change your mind later or if your publisher insists that definitions must not be
italic but bold, you just need to change the macro in the preamble, not every single
index entry.
Note: If you use the index processor xindy rather than makeindex or xindex (see
section 6.7.8), such custom macros do not work out of the box. This is because xindy
requires you to define semantic elements in the xindy “module” (style file) you use

111
CHAPTER 6. MORE TOOLS

before they can be used. In the given case, this would require to add the following
line in the module file:
(markup-locref :open "\IndexDef{" :close "}" :attr "IndexDef")
Please refer to [1, p. 678 ff.] for details.
You can also change the layout of the whole index. For example, if you mark the
index list box as bold, you will get a bold font for all index entries. In general,
however, it is better (and required for more advanced tasks) to set up a so-called
Index Style File (makeindex), module (xindy) or config file (xindex) to determine the
formatting; please refer to the makeindex, xindy or xindex documentations for details,
[11, 13, 14]. There are also some LATEX packages available that ease such formatting,
see https://ctan.org/topic/index.

6.7.6. Special Characters in Index Entries


As already mentioned above, some characters have a special meaning in index entries,
namely: !, @, ", and |. If you use them literally, you might get surprising results or
even a non-working index. In any case, you will not get the character itself.
In order to use these characters in inset entries, they have to be ‘escaped’, that is
prepended by a character that tells the index processor to treat this character without
its special meaning. By default, the escape character is " (but this can be changed).
So enter "!, "@, "", or "| to get the special character you want. Note that the escape
character, ", must be inserted in a TeX code box (see section 6.11.1).

6.7.7. Convenience Functions for Index Handling


Indexing a document can be a tedious task, since you often have to insert the same
index entry multiple times in order to refer to passages at different pages. This is not
only time-consuming, but also error-prone; e. g., you have to remember how exactly
an inset entry has been inserted to avoid redundant entries. LYX provides some
functions to ease the task.
First, if you want to add an entry which you already used before, you can open the
outliner via View ▷ Outline Pane (see section 2.6.1), select the Index Entries section (it
is convenient to have this open while indexing anyway), scroll to the entry in question
(if you check Sort, it will be more easier), then right-click on the entry and select
Insert Copy at Cursor Position from the context menu. This will do just what it says:
it will insert a copy of that index inset at the position where the cursor is.
Second, LYX also provides a semi-automated solution to index a word. If you right-
click on an index entry inset, you can select from the context menu Index All Occur-
rences of this Word. This will search the whole document (only single documents,

112
6.7. INDEX

not master and child documents) and insert a copy of this index inset after each oc-
currence of the word that precedes the inset. Note that casing of the word does not
matter, but only full words in the same grammatical form are considered (so if table
is the word before the index entry, Table will be considered as well, but not tables).
Please take care to not overuse this function and to carefully check the result after-
wards. Remember, a good index does not simply list all occurrences of a given word
in a specific document (that is a concordance rather), but only relevant occurrences!
So as convenient as this function might seem, it is suitable especially for particular
cases. With others, you will have more work with removing again falsely inserted
entries than you would have with manually inserting them at the right place.

6.7.8. Index Processor


If the index processor, xindy, is installed, LYX uses it (the texindy variant of it, for
that matter) for index generation; otherwise the program makeindex, the program
that is part of every LATEX distribution, is used. As a further option, you can select
the rather new xindex index processor.
• Makeindex is very old, no longer under development and has many pitfalls,
notably that it was developed with only the English language in mind. So it
fails to sort anything other than a monolingual English text correctly (we have
shown above, section 6.7.4, how to manually fix this sorting, but this is very
tedious work).
• The alternative program, xindy, is a newer and much more mighty alternative.
It can sort most languages correctly, and it is also much more customizable in
the output. However, also xindy is no longer actively maintained, and it has
bugs that are most likely not being addressed anytime soon. Also, xindy is not
always available out of the box and quite a challenge to install on some systems
(particularly Windows). But if you have it available, it is almost always a better
option than makeindex.
• The third option, xindex, is a quite new and actively developed index processor.
It is included in modern TEX distributions such as TEXLive and MikTEX, is
pretty much customizable and supports many languages. The program is still
in development, so not everything might work equally well than in the older
processors. But the program is definitely worth a try, particularly if xindy does
not work or not satisfy your needs.
All processors can be controlled by options that can be set in LYX’s preferences dialog,
see section C.6.2. The available options are listed and explained in [12, 13, 14]. In
this dialog, you can even specify arbitrary alternative programs to generate the index.
If you need specific options or an alternative index program only for a given document,
you can define the program and/or the options in Document ▷ Settings ▷ Indexes. This

113
CHAPTER 6. MORE TOOLS

is especially useful if you need to pass language-specific options to the index program
or if you need a specific layout style.

6.7.9. Multiple Indexes


In many fields it is common to have more than one index. For instance, you might
need to set up a separate “Index of Names” next to the standard index. LATEX does
not provide this possibility out of the box, but there are packages that add this
feature. LYX uses the splitidx package to generate multiple indexes. The package
is included in all recent LATEX distributions.9
To set up LYX for the use of multiple indexes, go to Document ▷ Settings ▷ Indexes and
select the option Use multiple Indexes. Note that the list Available Indexes already
contains the standard index “Index”. To add further indexes, add the name of the
index (in the form that should also appear as a heading) to the New input field and
press the Add button. The new index now also appears in the list. If you like, you
can attribute an alternative LYX label color to the new index.
Once the document changes have been applied, you can find the new index list in
Insert ▷ List/Contents/References and the Insert menu has a separate entry for each of
the defined indexes. The workflow is basically the same as for the default index, but
there are additional features:
• If you want to change the attribution of a specific index entry, right-clicking on
the entry’s label will open a dialog where you can do that.
• By right-clicking on an index, you can change its type. Furthermore, you can
specify an index to be a Subindex. If you do that, the heading of that list will
be decreased by one level. For example, if you use a book class, where the
standard index heading is defined as a chapter, subindexes will be defined as
sections and can thus be nested to the non-subindexes.
• The option Literal allows to use TEX code in the name of the index.

6.8. Nomenclature/Glossary
Sometimes you need to provide a list of technical terms or symbols that are mentioned
in your document with a brief explanation of them – a so called nomenclature or
glossary.
To be able to create nomenclatures or glossaries, you need the LATEX package nomencl
installed. You find it in the TEX catalogue, [5] or in the package manager of your
9
If yours does not ship it, consult the TEX catalogue, [5]. Note that the package does not only
consist of a LATEX style, but it also includes specific preprocessor programs that need to be
installed as well. Please consult the package’s manual for details.

114
6.8. NOMENCLATURE/GLOSSARY

LATEX-system.
A nomenclature entry is created if you place the cursor after a symbol entry and
then use the menu Insert ▷ Nomenclature Entry or the toolbar button . A gray box
labeled “Nom” is inserted and a window pops up asking for the nomenclature entry.
A nomenclature entry consists of two main entries. The first is the term or Symbol
that you wish to define. The second is the Description of the term or symbol.
Note: To use TEX code for nomenclature entries the option Literal in the nomencla-
ture dialog has to be used.

6.8.1. Nomenclature Definition and Layout


If you have symbols in formulas, you have to define them in the Symbol field as LATEX
formulas. For example to get “σ”, insert this:
$\sigma$
The “$” character starts/ends the formula. The LATEX-command for the Greek letter
is the name of the letter beginning with a backslash “\”. For capital Greek letters,
start the command also with a capital letter, like \Sigma.
(A short introduction to the LATEX syntax is given in section 6.11.2.)
You cannot use the Text Style dialog to format the description text; you have to use
LATEX-commands. For example the description of the nomenclature entry for the “σ”
in this document is:
dummy entry for the character \textsf{sigma}
The command \textsf sets the fonts to sans serif. To get bold font use the command
\textbf, for typewriter use \texttt, for emphasized use \emph.
To customize the appearance of all symbols add e. g. the command
\renewcommand{\nomlabel}[1]{\textsf{\textbf{#1}}}
to the LaTeX preamble in the document settings. This command will make the font
of all symbols bold and sans serif.
If the characters | , ! , @ and " should appear in nomenclature entries containing TEX
code they need to be escaped by adding a percent character in front of them.

6.8.2. Sort Order of Nomenclature Entries


The nomenclature entries are sorted alphabetically by the LATEX-code of the symbol
definition. This leads to undesired results when you, for example, have symbols in
formulas. Suppose you have nomenclature entries for the symbols a and σ. They
will be sorted by “a” and “$\sigma$” – the σ will be sorted before the a since the
character “$” is considered in sorting.

115
CHAPTER 6. MORE TOOLS

To control the sort order, you can edit the Sort as field of the nomenclature dialog.
Then the nomenclature entry will be sorted by this entry and not the symbol defini-
tion. For the example given, you can insert sigma in this field for the σ, then a will
be located before σ.
For subgrouping and tips for using sort entries see the nomencl documentation, [21].

6.8.3. Nomenclature Options


The nomencl package offers some options to adjust the appearance of the nomen-
clature. Here are some of its options; for more have a look at its documentation:
refeq Appends the phrase “, see equation (eq)” to every nomenclature entry, where
eq is the number of the last equation in front of the nomenclature entry
refpage Appends the phrase “, page (page)” to every nomenclature entry, where page
is the number of the page on which the nomenclature entry appeared
intoc Inserts the nomenclature in the Table of Contents
To use one or more of the options, add them to the comma-separated document class
options list in the Document ▷ Settings dialog. In this document the options refpage,
intoc are used.

You can also use the first two options above only for certain nomenclature entries
when you add one of the following commands as last entry to the Description field in
the nomenclature dialog:
\nomrefeq Like the refeq option
\nomrefpage Like the refpage option
\nomrefeqpage Short notation of \nomrefeq\nomrefpage
\nomnorefeq, \nomnorefpage, \nomnorefeqpage Turns off the corresponding op-
tions
Words like “page” are automatically translated for most document languages. If not,
add these lines in front of the nomenclature list as TEX code:
\renewcommand*{\eqdeclaration}[1]{
\unskip, see equation\nobreakspace(#1)}
\renewcommand*{\pagedeclaration}[1]{
\unskip, page\nobreakspace{}#1}
If the numbers should be hyperlinks, assure that you use Hyperref Support in the
document settings under PDF Properties and use instead:
\renewcommand*{\eqdeclaration}[1]{
\unskip, see \hyperlink{equation.#1}{equation\nobreakspace{}(#1)}}

116
6.9. BRANCHES

\renewcommand*{\pagedeclaration}[1]{
\unskip, \hyperlink{page.#1}{page\nobreakspace{}#1}}

6.8.4. Printing the Nomenclature


To print the nomenclature, use the menu Insert ▷ List/Contents/References ▷ Nomenclature.
A box labeled “Nomenclature” will show the place where the nomenclature is printed
in the output. By right-clicking on it, the amount of space for symbols can be altered.
You can choose between these settings:
Default a space of 1 cm is used
Longest label width the width of the widest symbol of all nomenclature entries is
used
Custom custom space
In the printed output the title of the nomenclature appears as “Nomenclature”. If
you are not happy with the name, you can change it by redefining the command
\nomname in the preamble. For example, in order to change the name to List of
Symbols, add the following line to the preamble:
\AtBeginDocument{\addto\captionsenglish{\def\nomname{List of Sym-
bols}}}
When you are using another document language than English, replace
\captionsenglish by \extras***, where *** is the name of the language used.

6.8.5. Nomenclature Program


LYX uses the program makeindex, that is part of every LATEX distribution, to generate
the nomenclature. LYX’s preferences dialog allows you to specify another program or
to control makeindex by adding options, see section C.6.2. The available options are
listed and explained in [21, 11].

6.9. Branches
Sometimes it is useful to hide some document parts in the output. For example a
teacher who is setting an exam obviously doesn’t want the pupils to see the answers,
but having questions and answers in the same document will make the life of the
markers of that exam much easier.
For these cases LYX allows you to put text into branches. The text will then only
appear in the output when its branch is activated. To create a branch, either select
the menu Insert ▷ Branch ▷ Insert New Branch (if you just want to specify a new branch)

117
CHAPTER 6. MORE TOOLS

or go in the Document ▷ Settings dialog to Branches, where you can specify and change
the name of the branch, its activation state (whether the content of the branch is
shown in the output or not), its background color inside LYX and whether the name
of the branch should be appended to the document file name on export if the branch
is active (see below for an example). Furthermore, the dialog lets you merge two
branches (just rename one branch to the name of the other) and to add “unknown
branches” (i. e. branches that were added to the document via copy and paste from
other documents, without having been defined) to the document’s branch list.
Text that should be in a branch is set into branch inset boxes. These boxes are
inserted via the menu Insert ▷ Branch where you can choose a branch. You can later
change the activation state of the branch by right-clicking on them.
Here is an example, where only the question text appears, the answer branch is
deactivated and therefore does not appear in the output:
Question: Who was the first physics Nobel prize winner?
If you activate Filename Suffix in Document ▷ Settings ▷ Branches, the name of the
active branches will be appended to the file name at export. Consider for example a
file “Exam.lyx” which has the above branches. If “Filename Suffix” is active, the PDF
export file would be called “Exam.pdf” if both the “Question” and “Answer” branch
were inactive, “Exam-Question.pdf” if only the “Question” branch was active, likewise
“Exam-Answer.pdf” if only the “Answer” branch was active, and “Exam-Question-
Answer.pdf” if both branches were active. This helps you to export different versions
of your document easily.

It is also possible to invert just some branch insets, whose content is output just in
case the branch is not activated (they are marked with ~ before the name). Such
insets make it easy to add alternative text for different versions of a document. To
control whether a particular inset is inverted, right-click on the inset button and
choose Invert Inset.
No answer: Because the “Answer” branch is deactivated.

To use conditional output inside places where you cannot insert branch insets, like
inside equations, you can code special LATEX definitions for each branch. For example
you can define for the question branch10
\newcommand{\question}[1]{#1}
\newcommand{\answer}[1]{}
and for the answer branch
\newcommand{\question}[1]{}
10
For an introduction to the LATEX-syntax, see section 6.11.2.

118
6.10. PDF PROPERTIES

\newcommand{\answer}[1]{#1}
Now it is possible to use the \question{. . . } and \answer{. . . } commands to
obtain conditional output. Here is an example formula where only the \question
part appears: √
x2 − 2x − 2 ⇒ x1 = 1 + 3.

Inside math, the same effect can be achieved using math macros, see the Math manual.
Each type of branch is allowed to have its specific style defined in layout files (e. g. any
branch inset can be automatically wrapped by your own LATEX commands.). For this
advanced usage, see the Customization manual, section Flex insets and InsetLayout).
In case you often need to keep all branches of a given name in sync as far as their
open/close status is concerned, you can use the LYX function branch-sync-all that
sets the open/close state to all branches of the same name from the branch currently
at cursor. You can bind it to a keyboard shortcut or add it to a user-defined context
menu for branch insets.

6.10. PDF Properties


Document ▷ Settings ▷ PDF Properties allows you to set up specifics of your document’s
PDF output. Most of these specifics are provided by the LATEX package hyperref
which you need to enable by clicking Use Hyperref Support in order to set the PDF
properties (if the package is already loaded by your document class or another pack-
age, the checkbox you need to click is labeled Customize Hyperref Options instead).
Among other things, hyperref hyperlinks all URLs and cross-references in the PDF
output. This means that the reader of your document will be able to click on an
URL, a table of contents entry or on a reference to open a website or to move to
the cross-referenced part of the document. Furthermore, you can set PDF metadata
(such as document author and title), or determine how the PDF is being opened by
the reader program.
The header information in the dialog tab General is saved together with the PDF as
file properties. Many programs are able to extract this information, for example, to
recognize who the author is and what the PDF is about. This is very useful to sort,
classify or use PDFs for bibliography issues. When the option Automatically fill header
is set, hyperref tries to extract the header information from your document title and
author entries. The option Load in fullscreen mode will open the PDF in fullscreen
mode, which is useful for presentations.
In the dialog tab Hyperlinks you can customize the look of such links, and you can
specify if and which bibliographical backreferences are created. Backreferences are
links inserted at the end of bibliographic entries pointing to either sections, pages or
slides on which these entries are being cited. The Break links over lines option allows

119
CHAPTER 6. MORE TOOLS

long links to be split; No frames around links and Color links both turn off the default
behavior of enclosing all links in frames; Color links colors the different links. The
default colors are:

magenta for hyperlinks and URLs

red for links

green for citations

but you can change these in the tab Additional Options. For example, in this document
they were changed with these additional options added to Hypersetup:

linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue

In the dialog tab Bookmarks you can specify if PDF bookmarks (shown as a collapsible
outline in the PDF reader) should be created for every section of your document to
make it easier for readers to navigate through the document. You can decide if the
bookmarks should be numbered like your document sections or not. By checking
Open bookmark tree you can instruct the PDF reader to uncollapse the outliner when
opening the PDF. Level determines up to which level this uncollapsing is done. For
example level 2 will display all sections and subsections, while level 1 will only display
the sections (collapsing the rest).

In the Additional Options dialog tab you can insert hyperref options which are not
among the ones described above as a comma-separated list (please refer to the hyper-
ref manual [19] for a full list and documentation of possible options). Note that these
options will be passed to hyperref via \hypersetup, not via the package options.
This will exclude some options that can only be specified via the latter. If you need
to use one of those options, you can set them by adding

PackageOptions hyperref option1,option2

in Document ▷ Settings ▷ Local Layout (but only if hyperref is not loaded by your doc-
ument class).

The Document Metadata input widget allows you to insert PDF properties that are
independent of the hyperref package and rely on some (rather new) LATEX core fea-
tures. This requires LATEX version 06/2022 at least (with earlier versions, input is
simply ignored). The widget expects a comma-separated list of key-value options
(such as pdfversion=1.7, lang=de-DE). At the point of writing this, the list of
options is still rather small and not very well documented (look for a file called
documentmetadata-support.pdf ), but it is expected that in the future, rather fun-
damental PDF properties (such as structure tagging for accessibility reasons and
different PDF standards such as PDF/A) can be set this way.

120
6.11. TEX CODE AND THE LATEX SYNTAX

6.11. TEX Code and the LATEX Syntax


6.11.1. TEX Code Boxes
As LYX uses LATEX in the background, it supports many LATEX commands and con-
structs, but not all. LATEX contains hundreds of packages that provide different
commands. All the time packages are being updated and new ones added. This has
the advantage that you can typeset nearly everything as there is a LATEX-package for
every problem, though LYX cannot support all packages and their commands.
But don’t worry, you can use any LATEX-command directly in LYX inside the TEX
Code box. A TEX Code box is created by the menu Insert ▷ TeX Code or by the toolbar
button (shortcut Ctrl+L). The box can be opened by left-clicking and closed by
right-clicking on it and selecting Close Inset.
You can insert complete or incomplete commands as TEX Code. Incomplete means
that the command argument can be Standard LYX text. For example, if you want to
draw a frame around a word11 and are therefore using the LATEX-command \fbox,
you can write the command part \fbox{ in a TEX Code box before the word and
the closing brace } in a second TEX Code box behind the word. The word between
the two TEX Code boxes is then the argument as it is in the following example:

gives
This is a line with a framed word.
Note: At the end of LATEX-commands without parameters, you have to insert a space
to let LATEX know that the command is finished.

6.11.2. A Short Introduction to the LATEX Syntax


When you write larger documents or books, you will need to know something about
the LATEX-commands that LYX uses in the background. Because LATEX is based on
commands, you can “program” your text. This has the advantage that the layout
of the document can be changed at any time if you know the right commands. For
example, imagine you have to write a manual for a product and the deadline is the
end of the day. Your boss has just complimented you for your good work but wants
to have all caption labels bold. But you have over a hundred figure and table captions
with non-bold labels in your manual. Of course it is impossible to change all caption
labels manually in one day.
Now LATEX comes into play. As mentioned above, for every problem there exists a
LATEX-package. First you have to find out which and therefore look in the LATEX
11
The LyX way would be to use a framed box.

121
CHAPTER 6. MORE TOOLS

package database, [WCT].


As result you find that the package caption is what you need. To use a package, you
have to load it in the document preamble (menu Document ▷ Settings ▷ LaTeX Pream-
ble) with the command
\usepackage[options]{package name}
All LATEX commands begin with a backslash, the command argument is set within
two braces and the options are set within two brackets. Note that not all commands
have an argument and options.
In your case the package name is caption. After a look in the documentation of the
package, you know that the option labelfont=bf will change the font of all caption
labels to bold. So you add the command
\usepackage[labelfont=bf]{caption}
to the preamble and the problem is solved.12
Note that some document classes have built-in solutions for well-known problems like
your case. For example if you use a KOMA-Script class, you don’t need the package
caption, you can instead write
\setkomafont{captionlabel}{\bfseries}
in the preamble and the problem is solved. So if you plan to write a large document,
you should have a look at the documentation of the document class you want to use.
(\setkomafont is an example of a command with more than one argument.)
Commands in the preamble affect the whole document, while commands in the text
affect only the text after the command or only the text used as command argument.
To insert a LATEX-command in text, use the TEX Code box as described in the previous
section.
If you want to learn more about LATEX and its syntax, have a look at the LATEX-books
[1, 2].

12
For more commands provided by the caption package, have a look at its documentation, [16].

122
6.12. CUSTOMIZED PAGE HEADERS AND FOOTERS

6.12. Customized Page Headers and Footers


To define a custom page header and footer line for your document, you need to set
the Page style to Fancy in the Document ▷ Settings dialog under Page Layout. As
a second step add in the menu Document ▷ Settings ▷ Modules the module “Custom
Header/Footerlines”. This module offers the following 6 environments:
Left Header, Center Header, Right Header
Left Footer, Center Footer, Right Footer
for the different positions in the header/footer. These environments can be selected
in the environment pull-down box.
Normally, headers and footers are set up at the beginning of the document. But you
can change them anywhere you want to. Figure 6.1 shows the page layout and where
the header/footer styles will appear.

Left Header Center Header Right Header

The normal text on the page goes here. The running header is above the
text, and the footer is below (including footnotes). Headers/footers
typically contain things like the page number, title of the chapter, company
logo but you can use almost anything, except of floats.

Left Footer Center Footer Right Footer

Figure 6.1.: Page layout with custom header and footer line.

Note: some document classes implement their own customized page headers and
footers if Page style is set to “Default”. Check what these are before you specify your
own customized page headers and footers.

6.12.1. Definition
To define your header line, add all three header environments. The things you add
to each environment appear on odd numbered pages, the things in the optional argu-
ments on even numbered pages. For single-sided documents, the optional arguments
will not be used and can be omitted. If you leave a header environment or its argu-
ment empty, nothing appears in the output. Defining the footer line works similarly.
For the definition, you will need some LATEX-commands that are inserted as TEX code
(menu Insert ▷ TeX Code):
\thepage prints the current page number
\Roman{page} prints the current page number with capital roman numerals

Magic code:

CXXIII
Υ = ♠ℵ
3
CHAPTER 6. MORE TOOLS

\roman{page} prints the current page number with small roman numerals
\leftmark prints the current section number and title. If the document has chapters,
it prints the current chapter number and title instead. It is called “leftmark”
because it usually goes in a left header.
\rightmark prints the current subsection number and title. If the document has
chapters, it prints the current section number and title instead. It is normally
used in the right header.

6.12.2. Default header/footer


The custom header/footer is not empty by default. The default header contains the
chapter and section title and the center footer has the page number. In order to
remove unwanted entries from the header/footer, include the relevant header/footer
style in your document, but leave it blank. So, if you do not want a page number in
the footer, include a blank Center Footer style.

6.12.3. Appearance
The header and footer will appear on normal pages. Some pages are different. The
title page has a header/footer environment of its own, and so does any page that
starts a new part or chapter in your book. Such pages will not have the custom
headers/footers, but that is normal. There is for example no need to print a header
with the chapter name on the chapter page where the chapter heading is in big bold
letters anyway.

6.12.3.1. Header and footer decoration line


By default, you get a 0.4 pt thick line below the header and no footer line. This can
be changed in the document preamble with the commands \headrulewidth and
\footrulewidth in the following way:
\renewcommand{\headrulewidth}{thickness}
where thickness is a size in standard units like pt or mm. If you don’t want a line,
set the thickness to 0 pt.
The lines can also be colored, but this requires more knowledge of LATEX. If you
really need this, have a look at the Internet or in section 4.4 of the book [MG04].

6.12.3.2. Several header/footer lines


In case you need more than one text line as a header/footer, you can do this by
adding a ragged line break in the style definition. However, the default height of the

124 LYX’s user guide


6.12. CUSTOMIZED PAGE HEADERS AND FOOTERS

header/footer is only the height of one text line. To expand the height, redefine the
LATEX length \headheight or \footheight with this entry in Document ▷ Settings ▷
LaTeX Preamble:
\setlength{\headheight}{height}
where height is a size in standard units (e. g. 1cm). If you don’t know how much
space is needed for the height, define your header/footer and preview your document
as a PDF. Then open the LATEX logfile with the menu Document ▷ LaTeX Log and
use the button Next Warning to see if you can find a warning about the package
fancyhdr. If there is such a warning, it contains the space that you need at least for
your header/footer.

6.12.4. This example


This example demonstrates what can be done with custom header/footers. Don’t use
it for your document as it is just an example. This example consists of the following
definition:
Left Header \rightmark, empty optional argument
Center Header empty, empty optional argument
Right Header empty, \leftmark in the optional argument
Left Footer empty, \thepage in the optional argument
Center Footer

LYX’s user guide, “Magic code:
Υ = ♠ℵ ” in the optional argument
3

Right Footer \Roman{page}, empty optional argument


\headrulewidth set to 2 pt
In principle you can use almost everything in headers/footers, except floats. For more
specialized features, for example, thumb-indexes, see the manual of the fancyhdr
package, [18].

Magic code:

CXXV
Υ = ♠ℵ
3
CHAPTER 6. MORE TOOLS

6.13. Previewing Snippets of your Document


LYX allows you to generate previews of sections of your document on the fly so you
can see how they will look in the final document without having to break your train
of thought with viewing the output.

6.13.1. Prerequisites
To get previews working, you need the LATEX package preview-latex (on some
systems named simply preview) installed. If it is not already installed, you will find
it in the TEX-catalogue, [5] or in the package manager of your LATEX-system. You
obtain prettier results if you install the program pnmcrop from the netpbm package;
for LYX on Windows this program and also the LATEX-package are automatically
installed together with LYX.

6.13.2. Enabling previews


If you would for example like to see in LYX your math formulas typeset by LATEX, acti-
vate the option Display Graphics in the Tools ▷ Preferences dialog under Look and feel ▷
Display. Then set Instant Preview to On. The Preview Size is the multiplication factor
for the size.
If you would like to see everything but your math formulas typeset by LATEX, set
Instant Preview to No math.
Previews are generated when you load a document into LYX and when you finish
editing an inset.
Note: Previews of an already loaded document are not in every case immediately
generated by activating the option Display Graphics. Reopening the document will fix
such problems.

6.13.3. Selected document parts


Besides math there are other cases where you might like to see a preview, for example
things that LYX cannot render like rotated parts or things that are not yet supported
by LYX. To do this, insert a preview inset via the menu Insert ▷ Preview. Insert or
paste the stuff that you want to preview into this inset. The preview will be generated
when the cursor is outside the preview inset. If you click on the preview, you can
edit the previewed stuff.
An example: To create rotated boxes, you use the LATEX command \rotatebox
which is not yet supported by LYX.13 Instead of the TEX Code boxes you want to see
13
\rotatebox is explained in section Rotated and Scaled Boxes of the Embedded Objects manual.

126
6.14. Advanced Find and Replace

in LYX the final rotated boxes, for example to adjust the rotation angle to fit with
the surrounding text. Therefore you create a preview inset and copy the text with
the rotated boxes into it. Here is the result:

wit

B
hr

x=
ota

Ad
ted

This is a line framed text and a formula.

R
Previewing works also for colors. In this example a special framed, colored box was
created using the LATEX command \fcolorbox:14

This is text within a colored, framed box.

If LYX does not show a preview, make sure that you enabled previews as described
above and also make sure that TEX Code in the preview inset is valid and that you
loaded the LATEX packages in your document preamble that are required by the TEX
Code. If LYX cannot create a preview, you will in most cases also not be able to view
your document due to LATEX errors. So if you have to use some TEX Code and don’t
know if it is correct, the preview inset is a nice method to check it without the need
to view the whole document.

6.13.4. LATEX source code


You can preview the LATEX source of the whole document or parts of it. Use the menu
View ▷ Source Pane and a window will be shown where you can see the LATEX-source
code. The window shows the source of the whole paragraph in which the cursor
currently sits. You can also select document parts in LYX’s main window, then only
this selection (when it is more than one paragraph) is shown as source code. To view
the whole document as source, enable the corresponding option in the source view
window. If you check Automatic update, you can see the changes as you make them
in LYX; but note that if you have several documents open, this will slow things down
as LYX updates them all, not just the one which is open at the time.

6.14. Advanced Find and Replace


6.14.1. Introduction
The advanced find and replace feature of LYX allows for searching of complex, format-
sensitive text segments and mathematics contents within LYX documents. It is an
enhancement of the standard (quick) find and replace feature. The key-features are:
14
\fcolorbox is explained in section Colored Boxes of the Embedded Objects manual.

127
CHAPTER 6. MORE TOOLS

• Both searching of text and of mathematical formulas is allowed, where the latter
is done by entering mathematics in the usual way; not only entire mathematical
formulas are found, but also parts occurring within more complex formulas
• Search may be format-insensitive, so that the searched text is found in any
context/style (standard text, section headings, notes, and even mathematics),
or it may be format-sensitive, so that, for example, a word entered with a
section heading will only be found within section headings
• Search may be restricted to mathematics environments only; this is useful for
remangling math notation where one does not want to match any text outside
of mathematics environments
• Search may be widened to a specific scope, i. e. a set of files which may be all
the children of the document being edited, all the open files, or all the manuals
available from the Help menu
• Replace may optionally preserve capitalization, so that the replaced text capi-
talization is adapted to the matching text (i. e. all lowercase, all uppercase, first
letter uppercase followed by lowercase)

6.14.2. Basic usage


The advanced find and replace feature is activated through the menu Edit ▷ Find &
Replace (Advanced) (shortcut Ctrl+Maj+F) or the toolbar button . This opens the
Advanced Find and Replace dialog.

6.14.2.1. Searching for text


Enter into the Find LYX mini-editor a simple word, and search for occurrences of it
by clicking on the Find Next button at the bottom of the dialog (or just press the
Retour key). The entered word is found both in text mode and in math mode, and
in emphasized, bold or normal face, and in both in section titles and in standard
text. Pressing Retour repeatedly keeps searching forward while pressing Shift+Return
searches backwards.
The Case sensitive option allows matches to occur only with the same case as entered
in the Find editor. The Whole words option allows matches to occur only at word
boundaries.

6.14.2.2. Searching for mathematics


Mathematical formulas, such as x2 or something more complex like 1+x 2 , may be
x 2

searched for by typing them in the Find editor. When searching for a formula, it is
found both when it is alone and when it occurs in sub-formulas and nested parts of

128
6.14. Advanced Find and Replace

sub-formulas. For example the mentioned segments would be found in something like
.
2
qx
x 2
1+x2

6.14.2.3. Style-aware search

It is also possible to search for text with specific styles. This is done by switching
to the Settings tab of the dialog and unchecking the Ignore format option. This way,
entering in the Find editor

• a normal word and searching for it would not find instances of the word occur-
ring in emphasized or boldface.

• an emphasized or boldface word and searching for it would find the respective
instances with the same face only, and within the same text style only.

• a normal word in a section heading, and searching for it, would find occurrences
of it only within section headings. Also, if the text to search is given an em-
phasized or bold face, in addition to a section style, then it is found only when
occurring with the same style.

• a displayed formula will only find instances of this formula that are also dis-
played formulas (and not inline formulas).

6.14.2.4. Replace

The entries made in the Find editor can be replaced with entries made in the Re-
place with editor. In order to find the next occurrence and replace it, click on the
Replace button or alternatively press Retour or Shift+Return while the cursor is in
the Replace with editor.

You can replace with fully-featured formatted LYX entries. Typical scenarios in which
to use this capability might be (just to mention two):

• replacing occurrences of a word with a customized formatted version of the


same word, for example replacing occurrences of a name like “func()” with its
typewriter version “func()”

• performing a notation rework of mathematical symbols, for example replacing


occurrences of “R” with “R” (you may want to enable the Whole words and
Case sensitive options and disable the Ignore format option in the Settings tab, in
order to avoid replacing all “R” letters occurring in normal text), or occurrences
of xij with xi, j , or occurrences of x[k] with xk .

129
CHAPTER 6. MORE TOOLS

6.14.2.5. Advanced usage


There is a regular expression (regexp) based searching facility.15 You can search
for a regular expression by inserting a regexp inset into the Find editor. This is
done with the context menu Insert ▷ Insert Regular Expression while the cursor is in
the Find editor. Characters entered within regexp insets are matched according to
the regular expression matching rules16 , while text entered outside regexp insets is
matched exactly against the same text in the document. You can cut and paste
regexp-mode insets. Examples of using such a feature may be:
1. Searching for all fractions with a given denominator: for example, entering in
the Find editor the fraction 1+x
.∗
2 (where the .∗ on the numerator is the match-

everything regular expression) finds all fractions with the given denominator.
2. Searching for all text with a given style: for example, after checking the Adhere
to search string formatting of and the Select all button in this section pressed,
entering a .∗ regular expression and giving it an emphasized or bold face, finds
all emphasized or bold face text respectively. Also, by inserting a .∗ regular
expression in a bullet or enumerated list or a section heading, you can find all
bullet or enumerated lists or section headings. The meaning of the specific style
options (if checked) is as follows:
Language Allows searching for text in specific language (relevant here is, as
with the other options, the setting of the search string)
Font color colored text like cyan, yellow, etc
Font family Roman, Sans serif, Typewriter
Font series e.g. Bold
Font shape e.g. upright, italic, ...
Font size e.g. Large, Tiny, ...
Emph/noun Semantic Markup: Emphasized, Noun
Underlining e.g. Single, Double, Wawy
Strike-through Single, With ’/’
Deletion searches also in deleted parts (in case of ’Track Changes’ enabled)
Sectioning markup e.g. title, part, chapter, section, ...
Finally, references to (sub)expressions in regexp may be used as usual: Enclosing
parts of the expression within round braces (), and referring back to them through
15
A good explanation of regular expressions is given in this Wikipedia entry:
https://en.wikipedia.org/wiki/Regular_expression.
16
Under the constraint that any (sub)expression must match a well-formed LYX segment, i. e. when
matching LATEX code, no segments with unbalanced {} braces are allowed to match expressions.

130
6.15. Spell Checking

\1, \2, etc.. For example, try searching with the regexp
\b(\w+)\s\1\b
in order to find word repetitions, if there are any.
The usage of back references in the replaced text is not (yet) fully implemented.
Note: Back references work both when occurring within the same regexp, and when
occurring in multiple different regexps, where the numbering of back-referenced sub-
expressions is absolute. That is, \1 always refers to the first occurrence of () in all
entered regexps.

6.15. Spell Checking


LYX has a built-in spell checker. The menu Tools ▷ Spellchecker, the F7 key or the
toolbar button start the spell checking from either the current cursor position
or the beginning of the currently selected text. A sidebar will appear showing any
incorrect (or unknown) word found, allowing you to edit and replace it in a second
line. Whenever an unknown word is found, the word is highlighted and the text
scrolled so that it is visible. In the spellchecker sidebar, there is a box showing
suggestions for a correction, if any could be found. Clicking on one of the corrections
will copy it to the Replacement field, double-clicking directly invokes the replacement.
Unknown but correctly typed words can be added to the personal dictionary.
By default, the dictionary file used is determined by the document language that
is set in the Document ▷ Settings dialog. You can specify the language of a word in
the spellchecker dialog by choosing a different one at the top of the dialog. LYX can
correctly spell check documents containing multiple languages. This works if you
have set the language of the text parts using the Text Style dialog ( ) and have the
spell checker dictionaries installed. LYX automatically switches to the appropriate
dictionary file.
All spell-checker dictionaries supported by LYX can be downloaded from here:
https://www.lyx.org/trac/export/HEAD/dictionaries/dicts/
You should download 2 files for each language (use Original Format link at the end
of the opened webpage). To install a dictionary on Windows, copy these 2 files into
LYX’s installation subfolder ~\Resources\dicts and restart LYX.
With Linux one needs to install the packages for the desired language. The number
of these packages vary depending on the Linux distribution, but in most cases these
are aspell-xx, hunspell-xx, myspell-xx, etc., where xx is the language code.

6.15.1. Further Settings


In the menu Tools ▷ Preferences ▷ Language Settings ▷ Spellchecker you can set the fol-
lowing things:

131
CHAPTER 6. MORE TOOLS

Spellchecker engine Select the library LYX should use for spell checking. Depending
on your platform, hunspell or enchant17 are available. On Windows only
hunspell is available. LYX on Mac OS can also use Mac’s own spellchecker
and will use it by default.
Alternative language If this field is not empty, LYX will always use the given lan-
guage for the spell checking, no matter what the document language is.
Escape characters Allows you to add non-standard characters that the spell checker
should escape, e. g. German umlauts. This should normally not be needed.
Accept compound words Prevents the spell checker from complaining about com-
pounded words like “passthrough”.
Spellcheck continuously Checks the spelling of your document as you type it. Mis-
spelled words get underlined with a dotted red line. By right-clicking on an
underlined word, suggestions from the spellchecker appear in a context menu.
Choosing one of them will replace the misspelled word with the suggested word.
Spellcheck notes and comments If enabled, the spelling of non-printed document
content is checked as well.

6.16. Thesaurus
LYX provides a multilingual thesaurus. It uses the same thesaurus framework as
LibreOffice, OpenOffice and Firefox (namely the MyThes18 thesaurus library, which
is included in LYX). Therefore, LYX is able to directly access OpenOffice thesaurus
dictionaries, which are available for many languages.
This section describes how new dictionaries are installed and set up for the use with
LYX.

6.16.1. Setting up the thesaurus


The MyThes/ OpenOffice thesauri consist of two files per language: A file with the
suffix *.dat containing the data and an index file with the suffix *.idx. The standard-
ized file names include the language code for the given language (e. g. en_US for US
English). For instance, the US English files are named:
• th_en_US_v2.idx
• th_en_US_v2.dat
17
Enchant itself is a wrapper library having different configurable back-ends. Please consult the
documentation or man-page of it to learn more.
18
https://lingucomponent.openoffice.org/thesaurus.html

132
6.16. Thesaurus

If you have LibreOffice or OpenOffice and its thesaurus installed, these files should be
already on your system and you just need to point LYX (in Tools ▷ Preferences ▷ Paths ▷
Thesaurus dictionaries) to the path where they are installed.19 On Windows, you
can alternatively also select dictionaries for installation during the LYX installation
process, which will then be installed in the correct place right away.
If you want to install new/updated thesaurus dictionaries, you can download them
from here:
https://www.lyx.org/trac/export/HEAD/lyxsvn/dictionaries/trunk/thes/
To install a new dictionary, download the two files for this dictionary into the the-
saurus path (which is set in Tools ▷ Preferences ▷ Paths ▷ Thesaurus dictionaries) and
restart LYX. If this path is not defined yet, you can use a dictionary of your choice
and point LYX there.
Alternatively, you can also install new dictionaries via LibreOffice/OpenOffice or, on
Linux, via your package manager (look for mythes-* or libreoffice-thesaurus-* pack-
ages). If you do this, make sure that LYX is able to find the installed dictionaries,
i. e. that Tools ▷ Preferences ▷ Paths ▷ Thesaurus dictionaries points to the path where
you installed these dictionaries.

6.16.2. Using the thesaurus


To start the thesaurus, use the menu Tools ▷ Thesaurus or the toolbar button while
the cursor is at the word you want to look up or while a word is selected. A dialog
pops up showing you probably related words that you can use as a replacement.
The suggestions are grouped into categories. Note that, for some languages (such as
English), the thesaurus does not only show equivalent words (synonyms), but also
generic terms (such as organism for plant), related terms (such as political theory for
anarchistic), compounds (such as tree diagram, if you look for tree) and opposites
(antonyms) (such as girl for boy). Generic terms, related terms and antonyms are
marked as such.
The language is automatically chosen from the language at the cursor, but you can
also switch it in the dialog, as you can enter new words to look up directly there.
Note that the thesaurus cannot handle phrases (only compounds that are in the
dictionary, such as the above tree diagram), and you have to use the so called lemma
form, i. e. the form that is used in the dictionaries (for many languages: first person
singular indicative active for nouns, infinitive for verbs). For example, looking up
19
On Linux, depending on your distribution and the way you installed the dictionaries, typical loca-
tions are /usr/share/mythes/, /usr/share/myspell/dicts/, /usr/share/ooo/thesaurus/,
~/.config/libreoffice/<version>/user/ or alike. On Windows, dictionaries are to be found
at ~\Program Files\LibreOffice-<Version>\share\extensions or similar. On the Mac,
the default location is /Users/<user name>/Library/Application Support/libreoffice/
<version>/user/.

133
CHAPTER 6. MORE TOOLS

the word form reporting yields no results, while results are shown for the word form
report. Your best bet is to highlight only the relevant part of such a word (e. g. report
in reports); then you will get suggestions without needing to adjust the query in the
dialog, and also the replacement will probably be correct (as only the highlighted
part will be replaced; thus the ending remains).

6.17. Change Tracking


When you work on a document collaboratively it is extremely useful to be able to see
changes that others have made highlighted in the document. You can then decide
if you want to accept a change or not. This can be achieved by turning on change
tracking in the menu Document ▷ Change Tracking ▷ Track Changes.
Changes made in the document will then be highlighted by strokes and colors:
underlined text is an addition, canceled text is a deletion. The color depends on
the author that made the change. You can change the color in Tools ▷ Preferences ▷
Look & feel ▷ Colors. The author and the date of the change are shown in LYX’s status
bar when the cursor is in changed text. The same information is shown when you
use the toolbar button .
When change tracking is activated, you will see the review toolbar in LYX:

The review toolbar as shown above contains the following buttons:

Document ▷ Change Tracking ▷ Track Changes


Document ▷ Change Tracking ▷ Show Changes in Output
Jumps to the next change
Document ▷ Change Tracking ▷ Accept Change
Document ▷ Change Tracking ▷ Reject Change
Document ▷ Change Tracking ▷ Merge Changes
Document ▷ Change Tracking ▷ Accept All Changes
Document ▷ Change Tracking ▷ Reject All Changes
Insert ▷ Note ▷ LyX Note
Navigate ▷ Next Note

134
6.18. Comparison of Documents

Not all changes are (yet) visualized, especially no format changes like from normal
to bold font or Standard to Description paragraph.

The review toolbar helps you to accept, reject, or merge changes – highlight the
change and press one of the desired toolbar buttons. When you merge changes, a
window pops up showing you information about the next change after the current
cursor position. So you don’t need to highlight a certain change. Within the merge
window you can decide to accept or reject changes and step to the next change. This
way you can jump through all the changes in the document.

The toolbar has two buttons to handle notes because notes are often important to
describe a change.

6.18. Comparison of Documents


You can compare two different LYX files via the menu Tools ▷ Compare. The compar-
ison result is a LYX file with change tracking enabled showing the differences. In the
comparison dialog you can select from which document LYX should take the document
settings for the resulting difference file with the option Copy Document Settings from.
The option Enable change tracking features in the output enables the change tracking
option Show Changes in Output to visualize the differences also in the PDF output of
the difference file.

6.19. International Support


This section describes how to use LYX with any language you want. For some lan-
guages there are special Wiki-pages that explain how to set up LYX to use them:
[24, 25, 26, 27, 28, 29]

Besides languages, LYX also supports phonetic symbols, see section A.4.2.

6.19.1. Language Options


The Document ▷ Settings ▷ Language dialog lets you set the language, the quote style
and character encoding.

Under Encoding you can choose the character encoding map you want to use for LATEX
export. The option Language Default is the preferred choice and works well in most
cases. For details about the different encoding options see section B.9.

135
CHAPTER 6. MORE TOOLS

6.19.2. Keyboard mapping configuration


If you have for example a U. S.-style keyboard and want to write in a language other
than English, you can use an alternate keymap. For example, if you want to write
in Italian, you can configure LYX to use an Italian keymap. The Tools ▷ Preferences ▷
Editing ▷ Keyboard/Mouse dialog allows you to choose up to two keyboard mappings,
see section C.2.3. You can choose primary and secondary keyboard languages and
then select which one you want to use.
Finally, you may just want to change a few key mappings or create an entirely different
keymap (for Vulcan, for instance). You may, for example, normally write in Italian
on a U. S.-style keyboard but want to include an occasional quotation in German. In
such a case, you can write your own keyboard mapping or modify an existing one to
support the characters you want. This and many other customizations are explained
in the Customization manual.

136
A. The User Interface
This appendix lists all the available menus and describes their functionality. It is
designed as a quick reference if you are searching for a special topic inside the user’s
guide.

A.1. The File Menu


Under the File menu are the basic operations in addition to some more advanced
operations.

A.1.1. New
Creates a new document.

A.1.2. New from Template


This menu entry prompts you for a template to use. Selecting a template will auto-
matically set certain layout features for the document, features you would otherwise
need to change manually. Furthermore, templates can provide text structures and
fragments for recurring writing tasks.

A.1.3. Open
Opens a document.

A.1.4. Open Recent


The submenu shows a list of the recently opened files. Click there on a file to open
it.

A.1.5. Open Example


This menu entry gives you quick access to all LYX example files.

137
A. The User Interface

A.1.6. Close
Closes the current document.

A.1.7. Close All


Closes all opened documents.

A.1.8. Save
Saves the actual document.

A.1.9. Save As
Saves the actual document under a new name to create a copy.

A.1.10. Save As Template


Saves the document in the appropriate templates directory for later use as a template.

A.1.11. Save All


Saves all opened documents.

A.1.12. Revert to saved


Reloads the actual document from disk.

A.1.13. Version Control


This is used when multiple people are working on the same document or when one
person wants to keep a careful archive of changes. It is described in the section
Version Control in LYX of the Additional Features manual.

A.1.14. Import
Here you can import files from older LYX versions, HTML files, LATEX files, NoWeb
files, plain text files and comma separated, table-like text files (CSV). The files will
be imported as a new LYX document.

138
A.1. The File Menu

When using the menu entry Plain text, line breaks in the text will start a new para-
graph; when using the menu entry Plain Text, Join Lines, consecutive lines of text will
be imported to one big paragraph. A new paragraph will begin when there is a blank
line in the file.

A.1.15. Export
You can export your document to various file formats. The resulting files are placed in
the directory of your LYX file. The menu entries are not the same on all installations.
They depend on the programs found by LYX during its configuration.
Here is a list of all available entries; some of them are explained in detail in sec-
tion 3.8.2:
CJK LyX format of the special LYX 1.4.x versions for Chinese, Japanese and Korean
(CJK)
Since LYX 1.5.0 CJK support has been fully integrated into LYX.
DocBook text file with code in the language SGML that is used for the markup
language DocBook
DocBook (XML) text file with code in the language XML that is used for the
markup language DocBook
DraftDVI LATEX’s native DVI-format. This format is not suitable if you have special
characters or spaces in files paths or file names in your document. LYX use this
format internally as a pre-stage to export to DVI.
DVI DVI-format that also allows the usage of special characters or spaces in files
paths or file names
DVI (LuaTeX) DVI-format using the program LuaTEX; supports Unicode and the
usage of non-TEX fonts; Note: not all DVI-viewers are currently able to display
this output format properly.
EPS (cropped) the same as PostScript but with cropped page margins.
Graphviz Dot text file with code in the programming language Dot which is used to
draw visualizations of graphs via the program Graphviz
HTML HTML-format; Note: the exported file will be stored in a subdirectory.
HTML (MS Word) HTML-format specialized so that the result can be imported to
MS Word; as a consequence of this formulas will be embedded as bitmap fonts
and not in the format MathML.
LaTeX (LuaTeX) text file with the LATEX source that is compilable with the program
LuaTEX

139
A. The User Interface

LaTeX (pdflatex) text file with the LATEX source, additionally all images used in
the document will be converted to a format that is readable by the pdflatex
program (GIF, JPG, PDF, PNG)
LaTeX (plain) text file with the LATEX source code, additionally all images used in
the document will be converted to the EPS-format, only this format is readable
by the latex program
LaTeX (XeTeX) text file with the LATEX source that is compilable with the program
XeTEX
LilyPond book (LaTeX) text file with the LATEX source and also code in the syntax
of the music notation software LilyPond
LyX z.y.x LYX-Document in a format readable by the LYX versions z.y.x (e. g. "LYX 2.1.x";
“z” and “y” represent the version number)
LyX Archive (zip|tar.gz) creates a zip-archive or a tar.gz-archive file (depending
upon your system) that contains your document and all files that are necessary
to compile it (images, child documents, BibTEX files, etc.)
LyXHTML HTML-format using LYX’s internal XHTML engine
MS Word Office Open XML Office Open XML file, to be opened with Microsoft
Word. For the conversion the program Pandoc is used. Pandoc is a third-party
product and may not work in all cases.
NoWeb text file with code in the format of the literate programming language NoWeb
OpenDocument (Pandoc) OpenDocument file, to be opened with LibreOffice, OpenOf-
fice, KOffice, Abiword, etc.. For the conversion the program Pandoc is used.
Pandoc is a third-party product and may not work in all cases.
OpenDocument (tex4ht) OpenDocument file. For the conversion the program tex4ht
is used. tex4ht is a third-party product and may not work in all cases.
PDF (cropped) the same as PDF (pdflatex) but with cropped page margins
PDF (dvipdfm) PDF-format using the program dvipdfm, produces internally a DVI-
file which is then converted to a PDF-file
PDF (lower resolution) the same as PDF (pdflatex) but with a reduced pixel reso-
lution of 150 dpi (e.g. useful for e-books to be read on tablet PCs or for large
documents as intermediate preview)
PDF (LuaTeX) PDF-format using the program LuaTEX, produces PDF-files directly
PDF (pdflatex) PDF-format using the program pdflatex, produces PDF-files di-
rectly
PDF (ps2pdf) PDF-format using the program ps2pdf, produces internally a PostScript-
file which is then converted to a PDF-file

140
A.2. The Edit Menu

PDF (XeTeX) PDF-format using the program XeTEX, produces PDF-files directly
Plain text text format
Plain text (ps2ascii) text format, the document will first be converted to Postscript
format and then exported as text using the program ps2ascii
Postscript PostScript format using the program dvips; for possible dvips options
see section C.6.1
Sweave text file with the LATEX source and also code in the statistical programming
language R. Using the R-function Sweave it is possible to use R-commands in
LATEX
If one of the menu entries DVI, PDF (pdflatex) or Postscript is missing, you need to
update your LATEX installation. After updating you have to reconfigure LYX, see
section 1.4.

A.1.16. Fax
This menu entry will only appear if you have a fax program installed (on Windows you
additionally need to register its program path to LYX’s PATH prefix, see section C.3).
With this menu entry you can send your document to a fax program like hylapex or
kdeprintfax. The default format of the sent file is PostScript. The format can be
changed in LYX’s preferences as described in section C.7.1.

A.1.17. New and Close Window


Opens or closes a new instance of LYX.

A.1.18. Exit
Prompts you to save all unsaved documents and then exits.

A.2. The Edit Menu


A.2.1. Undo and Redo
Described in section 2.4.

A.2.2. Cut, Copy, Paste, Paste Recent, Paste Special


Described in section 2.3.

141
A. The User Interface

A.2.3. Select Whole Inset


Selects the content of the inset in which the cursor currently is. If the cursor is
outside an inset, the whole document will be selected.

A.2.4. Select All


Selects the whole document.

A.2.5. Find & Replace (Quick)


Described in section 2.3.

A.2.6. Find & Replace (Advanced)


Described in section 6.14.

A.2.7. Move Paragraph Up/Down


This shifts the paragraph in which the cursor currently is one paragraph up or down.

A.2.8. Paragraph Settings


Enables you to set the paragraph alignment, line spacing and label width. These
settings only affect the paragraph in which the cursor is currently in.
You can also prevent the first line of the paragraph being indented if you have cho-
sen to separate paragraphs with Indentation in the Document ▷ Settings ▷ Text Layout
dialog.

A.2.9. Text Properties


This sub-menu provides several ways to customize the appearance of text passages.
You can
1. Customize text properties by means of the Text Properties dialog (via Cus-
tomize. . . ; this is described in section 3.7.6)
2. Apply the last settings done in this dialog via Apply last settings
3. Change the casing of selected text (Capitalize, Uppercase, Lowercase)

142
A.3. The View Menu

A.2.10. Custom Text Styles


This sub-menu only appears if the document class or a module provides custom text
styles (in the case of this document: Code, Emph, Noun and Strong, provided by the
Logical Markup module). See section 3.7.5.2 for details.

A.2.11. Table and Rows & Columns


These menus only appear if the cursor is inside a table. It allows you to create
multicolumn and multirow cells, add or remove borders of a cell and to set the
alignment of the cell.

A.2.12. Dissolve Inset


This menu only appears if the cursor is inside an inset. It will dissolve this inset.
This means that the inset is deleted and its content is left as normal text.

A.2.13. Settings or Math


This menu is only active if the cursor is inside an inset or a formula. Here you can
change the properties of the inset or the formula.

A.2.14. Increase/Decrease List Depth


These menus are only active if the cursor is in an environment that can be nested.
They increase/decrease the environment nesting level as explained in section 3.4 and
3.3.4.3.

A.3. The View Menu


At the bottom of the View menu the opened documents are listed.

A.3.1. Open/Close all Insets


Opens/closes all insets in your document.

A.3.2. Unfold/Fold Math Macros


Unfolds/folds the current math macro.
Math macros are described in the Math manual.

143
A. The User Interface

A.3.3. Outline Pane


Shows the outline window as described in sections 2.6 and 6.2.1.

A.3.4. Source Pane


Opens a window showing the source code of the actual document, as described in
section 6.13.

A.3.5. Messages Pane


Opens a window showing console messages. This is useful for debugging LYX (i. e.,
hunt for errors in the program) or to see what is going on in the background while
LATEX is processing the document.

A.3.6. Toolbars
In this menu entry you can set the icon size and the appearance of the different
toolbars. All toolbars and the Command Buffer can be turned on and off. The on
state is denoted in the menu with a checkmark.
The Phonetic Symbols, Table, Math, Math Macros, Review and Math Panels toolbars
can additionally be set to the state automatic. The state of these toolbars is set and
indicated in a submenu which lets you select On, Off, and Automatic.
In the on state the toolbar is permanently shown, in the off state it is never shown;
in the automatic state the toolbar is only shown when the cursor is in a certain
environment or when a certain feature is enabled. That means that the review toolbar
will only be shown if change tracking is activated, the math and table toolbars are
only shown if the cursor is inside a formula or table respectively, the phonetic symbols
toolbar only in the phonetic symbols environment.
LYX’s toolbars and their buttons are explained in section A.9.

A.3.7. Split View


Split View into Left and Right Half will split LYX’s main window vertically while
Split View into Upper and Lower Half will split it horizontally. This allows you to view
documents at the same time to compare them, or to view the same document, but
at different positions. You can even split the main window several times to view, for
example, three or more documents at the same time. To close a split view, use the
menu Close Current View.

144
A.4. The Insert Menu

A.3.8. Close Current View


Closes a split view.

A.3.9. Fullscreen
Using this menu entry or pressing F11 removes the menu bar and all toolbars so
that you will see nothing but your text. It furthermore displays LYX’s main window
fullscreen. To return from fullscreen to the normal view, press F11, or right-click and
turn off the fullscreen mode in the context menu.

A.4. The Insert Menu


A.4.1. Math
Inserts math constructs that are explained in chapter 5 and the Math manual.

A.4.2. Special Character


Here you can insert the following characters:
Symbols Opens the Symbols dialog which allows you to insert any character that can
be output by your LATEX system. By default groups of characters are displayed
in character categories; the available characters depend on the LATEX-packages
you have installed. You can get a complete display by checking Display all.
Note: Not all characters will be visible in the Symbols dialog because none of
the screen fonts that you can set in the preferences dialog (see section C.1.3)
can display every character.
Ellipsis Inserts an ellipsis: . . .
End of Sentence Inserts an end of sentence period as described in section 3.9.4.1.
Ordinary Quote Inserts this quote: ", no matter what quote style you selected in
the Document ▷ Settings ▷ Language dialog.
Single Quote Inserts a single quote in the quotation marks style selected in the
Document ▷ Settings ▷ Language dialog.
Non-Breaking Hyphen Inserts a hyphen that prevents automatic line breaks: -
Breakable Slash Inserts a slash where a line break can also occur: /
Visible Space Inserts a character to visualize that there is or should be a space.
This is e. g. useful if you need to indicate a space in a command sequence. An

145
A. The User Interface

example from the LYX Math manual: “To insert a fraction use the command
\frac␣A↓B.” The visible space is hereby the character before the A.
Menu Separator Inserts the menu separator sign: ▷
Phonetic Symbols Inserts a box where you can insert symbols from the International
Phonetic Alphabet (IPA) and opens a toolbar which provides a large set of these
symbols. To use this feature you must have the LATEX-package tipa installed.
More information about this feature can be found in the Linguistics manual
(Help ▷ Specific Manuals).
Logos Inserts the logos of the programs LYX, TEX, LATEX and LATEX 2ε .

A.4.3. Formatting
Opens a submenu with the following options:
Superscript Inserts a superscript: testa, b
Subscript Inserts a subscript: test3x
Non-Breaking Space Inserts a non-breaking space as described in section 3.5.1.
Interword Space Inserts an inter-word space as described in section 3.5.2.1.
Thin Space Inserts a thin space as described in section 3.5.2.2.
Horizontal Space Inserts horizontal space as described in section 3.5.2.
Horizontal Line Inserts a horizontal line as described in section 3.5.7.
Vertical Space Inserts vertical space as described in section 3.5.3.
Phantom Inserts a Phantom space as described in section 3.5.2.5.
Hyphenation Point Inserts a hyphenation point as described in section 3.9.3.
Ligature Break Inserts a ligature break as described in section 3.9.5.
Optional Line Break Inserts a line break point (zero-width space character) that is
invisible in the output. See section 3.9.2 for a usage example.
Ragged Line Break Inserts a forced line break as described in section 3.5.6.
Justified Break Inserts a forced line break that justifies the remaining text as de-
scribed in section 3.5.6.
New Page Inserts a forced page break as described in section 3.5.5.
Page Break Inserts a forced page break that shares the extra space among para-
graph breaks instead of leaving it at the bottom of the page, as described in
section 3.5.5.

146
A.4. The Insert Menu

Prevent Page Break Instructs LATEX to prevent a page break at the given position.
See section 3.5.5.2.

Clear Page Inserts a clear page break as described in section 3.5.5.1.

Clear Double Page Inserts a clear doublepage break as described in section 3.5.5.1.

A.4.4. Field
Here you can insert fields holding specific information. The submenu allows you to
insert

Date (Current) inserts the current date (which will automatically update itself)

Date (Last Modification) inserts the date of the last file modification (time of last
save)

Date (Fix) inserts a static date that will not change.

Time (Current) inserts the current time (which will automatically update itself)

Time (Last Modification) inserts the time of the last file modification (time of last
save)

Time (Fix) inserts a static time that will not change.

File Name (Excl. Extension) inserts the name of the current file (without the ex-
tension .lyx)

Version Control Revision inserts the version control reference number (e.g. git com-
mit hash). This submenu does not appear if the file is not under version control

User Name inserts the user name as specified in Tools ▷ Preferences ▷ Identity.

User Email inserts the user email address as specified in Tools ▷ Preferences ▷ Identity.

Other. . . opens a dialog that lets you insert alternative formats of the three date
types listed above and insert a range of other information.

A.4.5. List/Contents/References
Various lists can be inserted with this menu entry. The Table of Contents, the List of
Algorithms, List of Figures, List of Tables and List of Listings are described in section 6.2.
The Index List is described in section 6.7, the Nomenclature is described in section 6.8
and the BibTEX Bibliography is described in section 6.6.2.

147
A. The User Interface

A.4.6. Float
To insert floats, as described in section 4.6 and in detail the chapter Floats of the
Embedded Objects manual.

A.4.7. Note
To insert notes, described in section 4.1.

A.4.8. Branch
Inserts a branch inset, if any, and allowing you to create and insert a new branch.
Branches are described in section 6.9.

A.4.9. Custom Insets


Inserts document class-specific insets. Such insets only exist if they are defined in the
layout file for a certain document class. An example is the document class Elsevier
with three custom insets. The section Flex insets and InsetLayout in Installing New
Document Classes, The Layout file format of the Customization manual explains how
custom insets are defined.

A.4.10. File
This menu entry allows you to insert or include the contents of other files in your
document. For more information see chapter External Document Parts of the Em-
bedded Objects manual.

A.4.11. Box
Inserts a box in a certain style. Boxes are described in detail in the chapter Boxes of
the Embedded Objects manual.

A.4.12. Citation
Opens the Citation dialog as described in section 6.6.

A.4.13. Cross-Reference
Inserts a cross-reference as described in section 6.1.

148
A.4. The Insert Menu

A.4.14. Label
Inserts a label as described in section 6.1.

A.4.15. Caption
Inserts a caption in a float or multi-page table. Floats are described in section 4.6;
captions in multi-page tables are described in the section Multi-page Table Captions
of the Embedded Objects manual.

A.4.16. Index Entry


Inserts an index entry as described in section 6.7.

A.4.17. Nomenclature Entry


Inserts a nomenclature entry as described in section 6.8.

A.4.18. Table
Opens a dialog allowing you to specify the rows and columns of the table. Tables are
described in section 4.5 and in detail in the chapter Tables of the Embedded Objects
manual.

A.4.19. Graphics
Opens the Graphics dialog. Graphics are described in section 4.4.

A.4.20. URL
Inserts a URL as described in section 6.3.1.

A.4.21. Hyperlink
Inserts a hyperlink as described in section 6.3.2.

A.4.22. Footnote
Inserts a footnote as described in section 4.2.

149
A. The User Interface

A.4.23. Marginal Note


Inserts a marginal note as described in section 4.3.

A.4.24. Separate <Name> (Above/Below)


These menu items are only visible if it is possible to have two consecutive environ-
ments of the same type. See section 3.4.6 for an explanation.

A.4.25. Short Title


Is only visible if the cursor is in front, in or behind a section heading, title or caption
of a float. Inserts a short title as described in section 3.3.4.4.

A.4.26. TEX Code


Inserts a TEX Code box as described in section 6.11.1.

A.4.27. Program Listing


Inserts a program listings box. Program listings are explained in the chapter Program
Code Listings of the Embedded Objects manual.

A.4.28. Preview
Inserts a preview inset as described in section 6.13.

A.5. The Navigate Menu


This menu lists the existing chapters, sections, figures, tables, etc. of the current
document. This allows you to navigate easily through your document.

A.5.1. Bookmarks
With this menu entry you are able to define your own bookmarks. This is useful when
you are working on a large document and often have to jump, for example, between
section 2.5 and 6.3. To create bookmarks for this example, go to section 2.5 and use
the submenu Save Bookmark 1. Then go to section 6.3 and use Save Bookmark 2.
Now you can jump easily between these sections by using the menu or by the key
bindings Ctrl+1 and Ctrl+2.You can also use bookmarks to jump between several
opened documents.

150
A.6. The Document Menu

The submenu Clear Bookmarks allows you to clear bookmarks while the submenu
Navigate Back jumps to the position in the document where you recently changed
something.

A.5.2. Next Note, Change, Cross-reference


Jump to the next note, change, or cross-reference after the current cursor position.

A.5.3. Go to Label
Only active if the cursor is in front of a cross-reference. Sets the cursor before the
referenced label. (It is the same as if you right-click on a cross-reference box and use
Go to Label).

A.5.4. Forward Search


Allows you to jump directly to the corresponding text part in the output, see section
The LYX Server ▷ Forward search in the Additional Features manual for a detailed
description.

A.6. The Document Menu


A.6.1. Change Tracking
Change Tracking is described in section 6.17.

A.6.2. LaTeX Log


After running LATEX by viewing or exporting a document, this menu will be enabled.
It shows the logfile of the LATEX-program used. You can go to the next error or the
next warning, search, copy something to the clipboard or update the view.
With the help of the logfile, experts can find reasons for LATEX-errors.

With the button Open Containing Directory one can open LYX’s temporary folder for
the document. This folder contains all converted and created files to generate the
output. Some of these files might be of interest for experts to solve problems or for
writers who need to supply intermediate files. For example some journals require to
send the *.bbl file (a text file with the used BibTEX references).

151
A. The User Interface

A.6.3. Start Appendix Here


Sets the start of the appendices of the document at the current cursor position as
described in section 6.5.

A.6.4. View [<output format>]


This menu entry generates the output in the format you have specified as default
output format for the document (menu Document ▷ Settings ▷ Output ▷ Default Out-
put Format; see section B.21) or in the LYX preferences (menu Tools ▷ Preferences ▷
File Handling ▷ File Formats ▷ Default Output Format; see section C.7.2) and opens it in
an appropriate viewer. The viewer can be set or changed in the preferences (menu
Tools ▷ Preferences ▷ File Handling ▷ File Formats ▷ Viewer; see section C.7.2). The de-
fault viewers are set by LYX when it is first configured. The default output format is
PDF (pdflatex).

A.6.5. View (Other Formats)


With this menu you can view your document in alternative output formats. The
menu contains a list of available formats in which you can view the actual document
with an external program. The menu entries are not the same on all installations
— it depends on the LATEX programs that are found when LYX was configured. All
possible formats are listed in section A.1.15. You should at least see the menu entry
DVI. If it is missing, you need to update or repair your LATEX installation. After
updating you have to reconfigure LYX (see section 1.4.)

Invoking a view menu will start a viewer program. The viewer can be set or changed
in the preferences (menu Tools ▷ Preferences ▷ File Handling ▷ File Formats ▷ Viewer; see
section C.7.2). The default viewers are set by LYX when it is first configured.

A.6.6. Update [<output format>]


This menu entry allows you to update the view with your latest changes (in the
default output format) without opening a new viewer window.

A.6.7. Update (Other Formats)


With this menu you can update the view of alternative output formats of your doc-
ument without opening a new viewer window.

152
A.6. The Document Menu

A.6.8. View Master Document


This menu item is only visible if your document is included to another document,
which is then its “master” (see section Child Documents in the Embedded Objects
manual for more information on this topic). This item allows you to view the master
document from within its child. That is, if you are working on a child document
which is a chapter of a book, View Master Document generates the output of the
whole book, while View will just output the chapter alone.

The format used by this function is the default output format as specified in the
document settings (menu Document ▷ Settings ▷ Output ▷ Default Output Format; see
section B.21) or in the preferences (menu Tools ▷ Preferences ▷ File Handling ▷ File For-
mats ▷ Default Output Format; see section C.7.2).

A.6.9. Update Master Document


This menu item is only visible if your document is included to another document,
which is then its “master” (see section Child Documents in the Embedded Objects
manual for more information on this topic). This item allows you to update the view
of a master document from within its child without the need to switch to the master
document itself.

The format used by this function is the default output format as specified in the
document settings (menu Document ▷ Settings ▷ Output ▷ Default Output Format; see
section B.21) or in the preferences (menu Tools ▷ Preferences ▷ File Handling ▷ File For-
mats ▷ Default Output Format; see section C.7.2).

A.6.10. Compressed
Un/compresses the current document. For documents under version control it is
strongly recommended to disable compression (see the Additional Features manual
for details).

A.6.11. Disable Editing


Toggles the read-only state for the document.

A.6.12. Settings
The document settings are described in appendix B.

153
A. The User Interface

A.7. The Tools Menu


A.7.1. Spellchecker
Spell checking is explained in section 6.15.

A.7.2. Thesaurus
The thesaurus is described in section 6.16.

A.7.3. Statistics
Returns the number of the words and characters in the actual document or the
highlighted document part.

A.7.4. Check TeX


Generates with the help of the program ChkTEX a log of possible LATEX-errors and
displays it in a dialog. This feature is not available on Windows.

A.7.5. TeX Information


Shows you a list of the document classes and styles installed in your LATEX-system.
Use the option Show path to see the full filename paths.

A.7.6. Compare
Opens a dialog to compare LYX files as described in section 6.18.

A.7.7. Reconfigure
Reconfigures LYX; that is, LYX looks for LATEX-packages and programs it needs; see
also section 1.4.

A.7.8. Preferences
Opens the Preferences dialog as described in detail in appendix C.

154
A.8. The Help Menu

A.8. The Help Menu


This menu lists the documentation files of LYX in the language of LYX’s menus. If a
file is not available in this language, the English version will be listed.
The menu LaTeX Configuration shows a LYX document with information about the
LATEX packages and classes found by LYX (see also section 1.5).
The menu About LyX gives information about the copyright, the credits and the LYX
version you are using.

A.9. Toolbars
How to show or hide toolbars is explained in section A.3.6.
It is also possible to define custom toolbars. This is described in the Additional
Features manual.

A.9.1. Standard Toolbar

The standard toolbar as shown above contains from left to right the following buttons:

pull-down box for the environments


File ▷ New
File ▷ Open
File ▷ Save
Tools ▷ Spellchecker
Spellcheck continuously
Edit ▷ Undo
Edit ▷ Redo
Edit ▷ Cut
Edit ▷ Copy
Edit ▷ Paste or Edit ▷ Paste Recent
Edit ▷ Find & Replace (Quick)

155
A. The User Interface

Edit ▷ Find & Replace (Advanced)


Navigate ▷ Bookmarks ▷ Navigate Back
Emphasize text, function of the Édition ▷ Propriétés du texte ▷ Personnaliser... dialog
Set text to noun style, function of the Édition ▷ Propriétés du texte ▷ Personnaliser... dialog
Edit ▷ Custom Text Styles

Insert ▷ Math ▷ Inline Formula


Insert ▷ Graphics
Insert ▷ Table
Insert ▷ Custom Insets
Toggle outline window on/off, View ▷ Outline
Toggle math toolbar on/off
Toggle table toolbar on/off

A.9.2. Extra Toolbar

The extra toolbar as shown above contains from left to right the following buttons:

Default
Numbered list
Itemized list
List
Description list
Edit ▷ Increase List Depth
Edit ▷ Decrease List Depth

156
A.9. Toolbars

Insert ▷ Float ▷ Figure


Insert ▷ Float ▷ Table
Insert ▷ Label
Insert ▷ Cross-Reference
Insert ▷ Citation
Insert ▷ Index Entry
Insert ▷ Nomenclature Entry
Insert ▷ Footnote
Insert ▷ Marginal Note
Insert ▷ Note ▷ LyX Note
Insert ▷ Box
Insert ▷ Hyperlink
Insert ▷ TeX Code
Insert ▷ Math ▷ Macro
Insert ▷ File ▷ Child Document
Edit ▷ Text Style ▷ Customized
Format text using the recent settings in the Édition ▷ Propriétés du texte ▷ Personnaliser... dialog
Edit ▷ Paragraph Settings
Tools ▷ Thesaurus

A.9.3. View/Update Toolbar

The view/update toolbar as shown above contains from left to right the following
buttons:

Document ▷ View
Document ▷ Update

157
A. The User Interface

Document ▷ View Master Document


Document ▷ Update Master Document
Document ▷ Settings ▷ Formats ▷ Synchronize with Output
Document ▷ View (Other Formats)
Document ▷ Update (Other Formats)

A.9.4. Other Toolbars


The change tracking toolbar is explained in section 6.17, the table toolbar in the
Embedded Objects manual and the math macro toolbar in the Math manual.

158
B. The Document Settings
The Document Settings dialog contains submenus to set properties for the whole doc-
ument and is called with the menu Document ▷ Settings. You can save your document
settings as default with the Save as Document Defaults button in any dialog. This
will create a template named defaults.lyx which is automatically loaded by LYX
when you create a new document without using a template.
The button Use Class Defaults resets the document settings to the default of the
document class. This affects mostly class options, the page layout and Numbering &
TOC.
The different submenus of the dialog are explained in the following sections. There
are so many document settings available that it might take a while to find the one you
are looking for. To find a setting quicker, you can use the search field which is above
the submenus of the dialog. If you search e. g. for “page”, you will see that some
submenus will be grayed-out and disabled. Only the submenus with page settings
stay enabled. The found page settings are labeled red in these submenus.

B.1. Document Class


Here you set the document class, class options, a graphics driver, and a master
document. Document classes are described in section 3.1.2.
With the button Local Layout you can load you own layout-file, that is not in LYX’s
layouts folder and thus not recognized by LYX as a layout for a document class. For
more about layout-files, see the chapter Installing New Document Classes, Types of
Layout Files of the Customization Handbook.
Some classes use special class options by default. If this is the case, they are listed in
the field Predefined and you can decide to use them or not. If you do not know exactly
what the default class options are for, it is recommended you leave them untouched.
The Graphics driver is used for LATEX’s graphics, color and page layout packages. If
using Default, the default driver for the LATEX-packages is used. It is recommended
that you use the default unless you know what you are doing.1
1
When you want to use one of the following drivers
dvi2ps, dvialw, dvilaser, dvitops, psprint, pubps, ln
you first have to activate them in your LATEX distribution, see section Driver support in
https://www.ctan.org/tex-archive/macros/latex/required/graphics/grfguide.pdf.

159
B. The Document Settings

Specifying a Master document is necessary if the current document is a child or


subdocument. The master document will be used by LYX in the background if the
child document is opened without its master. This way child documents are always
compilable. More about master and child documents is explained in the section Child
Documents of the Embedded Objects manual.
There is also an option to suppress the date and one to use the LATEX-package refstyle
instead of prettyref for cross-references, see section 6.1.

B.2. Child Documents


This submenu is only visible when your document includes child documents. Please
refer to the section Child Documents of the Embedded Objects manual for details.

B.3. Modules
Modules are explained in section 3.1.2.3.

B.4. Local Layout


See section 3.1.2.4 for a description.

B.5. Fonts
The document font settings are described in section 3.7.

B.6. Text Layout


You can specify if paragraphs should be separated by Indentation or by Vertical space.
The Line spacing and whether it should be a Two-column document can also be spec-
ified here.
Note that LYX will not show two columns or the specified line spacing on screen.
That would be impractical, often unreadable, and is not part of the WYSIWYM
concept. However, it will be as you specified in the output.
With the option Use justification in LYX work area you can decide if LYX justifies the
text on screen. This only affects the text inside LYX not in the output.

160
B.7. Page Layout

The Default Style setting in Table Style lets you select which style newly inserted
tables should use by default.

B.7. Page Layout


This dialog is described in sections 3.1.4 and 3.1.3.

B.8. Page Margins


Here you can adjust the page margins as described in section 3.1.5.

B.9. Language
The document language and quote styles are set here. The encoding specifies how
the document content is exported to LATEX (the LYX file is always encoded in utf8).
All characters that cannot be encoded using the specified encoding will be exported
as LATEX-commands (this can fail if a LATEX-command is not known for a particular
character).
By default, LYX outputs LATEX files in Unicode – or utf8, for that matter (which is
nowadays also LATEX’s default encoding). This should normally fit your needs, since
LATEX’s Unicode support covers the characters of most scripts. Nonetheless it is not
yet comprehensive, so there might be cases where using one of the traditional, or
“legacy”, encodings is necessary.
LYX provides support for these traditional encodings. If you chose Traditional (auto-
selected) from the Encodings dropdown, LYX automatically selects the appropriate
traditional encoding for the given language(s).If the document contains text in more
than one language you thus may get more than one encoding in the LATEX file.
Finally, you can also select Custom, which lets you specify a specific (single) encoding
for the whole document. Note that this encoding is then used for any language. The
custom list (which is spelled out below) consists of traditional encodings and some
special cases of Unicode for specific purposes (see explanation below).
The ...(no inputenc) selection in the next dropdown menu does what it states: it
prevents LYX from automatically loading the LATEX-package inputenc. This option
might be useful if you use a class or package that pre-loads inputenc or if inputenc
must not be used for some reason. When using this, you probably need to load some
additional packages manually in the preamble and specify the used encoding for text
parts in foreign languages in TEX code. Note that this option is only available for
the standard Unicode and Traditional (auto-selected) encodings.

161
B. The Document Settings

The Language package determines the LATEX-package that is used for hyphenation
and the translation of strings like “Part”. The possible settings are:
Default uses the language package that is selected in Tools ▷ Preferences ▷ Language
Settings (see section C.5.1).
Automatic selects the most suitable language package for the view/export format
you will use. In many cases this will be babel. If the newer package poly-
glossia is more appropriate (is the case when using XeTEX or LuaTEX and
non-TEX fonts), this package will be used instead of babel.
Always Babel uses babel even if polyglossia would be more appropriate.
Custom allows you to specify a language package command of your choice. For
example if you want to use a language-specific package like ngerman (for
German texts), type in
\usepackage{ngerman}
None will not use a language package. This is necessary for some document classes
for scientific articles.
Here is a list with the important encodings:
ASCII the ASCII encoding, covers only plain English (7-bit ASCII). LYX converts
all other characters into LATEX commands, which may result in a big file when
lots of LATEX-commands are needed.
Arabic (CP 1256) MS Windows code page for Arabic and Farsi
Arabic (ISO 8859-6) for Arabic and Farsi
Armenian (ArmSCII8) for Armenian
Baltic (CP 1257) MS Windows code page for Estonian, Latvian and Lithuanian,
the same as the ISO-8859-13 encoding
Baltic (ISO 8859-13) for Estonian, Latvian and Lithuanian, a superset of the ISO-
8859-4 encoding
Baltic (ISO 8859-4) (latin 4) for Estonian, Latvian and Lithuanian, a subset of the
ISO-8859-13 encoding
Central European (CP 1250) MS Windows code page for ISO 8859-2 (latin2)
Central European (ISO 8859-2) (latin 2) covers Albanian, Croatian, Czech, Ger-
man, Hungarian, Polish, Romanian, Slovak and Slovenian
Chinese (simplified) (EUC-CN) for simplified Chinese, used especially on UNIX
OSes, since 2001 this encoding is officially replaced by the encoding GB18030,
as GB18030 is not available for LATEX you should try to use the encoding Uni-
code (CJK) (utf8)

162
B.9. Language

Chinese (simplified) (GBK) for simplified Chinese, is the same as the Windows
code page CP 936 except for the Euro currency sign, since 2001 this encoding
is officially replaced by the encoding GB18030, as GB18030 is not available for
LATEX you should try to use the encoding Unicode (CJK) (utf8)
Chinese (traditional) (EUC-TW) for traditional Chinese
Cyrillic (CP 1251) MS Windows code page for Cyrillic
Cyrillic (ISO 8859-5) covers Belorussian, Bulgarian, Macedonian, Serbian and Ukrainian
Cyrillic (KOI8-R) standard Cyrillic especially for Russian
Cyrillic (KOI8-U) Cyrillic for Ukrainian
Cyrillic (pt 154) Cyrillic for Kazakh
Greek (ISO 8859-7) for Greek
Hebrew (CP 1255) MS Windows code page for Hebrew, a superset of the ISO-8859-
8 encoding
Hebrew (ISO 8859-8) for Hebrew
Japanese (CJK) (EUC-JP) EUC-JP encoding for Japanese, uses the LATEX-package
CJK, when using this, set the document language to Japanese (CJK)
Japanese (CJK) (JIS) JIS encoding for Japanese, uses the LATEX-package CJK,
when using this, set the document language to Japanese (CJK)
Japanese (non-CJK) (EUC-JP) EUC-JP encoding for Japanese, uses the LATEX-
package japanese, when using this, set the document language to Japanese
Japanese (non-CJK) (JIS) JIS encoding for Japanese, uses the LATEX-package japanese,
when using this, set the document language to Japanese
Japanese (non-CJK) (SJIS) SJIS encoding for Japanese, uses the LATEX-package
japanese, when using this, set the document language to Japanese
Korean (EUC-KR) for Korean
Southern European (ISO 8859-3) (latin 3) covers Esperanto, Galician, Maltese and
Turkish
South-Eastern European (ISO 8859-16) (latin 10) covers Albanian, Croatian, Finnish,
French, German, Hungarian, Irish Gaelic, Italian, Polish, Romanian and Slove-
nian, is designed to cover many languages and characters with diacritics
Thai (TIS 620-0) for Thai
Turkish (ISO 8859-9) (latin 5) for Turkish, is like the ISO-8859-1 encoding where
the Icelandic letters are replaced by Turkish ones

163
B. The Document Settings

Unicode (CJK) (utf8) Unicode utf8 with the LATEX-package CJK (for the lan-
guages Chinese, Japanese and Korean). This encoding is selected by LYX with
the default encoding (Unicode (utf8) [default] in the main Encoding dropdown
list) with CJK languages. Normally you do not need to set this encoding man-
ually.

Unicode (XeTeX) (utf8) Unicode utf8 to be used with XeTEX and LuaTEX, which
use Unicode directly, without the help of the LATEX-package inputenc. LYX
automatically selects this encoding if you export or preview XeTEX or LuaTEX.
Normally you do not need to set this encoding manually.

Unicode (ucs-extended) (utf8x) Unicode utf8 based on the LATEX-package ucs (in-
cluding Latin, Greek, Cyrillic and CJK scripts). This used to be more compre-
hensive than Unicode (utf8), but meanwhile it is rather outdated.

Unicode (utf8) Unicode utf8 based on the LATEX-package inputenc. This encoding
is selected by LYX with the default encoding (Unicode (utf8) [default] in the
main Encoding dropdown list) with non-CJK languages. Normally you do not
need to set this encoding manually.

Western European (CP 1252) MS Windows code page for ISO 8859-1 (latin1)

Western European (ISO 8859-1) (latin 1) covers the languages Albanian, Catalan,
Danish, Dutch, English, Faroese, Finnish, French, Galician, German, Icelandic,
Irish, Italian, Norwegian, Portuguese, Spanish and Swedish; better use the ISO-
8859-15 encoding instead

Western European (ISO 8859-15) (latin 9) like the ISO-8859-1 encoding, but with
the Euro currency sign, the œ-ligature and some characters used for French and
Finnish

B.10. Colors
Here you can alter the font color for the Main text (default: black), for Greyed out
notes (default: light grey)for the background color for the Page (default: white) and
for Shaded boxes (default: red). The button Reset sets the color back to the default.

Clicking any button showing Default or Change opens a dialog enabling you to choose
from a selection of colors or from a color-picker or to specify a color using HSL or
RGB values. In the dialog you can add any color to the custom colors to select them
later more quickly.

Note, if you change the Main text font color and use the option Color links in the
document settings under PDF properties, you probably also need to change the link
font color as described in section 6.10.

164
B.11. Change Tracking

You can adapt the Main text font color and the Page background for every page in
your document if you use these commands as TEX Code after a forced page break:
• For the page color:
\pagecolor{color name}
• For the text color:
\color{color name}
You are restricted to one of black, blue, cyan, green, magenta, red, white or
yellow for the color name unless you have defined your own color (see the section
Colored Tables of the Embedded Objects Manual).
If you have changed a text or background color, you can use the following names to
refer to them:
• For the Page background color:
page_backgroundcolor
• For the Main text color:
document_fontcolor
• For the Shaded boxes background color:
shadecolor
• For the Greyed out notes text color:
note_fontcolor
To see how to define and use custom colors, see section Colored Cells of the Embed-
ded Objects manual.

B.11. Change Tracking


Here you can do some settings related to change tracking (see sec. 6.17). Alternatively
to the menu or toolbar, you can set here whether changes are being tracked and
whether they are shown in the output.
Additionally, you can advise LYX to place a change bar in the margin of the output.
This might be useful to make changed passages more salient.

B.12. Numbering & TOC


Here you can adjust the Numbering depth of section headings and the section depth
in the Table of Contents as described in section 3.3.4.3.
You can typeset lines numbering in the output file by enabling the checkbox at the
bottom. The functionality is handled by package lineno and additional options of

165
B. The Document Settings

this package can be used as well. The most common one are:
right Line numbers to the right margin
switch Line number to the outer margin (left – even pages, right – odd pages)
switch* Line numbers to the inner margin
modulo Print numbers only on multiples of five lines
pagewise Restart numbering for each page
displaymath, mathlines Line numbers for math environments (both options needed).

B.13. Bibliography
Here you can specify if a specific citation style using the LATEX packages biblatex,
natbib or jurabib should be used. If you use BibTEX, you can enable a Sectioned
bibliography using the LATEX package bibtopic. If you use Biblatex, you can select
the style files and specify further options. Finally, you can select a document-specific
Processor for the generation of the bibliography. For a further description of these
possibilities see section 6.6.

B.14. Indexes
Here you can define the Processor that will generate your index and you can define
additional indexes (see section 6.7 for details).

B.15. PDF Properties


The PDF properties are explained in section 6.10.

B.16. Math Options


These options will force LYX to use the LATEX packages amsmath, amssymb, can-
cel, esint, mathdots, mathtools, mhchem, stackrel, stmaryrd and undertilde,
or to use them automatically when they are needed.
amsmath is needed for many constructs, so when you get LATEX-errors in formulas,
ensure that you have this enabled.
amssymb is needed for some special math symbols like bold or upright Greek letters,
so when you get LATEX-errors in formulas, ensure that you have this enabled.

166
B.17. Float Settings

cancel is used for canceled formulas, see section Canceled Formulas of the Math
manual.
esint is used for special integral characters, see section Big Operators of the Math
manual.
mathdots is used for special ellipses, see section Ellipses of the Math manual.
mathtools is used for the math commands \overbracket, \underbracket, \smash-
operator, \adjustlimits, \splitfrac, \shortintertext and labeled arrows,
see the corresponding sections in the Math manual.
mhchem is used for chemical equations, see section Chemical Symbols and Equations
of the Math manual.
stackrel is used for the math command \stackrel, see section Relations of the Math
manual.
stmaryrd is used for a few special math symbols.
undertilde is used for the math command \utilde, see section Accents for one Char-
acter of the Math manual.

B.17. Float Settings


Here you can set global float placement and alignment options.
Details are described in the section Float Settings of the Embedded Objects manual.

B.18. Listings
The listings settings are explained in the chapter Program Code Listings of the Em-
bedded Objects manual.

B.19. Bullets
Here you can adjust the characters used for the itemize Levels, specify the Font set
to be used and set the Size of the bullets. The itemize environment is described in
section 3.3.6.2.
You can furthermore specify a Custom Bullet by inserting in this field the LATEX com-
mand of the desired character. For example to use the € sign, you have to insert
the command \texteuro. For math symbols you additionally need to enclose the

167
B. The Document Settings

command with $ signs. To use e. g. the symbol ⟳ you need to enter $\circlear-
rowright$. To find the command for a math symbol, create a formula and hover
the mouse over the desired symbol in the math toolbar.
Note: Some characters require to load special LATEX-packages in the preamble (menu
Document ▷ Settings ▷ LATEX Preamble). For example for the € sign one needs to add
the line \usepackage{textcomp} to the preamble. For most math symbols it is
sufficient to add the line \usepackage{amssymb}.

B.20. Branches
Branches are described in section 6.9.

B.21. Output
Here you can define some output specifics for the current document:
LyX Format The option Save transient properties controls whether document settings
that are frequently switched or that are specific to the user are saved with the
document. The properties that are affected by option are currently:
• the activation of change tracking
• the output of tracked changes
• the recording of the document directory path.
Disabling the option can prevent issues in collaborative work and/or when using
a version control system (for instance unnecessary merge conflicts)
Default Output Format: The format that is used when you enter “View”, “Update”,
“View Master Document” and “Update Master Document” in the Document
menu or the toolbar. The default is set in Tools ▷ Preferences ▷ File Handling ▷
File Formats, see section C.7.2.
LaTeX Output Options offers settings for the LaTeX export.
• Synchronize with Output enables Forward search and allows to customize the
macro used in this process (for a detailed description see section Reverse
DVI/PDF search of the Additional Features manual).
• Put fragile content out of moving arguments determines whether so-called
‘fragile’ LATEX constructs (such as labels or index entries) are placed out-
side of so-called ‘moving arguments’ in LATEX (such as sections or captions),
even if the corresponding insets are placed in such context in LYX. This
setting is on by default, since it prevents nasty LATEX errors. If you rely on

168
B.22. LaTeX Preamble

labels or index entries being kept inside the problematic macros, you can
uncheck this. If you don’t know what we are talking about here, worry
not: just leave it checked.
XHTML Output Options offers settings for the export format LyXHTML. Strict
XHTML 1.1 will assure that the output follows exactly version 1.1 of the XHTML
standard. The different Math output settings are described in detail in section
Math Output in XHTML of the Additional Features manual. Math image scaling
is used for the size of equations in the output.
DocBook Output Options offers settings for the export format DocBook. The de-
tails for the options are described in the chapter DocBook Output in the Additional
Features Manual.
.
Allow running external programs If this is switched on, LATEX is run with the -shell-escape
option which is needed with some packages. Note that this comes with security
risks, so please use this only when really necessary and if you know what you
are doing.

B.22. LaTeX Preamble


In this text field you can enter commands to load special LATEX-packages or to define
LATEX-commands. The preamble is a thing for LATEX-experts. You should not enter
commands here until you know exactly what you are doing.
An introduction to the LATEX-syntax is given in section 6.11.2.

169
C. The Preferences Dialog
The preferences dialog is called with the menu Tools ▷ Preferences. It has the following
submenus.

C.1. Look and Feel


C.1.1. User Interface
C.1.1.1. User Interface File
The appearance of the menus and toolbars can be changed by choosing a user interface
(ui) file. A ui-file is a text file where the toolbars and menus are listed. The file
default.ui loads three files:
stdmenus.inc specifies the menu entries for the standard menus
stdcontext.inc specifies the menu entries in popup context menus
stdtoolbars.inc specifies the toolbar buttons
To create your own menu and toolbar layout, start with a copy of these files and edit
the entries.
The syntax of the .inc-files is straightforward: the Menubar, Menu and Toolbar entries
must be finished with an explicit End. They may contain Submenu, Item, OptItem,
Separator, Icon, and in the case of the “file_lastfiles” menu a Lastfiles entry. The
syntax for the entries is:

Item “menu or button name” “LYX function”

All the LYX-functions are listed in the menu Help ▷ LyX Functions.

For example, assuming you use the menu Navigate ▷ Bookmarks quite often and there-
fore want six available bookmarks, you can add the line

Item “Save Bookmark 6” “bookmark-save 6”

to the “navigate_bookmarks” menu in stdmenus.inc to have the sixth bookmark.


Icon Set allows you to change the appearance of LYX’s toolbar buttons. The currently
available icon sets are compared in this image.

171
C. The Preferences Dialog

User interface style allows you to change the look and feel of LYX’s user interface
control elements. There may be different choices available on different operating
systems. On certain operating systems some styles may support dark mode while
others don’t. In order to use dark mode in LYX you may first need to enable it in
your system’s settings.

C.1.1.2. Context help


The option Enable tool tips in main work area enables tool tips showing the content of
closed insets like index entries or footnotes.

C.1.1.3. Menus
Maximum last files is the number of last opened files that LYX should display in the
menu File ▷ Open Recent.

C.1.1.4. Fullscreen
Here you can specify what is hidden in the fullscreen mode. With the option Limit
text width you can specify the width of the text in fullscreen mode. This way you
can display the text smaller than the screen; the text then appears centered.

C.1.2. Document Handling


C.1.2.1. Session handling
With the option Restore window layouts and geometries LYX’s main window will be
opened with the size and layout that was used in the last LYX session.
The option Restore cursor positions sets the cursor to the position in the file where it
was at the end of the last session.
The option Load opened files from last session opens all files that were opened in the
last LYX session.
The button Clear all session information deletes all information from previous LYX
sessions (cursor positions, names of last opened documents, etc.).

C.1.2.2. Backup & saving


Backup original documents when saving creates a backup copy of the file in the state
when it was saved the last time. It is stored in the Backup directory (see section C.3)
or in the same folder as your document if no Backup directory is specified. The
backup file has the file extension .lyx~ and the same name than the original file. If

172
C.1. Look and Feel

a Backup directory is specified, the file has the full path in its file name, separated by
“!”, e. g. !MyDir!MySubDir!Filename.lyx~.

If the option Make auto-save snapshots every X minutes is checked, LyX furthermore
automatically saves snapshots of the current document (including unsaved changes)
in the specified interval if there are unsaved changes. These files which are stored
as #<filename>.lyx# in the document’s directory are overwritten on each auto-save
cycle and deleted when the document is closed normally. Should LYX crash with
unsaved changes and the restoration from the emergency file fail, this file can be used
as a resort.

Please read section 2.2 for more details on LYX’s diverse backup and safety mecha-
nisms.

Save documents compressed by default always saves files in a compressed format (see
also section A.6.10). This applies to newly created documents only. The compression
status of existing documents is not changed when saving.

Save the document directory path stores the path of the document in the LYX file.
This is particularly handy if you have included files (such as graphics or child doc-
uments) which are referred to with relative paths. The option then allows moving
the document elsewhere and still finding these included files if they are still in their
original directories.

C.1.2.3. Windows & work area


If the option Open documents in tabs is not checked, every file will be opened in its
own new instance of LYX.

The option Single instance is only active if a LYXServer pipe1 is specified. If it


is checked, LYX documents will be opened in the same running instance of LYX.
Otherwise a new LYX instance is created for each file.

If the option Single close-tab button is checked, there will only be one close button
( ) at the right side of the tab bar to close tabs. Otherwise every document tab
has its own close button. Regardless of this option, one can always close a tab by
middle-clicking it in the tab bar.

Note: For this option you have to restart LYX before the change takes effect.

With the setting Closing last view you one can decide if a document is closed or hidden
when its tab or view is closed. Hidden documents are accessible via the menu View ▷
Hidden. Not to close documents can be useful if you open files parallel in several
instances of LYX and only want to close the view in once instance.
1
See section C.3 for information about LYXServer pipes.

173
C. The Preferences Dialog

C.1.3. Screen Fonts


These fonts are used to display your documents within LYX.
Note: This section only deals with the fonts inside the LYX window. The fonts that
appear in the output are independent of these fonts, and set in the menu Document ▷
Settings ▷ Fonts.
By default, LYX uses Times as its Roman (serif) font, Arial or Helvetica (depends
on the system) as its Sans Serif font and Courier as its Typewriter font.
You can change the font size with the Zoom setting.
The Font Sizes are calculated as letter height in units of points. 72.27 points have the
size of 1 inch, see Appendix D. The default font sizes are the same as if a document
font size of 10 pt were used. The sizes are explained in detail in section 3.7.3.

C.1.4. Colors
Here you can change the screen colors used by LYX by choosing an item in the list
and selecting the Alter button.
By checking the option Use system colors the color scheme of your OS or window
manager is used. The colors cursor, selection, table line, text, URL label and URL text
are then not customizable and thus not listed.

C.1.5. Display
Here you can specify if graphics are displayed inside LYX.
Instant Preview enables previewing snippets of your document. This feature is de-
scribed in section 6.13.
Checking the option Mark end of paragraphs displays a pilcrow (¶) at the end of every
paragraph.

C.2. Editing
C.2.1. Control
C.2.1.1. Editing
The option Cursor follows scrollbar sets the cursor to the top of the currently displayed
document part when scrolling.
You can adjust the width of the cursor. If you set the value to zero, the thickness of
the cursor scales relative to the zoom value you choose for the screen fonts.

174
C.2. Editing

Scroll below end of document is self-explanatory.


In LYX one can jump from word to word by pressing Ctrl+arrow key. With the option
Use Mac-style for cursor moving between words the cursor jumps from the end of a word
to the end of the next word. Normally it jumps from the beginning to the beginning.
The option Keep change tracking markup on copy and paste is only relevant in doc-
uments that do not track changes. In such documents, change-tracked text will be
copied and pasted as is (keeping addition and deletion markup) with this option se-
lected. It the option is not selected, pasted text will be inserted without any markup
(i. e., as ‘unchanged’ text). This also applies to wrapping to/dissolving from insets.
In documents that do track changes, pasted text is always marked as ‘new’ notwith-
standing the state of this option.
The option Sort environments alphabetically sorts the entries in the pull-down box for
the paragraph environments.
The option Group environments by their category groups the entries in the pull-down
box for the paragraph environments.
The Edit math macros options determine the editing style for math macros, see the
section Math Macros of the Math manual.
The option Search drive for cited files allows LYX to query your disk for cited docu-
ments when using the Try to Open Citation Content. . . context menu on a citation.
The Pattern field determines the search pattern. See sec. 6.6.3 for details.

C.2.2. Shortcuts
Bind File specifies the file to be used to bind a LYX function to a key. Several binding
files are available, among them:
cua.bind a typical set of PC keyboard shortcuts
(x)emacs.bind a set of bindings similar to those used in the editor programs Emacs
(XEmacs)
mac.bind a set of bindings for Mac OS systems.
There are also binding files designed for special document classes, like broadway.bind,
and binding files for special languages. The names of language binding files begin
with a language code, e. g. “pt” for Portuguese. If you use LYX in a certain language,
LYX will try to use the appropriate binding file.
Some binding files, like math.bind, only have a limited scope. When looking at the
end of the file cua.bind, you can see that they are included to keep the overview in
the bind-file.

175
C. The Preferences Dialog

The field Show key-bindings containing allows you to search for the shortcut provided
for a particular function in the selected key binding file.

C.2.2.1. Editing Shortcuts


To add new or modify existing key bindings to your own taste you can use the table
in the dialog that lists all LYX functions and the bound shortcuts. To find functions
easily, they are grouped by categories and the dialog provides the field Show key-
bindings containing. In this field you can insert a keyword for a function you want
to edit. Insert there for example as keyword “paste” and you get the four different
existing shortcuts for the three different functions that contain “paste” in their name.
As you can see, one function can have more than one shortcut. All LYX functions
are also listed in the file LYX Functions that you will find in the Help menu.
For example, to add the shortcut Alt+Q for the function textstyle-apply, select the
function and press the Modify button. A dialog pops up where you can add the
shortcut by using it. So press Alt+Q to define the shortcut.
Modifying an existing shortcut is done the same way. You can also bind multiple func-
tions to one shortcut by starting the LYX Function definition with “command-alternatives”
and following it with the different function names as a semicolon separated list. LYX
will then use the first function that is enabled in the current document part.
If you don’t like a particular shortcut, you can remove it.
Alternatively you can also edit shortcuts by modifying binding files with a text editor.
The syntax of the entries is:
\bind “key combination” “LYX function”
Note, though, that the key combination definition uses a specific syntax. This applies
to the designators of specific modifier keys (e. g., M, S, C for Meta/Alt, Shift, Ctrl,
respectively) as well as to the other keys. Note particularly that you cannot use
non-alphanumeric characters directly in the definition of the key combination, but
must use commands following the Xlib standard instead (please refer to the existing
bind files for a model). So if you wanted to bind a command to the key combination
Alt+Shift+:, you needed to specify it as M-S-colon. If you use the dialog to edit key
bindings, you don’t have to care for these specifics. LYX transforms your input to
the correct syntax.

C.2.3. Keyboard/Mouse
Normally keyboard settings are made in a menu of your operating system. For the
case where this is not possible, LYX provides keyboard maps. If, for example, you
have a Czech keyboard but want to use it as if it is a Romanian one, you can enable
Use keyboard map and select the keyboard map file named romanian.kmap.

176
C.3. Paths

You can specify a First and a Second keyboard map and, if you use the cua bindings,
you can select the first and second with Alt+K 1 and Alt+K 2 respectively or toggle
between them with Alt+K T.
Note: Keyboard maps can only provide a makeshift solution and don’t work on all
systems.
You can also specify the mouse Wheel scrolling speed. The standard value is 1.0;
higher values speed up the scrolling, lower ones slow it down. With the option Middle
mouse button pasting you can determine if pressing the middle mouse button (or the
mouse wheel) inserts the content of the clipboard.
If you Enable Scroll wheel zoom, you can select a key for zooming. When this key is
pressed and the mouse wheel is rotated, the text is zoomed.

C.2.4. Input Completion


Input completion is described in section 2.7.

C.3. Paths
The paths to the various resources used by LYX are normally determined during the
installation. But there may be reasons why you might want to modify them.
Working directory This is LYX’s working directory. It is the default when you Open,
Save or Save As files.
Document templates This directory contains the templates that are shown in File ▷
New from Template.
Example files This directory contains the example files that are listed in File ▷ Open
Example.
Backup directory Backup copies will be saved to this directory. If no directory is
given but backups are enabled as described in section C.1.2.2, the Working
directory will be used to save the backups.
Backup files have the ending “.lyx~”.
LyXServer pipe Here you can enter the name of a so-called UNIX-pipe. This pipe
is used to send data from external programs to LYX.
Example: You add a BibTEX database test.bib to your document. You can
edit this file with the program JabRef. In JabRef you have to use the same
Unix-Pipe for LYX in its preferences under External programs. If you want to
get one entry of the database as citation, select it in JabRef and click on the
LYX symbol. The entry will now be inserted as a citation at the current cursor
position in your LYX file. Of course, JabRef and LYX need to be running the

177
C. The Preferences Dialog

same time.
The pipe is also used for the Single instance feature, see section C.1.2.2.
To use the LYXServer-Pipe on Windows, you must use this pipe name:
\\.\pipe\lyxpipe

Temporary directory Temporary files will be saved in this directory.

Thesaurus dictionary Directory where the thesaurus dictionaries are located. You
only need to specify it if the thesaurus does not work or if you want to use
custom/alternative dictionaries.

Hunspell dictionary Directory where the dictionaries of the spell checker program
Hunspell are located. You only need to specify it if you are using Hunspell
and spell checking does not work or if you want to use custom/alternative
dictionaries. For LYX on Windows Hunspell is the only available spell checker
and should work without specifying a directory.

PATH prefix This field contains a list of paths to external programs. When LYX
needs to use an external program, it looks in this list to see where to find it
on the system. The path list is automatically set up on Windows and Mac
systems when LYX is configured; so you normally don’t have to modify it. On
Unix / Linux systems, the path list will need to be set only if there are external
programs you wish to use that are not in your normal system path ($PATH).

TEXINPUTS prefix The TEXINPUTS environment variable allows you to use ex-
ternal files which are included in a LYX document via commands in TEX code
or in the document preamble. This prefix includes by default the document
directory (represented by a single dot ’.’). The prefix can contain any list of
paths separated by the default separator of the OS (’:’ on UNIX like systems
and ’;’ on Windows). If files are included, the paths listed in the TEXINPUTS
prefix will be scanned for the input files. Note that any non-absolute path listed
in the TEXINPUTS prefix is considered to be relative to the directory of your
LYX file. It is recommended that you always include ’.’ as one of the paths;
otherwise compilation may fail for some documents.

C.4. Identity
Here you can insert your Name and E-mail address. These will be used when you have
enabled change tracking, as described in section 6.17, to mark changes you make as
yours.

178
C.5. Language Settings

C.5. Language Settings


C.5.1. Language
User interface language Here you can select the language for LYX’s menus. You
can find its actual translation status here: https://www.lyx.org/I18n

C.5.1.1. LaTeX Language Support


Language package determines which LATEX package should be loaded to handle lan-
guage issues. Language issues that are handled by this package include proper
hyphenation as well as localization of dates and text strings such as “Chapter”
and “Table”. The most widespread language package is babel; it is the default
language package in classic LATEX. More recent typesetting engines such as
XeTEX and LuaTEX come with the alternative language package polyglossia
that is more suited to the multi-script support of these engines. Furthermore,
there are also specific language packages for languages not covered by babel.
The available selections are described in section B.9.
Command start Here you customize the command that is used to switch to a dif-
ferent language. This might be useful if you want to use a different command
with babel (which provides several alternative commands with different be-
havior), or if you use a custom language package with specific commands, such
as ArabTEX [24], which needs the start command \begin{arabtext}. The de-
fault is the babel command \selectlanguage{$$lang}, whereby $$lang is a
placeholder that is substituted with the respective language name in the LATEX
output. Note that with polyglossia, this setting is ignored.
Command end Use this if the language switch set in Command start needs to be ex-
plicitly ended, as in babel’s alternative command \begin{otherlanguage*}...
\end{otherlanguage*}. Empty by default, as \selectlanguage{$$lang}
does not need to be explicitly ended (the switch remains valid until the next
\selectlanguage{$$lang}). Note that with polyglossia, this setting is ig-
nored.
Set languages globally If this option is set, the languages used in the document
will be added to the document class options rather than the language pack-
age options. Since the document class passes all options in gets to all loaded
LATEX-packages, all language-aware packages will be informed about the used
languages this way.
Set document language explicitly If this option is set, the language switch defined
in Command start is output at the beginning of the document, thereby explicitly
switching to the document language. This assures that the correct language is
used in any case. This might be needed if you use a non-default Command start

179
C. The Preferences Dialog

or if a package resets the document language. If not set, the language that is
active at document start is used (this usually should be the document language).
Unset document language explicitly Counterpart to Set document language explic-
itly. If set, the Command end is output at the end of the document.

C.5.1.2. Editor Settings


Mark additional languages If set, all text in a language different to the document
language will be marked (by default with a blue underline).
Right-to-left cursor movement Here you can define how cursor movement (with
the arrow keys) behaves when writing scripts with right-to-left direction (e.g.,
Arabic, Hebrew or Farsi).
Logical means that the cursor follows the logic of the text direction, and the
arrows’ direction relates to the directionality of the main paragraph language.
E. g., in embedded right-to-left text in a left-to-right paragraph (say, Hebrew
embedded in English), the cursor starts at the right (that is, at the beginning of
the embedded passage in the right-to-left logic) when coming from the left. The
meaning of the key is thus swapped for that part; right arrow in this specific
case always means: move forward in text (even if this means: move left). This
setting might be useful in texts that mix left-to-right and right-to-left scripts,
since the cursor then follows a coherent “text logic”.
Visual means: always move to the direction towards which the arrows really
point. In this case, in embedded right-to-left text in a left-to-right paragraph,
the cursor starts at the left (in the text logic: from the end) when coming from
the left. The visual meaning of the key is thus maintained in all cases, at the
expense of the text logic.

C.5.1.3. Local Preferences


Default decimal separator Defines the default decimal separator for use in tables
(decimal separator alignment). By default, the appropriate character for the
current language is selected (e. g., dot for English, comma for German), but
you can also specify a specific (static) custom character here.
Default length unit Defines the unit that is used as default for lengths in LYX’s
dialogs.

C.5.2. Spellchecker
The spellchecker settings are explained in section 6.15.

180
C.6. Outputs

C.6. Outputs
C.6.1. General
Forward search Commands that will be used for the menu Navigate ▷ Forward search.
For a detailed description see section Reverse DVI/PDF search of the Addi-
tional Features manual.
Dvips Options Options for the program dvips that is used for the export format
Postscript, see section A.1.15. Possible options are listed in the dvips manual:
https://www.tug.org/texinfohtml/dvips.html#Option-details
Output line length sets the maximum number of characters printed in one line when
using the menu File ▷ Export ▷ Plain text. Setting the line length to 0 means all
text is printed in one endless line.
Overwrite on export Setting what LYX is allowed to overwrite on export.

C.6.2. LaTeX
DVI viewer paper size options They only have an effect when the program xdvi is
used as DVI-viewer, read its manual to find out more.
Here you can also specify options and commands with parameters for processors. But
before you change something, it is strongly recommended to read the manuals of the
applications.
Bibliography generation Settings for the generation of the bibliography, see sec-
tion 6.6.2.
Index generation Settings for the generation of the index, see section 6.7.8.
Nomenclature command Command for the program that generates the nomencla-
ture, see section 6.8.5.
CheckTeX command Command for the program CheckTEX that is described in the
section Checking TEX of the Additional Features manual.
There are additionally the following options:
Use Windows-style paths in LATEX files Uses paths in the notation of Windows,
that means that “\” is used instead of “/” to separate folders. This option
is enabled by default when you use LYX on Windows.
Reset class options when document class changes Removes all manually set Class
options in the Document ▷ Settings ▷ Document Class dialog when changing the
document class.

181
C. The Preferences Dialog

C.7. File Handling


C.7.1. Converters
Here you find the list of defined converter commands to convert material from one
format to another. You can modify converters or create new ones. To modify a
converter, select it, change the entry of the Converter and/or Extra flag field and
press the Modify button. To create a new converter, select an existing one, select a
different format in the To format drop-down list, modify the Converter field and press
the Add button.
If the Converter File Cache is Enabled, conversions will be cached as long as specified in
the field Maximum Age (in days). This means that images don’t need to be converted
again when you reopen a document; the converted images from the cache will be used
instead.
More about converters, like the flags that can be used in the converter definition, is
described in the section Converters of the Customization manual.

C.7.2. File Formats


Here you find the list of defined file formats that LYX can handle. You can modify
the Editor and Viewer programs that should be used for certain formats.
You can also define the Default output format that is used when you use View, Update,
View Master Document or Update Master Document in the Document menu or the
toolbar.
More about formats and their options is described in the section Formats of the
Customization manual.
Since all conversions from one format to another take place in LYX’s temporary
directory, it is sometimes necessary to modify a file before copying it to the temporary
directory so that the conversion may be performed. This is done by specifying a
Copier. More about this is described in the section Copiers of the Customization
manual.

182
D. Units available in LYX
Table D.1 explains all the units available in LYX and used in this documentation.

Table D.1.: Units

unit name/description LATEX command


bp big point (72 bp = 1 in) -
cc cicero (1 cc = 12 dd) -
cm centimeter -
dd didot (1 dd ≈ 0.376 mm) -
em width of letter M in current font -
ex height of letter x in current font -
in inch -
mm millimeter -
mu math unit (1 mu = 1/18 em) -
pt point (72.27 pt = 1 in) -
pc pica (1 pc = 12 pt) -
sp scaled point (65536 sp = 1 pt) -
Column Width % % of column width \columnwidth
% of height between baselines of two
Line Distance % \baselineskip
subsequent text lines
Line Width % % of line width \linewidth
Page Height % % of paper height \paperheight
Page Width % % of paper width \paperwidth
Scale Graphics % % of original image width
Text Height % % of text height \textheight
Text Width % % of text width \textwidth

183
D. Units available in LYX

The bibliography on the following page was created with the Bibliography environ-
ment.

184
Bibliography

[Credits] The LYX Team: Credits:


https://www.lyx.org/Credits

[1] Frank Mittelbach and Michel Goossens: The LATEX Companion Second Edi-
tion. Addison-Wesley, 2004

[2] Helmut Kopka and Patrick W. Daly: A Guide to LATEX Fourth Edition.
Addison-Wesley, 2003

[3] Leslie Lamport: LATEX: A Document Preparation System. Addison-Wesley,


second edition, 1994

[4] Donald E. Knuth. The TEXbook. Addison-Wesley, 1984

[5] The TEX Catalogue:


https://ctan.org/topic

[6] The LATEX FAQ:


http://www.tex.ac.uk/faq/

[7] Documentation of the program BibTEX:


https://www.ctan.org/tex-archive/biblio/bibtex/contrib/doc/
btxdoc.pdf

[8] Documentation how to use the program BibTEX:


https://www.ctan.org/tex-archive/info/bibtex/tamethebeast/
ttb_en.pdf

[9] Documentation of the LATEX package biblatex:


https://www.ctan.org/tex-archive/macros/latex/contrib/
biblatex/doc/biblatex.pdf

[10] Documentation of the LATEX package biber:


https://www.ctan.org/tex-archive/biblio/biber/documentation/
biber.pdf

[11] Documentation of the program makeindex:


https://www.ctan.org/tex-archive/indexing/makeindex/doc/
makeindex.pdf

185
Bibliography

[12] Options for the program makeindex:


https://www.ctan.org/tex-archive/indexing/makeindex/doc/
manpages.dvi
[13] Documentation of the program xindex:
http://mirrors.ctan.org/indexing/xindex/doc/xindex-doc.pdf
[14] Documentation of the program xindy:
http://www.xindy.org/documentation.html
[15] Documentation of the AMS LATEX-packages:
https://www.ams.org/publications/authors/tex/amslatex
[16] Documentation of the LATEX package caption:
https://www.ctan.org/tex-archive/macros/latex/contrib/
caption/caption-eng.pdf
[17] Documentation of the LATEX package enumitem:
https://www.ctan.org/tex-archive/macros/latex/contrib/
enumitem/enumitem.pdf
[18] Documentation of the LATEX package fancyhdr:
https://www.ctan.org/tex-archive/macros/latex/contrib/
fancyhdr/fancyhdr.pdf
[19] Documentation of the LATEX package hyperref :
https://www.ctan.org/tex-archive/macros/latex/contrib/
hyperref/doc/manual.pdf
[20] Documentation of the LATEX package microtype:
https://www.ctan.org/tex-archive/macros/latex/contrib/
microtype/microtype.pdf
[21] Documentation of the LATEX package nomencl:
https://www.ctan.org/tex-archive/macros/latex/contrib/
nomencl/nomencl.pdf
[22] Documentation of the LATEX package prettyref :
https://www.ctan.org/tex-archive/macros/latex/contrib/
prettyref/prettyref.pdf
[23] Documentation of the LATEX package refstyle:
https://www.ctan.org/tex-archive/macros/latex/contrib/
refstyle/refstyle.pdf
[24] Wiki-page how to set up LYX for Arabic:
https://wiki.lyx.org/Windows/Arabic
[25] Wiki-page how to set up LYX for Armenian:
https://wiki.lyx.org/Windows/Armenian

186
Bibliography

[26] Wiki-page how to set up LYX for Cyrillic languages:


https://wiki.lyx.org/Windows/Cyrillic
[27] Wiki-page how to set up LYX for Farsi:
https://wiki.lyx.org/Windows/Farsi
[28] Wiki-page how to set up LYX for Hebrew:
https://wiki.lyx.org/Windows/Hebrew
[29] Wiki-page how to set up LYX for Japanese:
https://wiki.lyx.org/Windows/Japanese

187
Bibliography 2
[KD03] Helmut Kopka and Patrick W. Daly. A Guide to LATEX. Addison-Wesley,
Harlow, 4th edition, 2003.
[Lam94] Leslie Lamport. LATEX: A Document Preparation System. Addison-Wesley,
Reading, MA, 1994.
[MG04] Frank Mittelbach and Michael Goossens. The LATEX Companion. Addison-
Wesley, Boston, 2nd edition, 2004.
[WCT] Graham Williams and the CTAN Team. The CTAN catalogue. https:
//ctan.org/pkg/catalogue.
The above bibliography is created from a BibTEX database.

189
Nomenclature
@, |, !, " The quote sign in TeX code is output by writing ’ "" ’.
a dummy entry for the character ""a""
Alt Alt or Meta key
Ctrl Control key
Esc Escape key
Shift Shift key
Tab Tabulator key
σ dummy entry for the character sigma

191
Index

Abstracts, 34 Cross references, 97


AMS math, 96 Customization
Appendix, 102 of menus, 171
of toolbars, 171
Backup Cut, 6
Directory, 177
Documents, 172 Dashes, 66
Bibliography, 35, 102 Document
Biblatex, 105 Branches, 117
BibTEX, 104 Change Tracking, 134
Citation format, 106 Classes, 15
Databases, 104 Font, 54
Bindings, see Key Bindings Header/Footer line, 123
Boxes, 148 Language, 135
Branches, 117 Layout, 18
Local Layout, 18
Captions, 149 Margins, 19
Change Tracking, 134 Modules, 17
Character count, 154 Paper size, 19
Character Styles, 56 Preview, 65, 126
ChkTEX, 154 Settings, 15, 17–21, 24, 27, 49, 54,
Color 56, 71, 96, 103–106, 135, 159
background, 164 Title, 22
Change tracking, 134 Types, 15
Greyed-out notes, 164 Dummy entries
LYX screen, 174 This is an italic dummy entry, 111
main text, 164
Editing, 6
Shaded boxes, 164
EPS, see Image formats
Text, 61 External Material, 148
Compare, 154
Comparison of documents, 135 File formats, 63, 182
Converters, 182 DVI, 63
Copiers, 182 LATEX, 63
Copy, 6 PDF, 64
Counters, 101 Plain text, 63

193
Index

PostScript, 64 Instant preview, 126


File handling, 182 International support, 135
File Operations, 3
FileFormats JPG, see Image formats
XHTML, 65 Key Bindings, 12, 175
Find, 127 Editing, 176
Find, 7 Keyboard Map, 176
Floats, 83
Captions, 83 Language
Details, 85 Encoding, 161
Figure floats, 83 Options, 135
Table floats, 84 Phonetic symbols, 146
Font Settings, 179
Screen, 174 L TEX packages
A

Size, 54 CJK, 55
Types, 52 pstricks, 64
Fonts setspace, 21
Bitmap, 53 LATEX packages
Vector, 52 biblatex, 105
Footnotes, 75 L TEX packages
A

Formulas, see Math amsmath, 166


amssymb, 166
GIF, see Image formats babel, 68, 162, 179
Glossary, see Nomenclature biber, 106, 185
Graphics, 76 biblatex, 104, 107, 166, 185
Header/Footer line, 123 bibtopic, 166
Horizontal lines, 52 cancel, 166
HTML, 65 caption, 122, 186
Hyperlinks, 100 CJK, 163, 164
Hyphenation, 68 enumitem, 30, 32, 33, 186
Hyphens, 66 esint, 166
fancyhdr, 19, 125, 186
Images, 76 fontenc, 55
Formats, 77 hyperref, 119, 186
Settings grouping, 78 inputenc, 161, 164
Index japanese, 163
Cross referencing, 110 jurabib, 107, 166
Entry formatting, 111 mathdots, 166
Entry order, 111 mathtools, 166
Grouping, 109 mhchem, 166
Page ranges, 110 microtype, 56, 186
Processor, 113 natbib, 103, 107, 166
Index generation, 109 nomencl, 114, 186
Input completion, 11 polyglossia, 162, 179

194
Index

prettyref, 98, 160, 186 Integrals, 89


preview-latex, 126 Limits, 89
refstyle, 98, 160, 186 Macros, 94
splitidx, 114 Matrices, 92
stackrel, 166 Multi-line Equations, 92, 96
stmaryrd, 166 Navigating, 87
tipa, 146 Referencing formulas, 93
ucs, 164 Roots, 89
undertilde, 166 Spaces, 90
L TEX Syntax, 121
A Subscripts, 88
Letters, 33 Sums, 89
Ligatures, see Typography Symbols, 89
Line breaks, 51 Text, 95
Lists, 26 Typefaces, 94
Customization, 32 Menu
Customized, 30 Document, 151
Description, 28 Edit, 141
Enumerate, 28 File, 137
Custom, 30 Help, 155
Resumed, 31 Insert, 145
Itemize, 27 Navigate, 150
Labeling, 29 Tools, 154
Spacing, 32 View, 143
LYX Minipages, 85
Basics, 15 Mouse Operations, 8
Proper names, 73 Multi-page tables, 79
Reconfigure, see Reconfiguration of Navigating, 9
LYX Horizontal
LYX-Code, 36 Scrolling, 10
Outline, 9, 99
Marginal notes, 76
Nesting
Margins, 19
Environments, 37
Math, 87
Examples, 41
Accents, 90
Separation, 45
AMS, 96
Tables etc., 39
Arrays, 92
Nomenclature, 114
Basics, 87
Layout, 115
Brackets, 91
Options, 116
Delimiters, 91
Printing, 117
Exponents, 88
Program, 117
Font sizes, 95
Sort order, 115
Formula numbering, 93
Notes, 75
Fractions, 88
Functions, 90 Outline, 9, 99

195
Index

Page Breaks Paths, 177, 181


Suppress, 51 Shortcuts, 175
Page breaks Shortcuts, see Key Bindings
Clear, 51 Spaces
Forced, 50 inter-word, 70
Paragraph Non-Breaking, 46
Alignment, 50 Normal, 46
Environments, 21 Thin, 47
Indentation, 20 thin, 70
Line spacing, 21 Spacing, 46
Separation, 20 Fills, 48, 49
Settings, 142 Horizontal, 46
Verse, 26 Phantom, 49
Paragraph environments, 21–36 Vertical, 49
Paste, 6 Spell checking, 131
Paths, 177, 181 SVG, see Image formats
PDF, 64, 77
PDF properties, 119 Table of contents, 99
Phonetic symbols, 146 Tables, 78
PNG, see Image formats Cells, 82
Poetry, 26 Multi-page, 79
Preferences, 2, 171 Caption, 149
Program listings, 150 TEX Code, 121
Punctuation marks, 70 TEX Information, 154
Text Style, 56, 59
Quotation, 25
Thesaurus, 132
Quotation marks, see Typography
Toolbar, 144
Reconfiguration of LYX, 2, 17, 141, 152 Extra, 156
Reconfiguration of LYX, 154 Macro, 158
Redo, 8 Review, 134
Replace, 127 Standard, 155
Replace, 7 Table, 158
View / Update, 157
Section headings, 23 Typography, 66
Numbered, 23 Ligatures, 72
Short titles, 24 Quotation marks, 71
Unnumbered, 24 Units, 73
Settings Widows and orphans, 73
Color, 174
Display, 174 Undo, 8
Editing, 174 Units, 183
Keyboard Map, 176 URLs, 100
Language, 179
LATEX, 181 Verbatim, 36

196
Index

Word completion, see Input completion


Word count, 154

197

You might also like