About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account
Smile for the Camera: a new cybercrime short story ebook.


2.15 Environments

An environment is a block of code contained within the commands

\begin{<env-name>}

and

\end{<env-name>}

where <env-name> is the name of the environment. The block of code is then formatted in a method specific to that environment. For example, the bfseries2.5 environment will typeset the contents of the environment in a bold font. The following code:

\begin{bfseries}Here is some bold text.\end{bfseries}

will appear in the typeset document looking like:

Here is some bold text. (The entire sentence is in a
bold font.)

Some environments also supply commands that may only be used within that environment.

Example:

The itemize environment provides a command called \item so that you can specify individual items within an unordered list:

Shopping List:
\begin{itemize}
  \item Cabbages
  \item Bananas
  \item Apples
\end{itemize}

The above will produce the following output:

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



Footnotes

...env-bfseries2.5
Note there is no backslash in the environment name.

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