3

I'm trying to get a list of custom labels. Here is what I've tried:

\begin{enumerate}[Exercise (1)]

\item first

\item second

\end{enumerate}

This results in each item being labeled as: Exerc#se (#)

Where # is the number of the item in the list. How can I make the "i" in exercise not be pattern matched?

Using a \ doesn't work, it causes syntax error.

10
  • Are you using the enumerate package or enumitem with the shortlabels option. Please provide a compilable document!
    – user31729
    Jan 23, 2017 at 19:21
  • I am using the enumerate package. Thank you for the help Jan 23, 2017 at 19:22
  • 1
    please always use a complete document, so people don't have to guess. Jan 23, 2017 at 19:23
  • 1
    Use \begin{enumerate}[{Exercise} (1)] ...
    – user31729
    Jan 23, 2017 at 19:23
  • 1
    for the case you have, my old enumerate package is fine, but in general enumitem as in @ChristianHupfer's answer is rather more flexible. Jan 23, 2017 at 19:30

2 Answers 2

5

As documented in the package documentation, letters inside {} are never taken as counter templates so

 [{Exercise }(1)]

should hide Exercise

5

For completeness, here's a possible way to solve this with enumitem (a little bit more complex)

\documentclass{article}

\usepackage{enumitem}


\begin{document}
\begin{enumerate}[font={\bfseries},label={Exercise (\arabic*)}]

\item first

\item second

\end{enumerate}
\end{document}

enter image description here

1
  • The screenshot is from a version without font={\bfseries}
    – user31729
    Jan 23, 2017 at 19:33

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.