Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

Formatting Information — An introduction to typesetting with LATEX

Appendix B: Commands and errors

Section 2: Typesetting

Which LATEX command you type depends on what output you want and how you want it to be created — see the list in the Preface above. Whichever way you run LATEX, it will process your file and display a log or record of what it’s doing (see Figure B.2 above: it looks much the same no matter what system you use).

To typeset your document:

  1. Make sure you are in the right directory (folder) in your terminal, then type the command (xelatex followed by your filename; or latexmk or one of the other workflow-management commands)

  2. If you are using citation and reference commands for a bibliography, you will then need to run biber or bibtex (followed by a space and the name of your document), whichever you have chosen to use (see § 5.3.2.1 above)

  3. Run XƎLATEX again as in item 1 in the list above so that the citations are picked up;

  4. If you are creating an index, you will then need to run makeindex (followed by a space and the name of your document)

  5. Run LATEX again as in item 1 in the list above so that the citations and index references are resolved.

LATEX and all the ancillary programs write a transcript of what goes, and this will be shown in the window as well as being written into a log file.

If LATEX reports any errors — easily identifiable as lines in the log beginning with an exclamation mark (!) — don’t panic! Turn to § B.3 below, identify what went wrong, and fix it in your input file. Then re-run LATEX.

Exercise — Running LATEX in a terminal or console window

  • Open a command window;

  • Type cd followed by the name of the folder where you saved your sample document;

  • Type your LATEX command followed by the name of your LATEX document.