4

Most of my documents start with a couple of quick hacks that save me literally a couple of keystrokes a month:

\let\cite\texcite
\let\epsilon\varepsilon

and so on. Now, I'd like to do a similar thing to globally have my itemize environments behave like the itemize* environment defined by the mdwlist package. This is a little trickier, because itemize is an environment, not a command.

How do I do this?

Stefan Kottwitz
  • 231,401
Seamus
  • 73,242

2 Answers2

7

Generally, in such cases we could achieve it by

\let\newname\name
\let\endnewname\endname

or \renewenvironment.

But here it's not this simple, since the old environment would still be used. We would easily end up with TeX capacity exceeded because of nesting. A solution is to store the old environment in another macro, afterwards we could refer to that. Or easier, use the \makecompactlist command of mdwlist to redefine the original itemize environment.

\documentclass{article}
\usepackage{mdwlist}
\let\stditemize\itemize
\let\endstditemize\enditemize
\let\itemize\undefined
\makecompactlist{itemize}{stditemize}
\begin{document}
\begin{itemize}
\item One
\item Two
\item Three
\end{itemize}
\end{document}

The compact output list:

alt text

diabonas
  • 25,784
Stefan Kottwitz
  • 231,401
3

Wrong answer (in this case):

If this is LaTeX, then in general something like

\renewenvironment{itemize}{\begin{itemize*}}{\end{itemize*}}

should do the trick. However in this case it will cause nesting problems if itemize* internally uses itemize. (Thanks, Stefan)

Caramdir
  • 89,023
  • 26
  • 255
  • 291