1

I'm getting an error with package listlbls: https://www.ctan.org/pkg/listlbls?lang=en. It prints a list of labels used in the document. Here's a MWE:

\documentclass[draft]{report}
\usepackage[utf8]{inputenc}
\usepackage{listlbls}

\begin{document}
\listoflabels
\chapter{Second}\label{ch:ghost}
\section{A section}\label{sec:first}
Some text anf a reference \ref{ch:ghost}.
\section{Another Section}\label{sec:another}
Some more text and and another reference \ref{sec:first}.
\begin{equation}\label{eq:triv}
1=1
\end{equation}
By equation \ref{eq:triv}  section \ref{sec:another}.
\end{document}

When I use it together with the report class I get an error:

/usr/share/texlive/texmf-dist/tex/latex/listlbls/listlbls.sty:55:
LaTeX Error:
Missing \begin{document}.
l.55 \ifdefined\chapter*

So it seems to be something to do with the chapter command as it works fine in the article class. Most puzzlingly one of the online compilers I tested it on returned and error and gave an output with a empty first page bar one * character! Any ideas? enter image description here

enter image description here

enter image description here

2

That looks like a bug in listlbls.sty. You can solve it by making a private copy of that file in your working directory and changing the line (line number 55)

\ifdefined\chapter*

to

\ifdefined\chapter
| improve this answer | |
  • Thanks! I tried your fix and it worked, although I am still puzzled as to why that line was in the package originally, as it seems like it was testing for a report or book class anyway... – demodave Dec 1 '16 at 16:42

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.