1

I would like to change the behaviour of enumerate inside certain theorem environments. In particular. I would like enumerate to number using the letters "a." "b." "c." etc rather than "1." "2." "3." etc in my "exercise" environment, but otherwise to behave normally, including in other theorem environments.

\documentclass{article}

\newtheorem{exercise}{Exercise}[section]

\begin{exercise} \begin{enumerate} \item Question 1 \item Question 2 \end{enumerate} \end{exercise}

\end{document}

1 Answers1

2

I would suggest you use the enumitem package, which enables you to easily change the default style of your enumerate environments.

Combining this approach with the $\LaTeX$ hook system (texdoc hooks), we can modify the default labelling style within each exercise environment:

\documentclass{article}

\usepackage{enumitem}

\newtheorem{exercise}{Exercise}[section]

\AddToHook{ env/exercise/begin } { \setlist [enumerate] { label=\alph*. } }

\begin{document}

Start a list: \begin{enumerate} \item foo \end{enumerate}

List inside environment: \begin{exercise} \begin{enumerate} \item Question 1 \item Question 2 \end{enumerate} \end{exercise}

List after environment: \begin{enumerate} \item foo \end{enumerate}

\end{document}

Note also that the change of the label is contained inside the exercise environment, since \begin{...} also starts grouping, and we used the begin hook, which inserts our code after entering the exercise environment, but before processing its contents. Thus, we do not need to restore the behavior manually after the end of the exercise, as you observe in the example document.