1

Following the answer here, I'm hoping to track multiple types of figures in an extbook document, rendered with XeLaTeX.

What I'm doing is using one "class" of figure to display sheet music for songs, and another to display pictures. I may not even need a list of figures for pictures, but at the very least, they shouldn't be popping up in the song "index".

Using TeX 3.14159265 (TeX Live 2016).

I would expect the output of the code below to render two different lists: The first listing six songs, 1 – 6, and the second with three pictures, 1 – 3. Two lists are created, but the song list only contains three items, 6 – 8, and the second list contains six — three songs and three pictures, numbered 1 – 5, 9.

I admit to only having scanned the docs, which don't actually explain how \resumeList is supposed to work, so I imagine there is either an incompatibility with the document class or I am misunderstanding how the package is supposed to work and/or be used.

Also wondering if my overall approach to creating a list of Songs is the best one.

% arara: lilypond: {options: "--latex-program=xelatex --pdf"}
% arara: xelatex: { files: [ 'sandbox.tex' ] }
\documentclass[a5paper,twoside,9pt]{extbook}
\usepackage{titletoc}
\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage{blindtext} % for filler
\usepackage{lipsum} % for filler

\newcommand\songFigure{% just to quickly generate captioned images in the document
    \begin{figure}
    \centering
    \includegraphics[height=2cm]{example-image-a}
    \caption{song figure~\thefigure}
    \end{figure}%
}
\newcommand\imageFigure{% just to quickly generate captioned images in the document
    \begin{wrapfigure}{R}{0.3\textwidth}
    \centering
    \includegraphics[height=2cm]{example-image-b}
    \caption{image figure~\thefigure}
    \end{wrapfigure}%
}
\begin{document}
\startlist[song]{lof}% start list of Song figures
\printlist[song]{lof}{}{\chapter*{List of Song Figures}} % print main list of song figures

\mainmatter
\chapter{Test chapter one}
\songFigure
\songFigure
\songFigure

\stoplist[song]{lof}% stop list of songs
\startlist[image]{lof}% start list of images

\imageFigure

\lipsum[1]

\imageFigure

\lipsum[2-3]

\stoplist[image]{lof}% stop list of pictures
\resumelist[song]{lof}% resume list of songs

\songFigure
\songFigure
\songFigure

\appendix
\clearpage
\stoplist[song]{lof}% stop list of songs
\resumelist[image]{lof}% resume list of images

\imageFigure

\lipsum[2-3]
\stoplist[image]{lof}% stop list of pictures
\printlist[image]{lof}{}{\chapter*{List of images}} % print list of images
\end{document}

Song Figure Listing Image Figure Listing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.