18

I'd like to add a bullet point to description lists.

\begin{description}
  \item[Term] Description
\end{description}

Basically what I want looks like the following, when rendered:

\begin{itemize}
  \item \textbf{Term} Description
\end{itemize}

Using the itemize hack does not feel right. Is there a better solution?

knittl
  • 1,311

4 Answers4

16
\documentclass{article}
\let\Item\item
\newcommand\SpecialItem{\renewcommand\item[1][]{\Item[\textbullet~\bfseries##1]}}
\renewcommand\enddescription{\endlist\global\let\item\Item}
\begin{document}
\SpecialItem
\begin{description}
  \item[Text] more text
  \item[and some] more text
  \item[] empty
\end{description}

\begin{description}
  \item[Text] more text
  \item[and some] more text
  \item[] empty
\end{description}

\end{document}

without setting \SpecialItem it will be a default list

  • This works! (bullet point is a bit smaller than the bullet point of itemize, but that's no big deal). Can I somehow wrap this in a single command, so I could do this selectively for some description lists? – knittl May 30 '12 at 14:12
  • @knittl: see edited answer –  May 30 '12 at 14:24
  • @Herbert: If you move \SpecialItem to be after \begin{description}, then the renewcommand\enddescription{} is not needed. – Peter Grill May 30 '12 at 18:47
  • @PeterGrill: I know, but I prefer the other way –  May 30 '12 at 18:59
  • @Herbert: I guess your way is safer in that \SpecialItem can be invoked both from within the description environment and from outside. – Peter Grill May 30 '12 at 19:20
  • @Herbert I've used the above code but the Text come over the more text I don't know why? – Tak Mar 09 '14 at 12:20
9

The enumitem package mentions the following solution

\documentclass{article}
\usepackage{enumitem}
\newcommand\litem[1]{\item{\bfseries #1,\enspace}}
\begin{document}
 \begin{itemize}[label=\textbullet]
  \litem{Text} more text
 \end{itemize}

\end{document}

Obviously this is not much nicer than what you do already...

Martin H
  • 18,164
3

Here is a simple way which works with the paralist package, for example if you want a compact list (few vertical spaces). It is really a slight modification of egreg's answer.

\usepackage{paralist}

\newcommand{\bulletdescriptionlabel}[1]{%
\hspace\labelsep
\normalfont
\textbullet\ %
\bfseries #1}

\newenvironment{compactitemdesc}
{\begin{compactdesc}
  \let\makelabel\bulletdescriptionlabel
}
{\end{compactdesc}}

This works better than Herbert' method if you have sublists: if inside your new list type you have some other list then its items will work as usual. In Herbert's method (redefining \item) all \item command of sublists will be affected. This is avoided when using \makelabel etc. as suggested by egreg.

Daniel
  • 31
3

Using enumitem one can simplify the matter

\newenvironment{mydescription}
  {\description[before=\let\makelabel\bulletbfseriesmakelabel]}
  {\enddescription}
\newcommand\bulletbfseriesdescriptionlabel[1]{\textmd{\textbullet}~\textbf{#1}}

In the optional argument to \description one can add other customizations.

A more complicated way, that ensures one always uses the original enumitem provided \makelabel is

\newcommand{\changemakelabel}{%
  \let\enumitemmakelabel\makelabel
  \renewcommand\makelabel[1]{%
    \enumitemmakelabel{\normalfont\textbullet~\textbf{##1}}%
  }%
}

and then

\newenvironment{mydescription}
  {\description[before=\changemakelabel]}
  {\enddescription}

A perhaps simpler technique is changing the \descriptionlabel command; here's a way:

\documentclass{article}
\usepackage{enumitem}

\newcommand{\bulletdescriptionlabel}[1]{%
  \hspace\labelsep
  \normalfont
  \textbullet\ %
  \bfseries #1}

\newlist{mydescription}{description}{1}
\setlist[mydescription]
  {before=\let\makelabel\bulletdescriptionlabel}

\begin{document}
\begin{mydescription}
\item[title] test2
\end{mydescription}
\end{document}

One might want to simply patch the current \descriptionlabel command in a more abstract way, instead of having to look up the definition of \descriptionlabel.

\usepackage{etoolbox}
\let\bulletdescriptionlabel\descriptionlabel
\patchcmd\bulletdescriptionlabel
  {#1}
  {{\normalfont\textbullet\ }#1}
  {}{}

that is, getting a copy of \descriptionlabel and modifying it so that it typesets {\normalfont\textbullet\ } before the argument (which is the optional argument to \item).

egreg
  • 1,121,712