I have quite a lot of description environments in Beamer that are having both long and short items, leading to an output like
veryverylongitem description 1
shortitem description 2
which is not really great.
So I'm trying to put labels and descriptions on different lines, in something like
veryverylongitem
description 1
shortitem
description 2
I've tried two things for that:
\let\origdescription\description
\renewenvironment{description}{
\setlength{\leftmargini}{0em}
\origdescription
\setlength{\itemindent}{0em}
\setlength{\labelsep}{\textwidth}
}
{\endlist}
which seem to do what I'd like, except that things are completely glitchy when using two nested description environment
On another hand, puting something like
\begin{description}
\item[veryveryveryverylongitem]\hfill\\
description 1
\item[shortitem]\hfill\\
description 2
\end{description}
will do the job perfectly, except that I can't find a way to do renew the item command so that the hfill would applied document-wide.
Is there other way to deal with long description, or have I done something wrong in the two solutions ?
Best Answer
Using the
enumitem
package withbeamer
is not a good idea; for example, just by loadingenumitem
, the default beamer font and color specifications fordescription
are lost; moreover\setbeamercolor
and\setbeamerfont
will have no effect ondescription item
; even worst, the enumitem package will also interfere with thebeamer
layout foritemize
andenumerate
; in fact, it will produce errors for theenumerate
environment (See example at the bottom).In the following example I defined a
Ldescription
environment based on the beamer definition of standarddescription
; since the new definition follows the "beamer way", it will behave as expected (it's overaly aware, for exampe, and respects the color and font templates) and will give you the desired layout (feel free to adjust the lengths according to your needs):An image of the fourth frame:
Why enumitem shouln't be used with beamer
Processing the following code:
produces the following (expected) output:
Now uncomment-out the line loading
enumitem
. reprocess and now you'll get the following undesired result:Now, try this simple document:
and you'll receive:
The moral is clear:
enumitem
andbeamer
a are incompatible. Perhaps using theloadonly
package option to create own lists could be safe: