0

I need to generate two separate lists of images in my document, so I want to use titletoc and \startist, \stoplist and \printlist commands. When I try to compile my document, I get an error:

! LaTeX Error: Something's wrong--perhaps a missing \item.

This is my minimal working example:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{titletoc}

\begin{document} 

\part{First Part of this document} 

\chapter{First} 

\section{Introduction}
\startlist[test]{lof}

\begin{figure}[h]
  \centering
  \includegraphics[width=10cm]{picture.jpg}
  \caption{Bla}
  \label{fig:picture}
\end{figure}

\stoplist[test]{lof}

\printlist[test]{lof}{}{Pictures}

\end{document}

If I remove \chapter{First}, it works. What is the problem with chapter?

1

Welcome to TeX SX!

This is explained at the end of § 6.4 of the documentation (p.18). Based on this explanation, this code works:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[demo]{graphicx}
\usepackage{titletoc}

\begin{document}

\part{First Part of this document}

\chapter{First}

\section{Introduction}
\startlist[test]{lof}

\begin{figure}[h]
  \centering
  \includegraphics[width=10cm]{picture.jpg}
  \caption{Bla}
  \label{fig:picture}
\end{figure}

\stoplist[test]{lof}

\printlist[test]{lof}{}{\renewcommand\addvspace[1]{}Pictures}

\end{document} 

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.