2.8.2 Optional Arguments
Some commands may have one or more optional arguments. Unlike
mandatory arguments, optional arguments must always be enclosed in
square brackets [ ].
Example:
The command \\ ends a line. So the following segment of code:
will produce the following output:
will produce the following output:
[Start of line goes awry]In this example the [1cm] has been placed inside a group, so it is no longer considered to be an optional argument, and since the command \\ does not take a mandatory argument, the [1cm] is simply interpreted as ordinary text.
Example:
The command \framebox
(which will be covered later in
§4.7.1. Framed Boxes) takes a
mandatory argument and two optional arguments.
\framebox
puts a frame around the contents of its
mandatory argument:
In general, if a command has both optional and mandatory arguments, the optional arguments are usually specified first (although there are a few exceptions).
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).