Professional Documents
Culture Documents
org
LaTeX
Getting Started . . . . . . . . . .
Introduction . . . . . . . . . . . .
1.1. What is TeX? . . . . . . .
1.2. What is LaTeX? . . . . .
1.3. Other terms regarding TeX
1.4. Prerequisites . . . . . . .
1.5. What next? . . . . . . . .
2. Basics . . . . . . . . . . . . . . .
2.1. The LaTeX source . . . .
2.2. Input File Structure . . . .
2.3. Our first document . . . .
2.4. And what now? . . . . . .
I.
1.
Contents
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. .
3
5
5
8
14
15
32
35
36
44
56
71
Document Structure . . . . . . . . . . . .
3.1. The document environment . . .
4. Errors and Warnings . . . . . . . . . . . .
4.1. Error messages . . . . . . . . . . .
4.2. Warnings . . . . . . . . . . . . . .
4.3. Examples . . . . . . . . . . . . . .
5. Bibliography Management . . . . . . . . .
5.1. Embedded system . . . . . . . . .
5.2. Citations . . . . . . . . . . . . . .
5.3. BibTeX . . . . . . . . . . . . . . .
5.4. Bibliography in the table of contents
5.5. Multiple Bibliographies . . . . . .
5.6. References . . . . . . . . . . . . .
II. Formating . . . . . . . . . . . . . . . . . .
6. List Structures . . . . . . . . . . . . . . .
6.1. List Structures . . . . . . . . . . .
6.2. Easylist package . . . . . . . . . .
7. Tables . . . . . . . . . . . . . . . . . . . .
7.1. Floating with table . . . . . . . .
7.2. The tabular environment . . . .
3.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
77
78
. 101
102
104
105
117
118
. 121
133
180
187
189
. 191
193
194
216
219
. 221
224
7.16.
7.17.
7.18.
7.19.
7.20.
7.3.
7.4.
7.5.
7.6.
7.7.
7.8.
7.9.
7.10.
7.11.
7.12.
7.13.
7.14.
7.15.
Spanning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Resize tables . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sideways tables . . . . . . . . . . . . . . . . . . . . . . . . . . .
Alternate Row Colors in Tables . . . . . . . . . . . . . . . . . .
Colors of individual Cells . . . . . . . . . . . . . . . . . . . . .
Partial Vertical Lines . . . . . . . . . . . . . . . . . . . . . . . .
Space between rows . . . . . . . . . . . . . . . . . . . . . . . .
The table environment - captioning etc . . . . . . . . . . . . .
The tabular* environment - controlling table width . . . . . .
The tabularx package - simple column stretching . . . . . . .
Vertically centered images . . . . . . . . . . . . . . . . . . . . .
Professional tables . . . . . . . . . . . . . . . . . . . . . . . . .
Adding rule spacing above or below \hline and \cline commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tables with different font size . . . . . . . . . . . . . . . . . . .
Table with legend . . . . . . . . . . . . . . . . . . . . . . . . . .
Need more complicated features? . . . . . . . . . . . . . . . . .
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
258
258
258
258
258
258
248
255
258
258
258
258
258
258
258
258
258
258
Title Creation . . . . . . . . . .
8.1. Standard Title Pages . .
8.2. Custom Title Pages . . .
9. Page Layout . . . . . . . . . .
9.1. Page dimensions . . . .
9.2. Page orientation . . . .
9.3. Page styles . . . . . . .
9.4. Multi-column pages . .
9.5. Manual page formatting
9.6. Widows and orphans . .
9.7. Summary . . . . . . . .
10. Paragraph Formatting . . . . . .
10.1. Paragraph Alignment . .
10.2. Paragraph Indents . . . .
10.3. Line Spacing . . . . . .
10.4. Special Paragraphs . . .
10.5. Notes and References . .
11. Importing Graphics . . . . . . .
11.1. The graphicx package
11.2. Creating Vector Graphics
8.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
258
259
262
273
274
284
288
307
310
313
315
317
317
320
324
327
. 341
343
344
378
11.3. References . . . . . . . . . . . . . . . . . . . . . . . .
12. Creating Graphics . . . . . . . . . . . . . . . . . . . . . . . .
12.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . .
12.2. Alternatives . . . . . . . . . . . . . . . . . . . . . . . .
13. Floats, Figures and Captions . . . . . . . . . . . . . . . . . . .
13.1. Floats . . . . . . . . . . . . . . . . . . . . . . . . . . .
13.2. Captions . . . . . . . . . . . . . . . . . . . . . . . . .
13.3. Labels in the figures . . . . . . . . . . . . . . . . . . .
13.4. References . . . . . . . . . . . . . . . . . . . . . . . .
14. Hyperlinks . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14.1. Hyperref . . . . . . . . . . . . . . . . . . . . . . . . .
14.2. Usage . . . . . . . . . . . . . . . . . . . . . . . . . . .
14.3. Customization . . . . . . . . . . . . . . . . . . . . . .
14.4. Problems with Links and Equations . . . . . . . . . . .
14.5. Problems with Links and Pages . . . . . . . . . . . . .
14.6. Problems with Bookmarks . . . . . . . . . . . . . . . .
14.7. Problems with tables and figures . . . . . . . . . . . . .
14.8. Problems with long caption and \listoffigures or long title
14.9. Problems with already existing .toc, .lof and similar files
14.10. Problems with footnotes and special characters . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
385
387
389
392
399
400
407
434
436
437
437
438
445
457
458
462
464
466
467
468
III.
17.
16.
15.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
468
469
. 471
472
473
475
476
477
483
489
490
. 491
494
496
499
. 501
503
506
508
510
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
512
514
522
527
533
538
549
554
. 561
562
572
579
583
584
584
585
587
588
595
620
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 621
625
628
630
638
640
643
644
645
647
647
652
660
. 661
663
664
665
667
668
669
25.
26.
23.
24.
21.
22.
20.3. Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . .
20.4. Theorem styles . . . . . . . . . . . . . . . . . . . . . .
20.5. Conflicts . . . . . . . . . . . . . . . . . . . . . . . . .
20.6. Notes . . . . . . . . . . . . . . . . . . . . . . . . . . .
20.7. External links . . . . . . . . . . . . . . . . . . . . . . .
Algorithms and Pseudocode . . . . . . . . . . . . . . . . . . .
Typesetting Algorithms . . . . . . . . . . . . . . . . . . . . . .
22.1. Typesetting using the algorithmic package . . . . .
22.2. Typesetting using the algorithmicx package . . . .
22.3. The algorithm environment . . . . . . . . . . . . . .
22.4. Typesetting using the program package . . . . . . . .
22.5. Source Code Formatting using the Listings package
References . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linguistics . . . . . . . . . . . . . . . . . . . . . . . . . . . .
24.1. Enumerated examples . . . . . . . . . . . . . . . . . .
24.2. Syntactic trees . . . . . . . . . . . . . . . . . . . . . .
24.3. Glosses . . . . . . . . . . . . . . . . . . . . . . . . . .
24.4. IPA characters . . . . . . . . . . . . . . . . . . . . . .
References . . . . . . . . . . . . . . . . . . . . . . . . . . . .
External links . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 671
674
677
678
678
679
. 681
. 681
683
692
697
704
707
709
. 711
720
737
740
747
749
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 751
753
753
758
759
760
762
766
770
774
777
779
780
807
808
808
. 811
. 811
812
816
V. Advanced Topics . . . . . . . . . . . . . . . .
30. General Guidelines . . . . . . . . . . . . . . .
30.1. Project structure . . . . . . . . . . . .
30.2. Getting LaTeX to process multiple files
30.3. The file mystyle.sty . . . . . . . .
30.4. The main document document.tex .
30.5. Writing your document . . . . . . . . .
30.6. External Links . . . . . . . . . . . . .
31. Customizing LaTeX . . . . . . . . . . . . . .
31.1. New commands . . . . . . . . . . . . .
31.2. New Environments . . . . . . . . . . .
31.3. Command-line LaTeX . . . . . . . . .
31.4. Creating your own package . . . . . .
31.5. Creating your own style . . . . . . . .
32. Packages . . . . . . . . . . . . . . . . . . . .
32.1. Using an existing package . . . . . . .
32.2. Package documentation . . . . . . . .
32.3. Packages list . . . . . . . . . . . . . .
32.4. Creating packages . . . . . . . . . . .
32.5. External resources . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
817
819
820
. 821
835
837
. 841
842
843
844
849
853
854
856
859
. 861
863
865
885
885
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
887
888
892
897
899
900
904
905
907
910
914
924
. 931
934
934
937
939
943
944
946
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
947
. 951
953
954
957
960
963
997
998
1003
1005
1006
1006
1008
1009
1009
. 1011
1012
1013
1015
42.
40.
41.
VI.
39.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1026
1028
1030
. 1031
1033
1035
1035
1038
1039
1047
1048
. 1051
1053
1055
1057
1057
1059
1059
. 1061
1064
42.4. Samples . . . . . . . . . . . . . . . . .
42.5. References . . . . . . . . . . . . . . .
42.6. See also . . . . . . . . . . . . . . . . .
43. Text Formatting . . . . . . . . . . . . . . . . .
43.1. Spacing . . . . . . . . . . . . . . . . .
43.2. Hyphenation . . . . . . . . . . . . . .
43.3. Quote-marks . . . . . . . . . . . . . .
43.4. Diacritics and accents . . . . . . . . .
43.5. Space between Words and Sentences . .
43.6. Ligatures . . . . . . . . . . . . . . . .
43.7. Slash marks . . . . . . . . . . . . . . .
43.8. Emphasizing Text . . . . . . . . . . . .
43.9. Fonts . . . . . . . . . . . . . . . . . .
43.10. Symbols and special characters . . . .
43.11. Notes and References . . . . . . . . . .
44. Sample LaTeX documents . . . . . . . . . . .
44.1. General examples . . . . . . . . . . . .
44.2. Semantics of Programming Languages
45. Command Glossary . . . . . . . . . . . . . . .
45.1. # . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1066
1068
1068
1069
1070
1076
1080
1083
1084
1088
1090
1092
1093
1115
1125
1127
1127
1129
. 1131
. 1131
45.2.
45.3.
45.4.
45.5.
45.6.
45.7.
45.8.
45.9.
45.10.
45.11.
45.12.
45.13.
45.14.
45.15.
45.16.
45.17.
45.18.
45.19.
45.20.
45.21.
A
B
C
D
E
F
G
H
I .
K
L
M
N
O
P
R
S
T
U
V
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1135
1137
1139
1142
1142
1143
1146
1146
1148
1150
1150
1153
1155
1158
1159
. 1161
1163
1167
1173
1174
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1177
1178
1178
1179
1184
. 1191
. 1191
1192
1194
1195
1196
1197
1198
1199
1200
. 1201
1202
1203
1204
1205
47.15. S . . . . . . . . . . . . . . . . . . .
47.16. T . . . . . . . . . . . . . . . . . . .
47.17. U . . . . . . . . . . . . . . . . . . .
47.18. V . . . . . . . . . . . . . . . . . . .
47.19. W . . . . . . . . . . . . . . . . . . .
47.20. X . . . . . . . . . . . . . . . . . . .
48. Contributors . . . . . . . . . . . . . . . . .
List of Figures . . . . . . . . . . . . . . . . . . .
49. Licenses . . . . . . . . . . . . . . . . . . . .
49.1. GNU GENERAL PUBLIC LICENSE
49.2. GNU Free Documentation License . .
49.3. GNU Lesser General Public License .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1205
1206
1208
1208
1209
1209
. 1211
. 1271
1295
1295
1304
. 1311
Getting Started
Part I.
1
2
http://en.wikibooks.org/wiki/TeX
http://en.wikipedia.org/wiki/Donald%20Knuth
1. Introduction
TeX is a programming language, in the sense that it supports the if-else construct, you can make calculations with it (that are performed while compiling
the document), etc., but you would find it very hard to do anything else but
typesetting with it. The fine control TeX offers makes it very powerful, but also
difficult and time-consuming to use. TeX is renowned for being extremely sta-
Knuth started writing the TeX typesetting engine in 1977 to explore the potential of the digital printing equipment that was beginning to infiltrate the
publishing industry at that time, especially in the hope that he could reverse
the trend of deteriorating typographical quality that he saw affecting his own
books and articles.
As powerful as TeX might be, effective use requires a fairly high level of
learning, and investment of time to build custom macros for text formatting.
For those searching for a more straightforward solution, document preparation
systems based on TeX, consisting of collections of pre-built macros, exist.
LaTeX is one of the more popular of these. It is appreciated for being time
saving, automating certain tasks and reducing user introduced errors. This is
what makes it so popular. However, this comes at the cost of a sacrifice of
flexibility. TeX remains the language of choice for those wishing a dedicated
formatting language and almost unlimited functionality.
ble, for running on many different kinds of computers, and for being virtually
bug free.
3
4
http://en.wikipedia.org/wiki/Leslie%20Lamport
http://www.ctan.org
5
6
7
8
http://en.wikibooks.org/wiki/TeX
http://en.wikipedia.org/wiki/WYSIWYG
http://en.wikipedia.org/wiki/Openoffice.org
http://en.wikipedia.org/wiki/Microsoft%20Word
On the other hand, there are certain advantages to the LaTeX approach:
You don't (usually) see the final version of the document when editing it.
You generally need to know the necessary commands for LaTeX markup.
It can sometimes be difficult to obtain a certain look for the document.
In LaTeX:
Since LaTeX comprises a group of TeX5 commands, LaTeX document processing is essentially programming. You create a text file in LaTeX markup,
which LaTeX reads to produce the final document.
http://en.wikipedia.org/wiki/XML
Document sources can be read with any text editor and understood, unlike
the complex binary and XML9 formats used with WYSIWYG programs.
You can concentrate purely on the structure and contents of the document,
not get caught up with superficial layout issues.
You don't need to manually adjust fonts, text sizes, line heights, or text flow
for readability, as LaTeX takes care of them automatically.
In LaTeX the document structure is visible to the user, and can be easily
copied to another document. In WYSIWYG applications it is often not
obvious how a certain formatting was produced, and it might be impossible
to copy it directly for use in another document.
The layout, fonts, tables and so on are consistent throughout the document.
Mathematical formulae can be easily typeset.
Indexes, footnotes, citations and references are generated easily.
Since the document source is plain text, tables, figures, equations, etc. can
be generated programmatically with any language.
You are forced to structure your documents correctly.
10
11
http://en.wikipedia.org/wiki/WYSIWYM
http://en.wikipedia.org/wiki/DVI%20file%20format
The LaTeX document is a plain text file containing the content of the document,
with additional markup. When the source file is processed by the macro
package, it can produce documents in several formats. LaTeX natively supports
DVI11 and PDF, but by using other software you can easily create PostScript,
PNG, JPEG, etc.
The LaTeX-like approach can be called WYSIWYM10 , i.e. What You See
Is What You Mean: you can't see what the final version will look like while
typing. Instead you see the logical structure of the document. LaTeX takes
care of the formatting for you.
One of the most frustrating things beginners and even advanced users might
encounter using LaTeX is the lack of flexibility regarding the document design
and layout. If you want to design your document in a very specific way, you
may have trouble accomplishing this. Keep in mind that LaTeX does the
formatting for you, and mostly the right way. If it is not exactly what you
desired, then the LaTeX way is at least not worse, if not better. One way to
look at it is that LaTeX is a bundle of macros for TeX that aims to carry out
everything regarding document formatting, so that the writer only needs to
care about content. If you really want flexibility, use plain TeX instead.
12
http://www.ctan.org/
CTAN12 is a good place to find many resources regarding TeX and derivative
packages. It is the first place where you should begin searching.
and someone who encountered a similar problem before may have published
their solution as a package.
13
14
15
http://en.wikipedia.org/wiki/XeTeX
http://en.wikipedia.org/wiki/ConTeXt
http://en.wikipedia.org/wiki/LuaTeX
Therefore code written for TeX, LaTeX or ConTeXt are (mostly) not compatible. Additionnaly, engine-specific code (like font for XeTeX) may not be
compiled by every engine.
When searching for information on LaTeX, you might also stumble upon
XeTeX13 , ConTeXt14 , LuaTeX15 or other names with a -TeX suffix. XeTeX
is a TeX engine which uses Unicode and supports widely popular .ttf and
.otf fonts. LuaTeX is another engine with Lua scripting engine embedded
aiming at making TeX internals more flexible.
16
http://scribtex.com/
and continue this tutorial in the next chapter. ScribTeX is a web based online
editor for LaTeX documents with collaboration capabilities allowing you to
experiment with LaTeX syntax without having to bother with installing and
configuring a distribution and an editor. When you later feel that you would
benefit from having a standalone LaTeX installation, you can return to this
chapter and follow the instructions below.
ScribTeX.com16
At a minimum, you'll need a TeX distribution, a good text editor and a DVI or
PDF viewer. But, if this is the first time you are trying out LaTeX, you don't
even need to install anything. Just create an user account at:
1.4. Prerequisites
17
18
19
http://www.tug.org/texlive/
http://www.miktex.org/
http://www.tug.org/mactex/
TeX Live17 is a major TeX distribution for Unix/Linux, Mac OS and Windows.
MiKTeX18 is a Windows-specific distribution.
MacTeX19 is a Mac OS-specific distribution based on TeX Live.
If you want to use LaTeX locally on your computer, you generally need
to install a TeX distribution. TeX distributions are packaged collections of
packages and programs that enable you to typeset without having to manually
fetch files and configure things. The recommended distributions for each of
the major operating systems are:
20
21
22
http://www.tug.org/texlive/acquire.html
http://miktex.org/
http://alexkrispin.wordpress.com/2010/10/12/
a-script-to-automate-the-installation-of-texlive-2010/
Ubuntu has a 2009 version of TeX Live in the repositories, so you can use:
sudo apt-get install texlive. Here22 is a script to automate
the installation of TeX Live 2010 on Ubuntu.
Linux
TeX live and MikTeX have easy installers that take care of setting up the
environment and downloading packages.
Windows
25
23
24
http://fedoraproject.org/wiki/Features/TeXLive
http://www.gentoo.org/proj/en/tex/texlive-migration-guide.
xml#doc_chap2
http://www.tug.org/texlive/acquire.html
If your distribution does not have the TeX Live packages, you should report a
wish to the bug tracking system. In the worst case you will need to download
TeX Live25 yourself and run the installer by hand. It is not hard, but requires
that you know how to use a console and make multiple choices during the
installation.
Fedora has only 2007 version of TeX Live, but luckily there is a good
repository here23 that you can use to directly install the latest version: yum
install texlive (plus yum install texlive-latex and any
of the texlive-scheme- packages).
Gentoo provides an ebuild to install texlive using the command
emerge texlive. http://www.gentoo.org/proj/en/tex/texlive-migrationguide.xml#doc_chap224 This is a meta-ebuild that pulls in many other packages depending on its USE flags.
26
http://www.tug.org/mactex/
You will also need a text editor to write LaTeX code. You should use a text
editor (e.g. Notepad), not a word processor (Word, Openoffice). Dedicated
LaTeX editors are more useful than plain text editors, because they usually have
autocompletion of commands, spell and error checking and handy macros.
Mac OS
27
http://www.tug.org/texworks/
You can install TeXworks with the package manager of your Linux distribution
or choose it as an install option in the Windows or Mac installer.
TeXworks
28
29
30
http://www.lyx.org/
http://kile.sourceforge.net/
http://en.wikipedia.org/wiki/KDE_Software_Compilation_4
Kile
LyX28 is a popular LaTeX editor for Windows, Linux and Mac OS. It contains
formula and table editors and shows visual clues of the final document on the
screen enabling users to write LaTeX documents without worrying about the
actual syntax.
LyX
31
32
http://www.xm1math.net/texmaker/
http://texstudio.sourceforge.net/
TeXstudio
TeXmaker
33
34
http://www.texniccenter.org/
http://www.winedt.com/
WinEdt
TeXnicCenter33 is a popular free and open source LaTeX editor for Windows.
It also has a similar user interface to TeXmaker and Kile.
TeXnicCenter
35
36
http://bakoma-tex.com/menu/about.php
http://en.wikipedia.org/wiki/TeXShop
TeXShop
BaKoMa TeX
37
38
http://www.michaels-website.de/gedit-latex-plugin/
http://gummi.midnightcoding.org/
Gummi38 is a LaTeX editor for Linux, which compiles the output of pdflatex
in realtime and shows it on the right half of the screen.
Gummi
Gedit with gedit-latex-plugin37 is also worth trying out for users of GNOME.
GEdit is a cross-platform application for Windows, Mac, and Linux
gedit-latex-plugin
39
40
41
http://www.gnu.org/software/emacs
http://en.wikipedia.org/wiki/Vim
http://www.vim.org/scripts/script.php?script_id=3109
Vim40 is another general purpose text editor for a wide variety of platforms
including UNIX, Mac OS X and Windows. A variety of extensions exist
including LaTeX Box41 and Vim-LaTeX.
Vim
Emacs39 is a general purpose text processing system. When used in combination with Auctex and Reftex (extensions that may be installed into the Emacs
program), Emacs provides a complete LaTeX editing environment complete
with table of contents view, document preview and many other features. Emacs
is a very mature editing system with a unique set of keyboard commands.
Emacs
42
http://latexila.sourceforge.net/
Usually you will use a LaTeX compiler like pdflatex to produce a PDF
file directly, or a tool like dvi2pdf to convert the DVI file to PDF format.
Then you can view the result with your preferred PDF viewer (Adobe Reader,
Okular, Evince, Sumatra, Foxit).
Finally, you will need a viewer for the files LaTeX outputs. Normally LaTeX
saves the final document as a .dvi (Device independent file format), but you
will rarely want it to. DVI files do not contain embedded fonts and many
document viewers are unable to open them.
1.4.3. Viewers
LaTeXila
Also tex and pdftex compilers are included, but you should be careful with
using them, because they support only plain TeX. Note that since LaTeX is
just a collection of macros for TeX if you compile a plain TeX document with
a LaTeX compiler (such as pdflatex) it will work while the opposite is not
Here are the main programs you expect to find in any LaTeX distribution:
Practically all LaTeX distributions have a DVI viewer for viewing the default
output of latex, and also tools such as dvi2pdf for converting the result
automatically to PDF and PS formats.
You would write your document slightly differently depending on the compiler
you are using (latex or pdflatex). But as we will see later it is possible
to add a sort of abstraction layer to hide the details of which compiler you're
using, while the compiler can handle the translation itself.
When LaTeX was created, the only format it could create was DVI; later
PDF support was added by pdflatex. PDF files can be created with both
pdflatex and dvipdfm. The output of pdflatex takes direct advantage
of modern features of PDF such as hyperlinks and embedded fonts, which are
not part of DVI. Passing through DVI imposes limitations of its older format.
On the other hand, some packages, such as PSTricks, exploit the process of
conversion to DVI, and therefore will not work with pdflatex. Some of those
packages embed information in the DVI that doesn't appear when the DVI is
viewed, but reemerges when the DVI is converted to another, newer format.
true: if you try to compile a LaTeX source with a TeX compiler you will get
many errors.
Figure 1
(pdf,
png,
jpg)
PDF
pdf2ps
ps2pdf
dvipdfm
PostScript
Output formats
dvi2ps
latex
pdatex
Source formats
tex
pdftex
(eps)
DVI
The following diagram shows the relationships between the LaTeX source
code and the formats you can create from it:
43
http://en.wikipedia.org/wiki/Ghostscript
Most of the programs should be already within your LaTeX distribution; the
others come with w:Ghostscript43 , which is a free and multi-platform software
as well.
The boxed red text represents the file formats, the blue text on the arrows
represents the commands you have to use, the small dark green text under the
boxes represents the image formats that are supported. Any time you pass
through an arrow you lose some information, which might decrease the quality
of your document. Therefore, in order to achieve the highest quality in your
output file, you should choose the shortest route to reach your target format.
This is probably the most convenient way to obtain an output in your desired
format anyway. Starting from a LaTeX source, the best way is to use only latex
for a DVI output or pdflatex for a PDF output, converting to PostScript only
when it is necessary to print the document.
44
45
46
Throughout this book you should also utilise other means for learning about
LaTeX. Good sources are:
Now you should check that your editor and LaTeX distribution are functioning
properly by trying to compile the first example source in the beginning of the
next chapter45 .
47
48
49
http://tex.stackexchange.com/
http://www.tex.ac.uk/cgi-bin/texfaq2html
http://www.texample.net/
1
2
Chapter 1 on page 5
Chapter 41 on page 1047
Before starting, ensure you have LaTeX installed on your computer (see
Installation2 for instructions of what you will need). We begin by creating the
source LaTeX file, and then take you through how to feed this file through the
LaTeX system to produce quality output, such as postscript or PDF.
This tutorial is aimed at getting familiar with the bare bones of LaTeX1 .
2. Basics
\begin{document}
\documentclass{article}
For the truly impatient, a minimal example looks something like the following
(the commands will be explained later):
The input for LaTeX is a plain ASCII text file. You can create it with any text
editor. It contains the text of the document, as well as the commands that tell
LaTeX how to typeset the text.
2.1.1. Spaces
Hello world!
\end{document}
spaces
The following symbols are reserved characters that either have a special
meaning under LaTeX or are unavailable in all the fonts. If you enter them
directly in your text, they will normally not print, but rather make LaTeX do
It does not matter whether you enter one or several spaces after a word.
An empty line starts a new paragraph.
The command \ produces a tilde which is placed over the next letter. For
example \n gives . To produce just the character , use \{} which places
a over an empty box.
The other symbols and many more can be printed with special commands in
mathematical formulae or as accents.
As you will see, these characters can be used in your documents all the same
by adding a prefix backslash:
# $ % & _ { } \
http://en.wikibooks.org/wiki/LaTeX%2FFormatting
They start with a backslash \ and then have a name consisting of letters
only. Command names are terminated by a space, a number or any other
"non-letter".
They consist of a backslash \ and exactly one non-letter.
LaTeX commands are case sensitive, and take one of the following two formats:
If you want to insert text that might contain several particular symbols (such as
URIs), you can consider using the \verb command, which will be discussed
later in the section on formatting3 .
Similarly, the command \ produces a hat over the next character, for example
\{o} produces . If you need in text to display the symbol you have to use
\textasciicircum.
{
\bf This is bold.
}
This is no more bold.
Example:
\commandname[option1,option2,...]{argument1}{argument2}...
Between the \begin and the \end you can put other commands and nested
environments. The internal mechanism of environments defines a group, which
makes its usage safe (no influence on the other parts of the document). In
general, environments can accept arguments as well, but this feature is not
commonly used and so it will be discussed in more advanced parts of the
document.
\begin{environmentname}
text to be influenced
\end{environmentname}
Environments in LaTeX have a role that is quite similar to commands, but they
usually have effect on a wider part of the document. Their syntax is:
For some commands it is important to restrict their range of action, and that's
where groups come to be very useful.
This is an % stupid
% Better: instructive <---example: Supercal%
ifragilist%
icexpialidocious
This can be used to write notes into the input file, which will not show up in
the printed version.
2.1.6. Comments
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Multi-line_comments
The core LaTeX language does not have a predefined syntax for commenting
out regions spanning multiple lines. Refer to multi-line comments4 for simple
workarounds.
Note that the % character can be used to split long input lines that do not allow
whitespace or line breaks, as with Supercali...cious above.
\end{document}
Now you enter the text mixed with some useful LaTeX commands. At the end
of the document you add the
\begin{document}
When all the setup work is done, you start the body of the text with the
command
\usepackage{...}
This specifies what sort of document you intend to write. After that, you can
include commands that influence the style of the whole document, or you can
load packages that add new features to the LaTeX system. To load such a
package you use the command
\documentclass{...}
Example: an input file for a LaTeX document could start with the line
Here class specifies the type of document to be created. The LaTeX distribution
provides additional classes for other documents, including letters and slides.
The options parameter customizes the behavior of the document class. The
options have to be separated by commas.
\documentclass[options]{class}
The first information LaTeX needs to know when processing an input file is
the type of document the author wants to create. This is specified with the
\documentclass command.
command, which tells LaTeX to call it a day. Anything that follows this
command will be ignored by LaTeX. The area between \documentclass
and \begin{document} is called the preamble.
proc
IEEEtran
Document Classes
article
Here are some document classes that can be used with LaTeX:
which instructs LaTeX to typeset the document as an article with a base font
size of 11 points, and to produce a layout suitable for double sided printing on
A4 paper.
\documentclass[11pt,twoside,a4paper]{article}
book
slides
report
Document Classes
minimal
is as small as it can get. It only
sets a page size and a base font.
It is mainly used for debugging
purposes.
for longer reports containing several chapters, small books, thesis,
...
for real books
for slides. The class uses big sans
serif letters.
http://www.ctan.org/tex-archive/macros/latex/contrib/
memoir/memman.pdf
Chapter 28 on page 779
The most common options for the standard document classes are listed in the
following table:
letter
beamer
Document Classes
memoir
fleqn
a4paper, letterpaper,...
onecolumn, twocolumn
titlepage, notitlepage
landscape
\documentclass[12pt,a4paper,oneside,draft]{report}
For example, if you want a report to be in 12pt type on A4, but printed onesided in draft mode, you would use:
command, where package is the name of the package and options is a list of
keywords that trigger special features in the package. Some packages come
with the LaTeX base distribution. Others are provided separately.
\usepackage[options]{package}
While writing your document, you will probably find that there are some
areas where basic LaTeX cannot solve your problem. If you want to include
graphics, colored text or source code from a file into your document, you need
to enhance the capabilities of LaTeX. Such enhancements are called packages.
Packages are activated with the
2.2.2. Packages
http://en.wikibooks.org/wiki/Learning%20the%20vi%20Editor%
2FVim
http://en.wikibooks.org/wiki/emacs
Open your favorite text-editor. vim8 , emacs9 , Notepad++, and other text
editors will have syntax highlighting that will help to write your files.
Reproduce the following text in your editor. This is the LaTeX source.
Now we can create our first document. We will produce the absolute bare
minimum that is needed in order to get some output; the well known Hello
World! approach will be suitable here.
When picking a name for your file, make sure it bears a .tex extension.
\begin{document}
\documentclass{article}
As we have said before, each of the LaTeX commands begins with a backslash
(\). This is LaTeX's way of knowing that whenever it sees a backslash, to
expect some commands. Comments are not classed as a command, since all
they tell LaTeX is to ignore the line. Comments never affect the output of the
document.
\end{document}
Hello World!
This was the only actual line containing real content - the text that
we wanted displayed on the page.
1. Type the command: latex hello (the .tex extension is not required, although you can include it if you wish)
2. Various bits of info about LaTeX and its progress will be displayed. If
all went well, the last two lines displayed in the console will be:
It is clearly not going to be the most exciting document you have ever seen,
but we want to see it nonetheless. I am assuming that you are at a command
prompt, already in the directory where hello.tex is stored. LaTeX itself
does not have a GUI (graphical user interface), since it is just a program that
crunches away at your input files, and produces either a DVI or PDF file. Some
LaTeX installations feature a graphical front-end where you can click LaTeX
into compiling your input file. On other systems there might be some typing
involved, so here is how to coax LaTeX into compiling your input file on a text
based system. Please note: this description assumes that you already have a
working LaTeX installation on your computer.
1. Type the command: pdflatex hello (as before, the .tex extension is not required)
2. Various bits of info about LaTeX and its progress will be displayed. If
all went well, the last two lines displayed in the console will be:
This way you created the DVI file, but with the same source file you can create
a PDF document. The steps are exactly the same as before, but you have to
replace the command latex with pdflatex:
This means that your source file has been processed and the resulting document
is called hello.dvi, which takes up 1 page and 232 bytes of space. Now you
may view the DVI file. On Unix with X11 you can type xdvi foo.dvi, on
Windows you can use a program called yap (yet another previewer). (Now
evince and okular, the standard document viewers for many Linux distributions
are able to view DVI files.)
DVI needs less disk space and it is faster to create. It does not include the
fonts within the document, so if you want the document to be viewed properly
on another computer, there must be all the necessary fonts installed. It does
not support any interactivity such as hyperlinks or animated images. DVI
viewers are not very common, so you can consider using it for previewing
your document while typesetting.
PDF needs more disk space and it is slower to create, but it includes all
the necessary fonts within the document, so you will not have any problem
of portability. It supports internal and external hyperlinks. It also supports
you can notice that the PDF document is bigger than the DVI, even if it contains
exactly the same information. The main differences between the DVI and PDF
formats are:
10
http://en.wikipedia.org/wiki/Hanging%20punctuation
Note, in this instance, due to the simplicity of the file, you only need to run the
LaTeX command once. However, if you begin to create complex documents,
including bibliographies and cross-references, etc, LaTeX needs to be executed
multiple times to resolve the references. But this will be discussed in the future
when it comes up.
About now, you saw you can create both DVI and PDF document from the
same source. This is true, but it gets a bit more complicated if you want
to introduce images or links. This will be explained in detail in the next
chapters, but for now assume you can compile in both DVI and PDF without
any problem.
Never, ever use directories (folders) or file names that contain spaces. Although
your operating system probably supports them, some don't, and they will only
cause grief and tears with TeX. Make filenames as short or as long as you wish,
For a PDF output, you may have noticed that the output PDF file is not always
the same size depending on the engine you used to compile the file. So latex
dvips ps2pdf will usually be much smaller than pdflatex. So
if you want pdflatex features along with a small output file size, you can use
the Ghostscript command:
When you work with LaTeX you will soon find yourself in a maze of files with
various extensions and probably no clue. The following list explains the most
common file types you might encounter when working with TeX:
but strictly avoid spaces. Stick to lower-case letters without accents (a-z), the
digits 0-9, the hyphen (), and only one full point or period (.) to separate the
file extension (somewhat similar to the conventions for a good Web URL): it
will let you refer to TeX files over the Web more easily and make your files
more portable. Some operating systems do not distinguish between upper-case
and lower-case letters, others do. Therefore it's best not to mix them.
.bib
.blg
.bst
.cls
.bbl
.fd
.ins
.log
.ind
.idx
.lot
.lof
.out
.tex
.sty
11
12
Chapter 3 on page 77
Chapter 30 on page 819
When working on big documents, you might want to split the input file into
several parts. LaTeX has three commands to insert a file into another when
building the document.
This
command
is
roughly
equivalent
to
\clearpage
\input{filename} \clearpage. The \include command is
different from \input in that it's the output that is added instead of the
commands from the other files. Therefore a new page will be created at
every \include command, which makes it appropriate to use it for large
entities such as book chapters. The file extension of the .tex file which is to
be included must also be omitted from the filename, unlike with input for
\include{filename}
\input inserts the contents of another file, named filename.tex; note that the
.tex extension is omitted. For all practical purposes, \input is no more than
a simple, automated copy-and-paste of the source code in filename.tex.
\input{filename}
In this case, the user wants to include only filename2.tex and filename3.tex.
If the inclusion hierarchy is intricate, commenting can become error-prone:
page numbering will change, and any cross references won't work. A better
alternative is to retain the include calls and use the \includeonly command
in the preamble:
%\include{filename1}
\include{filename2}
\include{filename3}
%\include{filename4}
Very large documents (that usually include many files) take a very long time
to compile, and most users find it convenient to test their last changes by
including only the files they have been working on. One option is to hunt down
all \include commands in the inclusion hierarchy and to comment them
out:
\end{document}
Remember that the input file should omit all the commands referring to the
main document structure, which should be kept in the original document file.
This includes lines containing usepackages, document class, and everything
but the code strictly referring to the section that is to be included. In this way
you'll avoid finding characters of your code in the output document, or worse,
not finding anything after the included file, in case you forget to erase the
This way, only \include commands for the specified files will be executed,
and inclusion will be handled in only one place. Note that there must be no
spaces between the filenames and the commas.
\includeonly{filename2,filename3}
13
LaTeX is different from other typesetting systems in that you just have to tell it
the logical and semantical structure of a text. It then derives the typographical
form of the text according to the rules given in the document class file and
in various style files. LaTeX allows users to structure their documents with a
variety of hierarchal constructs, including chapters, sections, subsections and
paragraphs.
3. Document Structure
You would put your text where the dots are. The reason for marking off
the beginning of your text is that LaTeX allows you to insert extra setup
specifications before it (where the blank line is in the example above: we'll be
using this soon). The reason for marking off the end of your text is to provide
\begin{document}
...
\end{document}
\documentclass[11pt,a4paper,oneside]{report}
After the document class1 declaration, the text of your document is enclosed
between two commands which identify the beginning and end of the actual
document:
The preamble is everything from the start of the LaTeX source file until the
\begin{document} command. It normally contains commands that affect
the entire document.
3.1.1. Preamble
...
\end{document}
A useful side-effect of marking the end of the document text is that you can
store comments or temporary text underneath the \end{document} in the
knowledge that LaTeX will never try to typeset them:
\begin{document}
\documentclass{article}
\usepackage{mathptmx}
\begin{document}
\title{How to Structure a LaTeX Document}
\author{Andrew Roberts}
\date{December 2004}
\maketitle
\end{document}
\documentclass[11pt,a4paper,oneside]{report}
If you are provided with a class file from a publisher, or if you use the AMS
article class (amsart), then you can use several different commands to enter author information. The email address is at the end, and the \texttt
commands formats the email address using a mono-spaced font. The built-in
command called \today will be replaced with the current date when pro-
If there are two authors separate them with the \and command:
as you can see, you can use commands as arguments of \title and the
others. The double backslash (\\) is the LaTeX command for forced linebreak.
LaTeX normally decides by itself where to break lines, and it's usually right,
but sometimes you need to cut a line short, like here, and start a new one.
\date{\today}
\maketitle
\documentclass{article}
As most research papers have an abstract, there are predefined commands for
telling LaTeX which part of the content makes up the abstract. This should
appear in its logical order, therefore, after the top matter, but before the main
sections of the body. This command is available for the document classes
article and report, but not book.
3.1.3. Abstract
Using this approach, you can create only basic output whose layout is very
hard to change. If you want to create your title freely, see the Title Creation2
section.
cessed by LaTeX. But you are free to put whatever you want as a date, in no
set order. If braces are left empty, then the date is omitted.
The commands for inserting sections are fairly intuitive. Of course, certain
commands are appropriate to different document classes. For example, a book
\renewcommand{\abstractname}{Executive Summary}
By default, LaTeX will use the word "Abstract" as a title for your abstract, if
you want to change it into anything else, e.g. "Executive Summary", add the
following line before your abstract:
\begin{abstract}
Your abstract goes here...
...
\end{abstract}
...
\end{document}
\begin{document}
Command
Level
Comment
Notice that you do not need to specify section numbers; LaTeX will sort that
out for you. Also, for sections, you do not need to markup which content
belongs to a given block, using \begin and \end commands, for example.
LaTeX provides 7 levels of depth for defining sections:
\subsubsection{Article Information}
This subsubsection's content...
\subsection{Top Matter}
This subsection's content...
\section{Structure}
This section's content...
\section{Introduction}
This section's content...
has chapters but an article doesn't. Here is an edited version of some of the
structure commands in use from simple.tex.
All the titles of the sections are added automatically to the table of contents
(if you decide to insert one). But if you make manual styling changes to your
heading, for example a very long title, or some special line-breaks or unusual
font-play, this would appear in the Table of Contents as well, which you almost
certainly don't want. LaTeX allows you to give an optional extra version of the
heading text which only gets used in the Table of Contents and any running
heads, if they are in effect. This optional alternative heading goes in [square
brackets] before the curly braces:
Command
Level
Comment
\part{part}
-1
not in letters
\chapter{chapter}
0
only books and reports
\section{section}
1
not in letters
\subsection{subsection}2
not in letters
\subsubsection{subsubsection}
3
not in letters
\paragraph{paragraph} 4
not in letters
\subparagraph{subparagraph}
5
not in letters
Section numbering
All the divisional commands from \part* to \subparagraph* have this "starred"
version which can be used on special occasions for an unnumbered heading when the setting of secnumdepth would normally mean it would be
numbered.
\subsection*{Introduction}
To get an unnumbered section heading which does not go into the Table of
Contents, follow the command name with an asterisk before the opening curly
brace:
\setcounter{tocdepth}{3}
A related counter is tocdepth, which specifies what depth to take the Table
of Contents to. It can be reset in exactly the same way as secnumdepth. For
example:
\setcounter{secnumdepth}{1}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
For chapters you will also need to clear the page (this will also correct page
numbering in the ToC):
\phantomsection
\addcontentsline{toc}{section}{Introduction}
\section*{Introduction}
Note if you use pdf bookmarks you will need to add a phantom section so that
bookmark will lead to the correct place in the document:
\section*{Introduction}
\addcontentsline{toc}{section}{Introduction}
If you want the unnumbered section to be in the table of contents anyway, use
the \addcontentsline command like this:
\addtocounter{counter}{integer}
\setcounter{section}{4}
The value where the section numbering starts from can be set with the following
command:
\bibliographystyle{unsrt}
\bibliography{my_bib_file}
\appendix
\section{First Appendix}
\appendix
\chapter{First Appendix}
3.1.5. Appendices
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Paragraph_Indents
All auto-numbered headings get entered in the Table of Contents (ToC) automatically. You don't have to print a ToC, but if you want to, just add the
command \tableofcontents at the point where you want it printed (usually after the Abstract or Summary).
Paragraphs of text come after section headings. Simply type the text and
leave a blank line between paragraphs. The blank line means "start a new
paragraph here": it does not mean you get a blank line in the typeset output.
For formatting paragraph indents and spacing between paragraphs, refer to the
Formatting3 section.
The commands \listoffigures and \listoftables work in exactly the same way as \tableofcontents to automatically list all
your tables and figures. If you use them, they normally go after the
\tableofcontents command. The \tableofcontents command
normally shows only numbered section headings, and only down to the level
defined by the tocdepth counter, but you can add extra entries with the
\addcontentsline command. For example if you use an unnumbered
section heading command to start a preliminary piece of text like a Foreword
or Preface, you can write:
Entries for the ToC are recorded each time you process your document, and
reproduced the next time you process it, so you need to re-run LaTeX one extra
time to ensure that all ToC pagenumber references are correctly calculated.
We've already seen how to use the optional argument to the sectioning commands to add text to the ToC which is slightly different from the one printed in
the body of the document. It is also possible to add extra lines to the ToC, to
force extra or unnumbered section headings to be included.
To change the title of the TOC, you have to paste this command
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
This will format an unnumbered ToC entry for "Preface" in the "subsection" style. You can use the same mechanism to add lines to the
List of Figures or List of Tables by substituting lof or lot for toc.
If the hyperref package is used and the link does not point correct
to the chapter, the command \phantomsection in combination with
\clearpage or \cleardoublepage can be used (see also Labels_and_Cross-referencing4 ):
\subsection*{Preface}
\addcontentsline{toc}{subsection}{Preface}
\setcounter{tocdepth}{4}
The default ToC will list headings of level 3 and above. To change how deep
the table of contents displays automatically the following command can be
used in the preamble:
Depth
for LoT.
\listtablename
\listfigurename
with
\contentsname
in your document preamble. The List of Figures (LoF) and List of Tables
(LoT) names can be changed by replacing the
\makeatletter
\renewcommand*{\toclevel@chapter}{-1} % Put chapter depth at the same
level as \part.
\chapter{Epilog}
\renewcommand*{\toclevel@chapter}{0} % Put chapter depth back to its
default value.
\makeatother
You can change the depth of specific section type, which could be useful for
PDF bookmarks (if you are using the hyperref package) :
This will make the table of contents include everything down to paragraphs.
The levels are defined above on this page. Note that this solution does not
permit changing the depth dynamically.
5
6
http://www.ctan.org/pkg/tocvsec2
http://mirror.ctan.org/macros/latex/contrib/tocvsec2/
tocvsec2.pdf
you can embed them within the document itself. It's simpler, but it can be
time-consuming if you are writing several papers about similar subjects so
that you often have to cite the same books.
Any good research paper will have a whole list of references. There are two
ways to insert your references into LaTeX:
In order to further tune the display or the numbering of the table of contents,
for instance if the appendix should be less detailed, you can make use of the
tocvsec2 package ( CTAN5 , doc6 ).
7
8
9
http://www.bibtex.org
http://www.cs.stir.ac.uk/~kjt/software/latex/showbst.html
Chapter 5 on page 117
In order to know how to add the bibliography to your document, see the
Bibliography Management9 section.
you can store them in an external BibTeX file 7 and then link them via a
command to your current document and use a Bibtex style8 to define how
they appear. This way you can create a small database of the references you
might use and simply link them, letting LaTeX work for you.
Don't panic if you see error messages: it's very common to mistype or misspell
commands, forget curly braces, type a forward slash instead of a backslash,
or use a special character by mistake. Errors are easily spotted and easily
corrected in your editor, and you can then run LaTeX again to check you
have fixed everything. Some of the most common errors are described in next
sections.
LaTeX describes what it's typesetting while it does it, and if it encounters
something it doesn't understand or can't do, it will display a message saying
what's wrong. It may also display warnings for less serious conditions.
Key
x
Meaning
Stop immediately and exit the
program.
When LaTeX finds an error like this, it displays the error message and pauses.
You must type one of the following letters to continue:
The format of an error message is always the same. Error messages begin
with an exclamation mark at the start of the line, and give a description of
the error, followed by another line starting with the number, which refers to
the line-number in your document file which LaTeX was processing when
the error was spotted. Here's an example, showing that the user mistyped the
\tableofcontents command:
h
i
Key
q
Meaning
Carry on quietly as best you can
and don't bother me with any more
error messages.
Stop the program but re-position
the text in my editor at the point
where you found the error (This
only works if you're using an editor which LaTeX can communicate
with).
Try to give me more help.
(followed by a correction) means
input the correction in place of the
error and carry on (This is only a
temporary fix to get the file processed. You still have to make that
correction in the editor).
Meaning
run in non-stop mode. Plow
through any errors, unless too
many pile up and it fails (100 errors).
Warnings don't begin with an exclamation mark: they are just comments by
LaTeX about things you might want to look into, such as overlong or underrun
lines (often caused by unusual hyphenations, for example), pages running
short or long, and other typographical niceties (most of which you can ignore
4.2. Warnings
Some systems (Emacs is one example) run LaTeX with a "nonstop" switch
turned on, so it will always process through to the end of the file, regardless of
errors, or until a limit is reached.
Key
r
Most error messages are self-explanatory, but be aware that the place where
LaTeX spots and reports an error may be later in the file than the place where
it actually occurred. For example if you forget to close a curly brace which
Only a few common error messages are given here: those most likely to be
encountered by beginners. If you find another error message not shown here,
and it's not clear what you should do, ask for help.
4.3. Examples
until later). Unlike other systems, which try to hide unevennesses in the text
(usually unsuccessfully) by interfering with the letter spacing, LaTeX takes the
view that the author or editor should be able to contribute. While it is certainly
possible to set LaTeX's parameters so that the spacing is sufficiently sloppy
that you will almost never get a warning about badly-fitting lines or pages, you
will almost certainly just be delaying matters until you start to get complaints
from your readers or publishers.
The reason LaTeX thinks there are too many }'s here is that the opening
curly brace is missing after the \date control sequence and before the word
encloses, say, italics, LaTeX won't report this until something else occurs
which can't happen until the curly brace is encountered (e.g. the end of the
document!) Some errors can only be righted by humans who can read and
understand what the document is supposed to mean or look like.
December, so the closing curly brace is seen as one too many (which it is!). In
fact, there are other things which can follow the \date command apart from
a date in curly braces, so LaTeX cannot possibly guess that you've missed out
the opening curly brace until it finds a closing one!
Runaway argument?
{December 2004 \maketitle
This can also happen if you use the wrong character encoding, for example
using utf8 without "\usepackage[utf8]{inputenc}" or using iso8859-1 without
"\usepackage[latin1]{inputenc}", there are several character encoding formats,
make sure to pick the right one.
A character that can only be used in the mathematics was inserted in normal
text. Either switch to mathematic mode via \begin{math}...\end{math} or use
the 'quick math mode': \ensuremath{math stuff}
! Missing $ inserted
In this error, the closing curly brace has been omitted from the date. It's the
opposite of the error of too many }'s, and it results in \maketitle trying to
format the title page while LaTeX is still expecting more text for the date! As
\maketitle creates new paragraphs on the title page, this is detected and LaTeX
complains that the previous paragraph has ended but \date is not yet finished.
[101]
Overfull \hbox (9.11617pt too wide) in paragraph
at lines 860--861
This comes up if you force a linebreak, e.g., \\, and have a return before it.
Normally TeX ignores linebreaks, providing full paragraphs to ragged text.
In this case it is necessary to pull the linebreak up one line to the end of the
previous sentence.
This is a warning that LaTeX cannot stretch the line wide enough to fit, without
making the spacing bigger than its currently permitted maximum. The badness
(0-10,000) indicates how severe this is (here you can probably ignore a badness
of 1394). It says what lines of your file it was typesetting when it found this,
and the number in square brackets is the number of the page onto which the
offending line was printed. The codes separated by slashes are the typeface
and font style and size used in the line. Ignore them for the moment.
The warning is given so that you can find the line in the code that originates
the problem (in this case: 860-861) and fix it. The line on this example is too
long by a shade over 9pt. The chosen hyphenation point which minimizes the
error is shown at the end of the line (Win-). Line numbers and page numbers
are given as before. In this case, 9pt is too much to ignore (over 3mm), and a
manual correction needs making (such as a change to the hyphenation), or the
flexibility settings need changing.
It can also issue this warning if the \end{document} tag was not included
and/or was deleted.
Although this is a warning from the Babel package and not from LaTeX,
this error is very common and (can) give some strange hyphenation (word
breaking) problems in your document. Wrong hyphenation rules can decrease
the neatness of your document.
When you use the \usepackage command to request LaTeX to use a certain
package, it will look for a file with the specified name and the filetype .sty.
In this case the user has mistyped the name of the paralist package, so it's easy
to fix. However, if you get the name right, but the package is not installed on
your machine, you will need to download and install it before continuing. If
you don't want to affect the global installation of the machine, you can simply
download from Internet the necessary .sty file and put it in the same folder
of the document you are compiling.
1
2
The solution is not difficult, just install the used language in your LaTeX
distribution2 .
\usepackage[latin]{babel}
http://www.ctan.org/tex-archive/macros/latex/contrib/nag
nag ( www.ctan.org/tex-archive/macros/latex/contrib/nag3 ) is a LaTeX package designed to indicate the use of obsolete commands.
There are several programs capable of checking LaTeX source, with the aim
of finding errors or highlighting bad practice, and providing more help to
(particularly novice) users than the built-in error messages.
If you previously set the X language, and then decided to switch to Y, you
will get this error. This may seem awkward, as there is obviously no error in
your code if you did not change anything. The answer lies in the .aux file,
where babel defined your language. If you try the compilation a second time, it
should work. If not, delete the .aux file, then everything will work as usual.
4.3.9. Package babel Error: You haven't loaded the option X yet.
4
5
http://www.ctan.org/tex-archive/support/lacheck
http://baruch.ev-en.org/proj/chktex/
http://www.bibtex.org
5. Bibliography Management
If you are writing only one or two documents and aren't planning on writing
more on the same subject for a long time, maybe you don't want to waste
time creating a database of references you are never going to use. In this case
made to any reference that is contained within the file. This is often more
convenient than embedding them at the end of every document written. There is
now a centralized bibliography source that can be linked to as many documents
as desired (write once, read many!). Of course, bibliographies can be split
over as many files as one wishes, so there can be a file containing references
concerning General Relativity and another about Quantum Mechanics. When
writing about Quantum Gravity (QG), which tries to bridge the gap between
these two theories, both of these files can be linked into the document, in
addition to references specific to QG.
OK, so what is going on here? The first thing to notice is the establishment of
the environment. thebibliography is a keyword that LaTeX recognizes
\end{thebibliography}
\bibitem{lamport94}
Leslie Lamport,
\emph{\LaTeX: A Document Preparation System}.
Addison Wesley, Massachusetts,
2nd Edition,
1994.
\begin{thebibliography}{9}
you should consider using the basic and simple bibliography support that is
embedded within LaTeX.
Next is the actual reference entry itself. This is prefixed with the
\bibitem{cite_key} command. The cite_key should be a unique identifier for that particular reference, and is often some sort of mnemonic consisting
of any sequence of letters, numbers and punctuation symbols (although not a
comma). I often use the surname of the first author, followed by the last two
digits of the year (hence lamport94). If that author has produced more than one
reference for a given year, then I add letters after, 'a', 'b', etc. But, you should
do whatever works for you. Everything after the key is the reference itself.
You need to type it as you want it to be presented. I have put the different parts
as everything between the begin and end tags as being data for the bibliography.
The mandatory argument, which I supplied after the begin statement, is telling
LaTeX how wide the item label will be when printed. Note however, that the
number itself is not the parameter, but the number of digits is. Therefore, I am
effectively telling LaTeX that I will only need reference labels of one character
in length, which ultimately means no more than nine references in total. If
you want more than nine, then input any two-digit number, such as '56' which
allows up to 99 references.
To actually cite a given document is very easy. Go to the point where you want
the citation to appear, and use the following: \cite{cite_key}, where
the cite_key is that of the bibitem you wish to cite. When LaTeX processes the
document, the citation will be cross-referenced with the bibitems and replaced
with the appropriate number citation. The advantage here, once again, is that
LaTeX looks after the numbering for you. If it were totally manual, then
adding or removing a reference would be a real chore, as you would have to
re-number all the citations by hand.
5.2. Citations
of the reference, such as author, title, etc., on different lines for readability.
These linebreaks are ignored by LaTeX. I wanted the title to be in italics, so I
used the \emph{} command to achieve this.
When a sequence of multiple citations are needed, you should use a single
\cite{} command. The citations are then separated by commas. Note that
you must not use spaces between the citations. Here's an example:
The argument, "p. 215", will show up inside the same brackets. Note the tilde
in [p.215], which replaces the end-of-sentence spacing with a non-breakable
inter-word space. There are two reasons: end-of-sentence spacing is too wide,
and "p." should not be separated from the page number.
\cite[p.~215]{citation01}
Sometimes you want to refer to a certain page, figure or theorem in a text book.
For that you can use the arguments to the \cite command:
\nocite{lamport95}.
5.2.4. Natbib
If you only want a reference to appear in the bibliography, but not where it is
referenced in the main text, then the \nocite{} command can be used, for
example:
5.2.3. No Cite
The result will then be shown as citations inside the same brackets.
\cite{citation01,citation02,citation03}
Output
Goossens et al. (1993)
(Goossens et al., 1993)
Goossens, Mittlebach, and
Samarin (1993)
\citep*{goossens93}
(Goossens, Mittlebach, and
Samarin, 1993)
\citeauthor{goossens93}
Goossens et al.
\citeauthor*{goossens93} Goossens, Mittlebach, and
Samarin
\citeyear{goossens93}
1993
\citeyearpar{goossens93} (1993)
\citealt{goossens93}
Goossens et al. 1993
\citealp{goossens93}
Goossens et al., 1993
Natbib commands
Citation command
\citet{goossens93}
\citep{goossens93}
\citet*{goossens93}
\usepackage[options]{natbib}
The first job is to add the following to your preamble in order to get LaTeX to
use the Natbib package:
Using the standard LaTeX bibliography support, you will see that each reference is numbered and each citation corresponds to the numbers. The numeric
style of citation is quite common in scientific writing. In other disciplines,
the author-year style, e.g., (Roberts, 2003), such as Harvard is preferred, and
is in fact becoming increasingly common within scientific publications. A
discussion about which is best will not occur here, but a possible way to get
such an output is by the natbib package. In fact, it can supersede LaTeX's
own citation commands, as Natbib allows the user to easily switch between
Harvard or numeric.
Provided
REVTeX 4 home
page2
unsrtnat
apsrev
http://authors.aps.org/revtex4/
Provided
abbrvnat
Natbib-compatible styles
Style
Source
plainnat
Provided
Description
natbib-compatible
version of plain
natbib-compatible
version of abbrv
natbib-compatible
version of unsrt
natbib-compatible
style for Physical
Review journals
of altering the existing \cite commands to display the type of citation you
want.
3
4
achemso
Description
natbib-compatible
style for Review of
Modern Physics journals
natbib-compatible
style for IEEE publications
natbib-compatible
style for American
Chemical Society
journals
http://authors.aps.org/revtex4/
http://www.ctan.org/tex-archive/help/Catalogue/entries/
ieeetran.html
http://www.ctan.org/tex-archive/help/Catalogue/entries/
achemso.html
IEEEtranN
Natbib-compatible styles
Style
Source
rmpaps
REVTeX 4 home
page3
Meaning
Parentheses () (default)
Square brackets []
Curly braces {}
Angle brackets <>
multiple citations are separated by
semi-colons (default)
Description
natbib-compatible
style for Royal Society of Chemistry
journals
http://www.ctan.org/tex-archive/help/Catalogue/entries/rsc.
html
Natbib options
Option
round
square
curly
angle
colon
Natbib-compatible styles
Style
Source
rsc
TeX Catalogue entry6
longnamesfirst
sort&compress
numbers
super
sort
authoryear
Natbib options
Option
comma
Meaning
multiple citations are separated by
commas
author year style citations (default)
numeric citations
superscripted numeric citations
multiple citations are sorted into
the order in which they appear in
the references section
as sort, compressing multiple
numeric citations where possible
the first citation of any reference
will use the starred variant (full
author list), subsequent citations
will use the abbreviated et al. style
Meaning
for use with the chapterbib package. redefines \thebibliography to
issue \section* instead of \chapter*
keeps all the authors names in a
citation on one line to fix some hyperref problems - causes overfull
hboxes
nonamebreak
Natbib options
Option
sectionbib
1.
2.
3.
4.
\bibpunct{(}{)}{;}{a}{,}{,}
The final area that I wish to cover about Natbib is customizing its citation
style. There is a command called \bibpunct that can be used to override
the defaults and change certain settings. For example, I have put the following
in the preamble:
http://www.ctex.org/documents/packages/bibref/natbib.pdf
So as you can see, this package is quite flexible, especially as you can easily
switch between different citation styles by changing a single parameter. Do
have a look at the Natbib manual7 , it's a short document and you can learn
even more about how to use it.
http://en.wikipedia.org/wiki/BibTeX
@article{greenwade93,
author = "George D. Greenwade",
title
= "The {C}omprehensive {T}ex {A}rchive {N}etwork
({CTAN})",
year
= "1993",
journal = "TUGBoat",
volume = "14",
A BibTeX database is stored as a .bib file. It is a plain text file, and so can
be viewed and edited easily. The structure of the file is also quite simple. An
example of a BibTeX entry:
5.3. BibTeX
= "3",
= "342--351"
After the type, you must have a left curly brace '{' to signify the beginning
of the reference attributes. The first one follows immediately after the brace,
which is the citation key, or the BibTeX key. This key must be unique for all
entries in your bibliography. It is this identifier that you will use within your
document to cross-reference it to this entry. It is up to you as to how you
wish to label each reference, but there is a loose standard in which you use the
author's surname, followed by the year of publication. This is the scheme that
I use in this tutorial.
Each entry begins with the declaration of the reference type, in the form of
@type. BibTeX knows of practically all types you can think of, common
ones are: book, article, and for papers presented at conferences, there is
inproceedings. In this example, I have referred to an article within a journal.
number
pages
10
http://en.wikipedia.org/wiki/BibTeX%23Bibliographic%
20information%20file
Chapter 37 on page 997
Next, it should be clear that what follows are the relevant fields and data for
that particular reference. The field names on the left are BibTeX keywords9 .
They are followed by an equals sign (=) where the value for that field is then
placed. BibTeX expects you to explicitly label the beginning and end of each
value. I personally use quotation marks ("), however, you also have the option
of using curly braces ('{', '}'). But as you will soon see, curly braces have
other roles, within attributes, so I prefer not to use them for this job as they can
get more confusing. A notable exception is when you want to use characters
with umlauts (, , etc), since their notation10 is in the format \"{o}, and
the quotation mark will close the one opening the field, causing an error in
the parsing of the reference. Using \usepackage[utf8]{inputenc}
in the preamble to the .tex source file can get round this, as the accented
characters can just be stored in the .bib file without any need for special
markup. This allows a consistent format to be kept throughout the .bib file,
avoiding the need to use braces when there are umlauts to consider.
11
12
http://newton.ex.ac.uk/tex/pack/bibtex/btxdoc/node6.html
http://newton.ex.ac.uk/tex/pack/bibtex/btxdoc/node7.html
BibTeX can be quite clever with names of authors. It can accept names in
forename surname or surname, forename. I personally use the former, but
5.3.1. Authors
It can take a while to learn what the reference types are, and what fields each
type has available (and which ones are required or optional, etc). So, look at
this entry type reference11 and also this field reference12 for descriptions of
all the fields. It may be worth bookmarking or printing these pages so that they
are easily at hand when you need them.
@book{goossens93,
author
= "Michel Goossens and Frank Mittelbach and Alexander
Samarin",
Secondly, there is the issue of how to tell BibTeX when a reference has more
than one author. This is very simply done by putting the keyword and in
between every author. As we can see from another example:
remember that the order you input them (or any data within an entry for that
matter) is customizable and so you can get BibTeX to manipulate the input
and then output it however you like. If you use the forename surname method,
then you must be careful with a few special names, where there are compound
surnames, for example "John von Neumann". In this form, BibTeX assumes
that the last word is the surname, and everything before is the forename, plus
any middle names. You must therefore manually tell BibTeX to keep the 'von'
and 'Neumann' together. This is achieved easily using curly braces. So the
final result would be "John {von Neumann}". This is easily avoided with the
surname, forename, since you have a comma to separate the surname from the
forename.
=
=
=
=
@article
Be careful if you copy the following templates, the % sign is not valid to
comment out lines in bibtex files. If you want to comment out a line, you have
to put it outside the entry.
This book has three authors, and each is separated as described. Of course,
when BibTeX processes and outputs this, there will only be an 'and' between
the penultimate and last authors, but within the .bib file, it needs the ands so
that it can keep track of the individual authors.
title
year
publisher
address
A published book
@book
@article{Xarticle,
= "",
author
title
= "",
journal
= "",
%volume
= "",
%number
= "",
%pages
= "",
= "XXXX",
year
%month
= "",
%note
= "",
}
=
=
=
=
=
=
=
=
=
=
=
"",
"",
"",
"",
"",
"",
"",
"",
"XXXX",
"",
"",
@booklet{Xbooklet,
@booklet
@book{Xbook,
author
title
publisher
%volume
%number
%series
%address
%edition
year
%month
%note
}
@conference{Xconference,
author
= "",
title
= "",
booktitle = "",
%editor
= "",
Equal to inproceedings
@conference
%author
= "",
title
= "",
%howpublished
= "",
%address = "",
= "XXXX",
year
%month
= "",
%note
= "",
"",
"",
"",
"",
"",
"XXXX",
"",
"",
"",
@incollection
@inbook
%volume
=
%number
=
%series
=
%pages
=
%address =
year
=
%month
=
%publisher=
%note
=
Master's thesis
@mastersthesis
Technical manual
@manual
@inproceedings
@misc{Xmisc,
@misc
@mastersthesis{Xthesis,
author
= "",
= "",
title
school
= "",
%type
= "diploma thesis",
%address = "",
year
= "XXXX",
%month
= "",
%note
= "",
}
@proceedings
Ph.D. thesis
@phdthesis
%author
= "",
%title
= "",
%howpublished = "",
%year
= "XXXX",
%month
= "",
%note
= "",
@unpublished
@techreport{Xtreport,
author
= "",
title
= "",
institution = "",
%type
= "",
%number
= "",
%address = "",
year
= "XXXX",
%month
= "",
%note
= "",
}
@techreport
13
http://www.see-out.com/sandramau/bibpat.html
@electronic
@collection
@patent
For convenience though, many people simply put double curly braces, which
may help when writing scientific articles for different magazines, conferences
with different BibTex styles that do sometimes keep and sometimes not keep
the capital letters:
However, avoid putting the whole title in curly braces, as it will look odd if
different capitalization format is used:
In the event that BibTeX has been set by the chosen style to not preserve all
capitalization within titles, problems can occur, especially if you are referring
to proper nouns, or acronyms. To tell BibTeX to keep them, use the good old
curly braces around the letter in question, (or letters, if it's an acronym) and all
will be well!
@article{AbedonHymanThomas2003,
author = "Abedon, S. T. and Hyman, P. and Thomas, C.",
year = "2003",
title = "Experimental examination of bacteriophage latent-period
evolution as a response to bacterial availability",
journal = "Applied and Environmental Microbiology",
volume = "69",
pages = "7499--7506"
}
Below you will find a few additional examples of bibliography entries. The
first one covers the case of multiple authors in the Surname, Firstname format,
and the second one deals with the incollection case.
@misc{website:fermentas-lambda,
author = "Fermentas Inc.",
title = "Phage Lambda: description \& restriction map",
month = "November",
year = 2008,
url =
If you have to cite a website you can use @misc, for example:
@incollection{Abedon1994,
author = "Abedon, S. T.",
title = "Lysis and the interaction between free phages and infected
cells",
pages = "397--405",
booktitle = "Molecular biology of bacteriophage T4",
editor = "Karam, Jim D. Karam and Drake, John W. and Kreuzer,
Kenneth N. and Mosig, Gisela
and Hall, Dwight and Eiserling, Frederick A. and Black,
Lindsay W. and Kutter, Elizabeth
and Carlson, Karin and Miller, Eric S. and Spicer,
Eleanor",
publisher = "ASM Press, Washington DC",
year = "1994"
}
At the end of your LaTeX file (that is, after the content, but before
\end{document}, you need to place the following commands:
@article{blackholes,
author="Rabbert Klein",
title="Black Holes and Their Relation to Hiding Eggs",
journal="Theoretical Easter Physics",
publisher="Eggs Ltd.",
year="2010",
note="(to appear)"
}
The note field comes in handy if you need to add unstructured information, for
example that the corresponding issue of the journal has yet to appear:
"http://www.fermentas.com/techinfo/nucleicacids/maplambda.htm"
}
The second command is the one that actually specifies the .bib file you
wish to use. The ones I created for this tutorial were called sample1.bib,
sample2.bib, . . ., samplen.bib, but once again, you don't include
the file extension. At the moment, the .bib file is in the same directory as the LaTeX document too. However, if your .bib file was elsewhere
(which makes sense if you intend to maintain a centralized database of ref-
Bibliography styles are files recognized by BibTeX that tell it how to format
the information stored in the .bib file when processed for output. And so the
first command listed above is declaring which style file to use. The style file in
this instance is plain.bst (which comes as standard with BibTeX). You do
not need to add the .bst extension when using this command, as it is assumed.
Despite its name, the plain style does a pretty good job (look at the output of
this tutorial to see what I mean).
\bibliographystyle{plain}
\bibliography{sample1,sample2,...,samplen}
% Note the lack of whitespace between the commas and the next bib
file.
The addition of BibTeX adds extra complexity for the processing of the source
to the desired output. This is largely hidden to the user, but because of all
the complexity of the referencing of citations from your source LaTeX file
to the database entries in another file, you actually need multiple passes to
accomplish the task. This means you have to run LaTeX a number of times.
Now that LaTeX and BibTeX know where to look for the appropriate files,
actually citing the references is fairly trivial. The \cite{ref_key} is the
command you need, making sure that the ref_key corresponds exactly to one
of the entries in the .bib file. If you wish to cite more that one reference at
the same time, do the following: \cite{ref_key1, ref_key2, ...,
ref_keyN}.
erences for all your research), you need to specify the path as well, e.g
\bibliography{/some/where/sample}.
latex latex_source_code.tex
bibtex latex_source_code.aux
latex latex_source_code.tex
latex latex_source_code.tex
After the first LaTeX run, you will see errors such as:
(Extensions are optional, if you put them note that the bibtex command takes
the AUX file as input.)
1.
2.
3.
4.
Each pass will perform a particular task until it has managed to resolve all the
citation references. Here's what you need to type (into command line):
If you want a pdf output instead of a dvi output you can use pdflatex
instead of latex as follows:
The third step, which is invoking LaTeX for the second time will
see more errors like "LaTeX Warning: Label(s) may have
changed. Rerun to get cross-references right.". Don't
be alarmed, it's almost complete. As you can guess, all you have to do is follow
its instructions, and run LaTeX for the third time, and the document will be
output as expected, without further problems.
The next step is to run bibtex on that same LaTeX source (or more precisely the
corresponding AUX file, however not on the actual .bib file) to then define all
the references within that document. You should see output like the following:
pdflatex latex_source_code.tex
bibtex latex_source_code.aux
pdflatex latex_source_code.tex
pdflatex latex_source_code.tex
pdflatex %
bibtex %
It appears that the file extension is included by default when the current file
command (%) is executed. To process your document from within vim, you
1. :!
2. :!
Note that if you are editing your source in vim and attempt to use command
mode and the current file shortcut (%) to process the document like this:
(Extensions are optional, if you put them note that the bibtex command takes
the AUX file as input.)
1.
2.
3.
4.
14
15
http://vim-latex.sourceforge.net/
http://vim-latex.sourceforge.net/documentation/
latex-suite-quickstart/
However, it is much easier to install the Vim-LaTeX plugin from here14 . This
allows you to simply type \ll when not in insert mode, and all the appropriate
commands are automatically executed to compile the document. Vim-LaTeX
even detects how many times it has to run pdflatex, and whether or not it has
to run bibtex. This is just one of the many nice features of Vim-LaTeX, you
can read the excellent Beginner's Tutorial15 for more about the many clever
shortcuts Vim-LaTeX provides.
1. :! pdflatex %
2. :! bibtex %:r (without file extension, it looks for the AUX file
as mentioned above)
3. :! pdflatex %
4. :! pdflatex %
must explicitly name the file without the file extension for bibtex to work, as is
shown below:
16
http://en.wikipedia.org/wiki/Make_%28software%29
Another option exists if you are running Unix/Linux or any other platform
where you have make16 . Then you can simply create a Makefile and use vim's
make command or use make in shell. The Makefile would then look like this:
Figure 2 plain
Figure 3 abbrv
\bibliographystyle{ieeetr}
To number the references in order of appearance, rather than alphabetical order use ieeetr
Figure 4 alpha
apa
acn
authordate1
abstract
abbrv
alpha
unsrt
plain
Style Name
Author Name
Format
Homer Jay
Simpson
Homer Jay
Simpson
H. J. Simpson
Homer Jay
Simpson
Homer Jay
Simpson
Simpson, H. J.
Simpson,
Homer Jay
Simpson, H. J.
(1995)
Simpson1995
Simpson1995a
#ID#
Simpson, 1995
#ID#
Sim95
#ID#
Reference
Format
#ID#
by author
by author
as referenced
by author
Sorting
Author Name
Format
Homer Jay
Simpson
Reference
Format
Simpson 1995
Sorting
17
http://www.cs.stir.ac.uk/~kjt/software/latex/showbst.html
As you can see, there is no field for URLs. One possibility is to include
Internet addresses in howpublished field of @misc or note field of
@techreport, @article, @book:
named
Style Name
the
first
case
or
19
18
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Typesetting%20URLs
http://purl.org/nxg/dist/urlbst
Styles provided by Natbib (see below) handle this field, other styles can be
modified using urlbst19 program. Modifications of three standard styles (plain,
abbrv and alpha) are provided with urlbst.
url = "http://www.example.com"
Another way is to use special field url and make bibliography style recognise
it.
howpublished = "\url{http://www.example.com}"
20
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=citeURL
It can achieve this because of the nature of the .bib database, where all the
information about your references is stored in a structured format, but nothing
One of the main advantages of BibTeX, especially for people who write
many research papers, is the ability to customize your bibliography to suit the
requirements of a given publication. You will notice how different publications
tend to have their own style of formatting references, to which authors must
adhere if they want their manuscripts published. In fact, established journals
and conference organizers often will have created their own bibliography style
(.bst file) for those users of BibTeX, to do all the hard work for you.
If you need more help about URLs in bibliography, visit FAQ of UK List of
TeX20 .
21
http://www.mps.mpg.de/software/latex/localtex/localltx.
html#makebst
A bibliography style file (.bst) will tell LaTeX how to format each attribute,
what order to put them in, what punctuation to use in between particular
attributes etc. Unfortunately, creating such a style by hand is not a trivial task.
Which is why Makebst (also known as custom-bib) is the tool we need.
22
http://www.mps.mpg.de/software/latex/localtex/doc/merlin.
pdf
If you are using a custom built .bst file, it is important that LaTeX can find it!
So, make sure it's in the same directory as the LaTeX source file, unless you
are using one of the standard style files (such as plain or plainnat, that come
bundled with LaTeX - these will be automatically found in the directories that
they are installed. Also, make sure the name of the .bst file you want to use
LaTeX will find the relevant file and the questioning process will begin. You
will have to answer quite a few (although, note that the default answers are
pretty sensible), which means it would be impractical to go through an example
in this tutorial. However, it is fairly straight-forward. And if you require further
guidance, then there is a comprehensive manual22 available. I'd recommend
experimenting with it and seeing what the results are when applied to a LaTeX
document.
latex makebst
23
http://tug.ctan.org/tex-archive/biblio/bibtex/contrib/
babelbib/
\usepackage[fixlanguage]{babelbib}
\selectbiblanguage{german}
When writing documents in languages other than English, you may find it desirable to adapt the appearance of your bibliography to the document language.
This concerns words such as editors, and, or in as well as a proper typographic
layout. The babelbib package23 can be used here. For example, to layout
the bibliography in German, add the following to the header:
\bibliographystyle{babplain}
\bibliography{sample}
@article{mueller08,
% ...
language = {german}
}
\usepackage{babelbib}
Alternatively, you can layout each bibliography entry according to the language
of the cited document:
24
http://scholar.google.com
\cite
Usually Latex only display the entries which are referred to with
25
http://scholar.google.de/scholar_preferences?hl=en&lr=
&output=search
One should be alert to the fact that bibliographic databases are frequently the
product of several generations of automatic processing, and so the resulting
BibTex code is prone to a variety of minor errors, especially in older entries.
the option to return properly formatted output, but you must turn it on in the
Preferences25 .
Figure 5 Literatur-Generator
Figure 6 JabRef
Figure 7 BibDesk
26
27
28
29
http://literatur-generator.de/
http://mendeley.com
http://www.zotero.org/
http://jabref.sourceforge.net/
30
31
32
http://icculus.org/referencer/index.html
http://www.citavi.ch
http://bibliographer.homelinux.net/
33
34
35
http://www.molspaces.com/cb2bib/
http://www.unix-ag.uni-kl.de/~fischer/kbibtex/
http://users.tpg.com.au/thachly/kbib/
cb2Bib33 The cb2Bib is a tool for rapidly extracting unformatted, or unstandardized bibliographic references from email alerts, journal Web pages, and
PDF files.
KBibTeX34 KBibTeX is a BibTeX editor for KDE to edit bibliographies
used with LaTeX. Features include comfortable input masks, starting web
queries (e. g. Google or PubMed) and exporting to PDF, PostScript, RTF and
XML/HTML. As KBibTeX is using KDE's KParts technology, KBibTeX
can be embedded into Kile or Konqueror.
KBib35 Another BibTeX editor for KDE. It has similar capabilities, and
slightly different UI. Features include BibTeX reference generation from
PDF files, plain text, DOI, arXiv & PubMed IDs. Web queries to Google
Scholar, PubMer, arXiv and a number of other services are also supported.
36
37
38
39
http://www.mediawiki.org/wiki/Extension:Bibwiki
http://bibdesk.sourceforge.net/
http://www.citeulike.org/
http://stat.genopole.cnrs.fr/~cambroise/doku.php?id=
softwares:dokuwikibibtexplugin
Bibwiki36 Bibwiki is a Specialpage for MediaWiki to manage BibTeX bibliographies. It offers a straightforward way to import and export bibliographic
records.
BibDesk37 BibDesk is a bibliographic reference manager for Mac OS X. It
features a very usable user interface and provides a number of features like
smart folders based on keywords and live tex display.
CiteULike38 CiteULike is a free online service to organise academic papers.
It can export citations in BibTeX format, and can "scrape" BibTeX data from
many popular websites.
Bibtex39 Bibtex is a DokuWiki plugin that allows for the inclusion
of bibtex formatted citations in DokuWiki pages and displays them in
APA format. Note: This Plugins is vulnerable to an XSS attack ->
http://www.dokuwiki.org/plugin:bibtex
40
41
http://www.bibsonomy.org/
http://www.verzetteln.de/synapsen/
Although it can take a little time to get to grips with BibTeX, in the long term,
it's an efficient way to handle your references. It's not uncommon to find .bib
files on websites that people compile as a list of their own publications, or a
survey of relevant works within a given topic, etc. Or in those huge, online
bibliography databases, you often find BibTeX versions of publications, so it's
a quick cut-and-paste into your own .bib file, and then no more hassle!
5.3.15. Summary
Or, if you are using BibTeX, your references will be saved in a .bib file, and
your TeX document will include the bibliography by these commands:
\begin{thebibliography}{99}
\bibitem{bib:one_book} some information
\bibitem{bib:one_article} other information
\end{thebibliography}
If you are writing a book or report, you'll likely insert your bibliography using
something like:
Having all your references in one place can be a big advantage. And having
them in a structured form, that allows customizable output is another one.
There are a variety of free utilities that can load your .bib files, and allow you
to view them in a more efficient manner, as well as sort them and check for
errors.
\usepackage[nottoc,numbib]{tocbibind}
The most comfortable way of adding your bibliography to the table of contents
is to use the dedicated package tocbibind that works with many standard
document classes. Simply include this code in the preamble of your document:
\bibliographystyle{plain}
\bibliography{mybibtexfile}
42
http://www.ctan.org/tex-archive/macros/latex/contrib/
tocbibind
\clearpage
\addcontentsline{toc}{chapter}{Bibliography}
If you want your bibliography to be in the table of contents, just add the
following two lines just before the thebibliography environment:
As unnumbered item
This will include the Bibliography in the Table of Contents with proper numbering. The tocbibind package can also handle including the List of Figures,
List of Tables and the Table of Contents itself in the Table of Contents. It has
many options for numbering, document structure etc. to fit almost any scenario.
See the tocbibind CTAN page42 for detailed documentation.
43
The first line just terminates the current paragraph and page. If you are
writing a book, use \cleardoublepage to match the style used. The
second line will add a line in the Table of Contents (first option, toc), it will
be like the ones created by chapters (second option, chapter), and the third
argument will be printed on the corresponding line in the Table of Contents;
here Bibliography was chosen because it's the same text the thebibliography
environment will automatically write when you use it, but you are free to write
whatever you like. If you are using separate bib file, add these lines between
\bibliographystyle and \bibliography.
\addcontentsline{toc}{section}{Bibliography}
(OR
As numbered item
This trick is particularly useful when you have to insert the bibliography in
the Table of Contents, but it can work for anything. When LaTeX finds the
code above, it will record the info as described and the current page number,
inserting a new line in the Contents page.
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
block:
\renewcommand
inside of the
\section
\begin{thebibliography}{99}
...
\end{thebibliography}
\refname
instead of
\bibname
inserts.
Note: Use
\refname
\vspace*{-1em}
followed by
\renewcommand*{\refname}{\vspace*{-1em}}
...
\end{thebibliography}
44
45
http://ctan.org/pkg/multibib
http://ctan.org/pkg/bibtopic
\documentclass{article}
This package is for multiple Bibliographies for different sections in your work.
For example, you can generate a bibliography for each chapter You can find
information about the package on CTAN44
\bibliographystyle{alpha}
\section{Testing}
Lets cite all the books: \cite{ColBenh:93} and
\cite{Munt:93}; and an article: \cite{RouxSmart:95}.
\usepackage{bibtopic}
\begin{document}
46
http://fr.wikibooks.org/wiki/LaTeX%2FGestion%20de%20la%
20bibliographie
fr:LaTeX/Gestion de la bibliographie46
5.6. References
\end{btSect}
\end{document}
Formating
Part II.
6. List Structures
\begin{list_type}
description
and
enumerate
itemize
6.1.1. Itemize
All three of these types of lists can have multiple paragraphs per item: just
type the additional paragraphs in the normal way, with a blank line between
each. So long as they are still contained within the enclosing environment,
they will automatically be indented to follow underneath their item.
\end{list_type}
Figure 8
The enumerate environment is for ordered lists, where by default, each item is
numbered sequentially.
6.1.2. Enumerate
\begin{itemize}
\item The first item
\item The second item
\item The third etc \ldots
\end{itemize}
Figure 9
The description environment is slightly different. You can specify the item
label by passing it as an optional argument (although optional, it would look
odd if you didn't include it!). Ideal for a series of definitions, such as a glossary.
6.1.3. Description
\begin{enumerate}
\item The first item
\item The second item
\item The third etc \ldots
\end{enumerate}
\hfill
\\
Sometimes you want a description where the text begins on a new line. This
cannot easily be done with
Figure 10
\begin{description}
\item[First] The first item
\item[Second] The second item
\item[Third] The third etc \ldots
\end{description}
Figure 11
As you may have noticed, in standard LaTeX document classes, the vertical
spacing between items, and above and below the lists as a whole, is more
\begin{description}
\item[First] \hfill \\
The first item
\item[Second] \hfill \\
The second item
\item[Third] \hfill \\
The third etc \ldots
\end{description}
. They work exactly in the same way, but the output is more compact. Other
packages providing compacted lists are paralist and enumitem.
description*
and
enumerate*
itemize*
than between paragraphs: it may look odd if the descriptions are too short.
If you want tightly-packed lists, use the mdwlist package (included in the
mdwtools bundle), which provides compact, "starred" versions of the previous environments, i.e.
Latex will happily allow you to insert a list environment into an existing
one (up to a depth of four -- if you need more than four, use the easylist
package). Simply begin the appropriate environment at the desired point within
the current list. Latex will sort out the layout and any numbering for you.
\begin{enumerate}
\item The first item
\begin{enumerate}
\item Nested item 1
\item Nested item 2
\end{enumerate}
\item The second item
\item The third etc \ldots
\end{enumerate}
Figure 12
Inside lists you can redefine some length/dimension variables of LaTeX, for
example using:
However, since the tutorial is on formatting, I shall still include a brief guide
on customizing lists. Feel free to skip!
The thing people want to change most often with Enumerated lists are the
counters. A quick solution to this problem is provided by the enumerate
\newenvironment{my_enumerate}
{\begin{enumerate}
\setlength{\itemsep}{1pt}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}}
{\end{enumerate}}
Alternatively, to create a unified look in your document you can define your
own enumerate environment:
http://mirrors.fe.up.pt/pub/CTAN/macros/latex/required/
tools/enumerate.pdfThe enumerate package, David Carlisle 1999
http://mirrors.fe.up.pt/pub/CTAN/macros/latex/contrib/
enumitem/enumitem.pdfThe enumitem package, Javier Bezos 2011
enumii
enumi
There are four individual counters that are associated with itemized lists, each
one represents the four possible levels of nesting, which are called:
\begin{enumerate}
\setcounter{enumi}{4}
\item fifth element
\end{enumerate}
use:
enumi
\item
\setcounter
enumiv
enumiii
Command
\arabic
\alph
\Alph
\roman
\Roman
\fnsymbol
Example
1, 2, 3 ...
a, b, c ...
A, B, C ...
i, ii, iii ...
I, II, III ...
Aimed at footnotes (see below),
but prints a sequence of symbols.
Each counter also has a default format that dictates how it is displayed whenever LaTeX needs to print it. Such formats are specified using internal LaTeX
commands:
5. fifth element
Admittedly, the generic version is not that clear, so a couple of examples will
clarify:
\renewcommand{\representation}{\format_command{counter}}
Now, that's most of the technicalities out of the way. To make changes to the
formatting of a given level:
\theenumi
\the
Each counter entity holds various bits of information about itself. To get to the
numbered element, simply use
Note that you can also add other symbols, such as parentheses and periods,
before and after the counter. For instance, to create a list indexed by lower
This simply redefines the appearance of the label, which is fine, providing that
you do not intend to cross-reference to a specific item within the list, in which
case the reference will be printed in the previous format. This issue does not
arise in the first example.
\renewcommand{\labelenumi}{\Roman{enumi}}
The method used above first explicitly changes the format used by the counter.
However, the element that controls the label needs to be updated to reflect the
change, which is what the second line does. Another way to achieve this result
is this:
\labelitemi
.
The itemize labels are accessed via
\item[$\star$]
, eg
\item[new symbol]
Itemized lists are not as complex as they do not need to count. Therefore, to
customize, you simply change the labels. It can be done manually for each
entry with
\renewcommand{\labelenumi}{(\alph{enumi})}
case letters with parentheses before and after the letter, you might enter the
following:
The above example would set the labels for the first level to a greater than (>)
symbol. Of course, the text symbols available in Latex are not very exciting.
Why not use one of the ZapfDingbat symbols, as described in the Symbols3
section. Or use a mathematical symbol:
\renewcommand{\labelitemi}{\textgreater}
\labelitemiv
\labelitemiii
\labelitemii
\begin{document}
\renewcommand
\begin{itemize}
\setlength{\itemsep}{0cm}%
\setlength{\parskip}{0cm}%
\item Item opening the list
\item Item tightly following
\end{itemize}
Itemized list with tightly set items, that is with no vertical space between two
consecutive items, can be created as follows.
\renewcommand{\labelitemi}{$\star$}
inparaenum
Inline lists are a special case as they require the use of the paralist package
which provides the
instruction so the changes made are taken into account. This is needed for both
enumerated and itemized lists.
Figure 13
\Alph
To change the styles of the counter, tokens A, a, I, i, and 1 can be used in the
optional argument to produce the counter with one of the styles
\begin{document}
...
\usepackage{paralist}
\begin{inparaenum}[(i)]
. For example:
\arabic
and
\roman
\Roman
\alph
\ListProperties(Style2*=,Numbers=a,Numbers1=R,FinalMark=.)
& Main item~:
&& Sub item.
&& Another sub item.
\end{easylist}
\begin{easylist}[enumerate]
\usepackage[ampersand]{easylist}
The easylist package allows you to create list using a more convenient
syntax and with infinite nested levels. It is also very customizable.
Besides using easylist along with figures may cause some trouble to the layout
and the indentation. LaTeX lists do not have this problem.
\Activate
\begin{easylist}
& ...
\end{easylist}
\Deactivate
Important note: easylist has some drawbacks. First if you need to put an
easylist inside an environment using the same control character as the one
specified for easylist, you may get an error. To circumvent it, use the following
commands provided by easylist:
However, if there is one area about LaTeX that is the least intuitive, then this
is it. Basic tables are not too taxing, but you will quickly notice that anything
more advanced can take a fair bit of construction. So, we start slowly and build
up from there.
7. Tables
4
5
6
1
2
3
http://calc2latex.sourceforge.net/
http://www.ctan.org/tex-archive/support/excel2latex/
http://www.mathworks.com/matlabcentral/fileexchange/
4894-matrix2latex
https://code.google.com/p/matrix2latex/
http://rubygems.org/gems/latex-tools
http://cran.r-project.org/web/packages/xtable/index.html
Workaround: You might save lots of time by building tables using specialized
software and exporting them in LaTeX format. The following plugins and
libraries are available for some popular software:
9
10
7
8
http://orgmode.org/
https://www.gnu.org/software/emacs/manual/html_node/org/
A-LaTeX-example.html
http://emacswiki.org/emacs/AlignCommands
http://truben.no/latex/table/
org-mode7 : for Emacs users, org-mode tables can be used inline in LaTeX documents, see https://www.gnu.org/software/emacs/manual/html_node/org/A-LaTeX-example.html8 for a tutorial.
Emacs Align Commands9 : while not a workaround per se, the align commands can clean up a messy LaTeX table.
Online Table generator for LATeX10 : An online tool for creating simple
tables within the browser. LaTeX format is directly generated as you type.
h
t
b
p
here
top
bottom
page
You can set the optional parameter position specifier to define the position of
the table, where it should be placed. The following characters are all possible
placements. Using sequences of it define your "wishlist" to LaTeX.
\begin{table}[position specifier]
\centering
\begin{tabular}{|l|}
... your table ...
\end{tabular}
\caption{This table shows some data}
\label{tab:myfirsttable}
\end{table}
11
Default is tbp, which means that it is by default placed on the top of the page.
If it's not possible, its placed on the bottom and last possibility is to place it
with other floating environments on an extra page. You can force LaTeX to use
one given position. E.g. [!h] forces LaTeX to place it exactly where you place
it (Except when it's really impossible, e.g you place a table here and this place
would be the last line on a page). Centering the table horizontally works using
the \centering-command just after opening the table-environment.
left-justified column
The table spec argument tells LaTeX the alignment to be used in each column
and the vertical lines to insert.
\begin{tabular}[pos]{table spec}
The tabular environment can be used to typeset tables with optional horizontal and vertical lines. LaTeX determines the width of the columns automatically.
centered column
right-justified column
paragraph column with text vertically aligned at the top
paragraph column with text vertically aligned in the middle (requires array package)
paragraph column with text vertically aligned at the bottom (requires array package)
vertical line
double vertical line
By default, if the text in a column is too wide for the page, LaTeX wont
automatically wrap it. Using p{width} you can define a special type of
column which will wrap-around the text as in a normal paragraph. You can
pass the width using any unit supported by LaTeX, such as pt and cm, or
|
||
b{width}
m{width}
c
r
p{width}
bottom
center (default)
top
12
In the first line you have pointed out how many columns you want, their
alignment and the vertical lines to separate them. Once in the environment, you
have to introduce the text you want, separating between cells and introducing
new lines. The commands you have to use are the following:
b
c
t
The optional parameter pos can be used to specify the vertical position of the
table relative to the baseline of the surrounding text. In most cases, you will
not need this option. It becomes relevant only if your table is not in a paragraph
of its own. You can use the following letters:
column separator
start new row (additional space
may be specified after \\ using square brackets, such as
\\[6pt])
horizontal line
start a new line within a cell (in a
paragraph column)
partial horizontal line beginning in
column i and ending in column j
Note, any white space inserted between these commands is purely down to
ones' preferences. I personally add spaces between to make it easier to read.
\cline{i-j}
\hline
\newline
&
\\
\begin{tabular}{ l c r }
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\end{tabular}
1 2 3
4 5 6
7 8 9
This example shows how to create a simple table in LaTeX. It is a three-bythree table, but without any lines.
3
6
9
To add horizontal lines to the very top and bottom edges of the table:
\begin{tabular}{ l | c || r }
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\end{tabular}
1 2
4 5
7 8
3
6
9
And finally, to add lines between all rows, as well as centering (notice the use
of the center environment - of course, the result of this is not obvious from the
preview on this web page):
\begin{tabular}{ l | c || r }
\hline
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\hline
\end{tabular}
1 2
4 5
7 8
\begin{center}
\begin{tabular}{ l | c || r }
\hline
1 & 2 & 3 \\ \hline
4 & 5 & 6 \\ \hline
7 & 8 & 9 \\
\hline
\end{tabular}
\end{center}
1 2
4 5
7 8
3
6
9
Figure 14
The column specification can be altered using the array package. This is
done in the argument of the tabular environment using >{\command} for
commands executed right before each column element and <{\command} for
commands to be executed right after each column element. As an example: to
\begin{tabular}{|r|l|}
\hline
7C0 & hexadecimal \\
3700 & octal \\ \cline{2-2}
11111000000 & binary \\
\hline \hline
1984 & decimal \\
\hline
\end{tabular}
>{\begin{lrbox}{\boxname}}%
l%
<{\end{lrbox}%
The argument of the > and < specifications must be correctly balanced when
it comes to { and } characters. This means that >{\bfseries} is valid,
while >{\textbf} will not work and >{\textbf{} is not valid. If there
is the need to use the text of the table as an argument (for instance, using the
\textbf to produce bold text), one should use the \bgroup and \egroup
commands: >{\textbf\bgroup}c<{\egroup} produces the intended
effect. This works only for some basic LaTeX commands. For other commands,
such as \underline to underline text, it is necessary to temporarily store
the column text in a box using lrbox. First, you must define such a box with
\newsavebox{\boxname} and then you can define:
get a column in math mode enter: \begin{tabular}{>{$}c<{$}}. Another example is changing the font: \begin{tabular}{>{\small}c}
to print the column in a small font.
\begin{tabular}{>{\centering}p{3.5cm}<{\centering}p{3.5cm}}
Geometry & Algebra
\tabularnewline
\hline
Points & Addition
\tabularnewline
This same trick done with \raisebox instead of \underline can force
all lines in a table to have equal height, instead of the natural varying height
that can occur when e.g. math terms or superscripts occur in the text.
This stores the text in a box and afterwards, takes the text out of the box with
\unhbox (this destroys the box, if the box is needed again one should use
\unhcopy instead) and passing it to \underline. (For LaTeX2e, you may
want to use \usebox{\boxname} instead of \unhbox\boxname.)
\underline{\unhbox\boxname}}%
}
Here is a practical example. The following code creates two tables with the
same code; the only difference is that the last column of the second one has
LaTeX's algorithms for formatting tables have a few shortcomings. One is that
it will not automatically wrap text in cells, even if it overruns the width of the
page. For columns that you know will contain a certain amount of text, then
it is recommended that you use the p attribute and specify the desired width
of the column (although it may take some trial-and-error to get the result you
want). Use the m attribute to have the lines aligned toward the middle of the
box and the b attribute to align along the bottom of the box.
\begin{center}
\begin{tabular}{ | l | l | l | l |}
\hline
Day & Min Temp & Max Temp & Summary \\ \hline
Monday & 11C & 22C & A clear day with lots of sunshine.
However, the strong breeze will bring down the temperatures. \\
\hline
Tuesday & 9C & 19C & Cloudy with rain, across many northern
regions. Clear spells
across most of Scotland and Northern Ireland,
but rain reaching the far northwest. \\ \hline
Wednesday & 10C & 21C & Rain will still linger for the morning.
Conditions will improve by early afternoon and continue
\begin{document}
\usepackage[english]{babel}
\documentclass{article}
a defined width of 5 centimeters, while in the first one we didn't specify any
width. Compiling this code:
\begin{center}
\begin{tabular}{ | l | l | l | p{5cm} |}
\hline
Day & Min Temp & Max Temp & Summary \\ \hline
Monday & 11C & 22C & A clear day with lots of sunshine.
However, the strong breeze will bring down the temperatures. \\
\hline
Tuesday & 9C & 19C & Cloudy with rain, across many northern
regions. Clear spells
across most of Scotland and Northern Ireland,
but rain reaching the far northwest. \\ \hline
Wednesday & 10C & 21C & Rain will still linger for the morning.
Conditions will improve by early afternoon and continue
throughout the evening. \\
\hline
\end{tabular}
\end{center}
Figure 15
\end{document}
\newsavebox{\tstretchbox}
Note that the first table is cropped: The output is wider than the page width.
13
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Enumerate
\begin{tabular}{| c | c |}
\hline
\begin{verbatim}
code
\end{verbatim}
& description
If you use some LaTeX environments inside table cells, like verbatim or
enumerate13
\newcolumntype{S}[1]{%
>{\begin{lrbox}{\tstretchbox}}%
l%
<{\end{lrbox}%
\eqmakebox[#1][s]{\unhcopy\tstretchbox}}%
}
14
\begin{tabular}{| m{5cm} | c |}
\\ \hline
\end{tabular}
\begin{tabular}{l*{6}{c}r}
Team
& P & W &
\hline
Manchester United & 6 & 4 &
Celtic
& 6 & 3 &
Benfica
& 6 & 2 &
FC Copenhagen
& 6 & 2 &
\end{tabular}
0
0
1
1
&
&
&
&
2
3
3
2
\\
\\
\\
\\
D & L & F
Here is a table with six centered columns flanked by a single column on each
side:
It typically takes some text as its argument, and when appended to a column,
it will automatically insert that text into each cell in that column before the
actual data for that cell. This command kills the inter-column space and
7.2.7. @-expressions
Figure 16
123.456
Note
that
the
headers
should
\multicolumn{2}{l}{HEADER}.
\begin{tabular}{r@{.}l}
3
& 14159 \\
16 & 2
\\
123 & 456
\\
\end{tabular}
16.2
3.14159
be
enclosed
in
Admittedly, this is not that clear, and so will require a few examples to clarify.
Sometimes, it is desirable in scientific tables to have the numbers aligned on
the decimal point. This can be achieved by doing the following:
replaces it with whatever is between the curly braces. To add space, use
@{\hspace{width}}.
\begin{tabular}{|l|l|}
\hline
stuff & stuff \\ \hline
stuff & stuff \\
\hline
\end{tabular}
{|@{}l|l@{}|}
{|l|l|}
Figure 18
Figure 17
{|@{}l@{}|l@{}|}
Figure 19
Figure 20
To complete this tutorial, we take a quick look at how to generate slightly more
complex tables. Unsurprisingly, the commands necessary have to be embedded
within the table data itself.
7.3. Spanning
{|@{}l@{}|@{}l@{}|}
The command for this looks like this: \multicolumn{num_cols}{alignment}{contents}. num_cols is the number of subsequent columns to merge; alignment is either l, c, r, or to have text wrapping
specifiy a width p{5.0cm} . And contents is simply the actual data you want
to be contained within that cell. A simple example:
\begin{tabular}{|l|l|}
\hline
\multicolumn{2}{|c|}{Team sheet} \\
\hline
GK & Paul Robinson \\
LB & Lucus Radebe \\
DC & Michael Duberry \\
DC & Dominic Matteo \\
RB & Didier Domi \\
MC & David Batty \\
MC & Eirik Bakke \\
MC & Jody Morris \\
FW & Jamie McMaster \\
ST & Alan Smith \\
Figure
ST & Mark Viduka \\
\hline
\end{tabular}
21
GK
LB
DC
DC
RB
MC
MC
MC
FW
ST
ST
Team sheet
Paul Robinson
Lucus Radebe
Michael Duberry
Dominic Matteo
Dider Domi
David Batty
Eirik Bakke
Jody Morris
Jamie McMaster
Alan Smith
Mark Viduka
15
Package multirow
on CTAN {http://www.ctan.org/tex-archive/
macros/latex/contrib/multirow/}
\begin{tabular}{|l|l|l|}
\hline
\multicolumn{3}{|c|}{Team sheet} \\
\hline
Goalkeeper & GK & Paul Robinson \\ \hline
\multirow{4}{*}{Defenders} & LB & Lucus Radebe \\
& DC & Michael Duberry \\
& DC & Dominic Matteo \\
& RB & Didier Domi \\ \hline
Figure 22
\multirow{3}{*}{Midfielders} & MC & David Batty \\
& MC & Eirik Bakke \\
& MC & Jody Morris \\ \hline
Forward & FW & Jamie McMaster \\ \hline
\multirow{2}{*}{Strikers} & ST & Alan Smith \\
& ST & Mark Viduka \\
\hline
\end{tabular}
...
\usepackage{multirow}
...
Here is a nontrivial example of how to use spanning in both directions simultaneously and have the borders of the cells drawn correctly:
If there is no data for a cell, just don't type anything, but you still need the "&"
separating it from the next column's data. The astute reader will already have
deduced that for a table of n columns, there must always be n1 ampersands in
each row. The exception to this is when \multicolumn and \multirow
are used to create cells which span multiple columns or rows.
The main thing to note when using \multirow is that a blank entry must be
inserted for each appropriate cell in each subsequent row to be spanned.
\begin{tabular}{cc|c|c|c|c|l}
\cline{3-6}
& & \multicolumn{4}{|c|}{Primes} \\ \cline{3-6}
& & 2 & 3 & 5 & 7 \\ \cline{1-6}
\multicolumn{1}{|c|}{\multirow{2}{*Figure
}{Powers}}
23 &
\multicolumn{1}{|c|}{504} & 3 & 2 & 0 & 1 &
\multicolumn{1}{|c|}{}
&
\multicolumn{1}{|c|}{540} & 2 & 3 & 1 & 0 &
\multicolumn{1}{|c|}{\multirow{2}{*}{Powers}} &
\multicolumn{1}{|c|}{gcd} & 2 & 2 & 0 & 0 & min
\multicolumn{1}{|c|}{}
&
\multicolumn{1}{|c|}{lcm} & 3 & 3 & 1 & 1 & max
\end{tabular}
\usepackage{multirow}
\\ \cline{1-6}
\\ \cline{2-6}
\\ \cline{1-6}
\\ \cline{2-6}
The command
27
28
29
30
31
32
33
34
35
36
21
22
23
24
25
26
19
20
18
http://www.ctan.org/tex-archive/macros/latex/contrib/
ctable/
Chapter 13.2.9 on page 433
http://www.ctan.org/tex-archive/macros/latex/contrib/
caption/
http://tug.ctan.org/pkg/hhline
http://tug.ctan.org/pkg/array
http://tug.ctan.org/pkg/colortbl
http://tug.ctan.org/pkg/supertabular
http://tug.ctan.org/pkg/longtable
http://ctan.org/tex-archive/macros/latex/contrib/
threeparttable
http://tug.ctan.org/pkg/xtab
http://tug.ctan.org/pkg/tabulary
http://tug.ctan.org/pkg/arydshln
http://tug.ctan.org/pkg/ctable
http://tug.ctan.org/pkg/slashbox
http://tug.ctan.org/pkg/dcolumn
http://tug.ctan.org/pkg/rccol
http://tug.ctan.org/pkg/numprint
http://www.ctan.org/pkg/spreadtab
http://ctan.org/tex-archive/macros/latex/contrib/siunitx
38
39
40
37
http://www.ctan.org/tex-archive/graphics/pgf/contrib/
pgfplots
http://fr.wikibooks.org/wiki/LaTeX%2FFaire_des_tableaux
http://nl.wikibooks.org/wiki/LaTeX%2FTabellen
http://pl.wikibooks.org/wiki/LaTeX%2FTabele
\scalebox{0.7}{
\begin{tabular}...
\end{tabular}
}
\resizebox{8cm}{!} {
\begin{tabular}...
\end{tabular}
}
\resizebox{width}{height}{object} can be used with tabular to specify the height and width of a table. The following example shows how to
resize a table to 8cm width while maintaining the original width/height
ratio.
Many document classes will form a title page for you. One must specify what
to fill it with using these commands placed in the top matter1 :
There are several situations where you might want to create a title in a custom
format, rather than in the format natively supported by LaTeX. For shorter documents such as basic articles, the output of \maketitle is often adequate,
but longer documents (such as books and reports) often require more involved
formatting. While it is possible to change the output of \maketitle, it can
be complicated even with minor changes to the title. In such cases it is often
better to create the title from scratch, and this section will show you how to
accomplish this.
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Abstracts
This should go after the preceding commands. For most document styles, this
will form a separate page, while the article document style will place the
title on the top of the first page. Note that the abstract2 environment should
precede the \maketitle command in AMS documents.
\maketitle
Commonly the date is excluded from the title page by using \date{}. It
defaults to \today if not in the source file.
It is dependent on the document class which commands are used in the title
page generated by \maketitle. For example, the amsart uses commands
such as \address, \dedicatory, \email and more in the title page
while other classes may only use \title.
Footnotes within the title page can be specified with the \thanks command.
For example, one may add
\input{./title.tex}
\end{document}
\begin{document}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\usepackage[pdftex]{graphicx}
\documentclass[pdftex,12pt,a4paper]{report}
First step: since you'll be working only on the first page of your document
and you'll have to compile very often, you don't have to compile the whole
document each time, you only need to take a look at the first page. That is
why we'll first create a dummy document for preparing the title and then we'll
simply include it within the existing big document we are writing. Call the
dummy document test_title.tex and put the following code in it:
layout you like, you can use it for any other documents where you would like
the same layout without any additional fiddling with layout.
\end{titlepage}
\begin{titlepage}
Images
Alignment
all the things you want to put in the title must be inside the titlepage
environment. Now if you compile test_title.tex you will see a preview
of your title in the test_title.pdf file. Here is what you need to know
to write your title:
you can force the start of a new line by \\. If you want to add more vertical
space you don't need to use several new-line commands, just insert some
New lines
\normalsize is used to create text at the default size for the document.
{\large this text is slightly bigger than normal}, this one is not
If you want to change the size of some text just place it within
brackets, {like this}, and you can use the following commands (in order of size): \Huge, \huge, \LARGE, \Large, \large, \small,
\footnotesize, \tiny. So for example:
Text size
to be floating3 , you just want it there where you placed it. When handling it,
remember that it is considered like a big box by the TeX engine.
All these tips might have made you confused. Then, here is a practical example.
Get the test_title.tex described above and here is an example of a
the command \vfill keeps on adding empty spaces until the page is full.
If you put it in the page, you are sure that all the following text will be placed
at the bottom of the page.
you can insert the date of the current day with the command \today. If you
do not wish to insert any date, keep it blank e.g.\date{}
Date
vertical space. For example, this way \\[1cm] you start a new line after
having left 1 cm of empty space.
title.tex. On the right you can see the output after you compile test_title.tex in PDF:
\HRule \\[1.5cm]
% Title
Figure 35
\HRule \\[0.4cm]
{ \huge \bfseries Lager brewing techniques}\\[0.4cm]
\begin{center}
\begin{titlepage}
As you can see, the code looks "dirtier" than standard LaTeX source because
you have to take care of the output as well. If you start changing font's
output it will get more confused, but you can do it: it's only for the title and
your complicated code will be isolated from all the rest within its own file
title.tex.
The picture is from a file called logo.png that is in the same directory of
both title.tex and test_title.tex. Since I wanted to insert both the
author and supervisor names properly aligned I used a trick: I created two
small minipages, one on left and one on the right. Their width is a bit less than
half of page width (as you can see, they are exactly 40% of the text width).
Within the minipages I have used different alignments. Using \vfill I could
write the date exactly at the bottom of the page.
\input{./title.tex}
\begin{document}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
...
\usepackage[pdftex]{graphicx}
For example, the top section of your document would look like:
The titlepages package presents many styles of designs for title pages.
Italian users may also want to use the frontespizio package.
\tableofcontents
...
Latex and the document class will normally take care of page layout issues for
you. For submission to an academic publication, this entire topic will be out
of your hands, as the publishers want to control the presentation. However,
for your own documents, there are some obvious settings that you may wish
to change: margins, page orientation and columns, to name but three. The
purpose of this tutorial is to show you how to configure your pages.
9. Page Layout
A page in Latex is defined by myriad internal parameters. Each parameter corresponds to the length of an element of the page, for example, \paperheight
is the physical height of the page. Here you can see a diagram showing all the
variables defining the page. All sizes are given in Postscript Points (pt), there
are 72pt in an inch or 1pt = 0.3527mm.
1.
2.
3.
4.
10
11
Figure 36
Margin notes
4
5
Footer
Body
Header
It will not have been immediately obvious - because it doesn't really cause any
serious problems - that the default page size for all standard document classes
is US letter. This is shorter by 18 mm (about 3/4 inch), and slightly wider by 8
mm (about 1/4 inch), compared to A4 (which is the standard in almost all the
\headheight = 12pt
\headsep = 25pt
\textheight = 592pt
\textwidth = 390pt
1. \marginparsep = 10pt
2. \marginparwidth = 35pt
3. \footskip = 30pt
5.
6.
7.
8.
Readers from a word processing background are probably thinking why there
is so much white space surrounding the text. There is a good reason, and it's
all down to readability. Have a look in a few books, and pick a few lines at
random. Count the number of characters per line. I bet the average is about 66.
Studies have shown that it's easier to read text when there are 60-70 characters
per line - and it would seem that 66 is the optimal number. Therefore, the
page margins are set to ensure that readability remains as good as possible.
The above example illustrates how to pass the optional argument to the
\documentclass, which will then modify the page dimensions accordingly. The standard document classes that are a part of Latex are built to be
fairly generic, which is why you have the flexibility of specifying the page size.
Other classes may have different options (or none at all). Normally, 3rd party
classes come with some documentation to let you know.
\documentclass[a4paper]{article}
rest of the world). While this is not a serious issue (most printers will print the
document without any problems), it is possible to specify alternative sizes:
If you wish to change the margins of your document, there are many ways to
do so:
However, those who want to read on iPads or other handheld digital devices
need to create documents without the extra whitespace. In order to create
PDF documents with optimal handheld viewing, not only must the text field
and margins be adjusted, so must the page size. To do this, use the setlength
command to adjust the parameters "pdfpagewidth" and "pdfpagelength" to the
appropriate dimensions. If you are looking for a sensible dimension, consider
following the paper size used by the Supreme Court of the United States, 441pt.
by 666pt (or 6.125 inches by 9.25 inches), which looks great on the iPad. You
could also use the Supreme Court's text field size of 297 pt by 513 pt, but this
is too wide for font's other than Century Schoolbook, the font required by the
Supreme Court.
Also, white space is often left in the inner margin for the assumption that the
document will be bound.
Use the geometry package. This package allows you to specify the 4
margins without needing to remember the particular page dimensions commands. You can enter the measures in centimeters and inches as well. Use
cm for centimeters and in for inches after each value (e.g: 1.0in or 2.54cm).
Note that by default (i.e. without any options) this package already reduces
the margins, so for a 'standard layout' you may not need to specify anything.
These values are relative to the edge of paper (0in) and go inward it. It may
be implemented as follows:
Use the a4wide package for a page with A4 document size with smaller
margins.
\usepackage[cm]{fullpage}
\usepackage{fullpage}
The geometry package has many pre-defined page sizes, like a4paper,
built in.
Others include: a0paper, a1paper, ..., a6paper,
\usepackage[a4paper]{geometry}
\oddsidemargin=-1cm
\setlength{\textwidth}{6.5in}
\addtolength{\voffset}{-5pt}
\setlength{\oddsidemargin}{15.5pt}
\setlength{\evensidemargin}{15.5pt}
A quick way to eliminate the difference in position between even and odd
numbered pages would be setting the values to evensidemargin and oddsidemargin to the half of odd's default:
\usepackage[margin=1in, paperwidth=5.5in,
paperheight=8.5in]{geometry}
To explicitly change the paper dimensions using the geometry package, the
paperwidth and paperheight options can be used. For example:
http://www.ctex.org/documents/packages/layout/titlesec.pdf
If you intend to get a pdf in the end, there are basically three ways:
\usepackage{titlesec}
\titlespacing*{\chapter}{0pt}{-50pt}{20pt}
\titlefo
rmat{\chapter}[display]{\normalfont\huge\bfseries}{\chaptertitlename\
\thechapter}{20pt}{\Huge}
The top margin above a chapter can be changed using the titlesec package.
Example: http://www.ctex.org/documents/packages/layout/titlesec.pdf1
#
#
#
#
#
to the tex file, -t a4 after dvips and -sPAPERSIZE=a4 after the ps2pdf.
For pdflatex to work fine, using the package geometry usually works.
\documentclass[...,a4paper,...]{...}
\special{papersize=210mm,297mm}
With all the available Ghostscript versions, the safest way to always get the
right paper size in the end is to add
pdflatex myfile
latex myfile
dvipdf myfile
dvips myfile -o myfile.ps
ps2pdf myfile.ps myfile.pdf
\usepackage[landscape]{geometry}
The first is for when you want all of your document to be in landscape from the
very beginning. There are various packages available to achieve this, but the
one I prefer is the geometry package. All you need to do is call the package,
with landscape as an option:
When you talk about changing page orientation, it usually means changing
to landscape mode, since portrait is the default. I shall introduce two slightly
different styles of changing orientation.
The lscape package is for this very purpose. It supplies a landscape environment, and anything inside is basically rotated. No actual page dimensions
are changed. This approach is more applicable to books or reports than to
typical academic publications. Using pdflscape instead of lscape when
The second method is for when you are writing a document in portrait, but
you have some contents, like a large diagram or table that would be displayed
better on a landscape page. However, you still want the consistency of your
headers and footers appearing the same place as the other pages.
\usepackage[a4paper,landscape]{geometry}
Although, if you intend to use geometry to set your paper size, don't add
the \usepackage commands twice, simply string all the options together,
separating with a comma:
\begin{landscape}
\begin{table}
\centering
% optional, probably makes it look better to have it
centered on the page
\begin{tabular}{....}
.......
\end{tabular}
\end{table}
\end{landscape}
Also, to get a table to appear correctly on a landscaped page, one must place
the tabular environment inside a table environment, which is itself inside
the landscape environment. e.g., it should look like this:
generating a PDF document will make the page appear right side up when
viewed: the single page that is in landscape format will be rotated, while the
rest will be left in portrait orientation.
\begin{table}[p]
\centering
\rotatebox{90}{
\begin{minipage}{\textheight}
\begin{tabular}{|l|l|l|}
...
\end{tabular}
\end{minipage}
}
\end{table}
If you use the above code, you will see that the table is inserted where it is in
the code. It will not be floated! To fix this you need the package rotating
empty
The possibilities of changing the headers in plain Latex are actually quite
limited. There are two commands available: \pagestyle{style} will
apply the specified style to the current and all subsequent pages, and
\thispagestyle{style} will only affect the current page. The possible styles are:
Page styles in Latex terms refers not to page dimensions, but to the running
headers and footers of a document. These headers typically contain document
titles, chapter or section numbers/names, and page numbers.
myheadings
headings
plain
An issue to look out for is that the major sectioning commands (\part,
\chapter or \maketitle) specify a \thispagestyle{plain}. So,
if you wish to suppress all styles by inserting a \pagestyle{empty} at the
beginning of your document, then the style command at each section will override your initial rule, for those pages only. To achieve the intended result one
can follow the new section commands with \thispagestyle{empty}.
The \part command, however, cannot be fixed this way, because it sets
the page style, but also advances to the next page, so that \thispagestyle{}
cannot be applied to that page. Another approach is to simply write
\usepackage{nopageno} in the preamble. This package will make
\pagestyle{plain} have the same effect as \pagestyle{empty},
effectively suppressing page numbering when it is used.
\pagestyle{myheadings}
\markright{John Smith\hfill On page styles\hfill}
http://www.ctan.org/tex-archive/macros/latex/contrib/
fancyhdr/fancyhdr.pdf
\leftmark
and
\rightmark
The tricky problem when customizing headers and footers is to get things like
running section and chapter names in there. Standard LaTeX accomplishes
this with a two-stage approach (although an alternative one-stage mechanism
is provided by the package titleps). In the header and footer definition,
you use the commands
To get better control over the headers, one can use the package fancyhdr
written by Piet van Oostrum. It provides several commands that allow you to
customize the header and footer lines of your document. For a more complete
guide, the author of the package produced this documentation2 .
\subsectionmark
, or
\sectionmark
\chaptermark
\leftmark
and
\rightmark
\chapter
to represent the current section and chapter heading, respectively. The values of
these two commands are overwritten whenever a chapter or section command
is processed. For ultimate flexibility, the
\usepackage{fancyhdr}
\setlength{\headheight}{15.2pt}
\pagestyle{fancy}
command.
\chaptermark
If you want to change the look of the chapter name in the header line, you need
only "renew" the
, etc., must be used after the sectioning command if header and footer lines are
to be updated.
\chaptermark
\leftmark
and
\rightmark
\lfoot[<lf-even>]{<lf-odd>}
\cfoot[<cf-even>]{<cf-odd>}
\rfoot[<rf-even>]{<rf-o
\lhead[<lh-even>]{<lh-odd>}
\chead[<ch-even>]{<ch-odd>}
\rhead[<rh-even>]{<rh-o
The second line will prevent LaTeX from giving a warning. Both the header
and footer comprise three elements each according to its horizontal position
(left, centre or right). To set their values, the following commands are available:
\chaptername
\rightmark
\leftmark
\thepage
Watch out: if you provide long text in two different "parts" only in the footer
or only in the header, you might see overlapping text. There are special
commands you can use as arguments:
convert the names to uppercase, whichever was the formatting of the text. If
you want them to print the actual name of the chapter without converting it to
uppercase use the following command:
\rightmark
and
\leftmark
Note that
\thesection
\thechapter
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\chaptername\
\thechapter.\ #1}}{}}
is:
\chaptermark
\pagestyle{fancy}
will just print the name of the chapter and section, without number and without
affecting the formatting. Note that these redefinitions must be inserted after
the first call of
\rightmark
and
\leftmark
now
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}{}}
It is often necessary to clear any defaults or a previous style definition, and the
first line of the above example will do this. The commands are an alternative
\lhead{Andrew Roberts}
\rhead{\today}
\rfoot{\thepage}
\fancyhf{}
An example:
The first line for the header, the second for the footer. Setting it to zero means
that there will be no line.
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
Moreover, with the following commands you can define the thickness of the
decorative lines on both the header and the footer:
etc.
\lhead{...}
inside
\fancyplain{...}{...}
This approach has a serious bad point: some pages like the title or the beginning
of each chapter have no header or footer, but with the code we have shown
every page will get the same output. There is a way to solve this problem: you
can use the fancyplain style. If you do so, you can use the command
The result of these commands will put my name at the top left, todays date
at the top right, and the current page number at the bottom right of the page.
Even if the document class was two-sided, because no optional text has been
supplied for the even pages, the style will be used for all pages.
\lhead[Andrew Roberts]{}
For two-sided, it's common to mirror the style of opposite pages, you tend to
think in terms of inner and outer. So, the same example as above for two-sided
is:
It has the same behavior of the previous code, but you will get empty header
and footer in the title and at the beginning of chapters.
\lhead{\fancyplain{}{Andrew Roberts}}
\rhead{\fancyplain{}{\today}}
\rfoot{\fancyplain{}{\thepage}}
\fancyhf{}
\pagestyle{fancyplain}
When LaTeX wants to create a page with an empty style, it will insert the
first argument of fancyplain, in all the other cases it will use the second
argument. So, an improved version of the previous code would be:
\lhead{\fancyplain{}{\thepage}}
\chead{}
\rhead{\fancyplain{}{\textit{\leftmark}}}
\pagestyle{fancyplain}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\usepackage{fancyhdr}
\setlength{\headheight}{15pt}
This is effectively saying my name is top outer, todays date is top inner, and
current page number is bottom outer. You can use the fancyplain command
within them for two-sided documents, too.
\rhead[]{Andrew Roberts}
\lhead[]{\today}
\rhead[\today]{}
\lfoot[\thepage]{}
\rfoot[]{\thepage}
class
two-sided,
use
\fancyhf{}
If you want to get different style for even and odd pages, there is another
possible way, still using fancyhdr. Start again with:
\lfoot{}
\cfoot{}
\rfoot{}
even page
odd page
left side
centered
right side
\fancyhead[CE]{Author's Name}
\fancyhead[CO]{\today}
\fancyfoot[LE,RO]{\thepage}
so CE will refer to the center of the even pages and RO to the right side
of the odd pages. Whether it is header or footer, depends if you are using
\fancyhead or \fancyfoot. You can use multiple selectors separated by
a comma. Here is an example:
E
O
L
C
R
\usepackage{fancyhdr}
\setlength{\headheight}{15pt}
Finally, here is the complete code of a possible style you could use for a
two-sided document:
\fancypagestyle{plain}{ %
\fancyhf{} % remove everything
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0pt}}
it will print author's name on the center of the header of the even pages, the
date of the current day on the center of the odd pages and the current page
number on the left side of even pages and on the right size of the odd pages.
Finally, in order to have the pages at the beginning of any chapter really plain,
you could redefine the plain style, for example to have a really plain page when
you want. The command to use is \fancypagestyle{plain}{...}
and the argument can contain all the commands explained before. An example
is the following:
Some people like to put the current page number in context with the whole
document. LaTeX only provides access to the current page number. However,
you can use the lastpage package to find the total number of pages, like
this:
9.3.4. Page n of m
\fancypagestyle{plain}{ %
\fancyhf{} % remove everything
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0pt}}
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[RE]{\textit{\nouppercase{\leftmark}}}
\fancyhead[LO]{\textit{\nouppercase{\rightmark}}}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}{}}
Other packages for page styles are scrpage2, very similiar to fancyhdr,
and titleps, which takes a one-stage approach, without having to use
\leftmark or \rightmark.
Note the capital letters. Also, add a backslash after \thepage to ensure
adequate space between the page number and 'of'. And recall, when using
references, that you have to run LaTeX an extra time to resolve the crossreferences.
\usepackage{lastpage}
...
\cfoot{\thepage\ of \pageref{LastPage}}
While this simple addition will do the job 9 out of 10 times, it is widely
acknowledged that there are many limitations of this approach, and that the
multicol package is much more useful for handling multiple columns. It
has several advantages:
Floats are not fully supported by this environment. It can only cope if you use
the starred forms of the float commands (e.g., \begin{figure*} ) which
makes the float span all columns. This is not hugely problematic, since floats
of the same width as a column may be too small, and you would probably want
to span them anyway. See this section3 for a more detailed discussion.
\setlength{\columnsep}{20pt}
This will draw a thin line of 1pt in width. A thick line would not look very
pleasing, however, you are free to put in any length of your choosing. Also,
to change the horizontal space in between columns (the default is set at 10pt,
which is quite narrow) then you need to change the \columnsep parameter:
\setlength{\columnseprule}{1pt}
\begin{multicols}{2}
lots of text
\end{multicols}
\\
\newline
\newpage
\linebreak[number]
\\*
\clearpage
\nopagebreak[number]
\pagebreak[number]
http://en.wikipedia.org/wiki/Widows%20and%20orphans
\widowpenalty=300
\clubpenalty=300
LaTeX has a parameter for 'penalty' for widows and orphans ('club lines'
in LaTeX terminology). With the greater penalty LaTeX will try more to
avoid widows and orphans. You can try to increase these penalties by putting
following commands in your document preamble:
w:Widows and orphans4 In professional books, it's not desirable to have single
lines at the beginning or end of a page. In typesetting such situations are
called 'widows' and 'orphans'. Normally it is possible that widows and orphans
appear in LaTeX documents. You can try to deal with them using manual page
formatting, but there's also an automatic solution.
\needspace{5\baselineskip}
Some
text
on
5
lines.
Alternatively, you can use the needspace package to reserve some lines and
thus to prevent page breaking for those lines.
It also helps to have rubber band values for the space between paragraphs:
If this does not help, you can try increasing these values even more, to a
maximum of 10000. However, it is not recommended to set this value too high,
as setting it to 10000 forbids LaTeX from doing this altogether, which might
result in strange behavior.
This tutorial is relatively short, largely due to the fact that the whole LaTeX
ethos is to concentrate on the content, and let LaTeX (and/or other typographers
who have developed suitable document classes) decide on the best presentation.
The next step to achieve greater control of page layout is to set about designing
your own class. Unfortunately, that is not a straightforward task, and is often
best left to the professionals!
9.7. Summary
Paragraphs in LaTeX are usually fully justified (i.e., flush with both the left and
right margins). For whatever reason, should you wish to alter the justification
Altering the paragraph formatting is not often required, especially in academic writing. However, it is useful to know, and applications tend to be for
formatting text in floats, or other more exotic documents.
Environment
flushleft
flushright
center
Command
\raggedright
\raggedleft
\centering
(paragraph) columns in
\end
and
\begin
Alignment
Left justified
Right justified
Center
of a paragraph, there are three environments at hand, and also LaTeX command
equivalents.
{
\raggedleft
Some text flushed right.
}
B Warning
tabular
Be careful, however, if you decide to set the indent to zero, then it means you
will need a vertical space between paragraphs in order to make them clear. The
space between paragraphs is held in
\setlength{\parindent}{1cm}
command.
\setlength
. The default length that this constant holds is set by the document class that
you use. It is possible to override using the
\parindent
By default, the first paragraph after a heading follows the standard AngloAmerican publishers' practice of no indentation. The size of subsequent
paragraph indents are determined by a parameter called
\hangafter
. (While the default behaviour is to apply the hanging indent after the first line,
this may be changed with the
\hangindent
\usepackage{parskip}
\parskip
\parfillskip
.
To change the indentation of the last line in a paragraph, use the TeX command
\hangindent
and
\parindent
add additional space to the left and right sides of each line, allowing the
formatting for subsequent paragraphs to differ from the overall document
margins. This space is in addition to the indentation added by
\rightskip
and
\leftskip
\indent
If you want to indent a paragraph that is not indented, you can use
\setlength
\parskip
.
White-space in LaTeX can also be made flexible (what Lamport calls "rubber"
lengths). This means that values such as extra vertical space inserted before a
paragraph
\linespread
as the first command of the paragraph. This might come in handy when you
start a document with body text and not with a sectioning command.
\noindent
at the beginning of the paragraph. Obviously, this will only have an effect
when \parindent is not set to zero. If you want to indent the beginning of
every section, you can use the indentfirst package, see the chapter about
LaTeX/Packages1 for more information.
singlespace
onehalfspace
\setstretch{baselinestretch}
\usepackage{setspace}
1. Add
covered in LaTeX/Text_Formatting#Spacing2 .
will specify the line spacing for all sections and paragraphs until another
command is used.
\onehalfspacing
, or
\doublespacing
\singlespacing
in the preamble to change line spacing for the whole document or use
the environment
environment, everything input between the begin and end commands are
processed as if by a typewriter. All spaces and new lines are reproduced as
given, and the text is displayed in an appropriate fixed-width font. Any LaTeX
command will be ignored and handled as plain text. This is ideal for typesetting
program source code. Here is an example:
verbatim
There are several ways to introduce text that won't be interpreted by the
compiler. If you use the
See the section on customizing lists3 below for information on how to change
the line spacing in lists.
Figure 37
. Any others will be output. The font size in the verbatim environment can be
adjusted by placing a font size command4 before
\end{verbatim}
verbatim
\begin{verbatim}
The verbatim environment
simply reproduces every
character you input,
including all s p a c e s!
\end{verbatim}
alltt
\usepackage{alltt}
Remember to add
\begin{alltt}
Verbatim extended with the ability
to use normal commands. Therefore, it
Figure
is possible to \emph{emphasize} words in
this environment, for example.
\end{alltt}
38
. If this is an issue, then you can use the alltt package instead, providing an
environment with the same name:
\begin{verbatim}
alltt
inside the
\textbf{}
.
When using
\)
and
\(
alltt
\normalfont
is the delimiter: here we have used "+", but you can use any character you like
but * and space;
\verb
\verb+my text+
command:
\verb
.
If you just want to introduce a short verbatim phrase, you don't need to use the
whole environment, but you have the
\usepackage{alltt}
after
\renewcommand{\ttdefault}{txtt}
enviroment, note that the standard font has no bold TT font. Txtfonts has bold
fonts: just add
Verbatim
environment (note the capital letter) which lets you draw a rule round the
verbatim text, change the font size, and even have typographic effects inside
the
Verbatim
\textbf
\verb|\textbf{Hi mate!}|
will print verbatim all the text after it until it finds the next delimiter. For
example, the code:
\verb
\url
\verb
Go to \url{http://www.uni.edu/~myname/best-website-ever.html} for my
website.
\url
Typesetting URLs
\hypersetup{}
pdfborder = {0 0 0}
(alternately
pdfborder = {0 0 0 0}
When using this command through the hyperref package, the URL is
"clickable" in the PDF document, whereas it is not linked to the web when
using only the url package. Also when using the hyperref package, to
remove the border placed around a URL, insert
\url
. The mandatory first line argument is for specifying which line the numbering
shall commence. The optional step is the step between numbered lines (the
default is 1, which means every line will be numbered).
\begin{listing}[step]{first line}
Listing Environment
\urlstyle{same}
You can put the following code into your preamble to change the style, how
URLs are displayed to the normal font:
\usepackage{verbatim}
As we have seen, the only way LaTeX allows you to add comments is by using
the special character %, that will comment out all the rest of the line after itself.
This approach is really time-consuming if you want to insert long comments
or just comment out a part of your document that you want to improve later,
unless you're using an editor6 that automates this process. Alternatively, you
can use the verbatim package, to be loaded in the preamble as usual:
\usepackage{moreverb}
Note that this wont work inside complex environments, like math for example.
You may be wondering, why should I load a package called verbatim to have
This is another
\begin{comment}
rather stupid,
but helpful
\end{comment}
example for embedding
comments in your document.
(you can also use the comment package instead) you can use an environment
called comment that will comment out everything within itself. Here is an
example:
\comment{ This is a long comment and can extend over multiple lines,
etc. }
\newcommand{\comment}[1]{}
is for quotations where line breaks are important, such as poetry. Once in,
new stanzas are created with a blank line, and new lines within a stanza are
indicated using the newline command,
verse
for use with longer quotations, of more than one paragraph, because it indents
the first line of each paragraph.
quotation
quote
LaTeX provides several environments for quoting text; they have small differences and they are aimed for different types of quotations. All of them are
indented on either margin, and you will need to add your own quotation marks
if you want them. The provided environments are:
report
and
article
abstract
10.4.4. Abstracts
\\
. If a line takes up more than one line on the page, then all subsequent lines
are indented until explicitly separated with
\\
This page uses material from Andy Roberts Getting to grips with LaTeX with
permission from the author.
, but it's quite simple to create your own if you really need it.
book
dvips (default if compiling with latex), if you are compiling with latex to
get a DVI and you want to see your document with a DVI or PS viewer.
dvipdfm, if you are compiling with latex to get a DVI that you want to
convert to PDF using dvipdfm, to see your document with any PDF viewer.
\usepackage{graphicx}
As stated before, LaTeX can't manage pictures directly, so we will need some
extra help: we have to load the graphicx package in the preamble of our
document:
1
2
The graphics and graphicx packages recognize the "draft" and "final" options1
given in the \documentclass2 [...]{...} command at the start of the
In many respects, importing your images into your document using LaTeX is
fairly simple... once you have your images in the right format that is! Therefore,
I fear for many people the biggest effort will be the process of converting their
graphics files. Now we will see which formats we can include and then we
will see how to do it.
but, again, you don't need to pass any option to the package because the default
settings are fine in most of the cases.
As explained before, the image formats you can use depend on the driver that
graphicx is using but, since the driver is automatically chosen according to
the compiler, then the allowed image formats will depend on the compiler you
are using.
file. Using "draft" as the option will suppress the inclusion of the image in the
output file and will replace the contents with the name of the image file that
would have been seen. Using "final" will result in the image being placed in
the output file. The default is "final".
3
4
http://en.wikipedia.org/wiki/Encapsulated%20PostScript
http://en.wikipedia.org/wiki/Vector%20graphics
Many graphics software packages have the ability to save images in the EPS
format (extension is normally .eps). Here are some examples of software
that can output EPS formats:
The EPS format was defined by Adobe Systems for making it easy for applications to import postscript-based graphics into documents. Because an EPS
file declares the size of the image, it makes it easy for systems like LaTeX to
arrange the text and the graphics in the best way. EPS is a vector format4 this
means that it can have very high quality if it is created properly, with programs
that are able to manage vector graphics. It is also possible to store bit-map
pictures within EPS, but they will need a lot of disk space.
The only format you can include while compiling with latex is Encapsulated
PostScript3 (EPS).
5
6
7
http://sourceforge.net/projects/pdfcreator/
http://www.inkscape.org
http://www.ctan.org/tex-archive/support/epstopdf/
8
9
10
11
12
13
http://wiki.inkscape.org/wiki/index.php/LaTeX
http://live.gnome.org/Dia
http://www.gimp.org
http://pts.szit.bme.hu/sam2p/
http://www.imagemagick.org/
http://www.graphicsmagick.org/
PDF. From version 0.48, Inkscape has a special PDF+LaTeX output option
(and for EPS/PS too). See Inkscape website8 .
Dia9 is a cross platform diagramming utility which can export eps images,
or generate tex drawn using the tikz package.
Creating and converting raster-only graphics to EPS:
Commercial product Adobe Photoshop can save to EPS.
GIMP10 , has a graphical user interface, and it is multi-platform.
For command-line:
Sam2p11 (convert) or
ImageMagick12 (convert) or
GraphicsMagick13 (gm convert).
14
15
16
17
18
19
http://imgtops.sourceforge.net/
http://www.gnuplot.info
http://www.r-project.org/
http://gmt.soest.hawaii.edu/
http://projects.gnome.org/gnumeric/
http://matplotlib.sourceforge.net/
These three programs operate much the same way, and can convert between
most graphics formats. Sam2p however is the most recent of the three and
seems to offer both the best quality and to result in the smallest files.
imgtops14 . A lightweight graphics utility.
Creating publication-quality vector-based plots and charts:
Gnuplot15 , producing scientific graphics since 1986.
R16 , statistical and scientific figures.
Generic Mapping Tools (GMT)17 , maps and a wide range of highly customisable plots.
Gnumeric18 , spreadsheets has SVG, EPS, PDF export
matplotlib19 , plotting library written in python, with PDF and EPS export.
20
21
http://en.wikipedia.org/wiki/lossless
http://en.wikipedia.org/wiki/Vector%20graphics
JPG, widely used on Internet, digital cameras, etc. They are the best choice
if you want to insert photos
PNG, a very common format (even if not as much as JPG); it's a lossless20
format and it's the best choice for diagrams (if you were not able to generate
a vector21 version) and screenshots
If you are compiling with pdflatex to produce a PDF, you have a wider
choice. You can insert:
There are some tricks to be able to import formats other than EPS into your
DVI document, but they're very complicated. On the other hand, converting
any image to EPS is very simple, so it's not worth considering them.
24
25
22
23
http://en.wikipedia.org/wiki/Raster%20graphics
http://mirrors.ctan.org/info/svg-inkscape/InkscapePDFLaTeX.
pdf
http://dirkraffel.com/2007/11/19/include-eps-files-in-latex
http://www.inkscape.org
JPG and PNG are supported by any image processing program, so you just
have to use the one you prefer. If you want to create high quality vector PDF
to embed within your PDF document, you can use Inkscape25 : it supports
many vector formats and so you can use it to convert from one to an other. You
PDF, it is widely used for documents but can be used to store images as well.
It supports both vector and bit-map22 images, but it's not recommended for
the latter, as JPG or PNG will provide the same result using less disk space.
Vector formats can be used with the help of Inkscape. There are instructions23 on how to save your vector images in a PDF format understood
by LaTeX and have LaTeX manage the text styles and sizes in the image
automatically.
EPS can be used with the help of the epstopdf package. Please see these
instructions24 .
29
26
27
28
http://www.gnuplot.info
http://www.ctan.org/tex-archive/support/epstopdf/
http://www.ctan.org/tex-archive/help/Catalogue/entries/
epstopdf-pkg.html
http://en.wikipedia.org/wiki/Batch%20file
Note, that EPS files cannot be used with pdflatex, however they can be converted to PDF using the epstopdf utility27 , included in most LaTeX distributions. This can be called automatically by LaTeX using the epstopdf package28 .
In Windows, multiple files can be converted by placing the following line in
a batch file29 (a text file with a .BAT extension) in the same directory as the
images:
could also create your graphics directly with Inkscape. If you want to make
mathematical plots, then Gnuplot26 can save in any format.
30
31
http://www.ctan.org/tex-archive/support/epstopdf/
http://svn.ghostscript.com/ghostscript/trunk/gs/doc/Ps2pdf.
htm
If epstopdf30 produces whole page with your small graphics somewhere on it,
use
32
http://en.wikipedia.org/wiki/ImageMagick
which specifies the files to include in the document, if files with the same
basename exist, but with different extensions.
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
Images can be saved in multiple formats for different purposes. For example,
a directory can have "diagram.pdf" for high-resolution printing, while
"diagram.png" can be used for previewing on the monitor. You can specify
which image file is to be used by pdflatex through the preamble command:
width=xx
NB. Only
Now that we have seen which formats we can include and how we could
manage those formats, it's time to learn how to include them in our document.
After you have loaded the graphicx package in your preamble, you can
include images with \includegraphics, whose syntax is the following:
height=xx
33
Also note that the trim option does not work with XeLaTex.
Included graphics will be inserted just there, where you placed the code, and
the compiler will handle them as "big boxes". As we will see in the next
section33 , this can disrupt the layout; you'll probably want to place graphics
inside floating objects.
In order to use more than one option at a time, simply separate each with a
comma. The order you give the options matters. E.g you should first rotate
your graphic (with angle) and then specify its width.
page=x
This simply imports the image, without any other processing. However, it is
very large (so I won't display it here!). So, let's scale it down:
\includegraphics{chick}
OK, it's time to see graphicx in action. Here are some examples:
11.1.4. Examples
\includegraphics*[100,100][300,300]{mypicture}
The star version of the command will work for .eps files only. For a more
portable solution, the standard way should take precedence. The star command
will take the crop dimension as extra parameter:
Figure 39
This has now reduced it by half. If you wish to be more specific and give actual
lengths of the image dimensions, this is how to go about it:
\includegraphics[scale=0.5]{chick}
One can also specify the scale with respect to the width of a line in the local
environment (\linewidth), the width of the text on a page (\textwidth)
or the height of the text on a page (\textheight) (pictures not shown):
Figure 40
\includegraphics[width=2.5cm]{chick}
\includegraphics[height=\textheight]{chick}
\includegraphics[width=\textwidth]{chick}
\includegraphics[width=\linewidth]{chick}
And finally, an example of how to crop an image should you wish to focus on
one particular area of interest:
Figure 41
\includegraphics[scale=0.5, angle=180]{chick}
As you may have noticed, the file name of the picture is always without the
extension: LaTeX will take care of getting the right version for us. Consider
Trick: You can also use negative trim values to add blank space to your
graphics, in cases where you need some manual alignment.
Note the presence of clip, as the trim operation will not work without it.
Figure 42
\setlength\fboxsep{0pt}
\setlength\fboxrule{0.5pt}
\fbox{\includegraphics{chick}}
It is possible to have LaTeX create a border around your image by using fbox:
11.1.5. Borders
the following situation: you have added some pictures to your document in
JPG and you have successfully compiled it in PDF. Now you want to compile
it in DVI, you run latex and you get a lot of errors... because you forgot to
provide the EPS versions of the pictures you want to insert. At the beginning
of this book, we had stated that the same LaTeX source can be compiled in
both DVI and PDF without any change. This is true, as long as you don't use
particular packages, and graphicx is one of those. In any case, you can
still use both compilers with documents with pictures as well, as long as you
always remember to provide the pictures in two formats (EPS and one of JPG,
PNG or PDF).
\graphicspath{{c:\mypict~1\camera}}
\graphicspath{{c:/mypict~1/camera/}} % works well in Win XP
\graphicspath{{/var/lib/images/}}
There is a way to tell LaTeX where to look for images: for example, it can be
useful if you store images centrally for use in many different documents. The
answer is in the command \graphicspath which you supply with an argument giving the name of an additional directory path you want searched when
a file uses the \includegraphics command, here are some examples
(trailing / is required):
35
34
http://www.ctan.org/tex-archive/macros/latex/required/
graphics/grfguide.pdf.
http://en.wikibooks.org/wiki/grffile
As you may have noticed, in the first example I've used the "safe" (MS-DOS)
form of the Windows MyPictures folder because it's a bad idea to use directory
names containing spaces. Using absolute paths, \graphicspath does make
your file less portable, while using relative paths (like the last example), you
shouldn't have any problem with portability, but remember not to use spaces in
file-names. Alternatively, if you are using PDFLaTeX, you can use the package
grffile35 which will then allow you to use spaces in file names.
\graphicspath{{images_folder/}{other_folder/}{third_folder/}}
\graphicspath{{./images/}}
\begin{figure}[htb]
There are many scenarios where you might want to accompany an image
with a caption and possibly a cross-reference. This is done using the figure
environment. The following code sample shows the bare minimum required to
use an image as a figure.
export TEXINPUTS=./images//:./Snapshots//
Note that you cannot make the graphicx package search directories recursively.
Under Linux/Unix, you can achieve a recursive search using the environment
variable TEXINPUTS, e.g., by setting it to
36
The figure environment is not exclusively used for images. More information
on the figure environment and how to use it can be found in Floats, Figures
and Captions36 .
\begin{figure}[htb]
\centering
\includegraphics[width=0.8\textwidth]{image.png}
\caption{Awesome Image}
\label{fig:awesome_image}
\end{figure}
The above code extract is relatively trivial, and doesn't offer much functionality.
The following code sample shows an extended use of the figure environment
which is almost universally useful, offering a caption and label, centering the
image and scaling it to 80% of the width of the text.
\includegraphics{image.png}
\end{figure}
Placement
There are overall eight possible positioning targets:
% content section
\begin{wrapfigure}{r}{8cm} % "placement and width parameter for the
width of the image space.
\centering
\includegraphics[height=80mm]{Abb/bluesniper.jpg}
\caption{Selbstgebaute Bluesniper um Bluetooth-Gerte aus ber 1 km
Entfernung anzugreifen. (Stand: 2004)}
\label{bluesniper}
\end{wrapfigure}
%import section
\usepackage{wrapfig}
Text can also be wrapped around images. (This is especially useful if you
include tall pictures.)
37
http://ftp.univie.ac.at/packages/tex/macros/latex/contrib/
wrapfig/wrapfig-doc.pdf
The uppercase-character allows the figure to float, while the lowercase version
means "exactly here". 37
R
L
I
r
l
i
38
http://www.ctan.org/tex-archive/macros/latex/contrib/
pdfpages
Options:
Package Options
There is a great package for including full pages of PDF files: pdfpages38 .
It is capable of inserting full pages as is and more pages per one page in any
layout (e.g. 2x3).
Options for key=val (A comma separated list of options using the key = value
syntax)
includepdf
Commands
pages
pages={3,{},8-11,15}
angle
angle=90
addtolist
pagecommand={\label{fig:mylabel}}
Declares LaTeX-commands,
which are executed on each sheet
of paper. (Default: pagecommand={\thispagestyle{empty}}
Layout
includepdfmerge
Inserts pages of several external PDF documents.
pagecommand
40
39
http://www.ctan.org/tex-archive/macros/latex/contrib/
pdfpages/pdfpages.pdf
http://en.wikibooks.org/wiki/LaTeX%2FPGF%2FTikZ
You can draw graphics directly with TeX commands using the tikz package:
http://ftp.dante.de/tex-archive/help/Catalogue/entries/pgf.html It comes with
very good documentation with many examples.
11.2.1. TikZ/PGF
of
examples
can
be
found
here:
An extensive collection
http://www.texample.net/tikz/
\centering
\begin{tikzpicture}
\draw[thick,rounded corners=8pt]
(0,0) -- (0,2) -- (1,3.25) -- (2,2) -- (2,0) -- (0,2) -- (2,2) -(0,0) -- (2,0);
\end{tikzpicture}
\caption{This is the caption of my figure}
\label{fig:test}
\end{figure}
41
\begin{figure}
\centering
\input{./xfig/test.pstex_t}
\caption{This is the caption of my figure}
\label{fig:test}
\end{figure}
Vector graphics can be created using the vector painting program Xfig (see
Installation41 ), and exported for LaTeX. In Xfig, once your graphic is saved as
a file test.fig, you need to export it using the File > Export drop down
menu from the main Xfig window and then select the "Combined PS/Latex
(both parts)" in the language drop down list. If you don't change any other
settings, two files will be created in the same directory as the test.fig file,
such as: test.pstex_t and test.pstex. The figure can then be placed
in a LaTeX document:
11.2.2. Xfig
42
43
44
45
http://en.wikipedia.org/wiki/Ipe%20%28program%29
http://en.wikibooks.org/wiki/LaTeX
http://www.inkscape.org/
http://www.w3.org/Graphics/SVG/
11.2.4. Inkscape
The Ipe42 extensible drawing editor is a free vector graphics editor for creating
figures in PDF or EPS format. Unlike Xfig, Ipe represents LaTeX43 fonts in
their correct size on the screen which makes it easier to place text labels at
the right spot. Ipe also has various snapping modes (for example, snapping to
points, lines, or intersections) that can be used for geometric constructions.
11.2.3. Ipe
46
47
48
http://en.wikibooks.org/wiki/LaTeX
http://en.wikibooks.org/wiki/LaTeX
http://www.pstoedit.net/
To properly edit an EPS file, you can convert it to an editable format using
pstoedit48 . For instance, to get an Xfig-editable file, do:
that can be included in LaTeX46 files, such as EPS and PDF. From version
0.48, there is a combined PDF/EPS/PS+LaTeX output option, like XFig has.
49
http://linuxcommand.org/man_pages/eps2eps1.html
When all of the above fails, one can simplify the EPS file before attempting
other conversions, by using the eps2eps49 tool (also see next section):
$ epstopdf input.eps
$ inkscape input.pdf
Sometimes pstoedit fails to create the target format (for example when the
EPS file contains clipping information). A more robust way to edit EPS files
is achieved by converting it first to PDF and then importing the resulting
PDF in Inkscape. Inkscape uses the Cairo library that achieves a high-quality
transformation of the original EPS figure:
50
51
52
http://linuxcommand.org/man_pages/eps2eps1.html
http://ghostscript.com/
http://www.pa.op.dlr.de/~PatrickJoeckel/pscol/index.html
This will convert all the fonts to pre-drawn images, which is sometimes desirable when submitting manuscripts for publication. However, on the downside,
the fonts are NOT converted to lines, but instead to bitmaps, which reduces
the quality of the fonts.
11.3. References
In the Importing Graphics1 chapter, you learned that you can import or link
graphics into LaTeX, such as graphics that you have created in another program
or obtained elsewhere. In this chapter, you will learn how to create or embed
graphics directly in a LaTeX document. The graphics is marked up using
commands similar to those for typesetting bold text or creating mathematical
formulas, as the following example of embedded graphics shows:
2
3
4
http://en.wikibooks.org/wiki/LaTeX%2FPicture
http://en.wikibooks.org/wiki/LaTeX%2FXy-pic
http://en.wikibooks.org/wiki/LaTeX%2FPGF%2FTikZ
Figure 43
\begin{displaymath}
\xymatrix{ \bullet \ar[r] \ar@{.>}[r] & \bullet }
\end{displaymath}
http://en.wikipedia.org/wiki/catenary
12.1. Overview
In addition, numerous packages have been written for specific purposes. One
of them is XY-pic, described at the end of this chapter. A wide variety of these
packages are described in detail in The LaTeX Graphics Companion (not to be
confused with The LaTeX Companion).
While the former two packages just enhance the picture environment, the
pstricks package has its own drawing environment, pspicture. The
power of pstricks stems from the fact that this package makes extensive use
of PostScript possibilities. Unfortunately it has one big shortcoming: it doesn't
work together with pdfLaTeX, as such to generate a PDF document form TeX
source you have to go TeXDVIPDF; losing hyperlinks, metadata and
microtypographic features of pdflatex.
produced are "small" with respect to bytes, and there are no additional graphics
files to be dragged along.
6
7
http://en.wikipedia.org/wiki/MetaPost
http://en.wikipedia.org/wiki/METAFONT
The last but certainly not least is the PGF/TikZ system. While the previous
systems (picture, epic, pstricks or metapost) focus on the how to
draw, TikZ focuses more on the what to draw. One could say that TikZ is to
drawing in LaTeX as LaTeX is to digital typesetting. It's recommended to use
it if your LaTeX distribution includes it.
Perhaps the most powerful graphical tool related with LaTeX is MetaPost6 ,
the twin of Donald E. Knuths METAFONT7 . MetaPost has the very powerful and mathematically sophisticated programming language of METAFONT.
Contrary to METAFONT, which generates bitmaps, MetaPost generates encapsulated PostScript files, which can be imported in LaTeX. For an introduction,
see A Users Manual for MetaPost. A very thorough discussion of LaTeX and
TEX strategies for graphics (and fonts) can be found in TEX Unbound.
The easiest solution is to use the picture environment and then simply use the
"put" command to put a graphics file inside the picture, along with any other
desired LaTeX element. For example:
12.2. Alternatives
9
10
11
Note that the border around the picture in the above example was added by
using \fbox9 , so the contents of the border is the picture as generated by the
above code.
Figure 44
\setlength{\unitlength}{0.8cm}
\begin{picture}(6,5)
\put(3.5,0.4){$\displaystyle
s:=\frac{a+b+c}{2}$}
\put(1,1){\includegraphics[
width=2cm,height=2cm]{picture.eps}}
\end{picture}
12
13
14
http://www.math.uni-leipzig.de/~matveyev/lpic/
http://www.xfig.org
http://www.macports.org
be saved as .EPS (or .PDF) files which may then be imported into the LaTeX
document proper.
1. Create the drawing in xfig. Wherever you need LaTeX text, such as
a mathematical formula, enter a LaTeX string in a textbox. Use the
Edit tool to open the properties of each of those textboxes, and change
the option on the "Special Flag" field to Special. This tells LaTeX to
interpret these textboxes when it opens the figure.
2. Go to File -> Export and export the file as PDF/LaTeX (both parts) or
PS/LaTeX (both parts), depending on whether you are using pdflatex or
pslatex to compile your file. In your LaTeX document, where the picture
should be, use the following, where "test" is replaced by the name of the
image:
There are many ways to use xfig to create graphics for LaTeX documents. One
method is to export the drawing as a LaTeX document. This method, however,
suffers from various drawbacks: lines can be drawn only at angles that are
multiples of 30 and 45 degrees, lines with arrows can only be drawn at angles
that are multiples of 45 degrees, several curves are not supported, etc.
\usepackage{graphicx}
\usepackage{color}
Observe that this is just like including a picture, except that rather than
using \includegraphics, we use \input. If the export was into
PS/LaTeX, the file extension to include would be .pstex_t instead of
.pdf_t.
3. Make sure to include packages graphicx and color in the file, with
the usepackage command right below the documentclass command, like this:
\begin{figure}[htbp]
\centering
\input{test.pdf_t}
\caption{Your figure}
\label{figure:example}
\end{figure}
15
16
http://www-epb.lbl.gov/xfig/latex_and_xfig.html
http://www-epb.lbl.gov/xfig/contents.html
For more details on using xfig with LaTeX, this chapter15 of the xfig User
Manual16 may prove helpful.
Floats are not part of the normal stream of text, but separate entities, positioned
in a part of the page to themselves (top, middle, bottom, left, right, or wherever
the designer specifies). They always have a caption describing them and they
are always numbered so they can be referred to from elsewhere in the text.
LaTeX automatically floats Tables and Figures, depending on how much space
is left on the page at the point that they are processed. If there is not enough
room on the current page, the float is moved to the top of the next page. This
can be changed by moving the Table or Figure definition to an earlier or
Floats are containers for things in a document that cannot be broken over a
page. LaTeX by default recognizes "table" and "figure" floats, but you can
define new ones of your own (see Custom Floats2 below). Floats are there to
deal with the problem of the object that won't fit on the present page, and to
help when you really don't want the object here just now.
13.1. Floats
\begin{figure}[placement specifier]
... figure contents ...
\end{figure}
13.1.1. Figures
later point in the text, or by adjusting some of the parameters which control
automatic floating.
t
b
p
Specifier
h
Permission
Place the float here, i.e., approximately at the same point it occurs
in the source text (however, not
exactly at the spot)
Position at the top of the page.
Position at the bottom of the page.
Put on a special page for floats
only.
The previous section mentioned how floats are used to allow LaTeX to handle
figures, while maintaining the best possible presentation. However, there may
be times when you disagree, and a typical example is with its positioning of
figures. The placement specifier parameter exists as a compromise, and its
purpose is to give the author a greater degree of control over where certain
floats are placed.
Permission
Override internal parameters LaTeX uses for determining "good"
float positions.
Places the float at precisely the
location in the LaTeX code. Requires the float package,3 e.g.,
\usepackage{float}. This is
somewhat equivalent to h!.
http://www.ctan.org/tex-archive/macros/latex/contrib/
float/
What you do with these placement permissions is to list which of the options
you wish to make available to LaTeX. These are simply possibilities, and
LaTeX will decide when typesetting your document which of your supplied
specifiers it thinks is best.
Specifier
!
\usepackage{float}
\floatstyle{boxed}
\restylefloat{figure}
It's possible to get a thin border around all figures. You have to write the
following once at the beginning of the document:
Use \listoffigures to add a list of the figures in the beginning of the document. To change the name used in the caption from Figure to Example, use
\renewcommand{\figurename}{Example} in the figure contents.
You may feel that it is a bit long winded, but such distinctions are necessary,
because you may not want all tables to be treated as a float.
\begin{table}
\begin{tabular}{...}
... table data ...
\end{tabular}
\end{table}
Although tables have already been covered4 , it was only the internal syntax
that was discussed. The tabular environment that was used to construct the
tables is not a float by default. Therefore, for tables you wish to float, wrap the
tabular environment within a table environment, like this:
13.1.3. Tables
5
6
http://ctan.org/tex-archive/macros/latex/contrib/placeins
http://www.ctan.org/pkg/endfloat
13.2. Captions
\begin{table}[h!]
\begin{figure}[h!]
Figure 45
\centering
\reflectbox{%
\includegraphics[width=0.5\textwidth]{gull}}
\caption{A picture of the same gull
looking the other way!}
\end{figure}
\begin{figure}[h!]
\caption{A picture of a gull.}
\centering
\includegraphics[width=0.5\textwidth]{gull}
\end{figure}
\begin{document}
\usepackage[english]{babel}
\usepackage{graphicx}
\documentclass[a4paper,12pt]{article}
\end{document}
\begin{figure}[hb]
\centering
\includegraphics[width=4in]{gecko}
\caption[Close up of \textit{Hemidactylus} sp.]
Figure
{Close up of \textit{Hemidactylus}
sp.,46
which is
part the genus of the gecko family. It is the
second most speciose genus in the family.}
\end{figure}
\section{Introduction}
\listoffigures
\begin{document}
\documentclass[12pt]{article}
\usepackage{graphicx}
\end{document}
\begin{SCfigure}
\centering
\includegraphics[width=0.5\textwidth]%
{Giraff_picture}% picture filename
\caption{ ... caption text ... } Figure
\end{SCfigure}
\begin{document}
\usepackage[pdftex]{graphicx}
\usepackage{sidecap}
\documentclass{article}
47
Warning: If you want to label a figure so that you can reference it later, you
have to add the label after the caption (inside seems to work in LaTeX 2e)
but inside the floating environment. If it is declared outside, it will give the
section number. If the label picks up the section or list number instead of the
figure number, put the label inside the caption to ensure correct numbering. If
you get an error when the label is inside the caption, use \protect infront
of the \label command.
Labels and cross-references work fairly similarly to the general case - see the
Labels and Cross-referencing7 section for more information.
Although not normally the case in academic writing, an author may prefer
that some floats do not break the flow of text, but instead allow text to wrap
around it. (Obviously, this effect only looks decent when the figure in question
is significantly narrower than the text width.)
http://en.wikibooks.org/wiki/LaTeX/Packages/Installing_
Extra_Packages
\begin{wrapfigure}[lineheight]{alignment}{width}
\usepackage{wrapfig}
Anyway, we will look at the package wrapfig. (Note: wrapfig may not come
with the default installation of LaTeX; you might need to install additional
packages manually8 .)
Note that we have specified a size for both the wrapfigure environment
and the image we have included. We did it in terms of the text width: it is
always better to use relative sizes in LaTeX, let LaTeX do the work for you!
The "wrap" is slightly bigger than the picture, so the compiler will not return
any strange warning and you will have a small white frame between the image
Figure 48
\begin{wrapfigure}{r}{0.5\textwidth}
\begin{center}
\includegraphics[width=0.48\textwidth]{gull}
\end{center}
\caption{A gull}
\end{wrapfigure}
It happens that you'll generate figures with too much (or too little) white space
on the top or bottom. In such a case, you can simply make use of the optional
argument [lineheight]. It specifies the height of the figure in number of
lines of text. Also remember that the environment center adds some extra
white space at its top and bottom; consider using the command \centering
instead.
The wrapfig package can also be used with user-defined floats with float
package. See below in the section on custom floats9 .
and the surrounding text. You can change it to get a better result, but if you
don't keep the image smaller than the "wrap", you will see the image over the
text.
Another possibility is adding space within the float using the \vspace{...}
command. The argument is the size of the space you want to add, you can
use any unit you want, including pt, mm, in, etc. If you provide a negative
argument, it will add a negative space, thus removing some white space.
Using \vspace tends to move the caption relative to the float while the
[lineheight] argument does not. Here is an example using the \vspace
command, the code is exactly the one of the previous case, we just added some
negative vertical spaces to shrink everything up:
In this case it may look too shrunk, but you can manage spaces the way you like.
In general, it is best not to add any space at all: let LaTeX do the formatting
work!
Figure 49 336
\begin{wrapfigure}{r}{0.5\textwidth}
\vspace{-20pt}
\begin{center}
\includegraphics[width=0.48\textwidth]{gull}
\end{center}
\vspace{-20pt}
\caption{A gull}
\vspace{-10pt}
\end{wrapfigure}
11
10
http://tug.ctan.org/tex-archive/macros/latex/contrib/
floatflt/
http://www.ctan.org/tex-archive/macros/latex/contrib/
floatflt/floatflt.pdf
Alternatively you might use the picins package instead of the wrapfigure
package which produces a correct version without the excess white space out
of the box without any hand tuning.
(In this case, the problem is the use of \begin{center} to center the
image. The center environment adds extra space that can be avoided if
\centering is used instead.)
\begin{figure}
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{gull}
\caption{A gull}
\label{fig:gull}
\end{subfigure}%
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
13.2.6. Subfloats
etc.
etc.
\begin{subfigure}[<placement specifier>]{<width>}
\centering
... figure or table ...
You will notice that the figure environment is set up as usual. You may also
use a table environment for subtables. For each subfloat, you need to use:
Figure 50
If you intend to cross-reference any of the subfloats, see where the label is
inserted; \caption outside the subfigure-environment will provide the
global caption.
\caption{<sub caption>}
\end{subfigure}
12
If
you
are
writing
a
document
using
two
columns
(i.e.
you started your document with something like
\documentclass[twocolumn]{article}), you might have noticed that you can't use floating elements that are wider than the width of a
column (using a LaTeX notation, wider than 0.5\textwidth), otherwise
you will see the image overlapping with text. If you really have to use
such wide elements, the only solution is to use the "starred" variants of the
floating environments, that are {figure*} and {table*}. Those "starred"
versions work exactly like the standard ones, but they will be as wide as the
page, so you will get no overlapping.
13
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=
2colfltorder
If tables and figures are not adequate for your needs, then you always have the
option to create your own! Examples of such instances could be source code
To prevent the figures from being placed out-of-order with respect to their
"non-starred" counterparts, the package fixltx2e 13 should be used (e.g.
\usepackage{fixltx2e}).
A bad point of those environments is that they can be placed only at the top of
the page or on their own page. If you try to specify their position using modifiers like b or h they will be ignored. Add \usepackage{dblfloatfix}
to the preamble in order to alleviate this problem with regard to placing these
floats at the bottom of a page, using the optional specifier [b]. Default is
[tbp]. However, h still does not work.
14
examples, or maps. For a program float example, one might therefore wish to
create a float named program. The package float is your friend for this
task. All commands to set up the new float must be placed in the preamble, and
not within the document.
Float styles can also be customized as the second example below illustrates.
3. The default name that appears at the start of the caption is the type. If
you wish to alter this, use \floatname{type}{floatname}
4. Changing float style can be issued with \floatstyle{style}
(Works on all subsequent \newfloat commands, therefore, must
be inserted before \newfloat to be effective).
plain - the normal style for Latex floats, but the caption is always
below the content.
plaintop - the normal style for Latex floats, but the caption is
always above the content.
boxed - a box is drawn that surrounds the float, and the caption is
printed below.
ruled - the caption appears above the float, with rules immediately
above and below. Then the float contents, followed by a final horizontal rule.
\end{document}
class HelloWorldApp {
public static void main(String[] args) {
//Display the string
System.out.println("Hello World!");
}
}
\end{verbatim}
\caption{The Hello World! program in Java.}
\end{program}
\begin{program}
\begin{verbatim}
\begin{document}
\floatstyle{ruled}
\newfloat{program}{thp}{lop}
\floatname{program}{Program}
\usepackage{float}
\documentclass{article}
15
http://en.wikibooks.org/wiki/LaTeX%2FPackages%2FListings
Newly created floats with newfloat can also be used in combination with the
wrapfig package from above. E.g. the following code creates a floating text
box, which floats in the text on the right side of the page and is complete with
caption, numbering, an index file with the extension .lob and a customization
of the float's visual layout:
While this is useful, one should be careful when embedding the float within
another float. In particular, the error not in outer par mode may
occur. One solution might be to use the [H] option (not any other) on the inner
float, as this option "pins" the inner float to the outer one.
% this code block defines the new and custom floatbox float
environment
\floatstyle{simplerule}
\newfloat{floatbox}{thp}{lob}[section]
\usepackage{float}
\documentclass{article}
\end{document}
\begin{floatbox}{r}{}
\textit{Bootstrapping} is a resampling technique used
for robustly estimating statistical quantities, such as
the model fit $R^2$. It offers some protection against
the sampling bias.
\caption{Bootstrapping}
\end{floatbox}
\begin{document}
\floatname{floatbox}{Text Box}
17
16
http://mirror.ctan.org/macros/latex/contrib/caption/
caption-eng.pdf
http://www.komascript.de/
The KOMA script packages http://www.komascript.de/17 have their own caption customizing features with e.g. \captionabove, \captionformat
and \setcapwidth. However these definitions have limited effect on newly
created float environments with the wrapfig package.
\usepackage[font=small,labelfont=bf]{caption}
18
19
There is a LaTeX package lpic19 to put LaTeX on top of included graphics, thus
allowing to add TeX annotations to imported graphics. It defines a convenient
interface to put TeX over included graphics, and allows for drawing a white
background under the typeset material to overshadow the graphics. It is a
better alternative for labels inside of graphics; you do not have to change text
size when rescaling pictures, and all LaTeX power is available for labels.
\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}
21
20
http://www.ctan.org/tex-archive/help/Catalogue/entries/
pinlabel.html
http://www.ctan.org/pkg/pgf
That concludes all the fundamentals of floats. You will hopefully see how
much easier it is to let Latex do all the hard work and tweak the page layouts
in order to get your figures in the best place. As always, the fact that LaTeX
takes care of all caption and reference numbering is a great time saver.
13.3.1. Summary
A much more complicated package which can be used in the same way is
tikz21 . tikz is a front-end to a drawing library called pgf (which is used to
make beamer). It can be used to label figures by adding text nodes on top of
an image node.
13.4. References
14.1. Hyperref
14. Hyperlinks
\usepackage{hyperref}
The basic usage with the standard settings is straightforward. Just load the
package in the preamble, at the end of all the other packages but prior to other
settings:
14.2. Usage
you will have the possibility to include interactive external links and all your
internal references will be turned to hyperlinks. The compiler pdflatex makes it
possible to create PDF files directly from the LaTeX source, and PDF supports
more features than DVI. In particular PDF supports hyperlinks, and the only
way to introduce them in LaTeX is using hyperref. Moreover, PDF can
contain other information about a document such as the title, the author, etc.,
and you can edit those using this same package.
The package provides three useful commands for inserting links pointing
outside the document.
14.2.1. Commands
\ref
\label
This will automatically turn all your internal references into hyperlinks. It
won't affect the way to write your documents: just keep on using the standard
If the lemma labelled as "mainlemma" was number 4.1.1, then the outputted
text would be "we use lemma 4.1.1" with the hyperlink as expected.
\ref
but will make the text link text a full link, instead. The two can be combined,
for example in
\ref{label_name}
\hyperref[label_name]{''link text''}
Usage:
\hyperref
It will show the string "description" using standard document font but, if you
click on it, your browser will be opened pointing at "my_url". Here is an
example:
\href{''my_url''}{''description''}
Usage:
\href
It will show the URL using a mono-spaced font and, if you click on it, your
browser will be opened pointing at it.
\url{''my_url''}
Usage:
\url
\href
Both point at the same page, but in the first case the URL will be shown,
while in the second case the URL will be hidden. Note that, if you print your
document, the link stored using
\url{http://www.wikibooks.org}
\href{http://www.wikibooks.org}{wikibooks home}
\nolinkurl
\href{m
ailto:my_address@wikibooks.org}{\nolinkurl{my_address@wikibooks.org}}
it just shows your email address (so people can know it even if the document
is printed on paper) but, if the reader clicks on it, (s)he can easily send you
an email. Or, to incorporate the url package's formatting and line breaking
abilities into the displayed text, use2
\href{mailto:my_address@wikibooks.org}{my\_address@wikibooks.org}
Mail address
You can use relative paths to link documents near the location of your current
document; in order to do so, use the standard Unix-like notation (./ is the
current directory, ../ is the previous directory, etc.)
\url{run:/path/to/my/file.ext}
\href{run:/path/to/my/file.ext}{text displayed}
Files can also be linked using the url or the href commands. You simply have
to add the string run: at the beginning of the link string:
Local file
command.
\protect
The standard settings should be fine for most users, but if you want to change
something, you can easily do it. There are several variables you can change
and there are two methods to pass those to the package. You can pass the
options as an argument of the package when you load it (that's the standard
way packages work), or you can use the \hypersetup command:
14.3. Customization
\hypertarget{label}{link caption}
and
\hyperlink{label}{anchor caption}
http://www.tug.org/applications/hyperref/manual.html#
x1-120003.8
Here is a list of the possible variables you can change (for the complete list,
see the official documentation). The default values are written in an upright
font:
\usepackage[''option1, option2'']{hyperref}
exactly the same format has to be used if you pass those options to the package
while loading it, like this:
variable_name=new_value
you can pass as many options as you want; separate them with a comma.
Options have to be in the form:
\hypersetup{''option1'' [, ...]}
values
=true,false
=false,true
variable
bookmarks
unicode
comment
show or hide the bookmarks bar when displaying the document
allows to use characters of non-Latin
based languages in
Acrobats bookmarks
variable
pdfborder
values
={RadiusH
RadiusV Width
[Dash-Pattern]}
comment
set the style of the border around a link. The
first two parameters
(RadiusH, RadiusV)
have no effect in most
pdf viewers. Width
defines the thickness
of the border. DashPattern is a series of
numbers separated by
space and enclosed
by box-brackets. It is
an optional parameter
to specify the length
of each line & gap in
the dash pattern. For
example, {0 0 0.5 [3
comment
show or hide Acrobats toolbar
=true,false
show or hide Acrobats menu
=true,false
resize document window to fit document
size
. width of the
={FitH},{FitV},etc
fit5the
page to the window
={text}
define the title that
gets displayed in the
"Document Info" window of Acrobat
values
=true,false
pdftitle
pdfstartview
pdffitwindow
pdfmenubar
variable
pdftoolbar
values
={text}
={text}
={text}
={text}
={text}
variable
pdfauthor
pdfsubject
pdfcreator
pdfproducer
pdfkeywords
comment
the name of the PDFs
author, it works like
the one above
subject of the document, it works like the
one above
creator of the document, it works like the
one above
producer of the document, it works like the
one above
list of keywords, separated by brackets,
example below
values
(=true,false)
(=false,true)
variable
pdfnewwindow
pagebackref
comment
define if a new window should get
opened when a link
leads out of the current document
activate back references inside bibliography. Must be
specified as part of the
\usepackage{} statement.
linkcolor
hidelinks
variable
colorlinks
=red
values
(=false,true)
comment
surround the links by
color frames (false)
or colors the text of
the links (true). The
color of these links
can be configured
using the following
options (default colors
are shown):
hide links (removing
color and border)
color of internal links
(sections, pages, etc.)
urlbordercolor
citebordercolor
linkbordercolor
filecolor
urlcolor
citecolor
variable
linktoc
values
comment
=none,section,page,all
defines which part of
an entry in the table of
contents is made into
a link
=green
color of citation links
(bibliography)
=magenta
color of file links
=cyan
color of URL links
(mail, web)
={1 0 0}
color of frame around
internal links (if
colorlinks=false)
={0 1 0}
color of frame around
citations
={0 1 1}
color of frame around
URL links
\hypersetup{
bookmarks=true,
unicode=false,
bookmarks
pdftoolbar=true,
pdfmenubar=true,
pdffitwindow=false,
pdfstartview={FitH},
window
pdftitle={My title},
pdfauthor={Author},
pdfsubject={Subject},
pdfcreator={Creator},
%
%
%
%
%
%
%
%
Please note, that explicite RGB specification is only allowed for the border
colors (like linkbordercolor etc.), while the others may only assigned to named
colors (which you can define your own, see Colors6 ). In order to speed up
your customization process, here is a list with the variables with their default
value. Copy it in your document and make the changes you want. Next to the
variables, there is a short explanations of their meaning:
\usepackage{hyperref}
\usepackage{hyperref}
\hypersetup{colorlinks=false}
If you don't need such a high customization, here are some smaller but useful
examples. When creating PDFs destined for printing, colored links are not a
good thing as they end up in gray in the final output, making it difficult to read.
You can use color frames, which are not printed:
\urlstyle{same}
By default, URLs are printed using mono-spaced fonts. If you don't like it and
you want them to be printed with the same style of the rest of the text, you can
use this:
\usepackage[pdfauthor={Author's name},%
pdftitle={Document Title},%
pagebackref=true,%
pdftex]{hyperref}
When you just want to provide information for the Document Info section of
the PDF file, as well as enabling back references inside bibliography:
\hypersetup{
colorlinks,%
citecolor=black,%
filecolor=black,%
linkcolor=black,%
urlcolor=black
}
Beware that the shown line number is often completely different from the
erroneous line.
\begin{eqnarray*}a=b\end{eqnarray*}
\begin{eqnarray}a=b\nonumber\end{eqnarray}
provided by the book document class. It resets the page number counter to
1 prior to the first chapter of the book. But as the preface of the book also
has a page number 1 all links to "page 1" would not be unique anymore,
hence the notice that "duplicate has been ignored." The counter measure
\mainmatter
appear when a counter gets reinitialized, for example by using the command
Possible solution: Place the amsmath package before the hyperref package.
\pagenumbering{alph}
\pagenumbering{alph}
% a, b, c, ...
... titlepage, other front matter ...
\pagenumbering{roman}
% i, ii, iii, iv, ...
... table of contents, table of figures, ...
\pagenumbering{arabic} % 1, 2, 3, 4, ...
... beginning of the main matter (chapter 1) ...
command:
\pagenumbering
The best solution is to give each page a unique name by using the
\setcounter{page}{-100}
... titlepage, other front matter ...
\pagenumbering{roman}
% i, ii, iii, iv, ...
. The important point is that although the numbers are not visible, each page
will have a unique name.
If you don't want the page numbers to be visible (for example, during the front
matter part), use
By changing the page numbering every time before the counter is reset, each
page gets a unique name. In this case, the pages would be numbered a, b, c, i,
ii, iii, iv, v, 1, 2, 3, 4, 5, ...
, which will give the title page the label page.a. Since the page number is
suppressed, it won't make a difference to the output.
\maketitle
commands.
\nonumber
on every line of an eqnarray environment. In this case, use the *'ed form
instead, e.g.
\nonumber
The problem can also occur with the algorithms package: because each
algorithm uses the same line-numbering scheme, the line identifiers for the
second and follow-on algorithms will be duplicates of the first.
You can now work around this problem by providing a text string for the
bookmarks, which replaces the offending text:
The text displayed by bookmarks does not always look like you expect it to
look. Because bookmarks are "just text", much fewer characters are available
for bookmarks than for normal LaTeX text. Hyperref will normally notice
such problems and put up a warning:
If your url's are too long and running off of the page, try using the breakurl
package to split the url over multiple lines. This is especially important in a
multicolumn environment where the line width is greatly shortened.
gets ignored but its argument (red) gets printed. If you use:
\textcolor
\section{\textcolor{red}{Red !}}
to E=mc2 in the bookmark area. Color changes also do not travel well into
bookmarks:
\section{$E=mc^2$}
which turns
\section{\texorpdfstring{$E=mc^2$}{E=mc2}}
The links created by hyperref point to the label created within the
float environment, which, as previously described7 , must always be set
after the caption. Since the caption is usually below a figure or table,
\texorpdfstring
If you write your document in unicode and use the unicode option for the
hyperref package you can use unicode characters in bookmarks. This will
give you a much larger selection of characters to pick from when using
10
http://www.ctan.org/tex-archive/macros/latex/contrib/
hyperref/README
http://www.ctan.org/tex-archive/macros/latex/contrib/
oberdiek/hypcap.pdf
Chapter 13.2.4 on page 414
\capstart
Be sure to call this package after loading hyperref, which should otherwise
be loaded last.
If you use the wrapfig package mentioned in the "Wrapping text around
figures10 " section of the "Floats, Figures and Captions" chapter, or other similar
packages that define their own environments, you will need to manually include
\usepackage[all]{hypcap}
the figure or table itself will not be visible upon clicking the link8 . A
workaround exists by using the package hypcap http://www.ctan.org/texarchive/macros/latex/contrib/oberdiek/hypcap.pdf9 with:
with hyperref for long captions or long titles. This happens when the captions (or the titles) are longer than the page width (about 7-9 words depending
on your settings). To fix this, you need to use the option breaklinks when first
declaring:
\listoffigures
\begin{wrapfigure}{R}{0.5\textwidth}
\capstart
\begin{center}
\includegraphics[width=0.48\textwidth]{filename}
\end{center}
\caption{\label{labelname}a figure}
\end{wrapfigure}
The format of some of the auxilliary files generated by latex changes when you
include the hyperref package. One can therefore encounter errors like
! Argument of \Hy@setref@link has an extra }. when
the document is typeset with hyperref for the first time and these files
already exist. The solution to the problem is to delete all the files that latex
uses to get references right and typeset again.
\listoffigures
\usepackage[breaklinks]{hyperref}
11
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%23Common_
problems_and_workarounds
\phantomsection\label{some_label}
instead of using
is broken when pointed at a label. Instead of sending the user to the desired
label, upon clicking the user will be sent to the first frame. A simple work
around exists;
\hyperref[some_label]{some text}
14.12. References
\hyperlink{some_label}{some text}
\hypertarget{some_label}{}
Adding colors to your text is supported by the color package. Using this
package, you can set the color of the font of the text, and set the background
color of the page. You can use one of the predefined colors such as white, red,
or yellow, or you can define your own named colors. It's also possible to color
formulas in math-environments.
15. Colors
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
You may also want to add to the preamble after the previous line:
\usepackage{color}
To make use of these color features the color package must be inserted into the
preamble.
{\color{declared-color} text}
\definecolor
\textcolor{declared-color}{text}
If you need more colors, then you may also want to look at adding the x11names
to the initialization section as well, this offers more than 300 colors, but you
need to make sure your xcolor package is the most recent you can download.
\texttt
\color
and
\textcolor
Figure 51
that will switch the standard text color to the color you want. It will work until
the end of the current TeX group. For example:
There is also \fcolorbox to make framed background color in yet another color:
\colorbox{declared-color1}{\color{declared-color2}{text}}
\colorbox{declared-color}{text}
\pagecolor{declared-color}
You can change the background color of the whole page by:
\ttfamily
and
If you would like a color not pre-defined, you can use one of the 68 dvips
colors, or define your own. These options are discussed in the following
sections
The predefined color names are white, black, red, green, blue,
cyan, magenta, yellow. There may be other pre-defined colors on
your system, but these should be available on all systems.
\fcolorbox{declared-color-frame}{declared-color-background}{text}
Aquamarine
BlueGreen
Apricot
Blue
BlueViolet
Bittersweet
\usepackage[usenames,dvipsnames]{xcolor}
BrickRed
Black
Invoke the package with the usenames and dvipsnames option. If you are using
TikZ package you must declare the color package before that, otherwise it will
not work.
Emerald
DarkOrchid
ForestGreen
CornflowerBlue Cyan
Cerulean
CadetBlue
BurntOrange
Brown
Fuchsia
Dandelion
CarnationPink
Gray
Lavender
Maroon
Goldenrod
JungleGreen
Mahogany
Melon
LimeGreen
Green
MidnightBlue
Magenta
GreenYellow
NavyBlue
Orchid
Plum
Mulberry
OrangeRed
PineGreen
ProcessBlue
Peach
OliveGreen
Purple
Periwinkle
Orange
Red
RoyalBlue
SeaGreen
RawSienna
Rhodamine
Salmon
Sepia
RoyalPurple
RedOrange
SkyBlue
RubineRed
RedViolet
Violet
Turquoise
WildStrawberry Yellow
Tan
SpringGreen
YellowGreen
VioletRed
TealBlue
YellowOrange
White
Thistle
http://en.wikibooks.org/wiki/LaTeX%2FPackages%2FListings
15.6.1. Place
If the predefined colors are not adequate, you may wish to define your own.
If you loaded the xcolor package, you can define colors upon previously
defined ones:
Trick : When surfing on the web, you can get hexadecimal code for each color
on a web page using the colorzilla extension to Firefox.
\definecolor{orange}{RGB}{255,127,0}
You can use small letters rgb and choose a value between 0 and 1 or use capital
letters RGB and choose a value between 0 and 255. The following code should
give a similar results to the last code chunk.
\definecolor{orange}{rgb}{1,0.5,0}
To define a new color, follow the following example, which defines orange for
you, by setting the red to the maximum, the green to one half (0.5), and the
blue to the minimum:
15.6.2. Method
name is the name of the color; you can call it as you like
model is the way you describe the color, and is one of gray, rgb and cmyk.
color-spec is the description of the color
where:
\definecolor{''name''}{''model''}{''color-spec''}
\colorlet{notgreen}{blue!50!yellow}
Example
\definecolor{light-gray
Color Specification
just one number
between 0 (black)
and 1 (white), so
0.95 will be very
light gray, 0.30
will be dark gray
http://mirror.ctan.org/macros/latex/contrib/xcolor/xcolor.
pdf
Color Models
Model Description
gray Shades
of gray.
Among the models you can use to describe the color are the following (several
more are described in the xcolor manual2 ):
Color Models
Model Description
rgb Red,
Green,
Blue
Example
\definecolor{orange}{rg
Color Specification
three numbers
given in the form
red,green,blue;
the quantity of
each color is represented with a
number between 0
and 1
HTML Red,
Green,
Blue
Color Models
Model Description
RGB Red,
Green,
Blue
\definecolor{orange}{RG
three numbers
given in the form
red,green,blue;
the quantity of
each color is represented with a
number between 0
and 255
six hexadecimal
numbers given in
the form RRGGBB;
similar to what is
used in HTML
\definecolor{orange}{HT
Example
Color Specification
Example
four numbers
\definecolor{orange}{cm
given in the form
cyan,magenta,yellow,black;
the quantity of
each color is
represented with a
number between 0
and 1
Color Specification
The xcolor package provides extended versions of the described color related
commands. Tints can be defined as follow:
Color Models
Model Description
cmyk Cyan,
Magenta,
Yellow,
Black
http://mirror.ctan.org/macros/latex/contrib/xcolor/xcolor.
pdf
15.8. Sources
Other features include: support of hsb color model, html style notation, special
row coloring support in tables and more.
The first specifies 20 percent blue, the second is a mixture of 20 percent blue
and 80 percent black and the last one is a mixture of (20*0.3) percent blue,
(80*0.3) percent black and 70 percent green.
\color{blue!20}
\color{blue!20!black}
\color{blue!20!black!30!green}
\usepackage[T1]{fontenc}
\usepackage[light,math]{iwona}
For example:
In order to select a font other than the default typeface in LaTeX environment,
it is necessary to include some commands in the preamble of the document.
16. Fonts
http://en.wikipedia.org/wiki/TrueType
16.0.1. Example
Important: This only works for fonts that are already prepared for use with
LaTeX. A Truetype1 font (ttf) or similar must first be converted and made
available to LaTeX. The external links section below has some useful resources.
Figure 52
% Iwona font
\renewcommand*\rmdefault{iwona}\normalfont\upshape
Lorem ipsum dolor sit amet, consectitur adipiscing elit.
% Palatino font
\renewcommand*\rmdefault{ppl}\normalfont\upshape
Lorem ipsum dolor sit amet, consectitur adipiscing elit.
5
6
2
3
4
http://en.wikipedia.org/wiki/XeTeX
http://en.wikipedia.org/wiki/LuaTeX
http://www.ctan.org/tex-archive/help/Catalogue/entries/
fontspec.html
http://en.wikipedia.org/wiki/Opentype
http://en.wikipedia.org/wiki/Unicode
\usepackage{fontspec}
\documentclass{article}
To use the fonts, simply load the fontspec package and set the font:
If you use the XeTeX2 or LuaTeX3 engine and the fontspec4 package, you'll
be able to use any font installed in the system effortlessly. XeTeX also allows
using OpenType5 technology of modern fonts like specifying alternate glyphs
and optical size variants. XeTeX also uses Unicode6 by default, which might
be helpful for font issues.
16.1. XeTeX
http://www.ctan.org/tex-archive/macros/generic/ifxetex/
\ifxetex
\usepackage{fontspec}
\usepackage{xunicode}
\defaultfontfeatures{Mapping=tex-text} % To support LaTeX quoting
\documentclass{article}
\usepackage{ifxetex}
Then compile the document with XeLateX or LuaLaTeX. Note that you can
only generate .pdf files, and that you need a sufficiently new TeX distribution
(TeX Live 2009 should work for XeTeX and Tex Live 2010 for LuaTeX). Also
you should NOT load the inputenc or fontenc package. To make support both
pdflatex and XeTeX you can use the \ifxetex macro from the ifxetex7
package.
\begin{document}
Lorem ipsum...
\end{document}
\setmainfont{Arial}
8
9
10
http://www.tug.dk/FontCatalogue/
http://www.cl.cam.ac.uk/~rf10/pstex/latexcommands.htm
http://www.ee.iitb.ac.in/~trivedi/LatexHelp/latexfont.htm
\begin{document}
Lorem ipsum...
\end{document}
style
\setromanfont{Hoefler Text}
\else
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\fi
14
15
12
13
11
http://www.tug.org/TUGboat/Articles/tb27-1/
tb86kroonenberg-fonts.pdf
http://c.caignaert.free.fr/Install-ttf-Font.pdf
http://www.tex.ac.uk/ctan/support/installfont/installfont.
pdf
http://latex.josef-kleber.de/download/installfont-tl
http://latex.josef-kleber.de/download/installfont-tl
[ftp://tug.ctan.org/tex-archive/fonts/utilities/fontinst/doc/talks/et99-fonttutorial.pdf Understanding the world of TEX fonts and mastering the basics
of fontinst]
Font installation the shallow way11 "For one-off projects, you can cut corners
with font installation (i.e. fontinst) and end up with a more manageable set
of files and a cleaner TEX installation. This article shows how and why"
http://xpt.sourceforge.net/techdocs/language/latex/
latex33-LaTeXAndTrueTypeFont
http://fachschaft.physik.uni-greifswald.de/~stitch/ttf.
html
http://william.famille-blum.org/software/latexttf/index.
html
http://www.radamir.com/tex/ttf-tex.htm
16
19
18
17
Technical Texts
Part III.
One of the greatest motivating forces for Donald Knuth when he began developing the original TeX system was to create something that allowed simple
construction of mathematical formulas, whilst looking professional when
printed. The fact that he succeeded was most probably why TeX (and later
on, LaTeX) became so popular within the scientific community. Typesetting
mathematics is one of LaTeX's greatest strengths. It is also a large topic due to
the existence of so much mathematical notation.
17. Mathematics
1
2
http://www.ams.org/publications/authors/tex/amslatex
http://www.tex.ac.uk/ctan/macros/latex/contrib/mh/
mathtools.pdf
\usepackage{mathtools}
or
\usepackage{amsmath}
package1 introduces several new commands that are more powerful and flexible than the ones provided by LaTeX. The mathtools package fixes some
amsmath quirks and adds some useful settings, symbols, and environments
to amsmath.2 To use either package, include:
text - text formulas are displayed in-line, that is, within the body of text
where it is declared. e.g., I can say that a + a = 2a within this sentence.
displayed - displayed formulas are separate from the main text.
LaTeX needs to know beforehand that the subsequent text does in fact contain
mathematical elements. This is because LaTeX typesets maths notation differently than normal text. Therefore, special environments have been declared
for this purpose. They can be distinguished into two categories depending on
how they are presented:
LaTeX
TeX
shortshorthand
hand
\begin{math}...\end{math} \(...\) $...$
\begin{displaymath}...\end{displaymath}
\[...\] $$...$$
or
\begin{equation*}...\end{equation*}
Environment
Text
Displayed
Type
1. Most spaces and line breaks do not have any significance, as all spaces
are either derived logically from the mathematical expressions, or have
to be specified with special commands such as \quad
2. Empty lines are not allowed. Only one paragraph per formula.
3. Each letter is considered to be the name of a variable and will be typeset
as such. If you want to typeset normal text within a formula (normal
upright font and normal spacing) then you have to enter the text using
dedicated commands.4
If you are typing text normally, you are said to be in text mode, while you are
typing within one of those mathematical environments, you are said to be in
math mode, that has some differences compared to the text mode:
Mathematics has lots and lots of symbols! If there is one aspect of maths that
is difficult in LaTeX it is trying to remember how to produce them. There are
of course a set of symbols that can be accessed directly from the keyboard:
17.2. Symbols
Fortunately, there's a tool that can greatly simplify the search for the command
for a specific symbol. Look for "Detexify" in the external links5 section below.
x X,
\[
\forall x \in X, \quad \exists y \leq \epsilon
\]
Greek letters are commonly used in mathematics, and they are very easy to type
in math mode. You just have to type the name of the letter after a backslash: if
the first letter is lowercase, you will get a lowercase Greek letter, if the first
letter is uppercase (and only the first letter), then you will get an uppercase
letter. Note that some uppercase Greek letters look like Latin ones, so they are
not provided by LaTeX (e.g. uppercase Alpha and Beta are just "A" and "B"
respectively). Lowercase epsilon, theta, phi, pi, rho, and sigma are provided in
two different versions. The alternate, or variant, version is created by adding
"var" before the name of the letter:
, A, , B, , , , , , ,
\[
\alpha, \Alpha, \beta, \Beta, \gamma, \Gamma,
\pi, \Pi, \phi, \varphi, \Phi
\]
http://en.wikipedia.org/wiki/Limit%20%28mathematics%29
For certain operators such as limits8 , the subscript is placed underneath the
operator:
\[
\cos (2\theta) = \cos^2 \theta - \sin^2 \theta
\]
17.4. Operators
http://en.wikipedia.org/wiki/Modular%20arithmetic
a mod b
\[
a \bmod b
\]
For the modular operator9 there are two commands: \bmod and \pmod:
limx exp(x) = 0
\[
\lim_{x \to \infty} \exp(-x) = 0
\]
10
11
http://en.wikipedia.org/wiki/argmax
Chapter 18.6 on page 628
Powers and indices are equivalent to superscripts and subscripts in normal text
mode. The caret () character is used to raise something, and the underscore
To use operators which are not pre-defined, such as argmax10 , see custom
operators11
x a (mod b)
\[
x \equiv a \pmod b
\]
\[
f(n) = n^5 + 4n^2 + 2 _{n=17}
\]
An underscore (_) can be used with a vertical bar (|) to denote evaluation using
subscript notation in mathematics:
\[
k_{n+1} = n^2 + k_n^2 - k_{n-1}
\]
(_) is for lowering. If more than one expression is raised or lowered, they
should be grouped using curly braces ({ and }).
12
13
n
k
http://en.wikipedia.org/wiki/Binomial%20coefficient
requires the amsmath package
n!
k!(nk)!
\[
\frac{n!}{k!(n-k)!} = \binom{n}{k}
\]
n
k
n!
k!(nk)!
\[
\frac{n!}{k!(n-k)!} = {n \choose k}
\]
14
Another way to write fractions is to use the \over command without the
amsmath package:
Note that when appearing inside another fraction, or in inline text ab , a fraction is noticeably smaller than in displayed mathematics. The \tfrac and
\dfrac commands14 force the use of the respective styles, \textstyle
and \displaystyle. Similarly, the \tbinom and \dbinom commands
typeset the binomial coefficient.
yz
1 1
x+y
\[
\frac{\frac{1}{x}+\frac{1}{y}<!---->}{y-z}
\]
n
k
15
\[
^3/_7
\]
n!
k!(nk)!
\[
{n! \over k!(n-k)!} = {n \choose k}
\]
If you use them throughout the document, usage of xfrac package is recommended. This package provides \sfrac command to create slanted fractions.
Usage:
3/
Figure 53
16
a1 +
a2 +
1
1
a3 + a4
x = a0 +
\begin{equation}
x = a_0 + \cfrac{1}{a_1
+ \cfrac{1}{a_2
+ \cfrac{1}{a_3 + a_4}<!---->}<!---->}
\end{equation}
\begin{equation}
\frac{
\begin{array}[b]{r}
\left( x_1 x_2 \right)\\
\times \left( x_1 x_2 \right)
\end{array}
}{
\left( y_1y_2y_3y_4 \right)
}
\end{equation}
\[
\sqrt{\frac{a}{b}}
\]
17.7. Roots
(y1 y2 y3 y4 )
(x1 x2 )
(x10 x20 )
Some people prefer writing the square root "closing" it over its content. This
method arguably makes it more clear what is in the scope of the root sign. This
habit is not normally used while writing with the computer, but if you still
want to change the output of the square root, LaTeX gives you this possibility.
Just add the following code in the preamble of your document:
n
1 + x + x2 + x3 + . . .
\[
\sqrt[n]{1+x+x^2+x^3+\ldots}
\]
pa
This TeX code first renames the \sqrt command as \oldsqrt, then redefines \sqrt in terms of the old one, adding something more. The new square
root can be seen in the picture on the left, compared to the old one on the right.
Unfortunately this code won't work if you want to use multiple roots: if you
try to write b a as \sqrt[b]{a} after you used the code above, you'll just
get a wrong output. In other words, you can redefine the square root this way
only if you are not going to use multiple roots in the whole document.
The \sum and \int commands insert the sum and integral symbols respectively, with limits specified using the caret () and underscore (_). The typical
notation for sums is:
Figure 55
The limits for the integrals follow the same notation. It's also important to
represent the integration variables with an upright d, which in math mode is
obtained through the \mathrm{} command, and with a small space separating
it from the integrand, which is attained with the \, command.
10
i=1 ti
\[
\sum_{i=1}^{10} t_i
\]
17
\sum
L
\bigoplus
S
\bigcup
F
\bigsqcup
R
\int
\prod
N
\bigotimes
T
\bigcap
W
\bigvee H
\oint
\coprod
J
\bigodot
U
\biguplus
V
\bigwedge
s
\iint17
There are many other "big" commands which operate in a similar manner:
R x
0 e dx
\[
\int_0^\infty e^{-x}\,\mathrm{d}x
\]
t
RRRR
\iiiint19
R
\idotsint20
18
19
20
21
The \substack command21 allows the use of \\ to write the limits over
multiple lines:
For more integral symbols, including those not included by default in the
Computer Modern font, try the esint package.
\iiint18
If you want the limits of an integral to be specified above and below the symbol
(like the sum), use the \limits command:
0< j<n
0<i<m P(i, j)
\[
\sum_{\substack{
0<i<m \\
0<j<n
}<!---->}
P(i,j)
\]
22
\usepackage[intlimits]{amsmath}
Rb
\[
\int\limits_a^b
\]
23
24
http://hdl.handle.net/2268/6219
Chapter 18.2.3 on page 609
The use of delimiters such as brackets soon becomes important when dealing
with anything but the most trivial equations. Without them, formulas can
become ambiguous. Also, special types of mathematical structures, such as
matrices, typically rely on delimiters to enclose them.
How to use braces in multi line equations is described in the Advanced Mathematics24
chapter.
For bigger integrals, you may use personal declarations, or the bigints
package 23 .
Very often mathematical features will differ in size, in which case the delimiters surrounding the expression should vary accordingly. This can be done
automatically using the \left and \right commands. Any of the previous
delimiters may be used in combination with these:
\[
( a ), [ b ], \{ c \}, d , \ e \,
\langle f \rangle, \lfloor g \rfloor,
\lceil h \rceil
\]
x
y3
n 2o
\[
\left\{\frac{x^2}{y^3}\right\}
\]
x
y3
2
\[
\left(\frac{x^2}{y^3}\right)
\]
In certain cases, the sizing produced by the \left and \right commands
may not be desirable, or you may simply want finer control over the delimiter
1
x3
3 0
\[
\left.\frac{x^3}{3}\right_0^1
\]
\[
( \big( \Big( \bigg( \Bigg(
\]
sizes. In this case, the \big, \Big, \bigg and \Bigg modifier commands
may be used:
25
\[
\begin{matrix}
a & b & c \\
d & e & f \\
g & h & i
\end{matrix}
\]
26
a b c
d e f
g h i
The alignment by default is c but it can be any column type valid in array
environment.
1 3
1 3
=
2 4
2 4
\[
\begin{matrix}
-1 & 3 \\
2 & -4
\end{matrix}
=
\begin{matrix*}[r]
-1 & 3 \\
2 & -4
\end{matrix*}
\]
27
28
29
30
()
[]
pmatrix*29
bmatrix30
pmatrix28
Surrounding delimiter
()
Environment name
centers columns by
default
allows to specify
alignment of columns
in optional parameter
centers columns by
default
Notes
However matrices are usually enclosed in delimiters of some kind, and while
it is possible to use the \left and \right commands27 , there are various
other predefined environments which automatically include delimiters:
31
32
33
34
{}
{}
||
Bmatrix32
Bmatrix*33
vmatrix34
bmatrix*31
Surrounding delimiter
[]
Environment name
allows to specify
alignment of columns
in optional parameter
centers columns by
default
allows to specify
alignment of columns
in optional parameter
centers columns by
default
Notes
kk
kk
Vmatrix36
Vmatrix*37
allows to specify
alignment of columns
in optional parameter
centers columns by
default
allows to specify
alignment of colums
in optional parameter
Notes
35
36
37
38
vmatrix*35
Surrounding delimiter
||
Environment name
a1,2
a2,2
..
.
&
&
&
&
a1,n
a2,n
..
.
\cdots
\cdots
\ddots
\cdots
..
.
&
&
&
&
a1,1
a2,1
Am,n = .
..
\[
A_{m,n} =
\begin{pmatrix}
a_{1,1} & a_{1,2}
a_{2,1} & a_{2,2}
\vdots & \vdots
a_{m,1} & a_{m,2}
\end{pmatrix}
\]
a_{1,n} \\
a_{2,n} \\
\vdots \\
a_{m,n}
columns and rows. These can be specified using the \cdots, \vdots and
\ddots respectively:
39
1 2
3 4
\[
\begin{array}{cc}
1 & 2 \\
\hline
3 & 4
\end{array}
\]
In some cases you may want to have finer control of the alignment within
each column, or want to insert lines between columns or rows. This can be
achieved using the array environment, which is essentially a math-mode
version of the tabular environment39 , which requires that the columns be
pre-specified:
\[
M = \begin{bmatrix}
\frac{5}{6} & \frac{1}{6} & 0
\\[0.3em]
\frac{5}{6} & 0
& \frac{1}{6} \\[0.3em]
0
& \frac{5}{6} & \frac{1}{6}
\end{bmatrix}
\]
To counteract this problem, add additional leading space with the optional
parameter to the \\ command:
You may see that the AMS matrix class of environments doesn't leave enough
space when used together with fractions resulting in output similar to this:
5 1
6
6 0
M = 65 0 16
0 56 61
5
6
1
6
1
6
1
6
\[
M = \bordermatrix{~ & x & y \cr
A & 1 & 0 \cr
B & 0 & 1 \cr}
\]
If you need "border" or "indexes" on your matrix, plain TeX provides the
macro \bordermatrix
M=
6
5
6
To insert a small matrix, and not increase leading in the line containing it, use
smallmatrix environment:
Figure 56
The math environment differs from the text environment in the representation of text. Here is an example of trying to represent text within the math
environment:
Figure 57
There are two noticeable problems: there are no spaces between words or
numbers, and the letters are italicized and more spaced out than normal. Both
issues are simply artifacts of the maths mode, in that it treats it as a mathematical expression: spaces are ignored (LaTeX spaces mathematics according to
its own rules), and each character is a separate element (so are not positioned
as closely as normal text).
\[
50 apples \times 100 apples = lots of apples^2
\]
40
\[
50 \text{apples} \times 100 \text{apples}
= \text{lots of apples}^2
\]
There are a number of ways that text can be added properly. The typical way
is to wrap the text with the \text{...} command 40 (a similar command
is \mbox{...}, though this causes problems with subscripts, and has a less
descriptive name). Let's see what happens when the above equation code is
adapted:
\[
50 \text{ apples} \times 100 \text{ apples}
= \text{lots of apples}^2
\]
The text looks better. However, there are no gaps between the numbers and the
words. Unfortunately, you are required to explicitly add these. There are many
ways to add spaces between maths elements, but for the sake of simplicity
you may literally add the space character in the affected \text(s) itself (just
before the text.)
41
\[
50 \textrm{ apples} \times 100
\textbf{ apples} = \textit{lots of apples}^2
\]
Using the \text is fine and gets the basic result. Yet, there is an alternative
that offers a little more flexibility. You may recall the introduction of font
formatting commands41 , such as \textrm, \textit, \textbf, etc. These
commands format the argument accordingly, e.g., \textbf{bold text}
gives bold text. These commands are equally valid within a maths environment
to include text. The added benefit here is that you can have better control over
the font formatting, rather than the standard text achieved with \text.
\mathit{...}ABCDEFabcdef123456
\mathbf{...}ABCDEFabcdef123456
\mathrm{...}ABCDEFabcdef123456
LaTeX
Sample
command
\mathnormal{...}
ABCDEFabcde f 123456
vectors
most mathematical
notation
units of measurement, one word
functions
Common use
Description
42
43
Sans-serif42
Monospace (fixedwidth) font43
Description
Common use
http://en.wikipedia.org/wiki/sans-serif
http://en.wikipedia.org/wiki/Monospace%20font
LaTeX
Sample
command
\mathsf{...}ABCDEFabcdef123456
\mathtt{...}ABCDEFabcdef123456
44
45
46
47
Common use
often used for
sheaves/schemes
and categories, used
to denote cryptological44 concepts like
an alphabet of definition (A ), message
space (M ), ciphertext space (C ) and
key space45 (K );
Kleene's O 46 ; naming convention in
description logic47
Description
Calligraphy (uppercase only)
http://en.wikipedia.org/wiki/Cryptography
http://en.wikipedia.org/wiki/key%20space
http://en.wikipedia.org/wiki/Kleene%27s%20O
http://en.wikipedia.org/wiki/Description%20logic%23Naming%
20Convention
LaTeX
Sample
command
\mathcal{...}
A BC DE F abcde{3456
Blackboard bold53
52
\mathbb{...}ABCDEFaf123456
51
52
53
Almost canonical
font for Lie algebras,
with superscript
used to denote New
Testament papyri50 ,
ideals51 in ring theory
Used to denote
special sets (e.g. real
numbers)
Fraktur49
48
49
50
Common use
Description
LaTeX
Sample
command
48
\mathfrak{...}
ABCDEFabcdef123456
Common use
An alternative font
for categories and
sheaves.
Description
Script55
54
55
56
57
To bold lowercase Greek or other symbols use the \boldsymbol command56 ; this will only work if there exists a bold version of the symbol in the
current font. As a last resort there is the \pmb command57 (poor mans bold):
this prints multiple versions of the character slightly offset against each other
The maths formatting commands can be wrapped around the entire equation,
and not just on the textual elements: they only format letters, numbers, and
uppercase Greek, and the rest of the maths syntax is ignored.
LaTeX
Sample
command
\mathscr{...}54
58
So what to do when you run out of symbols and fonts? Well the next step is to
use accents:
17.12.1. Accents
To change the size of the fonts in math mode, see Changing font size58 .
= (1 , 2 , . . . , n )
\[
\boldsymbol{\beta} = (\beta_1,\beta_2,\ldots,\beta_n)
\]
59
60
a'
a0
\hat{a}
a
\grave{a}
a`
\dot{a}
a
\not{a}
6a
\overrightarrow{AB}
AB
a'''
a000
\overline{aaa}aaa
\breve{a}
a
59
\dddot{a}
d
\widehat{AAA} AAA
\tilde{a}
a
a''
a00
\bar{a}
a
\acute{a}
a
\ddot{a}
a
\mathring{a}
\overleftarrow{AB}
AB
a''''
a0000
\check{a}
a
\vec{a}
~a
\ddddot{a}60
\widetilde{AAA}
Latex deals with the + and signs in two possible ways. The most common is
as a binary operator. When two maths elements appear either side of the sign,
it is assumed to be a binary operator, and as such, allocates some space either
side of the sign. The alternative way is a sign designation. This is when you
state whether a mathematical quantity is either positive or negative. This is
common for the latter, as in maths, such elements are assumed to be positive
unless a is prefixed to it. In this instance, you want the sign to appear close
to the appropriate element to show their association. If you put a + or a with
nothing before it but you want it to be handled like a binary operator you can
add an invisible character before the operator using {}. This can be useful if
you are writing multiple-line formulas, and a new line could start with a = or a
+, for example, then you can fix some strange alignments adding the invisible
character where necessary.
LaTeX is obviously pretty good at typesetting mathit was one of the chief
aims of the core Tex system that LaTeX extends. However, it can't always
be relied upon to accurately interpret formulas in the way you did. It has
to make certain assumptions when there are ambiguous expressions. The
result tends to be slightly incorrect horizontal spacing. In these events, the
output is still satisfactory, yet any perfectionists will no doubt wish to fine-tune
\[
\pm
\]
\[
f(n) = \left\{
\begin{array}{l l}
n/2 & \quad \text{if $n$ is even}\\
-(n+1)/2 & \quad \text{if $n$ is odd}\\
\end{array} \right.
\]
There are other occasions where LaTeX has done its job correctly, but you just
want to add some space, maybe to add a comment of some kind. For example,
in the following equation, it is preferable to ensure there is a decent amount of
space between the math and the text.
their formulas to ensure spacing is correct. These are generally very subtle
adjustments.
if n is even
if n is odd
61
A \quad is a space equal to the current font size. So, if you are using an 11pt
font, then the space provided by \quad will also be 11pt (horizontally, of
course.) The \qquad gives twice that amount. As you can see from the code
LaTeX has defined two commands that can be used anywhere in documents
(not just maths) to insert some horizontal space. They are \quad and \qquad
(Note that this particular example can be expressed in more elegant code by the
cases construct provided by the amsmath package described in Advanced
Mathematics61 chapter.)
This code produces errors with Miktex 2.9 and does not yield the results seen
on the right. Use \textrm instead of just \text.
(
n/2
f (n) =
(n + 1)/2
y dx
ydx
\[ \int y \mathrm{d}x \]
OK, so back to the fine tuning as mentioned at the beginning of the document.
A good example would be displaying the simple equation for the indefinite
integral of y with respect to x:
from the above example, \quads were used to add some separation between
the maths and the text.
Description
small space
medium space
large space
negative space
Size
3/18 of a quad
4/18 of a quad
5/18 of a quad
-3/18 of a quad
NB you can use more than one command in a sequence to achieve a greater
space if necessary.
Command
\,
\:
\;
\!
However, this doesn't give the correct result. LaTeX doesn't respect the whitespace left in the code to signify that the y and the dx are independent entities.
Instead, it lumps them altogether. A \quad would clearly be overkill in this
situationwhat is needed are some small spaces to be utilized in this type of
instance, and that's what LaTeX provides:
y dx
ydx
ydx
The negative space may seem like an odd thing to use, however, it wouldn't be
there if it didn't have some use! Take the following example:
n!
r!(nr)!
n
=
r
\[
\left(
\begin{array}{c}
n \\
r
\end{array}
\right) = \frac{n!}{r!(n-r)!}
\]
n!
r!(nr)!
In any case, adding some spaces manually should be avoided whenever possible: it makes the source code more complex and it's against the basic principles
of a What You See is What You Mean approach. The best thing to do is to
define some commands using all the spaces you want and then, when you use
your command, you don't have to add any other space. Later, if you change
your mind about the length of the horizontal space, you can easily change it
n
=
r
\[
\left(\!
\begin{array}{c}
n \\
r
\end{array}
\!\right) = \frac{n!}{r!(n-r)!}
\]
\newcommand{\dd}{\; \mathrm{d}}
modifying only the command you defined before. Let us use an example: you
want the d of a dx in an integral to be in roman font and a small space away
from the rest. If you want to type an integral like \int x \; \mathrm{d}
x, you can define a command like this:
62
http://en.wikipedia.org/wiki/American%20Mathematical%
20Society
\usepackage{amsmath}
The AMS (American Mathematical Society62 ) mathematics package is a powerful package that creates a higher layer of abstraction over mathematical
LaTeX language; if you use it it will make your life easier. Some commands
amsmath introduces will make other plain LaTeX commands obsolete: in
order to keep consistency in the final output you'd better use amsmath commands whenever possible. If you do so, you will get an elegant output without
worrying about alignment and other details, keeping your source code readable.
If you want to use it, you have to add this in the preamble:
Code
Output
Comment
LaTeX gives you several commands to insert dots in your formulae. This can
be particularly useful if you have to type big matrices omitting elements. First
of all, here are the main dots-related commands LaTeX provides:
17.15.2. Dots
Output
...
...
Code
\dots
\ldots
Comment
generic dots, to be
used in text (outside
formulae as well). It
automatically manages whitespaces before and after itself
according to the context, it's a higher level
command.
the output is similar to the previous
one, but there is no
automatic whitespace
management; it works
at a lower level.
\ddots
\iddots
\vdots
Code
\cdots
..
.
..
.
Output
diagonal dots
inverse diagonal dots
(requires the mathdots
package)
vertical dots
Comment
These dots are centered relative to the
height of a letter.
There is also the binary multiplication
operator, \cdot,
mentioned below.
Output
......
Comment
to be used in matrices, it creates a row
of dots spanning n
columns.
Code
A_1,A_2,\dotsc,
Figure 58
Output
Comment
for "dots with commas"
Instead of using \ldots and \cdots, you should use the semantically
oriented commands. It makes it possible to adapt your document to different
conventions on the fly, in case (for example) you have to submit it to a publisher
who insists on following house tradition in this respect. The default treatment
for the various kinds follows American Mathematical Society conventions.
Code
\hdotsfor{n}
Code
A_1+\dotsb+A_N
Figure 60
Figure 59
Output
for "multiplication
dots"
Comment
for "dots with binary
operators/relations"
A_1\dotso A_N
Code
\int_ab
\dotsi
Figure 62
Figure 61
Output
Comment
for "dots with integrals"
Binary Operations
SymScript
bol
\pm
\mp
Relation Symbols
Sym- Script
bol
\leq
\succ
'
\simeq
k
\parallel
\subseteq
6=
\neq
_
\frown
`
\vdash
\cap
\cup
Script
\geq
\sim
\mid
\subset
\supseteq
\smile
\in
\dashv
Script
Symbol
Symbol
Symbol
=
v
3
<
Symbol
4
\models
\preceq
\gg
\approx
\sqsubset
\sqsupsete
\notin
>
Script
Symbol
\diamond
\bigtriangleup
Script
Symbol
\equiv
|=
\perp
\ll
\supset
\cong
<
\sqsubseteq w
\ni
/
<
>
Script
All the pre-defined mathematical symbols from the \TeX\ package are listed
below. More symbols are available from extra packages.
\ni
\land
>
5
/
.
\neg
\in
\notin
\uplus
\sqcap
\sqcup
\vee
\wedge
\cdot
]
u
t
Symbol
\times
\div
\ast
\star
\dagger
\ddagger
\exists
@
\nexists
\forall
Script
\rightarrow
\implies
\Rightarrow
(preferred for
implication)
\leftrightarro
\iff
\Leftrightarro
(preferred for
equivalence
(iff))
\top
\bot
\bigtriangledown
\triangleleft
\triangleright
\bigcirc
\bullet
\
\wr
\lor
and
and
B and
Greek Letters
Symbol
A and
Symbol
k
}
Script
\Alpha and
\alpha
\Beta and
\beta
\Gamma and
\gamma
\Delta and
\delta
Delimiters
SymScript
bol
|
|
{
\{
\uparrow
\downarrow
\|
\}
\Uparrow
\Downarrow
Script
\Omicron
and \omicron
\Pi, \pi and
\varpi
Script
\Nu and \nu
Symbol
\
i
e
c
\emptyset
and
\varnothing
/
\langle
\lceil
\lfloor
Script
, and
and o
and
Symbol
N and
Symbol
/
h
d
b
0/ and
Other symbols
Sym- Script
bol
\partial
M and
and
K and
I and
, and
Symbol
\imath
Script
\Eta and
\eta
\Theta,
\theta and
\vartheta
\Iota and
\iota
\Kappa and
\kappa
\Lambda and
\lambda
\Mu and \mu
H and
Z and
\Epsilon,
\epsilon and
\varepsilon
\Zeta and
\zeta
E , and
Symbol
\Re
Script
and
and
X and
, , and
and
T and
, and
P , and
Symbol
\nabla
Script
\Phi, \phi
and \varphi
\Chi and
\chi
\Psi and
\psi
\Omega and
\omega
\Sigma,
\sigma and
\varsigma
\Tau and
\tau
\Upsilon
and \upsilon
\Rho, \rho
and \varrho
\eth
\hbar
`
Symbol
arcsin
arccos
arctan
\arcsin
\arccos
\arctan
\arccot
Script
\jmath
\ell
Symbol
sinh
cosh
tanh
coth
\Im
\wp
\sinh
\cosh
\tanh
\coth
Script
Symbol
sec
csc
\Box
\infty
As you begin to see, typesetting math can be tricky at times. However, because
Latex provides so much control, you can get professional quality mathematics
typesetting with relatively little effort (once you've had a bit of practice, of
course!). It would be possible to keep going and going with math topics
17.17. Summary
Trigonometric Functions
SymScript
bol
sin
\sin
cos
\cos
tan
\tan
cot
\cot
63
http://en.meta.org/wiki/Help%3ADisplaying%20a%20formula
17.18. Notes
because it seems potentially limitless. However, with this tutorial, you should
be able to get along sufficiently.
68
65
66
67
64
http://www.artofproblemsolving.com/Wiki/index.php/LaTeX:
Symbols
http://detexify.kirelabs.org
http://www.thestudentroom.co.uk/wiki/LaTeX
http://www.ctan.org/tex-archive/info/symbols/
comprehensive/symbols-letter.pdf
http://pl.wikibooks.org/wiki/LaTeX%2FMatematyka
pl:LaTeX/Matematyka68
http://en.wikipedia.org/wiki/American%20Mathematical%
20Society
This page outlines some more advanced uses of mathematics markup using
LaTeX. In particular it makes heavy use of the AMS-LaTeX packages supplied
by the American Mathematical Society1 .
You can also use the \label and \ref (or \eqref from the amsmath
package) commands to label and reference equations, respectively. For equation number 1, \ref results in 1 and \eqref results in (1) :
\begin{equation}
f(x)=(x+a)(x+b)
\end{equation}
(1)
52 5 = 20
\begin{equation} \label{eq:someequation}
5^2 - 5 = 20
\end{equation}
(1)
a = bq + r
where \eqref{eq:erl} is true if $a$ and $b$ are integers with $b \neq
c$.
\begin{equation} \label{eq:erl}
a = bq + r
\end{equation}
\numberwithin{equation}{subsection}
\numberwithin{equation}{section}
To have the enumeration follow from your section or subsection heading, you
must use the amsmath package or use AMS class documents. Then enter
q
2
1 cv2 ww(1.1.1)
If the style you follow requires putting dots after ordinals (as it is required at least in Polish typography) the
\numberwithin{equation}{subsection} command in preamble
will result in the equation number in the above example to be rendered in this
way: (1.1..1).
L0 = L
\subsection{A subsection}
\begin{equation}
L = {L}{\sqrt{1-\frac{v^2}{c^2}<!-- -->}<!-- -->}
\end{equation}
\end{document}
\documentclass[12pt]{article}
\usepackage{amsmath}
\numberwithin{equation}{subsection}
\begin{document}
\section{First Section}
Note: Though it may look like the \renewcommand works by itself, it won't
reset the equation number with each new section. It must be used together
with manual equation number resetting after each new section beginning or
with the much cleaner \numberwithin.
\renewcommand{\theequation}{\thesubsection\arabic{equation}}
\renewcommand{\theequation}{\thesection\arabic{equation}}
(1.1b)
E 0 = B 4 j,
Maxwell0 s equations:
B0 = E,
(1.1a)
\begin{subequations}
Maxwells equations:
\begin{align}
B&=-\nabla \times E,\\
E&=\nabla \times B - 4\pi j,
\end{align}
\end{subequations}
1.1b the case presented). It is possible to add both labels in case both types of
references are needed.
http://en.wikipedia.org/wiki/L%27H%F4pital%27s_rule
A = B; A = B
\[
A \overset{!}{=} B; A \stackrel{!}{=} B
\]
obtained with \stackrel. This can be particularly useful for creating new
binary relations:
1
2
\[
\newcom
mand{\Heq}[1]{\overset{\left[#1\right]}{\underset{\mathrm{H}}{=}}}
It's convenient to define a new operator that will set the equal sign with H and
provided fraction:
0
x 1 [ 0 ]
x
limx0 e 2x
= limx0 e2 =
\[
\lim_{x\to 0}{\frac{e^x-1}{2x}<!-- -->}
\overset{\left[\frac{0}{0}\right]}{\underset{\mathrm{H}<!-- -->}{=}<!
\lim_{x\to 0}{\frac{e^x}{2}<!-- -->}={\frac{1}{2}<!-- -->}
\]
real
imaginary
z
}|
{
z = |{z}
x + iy
|{z}
complex number
\[
z = \overbrace{
\underbrace{x}_\text{real} +
\underbrace{iy}_\text{imaginary}
}^\text{complex number}
\]
Figure 63
\[
y = a + f(\underbrace{b x}_{
\ge 0 \text{ by assumption}<!-- -->})
= a + f(\underbrace{b x}_{
\mathclap{\ge 0 \text{ by assumption}<!-- -->}<!-- -->})
\]
Sometimes the comments are longer than the formula being commented
on, which can cause spacing problems. These can be removed using the
\mathclap command5 :
Figure 64
\[
z = \overbracket[3pt]{
\underbracket{x}_{\text{real}<!---->} +
\underbracket[0.5pt][7pt]{iy}_{\text{imaginary}<!---->}
}^{\text{complex number}<!---->}
\]
or that way
A B C
this way
\[
A \xleftarrow{\text{this way}<!-- -->} B
\xrightarrow[\text{or that way}]{} C
\]
The optional arguments set the rule thickness and bracket height respectively:
\[
a
%
A
%
B
%
C
%
D
%
E
%
F
\]
\xmapsto[under]{over} G\\
\xhookrightarrow[under]{over} F\\
\xhookleftarrow[under]{over} E\\
\xLeftrightarrow[under]{over} D\\
\xRightarrow[under]{over} C\\
\xLeftarrow[under]{over} B\\
\xleftrightarrow[under]{over} b\\
Figure 65
\[
H
%
I
%
J
%
K
%
L
%
M
\]
\xleftrightharpoons[under]{over} N
\xrightleftharpoons[under]{over} M\\
\xleftharpoonup[under]{over} L\\
\xleftharpoondown[under]{over} K\\
\xrightharpoonup[under]{over} J\\
\xrightharpoondown[under]{over} I\\
Figure 66
= x2 + (a + b)x + ab
f (x) = (x + a)(x + b)
\begin{align*}
f(x) &= (x+a)(x+b) \\
&= x^2 + (a+b)x + ab
\end{align*}
The align and align* environments8 are used for arranging equations of
multiple lines. As with matrices and tables, \\ specifies a line break, and & is
used to indicate the point at which the lines should be aligned.
+ 10x + 12
\begin{align}
f(x) &= x^4 + 7x^3 + 2x^2 \nonumber \\
&\qquad {} + 10x + 12
\end{align}
The align is similar, but automatically numbers each line like the
equation environment. Individual lines may be referred to by placing
a \label{...} before the linebreak. The \nonumber or \notag command can be used to suppress the number for a given line:
ab cd e f
gh i j
\begin{align*}
a & b & c & d & e & f & g & h & i & j
\end{align*}
Notice that we've added some indenting on the second line. Also, we need to
insert the double braces {} before the + sign because otherwise latex won't
create the correct spacing after the + sign. The reason for this is that without
the braces, latex interprets the + sign as a unary operator, instead of the binary
operator that it really is.
(4)
In this construction, the sizes of the left and right braces are not automatically
equal, in spite of the use of \left\{ and \right\}. This is because each
+ 10x + 12}
f (x) = x4 + 7x3 + 2x2
\begin{align}
f(x) &= \pi \left\{ x^4 + 7x^3 + 2x^2 \right.\nonumber\\
&\qquad \left. {} + 10x + 12 \right\}
\end{align}
Additional &'s on a single line will specify multiple "equation columns", each
of which is aligned. If you want a brace to continue across a new line, do the
following:
A=
XXX
YYY . . .
Z
(5)
\begin{align}
A &=
\left(\int_t XXX
\right.\nonumber\\
&\qquad \left.\vphantom{\int_t} YYY \dots \right)
\end{align}
Or you can replicate the height of the taller equation in the other using the
\vphantom command:
if x 0
if x < 0
(
exp x
u(x) =
1
\[
u(x) =
\begin{cases}
\exp{x} & \text{if } x \geq 0 \\
1
& \text{if } x < 0
\end{cases}
\]
10
To force display style for equations inside this construct, use dcases environment10 :
Just like before, you don't have to take care of definition or alignment of
columns, LaTeX will do it for you.
11
Often the second column consists mostly of normal text, to set it in normal
roman font of the document use dcases* environment11 :
Z
x dx
a=
b2
\[
a =
\begin{dcases}
\int x\, dx\\
b^2
\end{dcases}
\]
when x is even
when x is odd
Environment name
Description
Notes
Although align and align* are the most useful, there are several other
environments which may also be of interest:
(
x
f (x) =
x
\[
f(x) = \begin{dcases*}
x & when $x$ is even\\
-x & when $x$ is odd
\end{dcases*}
\]
gather and
gather*13
multline and
multline*12
12
13
Description
Similar to align
and align*
Environment name
eqnarray and
eqnarray*
Notes
Not recommended
since spacing is inconsistent
Equation number
aligned vertically
with first line and not
centered as with other
other environments.
Description
Similar to align,
but left aligns first
equation column, and
right aligns last column
Takes an argument
specifying number
of columns. Allows
to control explicitly
the horizontal space
between equations
You can calculate the
number of columns by
counting & characters
in a line, adding 1 and
dividing the result by
2
Notes
14
15
There are also few environments that don't form a math environment by themselves and can be used as building blocks for more elaborate structures:
alignat and
alignat*15
Environment name
flalign and
flalign*14
16
17
18
aligned18
split17
Description
Allows to gather few equations
to be set under each other and assigned a single equation number
Similar to align*, but used inside another displayed mathematics environment
Similar to align, to be used inside another mathematics environment.
Description
Similar to alignat, and just as
it, takes an additional argument
specifying number of columns of
equations to set.
19
\begin{equation}
\left.\begin{aligned}
B&=-\partial \times E,\\
E&=\partial \times B - 4\pi j,
\end{aligned}
\right\}
\qquad \text{Maxwells equations}
\end{equation}
For example:
)
Maxwell0 s equations
(1.1)
10 =
x+y
x
1 = x + y
20 =
2 =
x
y
xy
(2)
(1)
\begin{alignat}{2}
\sigma_1 &= x + y &\quad \sigma_2 &= \frac{x}{y} \\
\sigma_1 &= \frac{\partial x + y}{\partial x} & \sigma_2
&= \frac{\partial \frac{x}{y}<!---->}{\partial x}
\end{alignat}
E = B 4 j,
B0 = E,
\documentclass[a4paper,fleqn]{report}
\usepackage{amsmath}
\setlength{\mathindent}{1cm}
\begin{document}
\noindent Eulers formula is given below:
\begin{equation*}
e^{ix} = \cos{x} + i \sin{x}
\end{equation*}
\noindent This is a very important formula.
\end{document}
In order to indent an equation, you can set fleqn in the document class and
then specify a certain value for \mathindent variable:
Figure 67
LaTeX will insert a page break into a long equation if it has additional text
added using \intertext{} without any additional commands though.
\begin{align*}
&\vdots\\
&=12+7 \int_0^2
\left(
-\frac{1}{4}\left(e^{-4t_1}+e^{4t_1-8}\right)
\right)\,dt_1\displaybreak[3]\\
&= 12-\frac{7}{4}\int_0^2 e^{-4t_1}+e^{4t_1-8}\,dt_1\\
&\vdots %
\end{align*}
Figure 68
If you want the entire line or several equations to be boxed, use a minipage
inside an \fbox{}:
Figure 69
\begin{equation}
\boxed{x^2+y^2 = z^2}
\end{equation}
For a single equation or alignment building block, with the tag outside the box,
use \boxed{}:
There is also the mathtools \Aboxed{} which is able to box across alignment
marks
Figure 70
\fbox{
\addtolength{\linewidth}{-2\fboxsep}%
\addtolength{\linewidth}{-2\fboxrule}%
\begin{minipage}{\linewidth}
\begin{equation}
x^2+y^2=z^2
\end{equation}
\end{minipage}
}
Figure 71
\begin{align*}
\Aboxed{ f(x) & = \int h(x)\, dx} \\
& = g(x)
\end{align*}
20
21
22
\[
\operatorname{arg\,max}_a f(a)
= \operatorname*{arg\,max}_b f(b)
\]
23
\[
\argmax_c f(c)
\]
\DeclareMathOperator*{\argmax}{arg\,max}
\begin{equation}
\lim_{a\to \infty} \tfrac{1}{a}
\end{equation}
There are defaults for placement of subscripts and superscripts. For example,
limits for the lim operator are usually placed below the symbol, like this:
18.7.1. Limits
A lim in running text (inside $...$) will have its limits placed on the side,
so that additional leading won't be required. To override this behavior use
\limits command.
lima a1
\begin{equation}
\lim\nolimits_{a\to \infty} \tfrac{1}{a}
\end{equation}
lima a1
Rb 2
x
\begin{equation}
\int_a^b x^2
\end{equation}
Similarly one can put subscripts under a symbol that usually have them on the
side:
Rb 2
x
\begin{equation}
\int\limits_a^b x^2
\end{equation}
0 Cn
\begin{equation}
\sum\nolimits C_n
\end{equation}
While you can place symbols in sub- or superscript in summation style symbols
with the above introduced \nolimits:
\begin{equation}
\sideset{}{}\sum_{n=1}C_n
\end{equation}
To add both prime and a limit to a symbol, one have to use \sideset
command:
0n=1 Cn
\begin{equation}
\sum_{n=1}\nolimits C_n
\end{equation}
If you wish to place them on the corners of an arbitrary symbol, you should
use \fourIdx from the fouridx package.
b
a
\begin{equation}
\sideset{_a^b}{_c^d}\sum
\end{equation}
It's very flexible, for example, to put letters in each corner of the symbol use
this command:
n=1 Cn
1in
1 jm
Mi, j
\begin{equation}
\prod_{\substack{
1\le i \le n\\
1\le j \le m}<!---->}
M_{i,j}
\end{equation}
\begin{minipage}{3in}
\begin{align*}
\intertext{If}
A &= \sigma_1+\sigma_2\\
B &= \rho_1+\rho_2\\
\intertext{then}
C(x) &= e^{Ax^2+\pi}+B
\end{align*}
\end{minipage}
Note that usage of this command doesn't change alignment, as would stopping
and restarting the align environment.
Figure 72
Size command
\displaystyle
\textstyle
\scriptstyle
\scriptscriptstyle
Description
Size for equations in display mode
Size for equations in text mode
Size for first sub/superscripts
Size for subsequent sub/superscripts
Probably a rare event, but there may be a time when you would prefer to have
some control of the size. For example, using text-mode maths, by default
a simple fraction will look like this: ab where as you may prefer to have it
displayed larger, like when in display mode, but still keeping it in-line, like
a
this: .
b
A simple approach is to utilize the predefined sizes for maths elements:
1
1
a2 + a +a
3 4
24
25
As you can see, as the fractions continue, they get smaller (although they will
not get any smaller as in this example, they have reached the \scriptstyle
1+
x = a0 + a
\begin{equation}
x = a_0 + \frac{1}{a_1 + \frac{1}{a_2 + \frac{1}{a_3 + a_4}<!---->}<
\end{equation}
a1 +
a2 +
1
a3 + a4
Another approach is to use the \DeclareMathSizes command to select your preferred sizes. You can only define sizes for \displaystyle,
x = a0 +
\begin{equation}
x = a_0 + \frac{1}{\displaystyle a_1
+ \frac{1}{\displaystyle a_2
+ \frac{1}{\displaystyle a_3 + a_4}<!---->}<!---->}
\end{equation}
limit). If you wanted to keep the size consistent, you could declare each fraction
to use the display style instead, e.g.:
Put
\DeclareMathSizes{10}{18}{12}{8}
\DeclareMathSizes{11}{19}{13}{9}
\DeclareMathSizes{12}{20}{14}{10}
NB the changes only take place if the value in the first argument matches the
current document text size. It is therefore common to see a set of declarations
in the preamble, in the event of the main font being changed. E.g.,
\textstyle, etc. One potential downside is that this command sets the
global maths sizes, as it can only be used in the document preamble.
Short skips are used if the preceding line ends, horizontally, before the formula.
These parameters must be set after \begin{document}.
\abovedisplayskip=12pt
\belowdisplayskip=12pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=7pt
There are four parameters which control the vertical whitespace around displayed math:
\everymath{\displaystyle}
18.12. Notes
\label{marker}
Another good point of LaTeX is that you can easily reference almost anything
that is numbered (sections, figures, formulas), and LaTeX will take care of
numbering, updating it whenever necessary. The commands to be used do not
depend on what you are referencing, and they are:
19.1. Introduction
LaTeX will calculate the right numbering for the objects in the document; the
marker you have used to label the object will not be shown anywhere in the
document. Then LaTeX will replace the string "\ref{marker}" with the
right number that was assigned to the object. If you reference a marker that
does not exist, the compilation of the document will be successful but LaTeX
will return a warning:
It will print the number of the page where the object is.
\pageref{marker}
you can reference the object you have marked before. This prints the number
that was assigned to the object.
\ref{marker}
you give the object you want to reference a marker, you can see it like a
name.
Rerun
As you may have noticed reading how it works, it is a two-step process: first the
compiler has to store the labels with the right number to be used for referencing,
then it has to replace the \ref with the right number. That is why, when you
use references, you have to compile your document twice to see the proper
output. If you compile it only once, LaTeX will use the older information it
collected in previous compilations (that might be outdated), but the compiler
will inform you printing on the screen at the end of the compilation:
chap:
sec:
fig:
tab:
eq:
lst:
chapter
section
figure
table
equation
code listing
Since you can use exactly the same commands to reference almost anything,
you might get a bit confused after you have introduced a lot of references. It
is common practice among LaTeX users to add a few letters to the label to
describe what you are referencing. Here is an example:
Using the command \pageref{} you can help the reader to find the referenced object by providing also the page number where it can be found. You
could write something like:
If you want to be able to see the markers you are using in the output document
as well, you can use the showkeys package; this can be very useful while
developing your document. For more information see the Packages1 section.
Another suggestion: try to avoid using numbers within labels. You are better
off describing what the object is about. This way, if you change the order of
the objects, you will not have to rename all your labels and their references.
Figure
I greeted in section~\ref{sec:greetings}.
\section{Referencing}
Hello!
\section{Greetings}
\label{sec:greetings}
19.2.1. Sections
73
Here are some practical examples, but you will notice that they are all the same
because they all use the same commands.
19.2. Examples
http://en.wikipedia.org/wiki/non-breaking%20space
19.2.2. Pictures
You could place the label anywhere in the section; however, in order to avoid
confusion, it is better to place it immediately after the beginning of the section.
Note how the marker starts with sec:, as suggested before. The label is then
referenced in a different section. The tilde () indicates a non-breaking space2 .
Figure 74
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{gull}
\caption{Close-up of a gull}
\label{gull}
\end{figure}
Figure~\ref{gull} shows a photograph of a gull.
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{gull}
\caption{Close-up of a gull} \label{fig:gull}
\end{figure}
The command \label must appear after (or inside) \caption. Otherwise,
it will pick up the current section or list number instead of what you intended.
See the Floats, Figures and Captions3 section for more about the figure and
related environments.
\caption{Close-up of a gull\label{gull}}
http://www.ctan.org/tex-archive/macros/latex/contrib/
hyperref/README
19.2.3. Formulas
\usepackage[hypcap]{caption}
In case you use the package hyperref to create a PDF, the links to tables or
figures will point to the caption of the table or figure, which is always below
the table or figure itself4 . Therefore the table or figure will not be visible, if
it is above the pointer and one has to scroll up in order to see it. If you want
the link point to the top of the image you can give the option hypcap to the
caption package:
Figure 75
As you can see, the label is placed soon after the beginning of the math mode.
In order to reference a formula, you have to use an environment that adds
numbers. Most of the times you will be using the equation environment;
\begin{equation}
x_2 = \frac{5 - \sqrt{25 - 4 \times 6}}{2} = 2
\end{equation}
\begin{equation}
x_1 = \frac{5 + \sqrt{25 - 4 \times 6}}{2} = 3
\end{equation}
\begin{equation} \label{eq:solve}
x^2 - 5 x + 6 = 0
\end{equation}
The \tag{label} command allows replacing the labelnumber by the arbitrary text string label.
tag
eqref
that is the best choice for one-line formulas, whether you are using amsmath
or not. Note also the eq: prefix in the label.
The cases package adds the \numcases and the \subnumcases commands, which produce multi-case equations with a separate equation number
and a separate equation number plus a letter, respectively, for each case.
cases
numberwithin
This command has to be used very carefully. It outputs more than one word, so
it may happen its output falls on two different pages. In this case, the algorithm
can get confused and cause a loop. Let's make an example. You label an object
on page 23 and the \vref output happens to stay between page 23 and 24. If
it were on page 23, it would print like the basic ref, if it were on page 24, it
would print "on the previous page", but it is on both, and this may cause some
strange errors at compiling time that are very hard to be fixed. You could think
that this happens very rarely; unfortunately, if you write a long document it
5
6
http://en.wikibooks.org/wiki/LaTeX%2FPackages%2FHyperref
http://www.tug.org/applications/hyperref/manual.html#
TBL-23
If you would like a hyperlink reference, but do not want the predefined
text that \autoref{} provides, you can do this with a command such
as \hyperref[sec:intro]{Appendix\ref*{sec:intro}}.
Note that you can disable the creation of hyperlinks in hyperref, and
just use these commands for automatic text.
This renaming trick can, of course, be used for other purposes as well.
\def\sectionautorefname{Section}
\Autoref
command that produces an unlinked prefix (useful if the label is on the same
page as the reference), no alternative
\autoref*
Input:
Keep in mind that the \label must be placed inside an environment with a
counter, such as a table or a figure. Otherwise, not only the number will refer
to the current section, as mentioned above7 , but the name will refer to the
previous environment with a counter. For example, if you put a label after
closing a figure, the label will still say "figure n", on which n is the current
section number.
When you define a \label outside a figure, a table, or other floating objects, the label points to the current section. In some case, this behavior
is not what you'd like and you'd prefer the generated link to point to the
line where the \label is defined. This can be achieved with the command
\phantomsection as in this example:
Output:
\section{MyFirstSection} \label{sec:marker}
\section{MySecondSection}
In section~\nameref{sec:marker} we defined...
19.7. References
http://en.wikipedia.org/wiki/Theorem
With "theorem1 " we can mean any kind of labelled enunciation that we want
to look separated from the rest of the text and with sequential numbers next to
it. This approach is commonly used for theorems in mathematics, but can be
used for anything. LaTeX provides a command that will let you easily define
any theorem-like enunciation.
20. Theorems
\newtheorem{mydef}{Definition}
put it in the preamble. The first argument is the name you will use to reference
it, the second argument is the output LaTeX will print whenever you use it.
For example:
\newtheorem{name}{Printed output}
\usepackage{amsthm}
First of all, make sure you have the amsthm package enabled:
\newtheorem{name}{Printed output}[numberby]
Often the counters are determined by section, for example "Theorem 2.3"
refers to the 3rd theorem in the 2nd section of a document. In this case, specify
the theorem as follows:
\begin{mydef}
Here is a new definition
\end{mydef}
2
3
\newtheorem*{mydef}{Definition}
You can also create a theorem environment that is not numbered by using the
newtheorem* command3 . For instance,
where counter is the name of the counter to be used. Usually this will be the
name of the master theorem.
\newtheorem{name}[counter]{Printed output}
By default, each theorem uses its own counter. However it is common for
similar types of theorems (e.g. Theorems, Lemmas and Corollaries) to share a
counter. In this case, define subsequent theorems as:
4
5
6
It just adds Proof in italics at the beginning of the text given as argument and
a white square (Q.E.D5 symbol, also known as a tombstone6 ) at the end of
\begin{proof}
Here is my proof
\end{proof}
The proof environment4 can be used for adding the proof of a theorem. The
basic usage is:
20.3. Proofs
defines the mydef environment, which will generate definitions without numbering. This requires amsthm package.
\begin{proof}
Here is my proof:
If the last line of the proof is displayed math then the Q.E.D. symbol will
appear on a subsequent empty line. To put the Q.E.D. symbol at the end of the
last line, use the \qedhere command:
If you would like to manually name the proof, include the name in square
brackets:
it. If you are writing in another language than English, just use babel7 with
the right argument and the word Proof printed in the output will be translated
accordingly; anyway, in the source the name of the environment remains
proof.
\renewcommand{\qedsymbol}{}
The method above does not work with the deprecated environment
eqnarray*. Use align* instead.
\[
a^2 + b^2 = c^2 \qedhere
\]
\end{proof}
definition
remark
stylename
plain
Description
Used for theorems, lemmas,
propositions, etc. (default)
Used for definitions and examples
Used for remarks and notes
the argument is the style you want to use. All subsequently defined theorems
will use this style. Here is a list of the possible pre-defined styles:
\theoremstyle{stylename}
(Any arguments that are left blank will assume their default value). Here is an
example headspec:
(The note argument, which in this case is Topology, is always optional, but
will not appear by default unless you specify it as above in the head spec).
\begin{definition}[Topology]...
Definition 2: Topology
% Fix latex
\def\smallskip{\vskip\smallskipamount}
\def\medskip{\vskip\medskipamount}
\def\bigskip{\vskip\bigskipamount}
20.5. Conflicts
[ftp://ftp.ams.org/pub/tex/doc/amscls/amsthdoc.pdf
documentation]
20.6. Notes
\begin{thm}{Claim}\label{lyt-prob}
Let it be.
Then you know.
\end{thm}
amsthm
http://en.wikipedia.org/wiki/pseudocode
LaTeX has a variety of packages that can help to format algorithms, code, and
"pseudocode1 ". These packages provide stylistic enhancements over a uniform
style (i.e., typewriter fonts) so that constructs such as loops or conditionals are
visually separated from other text.
\State <text>
http://www.tug.org/texlive/Contents/live/texmf-dist/doc/
latex/algorithms/algorithms.pdf
\Comment{<text>}
\Return <text>
\Require <text>
\begin{algorithmic}
\If {$i\geq maxval$}
\State $i\gets 0$
\Else
\If {$i+k\leq maxval$}
\State $i\gets i+k$
\EndIf
\EndIf
\end{algorithmic}
22.2.1. If-statements
Figure 76
22.2.2. For-loops
The third form accepts as many \ElsIf{} clauses as required. Note that it
is \ElsIf and not \ElseIf.
22.2.3. While-loops
e.g.
22.2.8. Functions
\Ensure <text>
22.2.7. Postcondition
\Require <text>
22.2.6. Precondition
Note to users who switched from the old algorithmic package: comments
may be placed everywhere in the source; there are no limitations as in the old
algorithmic package.
\Comment{<text>}
22.2.10. Comments
\Function{Increment}{$a$}
\State $a \gets a+1$
\State \Return $a$
\EndFunction
\Return <text>
\algblock[<block>]{<start>}{<end>}
To define blocks beginning with a starting command and ending with an ending
command, use
\floatname{algorithm}{Procedure}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\algblock[Name]{Start}{End}
\algblockdefx[NAME]{START}{END}%
[2][Unknown]{Start #1(#2)}%
{Ending}
\algblockdefx[NAME]{}{OTHEREND}%
[1]{Until (#1)}
\begin{algorithmic}
\Start
\Start
\START[One]{x}
\END
\START{0}
Example:
\algblockdefx[<block>]{<start>}{<end>}
[<startparamcount>][<default value>]{<start text>}
[<endparamcount>][<default value>]{<end text>}
With \algblockdefx you can give the text to be output by the starting and
ending command and the number of parameters for these commands. In the
text the n-th parameter is referenced by #n.
More
advanced
customization
and
other
constructions
are
described
in
the
algorithmicx
manual:
http://mirror.ctan.org/macros/latex/contrib/algorithmicx/algorithmicx.pdf
\End
\end{algorithmic}
\OTHEREND{\texttt{True}}
\End
\Start
\End
\begin{algorithm}
\caption{<your caption for this algorithm>}
\label{<your label for references later in your document>}
\begin{algorithmic}
<algorithmic environment>
\end{algorithmic}
\end{algorithm}
anywhere in the document, and LaTeX will print a list of the "algorithm"
environments in the document with the corresponding page and the caption.
\listofalgorithms
When you use figures or tables, you can add a list of them close to the table of
contents; the algorithm package provides a similar command. Just put
\usepackage[chapter]{algorithm}
legal values for this option are: part, chapter, section, subsection, subsubsection
or nothing (default). For example:
\begin{algorithm}
environment
\caption{Calculate $y = x^n$}
\label{alg1}
commands later in the document
\begin{algorithmic}
environment
\Require $n \geq 0 \vee x \neq 0$
\Ensure $y = x^n$
\State $y \Leftarrow 1$
\If{$n < 0$}
\State $X \Leftarrow 1 / x$
\State $N \Leftarrow -n$
\Else
\State $X \Leftarrow x$
\State $N \Leftarrow n$
\EndIf
y \times X$
N - 1$
X \times X$
N / 2$
http://mirrors.ctan.org/macros/latex/contrib/algorithms/algorithms.pdf
http://developer.berlios.de/docman/?group_id=3442
\begin{program}
\mbox{A fast exponentiation procedure:}
\BEGIN %
\FOR i:=1 \TO 10 \STEP 1 \DO
The program package provides macros for typesetting algorithms. Each line
is set in math mode, so all the indentation and spacing is done automatically.
The notation |variable_name| can be used within normal text, maths
expressions or programs to indicate a variable name. Use \origbar to get
a normal | symbol in a program. The commands \A, \B, \P, \Q, \R, \S,
\T and \Z typeset the corresponding bold letter with the next object as a
subscript (eg \S1 typesets {\bf S$_1$} etc). Primes work normally, eg
\S.
Figure 77
\begin{program}
\IF x = 1 \AR y:=y+1
\BAR x = 2 \AR y:=y^2
\utdots
\BAR x = n \AR y:=\displaystyle\sum_{i=1}^n y_i \FI
\[
\( \ACTIONS A:
A \EQ \IF \B{} \THEN \S{}; \CALL A
\ELSE \CALL Z \FI \QE
\ENDACTIONS \)
\EQT
\( \WHILE \B{} \DO \S{} \OD \)
\]
\begin{program}
\VAR \seq{m := 0, p := 0, |last| := ''};
\ACTIONS |prog|:
|prog| \ACTIONEQ %
\seq{|line| := '', m := 0, i := 1};
\CALL |inhere| \ENDACTION
l \ACTIONEQ %
i := i+1;
\IF (i=(n+1)) \THEN \CALL |alldone| \FI ;
m := 1;
\IF |item|[i] \neq |last|
\THEN |write|(|line|); |line| := ''; m := 0;
\begin{program}
\DO \DO \IF \B1 \THEN \EXIT \FI;
\S1;
\IF \B2 \THEN \EXIT(2) \FI \OD;
\IF \B1 \THEN \EXIT \FI \OD
\end{program}
\begin{program}
\seq{|line| := '', i := 1};
\WHILE i \neq n+1 \DO
|line| := |item|[i] \concat '' \concat |number|[i];
i := i+1;
\WHILE i \neq n+1 \AND |item|[i] = |item|[i-1] \DO
|line| := |line| \concat , '' \concat |number|[i]);
3
4
http://www.ctan.org/pkg/program
http://mirror.ctan.org/macros/latex/contrib/program/
program-doc.pdf
Package documentation4
Package page3
The package also provides a macro for typesetting a set like this: \set{x
\in N | x > 0}.
i := i+1 \OD ;
|write|(|line|) \OD
\end{program}
% Start your
http://en.wikibooks.org/wiki/LaTeX%2FPackages%2FListings%
20
\begin{lstlisting}[frame=single]
code-block
\documentclass{article}
\usepackage{listings}
% Include the listings-package
\begin{document}
\lstset{language=Pascal}
% Set your language (you can change
the language for each code-block optionally)
Figure 78
\end{document}
for i:=maxint to 0 do
begin
{ do nothing }
end;
Write(Case insensitive );
Write(Pascal keywords.);
\end{lstlisting}
PACKAGE ,
OFFICIAL
ROGRIO
MANUAL
FOR
B RITO
THE
(2009),
ALGO -
http://mirrors.ctan.org/macros/latex/contrib/algorithms/
algorithms.pdf
RITHMS
T HE
23. References
package are effectively standard within the field, while others will vary by
author preference.
tipa
There are a number of LaTeX packages available for writing linguistics papers.
Various packages have been created for enumerated examples, sytactic trees,
OT tableaux, feature matrices, IPA fonts, and many other applications. Some
packages such as the
24. Linguistics
Glosses: gb4e;
IPA symbols: tipa;
OT Tableaux: OTtablx;
Syntactic trees: qtree + tree-dvips (for drawing arrows);
http://jones.ling.indiana.edu/~mdickinson/08/latex/slides.
pdf LaTeX for Linguists presentation
http://ctan.org/tex-archive/macros/generic/diagrams/xypic/
xy
http://ctan.org/pkg/tikz-qtree
4
5
6
http://sourceforge.net/projects/tikz-dependency/
http://nlp.stanford.edu/~manning/tex/avm.sty
http://www.math.neu.edu/ling/tex/
There are several commonly used packages for creating the kinds of numbered
examples that are used in linguistics publications.
The TikZ-depdendency4 package provides a high-level, convenient interface to draw dependency graphs. It is based on PGF/TikZ but does not
require prior knowledge of TikZ in order to be used productively.
http://ctan.mines-albi.fr/help/Catalogue/entries/gb4e.
html/ The gb4e package on CTAN
\begin{exe}
\ex This is an example.
\end{exe}
exe
\usepackage{gb4e}
gb4e
The
24.1.1. gb4e
produces:
\begin{exe}
\ex This is the first example.
\ex This is the second example.
\ex This is the third.
\end{exe}
Multiple examples can be included within the environment, and each will have
its own number.
Figure 79
produces:
\begin{exe}
\ex
\ex
\ex
\ex
\begin{xlist}
This is a sub-example.
This is a second sub-example.
\begin{xlist}
\ex This is a sub-sub-example.
\ex This is a second sub-sub-example.
\end{xlist}
enviroment is used.
xlist
Figure 80
\begin{exe}
\ex This sentence is grammatical English.
For notating acceptability judgments, the \ex command can take an optional
argument. When including a judgment marker, the corresponding sentence
must be surrounded by braces.
Figure 81
produces:
\end{xlist}
\end{exe}
\begin{exe}
\ex\label{ex1} Gozilla destroyed the city.
\ex\label{ex2} Godzilla roared.
\end{exe}
Figure 82
produces:
10
http://ctan.mackichan.com/macros/latex/contrib/gb4e/
gb4e-doc.pdf
http://ctan.org/tex-archive/macros/latex209/contrib/trees/
tree-dvips The lingmacros package on CTAN
package10 created by Emma Pease is an alternate method for example numbering. This package uses two main commands \enumsentence and
\eenumsentence. The former is used for singleton examples,
lingmacros
The
24.1.2. lingmacros
Figure 84
Figure 83
\enumsentence{This is an example.}
11
Figure 85
produces:
Multiply nested examples make use of the normal LaTeX list environments11 .
12
http://mirrors.ibiblio.org/pub/mirrors/CTAN/macros/
latex209/contrib/trees/tree-dvips/lingmacros-manual.pdf
While there are several packages for drawing syntactic trees available for
LaTeX, this article focuses on the qtree and xyling packages.
A new tree is started using the \Tree command, each (sub-)tree is indicated by
brackets [ ]. The root of a (sub-)tree is always preceded by a ., leaf nodes are
simply expressed by their labels.
\usepackage{qtree}
Drawing trees with qtree is relatively straightforward. First, the qtree package has to be included in the document's preamble:
qtree
Note that the spaces before the closing brackets, as well as the space between
\Tree and the first opening bracket are mandatory.
Figure 86
Using the same syntax as qtree, tikz-qtree is another easy-to-use alternative for
drawing syntactic trees.
tikz-qtree
anywhere in the document. The effect of the latter can be undone by using the
command
By default, qtree centers syntactic trees on the page. This behaviour can be
turned off by either specifying the behaviour when loading the package
The syntax of tikz-qtree and result when drawing a simple tree is the
same as for qtree.
\usepackage{tikz}
\usepackage{tikz-qtree}
To use the tikz-qtree package for drawing trees, put the following into
the document's preamble:
\begin{center}
Note that, other than for qtree, trees are not centered by default. To center
them, put them into a centered environment:
Figure 87
For setting the style of trees, tikz-qtree provides the \tikzset command. For
example, to make a tree grow from left to right instead of from top to bottom,
use the following code:
The above code changes the default orientation for all trees that are defined
after \tikzset commands. To only change the direction of a single tree, it has
to be put into a \tikzpicture environment:
Figure 88
Dependency trees can take multiple visual forms. Commonly, they quite
resemble phrase structure trees. Alternatively, they can be captured by brackets
drawn above running text.
% In the document:
\begin{tikzpicture}
\node (is-root) {is}
[sibling distance=3cm]
child { node {this} }
child {
node {tree}
[sibling distance=1.5cm]
child { node {an} }
child { node {example} }
child { node {.} }
child[missing]
};
\path (is-root) +(0,-2.5\tikzleveldistance)
% In the preamble:
\usepackage{tikz}
These can be either achieved using the fairly universal drawing package TikZ,
like so:
Figure 89
\medskip
\textit{This is an example tree.}
% In the document:
\Tree{
& \K{is}\B{dl}\B{drr} \\
\K{this} &&& \K{tree}\B{dll}\B{dl}\B{dr} \\
& \K{an} & \K{example} && \K{.} }
% In the preamble:
\usepackage{xytree}
The code for a similar tree using xyling might look like:
TikZ has the advantage that it allows for generating PDF directly from the
LaTeX source, without need for any detour of compiling to DVI using latex,
and then converting to PDF probably via PS using tools such as dvips and
ps2pdf. Latter is the case of another package based on the package xy,
namely xyling.
Figure 90
% In the document:
\xytext{
\xybarnode{Peter} &~~~&
\xybarnode{and}
\xybarconnect(UL,U){-2}"_{\small conj}"
\xybarconnect(UR,U){2}"^{\small conj}"
&~~~&
\xybarnode{Mary} &~~~&
\xybarnode{bought}
\xybarconnect[8](UL,U){-4}"_{\small subj}"
% In the preamble:
\usepackage{xytree}
An example code:
One way to typeset dependency brackets above running text is using the
package xytree. It gives you fairly good control of how the brackets are
typeset but requires compiling the LaTeX code to DVI (and perhaps converting
to PDF using the tools dvips and ps2pdf later).
Figure 91
results in:
\xybarconnect[13]{6}"^{\small punct}"
\xybarconnect[8](UR,U){4}"^{\small obj}"
&~~~&
\xybarnode{a} &~~~&
\xybarnode{car}
\xybarconnect(UL,U){-2}"_{\small det}"
&~~~&
\xybarnode{.}
% In the document:
\begin{dependency}[theme = simple]
\begin{deptext}[column sep=1em]
A \& hearing \& is \& scheduled \& on \& the \& issue \& today
\& . \\
\end{deptext}
\deproot{3}{ROOT}
\depedge{2}{1}{ATT}
\depedge[edge start x offset=-6pt]{2}{5}{ATT}
% In the preamble:
\usepackage{tikz-dependency}
The package provides high level commands to design and style dependency
graphs. To draw a graph, you only need to create a dependency environment,
write the text of the sentence within the deptext environment and use
depedge commands to draw the edges. Global and local optional parameters
can be used to style and fine tune the looks of the graph, as shown in the
following example:
Figure 92
\depedge{3}{2}{SBJ}
\depedge{3}{9}{PU}
\depedge{3}{4}{VC}
\depedge{4}{8}{TMP}
\depedge{5}{7}{PC}
\depedge[arc angle=50]{7}{6}{ATT}
\end{dependency}
\begin{exe}
\ex
\gll \\
cat.NOM eat.3.SG.PRS sour-cream.ACC\\
environment. But after the \ex tag, introduce the example and its gloss using
\gll and the translation after it with \trans tag.
exe
.
To create a glossed example, use the normal
gb4e
24.3. Glosses
\begin{exe}
\ex
Figure 93
13
lingmacros
The
There are two methods for getting IPA symbols into a document. The first way
is to use the
\usepackage{tipa}
tipa
The
\enumsentence{\shortex{3}
{Pekka & pel\"astyi & karhu-sta.}
{Pekka & became afraid & bear.ELA}
{Pekka became afraid because of the/a bear.'}
}
14
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%23Fonts
This method is useful for long stretches of text that need to be in IPA. Alternatively, there is the \textipa command that will format the text in its
argument into IPA. This command is similar to other font typesetting commands14 .
\begin{IPA}
text in IPA format here
\end{IPA}
environment.
IPA
produces:
\textipa{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
Figure 94
\textipa{abcdefghijklmnopqrstuvwxyz}
The IPA format works by translating ASCII characters into corresponding IPA
symbols. Lower case letters are rendered as usual,
Figure 96
produces:
environment.
IPA
Punctuation marks that are normally used in LaTeX are also rendered faithfully
in the
Figure 95
15
The \; macro preceding a capital letter produces a small caps version of the
letter.
In addition, there are a number of special macros for representing symbols that
don't have other associations, some of which are listed here. For a complete
list see the official TIPA Manual15 .
Figure 97
produces:
\textipa{1234567890 @}
environment.
tipa
Figure 99
gets you:
Figure 98
produces:
Figure 100
gets you:
25. References
2
3
http://www.essex.ac.uk/linguistics/external/clmt/
latex4ling/
http://www.ling.upenn.edu/advice/latex/qtree/
http://www.ctan.org/tex-archive/macros/latex/contrib/gb4e/
Part IV.
27. Indexing
can be re-written as
where key is the index entry and does not appear in the final layout. You enter
the index commands at the points in the text that you want to be referenced in
the index, likely near the reason for the key. For example, the text
\index{key}
command into the input file preamble. This should be done within the preamble,
since it tells LaTeX to create the files needed for indexing. To tell LaTeX what
to index, use
\makeindex
\usepackage{makeidx}
The showidx package that comes with LaTeX prints out all index entries in
the left margin of the text. This is quite useful for proofreading a document
and verifying the index.
It is common to place it at the end of the document. The default index format
is two columns.
\printindex
To show the index within the document, merely use the command
to create an entry called 'Fourier Series' with a reference to the target page.
Multiple uses of \index with the same key on different pages will add those
target pages to the same index entry.
Note that filename is without extension: the program will look for filename.idx
and use that. You can optionally pass filename.idx directly to the program as
an argument. The makeindex program generates a sorted index with the
same base file name, but this time with the extension .ind. If now the LaTeX
input file is processed again, this sorted index gets included into the document
at the point where LaTeX finds \printindex.
makeindex filename
When the input file is processed with LaTeX, each \index command
writes an appropriate index entry, together with the current page number,
to a special file. The file has the same name as the LaTeX input file, but a
different extension (.idx). This .idx file can then be processed with the
makeindex program. Type in the command line:
It replaces the glossary package and can be used instead of the nomencl
package.
makeindex -s
The index created by latex with the default options may not look as nice or as
suitable as you would like it. To improve the looks of the index makeindex
comes with a set of style files, usually located somewhere in the tex directory
structure, usually below the makeindex subdirectory. To tell makeindex
to use a specific style file, run it with the command line option:
Chapter ?? on page ??
The glossary index won't be generated until you place the following command
in document preamble:
\usepackage[toc]{glossaries}
For the glossary to show up in Table of Contents you need to additionally add
toc option:
\usepackage[xindy]{glossaries}
\usepackage{glossaries}
To enable the use of glossaries package, you have to load the package:
Note that a defined entry won't be included in the printed glossary unless it is
used in the document. This enables you to create a glossary of general terms
and just \include it in all your documents.
To use an entry from glossary you first need to define it. There are few ways to
define an entry depending on what you define and how it is going to be used.
Note that the links in generated glossary won't be clickable unless you load
this package after the hyperref package.
\makeglossaries
When you define terms, you need to remember that they will be sorted
by or .
While is a bit more LaTeX aware, it does it by ommiting latex
macros () thus incorrectly sorting the above example as .
wont fare much better, because it doesnt understand TeX macros,
it will interpret the word exactly as it was defined, putting it
inside symbol class, before words beginning with .
Therefore its needed to extend our example and specify how to sort
The above example defines an entry that has the same label and entry
name.
This is not always the case as the next entry will show:
macro:
Sometimes the mundane things are the most painful. However, it doesn't have
to be that way because of evolved, user-friendly templates. Thankfully, LaTeX
allows for very quick letter writing, with little hassle.
You can also specify plural forms, if they are not formed by adding
s (we will learn how to use them in next section):
the word:
If you want your name, address and telephone number to appear in the letter,
you have to declare them first signature, address and telephone.
LaTeX will leave some space after closing for your hand-written signature; then it will put your name and surname, if you have declared
them.
You can write multiple letters in one LaTeX file - start each one with \begin{letter}{recipient} and end with \end{letter}. You can leave recipient blank.
Each letter consists of four parts:
\documentclass{letter}
Figure 101 A
sample letter.
% The \ldots command produces dots in a way that will not upset
% the typesetting of the document.
\ldots
\usepackage{hyperref}
\signature{Joe Bloggs}
\address{21 Bridge Street \\ Smallville \\ Dunwich DU3 4WE}
\begin{document}
The amount of space to the left can be adjusted by increasing the 0pt.
\longindentation=0pt
To move the closing and signature parts to the left, insert the following before
\begin{document}:
\end{document}
\end{letter}
\closing{Yours Faithfully,}
http://mirror.hmc.edu/ctan/macros/latex/contrib/envlab/
elguide.pdf
Refer to the envlab user guide2 for more information about this capable
package.
\documentclass{letter}
\usepackage[businessenvelope]{envlab}
\makelabels
The envlab package provides customization to the \makelabels command, allowing the user to print on any of an assortment of labels or envelope
sizes. For example, beginning your LaTeX file the following way produces a
document which includes the letter and a business-size (#10) envelope on the
following page.
27.6. Envelopes
\vspace{1.0in}\large
FROM-STREET ADDRESS
FROM-NAME
\begin{document}
% envelope.tex
\documentclass{letter}
\usepackage[left=1in,to
p=0.15in,papersize={4.125in,9.5in},landscape,twoside=false]{geometry}
\setlength\parskip{0pt}
\pagestyle{empty}
Here is a relatively simple envelope which uses the geometry package which
is used because it vastly simplifies the task of rearranging things on the page
(and the page itself).
Figure 102
A sample
envelope to
be printed in
landscape
mode.
\end{document}
TO-STREET ADDRESS
TO-NAME
\setlength\parindent{3.6in}
In the first line, dvips command converts the .dvi file produced by latex into a
.ps (PostScript) file. In the second line, the PostScript file is sent to the printer.
$ pdflatex envelope.tex
$ pdf2ps envelope.pdf
$ lpr -o landscape envelope.ps
The above will certainly take care of the spacing but the actual printing is
between you and your printer. One user reports that printing envelopes created
with envlab is relatively painless. If you use the geometry package, you
may find the following commands useful for printing the envelope.
27.6.3. Printing
% koma_env.tex
\documentclass[a4paper]{scrlttr2}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
It is reported that pdflatex creates the right page size but not dvips despite
what it says in the geometry manual. It will never work though unless your
printer settings are adjusted to the correct page style. These settings depend
on the printer filter you are using and in CUPS might be available on the lpr
command line if you are masochistic.
\KOMAoptions{fromphone=true,fromfax=false}
\setkomavar{subject}{Wikipedia}
\setkomavar{customer}{2342}
\opening{Dear Sir or Madam,}
\begin{document}
\setkomavar{fromname}{Joe Bloggs}
\setkomavar{fromaddress}{21 Bridge Street \\ Smallville \\ Dunwich
DU3 4WE}
\setkomavar{fromphone}{0123 45679}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{url}
\end{document}
\end{letter}
\closing{Yours Faithfully,}
\ps{P.S. You can find the full text of GFDL license at
\url{http://www.gnu.org/copyleft/fdl.html}.}
\encl{Copyright permission form}
\ldots
Figure 103 A
sample letter with
folding marks ready
for standardized
windowed envelopes.
$ pdflatex koma_env
command
\name{}
\signature{}
\address{}
\location{}
\telephone{}
\makelabels
description
Folding the print of the resulting file koma_env.pdf according the folding
marks it can be placed into standardized windowed envelopes DIN C6/5, DL,
C4, C5 or C6.
\stopletter
\returnaddress
\startlabels
\mlabel{}{}
\descriptionlabel{}
\ccname
\ps
\encl{}
command
\stopbreaks
\startbreaks
\opening{}
\closing{}
\cc{}
"cc"
description
description
"encl"
"Page"
"To"
Long form date
Description
See main article
command
\enclname
\pagename
\headtoname
\today
environment
letter{}
description
verse
quotation
quote
4
5
http://www.ctan.org/tex-archive/macros/latex/contrib/
koma-script/scrguien.pdf
http://pl.wikibooks.org/wiki/LaTeX%2FPisanie%20list%F3w
http://fr.wikibooks.org/wiki/LaTeX%2FLettre
27.9. Sources
LaTeX can be used for creating presentations. There are several packages for
the task, including the Beamer package.
28. Presentations
http://www.ctan.org/tex-archive/macros/latex/contrib/
beamer/
http://www.ctan.org/tex-archive/macros/latex/contrib/
beamer/doc/beameruserguide.pdf
Andrew Mertz and William Slough Beamer by Example
The beamer package is provided with most LaTeX distributions, but is also
available from CTAN1 . If you use MikTeX, all you have to do is to include the
beamer package and let LaTeX download all wanted packages automatically.
The documentation2 explains the features in great detail. You can also have a
look at the PracTex article Beamer by example3
\begin{document}
\begin{frame}
\frametitle{This is the first slide}
%Content goes here
\end{frame}
\begin{frame}
\frametitle{This is the second slide}
\framesubtitle{A bit more information about this}
%More content goes here
\documentclass[xetex,mathserif,serif]{beamer}
The usual header information may then be specified. Note that if you are
compiling with XeTeX then you should use
\documentclass{beamer}
Figure 104
\end{frame}
% etc
\end{document}
For the actual talk, if you can compile it with pdfLaTeX then you could use
Adobe Reader with its fullscreen mode. If you want to navigate in your
presentation, you can use the almost invisible links in the bottom right corner
without leaving the fullscreen mode.
Inside of frames, you can use environments like block, theorem, proof,
... Also, \maketitle is possible to create the frontpage, if title and
author is set.
You give information about authors, titles and dates in the preamble
You can automatically print the table of contents at the beginning of each
section by adding in the preamble the following line.
\begin{frame}
\frametitle{Table of Contents}
\tableofcontents[currentsection]
\end{frame}
You can print the table of contents and highlight the current section/subsection
by typing :
Table of Contents
\frame{\titlepage}
\AtBeginSubsection[]
{
\begin{frame}
\frametitle{Table of Contents}
\tableofcontents[currentsection,currentsubsection]
\end{frame}
}
\AtBeginSection[]
{
\begin{frame}
\frametitle{Table of Contents}
\tableofcontents[currentsection]
\end{frame}
}
\begin{frame}[allowframebreaks]
\frametitle<presentation>{Weiterfhrende Literatur}
\begin{thebibliography}{10}
\beamertemplatebookbibitems
\bibitem{Autor1990}
A.~Autor.
\newblock {\em Einfhrung in das Pr% sentationswesen}.
\newblock Klein-Verlag, 1990.
\beamertemplatearticlebibitems
\bibitem{Jemand2000}
S.~Jemand.
\newblock On this and that.
\newblock {\em Journal of This and That}, 2(1):50--100, 2000.
\end{thebibliography}
\end{frame}
References (Beamer)
to use the "Warsaw" theme. Beamer has several themes, many of which
are named after cities (e.g. Barcelona, Madrid, Berlin, etc.). Color themes,
typically with animal names, can be specified with
\usetheme{Warsaw}
The first solution is to use a built-in theme such as Warsaw, Berlin, etc. The
second solution is to specify colors, inner themes and outer themes.
Themes
28.1.3. Style
http://www.hartwork.org/beamer-theme-matrix/
The list of all themes : Antibes, Bergen, Berkeley, Berlin, Boadilla, Copenhagen, Darmstadt, Dresden, Frankfurt, Goettingen, Hannover, Ilmenau, JuanLesPins, Luebeck, Madrid, Malmoe, Marburg, Montpellier, PaloAlto, Pittsburgh, Rochester, Singapore, Szeged, Warsaw, boxes, default
This Theme Matrix4 contains the various theme and color combinations
included with beamer. For more customizing options, have a look to the
official documentation included in your distribution of beamer, particularly
the part Change the way it looks.
\usecolortheme{beaver}
infolines
miniframes
shadow
sidebar
smoothbars
smoothtree
split
tree
\useinnertheme{rectangles}
\useoutertheme{infolines}
First you can specify the outertheme. The outertheme defines the head and the
footline of each slide.
rectangles
circles
inmargin
rounded
\setbeamercolor{alerted text}{fg=orange}
\setbeamercolor{background canvas}{bg=white}
\setbeamercolor{block body alerted}{bg=normal text.bg!90!black}
\setbeamercolor{block body}{bg=normal text.bg!90!black}
\setbeamercolor{block body example}{bg=normal text.bg!90!black}
\setbeamercolor{block title alerted}{use={normal text,alerted
text},fg=alerted text.fg!75!normal text.fg,bg=normal
text.bg!75!black}
\setbeamercolor{block title}{bg=blue}
\setbeamercolor{block title example}{use={normal text,example
text},fg=example text.fg!75!normal text.fg,bg=normal
text.bg!75!black}
\setbeamercolor{fine separation line}{}
\setbeamercolor{frametitle}{fg=brown}
\setbeamercolor{item projected}{fg=black}
\setbeamercolor{normal text}{bg=black,fg=yellow}
\setbeamercolor{palette sidebar primary}{use=normal text,fg=normal
text.fg}
\setbeamercolor{palette sidebar
quaternary}{use=structure,fg=structure.fg}
\setbeamercolor{palette sidebar
secondary}{use=structure,fg=structure.fg}
\setbeamercolor{palette sidebar tertiary}{use=normal text,fg=normal
text.fg}
\setbeamercolor{section in sidebar}{fg=brown}
\setbeamercolor{section in sidebar shaded}{fg= grey}
\setbeamercolor{separation line}{}
\setbeamercolor{sidebar}{bg=red}
\setbeamercolor{sidebar}{parent=palette primary}
\setbeamercolor{structure}{bg=black, fg=green}
\setbeamercolor{subsection in sidebar}{fg=brown}
\setbeamercolor{subsection in sidebar shaded}{fg= grey}
\setbeamercolor{title}{fg=brown}
\setbeamercolor{titlelike}{fg=brown}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamertemplate{background canvas}[vertical
shading][bottom=white,top=structure.fg!25]
\setbeamertemplate{sidebar canvas left}[horizontal
shading][left=white!40!black,right=black]
\definecolor{chocolate}{RGB}{33,33,33}
Math Fonts
The default settings for beamer use a different set of math fonts than one
\setbeamerfont{title}{family=\rm\addfontfeatures{Scale=1.18,
Numbers={Lining, Proportional}}}
You could take this a step further if you are using OpenType fonts with
Xe(La)TeX and specify a serif font with increased size and oldstyle proportional alternate number glyphs:
\setbeamerfont{title}{family=\rm}
You may also change the fonts for particular elements. If you wanted the title
of the presentation as rendered by \frame{\titlepage} to occur in a
serif font instead of the default sanserif, you would use:
Fonts
\frame[plain]{
The plain option. Sometimes you need to include a large figure or a large table
and you don't want to have the bottom and the top of the slides. In that case,
use the plain option :
but it is not clear if this works for absolutely every math character.
\usefonttheme[onlymath]{serif}
\documentclass[mathserif]{beamer}
would expect from creating a simple math article. One quick fix for this is to
use at the beginning of the file the option mathserif
\begin{lstlisting}[caption=First C example]
int main()
{
printf("Hello World!");
return 0;
}
\frame[containsverbatim]{
\frametitle{Source code}
Before using any verbatim environment (like listings), you should pass
the option containsverbatim to the \frame command.
\frame[shrink]{
...
}
If you want to include lots of text on a slide, use the shrink option.
...
}
\begin{itemize}
\item This one is always shown
\item<1-> The first time
\item<2-> The second time
For text animations, for example in the itemize environment, you can write:
\begin{frame}
\frametitle{Some background}
We start our discussion with some concepts.
\pause
The first concept we introduce originates with Erd\H os.
\end{frame}
\end{lstlisting}
}
\begin{frame}
\frametitle{Hidden higher-order concepts?'}
\begin{itemize}[<+->]
\item The truths of arithmetic which are independent of PA in
some
sense themselves {contain} essentially {\color{blue}{hidden
higher-order}},
or infinitary, concepts'???
\item Truths in the language of arithmetic which \ldots
\item
That suggests stronger version of Isaacson's thesi
\end{itemize}
\end{frame}
If you want to solve this, you can add a statement to precise the behavior it
must have when dealing with only commands in handout mode. Suppose you
have a code like this
This mode is useful to see each slide only one time with all its stuff on it,
making the itemize<+-> to be there all at once (for instance, printable version).
Nevertheless, this makes an issue when working with the only command,
because its purpose is to have only some text or figures at a time and not all of
them together.
\documentclass[12pt,handout]{beamer}
In beamer class, the default mode is presentation which makes the slides.
However, you can work in a different mode that is called handout by setting
this option when calling the class:
\only<1| handout:0>{\includegraphics{pic1.eps}}
\only<2>{\includegraphics{pic2.eps}}
Now imagine you still have your two pictures with the only statements, but the
second one show the first one plus some other graphs and you don't need the
first one to appear in the handout. You can thus precise the handout mode not
to include some only commands by:
This will ensure the handout will make a slide for each picture.
\only<1| handout:1>{\includegraphics{pic1.eps}}
\only<2| handout:2>{\includegraphics{pic2.eps}}
These pictures being completely different, you want them both in the handout,
but they cannot be both on the same slide since they are large. The solution is
to add the handout statement to have the following:
\only<1>{\includegraphics{pic1.eps}}
\only<2>{\includegraphics{pic2.eps}}
\begin{frame}
...
\end{frame}
\note{...}
A last word about the handout mode is about the notes. Actually, the full
syntax for a frame is
and this will hide your slide in both modes. (The order matters. Don't put
handout:0|beamer:0 or it won't work.)
\begin{frame}<0| handout:0>
or even, if you have written a frame that you don't want anymore but maybe
you will need it later, you can write
\begin{frame}<handout:0>
Note that the 'handout' option in the \documentclass line suppress all the
animations.
The first one is useful when you make a presentation to have only the notes
you need, while the second one could be given to those who have followed
your presentation or those who missed it, for them to have both the slides with
what you said.
\documentclass[12pt,handout,notes=show]{beamer}
or
\documentclass[12pt,handout,notes=only]{beamer}
and you can write your notes about a frame in the field note (many of them if
needed). Using this, you can add an option to the class calling, either
\note{...}
...
Example
Columns
There are two handy environments for structuring a slide: "blocks", which
divide the slide (horizontally) into headed sections, and "columns" which
divides a slide (vertically) into columns.
Important: the notes=only mode is literally doing only the notes. This means
there will be no output file but the DVI. Thus it requires you to have run the
compilation in another mode before. If you use separate files for a better
distinction between the modes, you may need to copy the .aux file from the
handout compilation with the slides (w/o the notes).
\begin{frame}
\begin{columns}[t] % contents are top vertically aligned
\begin{column}[T]{5cm} % each column can also be its own
environment
Contents of first column \\ split into two lines
\end{column}
\begin{column}[T]{5cm} % alternative top-align that's better for
graphics
\includegraphics[height=3cm]{graphic.png}
\end{column}
\end{columns}
\end{frame}
\begin{frame}
\begin{columns}[c] % the "c" option specifies center vertical
alignment
\column{.5\textwidth} % column designated by a command
Contents of the first column
\column{.5\textwidth}
Contents split \\ into two lines
\end{columns}
\end{frame}
\begin{block}{This is a Block}
This is important information
\end{block}
\begin{frame}
Simple
Enclosing text in the block environment creates a distinct, headed block of text.
This allows to visually distinguish parts of a slide easily. There are three basic
types of block. Their formating depends on the theme being used.
Blocks
\end{frame}
http://www.ctan.org/tex-archive/macros/latex/contrib/
powerdot/
http://www.bitlib.net/mirror/ctan/macros/latex/contrib/
powerdot/docs/powerdot.pdf
\begin{document}
\documentclass{powerdot}
7
8
http://en.wikipedia.org/wiki/Beamer%20%28LaTeX%29
http://www.ctan.org/tex-archive/macros/latex/contrib/
beamer/doc/beameruserguide.pdf
Wikipedia:Beamer (LaTeX)7
Beamer user guide8 (pdf) from CTAN
28.4. Links
28.3. References
10
11
http://www.ctan.org/get/macros/latex/contrib/powerdot/doc/
powerdot.pdf
http://www.math-linux.com/spip.php?article77
http://fr.wikibooks.org/wiki/LaTeX%2FFaire%20des%20pr%
E9sentations
LaTeX has specific features for teachers. We present the exam class1 which
is useful for designing exams and exercises with solutions. Interested people
29.1. Intro
Probsoln
{http://www.tex.ac.uk/tex-archive/macros/latex/
contrib/probsoln/probsoln.pdf} creating problem sheets optionally with
solutions
http://mat140.bham.ac.uk/~richard/programming/tex/exams/
msexdoc.pdf
We present the exam class. The exam class is well suited to design exams with
solutions. You just have to specify in the preamble if you want the solutions to
be printed or not. You can also count the number of points.
could also have a look at the probsoln package2 or the mathexm document
class3 .
\documentclass[a4paper,11pt,answers,addpoints]{exam}
\documentclass[a4paper,11pt]{exam}
\printanswers % If you want to print answers
% \noprintanswers % If you dont want to print answers
\addpoints % if you want to count the points
% \noaddpoints % if you dont want to count the points
% Specifies the way question are displayed:
\qformat{\textbf{Question\thequestion}\quad(\thepoints)\hfill}
\usepackage{color} % defines a new color
\definecolor{SolutionColor}{rgb}{0.8,0.9,1} % light blue
\shadedsolutions % defines the style of the solution environment
% \framedsolutions % defines the style of the solution environment
% Defines the title of the solution environment:
\r
enewcommand{\solutiontitle}{\noindent\textbf{Solution:}\par\noindent}
29.2.1. Preamble
Here is an example :
29.2.2. Document
\begin{minipage}{.8\textwidth}
This exam includes \numquestions\ questions. The total number of
The macro \numquestions gives the total number of questions. The macro
\numpoints gives the total number of points.
29.2.3. Introduction
\ifprintanswers
Only if answers are printed
\else
Only if answers are not printed
\fi
It is also possible to add stuff only if answers are printed using the \ifprintanswers command.
\end{solution}
\end{questions}
29.3. References
The backslash after \numquestion prevents the macro from gobbling the
following whitespace as it normally would.
points is \numpoints.
\end{minipage}
Advanced Topics
Part V.
During this guide we have seen what it is possible to do and how this can be
achieved, but the question is: I want to write a proper text with LaTeX, what to
do then? Where should I start from? This is a short step-by-step guide about
how to start a document properly, keeping a good high-level structure. This
way it will be very easy to make modifications even when the document is
almost finished. These are all just suggestions, but you might take inspiration
from that to create your own document.
./document.tex
./mystyle.sty
If you followed all those steps, these files should be in your root directory,
using "/" for each directory:
1. create a directory only for the project. We'll refer to that in the following
parts as the root directory
2. create two other directories inside the root, one for LaTeX documents,
the other one for images. Since you'll have to write their name quite
often, choose short names. A suggestion would be simply tex and img.
3. create your document (we'll call it document.tex, but you can use the
name you prefer) and your own package (for example mystyle.sty); this
second file will help you to keep the code cleaner.
\input{filename}
As your work grows, your LaTeX file can become unwieldy and confusing,
especially if you are writing a long article with substantial, discrete sections,
or a full-length book. In such cases it is good practice to split your work into
several files. For example, if you are writing a book, it makes a lot of sense to
write each chapter in a separate .tex file. LaTeX makes this very easy thanks
to two commands:
nothing else.
./tex/
./img/
The differences between these files will be explained below but what they
have in common is that they process the contents of filename.tex before continuing with the rest of the base file. When the compiler processes
your base file and reaches the command \input or \include, it reads
filename.tex and processes its content in accordance with the formatting
commands specified in the base file. This way you can put all the formatting
options in your base file and then input or include the files which contain
the actual content of your work. This means that the important part of your
working process, i.e. writing, is kept largely separate from formatting choices
(which is one of the main reasons why LaTeX is so good for serious writing!).
You will thus be dealing solely with text and very basic commands such as
\section, \emph etc. Your document will be uncluttered and much easier
to work with.
\include{filename}
and
Working on discrete parts of your documents has consequences for how the
base file is compiled; these will be dealt with below.
A further important difference is that using \include will force a page break
(which makes it ideal for a book's chapters), whereas the input command
does not (which in turn makes it ideal for, say, a long article with discrete
sections, which of course are not normally set on a new page).
Obviously, using absolute paths is inefficient if you are referring to a file in the
current directory. If, however, you need to include a file which is always kept
\input{/home/user/texfiles/myfiles/filename.tex}
If you had created the directory myfiles for your writing project, in your
texfiles directory, its full path would be,
\input{/home/user/texfiles/filename.tex}
An absolute path is a full path- and filename with every element specified. So,
filename.tex might have the full path,
When the LaTeX compiler finds a reference to an external file in the base file,
it will look for it in the same directory. However, you can in principle refer to
any file on your system, using both absolute and relative paths.
You may, however, need to make your source portable (to another computer or
to a different location of your harddisk), in which case relative paths should be
used if you wish to avoid unnecessary re-writing of path names. Or, a relative
path may simply be a more efficient and elegant way of referring to a file. A
relative path is one which is defined in relation to the current directory, in our
case the one which contains the base file. LaTeX uses the standard UNIX
notation: with a simple dot . you refer to the current directory, and by two
In practice, an absolute file path is generally used when one has to refer to
a file which is quite some way away in the file system (or perhaps even on
a different server!). One word of warning: do not leave empty spaces in the
filenames, they can cause ambiguous behaviour. Either leave no spaces or use
underscores _ instead.
\input{/home/user/documents/useful/foo.tex}
at a specific place in your system, you may refer to it with an absolute path,
for example,
\input{./myfiles/filename.tex}
but if you found it more convenient to put all your files in a sub-directory
of your current directory, called myfiles, you would refer to that file by
specifying
\input{filename.tex}
\input{./filename.tex}
dots .. you refer to the previous directory, that is the one above the current
directory in the file system tree. The slash / is used to separate the different
components of a pathname: directories and filenames. So by ./ you refer to the
current directory, by ../ you refer to the previous directory, by ../../ you refer to
a directory which is two steps upwards in the filesystem tree. Writing
This flexibility, inherent in the way in which LaTeX is integrated with modern
file systems, lets you input files in a way which suits your particular set-up.
Of course, all commonly used file systems Linux, Mac OS X and Windows
also feature the UNIX ./, ../ facility outlined above. Do note, however, that
LaTeX uses forward slashes / even on Microsoft Windows platforms, which
use backslashes \ in pathnames. LaTeX implementations for Windows systems
perform this conversion for you, which ensures that your document will be
valid across all installations.
\input{../../documents/useful/foo.tex}
Indeed, in our example of the absolute path above, you could refer to that file
relatively, too:
\documentclass{article}
\begin{document}
%\input{Section_1}
%\input{Section_2}
The simplest way to check that one or more of the various components of your
work is syntactically robust, is to comment out the command with a percentage
sign, for example:
When you compile your document, page references and the like will change
according to your use of the \input and \include commands. Normally
LaTeX users only run the compiler on parts of the document to check that
an individual chapter is syntactically correct and looks as the writer intended.
A full run is generally only performed for producing a full draft or the final
version. In such cases, it is invariably necessary to run LaTeX twice or more
to resolve all the page numbers, references, etc. (especially if you are using
bibliographic software such as BiBTeX, too).
Using this command provides more complex, and hence more useful possibilities. If you include the following command in your preamble, i.e. before
\begin{document},
This code will process your base file with the article conventions but only
the material in the file Section_4.tex will be processed. If that was, say,
the last thing you needed to check before sending off to that major journal,
you would then simply remove all the percentage signs and re-run LaTeX,
repeating the compiling process as necessary to resolve all references, page
numbers and so on.
%\input{Section_3}
\input{Section_4}
%\input{Section_5}
\end{document}
\documentclass{book}
\includeonly{Chapter_1,Chapter_4}
\begin{document}
\include{Chapter_1} %Note that we are using Chapter_1 and not
Chapter_1.tex
\include{Chapter_2}
\include{Chapter_3}
\include{Chapter_4}
\end{document}
This requires that there are \include commands in the document which
specify these files. The filename should be written without the .tex file
extension:
only the files specified between the curly braces will be included. Note that
you can have one or more files as the argument to this command: separate
them with a comma, no spaces.
\includeonly{filename1,filename2,...}
http://ctan.org/tex-archive/macros/latex/contrib/subfiles
\usepackage{subfiles}
This code would process the base file but only include the content of the author's first and fourth chapters (Chapter_1.tex and Chapter_4.tex).
Importantly, this alternative retains as much of the .aux information as possible from the previous run, so messes up your cross-references much less than
the makeshift suggestion above.
\documentclass{book}
\usepackage{subfiles}
\begin{document}
\end{document}
\documentclass[rootdocument.tex]{subfiles}
\begin{document}
\subfile{filename}
http://tezcatl.fciencias.unam.mx/tex-archive/macros/latex/
contrib/subfiles.zip
Some linux distributions, don't have subfiles package in their latex distributions. You can download subfiles.zip2 to generate subfiles.cls and
subfiles.sty files:
\documentclass[main.tex]{subfiles}
\begin{document}
%% my chapter 1 content
%%
%% more of my chapter 1 content
\end{document}
%% my document content
\subfile{chapter1}
%% more of my document content
\end{document}
http://www.ctan.org/tex-archive/macros/latex/contrib/
pdfpages/
\usepackage[final]{pdfpages}
If you need to insert an existing, possibly multi-page, PDF file into your
LaTeX document, whether or not the included PDF was compiled with LaTeX
or another tool, consider using the pdfpages package3 . In the preamble,
include the package:
wget http://mirror.ctan.org/macros/latex/contrib/subfiles.zip
unzip subfiles.zip
cd subfiles
latex subfiles.dtx
latex subfiles.ins
Instead of putting all the packages you need at the beginning of your document as you could, the best way is to load all the packages you need inside
another dummy package called mystyle you will create just for your document. The good point of doing this is that you will just have to add one single
\includepdf[pages=-]{insertme.pdf}
\includepdf[pages=3-6]{insertme.pdf}
This package also allows you to specify which pages you wish to include: for
example, to insert pages 3 to 6 from some file insertme.pdf, use:
For a list of several packages you can use, see the List of Packages4 section.
Then add all the packages you want with the standard command
\usepackage{...} as you would do normally, change the value of all
the variables you want, etc. It will work like the code you put here would be
copied and pasted within your document.
\ProvidesPackage{mystyle}
Creating your own style is very simple: create a file called mystyle.sty
(you could name it as you wish, but it has to end with ".sty"). Write at the
beginning:
\usepackage in your document, keeping your code much cleaner. Moreover, all the info about your style will be within one file, so when you will start
another document you'll just have to copy that file and include it properly, so
you'll have exactly the same style you have used.
\usepackage{mystyle}
\documentclass[12pt,a4paper]{report}
\usepackage{graphicx}
\usepackage{ifpdf}
\ifpdf
% put here packages only for the PDF:
\DeclareGraphicsExtensions{.pdf,.png,.jpg,.mps}
\usepackage{hyperref}
\else
% put here packages only for the DVI:
\fi
Then create a file called document.tex; this will be the main file, the one
you will compile, even if you shouldn't need to edit it very often because you
will be working on other files. It should look like this (it's the sample code for
a report, but you might easily change it for an article or whatever else):
\end{document}
% Bibliography:
\clearpage
\addcontentsline{toc}{chapter}{Bibliography}
\input{./tex/mybibliography.tex}
\appendix
\input{./tex/myappendix.tex}
\input{./tex/intro.tex}
\input{./tex/main_part.tex}
\input{./tex/conclusions.tex}
\input{./tex/title.tex}
%\maketitle
\tableofcontents
\listoffigures
\listoftables
\begin{document}
5
6
Here a lot of code expressed in previous sections has been used. At the
beginning there is the header discussed in the Tips & Tricks5 section, so
you will be able to compile in both DVI and PDF. Then you import the only
package you need, that is your mystyle.sty (note that in the code it has to be
imported without the extension), then your document starts. Then it inserts
the title: we don't like the output of \maketitle so we created our own,
the code for it will be in a file called title.tex in the folder called tex
we created before. How to write it is explained in the Title Creation6 section.
Then tables of contents, figure and tables are inserted. If you don't want them,
just comment out those lines. Then the main part of the document in inserted.
As you can see, there is no text in document.tex: everything is in other
files in the tex directory so that you can easily edit them. We are separating
our text from the structural code, so we are improving the "What You See is
What You Mean" nature of LaTeX. Then we can see the appendix and finally
Once you created your document.tex you won't need to edit it anymore,
unless you want to add other files in the tex directory, but this is not going to
happen very often. Now you can write your document separating it in as many
files as you want and adding many pictures without getting confused: thanks
to the rigid structure you gave to the project, you will be able to keep track of
all your edits clearly.
and write your vectors inside the new \myvec{...} command. You can
call it as you wish, but you'd better choose a short name because you will
probably write it very often. Then, if you change your mind and you want
your vectors to look differently you just have to change the definition of your
\newcommand{\myvec}[1]{\vec{#1}}
While writing, whenever you have to take a decision about formatting, define
your own command for it and add it to your mystyle.sty:let LaTeX work
for you. If you do so, it will be very easy to change it if you change your mind.
Here is an example: if you are writing a book about Mathematics and you
have to use vectors, you have to decide how they will look. There are several
different standards, used in many books. If a is a vector, some people like to
add an arrow over it (~a), other people write it underlined (a); another common
version is to write it bold (a). Let us assume you want to write your vectors
with an arrow over them; then add the following line in your mystyle.sty.
http://tug.ctan.org/tex-archive/macros/latex/contrib/
subfiles/subfiles.pdf
http://mirror.ctan.org/macros/latex/contrib/pdfpages/
pdfpages.pdf
\myvec{...}. Use this approach whenever you can: this will save you a lot
of time.
In this chapter, I will try to give some hints on how to teach LaTeX new tricks
and how to make it produce output that looks different from what is provided
by default.
Documents produced with the commands you have learned up to this point will
look acceptable to a large audience. While they are not fancy-looking, they
obey all the established rules of good typesetting, which will make them easy
to read and pleasant to look at. However, there are situations where LaTeX
does not provide a command or environment that matches your needs, or the
output produced by some existing command may not meet your requirements.
The following two examples should help you to get the idea. The first example
defines a new command called \wbal that will print "The Wikibook about
LaTeX". Such a command could come in handy if you had to write the title of
this book over and over again.
command. Basically, the command requires two arguments: the name of the
command you want to create, and the definition of the command. The num
argument in square brackets is optional and specifies the number of arguments
the new command takes (up to 9 are possible). If missing it defaults to 0, i.e.
no argument allowed.
\newcommand{name}[num]{definition}
The next example illustrates how to define a new command that takes one
argument. The #1 tag gets replaced by the argument you specify. If you
wanted to use more than one argument, use #2 and so on, these arguments are
added in an extra set of brackets.
\newcommand{\wbal}{The Wikibook
This is \wbal'' \ldots{} \wbal''
LaTeX will not allow you to create a new command that would overwrite an
existing one. But there is a special command in case you explicitly want this:
\renewcommand. It uses the same syntax as the \newcommand command.
\newcommand{\wbalsup}[1] {
This is the Wikibook about LaTeX
supported by #1}
\newcommand{\wbalTwo}[2] {
This is the Wikibook about LaTeX
supported by #1 #2}
% in the document body:
\begin{itemize}
\item \wbalsup{Wikimedia}
\item \wbalsup{lots of users!}
\item \wbalTwo{John}{Doe}
\end{itemize}
\newcommand{name}[num][default]{definition}
In certain cases you might also want to use the \providecommand command. It works like \newcommand, but if the command is already defined,
LaTeX will silently ignore the new command.
NOTE: when the command is used with an explicit first parameter it is given
enclosed with brackets ( "[lots of users]" ).
\end{itemize}
The num argument is used the same way as in the \newcommand command. LaTeX makes sure that you do not define an environment that already exists. If you ever want to change an existing command, you can
use the \renewenvironment command. It uses the same syntax as the
\newenvironment command.
\newenvironment{name}[num]{before}{after}
105
When creating a new environment you may easily get bitten by extra spaces
creeping in, which can potentially have fatal effects. For example when you
want to create a title environment which suppresses its own indentation as well
\begin{king}
My humble subjects \ldots
\end{king}
\newenvironment{king}
{\rule{1ex}{1ex}\hspace{\stretch{1}}}
Figure
{\hspace{\stretch{1}}\rule{1ex}{1ex}}
\begin{simple}
See the space\\to the left.
\end{simple}
Same\\here.
\newenvironment{simple}%
{\noindent}%
{\par\noindent}
Same
here.
Same
here.
\begin{correct}\input{somefile.tex}\end{correct}
Also, if you're still having problems with extra space being appended at the end
of your environment when using the \input for external source, make sure
there is no space between the beginning, sourcing, and end of the environment,
such as:
\begin{correct}
No space\\to the left.
\end{correct}
Same\\here.
\newenvironment{correct}%
{\noindent\ignorespaces}%
{\par\noindent%
\ignorespacesafterend}
No space
to the left.
\usepackage{ifthen}
\ifthenelse{\equal{\blackandwhite}{true}}{
% "black and white" mode; do something..
}{
% "color" mode; do something different..
}
If you work on a Unix-like OS, you might be using Makefiles or any kind
of script to build your LaTeX projects. In that connection it might be interesting to produce different versions of the same document by calling LaTeX
with command-line parameters. If you add the following structure to your
document:
If you define a lot of new environments and commands, the preamble of your
document will get quite long. In this situation, it is a good idea to create a
LaTeX package containing all your command and environment definitions.
You can then use the \usepackage command to make the package available
in your document. Writing a package basically consists of copying the contents
of your document preamble into a separate file with a name ending in .sty.
First the command \blackandwhite gets defined and then the actual file
is read with input. By setting \blackandwhite to false the color version
of the document would be produced.
latex '\newcommand{\blackandwhite}{true}\input{test.tex}'
\RequirePackage{mypack}
5. or
\usepackage{mypack}
3. write whatever you want in it using all the LaTeX commands you know.
Normally you should define new commands or import other packages.
4. import your new package with the known command
note: it has to have the same name of the file without the extension.
It tells LaTeX the name of the package and will allow it to issue a
sensible error message when you try to include a package twice.
\ProvidesPackage{mypack}
1. create a simple text file called mypack.sty (or any other name you like)
and open it with any text editor
2. at the very beginning of the text document just write
\documentclass{mystyle}
It is also possible to create your own style file. The process is similar to the
creation of your own package, you can call your own style file in the preamble
of any document by the command:
Alternatively, it is possible to place the package within /texmf/tex/latex/mypack/mypack.sty where '' is your home directory (On Windows this is often
C:\Users\username) and where mypack is the name of your package. Running
texhash or equivalent will allow you to use your package as detailed above,
but without it needing to be in the same directory as your document.
the file mypack.sty and the LaTeX source you are compiling must be in the
same directory. It will be as though all you have written within your package
is within the document itself.
again, within the style files other files or packages are imported by the requirepackage command.
\ProvidesClass{mystyle}
The name of the style file is then mystyle.cls and can be opened with any text
editor. At the beginning of this file, the following line has to be provided:
http://tug.ctan.org/search.html
Add-on features for LaTeX are known as packages. Dozens of these are preinstalled with LaTeX and can be used in your documents immediately. They
should all be stored in subdirectories of texmf/tex/latex named after
each package. To find out what other packages are available and what they
do, you should use the CTAN search page1 which includes a link to Graham
Williams' comprehensive package catalogue. A package is a file or collection
of files containing extra LaTeX commands and programming which add new
styling features or modify those already existing. Installed package files all
end with .sty (there may be ancillary files as well). When you try to typeset
32. Packages
http://en.wikibooks.org/wiki/LaTeX%2FPackages%
2FInstalling%20Extra%20Packages
\begin{document}
...
\end{document}
\usepackage{color}
\documentclass[11pt,a4paper,oneside]{report}
For example, to use the color package, which lets you typeset in colors, you
would type:
\usepackage{package_name}
Many packages can have additional formatting specifications in optional arguments in square brackets, in the same way as geometry does. Read the
\end{document}
\begin{document}
\title{\color{red}Practical Typesetting}
\author{\color{blue}Name\\ Work}
\date{\color{green}December 2005}
\maketitle
\usepackage{pslatex,palatino,avant,graphicx,color}
\usepackage[margin=2cm]{geometry}
\documentclass[11pt,a4paper,oneside]{report}
and you can have more than one \usepackage command. Some packages
allow optional settings in square brackets. If you use these, you must give the
package its own separate \usepackage command, like geometry shown below:
\usepackage{package1,package2,package3}
teTeX
Distribution
MiKTeX
Path
C:\Program Files\MiKTeX
2.7\doc\latex
/usr/share/texmf-tetex/do
To find out what commands a package provides (and thus how to use it), you
need to read the documentation. In the texmf/doc subdirectory of your
installation there should be directories full of .dvi files, one for every package
installed. This location is distribution-specific, but is typically found in:
\usepackage[option1,option2,option3]{''package_name''}
documentation for the package concerned to find out what can be done. You
can pass several options together separated by a comma:
texdoc <package-name>
On most Linux machines, you can usually automatically open any installed
package documentation with the texdoc command:
Generally, most of the packages are in the latex subdirectory, although other
packages (such as BibTeX and font packages) are found in other subdirectories
in doc. The documentation directories have the same name of the package
(e.g. amsmath), which generally have one or more relevant documents in
a variety of formats (dvi, txt, pdf, etc.). The documents generally have
the same name as the package, but there are exceptions (for example, the
documentation for amsmath is found at latex/amsmath/amsdoc.dvi).
If your installation procedure has not installed the documentation, the DVI files
can all be downloaded from CTAN. Before using a package, you should read
the documentation carefully, especially the subsection usually called "User
Interface", which describes the commands the package makes available. You
cannot just guess and hope it will work: you have to read it and find out.
Here is a (not complete) list of useful packages that can be used for a wide
range of different kind of documents. Each package has a short description
next to it and, when available, there is a link to a section describing such
package in detail. All of them (unless stated) should be included in your
LaTeX distribution as package_name.sty. For more information, refer to the
documentation of the single packages, as described in the previous section.
The list is in alphabetical order.
3
4
amsthm
amssymb
amsmath
array
bm
babel
caption
boxedminipage
it introduces the
boxedminipage environment,
that works exactly like minipage
but adds a frame around it
allows customization of appearance and placement of captions for
figures, tables, etc.
cancel
\cancelto{0}{x}
or
\cancel{x}
cite
changepage
\changepage{textheight}{textwidth}%
{evensidemargin}{oddsidemargin}%
{columnsep}{topmargin}%
{headheight}{headsep}%
{footskip}
7
8
http://en.wikibooks.org/wiki/LaTeX%2FPackages%2FColor
Chapter 9 on page 273
eucal
fancyhdr
esint
easylist
color
9
10
graphicx
glossaries
geometry
fontenc
11
12
http://en.wikibooks.org/wiki/LaTeX%2FPackages%2FHyperref
Chapter 36 on page 953
latexsym
inputenc
indentfirst
hyperref
13
http://en.wikibooks.org/wiki/LaTeX%2FPackages%2FListings
pdfpages
mathrsfs
natbib
listings
14
15
http://en.wikibooks.org/wiki/LaTeX%2FPackages%2FRotating
Chapter 32 on page 859
setspace
rotating
showkeys
16
17
subfiles
showidx
subfig
syntonly
\usepackage{syntonly}
\syntaxonly
18
todonotes
theorem
textcomp
19
20
http://ctan.org/tex-archive/macros/latex/contrib/siunitx
http://en.wikibooks.org/wiki/LaTeX%2FFormatting
ulem
siunitx19
url
21
xypic
wrapfig
verbatim
it improves the verbatim environment, fixing some bugs. Moreover, it provides the comment
environment, that lets you add
multiple-line comments or easily
comment out big parts of the code.
to insert images surrounded by
text. It was discussed in section
Floats, Figures and Captions21
is used to create trees, graphs,
(commutative) diagrams, and similar things.
25
22
23
24
Alphabetic catalogue25
The best way to look for LaTeX packages is the already mentioned CTAN:
Search23 . Additional resources form The TeX Catalogue Online24 :
See
28
26
27
http://www.ctan.org/tex-archive/help/Catalogue/brief.html
http://www.ctan.org/tex-archive/help/Catalogue/bytopic.
html
http://www.ctan.org/tex-archive/help/Catalogue/hier.html
__FORCETOC__
Here are some topics that are not really necessary to write a proper document,
but could help you making your life easier and giving you some details to
modify.
or
\stepcounter{NameOfTheNewCounter}
\newcounter{NameOfTheNewCounter}[NameOfTheOtherCounter]
you create a new counter that is automatically set to zero. If you want the
counter to be reset to zero every time another counter is increased, use:
\newcounter{NameOfTheNewCounter}
In LaTeX it is fairly easy to create new counters and even counters that reset
automatically when another counter is increased (think subsection in a section
for example). With the command
\setcounter{NameOfTheNewCounter}{number}
here the number can also be negative. For automatic reseting you need to use
\stepcounter.
\addtocounter{NameOfTheNewCounter}{number}
or
\section{My Section}
\subsection{My Subsection}
\part{My Part}
\renewcommand{\thesection}{\thepart .\arabic{section}}
Here follows an example where we want to use parts and sections, but no
chapters in the book class :
\addtocounter{mysubsection}{25}
\arabic{mysection}.\arabic{mysubsection}
bla bla and more bla bla
\stepcounter{mysubsection}
\arabic{mysection}.\arabic{mysubsection}
bla bla
\stepcounter{mysection}
\arabic{mysection}.\arabic{mysubsection}
bla bla
\newcounter{mysection}
\newcounter{mysubsection}[mysection]
\addtocounter{mysection}{2} % set them to some other numbers than 0
\addtocounter{mysubsection}{10} % same
%
\arabic{mysection}.\arabic{mysubsection}
bla bla
You can also pack a paragraph of your choice into a box with either the
The past chapters have already dealt with some boxes, although they weren't
described as such. The tabular environment and the \includegraphics,
for example, both produce a box. This means that one can easily arrange two
tables or images side by side. You just have to make sure that their combined
width is not larger than the \textwidth.
Admittedly, this is a very simplistic description of what really happens, but the
point is that TeX operates with glue and boxes. Letters are not the only things
that can be boxes. One can put virtually everything into a box, including other
boxes. Each box will then be handled by LaTeX as if it were a single letter.
LaTeX builds up its pages by pushing around boxes. At first, each letter is a
little box, which is then glued to other letters to form words. These are again
glued to other words, but with special glue, which is elastic so that a series of
words can be squeezed or stretched as to exactly fill a line on the page.
33.2. Boxes
While \parbox packs up a whole paragraph doing line breaking and everything, there is also a class of boxing commands that operates only on horizontally aligned material. We already know one of them; its called \mbox. It
simply packs up a series of boxes into another one, and can be used to prevent
LaTeX from breaking two words. As you can put boxes inside boxes, these
horizontal box packers give you ultimate flexibility.
environment. The pos parameter can take one of the letters c, t or b to control
the vertical alignment of the box, relative to the baseline of the surrounding
text. width takes a length argument specifying the width of the box. The
main difference between a minipage and a \parbox is that you cannot
use all commands and environments inside a parbox, while almost anything is
possible in a minipage.
command or the
\parbox[pos]{width}{text}
The following example shows you some things you could do with the
\makebox and \framebox commands:
width defines the width of the resulting box as seen from the outside (This
means it can be smaller than the material inside the box. You can even
set the width to 0pt so that the text inside the box will be typeset without
influencing the surrounding boxes). Besides the length expressions, you
can also use \width, \height, \depth, and \totalheight in the
width parameter. They are set from values obtained by measuring the typeset
text. The pos parameter takes a one letter value: center, flushleft, flushright, or
spread the text to fill the box.
\makebox[width][pos]{text}
Figure 107
\raisebox{lift}[extend-above-baseline][extend-below-baseline]{text}
Now that we control the horizontal, the obvious next step is to go for the
vertical. No problem for LaTeX. The
\makebox[\textwidth]{%
c e n t r a l}\par
\makebox[\textwidth][s]{%
s p r e a d}\par
\framebox[1.1\width]{Guess Im
framed now!} \par
\framebox[0.8\width][r]{Bummer,
I am too wide} \par
\framebox[1cm][l]{never
mind, so am I}
Can you read this?
Figure 108
\raisebox{0pt}[0pt][0pt]{\Large%
\textbf{Aaaa\raisebox{-0.3ex}{a}%
\raisebox{-0.7ex}{aa}%
\raisebox{-1.2ex}{r}%
\raisebox{-2.2ex}{g}%
\raisebox{-4.5ex}{h}}}
he shouted but not even the next
one in line noticed that something
terrible had happened to him.
command lets you define the vertical properties of a box. You can use
\width, \height, \depth, and \totalheight in the first three parameters, in order to act upon the size of the box inside the text argument:
Here is an example:
\rule[lift]{width}{height}
\begin{framed}
This is an easy way to box text within a document!
\end{framed}
Figure 109
\rule{3mm}{.1pt}%
\rule[-1mm]{5mm}{1cm}%
\rule{3mm}{.1pt}%
\rule[1mm]{1cm}{5mm}%
\rule{3mm}{.1pt}
1
2
http://tug.org/pracjourn/2007-3/henningsen/
http://en.wikibooks.org/wiki/User%3AArnehe
Note: This Wikibook is based on the article Tools for Collaborative Writing
of Scientific LaTeX Documents1 by Arne Henningsen2 that is published in The
PracTeX Journal 2007, number 3 (http://www.tug.org/pracjourn/).
http://www.limsup.com
34.1. Abstract
4
5
6
7
8
http://www.scribtex.com
https://www.sharelatex.com
http://writelatex.com
http://en.wikipedia.org/wiki/Etherpad
http://www.publications.li
The online LaTeX editor ScribTeX4 makes sharing your document with
others very easy. It provides a full LaTeX environment, with all the usual
features of LaTeX like bibtex, images and custom style files. It also provides
full version histories of your files, essential for collaborating. The free
account allows only 3 projects and only one collaborator per project.
ShareLaTeX.com5 is a new cloud based LaTeX editor designed to making
working collaboratively as easy as possible. With real time collaborative
editing similar to google documents it is currently in public beta.
writelatex.com6 is like EtherPad7 for LaTeX. Start writing with one click
and share the link. It supports real time preview, figures, bibliographies and
custom styles. Currently in beta.
publications.li8 is a real-time collaborative LaTeX editor.
9
10
11
12
http://www.verbosus.com
http://monkeytex.bradcater.webfactional.com
http://www.getdropbox.com
http://en.wikipedia.org/wiki/Gobby
13
14
15
16
17
http://docs.google.com
http://docs.latexlab.org
http://titanpad.com
http://etherpad.org/etherpadsites.html
http://en.wikipedia.org/wiki/EtherPad
wget -O filename.tex
"http://titanpad.com/ep/pad/export/xxxx/latest?format=txt" && (latex
filename.tex)
18
19
http://en.wikipedia.org/wiki/Mercurial
http://en.wikibooks.org/wiki/Git
34.2. Introduction
You could use more modern distributed version control systems like Mercurial18 or Git19 .
There are many ways to interchange documents among authors. One possibility
is to compose documents by interchanging e-mail messages. This method has
the advantage that common users generally do not have to install and learn
the usage of any extra software, because virtually all authors have an e-mail
account. Furthermore, the author who has modified the document can easily
attach the document and explain the changes by e-mail as well. Unfortunately,
there is a problem when two or more authors are working at the same time on
the same document. So, how can authors synchronise these files?
20
http://en.wikipedia.org/wiki/List_of_revision_control_
software
21
http://subversion.apache.org/
22
http://www.dyndns.com/
Users do not have to install the SVN server software, but a SVN "client"
software. This is the unique way to access the repositories on the server.
Besides the basic SVN command-line client, there are several Graphical
To set up a SVN version control system, the SVN server software has to
be installed on a (single) computer with permanent internet access. (If this
computer has no static IP address, one can use a service like DynDNS22 to
be able to access the server with a static hostname.) It can run on many Unix,
modern MS Windows, and Mac OS X platforms.
Each user has a local working copy of a remote repository. For instance, users
can update changes from the repository to their working copy, commit changes
from their own working copy to the repository, or (re)view the differences
between working copy and repository.
make changes, and then check it back in. The server records all changes a user
checks in (usually with a message summarizing what changes the user made)
so that other users can easily apply those changes to their own local files.
23
24
25
26
http://subversion.tigris.org/links.html).
http://tortoisesvn.tigris.org/
http://zoneit.free.fr/esvn/
http://kdiff3.sourceforge.net/
Most MS Windows users access the SVN server by the TortoiseSVN24 client,
because it provides the most usual interface for common users. Linux users
usually use SVN utilities from the command-line, or eSvn25 --a GUI frontend-with KDiff326 for showing complex differences.
User Interface Tools (GUIs) and plug-ins for accessing the SVN server (see
http://subversion.tigris.org/links.html).23 Additionally, there are very good
manuals about SVN freely available on the internet (e.g. http://svnbook.redbean.com).
27
28
http://www.tug.org/tetex/)
http://www.miktex.org/)
If a new class or style file has been added (but not if these files have been
modified), the users have to update their 'file name data base' (FNDB) before
On our Subversion server, we have one repository for a common texmf tree.
Its structure complies with the TeX Directory Structure guidelines (TDS,
http://www.tug.org/tds/tds.html, see figure 1). This repository provides LaTeX
classes, LaTeX styles, and BibTeX styles that are not available in the LaTeX
distributions of the users, e.g. because they were bought or developed for the
internal use at our department. All users have a working copy of this repository
and have configured LaTeX to use this as their personal texmf tree. For
instance, teTeX (http://www.tug.org/tetex/)27 users can edit their TeX configuration file (e.g. /etc/texmf/web2c/texmf.cnf) and set the variable
TEXMFHOME to the path of the working copy of the common texmf tree (e.g.
by TEXMFHOME = $HOME/texmf); MiKTeX (http://www.miktex.org/)28
users can add the path of the working copy of the common texmf tree in the
'Roots' tab of the MiKTeX Options.
The Subversion server hosts a separate repository for each project of our department. Although branching, merging, and tagging is less important for writing
text documents than for writing source code for software, our repository layouts follow the recommendations of the 'Subversion book' (http://svnbook.redbean.com). In this sense, each repository has the three directories /trunk,
/branches, and /tags.
they can use these classes and styles. For instance, teTeX users have to execute
texhash; MiKTeX users have to click on the button 'Refresh FNDB' in the
'General' tab of the MiKTeX Options.
Often the question arises, which files should be put under version control.
Generally, all files that are directly modified by the user and that are necessary
for compiling the document should be included in the version control system.
Typically, these are the LaTeX source code (*.tex) files (the main document
and possibly some subdocuments) and all pictures that are inserted in the
document (*.eps, *.jpg, *.png, and *.pdf files). All LaTeX classes
(*.cls), LaTeX styles (*.sty), BibTeX data bases (*.bib), and BibTeX
styles (*.bst) generally should be hosted in the repository of the common
texmf tree, but they could be included in the respective repository, if some
A great feature of a version control system is that all authors can easily trace
the workflow of a project by viewing the differences between arbitrary versions
of the files. Authors are primarily interested in 'effective' modifications of
In this sense, it is very important not to change the positions of line breaks
without cause. Hence, automatic line wrapping of the users' LaTeX editors should be turned off and line breaks should be added manually. Otherwise, if a single word in the beginning of a paragraph is added or removed, all line breaks of this paragraph might change so that most diff
tools indicate the entire paragraph as modified, because they compare the
files line by line. The diff tools wdiff (http://www.gnu.org/software/wdiff/)
and dwdiff (http://os.ghalkes.nl/dwdiff.html) are not affected by the positions of line breaks, because they compare documents word by word. However, their output is less clear so that modifications are more difficult to
the source code that change the compiled document, but not in 'ineffective'
modifications that have no impact on the compiled document (e.g. the position
of line breaks). Software tools for comparing text documents ('diff tools')
generally cannot differentiate between 'effective' and 'ineffective' modifications;
they highlight both types of modifications. This considerably increases the
effort to find and review the 'effective' modifications. Therefore, 'ineffective'
modifications should be avoided.
Furthermore, we split long sentences into several lines so that each line
has at most 80 characters, because it is rather inconvenient to search for
(small) differences in long lines. (Note: For instance, the LaTeX editor Kile
(http://kile.sourceforge.net/) can assist the user in this task when it is configured to add a vertical line that marks the 80th column.) We find it very useful
to introduce the additional line breaks at logical breaks of the sentence, e.g.
before a relative clause or a new part of the sentence starts. An example LaTeX
code that is formatted according to these guidelines is the source code of the
A reasonable convention is to add a line break after each sentence and start
each new sentence in a new line. Note that this has an advantage also beyond
version control: if you want to find a sentence in your LaTeX code that you
have seen in a compiled (DVI, PS, or PDF) file or on a printout, you can easily
identify the first few words of this sentence and screen for these words on the
left border of your editor window.
track. Moreover, these tools cannot be used directly with the Subversion
command-line switch --diff-cmd, but a small wrapper script has to be
used (http://textsnippets.com/posts/show/1033).
29
30
http://en.wikibooks.org/wiki/User%3AArnehe
http://svnbook.red-bean.com/en/1.4/svn.advanced.props.
file-portability.html#svn.advanced.props.special.
eol-style).
31
There is also another important reason for reducing the number of 'ineffective'
modifications: if several authors work on the same file, the probability that the
same line is modified by two or more authors at the same time increases with
the number of modified lines. Hence, 'ineffective' modifications unnecessarily
increase the risk of conflicts (see section Interchanging Documents31 ).
32
http://svnbook.red-bean.com,
Subversion has a feature called 'Keyword Substitution' that includes dynamic version information about a file (e.g. the revision number or the
last author) into the contents of the file itself (see e.g. http://svnbook.redbean.com,32 chapter 3). Sometimes, it is useful to include these information
not only as a comment in the LaTeX source code, but also in the (compiled)
DVI, PS, or PDF document. This can be achieved with the LaTeX packages svn (http://www.ctan.org/tex-archive/macros/latex/contrib/svn/), svninfo
(http://www.ctan.org/tex-archive/macros/latex/contrib/svninfo/), or (preferably) svn-multi (http://www.ctan.org/tex-archive/macros/latex/contrib/svnmulti/).
9.
8.
7.
6.
1.
2.
3.
4.
5.
If the users are willing to let go of the built-in diff utility of SVN and use diff
tools that are local on their workstations, they can put to use such tools that
are more tailored to text documents. The diff tool that comes with SVN was
designed with source code in mind. As such, it is built to be more useful for
files of short lines. Other tools, such as Compare It! allows to conveniently
compare text files where each line can span hundreds of characters (such as
when each line represents a paragraph). When using a diff tool that allows
convenient views of files with long lines, the users can author the TeX files
without a strict line-breaking policy.
10. Use the Subversion client for copying, moving, or renaming files and
folders that are under revision control.
33
34
http://www.ctan.org/tex-archive/support/latexdiff/
http://www.ctan.org/tex-archive/macros/latex/contrib/
changebar/
The tools latexdiff33 and changebar34 can visualize differences of two LaTeX
files inside a generated document. This makes it easier to see impact of certain
changes or discuss changes with people not custom to LaTeX. Changebar
comes with a script chbar.sh which inserts a bar in the margin indicating
parts that have changed. Latexdiff allows different styles of visualization. The
default is that discarded text is marked as red and added text is marked as blue.
It also supports a mode similar to Changebar which adds a bar in the margin.
Latexdiff comes with a script latexrevise which can be used to accept or
decline changes. It also has a wrapper script to support version control systems
such as the discussed Subversion.
35
36
http://www.qtrac.eu/diffpdf.html
http://www.qtrac.eu/comparepdf.html
Writing of scientific articles, reports, and books requires the citation of all
relevant sources. BibTeX is an excellent tool for citing references and creating
bibliographies (Markey 2005, Fenn 2006). Many different BibTeX styles can
The program DiffPDF35 can be used to compare two existing PDFs visually.
There is also a command line tool comparepdf36 based on DiffPDF.
All users edit our bibliographic data base with the graphical BibTeX editor
JabRef (http://jabref.sourceforge.net/). As JabRef is written in Java, it runs on
all major operating systems. As different versions of JabRef generally save
files in a slightly different way (e.g. by introducing line breaks at different
positions), all users should use the same (e.g. last stable) version of JabRef.
Otherwise, there would be many differences between different versions of
.bib files that solely originate from using different version of JabRef. Hence,
it would be hard to find the real differences between the compared documents.
Furthermore, the probability of conflicts would be much higher (see section
'Subversion really makes the difference'). As JabRef saves the BibTeX data
base with the native newline character of the author's operating system, it is
recommended to add the Subversion property 'svn:eol-style' and set it to 'native'
(see section 'Subversion really makes the difference').
Second, we add the BibTeX field location for information about the location, where the publication is available as hard copy (e.g. a book or a copy
of an article). This field can contain the name of the user who has the hard
copy and where he has it or the name of a library and the shelf-mark. This
field can be added in JabRef by selecting Options Set up general
fields and adding the word location (using the semicolon (;) as delimiter) somewhere in the line that starts with General: (see figure 4).
Third, we put all PDF files of publications in a specific subdirectory in our file
server, where we use the BibTeX key as file name. We inform JabRef about
this subdirectory by selecting Options Preferences External
programs and adding the path of the this subdirectory in the field Main
34.8. Conclusion
If we send the LaTeX source code of a project to a journal, publisher, or somebody else who has no access to our common texmf
tree, we do not include our entire bibliographic data base, but extract
the relevant entries with the Perl script aux2bib (http://www.ctan.org/texarchive/biblio/bibtex/utils/bibtools/aux2bib).
First, we plan that all users install the same LaTeX distribution. As the TeX
Live distribution (http://www.tug.org/texlive/) is available both for Unix and
MS Windows operating systems, we might recommend our users to switch
to this LaTeX distribution in the future. (Currently, our users have different
LaTeX distributions that provide a different selection of LaTeX packages and
different versions of some packages. We solve this problem by providing some
packages on our common texmf tree.)
Subversion version control system and several other software tools and LaTeX
packages. However, there are still a few issues that can be improved.
Fenn, Jrgen (2006): Managing citations and your bibliography with BibTeX.
The PracTEX Journal, 4. http://www.tug.org/pracjourn/2006-4/fenn/.
34.10. References
34.9. Acknowledgements
38
37
http://www.ctan.org/tex-archive/info/bibtex/tamethebeast/
ttb_en.pdf.
http://mathoverflow.net/questions/3044/
tools-for-collaborative-paper-writing
Using other software freely available on Internet, you can easily convert DVI
and PDF to other document formats. In particular, you can obtain the PostScript
version using software which is included in your LaTeX distribution. Some
LaTeX IDE will give you the possibility to generate the PostScript version
directly (even if it uses internally a DVI mid-step, e.g. LaTeX DVI PS).
It is also possible to create PDF from DVI and vice versa. It doesn't seem
Strictly speaking, LaTeX source can be used to directly generate two formats:
Other formats can be produced, such as RTF (which can be used in Microsoft
Word) and HTML. However, these documents are produced from software that
parses and interprets the LaTeX files, and do not implement all the features
available for the primary DVI and PDF outputs. Nonetheless, they do work,
and can be crucial tools for collaboration with colleagues who do not edit
documents with LaTeX.
logical to create a file with two steps when you can create it straight away, but
some users might need it because, as you remember from the first chapters,
the format you can generate depends upon the formats of the images you want
to include (EPS for DVI, PNG and JPG for PDF). Here you will find sections
about different formats with description about how to get it.
you will get also a file called my_file.ps that you can delete.
dvi2ps myfile.dvi
ps2pdf myfile.ps
dvipdfm my_file.dvi
pdflatex my_file
35.1.1. Directly
For Linux:
For Windows:
If you have created different PDF documents and you want to merge them into
one single PDF file you can use the following command-line command. You
need to have Ghostscript installed:
1
2
http://pdfshuffler.sourceforge.net/
http://www.accesspdf.com/
Note: If you are merging external PDF documents into a Latex document which
is compiled with pdflatex, a much simpler option is to use the pdfpages
package, e.g.:
Another option to check out is pdftk2 (or PDF toolkit), which is a commandline tool that can manipulate PDFs in many ways. To merge one or more files,
use:
3
4
http://en.wikipedia.org/wiki/Shell%20%28computing%29
http://www2.warwick.ac.uk/fac/sci/statistics/staff/
academic/firth/software/pdfjam
You can also use XeTeX (or, more precisely, XeLaTeX), which works in the
same way as pdflatex: it creates a PDF file directly from LaTeX source. One
35.1.4. XeTeX
Three simple shell3 scripts using the pdfpages package are provided in the
pdfjam bundle4 by D. Firth. They include options for merge several pdf
(pdfjoin), put several pages in one physical sheet (pdfnup) and rotate pages
(pdf90).
\usepackage{pdfpages}
...
\includepdf[pages=-]{Document1.pdf}
\includepdf[pages=-]{Document2.pdf}
...
5
6
http://en.wikipedia.org/wiki/XeTeX
Chapter 14.3 on page 445
from DVI
pdf2ps my_file.pdf
from PDF
Customization of PDF output in XeTeX (setting document title, author, keywords etc.) is done using the configuration of hyperref6 package.
advantage of XeTeX over standard LaTeX is support for Unicode and modern
typography. See its Wikipedia entry5 for more details.
7
8
9
http://en.wikipedia.org/wiki/OpenOffice.org%20Writer
http://en.wikipedia.org/wiki/Microsoft%20Word
http://latex2rtf.sourceforge.net/
LaTeX can be converted into an RTF file, which in turn can be opened by
a word processor such as OpenOffice.org Writer7 or Microsoft Word8 . This
conversion is done through latex2rtf9 , which can run on any computer platform. The program operates by reading the LaTeX source, and mimicking the
behaviour of the LaTeX program. latex2rtf supports most of the standard
implementations of LaTeX, such as standard formatting, some math typesetting, inclusion of EPS, PNG or JPG graphics, and tables. As well, it has some
dvi2ps my_file.dvi
Both latex and (if needed) bibtex commands need to be run before
latex2rtf, because the .aux and .bbl files are needed to produce the
proper output. The result of this conversion will create myfile.rtf, which
you may open in many modern word processors such as Microsoft word or
Open Office.
latex mypaper
bibtex mypaper # if you use bibtex
latex2rtf mypaper
limited support for packages, such as varioref, and natbib. However, many
other packages are not supported.
10
http://hevea.inria.fr
TeX4ht
latex2html
hevea mylatexfile
hevea
11
http://www.cse.ohio-state.edu/~gurari/TeX4ht/
In some cases it may be sufficient to simply copy a region of a PDF (or PS) file
using the tools available in a PDF viewer (for example using LaTeX to typeset
bibtex2html mybibtexfile
for BibTeX
bibtex2html
12
13
To convert from PDF, open your file with GIMP13 . It will ask you which page
you want to convert, whether you want to use anti-aliasing (choose strong if
you want to get something similar to what you see on the screen). Try different
resolutions to fit your needs, but 100 dpi should be enough. Once you have
the image within GIMP, you can post-process it as you like and save it to any
35.5.1. PNG
On *nix the LaTeX package preview and the tool dvipng may be used to
generate png output for small amounts of LaTeX code, for example to render
equations for use in presentations. See LaTeX/Tips_and_Tricks#Generate_png_screenshots12 for more details.
a formula for pasting into a presentation). This however will not generally
have sufficient resolution for whole pages or large areas.
14
15
16
17
http://savannah.nongnu.org/projects/dvipng/
http://www.imagemagick.org/
http://optipng.sourceforge.net/
http://www.cityinthesky.co.uk/pdf2svg.html
Direct conversion from PDF to SVG can be done using the command line tool
pdf2svg17 . (If you are using Linux or FreeBSD or MacPorts, pdf2svg might
also be installable via the package installer.)
35.5.2. SVG
You can optimize the resulting image using optipng16 so that it will take up
less space.
format supported by GIMP, as PNG for example. A method for DVI files is
dvipng14 (usage is the same as dvipdfm). Also, the "convert" command from
the ImageMagick15 suite can convert both DVI and PDF files to PNG.
19
18
http://en.wikipedia.org/wiki/Wikipedia:WikiProject_
Electronics/Ps2svg.sh
http://dvisvgm.sourceforge.net/
One can also use dvisvgm19 , an open source utility that converts from DVI to
SVG.
20
(note the omission of .tex extension). This will output result to standard output.
If you want the plain text go to a file, use
detex yourfile
Most LaTeX distributions come with detex program, which strips LaTeX
commands. It can handle multi-file projects, so all you need is to give one
command:
21
http://code.google.com/p/opendetex/
If the output from detex does not satisfy you, you can try a newer version
available on Google Code21 , or use HTML conversion first and then copy text
from your browser.
1. LaTeX needs to know how to hyphenate the language(s) you are using.
2. You need to use language-specific typographic rules. In French for
example, there is a mandatory space before each colon character (:).
3. You want to be able to insert all the language-specific special characters
directly from your keyboard instead of using cumbersome coding (for
example, type instead of \"{a}).
When you write documents in languages other than English, areas where
LaTeX has to be configured appropriately:
36. Internationalization
You should place it soon after the \documentclass command, so that all
the other packages you load afterwards will know the language you are using.
A list of the languages built into your LaTeX system will be displayed every
time the compiler is started. Babel will automatically activate the appropriate
\usepackage[language]{babel}
The babel package by Johannes Braams will take care of everything. You
can load it in your preamble, providing as an argument the language you want
to use:
36.1. Hyphenating
If you simply need to add a few words from another language, you may find
LaTeX/Accents1 an easier way.
to change the active language. You can also add short pieces of text in another
language using the command
\selectlanguage{languageA}
then the last language in the option list will be active (i.e. languageB), and you
can use the command
\usepackage[languageA,languageB]{babel}
hyphenation rules for the language you choose. If your LaTeX format does not
support hyphenation in the language of your choice, babel will still work but
will disable hyphenation, which has quite a negative effect on the appearance of
the typeset document. Babel also specifies new commands for some languages,
which simplify the input of special characters. See the sections about languages
below for more information.
The [ftp://ftp.tex.ac.uk/tex-archive/macros/latex/required/babel/babel.pdf babel manual] provides much more information on these and many other options.
The starred version of this environment typesets the main text according to the
rules of the other language, but keeps the language specific string for ancillary
things like figures, in the main language of the document. The environment
hyphenrules switches only the hyphenation patterns used; it can also be
used to disallow hyphenation by using the language name 'nohyphenation'.
\begin{otherlanguage}{languageB}
Text in language B. This environment switches all language-related
definitions, like the language
specific names for figures, tables etc. to the other language.
\end{otherlanguage}
Babel also offers various environments for entering larger pieces of text in
another language:
2
3
http://en.wikipedia.org/wiki/PuTTY
http://en.wikipedia.org/wiki/Texmaker
inputenc package tells LaTeX what the text encoding format of your .tex
files is. The encoding depends on your operating system but often a software's
encoding can be changed from the settings (this happens at least with some
editors, the PuTTY2 terminal and TeXmaker3 ). You may choose whichever
encoding you like, but you must say so in the preamble, so for example, if you
prefer to use the ISO-8859-1, write
\usepackage[encoding]{inputenc}
Most of the modern computer systems allow you to input letters of national
alphabets directly from the keyboard. In order to handle variety of input
encoding used for different groups of languages and/or on different computer
platforms LaTeX employs the inputenc package:
using
! Package inputenc Error: Unicode char \u8: not set up for use with
LaTeX.
You
might
encounter
a
situation
where
\usepackage[utf8]{inputenc} might result in error:
The supported encoding by the LaTeX team is utf8 and covers a fairly specific/limited range of unicode input characters. It only defines those symbols
that are known to be available with the current font encoding. utf8x is not
officially supported, but covers a much broader range of input symbols.
\usepackage[utf8]{inputenc}
Most modern operating systems use Unicode (utf-8) as a default encoding for
text. On such system (for example Ubuntu) you can use:
\usepackage[latin1]{inputenc}
Mac
Unix
Operating system
Encodings
Western Latin
applemac
latin1
Cyrillic
maccyr
koi8-ru
When using the inputenc package, you should consider that other people
might not be able to display your input files on their computer, because they use
a different encoding. For example, the German umlaut on OS/2 is encoded
as 132, on Unix systems using ISO-LATIN 1 it is encoded as 228, while in
Cyrillic encoding cp1251 for Windows this letter does not exist at all; therefore
you should use this feature with care. The following encodings may come in
handy, depending on the type of system you are working on:
This is due to the utf8 definition not necessarily having a mapping of all the
character glyphs you are able to enter on your keyboard. Such characters are
for example . In such case, you need to use the utf8x option
to define more character combinations. This might break up compatibility with
some packages like csquotes.
Encodings
Western Latin
ansinew
cp850
Cyrillic
cp1251
cp866nav
fontenc package tells LaTeX how to output the text you have produced.
It defines at which position inside a TeX-font each letter is stored. Multiple
input encodings could be mapped into one font encoding, which reduces
number of required font sets. LaTeX can produce either bitmap-fonts (usually
rasterized to 300 or 600 ppi) or scalable vector fonts (such as Type 1 fonts).
There are many different font sets available containing different sets of glyphs
(characters).
Windows
DOS, OS/2
Operating system
To overcome these shortcomings, several 8-bit CM-like font sets were created.
Extended Cork (EC) fonts in T1 encoding contains letters and punctuation
characters for most of the European languages based on Latin script. The
The default LaTeX font encoding is OT1, the encoding of the original Computer
Modern TeX text fonts. It contains only 128 characters, many from ASCII,
but leaving out some others and including a number that are not in ASCII.
When accented characters are required, TeX creates them by combining a
normal character with an accent. While the resulting output looks perfect,
this approach stops the automatic hyphenation from working inside words
containing accented characters. Besides, some of Latin letters could not be
created by combining a normal character with an accent, to say nothing about
letters of non-Latin alphabets, such as Greek or Cyrillic.
\usepackage[encoding]{fontenc}
http://en.wikipedia.org/wiki/ArabTeX
You can input text in either romanized characters or native Arabic script
encodings. Use any of the following commands/environment to enter in text:
\usepackage{arabtex}
For languages which use the Arabic script, including Arabic, Persian, Urdu,
Pashto, Kurdish, Uyghur, etc., add the following code to your preamble:
http://tug.ctan.org/tex-archive/language/arabic/arabi/
You may use Arabi with Lyx, or with tex4ht to produce HTML. You may also
copy and paste from PDF files produced with Arabi thanks to the support of
the cmap package.
\usepackage[LAE,LFE]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[farsi,arabic]{babel}
You may also use the Arabi package within babel to typeset Arabic and Persian
http://tug.ctan.org/tex-archive/macros/xetex/latex/
xepersian/
http://www.ctan.org/tex-archive/info/lshort/english/lshort.
pdf
See also the Bulgarian translation of the "Not so Short Introduction to LaTeX
2e from http://www.ctan.org/tex-archive/info/lshort/bulgarian/lshort-bg.pdf
Please add the section "Writing in Cyrillic" from http://www.ctan.org/texarchive/info/lshort/english/lshort.pdf7 . You are allowed to copy it.
\usepackage{xepersian}
You may use different encoding, but UTF-8 is becoming standard and it allows
you to have czech quotation marks directly in your text. Otherwise, there
are macros \glqq and \grqq to produce left and right quote or place quotated
text "\uv{here}".
\usepackage[czech]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
36.4.4. Czech
This enables you to type cyrillic letters directly via your keyboard,
but with a different distribution than a standard cyrillic keyboard! To
get the standard distribution, only include: \usepackage[OT1]{fontenc}
\usepackage[russian]{babel}
8
9
http://en.wikipedia.org/wiki/Operating%20system
http://en.wikipedia.org/wiki/PuTTY
The default encoding system can oftenly be changed regardless of the operating
system8 (this happens at least with some editors, the PuTTY9 terminal and
\usepackage[utf8]{inputenc}
This will also automatically change document language (section names, etc.)
to Finnish.
\usepackage[finnish]{babel}
36.4.5. Finnish
10
11
http://en.wikipedia.org/wiki/Texmaker
Chapter 36.4.16 on page 992
\usepackage[T1]{fontenc}
If you want to use European Computer Modern fonts, you should use:
to get the letter . Actually letters like work as well so the same idea
applies also to other European languages like Spanish11 .
\"{a}
The encoding is important and makes sure you can simply write the kkset
as such, which is less cumbersome than having to write
\usepackage[latin1]{inputenc}
TeXmaker10 ). You may choose whichever encoding you like, but you must say
so in the preamble, so for example, if you prefer to use the ISO-8859-1, write
instead
\usepackage[french]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
Some hints for those creating French documents with LaTeX: you can load
French language support with the following command:
36.4.6. French
The ae-package changes encoding to T1 and also loads the scalable version of
Almost European Computer Modern fonts.
\usepackage{ae}
For creating scalable (vector) Type1 fonts instead of bitmapped fonts, you can
substitute the line above with:
input code
\og guillemets \fg{}
M\up{me}, D\up{r}
1\ier{}, 1\iere{},
1\ieres{}
2\ieme{} 4\iemes{}
\No 1, \no 2
20\degres C, 45\degres
M. \bsc{Durand}
2e 4es
N 1, n 2
20 C, 45
M. Durand
rendered output
guillemets
Mme , Dr
1er , 1re , 1res
There are multiple options for typesetting French documents, depending on the
flavor of French: french, frenchb, and francais for Parisian French,
and acadian and canadien for new-world French. All enable French
hyphenation, if you have configured your LaTeX system accordingly. All of
these also change all automatic text into French: \chapter prints Chapitre,
\today prints the current date in French and so on. A set of new commands
also becomes available, which allows you to write French input files more
easily. Check out the following table for inspiration:
hrosme
reoivent
rendered output
1 234,567 89
uvre et uvre
You can load German language support using either one of the two following
commands.
36.4.7. German
You will also notice that the layout of lists changes when switching to the
French language. For more information on what the french option of babel
does and how you can customize its behavior, run LaTeX on file frenchb.dtx
and read the produced file frenchb.pdf or frenchb.dvi.
input code
\nombre{1234,56789}
\OE uvre or \OE{}uvre
and \oe uvre
re\c coivent or
re\c{c}oivent
hro\"isme
This enables German hyphenation, if you have configured your LaTeX system
accordingly. It also changes all automatic text into German. Eg. Chapter
becomes Kapitel. A set of new commands also becomes available, which
allows you to write German input files more quickly even when you dont
use the inputenc package. Check out the table below for inspiration. With
inputenc, all this becomes moot, but your text also is locked in a particular
encoding world.
\usepackage[ngerman]{babel}
\usepackage[german]{babel}
"
In German books you often find French quotation marks (guillemets). German typesetters, however, use them differently. A quote in a German book
would look like this. In the German speaking part of Switzerland, typesetters use guillemets the same way the French do. A major problem arises
from the use of commands like \flq: If you use the OT1 font (which is the
default font) the guillemets will look like the math symbol "", which turns
a typesetters stomach. T1 encoded fonts, on the other hand, do contain the
This preamble enables hyphenation and changes all automatic text to Greek.
A set of new commands also becomes available, which allows you to write
Greek input files more easily. In order to temporarily switch to English and
vice versa, one can use the commands \textlatin{english text}
and \textgreek{greek text} that both take one argument which is
then typeset using the requested font encoding. Otherwise you can use the
command \selectlanguage{...} described in a previous section. Use
\euro for the Euro symbol.
\usepackage[english,greek]{babel}
\usepackage[iso-8859-7]{inputenc}
36.4.8. Greek
required symbols. So if you are using this type of quote, make sure you use
the T1 encoding. (\usepackage[T1]{fontenc})
12
http://www.math.bme.hu/latex/
\usepackage[magyar]{babel}
\usepackage[latin2]{inputenc}
\usepackage[T1]{fontenc}
36.4.9. Hungarian
\begin{abstract}
etta er tdrttur.
\end{abstract}
is needed. This allows the user to write with Icelandic characters and changes
text like the Abstract in
\usepackage[utf8]{inputenc}
\usepackage[icelandic]{babel}
\usepackage[T1]{fontenc}
36.4.11. Italian
at the beginning of your document and you can write in Italian without being
worried of translations and fonts. If you are writing your document without
getting any error, then don't worry about anything else. If you start getting
some unknown errors whenever you use an Italian letter, then you have to
worry about the encoding of your files. As known, any LaTeX source is just
plain text, so you'll have to insert accented letters properly within the text
file. If you write your document using always the same program on the same
computer, you should not have any problem. If you are writing your document
using different programs, if could start getting some strange errors from the
\usepackage[italian]{babel}
\usepackage[latin1]{inputenc}
1. We must be able to edit Korean input files. Korean input files must be in
plain text format
a) Korean using Unicode. These days all three major operating systems (Mac OS, Unix, Windows) come equipped with pretty decent
36.4.12. Korean
compiler. The reason could be that the accented letters were not included
properly within your source file and LaTeX can't recognize them. The reason
is that an editor modified your document with a different encoding from the one
that was used when creating it. Most of the operating systems use UTF-8 as
default, but this could create problems if are using programs based on different
libraries or different operating systems. The best way to solve this problem is
to change the encoding to ISO-8859-1, that includes all the letters you need.
Some text editors let you change the encoding in the settings.
multilingual support and internationalization features so that editing Korean text file is not so much of a problem anymore, even on
non-Korean operating systems. In your text editor (not your word
processor), go to "Settings" and choose UTF-8. Set the preamble
in latex to UTF-8 as well (usepackage with values ucs and utf8x).
Open your Korean keyboard from the keyboard menu, and start
writing.
b) Korean using older formats. The two most widely used encodings
for Korean text files are EUC-KR and its upward compatible extension used in Korean MS-Windows, CP949/Windows-949/UHC.
In these encodings each US-ASCII character represents its normal
ASCII character similar to other ASCII compatible encodings such
as ISO-8859-x, EUC-JP, Big5, or Shift_JIS. On the other hand,
Hangul syllables, Hanjas (Chinese characters as used in Korea),
Hangul Jamos, Hiraganas, Katakanas, Greek and Cyrillic characters and other symbols and letters drawn from KS X 1001 are
represented by two consecutive octets. The first has its MSB set.
Until the mid-1990s, it took a considerable amount of time and ef-
13
http://jshin.net/faq
\usepackage{hangul}
To use the HLATEX package for typesetting your Korean text, put the following declaration into the preamble of your document:
In case you dont need Korean localization features but just want to typeset
Korean text, you can put the following line in the preamble, instead.
This command turns the Korean localization on. The headings of chapters,
sections, subsections, table of content and table of figures are all translated
into Korean and the formatting of the document is changed to follow Korean
conventions. The package also provides automatic particle selection. In
Korean, there are pairs of post-fix particles grammatically equivalent but
different in form. Which of any given pair is correct depends on whether
the preceding syllable ends with a vowel or a consonant. (It is a bit more
complex than this, but this should give you a good picture.) Native Korean
speakers have no problem picking the right particle, but it cannot be determined
which particle to use for references and other automatic text that will change
while you edit the document. It takes a painstaking effort to place appropriate
particles manually every time you add/remove references or simply shuffle
parts of your document around. HLATEX relieves its users from this boring
and error-prone process.
The above code merely allows to use polish letters and translates the automatic
text to polish, so that "chapter" becomes "rozdzia". There are a few additional
things one must remember about.
\usepackage[utf8]{inputenc}
\usepackage{polski}
\usepackage[polish]{babel}
If you plan to use Polish in your utf-8 encoded document, use the following
code
36.4.13. Polish
For more details on typesetting Korean with HLATEX, refer to the HLATEX
Guide. Check out the web site of the Korean TEX User Group (KTUG) at
http://www.ktug.or.kr/.
\usepackage{hfont}
According to polish grammar rules, you have to put dots after numerals in
chapter, section, subsection, etc. headers.
Numerals
yc o
Noc bya sierpniowa, ciepa i~sodka, Ksi
ez
swieca srebrnem
swiatem wg
ebienie, tak,
w blasku.
Poni
zej, na podwrzu zamkowem, wida
c byo u
spione kupy
zonierzy,
a~tak
ze i~ciaa zabitych
podczas dziennej strzelaniny, bo nie znaleziono dotad
czasu na ich
pogrzebanie.
Polish has many single letter connectives: "a", "o", "w", "i", etc., grammar
and typography rules don't allow for them to end a printed line. To ensure that
LaTeX won't set them as last letter in the line, you have to use non breakable
space:
Connectives
\renewcommand\thesection{\arabic{section}.}
\renewcommand\thesubsection{\arabic{section}.\arabic{subsection}.}
\renewcommand\thesubsub
section{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.}
For articles:
\arabic{subsubsection}.}
\renewcommand\thechapter{\arabic{chapter}.}
\renewcommand\thesection{\arabic{chapter}.\arabic{section}.}
\renewcommand\
thesubsection{\arabic{chapter}.\arabic{section}.\arabic{subsection}.}
\renewcommand\the
subsubsection{\arabic{chapter}.\arabic{section}.\arabic{subsection}.%
For books:
14
http://www.ci.pwr.wroc.pl/~pmazur/LaTeX/mwclsdoc.pdf
Full
documentation
for
those
classes
is
available
http://www.ci.pwr.wroc.pl/ pmazur/LaTeX/mwclsdoc.pdf14 (polish)
\documentclass{mwart}
\usepackage[polish]{babel}
\usepackage{polski}
\begin{document}
Pjd
z ki
n
ze t
e chmurno
s
c w gab
flaszy.
\end{document}
Simple usage:
at
mwcls
Alternatively you can use the mwart class instead of article, mwbk
instead of book and mwrep instead of report (those classes have much
more European typography settings but do not require the use of polish babel
settings or character encoding).
To adjust penalties for leaving widows and orphans (clubs in TeX nomenclature) use those commands:
\brokenpenalty=1000
It's much more frowned upon to set pages with hyphenation between pages
than it is customary in American typesetting.
\usepackage{indentfirst}
Indentation
\usepackage{icomma}
Commas in math
\clubpenalty=1000
\widowpenalty=1000
15
16
http://so.pwn.pl/zasady.php
http://dtp.msstudio.com.pl/typo.html
Further information
The alternative is to use the numprint package, but it is much less convenient.
\usepackage[utf8]{inputenc}
if you are in Brazil, you can substitute the language for brazilian portuguese by
choosing: brazilian. The first line is to get everything translated properly,
the second is for being able to input text correctly and the third one to get the
hyphenation of words with diacritics right. Note that we are using the latin1
input encoding here, so this will not work on a Mac or on DOS. Just use the
appropriate encoding for your system. If you are using Linux, use
\usepackage[portuguese]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
36.4.14. Portuguese
\usepackage[spanish]{babel}
36.4.16. Spanish
\usepackage[slovak]{babel}
\usepackage[IL2]{fontenc}
\usepackage[utf8]{inputenc}
Basic settings are fine when left the same as Czech, but Slovak needs special
signs for d,t,l. To be able to type them from keyboard use the following
settings
36.4.15. Slovak
\usepackage[spanish,mexico]{babel}
\def\spanishoptions{mexico}
\usepackage[spanish]{babel}
The trick is that Spanish has several options and commands to control the
layout. The options may be loaded either at the call to Babel, or before,
by defining the command \spanishoptions. Therefore, the following
commands are roughly equivalent:
The macro \spanishoperators{list of operators} contains a list of spanish mathematical operators, and may be redefined at will. For instance, the
command \def\spanishoperators{sen} only defines sen, overriding
all other definitions; the command \let\spanishoperators\relax
disables them all. This command supports accented or spaced operators: the
The other commands modify the spanish layout after loading babel. Two particularly useful commands are \spanishoperators and
\spanishdeactivate.
simplify the way LyX customizes some features of the Spanish layout from
inside the GUI.
Please check the documentation for Babel or spanish.dtx for further details.
\usepackage[latin1]{inputenc}
\usepackage[utf8]{inputenc}
The rules for producing characters with diacritical marks, such as accents,
differ somewhat depending whether you are in text mode, math mode, or the
tabbing environment.
37. Accents
\usepackage{lmodern}
Of course, the encoding in the text editor needs to be set to utf8, as well.
Depending on the used UTF8 characters, one needs to specify a font that
actually includes them (and supports the T1 font enconding). E.g. for German
related special characters:
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
The Unicode character encoding UTF8 includes several special characters and
characters with accents. The following code specifies that the encoding of
the LaTeX document source file is UTF8. Font encoding is specified as T1,
because it supports the encoding of extended character sets in fonts.
The following accents may be placed on letters. Although "o" is used in most
of the examples, the accents may be placed on any letter. Accents may even
be placed above a "missing" letter; for example, \{} produces a tilde over a
blank space.
With XeTeX and LuaTeX the inputenc and fontenc package are no longer
needed and replaced by the fontspec package. Both engines support UTF-8
directly and allow the use of TTF and OpenType fonts to support Unicode
characters. See the XeTeX section1 in the Fonts chapter of this book for more
information.
Sample
LaTeX command
\{o}
\'{o}
\{o}
\"{o}
\H{o}
\{o}
\c{c}
\k{a}
\l
\={o}
\b{o}
Description
grave accent
acute accent
circumflex
umlaut or dieresis
long Hungarian umlaut (double acute)
tilde
cedilla
ogonek
l with stroke
macron accent (a bar
over the letter)
bar under the letter
oo
Description
dot over the letter
dot under the letter
ring over the letter
(for there is also
the special command
\{aa})
breve over the letter
caron/hacek ("v")
over the letter
"tie" (inverted u) over
the two letters
and
\i
\t{oo}
\u{o}
\v{s}
Sample
LaTeX command
\.{o}
\d{u}
\r{a}
More information regarding language configuration can be found in the Internationalization2 section.
. This provides the short hand "o for \"{o}. This is very useful if one
needs to use some text accents in a label, since no backslash will be accepted
otherwise.
\usepackage[ngerman]{babel}
. For example:
\j
\acute{o}
\check{o}
o
\tilde{o}
o
e
\widetilde{oo}
oo
LaTeX comSample
mand
\hat{o}
o
b
\widehat{oo} oo
circumflex
wide version
of \hat over
several letters
vee or check
tilde
wide version of
\tilde over
several letters
acute accent
Description
\'
\v
\
Text-mode
equivalence
\
Several of the above and some similar accents can also be produced in math
mode. The following commands may be used only in math mode.
grave accent
dot over the
letter
two dots over
the letter (umlaut in textmode)
breve
macron
vector (arrow)
over the letter
o`
o
o
o
o
~o
\ddot{o}
\breve{o}
\bar{o}
\vec{o}
\u
\=
\"
Text-mode
equivalence
\
\.
When applying accents to letters i and j, you can use \imath and \jmath to
keep the dots from interfering with the accents:
Description
Sample
LaTeX command
\grave{o}
\dot{o}
Sample with
upper dot
i
circumflex on
letter i without
upper dot
~j
vector (arrow)
on letter j without upper dot
Description
Some of the accent marks used in running text have other uses in the tabbing
environment. In that case they can be created with the following command:
\vec{\jmath}~
LaTeX comSample
mand
\hat{\imath}
If you find it awkward, you can use the gensymb package which provides a
\degree command.
$90^\circ{}$
The usage of the T1 font encoding influences the usability of pdf output
(generated via pdflatex). For example without specifying T1, extracting the
umlaut via a PDF viewer actually extracts the two characters "A. Analog
to that, a PDF viewer cannot find words with umlauts in a PDF document
which was generated via pdflatex without the T1 font enconding. With T1 font
enconding (and even with composed special characters) the PDF contains the
correct text information.
Using the package textcomp sets this and other characters up.
Package inputenc Error: Unicode char \u8: C not set up for use with
LaTeX.
http://spectroscopy.mps.ohio-state.edu/symposium_53/
latexinstruct.html
http://www.giss.nasa.gov/tools/latex/ltx-401.html
more with fonts like lmodern. Using the ae package leads to text encoding
problems in PDF files generated via pdflatex (e.g. text extraction and
searching), besides typographic issues.
will output:
\renewcommand{\LaTeX}{{\rm \LaTeX}}
If you insert the \LaTeX command in an area with a non-default font, it will
be formatted accordingly. If you want to keep LaTeX written in Computer
Modern roman shape, you must redefine the function. However, the naive
\let\LaTeXtemp\LaTeX
\renewcommand{\LaTeX}{{\rm \LaTeXtemp }}
\newcommand{\LaTeXtemp}{\LaTeX}
\renewcommand{\LaTeX}{{\rm \LaTeXtemp}}
Sadly,
1
2
http://en.wikipedia.org/wiki/Full%20stop
http://en.wikipedia.org/wiki/The%20Chicago%20Manual%20of%
20Style
If the command \frenchspacing is used in the preamble, the space between sentences is always consistent.
If you simply use the forms "i.e." or "e.g.", LaTeX will treat the periods
as end of sentence periods (i.e. full stop1 ) since they are followed by a space,
and add more space before the next "sentence". To prevent LaTeX from adding
space after the last period, the correct syntax is either "i.e.\ " or "e.g.\
".
The same can be done with similar counter types and document units such as
"subsection".
\usepackage{amsmath}
\numberwithin{equation}{section}
\numberwithin{figure}{section}
For long documents the numbering can become cumbersome as the numbers
reach into double and triple digits. To reset the counters at the start of each
section and prefix the numbers by the section number, include the following in
the preamble.
or, if you don't have this package, you can add the following text just after
\documentclass[...]{...} :
\usepackage{ifpdf}
\ifpdf
% we are running pdflatex
\else
% we are running latex
\fi
this is plain TeX code. The ifpdf package and this code, both define a new
if-else you can use to change your code according to the compiler you are
using. After you have used this code, you can use whenever you want in your
document the following syntax:
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse
\else
\ifnum\pdfoutput=1
\pdftrue
\else
\pdffalse
\fi
\fi
It is often preferable to use the same font and font size in your images as in
the document. Moreover, for scientific images, you may need mathematical
formulae or special characters (such as Greek letters). Both things can be
achieved easily if the image editor allows you to use LaTeX code in your
image. Most vector image editors do not offer this option. There are, however,
a few exceptions.
place after \ifpdf the code you want to insert if you are compiling with
pdflatex, place after \else the code you want to insert if you are compiling
with latex. For example, you can use this syntax to load different packages or
different graphic file formats3 according to the compiler.
4
5
6
7
http://en.wikipedia.org/wiki/Xfig
http://en.wikipedia.org/wiki/Ipe_%28program%29
http://en.wikipedia.org/wiki/Inkscape
http://pav.iki.fi/software/textext/
A very versatile vector image editor is Inkscape6 . It does not support LaTeX
text by itself, but you can use the plugin Textext7 for that. This allows you to
In early days, LaTeX users used Xfig4 for their drawings. The editor is still
used by quite a few people nowadays because it has special 'export to LaTeX'
features. It also gives you some very basic ways of encapsulating LaTeX text
and math in the image (setting the text's 'special flag' to 'special' instead of
'normal'). When exporting, all LaTeX text will be put in a .tex-file, separately
from the rest of the image (which is put in a .ps file).
http://en.wikipedia.org/wiki/Asymptote_%28vector_graphics_
language%29
LaTeXDraw is a free and open source graphical PSTricks generator and editor.
It allows you to draw basic geometric objects and save the result in a variety
of formats including .jpg, .png, .eps, .bmp as well as .tex. In the last case the
saved file contains PSTricks/LaTeX code only. Owing to that you can include
any possible LaTeX code in the picture, since the file is rendered by your
LaTeX environment directly.
put any block of LaTeX code in your image. Additionally since version 0.48
you can export to vectorgraphics with texts separated in a .tex file. Using this
way text is rendered by the latex compiler itself.
http://en.wikipedia.org/wiki/gnuplot
Using Microsoft Excel 2010, charts can be copied directly to Microsoft Expression Design 4, where they can be saved as PDF files. These PDF files can
be included in LaTeX. This method produces high quality vectorized images.
-1
-0.5
0 0
0.5
0.5
1.5
1.5
2.5
Figure 115 gnuplot can plot various numerical data, functions, error
distribution as well as 3D graphs and surfaces
-1.5
\input{graph1.tex}
Now gnuplot produces two files: the graph drawing in graph.eps and the
text in graph.tex. The second includes the EPS image, so that we only
need to include the file graph.tex in our document:
Some editors will think of all following text as part of a formular and highlight
it as such (because of the '$' that is interpreted as part of the latex code). This
can be avoided by ending with:
(2*($1)):2
\begin{gnuplot}[terminal=epslatex, terminaloptions=color,
scale=0.9, linewidth=2 ]
...
\end{gnuplot}
When you are using gnuplottex it is also possible to directly pass the terminal
settings as an argument to the environment
With the included tex file we can work as with an ordinary image.
eps2pdf graph1.eps
sed -i s/".eps"/".pdf"/g graph1.tex
When using pdfLaTeX instead of simple LaTeX, we must convert the EPS
image to PDF and to substitute the name in the graph1.tex file. If we are
working with a Unix-like shell, it is simply done using:
As it uncomments the dollar sign for the gnuplot interpreter, but is not affecting
the interpretation of the .tex by the editor.
#$
\end{gnuplot}
10
http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.
html
This section describes how to generate a png screenshot of a LaTeX page using
the *nix tool dvipng and the LaTeX package preview. This screenshots
are useful, for example, if you want to include a LaTeX generated formula
This way, if we choose to output to PS or DVI, the EPS version is used and if
we output to PDF directly, the converted PDF graphics is used. Please note
that usage of epstopdf requires compiling with latex -shell-escape.
\includegraphics{graph1}
(3)k
12
.
k=0 2k + 1
to see if you have dvipng installed on your machine and ready to use. Again,
if you get a directory, you are ready to start doing screenshot of LaTeX pages.
Say you want to take a screenshot of
which dvipng
on a console and if locate returns a directory, then you are good. Next, type
locate preview.sty
Run LaTeX as usual to generate the dvi file foo.dvi. Note the active
option in the package declaration and the preview environment around the
equation's code. Without any of these two, you won't get an dvi output. Now,
we want an X font size formula, where X is measure in pixels. You need
to convert this, to dots per inch (dpi). The formula is: <dpi> = <font_px>*72.27/10. If you want, for instance, X = 32, then the size in dpi
corresponds to 231.26. This value will be passed to dvipng using the flag
D. To generate the desired png file run the command as follows:
\documentclass{article}
\usepackage[active]{preview}
\begin{document}
\begin{preview}
\[
\pi = \sqrt{12}\sum^\infty_{k=0} \frac{(-3)^{-k}}{2k+1}
\]
\end{preview}
\end{document}
ispell yourfile.tex
aspell -c yourfile.tex
hunspell -l -t -i utf-8 yourfile.tex
The flag -T sets the size of the image. The option tight will only include
all ink put on the page. The option -o sends the output to the file name
foo.png.
11
12
13
14
http://en.wikipedia.org/wiki/LyX
http://en.wikipedia.org/wiki/Kile
http://en.wikipedia.org/wiki/Emacs
Chapter 35.6 on page 951
detex yourfile | wc
If you want to count words you can, again, use LyX or convert your LaTeX
source to plain text and use, for example, UNIX wc command:
Both understand LaTeX and will skip LaTeX commands. You can also use a
LaTeX editor with built-in spell checking, such as LyX11 , Kile12 , or Emacs13 .
Last another option is to convert LaTeX source to plain text14 and open resulting file in a word processor like OpenOffice.org or KOffice.
\usepackage{ifthen}
However, LaTeX doesn't give you the ability to get a new even-side page. The
following method opens up this;
\cleardoublepage
In the twoside-mode you have the ability to get a new odd-side page by:
1. pdflatex yourfile.tex
2. pdftotext yourfile.pdf
3. wc yourfile.txt
If the given page is an odd-side page, the next new page is subsequently an
even-side page, and LaTeX will do nothing more than a regular \newpage.
However, if the given page is an even page, LaTeX will make a new (odd)
page, put in a placeholder, and make another new (even) page. A crude but
effective method.
\newevenside
To active the new even-side page, type the following where you want the new
even-side:
\newcommand{\newevenside}{
\ifthenelse{\isodd{\thepage}}{\newpage}{
\newpage
\phantom{placeholder} % doesn't appear on page
\thispagestyle{empty} % if want no header/footer
\newpage
}
}
\usepackage{eso-pic}
...
\AddToShipoutPicture{%
\AtPageLowerLeft{%
\rotatebox{90}{%
\begin{minipage}{\paperheight}
\centering\textcopyright~\today{} Humble me
\end{minipage} %
}
} %
}%
If you want to put a sidebar with information like copyright and author, you
might want to use the eso-pic package. Example:
Please note that the folder tmp should exist. However if you're using linux you
can do something like this:
If you're using pdflatex you can create a folder in which all the output files will
be stored, so your top directory looks cleaner.
tmp
-interaction=nonstopmode $*; cp tmp/*.pdf .'
Appendix
Part VI.
http://www.andy-roberts.net/misc/latex/index.html
The following books have been included in this wikibook (or we are working
on it!), with permission of the author:
39. Authors
3
4
5
http://www.ctan.org/tex-archive/info/lshort/english/lshort.
pdf
http://it.oetiker.ch/
http://homepage.boku.ac.at/partl/
http://www.ctan.org/tex-archive/info/beginlatex/
beginlatex-3.6.pdf
6
7
8
http://silmaril.ie/cgi-bin/blog
http://sarovar.org/projects/ltxprimer/
http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/
work. The original book is released under the GNU Free Documentation
License, the same as Wikibooks. For more information, his personal website
is http://silmaril.ie/cgi-bin/blog6 (Working...)
LaTeX Primer7 from the Indian TeX Users Group. Their document is released under the GNU Free Documentation License, the same as Wikibooks,
so we can include parts of their document as we wish. In any case, we have
contacted Indian TeX Users Group and they allowed us to do it. (Working...)
David Wilkins' Getting started with LaTeX8 . The book is not released
under any free license, but we have contacted the author asking him for the
permission to use parts of his book on Wikibooks. He agreed: his work
is still protected but you are allowed to copy the parts you want on this
Wikibook. If you see text on both the original work and here, then that part
(and only that part) is released under the terms of GFDL, like any other text
here on Wikibooks. (Working...)
9
10
http://en.wikibooks.org/wiki/User%3AAlejo2083
http://en.wikibooks.org/wiki/User%3AJtwdog
Alessio Damato9
Jtwdog10
1
2
http://en.wikipedia.org/wiki/TeX
http://en.wikipedia.org/wiki/LaTeX
w:TeX1 w:LaTeX2
40. Links
3
4
5
6
http://www.tug.org/
http://uk.tug.org/
http://www.tug.org.in/
http://www.ctan.org/
The TeX Users Group3 Includes links to free versions of (La)TeX for many
kinds of computer.
UK-TUG4 The UK TeX Users' Group
TUGIndia5 The Indian TeX Users Group
[news:comp.text.tex comp.text.tex] Newsgroup for (La)TeX related questions
CTAN6 hundreds of add-on packages and programs
40.0.1. Community
http://www.ctan.org/tex-archive/info/lshort/english/lshort.
pdf
http://www.ams.org/tex/amslatex.html
40.0.2. Tutorials/FAQs
http://www.ctan.org/tex-archive/info/epslatex.pdf
The UK TeX FAQ List of questions and answers that are frequently posted
at comp.text.tex
http://www.tex.ac.uk/faq
TeX on Mac OS X: Guide to using TeX and LaTeX on a Mac
http://www.rna.nl/tex.html
Text Processing using LaTeX
http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/
The (La)TeX encyclopaedia
http://tex.loria.fr/index.html
Hypertext Help with LaTeX
http://www.giss.nasa.gov/latex/
EpsLatex: a very comprehensive guide to images, figures and graphics
http://www.ctan.org/tex-archive/info/epslatex.pdf9
The Comprehensive LaTeX Symbol List (in PDF)
http://www.ctan.org/tex-archive/info/symbols/comprehensive/symbolsa4.pdf
10
11
12
http://www.latex-project.org/
http://www.ctan.org
http://www.tug.org/tds/
40.0.3. Reference
15
16
17
13
14
http://www.math.missouri.edu/~stephen/naturalmath/
http://www.ctan.org/tex-archive/info/l2tabu/english/
l2tabuen.pdf
http://www.LaTeXTemplates.com
http://openwetware.org/wiki/LaTeX_template_for_PhD_thesis
http://www.cs.ucl.ac.uk/research/students/Latexforthesis.
htm
A resource for free high quality LaTeX templates for a variety of applications15
LaTeX template for writing PhD thesis16 , 2007
UCL computer department thesis template17
40.0.4. Templates
18
http://www.cs.utexas.edu/users/jbednar/latex/
41. Installation
UNIX and Linux users have a wide choice of distributions; the most common
are teTeX and TeX Live. As of May 2006 teTeX is no longer actively maintained and its former maintainer Thomas Esser recommended TeX Live as the
41.1.1. UNIX/Linux
TeX and LaTeX are available for most computer platforms, since they were
programed to be very portable. They are most commonly installed using a
distribution, such as teTeX, MiKTeX, or MacTeX. This, however, does not
include any editor or advanced graphical user interface. Other programs, that
are not part of the distribution, are used to write and prepare TeX and LaTeX
files.
3
4
5
6
7
41.1.2. Mac OS X
replacement.1 Ubuntu2 and Debian3 users can install one (not both!) of these
systems using the system's apt4 package manager.
8
9
http://miktex.org/
http://www.scribtex.com/
To get started without needing to install anything, users can use ScribTeX9
which is a completely online LaTeX compiler, based on the TeX Live distribution.
41.1.4. Online
Microsoft Windows users can install MiKTeX8 onto their computer. This
distribution has advanced features, such as automatic installation of packages,
and simple interfaces to modify settings, such as default paper sizes.
10
11
12
13
14
15
http://texstudio.sourceforge.net/
http://www.xm1math.net/texmaker/
http://www.vim.org/
http://vim-latex.sourceforge.net/
http://www.gnu.org/software/emacs/
http://www.gnu.org/software/auctex/
TexStudio10
Texmaker11
Vim12 with Vim-LaTeX13 Vimscript plugin
Emacs14 with AUCTeX15
Cross-platform
TeX and LaTeX source documents (as well as related files) are all text files,
and can be opened and modified in almost any text editor. A few recommended
editors include:
41.2. Editors
16
17
18
19
20
21
http://www.scribtex.com/
http://www.verbosus.com/
http://www.tug.org/texworks/
http://gummi.midnightcoding.org/
http://kile.sourceforge.net/
http://www.uoregon.edu/~koch/texshop/
Windows-only
TeXShop21
Mac OS X-only
Kile20
Linux-only
LEd22
TeXnicCenter23
WinEdt24
WinShell25
22
23
24
25
http://www.latexeditor.org/
http://www.texniccenter.org/
http://www.winedt.com/
http://www.winshell.de/
Cross-platform
Bibliography files (*.bib) are most easily edited and modified using a management system. These graphical user interfaces all feature a database form,
where information is entered for each reference item, and the resulting text file
can be used directly by BibTeX.
26
27
28
http://jabref.sourceforge.net/
http://www.mendeley.com//
http://bibdesk.sourceforge.net/
BibDesk28
Mac OS X-only
JabRef26
Mendeley27
29
30
http://en.wikipedia.org/wiki/Xfig
http://www.cygwin.com/
Xfig29 is a basic program that can produce vector graphics, which can be
exported to PSTEX. It can be installed on UNIX/Linux platforms. With
Ubuntu or Debian distributions, it can be easily installed using apt.
41.4.1. Xfig
31
32
33
34
35
http://en.wikipedia.org/wiki/Inkscape
http://en.wikipedia.org/wiki/Encapsulated%20PostScript
http://en.wikipedia.org/wiki/Portable%20Document%20Format
Chapter 11 on page 343
http://www.elisanet.fi/ptvirtan/software/textext/index.
html
Inkscape31 is an open source vector graphics editor, which can export images to
EPS32 or PDF33 files, which may then be imported into LaTeX (see ../Importing
Graphics34 ). It can run natively under Windows, Linux or Mac OS.
41.4.2. Inkscape
36
37
http://en.wikipedia.org/wiki/OpenOffice.org
http://en.wikibooks.org/wiki/LaTeX%2FPackages%
2FInstalling%20Extra%20Packages
41.6. References
It is also possible to export vector graphics to EPS format using OpenOffice.org36 Draw, which is an open source office suite available for Windows,
Linux and Mac.
41.4.3. OpenOffice.org
http://www.uz.ac.zw/science/maths/latex/ltx-86.html
First, we introduce the LaTeX measurement units. All LaTeX units are twoletter abbreviations. You can choose from a variety of units. Here are the most
common ones.1
42.1. Units
Definition
a point is 1/72.27
inch, that means about
0.0138 inch or 0.3515
mm.
a millimeter
a centimeter
inch
roughly the height of
an 'x' in the current
font
roughly the width of
an 'M' (uppercase) in
the current font
undefined, depends
on the font used
2.84
28.4
72.27
undefined, depends
on the font used
http://www.uz.ac.zw/science/maths/latex/ltx-86.html
em
mm
cm
in
ex
Abbreviation
pt
Definition
a big point is 1/72
inch, that means about
0.0139 inch or 0.3527
mm.
pica
didt (1157 didt =
1238 points)
ccero (12 didt)
scaled point (65536sp
per point)
\baselineskip
cc
sp
pc
dd
Abbreviation
bp
12.84
0.000015
12
1.07
\oddsidemargin
\linewidth
\evensidemargin
\columnwidth
\columnsep
Multiplies \baselineskip
\baselinestretch
\textheight
\tabcolsep
\parskip
\parindent
\paperheight
\paperwidth
You can change the values of the variables defining the page layout with two
commands. With this one you can set a new value:
\unitlength
\topmargin
\textwidth
When using these commands, you may duplicate the text that you want to use
as reference if you plan to also display it. But LaTeX also provides a set of
commands to avoid this duplication:
\settowidth{parameter}{some text}
\settoheight{parameter}{some text}
\settodepth{parameter}{some text}
You may also set a length from the size of a text with one of these commands:
\newlength{parameter}
\addtolength{parameter}{length}
with this other one, you can add a value to the existing one:
\setlength{parameter}{length}
42.4. Samples
You may wish to look at the example below to see how you can use these.
The command \newsavebox creates a placeholder for storing a text; the
command \savebox stores the specified text in this placeholder, and does
not display anything in the document; and \usebox recalls the content of the
placeholder into the document.
\newsavebox{boxname}
\savebox{boxname}{some text}
\usebox{boxname}
\addtolength{\itemsep}{0.5\baselineskip}
\includegraphics[width=0.5\textwidth]{mygraphic}
http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/squeeze.
html
42.5. References
This section will guide you through the various text, paragraph, and page
formatting techniques. Formatting tends to refer to most things to do with
appearance, so it makes the list of possible topics quite eclectic: text style,
font, size, etc.
\linespread{factor}
If you want to use larger inter-line spacing in a document, you can change its
value by putting the
43.1. Spacing
LaTeX is so flexible that we will actually only skim the surface, as you can
have much more control over the presentation of your document if you wish.
Having said that, one of the purposes of LaTeX is to take away the stress of
having to deal with the physical presentation yourself, so you need not get too
carried away!
\begin{doublespace}
To change line spacing within the document, the setspace package provides
the environments singlespace, onehalfspace, doublespace and
spacing:
\usepackage{setspace}
%\singlespacing
\onehalfspacing
%\doublespacing
%\setstretch{1.1}
The setspace package allows more fine-grained control over line spacing.
To set "one and a half" line spacing document-wide, but not where it is usually
unnecessary (e.g. footnotes, captions):
line spacing. Normally the lines are not spread, so the default line spread factor
is 1.
If such a space should be kept even if it falls at the end or the start of a line,
use \hspace* instead of \hspace. The length in the simplest case is just a
\hspace{length}
\begin{spacing}{2.5}
This paragraph has \\ huge gaps \\ between lines.
\end{spacing}
x\hspace{\stretch{1}}
x\hspace{\stretch{3}} x
generates a special rubber space. It stretches until all the remaining space on
a line is filled up. If two \hspace{\stretch{n}} commands are issued
on the same line, they grow according to the stretch factor.
\stretch{n}
The command:
number plus a unit, e.g. \hspace{1.5 cm}. For a list of the possible units,
see the Useful Measurement Macros1 appendix.
This command should normally be used between two empty lines. If the space
should be preserved at the top or at the bottom of a page, use the starred
version of the command, \vspace*, instead of \vspace. The \stretch
\vspace{length}
\parskip 7.2pt
It's important you use the \vspace* command instead of \vspace, otherwise LaTeX can silently ignore the extra space.
{ \vspace*{length} }
If you want to add space at the beginning of the document, without anything
else written before, then you may use
command.
\\[length]
Additional space between two lines of the same paragraph or within a table is
specified with the
causes the words listed in the argument to be hyphenated only at the points
marked by -. The argument of the command should only contain words
\hyphenation{word list}
43.2. Hyphenation
Several macros allow filling the rest of the line -- or stretching parts of the line
-- in different manners:
\hyphenation{FORTRAN Hy-phen-a-tion}
The hyphenation hints are stored for the language that is active when the
hyphenation command occurs. This means that if you place a hyphenation
command into the preamble of your document it will influence the English language hyphenation. If you place the command after the \begin{document}
and you are using some package for national language support like babel, then
the hyphenation hints will be active in the language activated through babel.
The example below will allow hyphenation to be hyphenated as well as
Hyphenation, and it prevents FORTRAN, Fortran and fortran from
being hyphenated at all. No special characters or symbols are allowed in the
argument. Example:
built from normal letters, or rather characters that are considered to be normal
letters by LaTeX. It is known that the hyphenation algorithm does not find
all correct American English hyphenation points for several words. A log of
known exceptions is published periodically in the TUGboat journal. (See a
2008 list: http://www.tug.org/TUGboat/Articles/tb29-2/tb92hyf.pdf)
This can be quite cumbersome if one has many words that contain a dash
like electromagnetic-endioscopy. One alternative to this is using the \hyp
command of the hyphenat package. This command typesets a hyphen and
\begin{minipage}{2in}
I think this is: su\-per\-cal\-%
i\-frag\-i\-lis\-tic\-ex\-pi\-%
al\-i\-do\-cious
\end{minipage}
\hyphenpenalty=100000
\fbox is similar to \mbox, but in addition there will be a visible box drawn
around the content.
To avoid hyphenation altogether, the penalty for hyphenation can be set to an
extreme value:
\mbox{text}
Several words can be kept together on one line with the command
electromagnetic\hyp{}endioscopy
allows full automatic hyphenation of the other words forming the compound
word. One would thus write
LaTeX treats left and right quotes as different entities. For single quotes,
(on American keyboards, this symbol is found on the tilde key (adjacent to
the number 1 key on most) gives a left quote mark, and ' is the right. For
double quotes, simply double the symbols, and LaTeX will interpret them
43.3. Quote-marks
will widen the text width and reduce the amount of margin overruns.
\usepackage{geometry}
You can change the degree to which LaTeX will hyphenate by changing the
value of \tolerance=1000 and \hyphenpenalty=1000. You'll have
to experiment with the values to achieve the desired effect. A document which
has a low tolerance value will cause LaTeX not to tolerate uneven spacing
between words, hyphenating words more frequently than in documents with
higher tolerances. Also note that using a higher text width will decrease the
probability of encountering badly hyphenated word. For example adding
To quote" in Latex
To quote'' in Latex
To quote' in Latex
Figure 118
Figure 117
Figure 116
accordingly. (Although, you can use the " for right double quotes if you wish).
On British keyboards, ' ' is left of the ' 1 ' key and shares the key with '
', and sometimes ' ' or ' | '. The apostrophe (' ' ') key is to the right of the
colon/semicolon key and shares it with the ' @ ' symbol.
Figure 119
\usepackage[T1]{fontenc}
For left bottom quote and European quoting style you need to use T1 font
encoding enabled by:
The right quote is also used for apostrophe in LaTeX without trouble.
Figure 121
,,Prosz
e, naci
snij klawisz <<x>>''.
To ,,quote'' in Latex
The package csquotes offers a multi-lingual solution to quotations, with integration to citation mechanisms offered by BibTeX. This package allows one for
example to switch languages and quotation styles according to babel language
selections.
\nonfrenchspacing
which tells LaTeX not to insert more space after a period than after ordinary
character. Frenchspacing can be turned off later in your document via the
\frenchspacing
To get a straight right margin in the output, LaTeX inserts varying amounts
of space between the words. By default, It also inserts slightly more space at
the end of a sentence. However, the extra space added at the end of sentences
is generally considered typographically old-fashioned in English language
printing. (The practice is found in nineteenth century design and in twentieth
century typewriter styles.) Most modern typesetters treat the end of sentence
space the same as the interword space. (See for example, Bringhurst's Elements
of Typographic Style.) The additional space after periods can be disabled with
the command
\frenchspacing
in front of a period specifies that this period terminates a sentence even when
it follows an uppercase letter. (If you are using
\@
command.
If an author wishes to use the wider end-of-sentence spacing, care must be
exercised so that punctuation marks are not misinterpreted as ends of sentences.
TeX assumes that sentences end with periods, question marks or exclamation
marks. Although if a period follows an uppercase letter, this is not taken
as a sentence ending, since periods after uppercase letters normally occur in
abbreviations. Any exception from these assumptions has to be specified by
the author. A backslash in front of a space generates a space that will not be
enlarged. A tilde
Some very long words, numbers or URLs may not be hyphenated properly
and move far beyond the side margin. One solution for this problem is to
use sloppypar environment, which tells LaTeX to adjust word spacing less
strictly. As a result, some spaces between words may be a bit too large, but
long words will be placed properly.
\begin{sloppypar}
This is a paragraph with
a very long word ABCDEFGHIJKLMNOPRST;
then we have an another bad thing
--- a long number 1234567890123456789.
\end{sloppypar}
122 border
http://en.wikipedia.org/wiki/Typographical%20ligature
between the two letters in question. This might be necessary with words built
from two words. Here is an example:
{\kern0pt}
{}
Some letter combinations are typeset not just by setting the different letters
one after the other, but by actually using special symbols (like " "), called
ligatures3 . Ligatures can be prohibited by inserting
43.6. Ligatures
Figure 123
http://www.ctan.org/tex-archive/macros/latex/contrib/
microtype/
\DisableLigatures
Some tools are unable to perform search in documents that contain ligatures (a
search for "finally" wouldn't find the string " nally"). If one desires,
for greater accessibility, to disable ligatures altogether in the whole document,
the
\usepackage[resetfonts]{cmap}
Another solution is to use the cmap package, which will help the reader to
interpret the ligatures:
If you are using XeLaTeX and OpenType fonts, the fontspec package allows
for standard ligatures to be turned off as well as fancy swash ligatures to be
turned on.
Note that this will also disable ligatures such as -- , --- , etc.
\usepackage{microtype}
\DisableLigatures{encoding = *, family = *}
mm/year
", which allow the line to "break" after the slash mark (if needed). The use of
the
input\slash output
command.
\emph{text}
Figure 124
In order to add some emphasis to a word or phrase, the simplest way is to use
the
\familydefault
There are three main font families: roman (e.g., Times), sans serif (e.g., Arial)
and monospace (e.g., Courier). You can also specify styles such as italic and
bold. To change the default family for the rest of the document, change the
In LaTeX, there are many ways to specify and control font, and this section is
only intended to serve as a brief overview of the topic.
43.9. Fonts
\emph{...}
{\em ...}
\textrm{...} {\rmfamily
...}
\textsf{...} {\sffamily
...}
emphasis
roman font
family
sans serif font
family
LaTeX comEquivalent to
Output style
mand
\textnormal{...}
{\normalfont document font
family
...}
Remarks
The following table lists the commands you will need to access the typical font
styles:
\renewcommand{\familydefault}{\sfdefault}
\textup{...} {\upshape
...}
\textit{...} {\itshape
...}
\textsl{...} {\slshape
...}
LaTeX comEquivalent to
mand
\texttt{...} {\ttfamily
...}
slanted shape
italic shape
a skewed version of the normal typeface
(similar to, but
slightly different from,
italics)
this is a
fixed-width
or monospace
font
the same as the
normal typeface
teletypefont
family
upright shape
Remarks
Output style
medium
weight
bold
uppercase (all
caps)
Small Capitals
Output style
a font weight
in between normal and bold
Also
\lowercase.
There are some
caveats, though;
see here6 .
Remarks
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=casechange
\textbf{...} {\bfseries
...}
\textmd{...} {\mdseries
...}
LaTeX comEquivalent to
mand
\textsc{...} {\scshape
...}
\uppercase{...}
\emph
command with the underline rather than the italic style. It is unlikely that you
wish this to be the desired effect, so it is better to stop ulem taking over
\emph
\usepackage{ulem}
command, text underlined in this way will not break properly. This functionality has to be added with the ulem (underline emphasis) package. Stick
\underline{...}
You may have noticed the absence of underline. This is because underlining
is not recommended for typographic reasons (it weighs the text down). You
should use emph instead. Although this is available via the
The commands in column two are not entirely equivalent to the commands
in column one: They do not correct spacing after the selected font style has
ended. The commands in column one are therefore in general recommended.
Some font styles are not compatible one with the other. But some extra
packages will fill this hole. For bold small capitals, you might want to use:
\sout{...}
.
And for a strike-out
\uwave{...}
.
To add a wavy underline, use
\uline{...}
.
To underline, use
\usepackage[normalem]{ulem}
\normalem
To apply different font sizes, simply follow the commands on this table:
\usepackage{bold-extra}
...
\textsc{\textbf{This is bold small capitals}}
Note that the font size definitions are set by the document class. Depending on
the document style the actual font size may differ from that listed above. And
not every document class has unique sizes for all 10 size commands.
Figure 125
[12pt]
7.33325
8.50012
10.00002
10.95003
11.74988
14.09984
15.84985
19.02350
22.82086
22.82086
[10pt]
7.33325
7.97224
8.50012
9.24994
10.00002
10.95003
11.74988
14.09984
15.84985
19.02350
[11pt]
7.97224
8.50012
9.24994
10.00002
10.95003
11.74988
14.09984
15.84985
19.02350
22.82086
[12pt]
8.50012
9.24994
10.00002
10.95003
11.74988
14.09984
15.84985
19.02350
22.82086
22.82086
17.27505
20.73755
20.73755
20.73755
24.88382
29.86258
35.82510
43.00012
51.60014
51.60014
slides
[10pt]
5.31258
7.43760
8.50012
9.24994
10.00002
11.74988
14.09984
16.24988
19.50362
23.39682
beamer
[11pt]
6.37509
8.50012
9.24994
10.00002
10.95003
11.74988
14.09984
16.24988
19.50362
23.39682
As a technical note, points in TeX follow the standard American point size
in which 1 pt is approximately 0.3513_6 mm. The standard point size used
in most modern computer programs (known as the desktop publishing point
or PostScript point) has 1 pt equal to approximately 0.352_7 mm while the
http://en.wikipedia.org/wiki/Point_%28typography%29
These commands change the size within a given scope, so for instance
\Large some words} will change the size of only some words, and
does not affect the font in the rest of the document. These commands cannot
be used in math mode. However, part of a formula may be set in a different
size by using an \mbox command containing the size command.
The new size takes effect immediately after the size command; if an entire
paragraph or unit is set in a certain size, the size command should include the
blank line or the \end{} which delimites the unit. (See Declarations.)
The default for \normalsize is 10-point, but it may differ for some Document
Styles or their options. The actual size produced by these commands also
depends on the Document Style and, in some styles, more than one of these
size commands may produce the same actual size.
standard European point size (known as the Didot point) had 1 pt equal to
approximately 0.37597151 mm. (See: w:Point_(typography)7 .)
\newcommand
Even if you can easily change the output of your fonts using those commands,
you're better off not using explicit commands like this, because they work in
opposition to the basic idea of LaTeX, which is to separate the logical and
visual markup of your document. This means that if you use the same font
changing command in several places in order to typeset a special kind of
information, you should use
Another use for size commands is to embed a single command inside the size-syntax, which affects all things within this command, e.g.
\Large{\tableofcontents}.
and then figuring out for each one whether it was used for pointing out danger
or for some other reason.
\textbf
, without having to wade through your document, identifying all the occurrences of
\textbf
This approach has the advantage that you can decide at some later stage that
you want to use some visual representation of danger other than
\newcommand{\oops}[1]{\textbf{#1}}
http://www.ctan.org/tex-archive/macros/latex/contrib/
mhchem/
\ce{}
command. This allows you to, for instance, typeset 6th as 6th :
\textsuperscript{}
Figure 126
\textsubscript{}
% In your document:
Ammonium sulphate is \ce{(NH4)2SO4}.
11
12
10
http://www.ctan.org/tex-archive/macros/latex/contrib/
bpchem/
http://www.ctan.org/tex-archive/macros/latex/contrib/
koma-script/
http://tug.ctan.org/pkg/fixltx2e
http://tug.ctan.org/pkg/fixltx2e
_{}
, the math mode must be used. This is easily accomplished in running text by
bracketing your text with the
\textsubscript{}
% In your document:
It is found that height\textsubscript{apple tree} is
different than height\textsubscript{orange tree}.
command:
\mathrm
See also the above mentioned package mhchem for chemical symbols and
formulas.
Note that in math mode text will appear in a font suitable for mathematical
variables. In math mode, to generate roman text, for example, one would use
the
13
http://en.wikipedia.org/wiki/Text%20figures
in your preamble. textcomp also allows you to use decimal points, properly
formatted dollar signs, etc. within
\usepackage{textcomp}
Some fonts do not have text figures built in; the textcomp package attempts
to remedy this by effectively generating text figures from the currently-selected
font. Put
\oldstylenums{1234567890}
command:
\oldstylenums{}
Many typographers prefer to use titling figures, sometimes called lining figures,
when numerals are interspersed with full caps, when they appear in tables, and
when they appear in equations, using text figures13 elsewhere. LaTeX allows
this usage through the
\usepackage{textcomp}
One common use for text figures is in section, paragraph, and page numbers.
These can be set to use text figures by placing some code in your preamble:
\oldstylenums{}
...
\myThePage definition
\pagenumbering
\thepage
\pagenumbering{arabic}
command, e.g.,
\pagenumbering
\tableofcontents
\pagenumbering{roman}
\chapter{Preface}
...
\chapter{Introduction}
...
\pagenumbering{arabic}
% without this, the \thepage command will not be in oldstyle (e.g.,
in your Table of Contents}
\renewcommand{\thepage}{\oldstylenums{\myThePage}}
\Chapter{Foo}
...
14
15
16
17
http://en.wikipedia.org/wiki/hyphen
http://en.wikipedia.org/wiki/Dash%23En%20dash
http://en.wikipedia.org/wiki/Dash%23Em%20dash
http://en.wikipedia.org/wiki/Plus%20and%20minus%20signs%
23Minus%20sign
LaTeX knows four kinds of dashes: a hyphen14 (-), en dash15 (), em dash16
(), or a minus sign17 (). You can access three of them with different
numbers of consecutive dashes. The fourth sign is actually not a dash at allit
is the mathematical minus sign:
Figure 127
The names for these dashes are: -(-) hyphen , --() en-dash , ---()
em-dash and () minus sign. They have different purposes:
\hyp{}
Use
Figure 128
18
http://en.wikipedia.org/wiki/euro%20sign
\usepackage[official]{eurosym}
official
. If you want to use the official version of the euro symbol, then you have to
use eurosym, load it with the
\texteuro
then you can insert the euro symbol with the command
\usepackage{textcomp}
When writing about money these days, you need the euro sign18 . You have
several choices. If the fonts you are using have a euro symbol and you want to
use that one, first you have to load the textcomp package in the preamble:
19
http://en.wikipedia.org/wiki/Ellipsis
43.10.3. Ellipsis (. . . )
\euro
\usepackage[gen]{eurosym}
command. Finally, if you want a euro symbol that matches with the current
font style (e.g., bold, italics, etc.) but your current font does not provide it, you
can use the eurosym package again but with a different option:
\euro
Figure 129
\textellipsis
\ldots
only a little space and are set very close to the preceding letter. Therefore, you
cannot enter ellipsis by just typing three dots, as the spacing would be wrong.
Instead, there is a special command for these dots. It is called
LaTeX has lots of symbols at its disposal. The majority of them are within the
mathematical domain, and later chapters will cover how to get access to them.
For the more common text symbols, use the following commands:
Figure 130
There are some very simple LaTeX commands for typesetting special text
strings:
Figure 131
20
21
\ding{number}
\usepackage{pifont}
.
Of course, these are rather boring. For some more interesting symbols, the
Postscript ZipfDingbats font is available thanks to the pifont package. Hopefully you are beginning to notice now that when you want to use a package,
you need to add the declaration to your preamble; in this instance:
\textvisiblespace
\~{}
, will print the specified symbol. Here is a table of the available symbols:
This page uses material from Andy Roberts Getting to grips with LaTeX with
permission from the author.
The easiest way to learn how to use latex is to look at how other people use it.
Here is a list of real world latex sources that are freely available on the internet.
The information here is sorted by application area, so that it is grouped by the
scientific communities that use similar notation and LaTeX constructs.
1
2
3
4
5
http://en.wikibooks.org/wiki/LaTeX%2Fcaption.tex
http://en.wikibooks.org/wiki/LaTeX%2Fsimple.tex
http://en.wikibooks.org/wiki/LaTeX%2Fwrapped.tex
http://www.tug.org/pracjourn/2006-2/eglen/
http://www.ctan.org/tex-archive/info/lshort/english/
6
7
8
9
http://www.ccs.neu.edu/course/csg264/latex/
http://cristal.inria.fr/~remy/latex/
http://svn.openfoundry.org/pugs/docs/talks/hw2005.tex
http://en.wikibooks.org/wiki/LaTeX%2FPackages%2FListings
Articles on programming language research, from syntax to semantics, including source code listings, type rules, proof trees, and even some category theory.
A good place to start is Mitchell Wand's Latex Resources6 , including a sample
file that also demonstrates Didier Remy's mathpartir7 package. The following
are latex sources of some articles, books, or presentations from this field:
45.1. #
\:
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%23Slash%
20marks
Chapter 9.5 on page 310
\;
\,
\\[*][extra-space]
\@
\+
\<
\>
\=
hyphenation; tabbing
\-
\!
\)
\(
\|
accent or tabbing
accent or tabbing
\'
see tabbing
\addtocounter{counter}{value}
adds text (or formatting commands) directly to the file that generates the
specified list or table
\addtocontents{file}{text}
\addcontentsline{file}{sec_unit}{entry}
45.2. A
\]
\[
changes the way sectional units are numbered so that information after the
command is considered part of the appendix
\appendix
\alph
\addvspace
\addtolength{len-cmd}{len}
\address{Return address}
\baselineskip
prints a backslash
\backslash
45.3. B
\author
\arabic
6
7
equivalent to \vspace{\bigskipamount}
\bigskip
\bigskipamount
\bibitem
Boldface typeface
\bf
\baselinestretch
\centering
Centered dots
\cdots
\caption
\cal
45.4. C
\boldmath
8
9
10
\cline
Ends the current page and causes any floats to be printed. See Page Layout10 .
\clearpage
\cleardoublepage
\cite
\circle
\chapter
11
12
13
14
\copyright
\color
\closing
Adds horizontal line in a table that spans only to a range of cells. See \hline11
and ../Tables/12 chapter.
\em
45.6. E
\dotfill
\documentclass[options]{style}
\ddots
\date
\dashbox
45.5. D
\fbox
45.7. F
\euro
\ensuremath (LaTeX2e)
Toggles italics on/off for the text in curly braces following the command e.g.
\emph{This is in italics \emph{but this isn't} and this is again}.
\emph
Toggles italics on/off for the text inside curly braces with the command.
Such as {\em This is in italics \em but this isn't \em and this is again}. This
command allows nesting.
16
15
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Footnotes
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
\frac
\footnotetext
\footnotesize
\footnotemark
Creates a footnote15 .
\footnote
\fnsymbol
\flushbottom
mode.
The
usage
is
17
18
Instructs LaTex to abstain from inserting more space after a period (.) than
is the case for an ordinary character. In order to untoggle this functionality
resort to the command \nonfrenchspacing18 .
\frenchspacing
Like \makebox but creates a frame around the box. See LaTeX/Advanced
Topics#Boxes17 .
\framebox
\frame
19
20
21
\href
\hline
\hfill
45.9. H
45.8. G
23
22
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
\hyphenation{word list}
\Huge
\huge
\hspace
\hrulefill
24
25
26
http://en.wikibooks.org/wiki/..%2FFormatting%23Hyphenation
Chapter 2.4.2 on page 71
Chapter 11.1.9 on page 377
\includeonly
\includegraphics
This command is different from \input in that it's the output that is added
instead of the commands from the other files. For more see LaTex/Basics25
\include
45.10. I
27
28
\item
Italicizes the text which is inside curly braces with the command. Such as
{\it This is in italics}. \em is generally preferred since this allows nesting.
\it
\input
\indent
29
30
\large
Used to create label which can be later referenced with \ref. See Labels
and Cross-referencing29 .
\label
45.12. L
\kill
45.11. K
33
32
31
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
http://en.wikibooks.org/wiki/..%2FFormatting%23Ready-made%
20strings
\LaTeXe
\LaTeX
\LARGE
\Large
36
35
34
http://en.wikibooks.org/wiki/..%2FFormatting%23Ready-made%
20strings
http://en.wikibooks.org/wiki/..%2FFormatting%23Ellipsis%
20%28...%29
Chapter 9.5 on page 310
\linethickness
\linebreak
\line
\lefteqn
\left
\ldots
37
38
\makebox
45.13. M
\location
\listoftables
\listoffigures
\linewidth
39
\multicolumn
\medskip
\mbox
\mathop
\mathcal
\markboth \markright
\maketitle
Defines a box that has a specified width, independent from its content. See
LaTeX/Advanced Topics#Boxes39 .
40
41
\newlength
\newfont
\newenvironment
\newcounter
\newcommand
45.14. N
\multiput
42
43
\nolinebreak
\noindent
\nocite
\newtheorem
\newsavebox
Ends current page and starts a new one. See Page Layout43 .
\newpage
Ends current line and starts a new one. See Page Layout42 .
\newline
46
44
45
\not
Suggests LaTeX not to break page in this place. See Page Layout46 .
\nopagebreak
\normalsize
\nonfrenchspacing
47
\overline
Draws a brace over the argument. Can be used in displaystyle with superscript
to label formulae. See Advanced Mathematics47 .
\overbrace
\oval
Inserts an opening phrase when using the letter class, for example \opening{Dear Sir}
\opening
\onecolumn
45.15. O
48
49
\pagestyle
\pageref
Defines the type of characters used for the page numbers. Options : arabic,
roman, Roman, alph, Alph, gobble (invisible).
\pagenumbering
\pagebreak
45.16. P
50
51
52
53
\parindent
Defines a box whose contents are created in paragraph mode. See Advanced
Topics52 .
\parbox
\paragraph
\par
54
55
\raggedbottom
45.17. R
\put
\providecommand (LaTeX2e)
\protect
\part
\parskip
56
57
\renewcommand
\ref
\raisebox
\raggedright
\raggedleft
58
\sbox
\savebox
45.18. S
Creates a line of specified width and height. See LaTeX/Advanced Topics#Rules and Struts58 .
\rule
\roman
\rm
\right
60
59
\sf
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
Chapter 3.1.4 on page 85
\settowidth
\setlength
\setcounter
\section
\scriptsize
\sc
62
61
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%23Slash%
20marks
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
\smallskip
\small
\slash
\sl
\signature
\shortstack
64
63
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
Chapter 17.7 on page 522
\subparagraph
Takes two arguments and stacks the first on top of the second.
\stackrel
\sqrt
\space
\sout
65
66
67
Inserts a table of contents (based on section headings) at the point where the
command appears.
\tableofcontents
45.19. T
\subsubsection
\subsection
70
69
68
http://en.wikibooks.org/wiki/..%2FFormatting%23Ready-made%
20strings
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
Chapter 15.2 on page 473
\textit{}
\textcolor{}{}
\textbf{}
\TeX
\telephone
74
73
72
71
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
\textrm{}
\textnormal{}
\textmd{}
77
76
75
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
\texttt{}
\textsl{}
\textsf{}
\textsc{}
79
78
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
\tiny
\thispagestyle
\thanks
\textheight
\textwidth
\textup{}
81
80
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
http://en.wikibooks.org/wiki/..%2FFormatting%23Ready-made%
20strings
\typein
\typeout
\twocolumn
\tt
\today
\title
82
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
\uwave
\usecounter
\usebox
\unitlength
\underline
\underbrace
\uline
45.20. U
84
83
http://en.wikibooks.org/wiki/..%2FFormatting%23Font%
20Styles%20and%20size
Chapter 17.15.2 on page 573
\vector
\vdots
\vbox{text}
\value
45.21. V
85
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Verbatim%20Text
This page uses material from Dr. Sheldon Greens Hypertext Help with LaTeX.
\vspace
\vphantom
\vline
\vfill
\verb
Using cite.sty and BibTeX makes it very easy to produce some bibliography
styles. But author-date styles - for example the often mentioned, never defined
"Harvard" - are not so easy. It's true that you can download some .bst files
@article{erdos65,
title = {Some very hard sums},
journal={Difficult Maths Today},
author={Paul Erd\H{o}s and Arend Heyting and Luitzen Egbertus
Brouwer}
year={1930}
pages={30}
}
plainnat
abbrvnat
unsrtnat
which correspond to the three styles available by default in BibTeX where you
have a plain numbered style, an abbreviated numbered style and an unsorted
46.3. Natbib
from CTAN that will handle some variants but using them is not always
straightforward. This guide deals with Natbib a supplementary package that
can access .bib files and has sophisticated functionality for producing custom or
default author-year format citations and bibliographies as well as the numerical
styles handled by BibTeX.
\begin{document}
\documentclass[]{article}
\usepackage[round]{natbib}
All Natbib styles require that you load the package in your document preamble.
So, a skeleton LaTeX file with Natbib might look like this:
\citep[]{}
and
\citet[]{}
Option
round
square
curly
angle
semicolon
colon
Effect
()
[]
{}
<>
separate citations with ;
as semicolon
Options available with Natbib can be specified in the brackets on the \usepackage command. Among them are:
Options
\end{document}
\bibliographystyle{plainnat}
\bibliography{myrefs}
sectionbib
longnamesfirst
compress
sort&compress
Option
comma
authoryear
numbers
super
sort
Effect
separate with commas
author-year citations
numeric citations
superscript citations
multiple citations are ordered as in
bibliography
as sort but number ranges are compressed and hyphenated
number ranges are compressed
and hyphenated but only where the
'natural' sort produces a continuous
range
first citation is full author list and
subsequent citations are abbreviated
allows multiple bibliographies in
the same document
Effect
forces all author names onto one
line
merges a citation with a previous
citation
elides any repeated elements in
merged references
ignore merge
Clearly some of these options require explanation but that will be achieved
via examples below. For now, we just note that they can be passed through
\usepackage[]{} in the preamble of your LaTeX file.
mcite
elide
merge
Option
nonamebreak
\citet{Erdos65}
produces
The \citet command is used for textual citations, that is to say that author
names appear in the text outside of the parenthetical reference to the date of
publication. This command can take options for chapter, page numbers etc.
Here are examples
To cite with Natbib, use the commands \citet or \citep in your document. The
"plain" versions of these commands produced abbreviated lists in the case of
multiple authors but both have * variants which result in full author listings. I
have assumed the use of the round option in these examples.
46.4. Citation
produces
produces
produces
produces
produces
produces
\citet*{Erdos65}
\citet*[chapter
2]{Erdos65}
\citet*[pp. 1012]{Erdos65}
\citet[chapter
2]{Erdos65}
\citet[pp. 1012]{Erdos65}
\citet[see][chap.
2]{Erdos65}
produces
\citep{Erdos65}
\citep[chapter
2]{Erdos65}
\citep[pp. 1012]{Erdos65}
produces
produces
produces
The \citep command is used where the author name is to appear inside the
parentheses alongside the date.
\citet*[see][chap.
2]{Erdos65}
produces
produces
produces
produces
produces
\citep*{Erdos65}
\citep*[chapter
2]{Erdos65}
\citep*[pp. 1012]{Erdos65}
\citep*[see][chap.
2]{Erdos65}
\citep[see][chap.
2]{Erdos65}
which specifies how the data are to be presented. Above the three basic Natbib
styles were mentioned as analogues of the partially homonymous styles in
BibTeX. Let us imagine documents bearing citations as in the section about
citation above1 . Here is, approximately, how these citations would appear in
plainnat.
\bibliographystyle{plainnat}
\bibliography{mybibliographydatabase}
Having dealt with basic varieties of citation, we turn to the creation of the
bibliography or reference list. Inserting a correct and correctly formatted
bibliography when using Natbib is no different than when using plain BibTeX.
There are two essential commands -
This covers the basic functionality provided by the package Natbib. It may not,
ofcourse, provide what you are looking for. If you don't find what you want
here then you should probably next investigate harvard.sty which provides a
slighly different set of author-date citation functions. Providing a gentle guide
to harvard.sty is my next rainy day project.
Figure 133
1
2
http://en.wikibooks.org/wiki/LaTeX%2FAbsolute%20Beginners
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Abstracts
Absolute Beginners1
Abstract2
47.1. A
47. Index
Accents3
Advanced Topics4
Algorithms5
Arrays6
Authors7
3
4
5
6
7
8
9
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%23Accents
Chapter 33 on page 887
Chapter 21 on page 679
Chapter 17.10 on page 538
Chapter 39 on page 1035
Chapter 36 on page 953
Chapter 2 on page 35
babel8
Basics9
47.2. B
14
15
10
11
12
13
beamer package10
Bibliography Management11
BibTeX12
Bold13
Bullets14
Bullet points15
16
17
18
19
20
21
22
Captions16
Collaborative Writing of LaTeX Documents17
Color18
color package19
Columns, see Multi-column Pages20
Cross-referencing21
Customizing LaTeX22
47.3. C
25
26
27
28
24
23
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%23Dashes%
20and%20Hyphens
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Description
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%23Accents
Chapter 2.2.1 on page 46
Chapter 3 on page 77
Chapter 12 on page 387
Dashes23
description environment24
Diactrical marks25
Document Classes26
Document Structure27
Drawings28
47.4. D
34
33
32
31
29
30
47.5. E
36
37
38
39
40
35
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%23Euro_.E2.
82.AC_currency_symbol
Chapter 35 on page 937
Chapter 13 on page 399
Chapter 13 on page 399
Chapter 16 on page 491
Chapter 9 on page 273
Figures37
Floats38
Fonts39
Footer, Page40
47.6. F
42
43
44
45
46
41
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Footnotes
http://en.wikibooks.org/wiki/LaTeX%2FFormatting
Chapter 30 on page 819
Chapter 12 on page 387
Chapter 11 on page 343
Chapter 11 on page 343
General Guidelines43
Graphics
Creating44
Embedding45
Importing46
47.7. G
Footnotes41
Formatting42
47
48
49
50
51
52
Header, Page48
HTML output49
Hyperlinks50
hyperref package51
hyphen52
47.8. H
graphicx package47
54
55
56
57
58
53
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Hyphenation
Chapter 38.2 on page 1011
Chapter 11 on page 343
Chapter 11 on page 343
Chapter 27 on page 753
Chapter 36 on page 953
47.9. I
Hyphenation53
61
62
63
64
59
60
Chapter 1 on page 5
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%23Font_
Styles_and_size
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%23Itemize
Chapter 19 on page 647
Chapter 27.4 on page 761
Chapter 40 on page 1039
Labels62
Letters63
Links64
47.10. L
Introduction59
Italics60
itemize61
70
69
65
66
67
68
makeidx package66
\maketitle67
Margin Notes68
Creating Graphics69
Mathematics70
47.11. M
Lists65
71
72
73
74
75
76
77
Packages74
Creating 175 , Creating 276
Page Layout77
47.12. P
Matrices71
Minipage environment example72
Multi-column Pages73
PDF output78
picture79
Pictures80
PNG output81
Presentations82
Pseudocode83
78
79
80
81
82
83
84
Quotes84
47.13. Q
88
85
86
87
Small Capitals87
Source Code Listings88
47.15. S
References85
RTF output86
47.14. R
93
94
90
91
92
89
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%23The%
20Space%20Between%20Words
Chapter 38.6 on page 1026
Chapter 17.5 on page 512
http://en.wikibooks.org/wiki/LaTeX%2FFormatting%23Text%
20mode%20superscript%20and%20subscript
Chapter 35.1.4 on page 942
Chapter 3.1.7 on page 93
Table of contents94
47.16. T
Tables95
Teletype text96
Text Size97
Theorems98
Tips and Tricks99
Title Creation100
95
96
101 http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Typesetting%20URLs
102 http://en.wikibooks.org/wiki/LaTeX%2FFormatting%
23Verbatim%20Text
Verbatim Text102
47.18. V
URLs101
47.17. U
103
104
105
106
XeTeX104
XY-pic package105
xy package106
47.20. X
Word Counting103
47.19. W
1
2
3
4
User
3mta31
ABCD2
ATC23
Aadornellesf4
http://en.wikibooks.org/w/index.php?title=User:3mta3
http://en.wikibooks.org/w/index.php?title=User:ABCD
http://en.wikibooks.org/w/index.php?title=User:ATC2
http://en.wikibooks.org/w/index.php?title=User:
Aadornellesf
Edits
140
2
1
1
48. Contributors
11
12
7
8
9
10
5
6
Abonnema5
Adam majewski6
Adamcrume7
Adouglass8
Adrignola9
Akim Demaille10
Alejo208311
AllenZh12
http://en.wikibooks.org/w/index.php?title=User:Abonnema
http://en.wikibooks.org/w/index.php?title=User:Adam_
majewski
http://en.wikibooks.org/w/index.php?title=User:Adamcrume
http://en.wikibooks.org/w/index.php?title=User:Adouglass
http://en.wikibooks.org/w/index.php?title=User:Adrignola
http://en.wikibooks.org/w/index.php?title=User:Akim_
Demaille
http://en.wikibooks.org/w/index.php?title=User:Alejo2083
http://en.wikibooks.org/w/index.php?title=User:AllenZh
2
1
1
1
47
1
122
2
13
14
15
16
17
18
19
20
21
Alzahrawi13
Amamory14
Ambrevar15
Anarchyboy16
Andyr17
Ans18
Arided19
Arnehe20
Arthurvogel21
http://en.wikibooks.org/w/index.php?title=User:Alzahrawi
http://en.wikibooks.org/w/index.php?title=User:Amamory
http://en.wikibooks.org/w/index.php?title=User:Ambrevar
http://en.wikibooks.org/w/index.php?title=User:Anarchyboy
http://en.wikibooks.org/w/index.php?title=User:Andyr
http://en.wikibooks.org/w/index.php?title=User:Ans
http://en.wikibooks.org/w/index.php?title=User:Arided
http://en.wikibooks.org/w/index.php?title=User:Arnehe
http://en.wikibooks.org/w/index.php?title=User:Arthurvogel
9
1
59
2
6
5
2
25
1
29
26
27
28
25
22
23
24
Asmeurer22
Astrophizz23
Atallcostsky24
Atiq ur Rehman25
Atulya198826
Avila.gas27
Bajrangkhichi9628
Bakken29
http://en.wikibooks.org/w/index.php?title=User:Asmeurer
http://en.wikibooks.org/w/index.php?title=User:Astrophizz
http://en.wikibooks.org/w/index.php?title=User:
Atallcostsky
http://en.wikibooks.org/w/index.php?title=User:Atiq_ur_
Rehman
http://en.wikibooks.org/w/index.php?title=User:Atulya1988
http://en.wikibooks.org/w/index.php?title=User:Avila.gas
http://en.wikibooks.org/w/index.php?title=User:
Bajrangkhichi96
http://en.wikibooks.org/w/index.php?title=User:Bakken
1
1
1
1
1
13
1
1
36
37
35
30
31
32
33
34
Bamgooly30
Barakafrit31
Basenga32
Bcmpinc33
Belteshazzar34
Benjaminevans8235
Benregn36
Bhanuvrat37
http://en.wikibooks.org/w/index.php?title=User:Bamgooly
http://en.wikibooks.org/w/index.php?title=User:Barakafrit
http://en.wikibooks.org/w/index.php?title=User:Basenga
http://en.wikibooks.org/w/index.php?title=User:Bcmpinc
http://en.wikibooks.org/w/index.php?title=User:
Belteshazzar
http://en.wikibooks.org/w/index.php?title=User:
Benjaminevans82
http://en.wikibooks.org/w/index.php?title=User:Benregn
http://en.wikibooks.org/w/index.php?title=User:Bhanuvrat
1
1
4
1
1
2
1
1
44
45
43
42
38
39
40
41
BiT38
Bianbum39
Bilbo150740
Billy the Goat II41
Blacktrumpeter42
Blaisorblade43
Bonuama44
Borgg45
http://en.wikibooks.org/w/index.php?title=User:BiT
http://en.wikibooks.org/w/index.php?title=User:Bianbum
http://en.wikibooks.org/w/index.php?title=User:Bilbo1507
http://en.wikibooks.org/w/index.php?title=User:Billy_the_
Goat_II
http://en.wikibooks.org/w/index.php?title=User:
Blacktrumpeter
http://en.wikibooks.org/w/index.php?title=User:
Blaisorblade
http://en.wikibooks.org/w/index.php?title=User:Bonuama
http://en.wikibooks.org/w/index.php?title=User:Borgg
26
1
2
1
1
1
3
1
51
52
53
50
48
49
46
47
Bpsullivan46
Braindrain000047
Brammers48
Brendanarnold49
BrettMontgomery50
Brevity51
Bsander52
Bumbulski53
http://en.wikibooks.org/w/index.php?title=User:Bpsullivan
http://en.wikibooks.org/w/index.php?title=User:
Braindrain0000
http://en.wikibooks.org/w/index.php?title=User:Brammers
http://en.wikibooks.org/w/index.php?title=User:
Brendanarnold
http://en.wikibooks.org/w/index.php?title=User:
BrettMontgomery
http://en.wikibooks.org/w/index.php?title=User:Brevity
http://en.wikibooks.org/w/index.php?title=User:Bsander
http://en.wikibooks.org/w/index.php?title=User:Bumbulski
1
1
1
1
1
1
1
8
54
55
56
57
58
59
60
61
62
Byassine5254
Bytecrook55
C3l56
CD-Stevens57
Caesura58
Calimo59
Cameronc60
Canageek61
CarsracBot62
http://en.wikibooks.org/w/index.php?title=User:Byassine52
http://en.wikibooks.org/w/index.php?title=User:Bytecrook
http://en.wikibooks.org/w/index.php?title=User:C3l
http://en.wikibooks.org/w/index.php?title=User:CD-Stevens
http://en.wikibooks.org/w/index.php?title=User:Caesura
http://en.wikibooks.org/w/index.php?title=User:Calimo
http://en.wikibooks.org/w/index.php?title=User:Cameronc
http://en.wikibooks.org/w/index.php?title=User:Canageek
http://en.wikibooks.org/w/index.php?title=User:CarsracBot
1
1
1
7
1
1
3
1
2
66
67
68
69
70
63
64
65
Cdecoro63
Cengique64
Cerniagigante65
Cfailde66
Chafe6667
Chazz68
Chisophugis69
ChrisHodgesUK70
http://en.wikibooks.org/w/index.php?title=User:Cdecoro
http://en.wikibooks.org/w/index.php?title=User:Cengique
http://en.wikibooks.org/w/index.php?title=User:
Cerniagigante
http://en.wikibooks.org/w/index.php?title=User:Cfailde
http://en.wikibooks.org/w/index.php?title=User:Chafe66
http://en.wikibooks.org/w/index.php?title=User:Chazz
http://en.wikibooks.org/w/index.php?title=User:Chisophugis
http://en.wikibooks.org/w/index.php?title=User:
ChrisHodgesUK
2
3
5
1
1
1
2
61
74
75
76
77
78
72
73
71
ChristianGruen71
Chuaprap72
Chuckhoffmann73
Clebell74
Codairem75
Collinpark76
Comput2h77
ConditionalZenith78
http://en.wikibooks.org/w/index.php?title=User:
ChristianGruen
http://en.wikibooks.org/w/index.php?title=User:Chuaprap
http://en.wikibooks.org/w/index.php?title=User:
Chuckhoffmann
http://en.wikibooks.org/w/index.php?title=User:Clebell
http://en.wikibooks.org/w/index.php?title=User:Codairem
http://en.wikibooks.org/w/index.php?title=User:Collinpark
http://en.wikibooks.org/w/index.php?title=User:Comput2h
http://en.wikibooks.org/w/index.php?title=User:
ConditionalZenith
1
1
1
1
1
1
1
5
85
86
81
82
83
84
79
80
Conighion79
Conrad.Irwin80
Courcelles81
Crasic82
Crasshopper83
CrazyTerabyte84
Crissov85
Ccero86
http://en.wikibooks.org/w/index.php?title=User:Conighion
http://en.wikibooks.org/w/index.php?title=User:Conrad.
Irwin
http://en.wikibooks.org/w/index.php?title=User:Courcelles
http://en.wikibooks.org/w/index.php?title=User:Crasic
http://en.wikibooks.org/w/index.php?title=User:Crasshopper
http://en.wikibooks.org/w/index.php?title=User:
CrazyTerabyte
http://en.wikibooks.org/w/index.php?title=User:Crissov
http://en.wikibooks.org/w/index.php?title=User:C%C3%ADcero
1
2
1
1
2
2
2
2
91
92
93
90
89
88
87
Dan Polansky87
Danielstrong5288
David.s.hollman89
DavidMcKenzie90
Debejyo91
Dendik92
Derbeth93
http://en.wikibooks.org/w/index.php?title=User:Dan_
Polansky
http://en.wikibooks.org/w/index.php?title=User:
Danielstrong52
http://en.wikibooks.org/w/index.php?title=User:David.s.
hollman
http://en.wikibooks.org/w/index.php?title=User:
DavidMcKenzie
http://en.wikibooks.org/w/index.php?title=User:Debejyo
http://en.wikibooks.org/w/index.php?title=User:Dendik
http://en.wikibooks.org/w/index.php?title=User:Derbeth
71
1
1
6
1
1
103
Derwaldrandfoerster94
Dilaudid95
Dirk Hnniger96
Dlituiev97
Dmb98
DmitriyZotikov99
Dncarley100
Dporter101
http://en.wikibooks.org/w/index.php?title=User:
Derwaldrandfoerster
95 http://en.wikibooks.org/w/index.php?title=User:Dilaudid
96 http://en.wikibooks.org/w/index.php?title=User:Dirk_H%C3%
BCnniger
97 http://en.wikibooks.org/w/index.php?title=User:Dlituiev
98 http://en.wikibooks.org/w/index.php?title=User:Dmb
99 http://en.wikibooks.org/w/index.php?title=User:
DmitriyZotikov
100 http://en.wikibooks.org/w/index.php?title=User:Dncarley
101 http://en.wikibooks.org/w/index.php?title=User:Dporter
94
1
6
66
1
3
1
3
1
102
103
104
105
106
107
108
109
110
Dr0pi102
Dreaven3103
Drevicko104
Drewbie105
Dubbaluga106
E.lewis1107
Echeban108
Ediahist109
Edudobay110
http://en.wikibooks.org/w/index.php?title=User:Dr0pi
http://en.wikibooks.org/w/index.php?title=User:Dreaven3
http://en.wikibooks.org/w/index.php?title=User:Drevicko
http://en.wikibooks.org/w/index.php?title=User:Drewbie
http://en.wikibooks.org/w/index.php?title=User:Dubbaluga
http://en.wikibooks.org/w/index.php?title=User:E.lewis1
http://en.wikibooks.org/w/index.php?title=User:Echeban
http://en.wikibooks.org/w/index.php?title=User:Ediahist
http://en.wikibooks.org/w/index.php?title=User:Edudobay
1
1
4
3
1
3
1
6
1
Elliptic1111
Elwikipedista112
Emreg00113
Erylaos114
Eudoxos115
EvanKroske116
Everlong117
Eyliu118
Ffangs119
111 http://en.wikibooks.org/w/index.php?title=User:Elliptic1
112 http://en.wikibooks.org/w/index.php?title=User:
Elwikipedista
113 http://en.wikibooks.org/w/index.php?title=User:Emreg00
114 http://en.wikibooks.org/w/index.php?title=User:Erylaos
115 http://en.wikibooks.org/w/index.php?title=User:Eudoxos
116 http://en.wikibooks.org/w/index.php?title=User:EvanKroske
117 http://en.wikibooks.org/w/index.php?title=User:Everlong
118 http://en.wikibooks.org/w/index.php?title=User:Eyliu
119 http://en.wikibooks.org/w/index.php?title=User:Ffangs
3
1
1
16
1
2
1
5
3
Filip Dominec120
Fishix121
Fishpi122
Flal123
FlashSheridan124
Fmccown125
Fongs126
Franzl aus tirol127
120 http://en.wikibooks.org/w/index.php?title=User:Filip_
Dominec
121 http://en.wikibooks.org/w/index.php?title=User:Fishix
122 http://en.wikibooks.org/w/index.php?title=User:Fishpi
123 http://en.wikibooks.org/w/index.php?title=User:Flal
124 http://en.wikibooks.org/w/index.php?title=User:
FlashSheridan
125 http://en.wikibooks.org/w/index.php?title=User:Fmccown
126 http://en.wikibooks.org/w/index.php?title=User:Fongs
127 http://en.wikibooks.org/w/index.php?title=User:Franzl_aus_
tirol
2
1
2
1
1
1
1
4
Frap128
Fredmaranhao129
Fsart130
Ftravers131
GPHemsley132
Gallen01133
Garoth134
GavinMcGimpsey135
128 http://en.wikibooks.org/w/index.php?title=User:Frap
129 http://en.wikibooks.org/w/index.php?title=User:
Fredmaranhao
130 http://en.wikibooks.org/w/index.php?title=User:Fsart
131 http://en.wikibooks.org/w/index.php?title=User:Ftravers
132 http://en.wikibooks.org/w/index.php?title=User:GPHemsley
133 http://en.wikibooks.org/w/index.php?title=User:Gallen01
134 http://en.wikibooks.org/w/index.php?title=User:Garoth
135 http://en.wikibooks.org/w/index.php?title=User:
GavinMcGimpsey
1
1
1
1
1
1
1
1
136
137
138
139
140
141
142
143
144
Geetha nitc136
Gelbukh137
Geminatea138
Germanzs139
Ghoti140
Gkc141
Glad142
Glosser.ca143
Gmh04144
http://en.wikibooks.org/w/index.php?title=User:Geetha_nitc
http://en.wikibooks.org/w/index.php?title=User:Gelbukh
http://en.wikibooks.org/w/index.php?title=User:Geminatea
http://en.wikibooks.org/w/index.php?title=User:Germanzs
http://en.wikibooks.org/w/index.php?title=User:Ghoti
http://en.wikibooks.org/w/index.php?title=User:Gkc
http://en.wikibooks.org/w/index.php?title=User:Glad
http://en.wikibooks.org/w/index.php?title=User:Glosser.ca
http://en.wikibooks.org/w/index.php?title=User:Gmh04
3
2
1
1
2
4
1
3
1
145
146
147
148
149
150
151
152
153
Gms145
Go.pbam.146
Goodgerster147
Graemeg148
Greenbreen149
Grenouille150
Grj23151
Gronau152
Guyrobbie153
http://en.wikibooks.org/w/index.php?title=User:Gms
http://en.wikibooks.org/w/index.php?title=User:Go.pbam.
http://en.wikibooks.org/w/index.php?title=User:Goodgerster
http://en.wikibooks.org/w/index.php?title=User:Graemeg
http://en.wikibooks.org/w/index.php?title=User:Greenbreen
http://en.wikibooks.org/w/index.php?title=User:Grenouille
http://en.wikibooks.org/w/index.php?title=User:Grj23
http://en.wikibooks.org/w/index.php?title=User:Gronau
http://en.wikibooks.org/w/index.php?title=User:Guyrobbie
7
1
1
1
1
1
1
2
1
Gwpl154
Gyro Copter155
Gtz156
HJMills157
Hagindaz158
Hankjones159
Hankwang160
Hannes Rst161
Hansfn162
http://en.wikibooks.org/w/index.php?title=User:Gwpl
http://en.wikibooks.org/w/index.php?title=User:Gyro_Copter
http://en.wikibooks.org/w/index.php?title=User:G%C3%B6tz
http://en.wikibooks.org/w/index.php?title=User:HJMills
http://en.wikibooks.org/w/index.php?title=User:Hagindaz
http://en.wikibooks.org/w/index.php?title=User:Hankjones
http://en.wikibooks.org/w/index.php?title=User:Hankwang
http://en.wikibooks.org/w/index.php?title=User:Hannes_R%
C3%B6st
162 http://en.wikibooks.org/w/index.php?title=User:Hansfn
154
155
156
157
158
159
160
161
1
1
1
2
1
7
1
1
2
Harrikoo163
Harrywt164
Helder.wiki165
Helptry166
HenrikMidtiby167
Henry Tallboys168
Henrybissonnette169
Herbythyme170
http://en.wikibooks.org/w/index.php?title=User:Harrikoo
http://en.wikibooks.org/w/index.php?title=User:Harrywt
http://en.wikibooks.org/w/index.php?title=User:Helder.wiki
http://en.wikibooks.org/w/index.php?title=User:Helptry
http://en.wikibooks.org/w/index.php?title=User:
HenrikMidtiby
168 http://en.wikibooks.org/w/index.php?title=User:Henry_
Tallboys
169 http://en.wikibooks.org/w/index.php?title=User:
Henrybissonnette
170 http://en.wikibooks.org/w/index.php?title=User:Herbythyme
163
164
165
166
167
3
1
1
4
3
4
5
1
Hermine potter171
Hippasus172
Hjsb173
Hokiehead174
Hosszuka175
Hroobjartr176
ILubeMyCucumbers20177
Iamunknown178
171 http://en.wikibooks.org/w/index.php?title=User:Hermine_
potter
172 http://en.wikibooks.org/w/index.php?title=User:Hippasus
173 http://en.wikibooks.org/w/index.php?title=User:Hjsb
174 http://en.wikibooks.org/w/index.php?title=User:Hokiehead
175 http://en.wikibooks.org/w/index.php?title=User:Hosszuka
176 http://en.wikibooks.org/w/index.php?title=User:Hroobjartr
177 http://en.wikibooks.org/w/index.php?title=User:
ILubeMyCucumbers20
178 http://en.wikibooks.org/w/index.php?title=User:Iamunknown
2
1
1
1
6
3
1
1
186
185
183
184
179
180
181
182
Icc97179
Igjimh180
Immae181
Inductiveload182
Infenwe183
Insaneinside184
InverseHypercube185
IrfanAli186
http://en.wikibooks.org/w/index.php?title=User:Icc97
http://en.wikibooks.org/w/index.php?title=User:Igjimh
http://en.wikibooks.org/w/index.php?title=User:Immae
http://en.wikibooks.org/w/index.php?title=User:
Inductiveload
http://en.wikibooks.org/w/index.php?title=User:Infenwe
http://en.wikibooks.org/w/index.php?title=User:
Insaneinside
http://en.wikibooks.org/w/index.php?title=User:
InverseHypercube
http://en.wikibooks.org/w/index.php?title=User:IrfanAli
1
26
1
1
1
2
5
1
Ish ishwar187
Itai188
JECompton189
JV190
Jacho191
JackPotte192
Jacobrothstein193
Jamoroch194
http://en.wikibooks.org/w/index.php?title=User:Ish_ishwar
http://en.wikibooks.org/w/index.php?title=User:Itai
http://en.wikibooks.org/w/index.php?title=User:JECompton
http://en.wikibooks.org/w/index.php?title=User:JV
http://en.wikibooks.org/w/index.php?title=User:Jacho
http://en.wikibooks.org/w/index.php?title=User:JackPotte
http://en.wikibooks.org/w/index.php?title=User:
Jacobrothstein
194 http://en.wikibooks.org/w/index.php?title=User:Jamoroch
187
188
189
190
191
192
193
23
1
4
5
6
1
2
2
Jan Winnicki195
Janltx196
Janskalicky197
Jason barrington198
Jasu199
Javalenok200
Jayk201
Je ne dtiens pas la vrit universelle202
195 http://en.wikibooks.org/w/index.php?title=User:Jan_
Winnicki
196 http://en.wikibooks.org/w/index.php?title=User:Janltx
197 http://en.wikibooks.org/w/index.php?title=User:Janskalicky
198 http://en.wikibooks.org/w/index.php?title=User:Jason_
barrington
199 http://en.wikibooks.org/w/index.php?title=User:Jasu
200 http://en.wikibooks.org/w/index.php?title=User:Javalenok
201 http://en.wikibooks.org/w/index.php?title=User:Jayk
202 http://en.wikibooks.org/w/index.php?title=User:Je_ne_d%C3%
A9tiens_pas_la_v%C3%A9rit%C3%A9_universelle
1
9
1
2
1
1
1
1
203
204
205
206
207
208
209
210
211
JenVan203
Jer789204
Jevon205
Jflycn206
Jguk207
Jimbotyson208
Jld209
Jlrn210
Jmcdon10211
http://en.wikibooks.org/w/index.php?title=User:JenVan
http://en.wikibooks.org/w/index.php?title=User:Jer789
http://en.wikibooks.org/w/index.php?title=User:Jevon
http://en.wikibooks.org/w/index.php?title=User:Jflycn
http://en.wikibooks.org/w/index.php?title=User:Jguk
http://en.wikibooks.org/w/index.php?title=User:Jimbotyson
http://en.wikibooks.org/w/index.php?title=User:Jld
http://en.wikibooks.org/w/index.php?title=User:Jlrn
http://en.wikibooks.org/w/index.php?title=User:Jmcdon10
2
1
3
5
3
51
1
1
1
Joaospam212
Jodi.a.schneider213
Joe Schmedley214
Joeyboi215
John1923216
Jomegat217
Jonathan Webley218
Jotomicron219
212 http://en.wikibooks.org/w/index.php?title=User:Joaospam
213 http://en.wikibooks.org/w/index.php?title=User:Jodi.a.
schneider
214 http://en.wikibooks.org/w/index.php?title=User:Joe_
Schmedley
215 http://en.wikibooks.org/w/index.php?title=User:Joeyboi
216 http://en.wikibooks.org/w/index.php?title=User:John1923
217 http://en.wikibooks.org/w/index.php?title=User:Jomegat
218 http://en.wikibooks.org/w/index.php?title=User:Jonathan_
Webley
219 http://en.wikibooks.org/w/index.php?title=User:Jotomicron
1
1
2
1
1
12
30
1
Jraregris220
Jtwdog221
Juliabackhausen222
Juliusross223
Justin W Smith224
Jwchong225
Karcih226
Karper227
220 http://en.wikibooks.org/w/index.php?title=User:Jraregris
221 http://en.wikibooks.org/w/index.php?title=User:Jtwdog
222 http://en.wikibooks.org/w/index.php?title=User:
Juliabackhausen
223 http://en.wikibooks.org/w/index.php?title=User:Juliusross
224 http://en.wikibooks.org/w/index.php?title=User:Justin_W_
Smith
225 http://en.wikibooks.org/w/index.php?title=User:Jwchong
226 http://en.wikibooks.org/w/index.php?title=User:Karcih
227 http://en.wikibooks.org/w/index.php?title=User:Karper
1
28
2
5
1
1
2
2
Karthicknainar228
Kazkaskazkasako229
Kcho230
Kejia231
Kenyon232
Keplerspeed233
Kernigh234
Kevang235
228 http://en.wikibooks.org/w/index.php?title=User:
Karthicknainar
229 http://en.wikibooks.org/w/index.php?title=User:
Kazkaskazkasako
230 http://en.wikibooks.org/w/index.php?title=User:Kcho
231 http://en.wikibooks.org/w/index.php?title=User:Kejia
232 http://en.wikibooks.org/w/index.php?title=User:Kenyon
233 http://en.wikibooks.org/w/index.php?title=User:Keplerspeed
234 http://en.wikibooks.org/w/index.php?title=User:Kernigh
235 http://en.wikibooks.org/w/index.php?title=User:Kevang
1
7
1
4
1
7
1
2
236
237
238
239
240
241
242
243
244
Kevinfiesta236
KlausFoehl237
Klusinyan238
Konteki239
Kovianyo240
Kpym241
Kri242
Krischik243
Krishnavedala244
http://en.wikibooks.org/w/index.php?title=User:Kevinfiesta
http://en.wikibooks.org/w/index.php?title=User:KlausFoehl
http://en.wikibooks.org/w/index.php?title=User:Klusinyan
http://en.wikibooks.org/w/index.php?title=User:Konteki
http://en.wikibooks.org/w/index.php?title=User:Kovianyo
http://en.wikibooks.org/w/index.php?title=User:Kpym
http://en.wikibooks.org/w/index.php?title=User:Kri
http://en.wikibooks.org/w/index.php?title=User:Krischik
http://en.wikibooks.org/w/index.php?title=User:
Krishnavedala
1
1
1
1
14
1
14
1
1
245
246
247
248
249
250
251
252
253
Krisrose245
Kroolik246
Krst247
Kubieziel248
Kwetal249
LQST250
LR251
LaTeX252
Latexing253
http://en.wikibooks.org/w/index.php?title=User:Krisrose
http://en.wikibooks.org/w/index.php?title=User:Kroolik
http://en.wikibooks.org/w/index.php?title=User:Krst
http://en.wikibooks.org/w/index.php?title=User:Kubieziel
http://en.wikibooks.org/w/index.php?title=User:Kwetal
http://en.wikibooks.org/w/index.php?title=User:LQST
http://en.wikibooks.org/w/index.php?title=User:LR
http://en.wikibooks.org/w/index.php?title=User:LaTeX
http://en.wikibooks.org/w/index.php?title=User:Latexing
3
2
4
1
2
1
8
1
2
261
260
258
259
254
255
256
257
Lavaka254
Lbailey45255
Leyo256
LinuxChristian257
Listdata258
Literaturgenerator259
Lnkbuildingservices4u260
Louabill261
http://en.wikibooks.org/w/index.php?title=User:Lavaka
http://en.wikibooks.org/w/index.php?title=User:Lbailey45
http://en.wikibooks.org/w/index.php?title=User:Leyo
http://en.wikibooks.org/w/index.php?title=User:
LinuxChristian
http://en.wikibooks.org/w/index.php?title=User:Listdata
http://en.wikibooks.org/w/index.php?title=User:
Literaturgenerator
http://en.wikibooks.org/w/index.php?title=User:
Lnkbuildingservices4u
http://en.wikibooks.org/w/index.php?title=User:Louabill
1
1
1
1
3
1
1
1
Louisix262
Lucasreddinger263
MER-C264
MaBoehm265
Maartenweyn266
Madskaddie267
MagnusPI268
MarSraM269
Maratonda270
262 http://en.wikibooks.org/w/index.php?title=User:Louisix
263 http://en.wikibooks.org/w/index.php?title=User:
Lucasreddinger
264 http://en.wikibooks.org/w/index.php?title=User:MER-C
265 http://en.wikibooks.org/w/index.php?title=User:MaBoehm
266 http://en.wikibooks.org/w/index.php?title=User:Maartenweyn
267 http://en.wikibooks.org/w/index.php?title=User:Madskaddie
268 http://en.wikibooks.org/w/index.php?title=User:MagnusPI
269 http://en.wikibooks.org/w/index.php?title=User:MarSraM
270 http://en.wikibooks.org/w/index.php?title=User:Maratonda
3
3
1
1
3
1
2
1
1
Marozols271
Marra272
Martin scharrer273
Martin von Wittich274
MartinSpacek275
Martinkunev276
Masterpiga277
271 http://en.wikibooks.org/w/index.php?title=User:Marozols
272 http://en.wikibooks.org/w/index.php?title=User:Marra
273 http://en.wikibooks.org/w/index.php?title=User:Martin_
scharrer
274 http://en.wikibooks.org/w/index.php?title=User:Martin_von_
Wittich
275 http://en.wikibooks.org/w/index.php?title=User:
MartinSpacek
276 http://en.wikibooks.org/w/index.php?title=User:Martinkunev
277 http://en.wikibooks.org/w/index.php?title=User:Masterpiga
4
2
1
1
6
1
2
Matej.korvas278
Mathieu Perrin279
Matthias M.280
Mckay281
Mcld282
Mecanismo283
Merciadriluca284
Mhue285
278 http://en.wikibooks.org/w/index.php?title=User:Matej.
korvas
279 http://en.wikibooks.org/w/index.php?title=User:Mathieu_
Perrin
280 http://en.wikibooks.org/w/index.php?title=User:Matthias_M.
281 http://en.wikibooks.org/w/index.php?title=User:Mckay
282 http://en.wikibooks.org/w/index.php?title=User:Mcld
283 http://en.wikibooks.org/w/index.php?title=User:Mecanismo
284 http://en.wikibooks.org/w/index.php?title=User:
Merciadriluca
285 http://en.wikibooks.org/w/index.php?title=User:Mhue
1
2
1
1
19
1
1
4
MichaelBueker286
Mietchen287
Mijikenda288
Mike.lifeguard289
Mikhail Ryazanov290
Mimo291
MoMaT292
286 http://en.wikibooks.org/w/index.php?title=User:
MichaelBueker
287 http://en.wikibooks.org/w/index.php?title=User:Mietchen
288 http://en.wikibooks.org/w/index.php?title=User:Mijikenda
289 http://en.wikibooks.org/w/index.php?title=User:Mike.
lifeguard
290 http://en.wikibooks.org/w/index.php?title=User:Mikhail_
Ryazanov
291 http://en.wikibooks.org/w/index.php?title=User:Mimo
292 http://en.wikibooks.org/w/index.php?title=User:MoMaT
1
1
1
1
2
2
1
Modest Genius293
Morelight294
Mouselb295
Mrt doulaty296
Ms2ger297
Mwtoews298
Naught101299
NavarroJ300
Nbrouard301
293 http://en.wikibooks.org/w/index.php?title=User:Modest_
Genius
294 http://en.wikibooks.org/w/index.php?title=User:Morelight
295 http://en.wikibooks.org/w/index.php?title=User:Mouselb
296 http://en.wikibooks.org/w/index.php?title=User:Mrt_doulaty
297 http://en.wikibooks.org/w/index.php?title=User:Ms2ger
298 http://en.wikibooks.org/w/index.php?title=User:Mwtoews
299 http://en.wikibooks.org/w/index.php?title=User:Naught101
300 http://en.wikibooks.org/w/index.php?title=User:NavarroJ
301 http://en.wikibooks.org/w/index.php?title=User:Nbrouard
1
3
1
1
1
84
2
1
3
Neet302
Nemoniac303
Nemti304
Neoptolemus305
Neoriddle306
Netheril96307
Niel.Bowerman308
Nigels309
Nixphoeni310
http://en.wikibooks.org/w/index.php?title=User:Neet
http://en.wikibooks.org/w/index.php?title=User:Nemoniac
http://en.wikibooks.org/w/index.php?title=User:Nemti
http://en.wikibooks.org/w/index.php?title=User:Neoptolemus
http://en.wikibooks.org/w/index.php?title=User:Neoriddle
http://en.wikibooks.org/w/index.php?title=User:Netheril96
http://en.wikibooks.org/w/index.php?title=User:Niel.
Bowerman
309 http://en.wikibooks.org/w/index.php?title=User:Nigels
310 http://en.wikibooks.org/w/index.php?title=User:Nixphoeni
302
303
304
305
306
307
308
21
1
1
2
5
1
1
1
3
Nkour311
Norbert.beckers312
Nothing1212313
NqpZ314
Nsuwan315
Nux316
Obelyaev317
Oderbolz318
Ojan319
311 http://en.wikibooks.org/w/index.php?title=User:Nkour
312 http://en.wikibooks.org/w/index.php?title=User:Norbert.
beckers
313 http://en.wikibooks.org/w/index.php?title=User:Nothing1212
314 http://en.wikibooks.org/w/index.php?title=User:NqpZ
315 http://en.wikibooks.org/w/index.php?title=User:Nsuwan
316 http://en.wikibooks.org/w/index.php?title=User:Nux
317 http://en.wikibooks.org/w/index.php?title=User:Obelyaev
318 http://en.wikibooks.org/w/index.php?title=User:Oderbolz
319 http://en.wikibooks.org/w/index.php?title=User:Ojan
1
1
1
1
4
1
1
1
1
Olesh320
Olivier.descout321
Orderud322
Otec Stochastik323
PAC324
PAC2325
Pamputt326
Pandora85327
320 http://en.wikibooks.org/w/index.php?title=User:Olesh
321 http://en.wikibooks.org/w/index.php?title=User:Olivier.
descout
322 http://en.wikibooks.org/w/index.php?title=User:Orderud
323 http://en.wikibooks.org/w/index.php?title=User:Otec_
Stochastik
324 http://en.wikibooks.org/w/index.php?title=User:PAC
325 http://en.wikibooks.org/w/index.php?title=User:PAC2
326 http://en.wikibooks.org/w/index.php?title=User:Pamputt
327 http://en.wikibooks.org/w/index.php?title=User:Pandora85
2
1
22
1
29
25
1
1
Panic2k4328
PatrickDevlin21329
PatrickGalyon330
Paxinum331
Pdelong332
PeterAllen333
Petter Strandmark334
PhilJohnG335
328 http://en.wikibooks.org/w/index.php?title=User:Panic2k4
329 http://en.wikibooks.org/w/index.php?title=User:
PatrickDevlin21
330 http://en.wikibooks.org/w/index.php?title=User:
PatrickGalyon
331 http://en.wikibooks.org/w/index.php?title=User:Paxinum
332 http://en.wikibooks.org/w/index.php?title=User:Pdelong
333 http://en.wikibooks.org/w/index.php?title=User:PeterAllen
334 http://en.wikibooks.org/w/index.php?title=User:Petter_
Strandmark
335 http://en.wikibooks.org/w/index.php?title=User:PhilJohnG
3
3
1
4
2
1
2
2
Pi zero336
Piksi337
Pmillerrhodes338
Pmlineditor339
Polytropos Technikos340
Ppadmapriya341
Prawojazdy342
Prispartlow343
336 http://en.wikibooks.org/w/index.php?title=User:Pi_zero
337 http://en.wikibooks.org/w/index.php?title=User:Piksi
338 http://en.wikibooks.org/w/index.php?title=User:
Pmillerrhodes
339 http://en.wikibooks.org/w/index.php?title=User:Pmlineditor
340 http://en.wikibooks.org/w/index.php?title=User:Polytropos_
Technikos
341 http://en.wikibooks.org/w/index.php?title=User:Ppadmapriya
342 http://en.wikibooks.org/w/index.php?title=User:Prawojazdy
343 http://en.wikibooks.org/w/index.php?title=User:Prispartlow
82
11
13
1
1
1
1
1
Pstar344
PsyberS345
QUBot346
Qeny347
QuantumEleven348
Quaristice349
QuiteUnusual350
Qwertyus351
http://en.wikibooks.org/w/index.php?title=User:Pstar
http://en.wikibooks.org/w/index.php?title=User:PsyberS
http://en.wikibooks.org/w/index.php?title=User:QUBot
http://en.wikibooks.org/w/index.php?title=User:Qeny
http://en.wikibooks.org/w/index.php?title=User:
QuantumEleven
349 http://en.wikibooks.org/w/index.php?title=User:Quaristice
350 http://en.wikibooks.org/w/index.php?title=User:
QuiteUnusual
351 http://en.wikibooks.org/w/index.php?title=User:Qwertyus
344
345
346
347
348
7
1
2
1
1
1
8
3
Rafaelgr352
Rafopar353
Rajkiran g354
Ramac355
Raphael Ackermann356
Raylu357
RaymondSutanto358
Rbonvall359
http://en.wikibooks.org/w/index.php?title=User:Rafaelgr
http://en.wikibooks.org/w/index.php?title=User:Rafopar
http://en.wikibooks.org/w/index.php?title=User:Rajkiran_g
http://en.wikibooks.org/w/index.php?title=User:Ramac
http://en.wikibooks.org/w/index.php?title=User:Raphael_
Ackermann
357 http://en.wikibooks.org/w/index.php?title=User:Raylu
358 http://en.wikibooks.org/w/index.php?title=User:
RaymondSutanto
359 http://en.wikibooks.org/w/index.php?title=User:Rbonvall
352
353
354
355
356
1
1
3
3
1
1
1
3
Rdg nz360
RealSebix361
Recent Runes362
Redirect fixer363
Rehoot364
Ricordisamoa365
Risk366
Rnddim367
360 http://en.wikibooks.org/w/index.php?title=User:Rdg_nz
361 http://en.wikibooks.org/w/index.php?title=User:RealSebix
362 http://en.wikibooks.org/w/index.php?title=User:Recent_
Runes
363 http://en.wikibooks.org/w/index.php?title=User:Redirect_
fixer
364 http://en.wikibooks.org/w/index.php?title=User:Rehoot
365 http://en.wikibooks.org/w/index.php?title=User:
Ricordisamoa
366 http://en.wikibooks.org/w/index.php?title=User:Risk
367 http://en.wikibooks.org/w/index.php?title=User:Rnddim
1
17
8
1
4
1
1
1
Roarbakk368
Robbiemorrison369
Robert Borkowski370
Robert Horning371
Robin372
Rogal373
Rogerbrent374
368 http://en.wikibooks.org/w/index.php?title=User:Roarbakk
369 http://en.wikibooks.org/w/index.php?title=User:
Robbiemorrison
370 http://en.wikibooks.org/w/index.php?title=User:Robert_
Borkowski
371 http://en.wikibooks.org/w/index.php?title=User:Robert_
Horning
372 http://en.wikibooks.org/w/index.php?title=User:Robin
373 http://en.wikibooks.org/w/index.php?title=User:Rogal
374 http://en.wikibooks.org/w/index.php?title=User:Rogerbrent
1
5
1
4
3
1
1
Rondenaranja375
Rossdub376
Rror377
Sabalka378
SamuelLB379
Sanderd17380
Sandman10000381
Sandrobt382
375 http://en.wikibooks.org/w/index.php?title=User:
Rondenaranja
376 http://en.wikibooks.org/w/index.php?title=User:Rossdub
377 http://en.wikibooks.org/w/index.php?title=User:Rror
378 http://en.wikibooks.org/w/index.php?title=User:Sabalka
379 http://en.wikibooks.org/w/index.php?title=User:SamuelLB
380 http://en.wikibooks.org/w/index.php?title=User:Sanderd17
381 http://en.wikibooks.org/w/index.php?title=User:
Sandman10000
382 http://en.wikibooks.org/w/index.php?title=User:Sandrobt
4
2
1
4
35
4
1
1
388
389
390
391
383
384
385
386
387
Sargas383
Sbeyer384
Schaber385
SciYann386
Scientific29387
Scorwin388
Scruss389
Semperos390
Sgenier391
http://en.wikibooks.org/w/index.php?title=User:Sargas
http://en.wikibooks.org/w/index.php?title=User:Sbeyer
http://en.wikibooks.org/w/index.php?title=User:Schaber
http://en.wikibooks.org/w/index.php?title=User:SciYann
http://en.wikibooks.org/w/index.php?title=User:
Scientific29
http://en.wikibooks.org/w/index.php?title=User:Scorwin
http://en.wikibooks.org/w/index.php?title=User:Scruss
http://en.wikibooks.org/w/index.php?title=User:Semperos
http://en.wikibooks.org/w/index.php?title=User:Sgenier
14
1
2
1
1
1
1
2
1
Shahbaz Youssefi392
Silca678393
Silverpie394
Simeon395
Simonjtyler396
SiriusB397
Sjlegg398
Skarakoleva399
Skou400
392 http://en.wikibooks.org/w/index.php?title=User:Shahbaz_
Youssefi
393 http://en.wikibooks.org/w/index.php?title=User:Silca678
394 http://en.wikibooks.org/w/index.php?title=User:Silverpie
395 http://en.wikibooks.org/w/index.php?title=User:Simeon
396 http://en.wikibooks.org/w/index.php?title=User:Simonjtyler
397 http://en.wikibooks.org/w/index.php?title=User:SiriusB
398 http://en.wikibooks.org/w/index.php?title=User:Sjlegg
399 http://en.wikibooks.org/w/index.php?title=User:Skarakoleva
400 http://en.wikibooks.org/w/index.php?title=User:Skou
1
4
1
1
2
1
2
1
1
Smobbl Bobbl401
Snaxe920402
Snoopy67403
Spag85404
Spelemann405
Spirosdenaxas406
Spook407
Steindani408
401 http://en.wikibooks.org/w/index.php?title=User:Smobbl_
Bobbl
402 http://en.wikibooks.org/w/index.php?title=User:Snaxe920
403 http://en.wikibooks.org/w/index.php?title=User:Snoopy67
404 http://en.wikibooks.org/w/index.php?title=User:Spag85
405 http://en.wikibooks.org/w/index.php?title=User:Spelemann
406 http://en.wikibooks.org/w/index.php?title=User:
Spirosdenaxas
407 http://en.wikibooks.org/w/index.php?title=User:Spook
408 http://en.wikibooks.org/w/index.php?title=User:Steindani
1
5
1
4
11
4
1
1
Stephan Schneider409
SteveM82410
StevenJohnston411
Stoettner412
Stuples413
Svick414
Swift415
TFTD416
409 http://en.wikibooks.org/w/index.php?title=User:Stephan_
Schneider
410 http://en.wikibooks.org/w/index.php?title=User:SteveM82
411 http://en.wikibooks.org/w/index.php?title=User:
StevenJohnston
412 http://en.wikibooks.org/w/index.php?title=User:Stoettner
413 http://en.wikibooks.org/w/index.php?title=User:Stuples
414 http://en.wikibooks.org/w/index.php?title=User:Svick
415 http://en.wikibooks.org/w/index.php?title=User:Swift
416 http://en.wikibooks.org/w/index.php?title=User:TFTD
3
1
1
7
1
1
1
1
TWiStErRob417
Tauriel-1418
Tazquebec419
Tdomhan420
Teles421
Tgwizard422
Thefrankinator423
Thenub314424
Thietkeweb425
http://en.wikibooks.org/w/index.php?title=User:TWiStErRob
http://en.wikibooks.org/w/index.php?title=User:Tauriel-1
http://en.wikibooks.org/w/index.php?title=User:Tazquebec
http://en.wikibooks.org/w/index.php?title=User:Tdomhan
http://en.wikibooks.org/w/index.php?title=User:Teles
http://en.wikibooks.org/w/index.php?title=User:Tgwizard
http://en.wikibooks.org/w/index.php?title=User:
Thefrankinator
424 http://en.wikibooks.org/w/index.php?title=User:Thenub314
425 http://en.wikibooks.org/w/index.php?title=User:Thietkeweb
417
418
419
420
421
422
423
1
1
3
1
1
1
5
21
2
TinyTimZamboni426
ToematoeAdmn427
Tom Morris428
Tom.marcik429
Tomato86430
Tomxlawson431
TomyDuby432
Topodelapradera433
426 http://en.wikibooks.org/w/index.php?title=User:
TinyTimZamboni
427 http://en.wikibooks.org/w/index.php?title=User:
ToematoeAdmn
428 http://en.wikibooks.org/w/index.php?title=User:Tom_Morris
429 http://en.wikibooks.org/w/index.php?title=User:Tom.marcik
430 http://en.wikibooks.org/w/index.php?title=User:Tomato86
431 http://en.wikibooks.org/w/index.php?title=User:Tomxlawson
432 http://en.wikibooks.org/w/index.php?title=User:TomyDuby
433 http://en.wikibooks.org/w/index.php?title=User:
Topodelapradera
2
1
1
3
124
6
11
2
TorfusPolymorphus434
Tosha435
Towsonu2003436
Tpr437
Tualha438
Tuetschek439
Tuka440
Tully441
Tweenk442
434 http://en.wikibooks.org/w/index.php?title=User:
TorfusPolymorphus
435 http://en.wikibooks.org/w/index.php?title=User:Tosha
436 http://en.wikibooks.org/w/index.php?title=User:Towsonu2003
437 http://en.wikibooks.org/w/index.php?title=User:Tpr
438 http://en.wikibooks.org/w/index.php?title=User:Tualha
439 http://en.wikibooks.org/w/index.php?title=User:Tuetschek
440 http://en.wikibooks.org/w/index.php?title=User:Tuka
441 http://en.wikibooks.org/w/index.php?title=User:Tully
442 http://en.wikibooks.org/w/index.php?title=User:Tweenk
5
14
2
1
1
1
1
8
1
Uluboz443
Unbitwise444
Unco445
Urhixidur446
Vadik wiki447
Vaffelkake448
Velociostrich449
Vesal450
Waldir451
http://en.wikibooks.org/w/index.php?title=User:Uluboz
http://en.wikibooks.org/w/index.php?title=User:Unbitwise
http://en.wikibooks.org/w/index.php?title=User:Unco
http://en.wikibooks.org/w/index.php?title=User:Urhixidur
http://en.wikibooks.org/w/index.php?title=User:Vadik_wiki
http://en.wikibooks.org/w/index.php?title=User:Vaffelkake
http://en.wikibooks.org/w/index.php?title=User:
Velociostrich
450 http://en.wikibooks.org/w/index.php?title=User:Vesal
451 http://en.wikibooks.org/w/index.php?title=User:Waldir
443
444
445
446
447
448
449
1
1
1
3
6
3
3
10
70
Wdcf452
Webinn453
Wenzeslaus454
White gecko455
Whiteknight456
Wikieditoroftoday457
Willy james458
Winfree459
Winniehell460
http://en.wikibooks.org/w/index.php?title=User:Wdcf
http://en.wikibooks.org/w/index.php?title=User:Webinn
http://en.wikibooks.org/w/index.php?title=User:Wenzeslaus
http://en.wikibooks.org/w/index.php?title=User:White_gecko
http://en.wikibooks.org/w/index.php?title=User:Whiteknight
http://en.wikibooks.org/w/index.php?title=User:
Wikieditoroftoday
458 http://en.wikibooks.org/w/index.php?title=User:Willy_james
459 http://en.wikibooks.org/w/index.php?title=User:Winfree
460 http://en.wikibooks.org/w/index.php?title=User:Winniehell
452
453
454
455
456
457
4
1
1
1
1
9
1
1
1
461
462
463
464
465
466
467
468
469
Withinfocus461
Wkdurfee462
Wmheric463
Wn202464
Writalnaie465
Wxm29466
Wysinwygaa467
Xania468
Xeracles469
http://en.wikibooks.org/w/index.php?title=User:Withinfocus
http://en.wikibooks.org/w/index.php?title=User:Wkdurfee
http://en.wikibooks.org/w/index.php?title=User:Wmheric
http://en.wikibooks.org/w/index.php?title=User:Wn202
http://en.wikibooks.org/w/index.php?title=User:Writalnaie
http://en.wikibooks.org/w/index.php?title=User:Wxm29
http://en.wikibooks.org/w/index.php?title=User:Wysinwygaa
http://en.wikibooks.org/w/index.php?title=User:Xania
http://en.wikibooks.org/w/index.php?title=User:Xeracles
28
1
1
1
2
2
1
5
1
470
471
472
473
474
475
476
477
478
Xnn470
Xonqnopp471
Yanuzz472
Yez473
Ynhockey474
Ypey475
Ysnikraz476
ZeroOne477
Zrisher478
http://en.wikibooks.org/w/index.php?title=User:Xnn
http://en.wikibooks.org/w/index.php?title=User:Xonqnopp
http://en.wikibooks.org/w/index.php?title=User:Yanuzz
http://en.wikibooks.org/w/index.php?title=User:Yez
http://en.wikibooks.org/w/index.php?title=User:Ynhockey
http://en.wikibooks.org/w/index.php?title=User:Ypey
http://en.wikibooks.org/w/index.php?title=User:Ysnikraz
http://en.wikibooks.org/w/index.php?title=User:ZeroOne
http://en.wikibooks.org/w/index.php?title=User:Zrisher
1
12
1
1
1
1
1
3
1
485
Zvika479
Zwiebelleder480
Zxx117481
Zyqqh482
Zzo38483
var Arnfjr Bjarmason484
479 http://en.wikibooks.org/w/index.php?title=User:Zvika
480 http://en.wikibooks.org/w/index.php?title=User:
Zwiebelleder
481 http://en.wikibooks.org/w/index.php?title=User:Zxx117
482 http://en.wikibooks.org/w/index.php?title=User:Zyqqh
483 http://en.wikibooks.org/w/index.php?title=User:Zzo38
484 http://en.wikibooks.org/w/index.php?title=User:%C3%86var_
Arnfj%C3%B6r%C3%B0_Bjarmason
485 http://en.wikibooks.org/w/index.php?title=User:%D0%9F%D0%
B8%D0%BA%D0%B0_%D0%9F%D0%B8%D0%BA%D0%B0
3
1
1
2
1
1
1
486
486 http://en.wikibooks.org/w/index.php?title=User:%D8%A7%D9%
85%DB%8C%D8%B1_%D8%A7%D8%B9%D9%88%D8%A7%D9%86%DB%8C
List of Figures
http://www.gnu.org/
EURO: This is the common (reverse) face of a euro coin. The copyright
on the design of the common face of the euro coins belongs to the
European Commission. Authorised is reproduction in a format without
relief (drawings, paintings, films) provided they are not detrimental to
the image of the euro.
ATTR: The copyright holder of this file allows anyone to use it for
any purpose, provided that the copyright holder is properly attributed.
Redistribution, derivative work, commercial use, and all other use is
permitted.
Copies of the GPL, the LGPL as well as a GFDL are included in chapter
Licenses487 . Please note that images in the public domain do not require
attribution. You may click on the image numbers in the following table to open
the webpage of the images in your webbrower.
488
489
490
491
492
Dirk Hnniger489
Dirk Hnniger490
Literaturgenerator491
5
6
7
8
GFDL
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
GFDL
GFDL
PD
cc-by-sa3.0
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ALiteraturgenerator
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
Mij
Dirk Hnniger492
Alessio Damato
Dirk Hnniger488
1
2
493
494
495
496
497
498
Dirk Hnniger494
Dirk Hnniger495
Dirk Hnniger496
Dirk Hnniger497
Dirk Hnniger498
10
11
12
13
14
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
Dirk Hnniger493
499
500
501
502
503
504
Dirk Hnniger500
Dirk Hnniger501
Dirk Hnniger502
Dirk Hnniger503
Dirk Hnniger504
16
17
18
19
20
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
Dirk Hnniger499
15
505
506
507
508
509
510
Dirk Hnniger506
Dirk Hnniger507
Dirk Hnniger508
Dirk Hnniger509
Dirk Hnniger510
22
23
24
25
26
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
Dirk Hnniger505
21
511
512
513
514
515
516
Dirk Hnniger512
Dirk Hnniger513
Dirk Hnniger514
Dirk Hnniger515
Dirk Hnniger516
28
29
30
31
32
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
Dirk Hnniger511
27
517
518
519
520
521
522
Dirk Hnniger518
Dirk Hnniger519
Alessio Damato520
Dirk Hnniger521
Dirk Hnniger522
34
35
36
37
38
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
GFDL
cc-by-sa3.0
cc-by-sa3.0
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3AAlejo2083
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
http://en.wikibooks.org/wiki/User%3ADirk%20H%FCnniger
Dirk Hnniger517
33
GFDL
GFDL
523 http://en.wikibooks.org/wiki/%3Awikibooks%3Aen%3AUser%
3AJtwdog
524 http://en.wikibooks.org
525 http://en.wikibooks.org/wiki/%3Awikibooks%3Aen%3AUser%
3AJtwdog
526 http://en.wikibooks.org
527 http://en.wikibooks.org/wiki/%3Awikibooks%3Aen%3AUser%
3AJtwdog
528 http://en.wikibooks.org
41
40
39
GFDL
529 http://en.wikibooks.org/wiki/%3Awikibooks%3Aen%3AUser%
3AJtwdog
530 http://en.wikibooks.org
531 http://en.wikibooks.org/wiki/User%3AChrisHodgesUK
532 http://en.wikibooks.org/wiki/User%3AChrisHodgesUK
533 http://en.wikibooks.org/wiki/User%3AAlejo2083
534 http://en.wikibooks.org/wiki/User%3AMwtoews
535 http://en.wikibooks.org/wiki/User%3AMwtoews
536 http://en.wikibooks.org/wiki/User%3AAlejo2083
537 http://en.wikibooks.org/wiki/User%3AAlejo2083
43
44
45
46
47
48
49
42
538
539
540
541
542
543
544
545
546
Alessio Damato538
ChrisHodgesUK539
ChrisHodgesUK540
Tomato86541
Alessio Damato542
ChrisHodgesUK543
Winfree544
Tomato86545
Neet546
PD
GFDL
PD
GFDL
GFDL
GFDL
http://en.wikibooks.org/wiki/User%3AAlejo2083
http://en.wikibooks.org/wiki/User%3AChrisHodgesUK
http://en.wikibooks.org/wiki/User%3AChrisHodgesUK
http://en.wikibooks.org/wiki/User%3ATomato86
http://en.wikibooks.org/wiki/User%3AAlejo2083
http://en.wikibooks.org/wiki/User%3AChrisHodgesUK
http://en.wikibooks.org/wiki/User%3AWinfree
http://en.wikibooks.org/wiki/User%3ATomato86
http://en.wikibooks.org/wiki/User%3ANeet
50
51
52
53
54
55
56
57
58
547
548
549
550
551
552
553
554
555
Neet547
Neet548
Neet549
Neet550
Tomato86551
Tomato86552
Tomato86553
Tomato86554
Inductiveload555
PD
PD
PD
PD
GFDL
GFDL
GFDL
GFDL
PD
http://en.wikibooks.org/wiki/User%3ANeet
http://en.wikibooks.org/wiki/User%3ANeet
http://en.wikibooks.org/wiki/User%3ANeet
http://en.wikibooks.org/wiki/User%3ANeet
http://en.wikibooks.org/wiki/User%3ATomato86
http://en.wikibooks.org/wiki/User%3ATomato86
http://en.wikibooks.org/wiki/User%3ATomato86
http://en.wikibooks.org/wiki/User%3ATomato86
http://en.wikibooks.org/wiki/User%3AInductiveload
59
60
61
62
63
64
65
66
67
556
557
558
559
560
561
562
563
564
Tomato86556
Tomato86557
Tomato86558
ChrisHodgesUK559
Tomato86560
Alessio Damato561
Alessio Damato562 13:31, 12 January
2007 (UTC)
Alessio Damato563
Nemti564
GFDL
PD
GFDL
GFDL
GFDL
GFDL
GFDL
GFDL
http://en.wikibooks.org/wiki/User%3ATomato86
http://en.wikibooks.org/wiki/User%3ATomato86
http://en.wikibooks.org/wiki/User%3ATomato86
http://en.wikibooks.org/wiki/User%3AChrisHodgesUK
http://en.wikibooks.org/wiki/User%3ATomato86
http://en.wikibooks.org/wiki/User%3AAlejo2083
http://en.wikibooks.org/wiki/User%3AAlejo2083
http://en.wikibooks.org/wiki/User%3AAlejo2083
http://en.wikibooks.org/wiki/User%3ANemti
75
76
68
69
70
71
72
73
74
565
566
567
568
569
570
Hankjones569
jeg
Hankjones570
82
83
84
GFDL
GFDL
cc-by-sa3.0
cc-by-sa3.0
GFDL
GPL
http://en.wikibooks.org/wiki/User%3AGkc
http://en.wikibooks.org/wiki/User%20talk%3AGkc
http://en.wikibooks.org/wiki/User%3AHankjones
http://en.wikibooks.org/wiki/User%3AHankjones
http://en.wikibooks.org/wiki/User%3AHankjones
http://en.wikibooks.org/wiki/User%3AHankjones
77
78
79
80
81
571
572
573
574
575
576
577
86
87
88
89
90
91
92
93
GFDL
cc-by-sa3.0
PD
PD
cc-by-sa3.0
http://en.wikibooks.org/wiki/User%3AHankjones
http://en.wikibooks.org/wiki/User%3APhilJohnG
http://en.wikibooks.org/wiki/User%3APhilJohnG
http://en.wikibooks.org/wiki/User%3APhilJohnG
http://en.wikibooks.org/wiki/User%3AMatej.korvas
http://en.wikibooks.org/wiki/User%3AMatej.korvas
http://en.wikibooks.org/wiki/User%3AOlesh
Hankjones571
85
578
579
580
581
582
583
Hankjones579
ChrisHodgesUK580
Hankjones581
Hankjones582
Hankjones583
95
96
97
98
99
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
cc-by-sa3.0
http://en.wikibooks.org/wiki/User%3AHankjones
http://en.wikibooks.org/wiki/User%3AHankjones
http://en.wikibooks.org/wiki/User%3AChrisHodgesUK
http://en.wikibooks.org/wiki/User%3AHankjones
http://en.wikibooks.org/wiki/User%3AHankjones
http://en.wikibooks.org/wiki/User%3AHankjones
Hankjones578
94
584
585
586
587
588
589
590
gms
Israel Buitron586
Alessio Damato587
Alessio Damato
Alessio Damato588
Alessio Damato589
Alessio Damato590
Derbeth585
cc-by-sa3.0
GFDL
PD
GFDL
GFDL
GFDL
GFDL
GFDL
GFDL
GFDL
http://en.wikibooks.org/wiki/User%3AHankjones
http://en.wikibooks.org/wiki/User%3ADerbeth
http://en.wikibooks.org/wiki/User%3ANeoriddle
http://en.wikibooks.org/wiki/User%3AAlejo2083
http://en.wikibooks.org/wiki/User%3AAlejo2083
http://en.wikibooks.org/wiki/User%3AAlejo2083
http://en.wikibooks.org/wiki/User%3AAlejo2083
101
102
103
104
105
106
107
108
109
100 Hankjones584
591 http://en.wikibooks.org/wiki/%3Awikibooks%3Aen%3AUser%
3AArnehe
592 http://en.wikibooks.org
593 http://en.wikibooks.org/wiki/%3Awikibooks%3Aen%3AUser%
3AArnehe
594 http://en.wikibooks.org
595 http://en.wikibooks.org/wiki/%3Awikibooks%3Aen%3AUser%
3AArnehe
596 http://en.wikibooks.org
GFDL
GFDL
GFDL
GFDL
GFDL
GFDL
597 http://en.wikibooks.org/wiki/%3Awikibooks%3Aen%3AUser%
3AArnehe
598 http://en.wikibooks.org
599 http://en.wikibooks.org/wiki/%3Awikibooks%3Aen%3AUser%
3AArnehe
600 http://en.wikibooks.org
601 http://en.wikibooks.org/wiki/User%3AAlejo2083
602 http://en.wikibooks.org/wiki/User%3ATomato86
603 http://en.wikibooks.org/wiki/User%3AThenub314
Andrew Roberts
Tobias Oetiker
Tobias Oetiker
Tobias Oetiker
Jtwdog606 at en.wikibooks607
Tomato86604
Derbeth605
Tobias Oetiker
GFDL
GFDL
GFDL
GFDL
GFDL
GFDL
GFDL
PD
GFDL
GFDL
GFDL
604 http://en.wikibooks.org/wiki/User%3ATomato86
605 http://en.wikibooks.org/wiki/User%3ADerbeth
606 http://en.wikibooks.org/wiki/%3Awikibooks%3Aen%3AUser%
3AJtwdog
607 http://en.wikibooks.org
121
122
123
124
125
126
127
128
129
130
131
132
GFDL
608 http://en.wikibooks.org/wiki/User%3AJimbotyson
133 Jimbotyson608
Free
Inc.
Copyright 2007
Software Foundation,
<http://fsf.org/>
When we speak of free software, we are referring to freedom, not price. Our General
Public Licenses are designed to
make sure that you have the freedom to distribute copies of free
software (and charge for them
if you wish), that you receive
source code or can get it if you
want it, that you can change the
software or use pieces of it in
new free programs, and that you
know you can do these things.
49. Licenses
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS 0.
Definitions.
Copyright
also
means
copyright-like laws that apply to other kinds of works,
such as semiconductor masks.
An interactive user interface displays Appropriate Legal Notices to the extent that it includes a convenient and prominently visible feature that (1)
displays an appropriate copyright notice, and (2) tells the
user that there is no warranty for
the work (except to the extent
that warranties are provided),
that licensees may convey the
work under this License, and
how to view a copy of this License. If the interface presents
a list of user commands or options, such as a menu, a promi-
You may make, run and propagate covered works that you do
not convey, without conditions
All rights granted under this License are granted for the term
of copyright on the Program,
and are irrevocable provided the
stated conditions are met. This
License explicitly affirms your
unlimited permission to run the
unmodified Program. The output from running a covered
work is covered by this License
only if the output, given its
content, constitutes a covered
work. This License acknowledges your rights of fair use or
other equivalent, as provided by
copyright law.
A compilation of a covered
work with other separate and independent works, which are not
by their nature extensions of the
covered work, and which are
not combined with it such as to
form a larger program, in or on
a volume of a storage or distribution medium, is called an aggregate if the compilation and
its resulting copyright are not
used to limit the access or legal rights of the compilations
users beyond what the individ-
* a) Disclaiming warranty or
limiting liability differently
from the terms of sections 15
and 16 of this License; or * b)
Requiring preservation of specified reasonable legal notices
Notwithstanding any other provision of this License, for material you add to a covered work,
you may (if authorized by the
copyright holders of that material) supplement the terms of
this License with terms:
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise
to propagate or modify it is
void, and will automatically terminate your rights under this License (including any patent licenses granted under the third
paragraph of section 11).
An entity transaction is a
transaction transferring control
of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results
from an entity transaction, each
party to that transaction who receives a copy of the work also
receives whatever licenses to the
work the partys predecessor in
interest had or could give under
the previous paragraph, plus a
right to possession of the Corresponding Source of the work
from the predecessor in interest,
if the predecessor has it or can
get it with reasonable efforts.
A contributor is a copyright
holder who authorizes use under
this License of the Program or
a work on which the Program is
based. The work thus licensed
is called the contributors contributor version.
IN NO EVENT UNLESS
REQUIRED BY APPLICABLE LAW OR AGREED TO
IN WRITING WILL ANY
COPYRIGHT
HOLDER,
THERE IS NO WARRANTY
FOR THE PROGRAM, TO
THE EXTENT PERMITTED
BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE
COPYRIGHT
HOLDERS
AND/OR OTHER PARTIES
PROVIDE THE PROGRAM
AS IS WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR
IMPLIED, INCLUDING, BUT
NOT LIMITED TO, THE
IMPLIED
WARRANTIES
OF
MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE
QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
COST OF ALL NECESSARY
SERVICING, REPAIR OR
CORRECTION. 16. Limitation
of Liability.
<program>
Copyright
(C)
<year> <name of author> This
program comes with ABSOLUTELY NO WARRANTY;
for details type show w. This
is free software, and you are
welcome to redistribute it under
certain conditions; type show
c for details.
this program.
If not, see
<http://www.gnu.org/licenses/>.
This License is a kind of "copyleft", which means that derivative works of the document must
themselves be free in the same
sense. It complements the GNU
General Public License, which
A "Secondary Section" is a
named appendix or a frontmatter section of the Document
that deals exclusively with the
relationship of the publishers
or authors of the Document to
the Documents overall subject
(or to related matters) and contains nothing that could fall directly within that overall subject.
(Thus, if the Document is in
part a textbook of mathematics,
a Secondary Section may not explain any mathematics.) The
relationship could be a matter
of historical connection with the
subject or with related matters,
or of legal, commercial, philo-
lic, that is suitable for revising the document straightforwardly with generic text editors or (for images composed
of pixels) generic paint programs or (for drawings) some
widely available drawing editor,
and that is suitable for input to
text formatters or for automatic
translation to a variety of formats suitable for input to text
formatters. A copy made in an
otherwise Transparent file format whose markup, or absence
of markup, has been arranged to
thwart or discourage subsequent
modification by readers is not
Transparent. An image format
is not Transparent if used for
any substantial amount of text.
A copy that is not "Transparent"
is called "Opaque".
You may also lend copies, under the same conditions stated
above, and you may publicly
display copies. 3. COPYING
IN QUANTITY
You may combine the Document with other documents released under this License, under the terms defined in section
4 above for modified versions,
provided that you include in the
combination all of the Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in
its license notice, and that you
preserve all their Warranty Disclaimers.
You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, or distribute it is
void, and will automatically terminate your rights under this License.
"CC-BY-SA" means the Creative Commons AttributionShare Alike 3.0 license published by Creative Commons
Corporation, a not-for-profit
corporation with a principal
place of business in San Francisco, California, as well as
future copyleft versions of that
license published by that same
organization.
An MMC is "eligible for relicensing" if it is licensed under this License, and if all
works that were first published
under this License somewhere
other than this MMC, and subsequently incorporated in whole
or in part into the MMC, (1)
had no cover texts or invariant
sections, and (2) were thus incorporated prior to November 1,
2008.
Free
Inc.
Copyright 2007
Software Foundation,
<http://fsf.org/>
The Library refers to a covered work governed by this License, other than an Application
or a Combined Work as defined
below.
The object code form of an Application may incorporate material from a header file that is
part of the Library. You may
convey such object code under
terms of your choice, provided
that, if the incorporated material
is not limited to numerical parameters, data structure layouts
and accessors, or small macros,
inline functions and templates
(ten or fewer lines in length),
you do both of the following:
4. Combined Works.
5. Combined Libraries.
GNU GPL, and only to the extent that such information is necessary to install and execute a
modified version of the Combined Work produced by recombining or relinking the Application with a modified version of
the Linked Version. (If you use
option 4d0, the Installation Information must accompany the
Minimal Corresponding Source
and Corresponding Application
Code. If you use option 4d1,
you must provide the Installation Information in the manner
specified by section 6 of the
GNU GPL for conveying Corresponding Source.)
cense, you may choose any version of the GNU Lesser General
Public License ever published
by the Free Software Foundation.