2

I want to use roman enumerate labels in theorems, and alphabetic labels in lists of examples:

\documentclass{article}
\usepackage{ntheorem}
\usepackage{enumitem}
\newtheorem{theorem}{Theorem}
\theorembodyfont{\upshape}
\newtheorem{examples}[theorem]{Examples}
\begin{document}
\begin{theorem}
TFAE:
\begin{enumerate}[label=(\roman*)]
\item $\phi$
\item $\psi$
\end{enumerate}
\end{theorem}
\begin{examples}
\begin{enumerate}[label=({\alph*})]
\item X
\item Y
\end{enumerate}
\end{examples}
\end{document}

enter image description here

Is there a way to get this to happen automatically, so that I can just use the same enumerate environment each time, and the system somehow detects the surrounding environment and chooses the appropriate label type? Or maybe there is a variable that can be set in the definition of the theorem environment or something like that?

1 Answer 1

4

Add the following hook after the definitions of theorem and examples environments:

\AtBeginEnvironment{theorem}{\setlist[enumerate]{label = (\roman*)}}
\AtBeginEnvironment{examples}{\setlist[enumerate]{label = (\alph*)}}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .