2.8.1 Mandatory Arguments
Mandatory (or compulsory) arguments are arguments that have to be
specified.
Examples:
- If you want a footnote, you need to use the
\footnote
command, which has a mandatory argument that specifies the contents of the footnote. Like this: - If you want to start a new chapter, you need to use the
\chapter
command, but you also need to tell LaTeX the title of this new chapter. So the\chapter
command takes one mandatory argument that specifies the title.For example, the following code:
was used to generate the heading for the definitions chapter of this document.
- The command
\textbf
typesets its argument in a bold font (as opposed to the declaration\bfseries
which switches to a bold font.)For example, the following code:
produces the output
Notes:
- LaTeX takes the first non-space object
following the command name as the argument, which is why in the
above
examples the arguments have to be grouped.
Suppose the last example above didn't have a group, so instead the code was:
\textbf
Some bold text.then only the “S” would be the argument because it's the first object following the command, in which case the output would look like:
- If you want the argument to be blank, use empty braces:
{}. For example, suppose you
want to have a
chapter without a title2.4 you would need to do:
Footnotes
- ... title2.4
- The numbers for chapters, sections etc are automatically inserted by LaTeX, so this example would produce a numbered chapter without a title.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).