8

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

For example, I have the following figure that is a study system. Therefore, it should be in the List of Figures and also in the List of Study Systems. Note different captions in two lists.

figure

I want it to appear in the standard List of Figures, as shown below:

Lof

and at the same time appear in a custom List of Study Systems, as shown below:

LoSS

2
  • How are you building your "List of Study Systems"? Please add to your question a MWE showing the relevant settings. Commented Nov 28, 2011 at 22:22
  • Actually this is something I faced a few months ago and found a solution. After reading TeX.SX faq, I decided to post it here hoping it would benefit others. But I just realized as my rep is low, I can't answer my own questions right away. Commented Nov 28, 2011 at 22:30

2 Answers 2

8

Here's one possible solution using the features provided by the caption package. The basic idea is to declare a new float called system using \DeclareCaptionType, and then to use a new command with one mandatory argument that will simply increase the system counter, and write its argument to both the LoF and the new list:

\documentclass{article}
\usepackage{caption}

\newcommand\listofsystemname{List of Study Systems}
\DeclareCaptionType[fileext=sys]{system}[\listofsystemname]

\renewcommand\thesystem{\Roman{system}}

\newcommand\DoubleCaption[1]{%
  \stepcounter{system}%
  \caption{Study system \thesystem: #1}
  \addcontentsline{sys}{figure}{\protect\numberline{\thesystem}#1}}

\begin{document}

\listofsystems
\listoffigures

\begin{figure}
  \centering A
  \DoubleCaption{IEEE 13-bus unbalanced}
  \label{fig:test1}
\end{figure}

\begin{figure}
  \centering B
  \caption{A standard figure caption}
  \label{fig:test2}
\end{figure}

\begin{figure}
  \centering C
  \DoubleCaption{IEEE 16-bus balanced}
  \label{fig:test3}
\end{figure}

\end{document}

enter image description here

Depending of the actual needs, my previous solution could be an overkill; after all, if the only requirement is a "new list of", creating a new float type is not really necessary. In this case, a simple use of \@starttoc will suffice:

\documentclass{article}

\newcommand\listofsystemname{List of Study Systems}

\newcounter{system}
\renewcommand\thesystem{\Roman{system}}

\makeatletter
\newcommand\listofsystems{\section*{\listofsystemname}\@starttoc{sys}}
\makeatother

\newcommand\DoubleCaption[1]{%
  \stepcounter{system}%
  \caption{Study system \thesystem: #1}
  \addcontentsline{sys}{figure}{\protect\numberline{\thesystem}#1}}

\begin{document}

\listofsystems
\listoffigures

\begin{figure}
  \centering A
  \DoubleCaption{IEEE 13-bus unbalanced}
  \label{fig:test1}
\end{figure}

\begin{figure}
  \centering B
  \caption{A standard figure caption}
  \label{fig:test2}
\end{figure}

\begin{figure}
  \centering C
  \DoubleCaption{IEEE 16-bus balanced}
  \label{fig:test3}
\end{figure}

\end{document}
1
  • thanks. My own solution is below, but yours is far more elegant! Commented Apr 27, 2012 at 18:23
2

This is how I did it myself:

In the preamble, add the following:

% Add a list of study systems
\usepackage{tocloft}
\newcommand{\tocloftclearpage}{\cleardoublepage\phantomsection}
                    % tocloft won't print listofs on new pages otherwise
\newcommand{\liststudysystemname}{List of Study Systems}
\newlistof[chapter]{studysystem}{sts}{\liststudysystemname}
\newcounter{studysystemdiagram}
\newcommand{\studysystem}[1]{%
    \stepcounter{studysystemdiagram}
    \addcontentsline{sts}{figure}{\protect\numberline{\Roman{studysystemdiagram}}#1}}
\newcommand{\studysystemcaption}[1]{Default caption}
\newcommand{\studysystemcaptionprefix}{Study system \Roman{studysystemdiagram}:\ }
\newcommand{\definesystemlabel}[1]{%
    \newcommand{#1}{\Roman{studysystemdiagram}}}

Then for each "special figure," update its figure environment similar to this one:

\begin{figure}
    \centering
    \includegraphics[width=0.65\textwidth]{Figs/systemIEEE13bus}
    \renewcommand{\studysystemcaption}{IEEE 13-bus unbalanced test feeder with the augmented DER unit and load.}
    \studysystem{\studysystemcaption}
    \caption[\studysystemcaptionprefix\studysystemcaption]{\studysystemcaptionprefix \studysystemcaption\ Loads and shunt capacitors of the original test feeder are not shown.}
    \label{fig:SPAACE_systemIEEE13bus}
\end{figure}
1
  • Could you please include an explanation of the code?
    – N.N.
    Commented Nov 29, 2011 at 19:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .