6

I'm starting to accumulate a large and fairly unwieldy list of figures at the start of my thesis and want to split that list into two. I want to have a list of the 'main' figures included in the front matter and another list at the start of the appendices . This second list should just include any figures that are part of the appendices.

I've found a few examples that detail how I could suppress the figures in the appendix but nothing that describes how I would be able to then list them at a later point in my work.

Any ideas?

Thanks!

  • Just declare a new floating environment with its own list, and use this one instead of figure in the appendix. For declaring a new floating environment one could use the float, the floatrow, or the/my newfloat package. The memoir and KOMA-Script document classes offers their own support for declaring new floating environments, so there is no extra package needed here. – Axel Sommerfeldt Aug 26 '13 at 11:19
  • Sounds perfect (and very simple). I'll have a play around with this and see what I can come up with! – casimp Aug 26 '13 at 11:40
  • 1
    @Simpsono there's really no need for a new float type; in my answer I present two different options and both of them work with the standard figure environment. – Gonzalo Medina Aug 26 '13 at 15:46
6

This can be easily done with the help of the titletoc package and its features for partial lists; \startlist, \printlist, \stoplist; the idea is to have to partial lists; the first one stops just before the appendices and at this point, the second list begins; a little example:

\documentclass{book}
\usepackage{graphicx}
\usepackage{titletoc}

\newcommand\myfigure{% just to quickly generate captioned images in the document
  \begin{figure}
  \centering
  \includegraphics[height=2cm]{example-image-a}
  \caption{test figure~\thefigure}
  \end{figure}%
}

\begin{document}

\startlist[main]{lof}% starts main list of figures
\printlist[main]{lof}{}{\chapter*{List of Figures in Main Part}}% prints main list of figures

\mainmatter
\chapter{Test chapter one}
\myfigure
\myfigure
\myfigure
\myfigure
\chapter{Test chapter one}
\myfigure
\myfigure
\myfigure
\myfigure
\myfigure
\myfigure

\appendix
\clearpage
\stoplist[main]{lof}% stops main list of figures

\startlist[appendix]{lof}% starts list of figures in appendices
\printlist[appendix]{lof}{}{\chapter*{List of Figures in 
Appendices}}% prints list of figures in appendices

\chapter{Test appendix one}
\myfigure
\myfigure
\myfigure

\chapter{Test appendix two}
\myfigure
\myfigure
\myfigure

\end{document}

An image of the main list:

enter image description here

An image of the list for images in appendices:

enter image description here

Without additional packages this can also be done with a little more work; the idea now is to change \ext@figure (controlling the extension of the auxiliary file in which the information for figure captions is written to) just at the beginning of the appendixes and to have a new list of figures through a new command defined in a similar way to the standard \listoffigures; a patch of \@chapter is necessary in order to have the default spacing (10pt) in the new list when a new chapter begins:

\documentclass{book}
\usepackage{xpatch}
\usepackage{graphicx}

\makeatletter
\newcommand\listofappfigures{%
  \renewcommand\ext@figure{lfa}%
   \renewcommand\listfigurename{List of Figures in Appendices}%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename}%
      \@mkboth{\MakeUppercase\listfigurename}%
              {\MakeUppercase\listfigurename}%
    \@starttoc{lfa}%
    \if@restonecol\twocolumn\fi
    }
\xpatchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{10\p@}}}{\addtocontents{lot}{\protect\addvspace{10\p@}}\addtocontents{lfa}{\protect\addvspace{10\p@}}}{}{}
\makeatother

\newcommand\myfigure{%
  \begin{figure}
  \centering
  \includegraphics[height=2cm]{example-image-a}
  \caption{test figure~\thefigure}
  \end{figure}%
}

\begin{document}

\listoffigures

\mainmatter
\chapter{Test chapter one}
\myfigure
\myfigure
\myfigure
\myfigure
\chapter{Test chapter one}
\myfigure
\myfigure
\myfigure
\myfigure
\myfigure
\myfigure

\appendix

\listofappfigures

\chapter{Test appendix one}
\myfigure
\myfigure
\myfigure

\chapter{Test appendix two}
\myfigure
\myfigure
\myfigure

\end{document}
  • 1
    This worked beautifully!I had a small problem with titletoc, which appeared to be due to the fact I was loading the hyperref package first (see tex.stackexchange.com/questions/79547/…) but other than that it was a piece of cake! – casimp Aug 27 '13 at 7:46

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.