1

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.

  • Are you using the enumerate package or enumitem with the shortlabels option. Please provide a compilable document! – user31729 Jan 23 '17 at 19:21
  • I am using the enumerate package. Thank you for the help – xandermonkey Jan 23 '17 at 19:22
  • 1
    please always use a complete document, so people don't have to guess. – David Carlisle Jan 23 '17 at 19:23
  • 1
    Use \begin{enumerate}[{Exercise} (1)] ... – user31729 Jan 23 '17 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. – David Carlisle Jan 23 '17 at 19:30
5

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

 [{Exercise }(1)]

should hide Exercise

3

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

  • The screenshot is from a version without font={\bfseries} – user31729 Jan 23 '17 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.