Nothing seems to work.
I've tried adding * to \caption
.
I've tried adding \captionsetup{list=no}
to the preamble before the \appendix
entry.
I'm using \usepackage{caption}
.
Any ideas?
.lof
file with \endinput
A trick is to end the file .lof
via \endinput
. Then TeX will not read the lines after \endinput
, when the file is \input
in the list of figures:
\documentclass{article}
\makeatletter
\g@addto@macro\appendix{%
\if@filesw % \nofiles is not active
\immediate\write\@auxout{%
\string\@writefile{lof}{\string\endinput}%
}%
\fi
}%
\makeatother
\begin{document}
\listoffigures
\begin{figure}
\caption{First figure caption}
\end{figure}
\newpage
\appendix
\begin{figure}
\caption{Figure caption not in list of figures}
\end{figure}
\end{document}
Then the .lof
file contains:
\contentsline {figure}{\numberline {1}{\ignorespaces First figure caption}}{1}
\endinput
\contentsline {figure}{\numberline {2}{\ignorespaces Figure caption not in list of figures}}{2}
And only the first entry is shown.
\addtocontents
for .lof
file in \appendix
The following example redefines \addtocontents
in \appendix
to do nothing, if the contents is meant to go into the list of figures:
\documentclass{article}
\makeatletter
\g@addto@macro\appendix{%
\newcommand*{\SavedAddToContents}{}%
\let\SavedAddToContents\addtocontents
\renewcommand*{\addtocontents}[1]{%
\def\atc@next{\SavedAddToContents{#1}}%
\edef\atc@handle{#1}%
\def\atc@lof{lof}%
\ifx\atc@lof\atc@handle
\let\atc@next\@gobble
\fi
\atc@next
}%
}%
\makeatother
\begin{document}
\listoffigures
\begin{figure}
\caption{First figure caption}
\end{figure}
\appendix
\begin{figure}
\caption{Figure caption not in list of figures}
\end{figure}
\end{document}
The .lof
file contains:
\contentsline {figure}{\numberline {1}{\ignorespaces First figure caption}}{1}
list=no
of package caption
At least with the simple example file, the option setting list=no
works, if added to \appendix
:
\documentclass{article}
\usepackage{caption}
\makeatletter
\g@addto@macro\appendix{%
\captionsetup{list=no}%
}%
\makeatother
\begin{document}
\listoffigures
\begin{figure}
\caption{First figure caption}
\end{figure}
\appendix
\begin{figure}
\caption{Figure caption not in list of figures}
\end{figure}
\end{document}
File .lof
contains only the first figure caption:
\contentsline {figure}{\numberline {1}{\ignorespaces First figure caption\relax }}{1}
caption
Also the manual method by specifying an empty caption title for the list of figures works here:
\documentclass{article}
\usepackage{caption}
\begin{document}
\listoffigures
\begin{figure}
\caption{First figure caption}
\end{figure}
\appendix
\begin{figure}
\caption[]{Figure caption not in list of figures}
\end{figure}
\end{document}
list=no
from caption at the top of the answer, as it is the most simple and convenient way to achieve the result.
Commented
Jun 7, 2015 at 11:17
\addvspace
commands added by \chapter
s.
Commented
Jun 7, 2015 at 11:23