Graphics, Figures & TablesList of figures of a subset of figures

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
yostane
Posts: 7
Joined: Tue Dec 15, 2009 2:37 pm

List of figures of a subset of figures

Post by yostane »

Hi,
Is there a way to insert a "listoffigures" that considers only a subset of the figures present in the document.
Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

List of figures of a subset of figures

Post by php1ic »

When writing the caption if you put nothing for the text that will go in the list of figures, it will not appear

Code: Select all

\begin{figure}
\centering
\includegraphics{file.eps}
\caption[Figure]{This figure will appear in the list of figures}
\end{figure}

\begin{figure}
\centering
\includegraphics{file.eps}
\caption[]{This figure will NOT appear in the list of figures}
\end{figure}
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Re: List of figures of a subset of figures

Post by sommerfee »

Using the caption package one can limit the entries in the list of figures by using either \caption[]{...} (which will suppress this entry) or \captionsetup{list=on} resp. \captionsetup{list=off} (which is suitable for a range of figures).
yostane
Posts: 7
Joined: Tue Dec 15, 2009 2:37 pm

Re: List of figures of a subset of figures

Post by yostane »

Thanks for your quick answer :p.
Howerver I would like also to make another "listoffigures" for the other subset. Sorry I should have detailed my problem earlier :oops: .
Thanks.
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

List of figures of a subset of figures

Post by sommerfee »

There are two pre-defined subsets, "figure" and "table". If you need additional ones you can define them using \DeclareCaptionType which is offered by the caption package, too, for example:

Code: Select all

\documentclass{article}
\usepackage{caption}
\DeclareCaptionType{otherfigure}[Other Figure][List of other figures]

\begin{document}

\listoffigures
\listofotherfigures

\begin{figure}
\caption{A figure}
\end{figure}

\begin{otherfigure}
\caption{A figure, too}
\end{otherfigure}

\end{document}
yostane
Posts: 7
Joined: Tue Dec 15, 2009 2:37 pm

Re: List of figures of a subset of figures

Post by yostane »

Thank you a loooooooooooot :D
dochar
Posts: 4
Joined: Tue Jun 21, 2011 7:12 am

Re: List of figures of a subset of figures

Post by dochar »

I have a related question. I have a number of figures in my dissertation. Out of those figures, there are some that I want to be included in *two* listof's: the standard "List of Figures" and a non-standard "List of Special Figures."

How can I do this?

I really appreciate any help.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

List of figures of a subset of figures

Post by Stefan Kottwitz »

Hi Dochar,

welcome to the board!

You could use \DeclareCaptionType of the caption package, producing it's own list, or \newfloat of the float package.

Stefan
LaTeX.org admin
dochar
Posts: 4
Joined: Tue Jun 21, 2011 7:12 am

Re: List of figures of a subset of figures

Post by dochar »

Thank you Stefan for your prompt reply.

If I use \DeclareCaptionType, how will I be able to associate two "types" to one single figure so that it appears in both listofs?
dochar
Posts: 4
Joined: Tue Jun 21, 2011 7:12 am

List of figures of a subset of figures

Post by dochar »

Okay, here's how I did this. I am going to share this hoping that it would help others.

In the preamble, I added the following:

Code: Select all

% Add a list of study systems
\usepackage{tocloft}
\newcommand{\tocloftclearpage}{\clearpage\phantomsection}
                    % tocloft won't print listofs on new pages otherwise
\newcommand{\liststudysystemname}{List of Diagrams of Study Systems}
\newlistof[chapter]{studysystem}{sts}{\liststudysystemname}
\newcommand{\studysystem}[1]{%
    \addcontentsline{sts}{figure}{\protect\numberline{\thefigure}#1}}
\newcommand{\studysystemcaption}[1]{Default caption} 
Then for each "special figure" that I had, I updated its figure environment similar to this one:

Code: Select all

\begin{figure}
    \centering
    \includegraphics[width=0.75\textwidth]{Figs/SPAA_systemIEEE34bus}
    \renewcommand{\studysystemcaption}{Study system II: IEEE 34-bus test feeder with three augmented DER units.}
    \caption{\studysystemcaption}
    \studysystem{\studysystemcaption}
    \label{fig:SPAA_systemIEEE34bus}
\end{figure}
Post Reply