5

I get an error when trying to build my PDF in Texmaker, I have following lines of code giving me an issue despite working this morning:

\begin{enumerate}[a)]
\item Some text
\item Some text
\item Some text \\
\end{enumerate}

I get the following message:

enter image description here

As there are many issues that are similar I've tried the answer on this question to see if my enumerate was bugging due to the \\ and it wasn't the case. The strange thing is when I type the following it works perfectly:

\begin{enumerate}
\item Some text
\item Some text
\item Some text \\
\end{enumerate}

closed as unclear what you're asking by Andrew Swann, Schweinebacke, Maarten Dhondt, gernot, Stefan Pinnow May 4 '17 at 10:42

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Does the problem appear if you completely remove the linebreak? And why do you have to use it anyway : the environment should correctly break the last line when it exits? – T. Verron Sep 27 '12 at 15:30
  • 2
    Interesting choice for the log's font … – Qrrbrbirlbel Sep 27 '12 at 15:36
  • @T.Verron If I remove the linebreak the problem persists and I had to add a linebreak otherwise the text I start typing afterwards starts aligned with the enumerate list rather than the edge of the page. – Oyibo Sep 27 '12 at 15:42
  • @Qrrbrbirlbel Yeah I changed it while checking out fonts yesterday and haven't changed it back, although not the clearest of fonts, agreed:D – Oyibo Sep 27 '12 at 15:44
  • 1
    @Oyibo: You should consider using the enumitem package. With \usepackage[shortlabels]{enumitem} you can use the old style label, but I think it is better to switch to the new more explicit style: [label={a)}] – Peter Grill Sep 27 '12 at 21:00
4

I found a fix for this, I'd copied pasted all the \usepackage lines from another previous version of my document which didn't have \usepackage{enumerate}, once I added this package my document compiled perfectly as shown below:
enter image description here

I decided I'd leave the question open and post a solution anyways as it's easy to miss and took me quite a while to figure it out despite being an easy thing to fix.

  • Did you try adding/removing \usepackage lines on the new working document (towards the old one), until you see the bug appear? – T. Verron Sep 27 '12 at 15:54
  • I tried removing them one by one by putting them into comments to see which package I'd imported could be causing the issue, then once I'd gotten to the bottom of the list I realised that I'd not seen the enumerate one, was kind of lucky as I was in the process of posting the question here for help. – Oyibo Sep 27 '12 at 15:58
  • So basically you just removed enumerate from your included package? This is weird, because your code shouldn't compile in that case. – T. Verron Sep 27 '12 at 16:32
  • You've misunderstood what I wrote, I added enumerate and it worked, I had badly copy pasted the whole thing so it was missing and giving me the error. – Oyibo Sep 27 '12 at 16:56
  • Oooh... I thought you were waiting for a more proper solution. I guess you should accept your own answer, so that people know there is a solution on this page. – T. Verron Sep 27 '12 at 20:19
-1

Perhaps you should delete the \ before \end and add \usepackage[shortlabels]{enumitem} to your tex document. An example from TeXblog

\documentclass{article}
\usepackage[shortlabels]{enumitem}
\begin{document}
\begin{enumerate}[a)]
\item Some text
\item Some text
\item Some text
\end{enumerate}
\begin{enumerate}[label=\textcircled{\scriptsize\Alph*},font=\sffamily]
  \item State the paper size by an option to the document class
  \item Determine the margin dimensions using one of these packages:
  \begin{itemize}[label=---,itemsep=-2pt]
    \item geometry
    \item typearea
  \end{itemize}
  \item Customize header and footer by one of these packages:
  \begin{itemize}
    \item fancyhdr
    \item scrpage2
  \end{itemize}
  \item Adjust the line spacing for the whole document
  \begin{itemize}
    \item by using the setspace package
    \item or by the command \verb|\linespread{factor}|
  \end{itemize}
\end{enumerate}
\end{document}

The output is

OutputFigure

  • 1
    This (a) does not answer the question and (b) does not produce the posted image. – Andrew Swann May 4 '17 at 6:50
  • Thx, I have correct the code and image. – jz0410 May 4 '17 at 8:12
  • OK - but it still doesn't answer tho OPs question. – Andrew Swann May 4 '17 at 8:13
  • T^T I think I am answering the question... – jz0410 May 4 '17 at 8:57
  • 1
    From the OP's answer, it is the enumerate package that is being used and had been lost from the preamble. Once reinstated the code worked fine. – Andrew Swann May 4 '17 at 9:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.