Latest news 2019-11-04: The giveaway of two signed copies of “Quack, quack, quack. Give my hat back!” has closed and the winning entrants have been selected. Thank you to everyone who took part.

2. Some Definitions

As mentioned in the introduction, LaTeX is a language, so you can't simply start typing and expect to see your document appear before your very eyes[Why is TeX not a WYSIWYG system?]. You need to know a few things before you can get started, so it's best to define a few terms first. Don't worry if there seems a lot to take in, there will be some practical examples later, which should hopefully make things a little clearer.

Throughout this document, source code is illustrated in the form:

This is an \textbf{example}.

The corresponding output (how it will appear in the PDF document)2.1 is illustrated like this:

Image showing typeset output (click here for a more detailed description).

Take care not to confuse a backslash \ with a forward slash / as they have different meanings. (Commands typeset in blue, such as \par, indicate a hyperlink to the command definition in the summary.)

Command definitions are shown in a typewriter font in the form:

\documentclass[<options>]{<class file>}

In this case the command being defined is called \documentclass and text typed <like this> (such as <options> and <class file>) indicates the type of thing you need to substitute. (Don't type the angle brackets!) For example, if you want the scrartcl class file you would substitute <class file> with scrartcl and if you want the letterpaper option you would substitute <options> with letterpaper, like this:


But more on that later.

Sometimes it can be easy to miss a space character when you're reading this kind of document. When it's important to indicate a space, the visible space symbol  is used. For example:


When you type up the code, replace any occurrence of with a space.

One other thing to mention is the comment character % (the percent symbol). Anything from the percent symbol up to, and including, the end of line character is ignored by LaTeX. Thus

A simple % next comes a command to make some bold text

will produce the output

Image showing typeset output (click here for a more detailed description).

The percent symbol is often used to suppress unwanted space resulting from line breaks2.2 in the source code. For example, the following code


will produce the output:

FooBar (single word)

as opposed to


which will produce the output:

Foo Bar (two words)

On the other hand, spaces at the start of a line of input are ignored, so


still produces:



... document)2.1
This HTML version of the book uses bitmaps to illustrate the output, which doesn't look as good as the actual PDF version.
... breaks2.2
LaTeX treats the end-of-line character as a space.

This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs