Saturday, June 1, 2013

Using before as a Global setting in enumitem

Using before as a Global setting in enumitem

I am working on a small project and am using the enumitem package reasons for beyond this example. I read the docs and managed to produce this example. Currently, I am using the before argument on the \begin{description} (uncomment part of line 6).
To facilitate reuse I would like to move it into the global settings for description the description environment (line 4). However, it appears to be beyond my understanding.
Thanks for the help
\documentclass{article}
  \usepackage{enumitem}

  %\setlist[description]{before={\renewcommand{\makelabel}[1]{\textit{##1}: }}} % Illegal parameter number in definition of \enit@@description.
  \begin{document}
    \begin{description}%[before={\renewcommand{\makelabel}[1]{\textit{##1}: }}]
      \item[square]{a four-sided polygon is a square if and only if all sides are equal and its vertex angles are all right angles.}
    \end{description}
  \end{document}

No comments:

Post a Comment