8

I am using the package nomencl to generate a list of abbreviations. However, after a recent MiKTeX 2.9 update (using TeXnicCenter) I keep getting errors for the abbreviation items

LaTeX Error: Lonely \item--perhaps a missing list environment.

Unfortunately, I cannot figure out an MWE (the MWE that I tried do work, but the real document doesn't). So here is a shortened version of my main document (without all the other header stuff and bibliography):

\documentclass{scrartcl}
\usepackage[intoc]{nomencl} 
\let\abk\nomenclature   
\renewcommand{\nomname}{List of Abbreviations}
\let\OrgItem\item
\renewcommand\nompreamble{\renewcommand\item[1][]{\OrgItem[##1]\dotfill    
\hspace{\labelsep}}}    
\setlength{\nomitemsep}{-\parsep}   
\makenomenclature

\begin{document}
\printnomenclature \newpage
\include{Introduction}
\include{Methods}
\include{Results}
\end{document}

However, if instead of including the chapters I simply try out an MWE with the same header and one abbreviation:

\begin{document}
\printnomenclature \newpage
This is my txt \abk{txt}{text}
\end{document}

then everything works fine. Any suggestions about the reason?

Marco Daniel
  • 95,681
Anja
  • 485
  • 1
    Try to successively remove parts of the main document until the error disappears. – gerrit Dec 06 '11 at 14:45
  • Try \input instead of \include. – Count Zero Dec 06 '11 at 15:14
  • 3
    @gerrit: Due to the kind of the error message I thought it is a general problem rather than text-dependent. I followed your advice and after 2 hours trying to narrow down the problem area I finally found the reason: One of the abbreviations was defined twice. – Anja Dec 06 '11 at 17:29
  • @Anja: Please turn your comment into an answer. – lockstep Dec 06 '11 at 22:46
  • @lockstep: I think this isn't an answer. I think we should close this question as to localized. If she edit her question it will be enough. – Marco Daniel Dec 07 '11 at 11:09
  • 1
    This is why making a minimal example should be done before asking a question… – Seamus Dec 07 '11 at 11:10
  • @Seamus: Indeed! – Marco Daniel Dec 07 '11 at 11:11
  • @Seamus: That's what I was trying to do for a while, wondering why the supposed MWE works. Due to the kind of error message (missing environment) and to the fact that the errors occurred for all items I thought it's a more general problem, e.g. with the "include" commands or something similar. – Anja Dec 07 '11 at 12:21
  • @Anja If you thought it was a problem with \include then a minimal example involving \include should have been your first test. I've learned a lot more from building MWEs than I have from the answers I get when I find one that works (or doesn't) – Seamus Dec 07 '11 at 13:54
  • @Seamus: Fair enough! I absolutely agree that building MWEs is helpful. I am not very experienced with LaTeX, but I usually manage to resolve most of the occurring problems either this way or by narrowing down the problem area. In this particular case, I was really puzzled so that I didn't see another way rather than asking the community. I am grateful for gerrit's hint and indeed I learned a lesson about problem solving strategies from this topic. Now, I don't think that further off-topic discussion will be helpful for anyone. – Anja Dec 07 '11 at 14:58

1 Answers1

17

The problem was, that one of the abbreviations was defined twice. After removing the duplicate item everything works fine.

Anja
  • 485
  • 4
    You saved my day, a similar problem was bugging me, and your note on duplicate definitions solved my problem. Which was indeed caused by duplicate nomenclature definitions. – Dohn Joe Nov 03 '15 at 14:07