My thesis contains many description
environments. After showing it to my supervisor, he complained about the missing separation between the items titles and descriptions. I tried to redefine the \item
command, to change all description
environments at once, without changing every \item
manually.
While my approach works for simple items (the first one), it fails for items that contain multiple paragraphs of text in the description (like the second one).
\documentclass{book}
\let\olddescription\description
\def\description{%
\olddescription \let\olditem\item%
\def\item[##1]##2{\olditem[##1]{\hfill \\##2}}}
\begin{document}
\begin{description}
\item[The First Item]{This text describes the first item.}
\item[The Second Item]{This text describes the second item.
Contrary to the description of the first item, it is quite a bit longer.
Additionally, it consists of multiple paragraphs, which causes problems
with redefining the item command.}
\end{description}
\end{document}
On compiling with pdflatex, the following error message appears:
Runaway argument?
{This text describes the second item. Contrary to the description of \ETC.
! Paragraph ended before \item was complete.
<to be read again>
\par
l.14
?
! Extra }, or forgotten \endgroup.
l.15 ...roblems with redefining the item command.}
?
If I remove the second item, it works. Is there a way to fix my \item
command?
I know that I can just redefine the descriptionlabel
command like this:
\let\olddescriptionlabel\descriptionlabel
\renewcommand*\descriptionlabel[1]{\olddescriptionlabel{#1:}}
But this does unfortunately not work for the line break I tried to add after the title using the code I found at http://en.wikibooks.org/wiki/LaTeX/List_Structures#Description.
\def
are not allowed to have\par
in the replacement text. You need to use\long\def
for that.