2

I followed the demo in Customizing enumerated lists Using packages in LaTeX/List Structures. The code is

\documentclass{article}
\usepackage{enumerate}
\begin{document}
\begin{enumerate}[label=\bfseries Exercise (i):]
    \item 5 + 7 = 12
    \item 9 + 1 = 10
\end{enumerate}
\end{document}

However I got the unexpected output, enter image description here

when I remove "label=" in the enumerate option, the output does not show "label=".

\documentclass{article}
\usepackage{enumerate}
\begin{document}
\begin{enumerate}[\bfseries Exercise (i):]
    \item 5 + 7 = 12
    \item 9 + 1 = 10
\end{enumerate}
\end{document}

enter image description here

So how to use label in enumerate?

This question has been solved. The label option is provided by package enumitem. The right code is

\documentclass{article}
\usepackage{enumerate}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label = \bfseries Exercise \roman*:]
    \item 5 + 7 = 12
    \item 9 + 1 = 10
\end{enumerate}
\end{document}
  • You are mixing the syntax of the enumerate package (which does not know the label=... syntax) with the one of the enumitem package (which does know it) – cgnieder Aug 11 '15 at 10:45
  • 1
    The output in your second example is not right, see Exerciise. This is because the i in the word Exercise is interpreted as a special character. – Philipp Imhof Aug 11 '15 at 10:49
1

enter image description here

Your list is more like an enumerate rather than an itemize. It is recommended here to use the enumitem package and \setlist which accepts many parameters as options.

\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate]{label=\bfseries Exercise (\roman*):}

\begin{document}

\begin{enumerate}
  \item 5 + 7 = 12
  \item 9 + 1 = 10
\end{enumerate}

\end{document}
0

According to the enumerate manual, there is no label=<...> syntax.

The letter a in label= is interpreted as \alph, this is why your output is

  • libel
  • liibel

etc.

You should write

\documentclass{article}
\usepackage{enumerate}
\begin{document}
\begin{enumerate}[\bfseries {Exercise} (i):]
    \item 5 + 7 = 12
    \item 9 + 1 = 10
\end{enumerate}
\end{document}

Note that you have to use {Exercise} in order to avoid interpretation of i as \roman.

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.