Paragraphs, Lists, Labels

Paragraphs

The text of the document is automatically formatted into paragraphs. Paragraphs should be separated by empty lines. Other separators like multiple spaces and new line characters are all treated equally and replaced by single spaces. When writing paragraphs, the following special commands may be useful:

  • \\ (double backslash) - begin new line within paragraph
  • % (percent) - comment the rest of the line
  • \noindent - skip indentation at the beginning of paragraph
  • \emph{text} - emphasize the text
  • \textbf{text} \textit{text} - boldface and italic formatting
  • \tiny \scriptsize \footnotesize \small \normalsize \large \Large \LARGE \huge \Huge - change the size of the font (from the smallest to the largest)

The above commands should not be used for formatting large parts of documents, since formatting is best done by LaTeX.

To write in the text a character that has a special meaning, precede it with \ (backslash), for example write \% to get % or \$ to get $.

Lists

There are two basic environments for creating lists: itemize for unnumbered items (bullets) and enumerate for numbered items. Here is an example code:

The items we need are:\begin{itemize}\item Chair\item Desk\end{itemize}
Our priorities include:
\begin{enumerate}
\item Most importantly, ...
\item Secondly, ...
\item Finally, ...
\end{enumerate}

The result is:


Labels and References

When the document is formatted by LaTeX, some objects (chapters, sections, tables, figures, equations, list items) are automatically numbered. To refer to an object somewhere else in the document, the following commands can be used:

  • \label{label_name} - label an object of the document
  • \ref{label_name} - insert the number of the object
  • \pageref{label_name} - insert the page number on which the object is located

For example, a section may be labeled as follows:

\section{Introduction\label{sec:intro}}
In this section we describe ...

Then, it may be referred to as follows:

In section \ref{sec:intro} on page \pageref{sec:intro} we mentioned that ...

Assuming that the introduction is the first section and it is located on the second page, the result will look as follows:

It is not obligatory but advisable to begin labels with the text indicating the type of the object, for example sec:, for sections, fig: for figures, tab: for tables, etc.

The above commands should not be used for bibliography references. See section Bibliography for details.

Copyright (c) 2008, 2013 by Krzysztof Fleszar