About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account
Latest news 2024-10-15: New blog post: Tales for Our Times Book Launch.


4.4.3 Description Environment

The description environment has the same format as the itemize environment described in §4.4.1. Unordered Lists, only this time you need to specify a marker as an optional argument to the \item command, since there is no default marker for this environment. The marker may be a textual label, and most classes will typeset it in bold. The KOMA-Script classes, such as scrartcl, default to a bold sans-serif font, as illustrated in this next example:

\begin{description}
  \item[Animal] Living being

  \item[Vegetable] Plant
 
  \item[Mineral] Natural inorganic substance
\end{description}

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

The KOMA-Script classes provide a way of changing the font style in the description label markers. (The font changing commands \normalfont and \scshape will be covered in §4.5. Fonts, and the KOMA-Script command \addtokomafont in §5.3. Chapters, Sections, Subsections ....)

\addtokomafont{descriptionlabel}{\normalfont\scshape}
\begin{description}
  \item[Animal] Living being

  \item[Vegetable] Plant

  \item[Mineral] Natural inorganic substance
\end{description}

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

It is possible to nest all the listing environments, as long as you don't exceed four itemize and four enumerate environments. The description environment has no restriction on the number of times it can be nested. However, just because you can do something, doesn't mean you should. In general it's best to avoid an excessively complicated block of text in your document.

Example (Assorted Nesting):

This example uses each of the listing environments described above.

\begin{description}

   \item[Animal] Living being

   \begin{itemize}

      \item Mammals

      \item Birds

      \item Reptiles. For example:

      \begin{enumerate}

         \item dinosaurs

         \item crocodiles

       \end{enumerate}

   \end{itemize}

   \item[Vegetable] Plant

   \begin{itemize}

      \item Cultivated. For example:

      \begin{enumerate}

         \item Carrots

         \item Broccoli

         \item Potatoes

      \end{enumerate}

      \item Wild

   \end{itemize}

   \item[Mineral] Natural inorganic substance

\end{description}

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

Exercise 5: Lists

Try writing the source code that will create the output shown below.

You can download or view the answer if you can't work out how to do it.


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