I need help writing my own description environment. The only thing I want to change is the appearance of description label. I can achieve what I want universally just fine with the following bit in the preamble.


However, I just want to use this change in one particular list, not in my entire document. I am not experienced enough in using \newenvironment to do what I want. Please, can you show me what the definition of this new description environment would look like?


To define the new environment just call the original one in it as last and first thing of the 'begin' and 'end' part, respectively. You can place your own redefinition before that. They will be local to this environment. Note that the hash (#) in macro arguments like #1 must be doubled in this case (##1) to differ them for potential arguments of the environment.




  \item[First] Test
  \item[Second] Test

  \item[First] Test
  \item[Second] Test


You can also improve this a little and write:


This defines the custom macro outside of the environment so that the hashes aren't a problem which is important in more complex macros. The definition can then be copied using the \let macro. The internal environment is written into the plain form \description ... \enddescription instead of \begin{description} ... \end{description} to avoid confusing error messages when \end{mydescription} is missing. In this case the last \begin would be the one of the internal macro and its name would be printed in the error message instead of the one written in the source file. This isn't a problem for your own small environments, but important if they are used by other people.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.