3

Can anyone tell me how to fix the following problem:

The following code produces the error

Package enumitem Error: topsep=0em,partopsep=0em undefined

\documentclass[11pt]{amsart}
\usepackage{enumitem}
\def \ListSimpleArguments {topsep=0em,partopsep=0em}
\begin{document}
\begin{enumerate}[\ListSimpleArguments]
    \item aaa
\end{enumerate}
\end{document}  

But when I do not use the Variable \ListSimpleArguments then it works:

\documentclass[11pt]{amsart}
\usepackage{enumitem}
\def \ListSimpleArguments {topsep=0em,partopsep=0em}
\begin{document}
\begin{enumerate}[topsep=0em,partopsep=0em]
    \item aaa
\end{enumerate}
\end{document}  

How can I solve this problem? How can I define these optional arguments in a variable?

3

The parsers of key=value syntax take care not to expand macros. It is better to use the facilities of the package to set the defaults:

\documentclass[11pt]{amsart}
\usepackage{enumitem}
\setlist[enumerate]{topsep=0em,partopsep=0em}
\begin{document}
\begin{enumerate}
    \item aaa
\end{enumerate}
\end{document}  

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.