7

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}
Torbjørn T.
  • 206,688
Oyibo
  • 545
  • 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
  • 4
    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
  • @PeterGrill thanks for the advice, its indeed more explicit! – Oyibo Sep 28 '12 at 15:54

2 Answers2

7

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.

Oyibo
  • 545
  • 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
  • No worries, also you have to wait 48 hours after posting to accept your own answer, that's why I haven't accepted yet. – Oyibo Sep 28 '12 at 15:52
-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

Schweinebacke
  • 26,336
jz0410
  • 1