# List figures with \listoffigures but don't show the figures themselves

For a journal submission, I need a list of figure captions at the end of my manuscript but they explicitly asks not to include the figures themselves in the document.

I have added \listoffigures at the end of the document and it does what it does. But, now, how do I keep the figures from being rendered?

\documentclass[man]{apa6}

% Essential manuscript parts
\title{Test}
\author{Test}

% Style list of figures
\usepackage[titles]{tocloft}
\renewcommand{\listfigurename}{Figure captions}
\cftpagenumbersoff{figure}
\renewcommand{\cftfigpresnum}{\itshape\figurename\enspace}
\renewcommand{\cftfigaftersnum}{.\space} \setlength{\cftfigindent}{0pt}
\setlength{\cftafterloftitleskip}{0pt}

\begin{document}

\maketitle

\begin{table}[htp]
\caption{Something}
\end{table}

\begin{figure}[htbp]
\centering
\caption{This is a figure.}
\end{figure}

\begin{figure}[htbp]
\centering
\caption{This is a figure.}
\end{figure}

\renewcommand{\listfigurename}{Figure captions}
\listoffigures

\end{document}


I have tried the comment package and \excludecomment{figure} but that eliminates the figure list as well.

I've tried adding the following to the preamble:

\renewcommand{\includegraphics}[2][]{}
\captionsetup[figure]{labelsep=none,labelformat=empty,textformat=empty}


This indeed removes the figures and captions on the final pages but leaves empty pages. Is there a way omit the empty pages?

• If you are willing to define figures with a macro instead of an environment, you can have a look at the \holdFigures macro of the boxhandler package. It has a deferral mechanism. – Steven B. Segletes May 5 '15 at 20:03
• In principle, I'd be willing to do that but in practice I can't. I'm writing the manuscript with interspersed R-code that creates the figures/tables and their environments. – crsh May 6 '15 at 8:02

A solution that requires a change in the file for the final version with only the list of figures.

You keep the line

\nofiles\renewcommand{\processdelayedfloats}


commented out until you have the document in final form; the figures will be printed at the end. When your document is finished, uncomment the two lines and run LaTeX again.

Here's an example

\documentclass{article}
\usepackage{graphicx}

%%% Remove the next line if you want the figures at their place
\usepackage[figuresonly,nolists,nomarkers]{endfloat}

\usepackage{lipsum}% mock text

% Uncomment the following line for the final version
%\nofiles\renewcommand{\processdelayedfloats}{}

\begin{document}

\lipsum[1]

\begin{figure}
\includegraphics[width=.3\textwidth]{example-image-a}
\caption{Whatever}
\end{figure}

\lipsum[2]

\begin{figure}
\includegraphics[width=.3\textwidth]{example-image-a}
\caption{Whatever}
\end{figure}

\lipsum[3]

\begin{table}[htp]
A table
\caption{Something}
\end{table}

\lipsum[4]

\clearpage

\listoffigures

\end{document}

• This looks good, but it doesn't quite work, yet. As evident from the MWE, I use the apa6 class that sets the options for endfloat to handle both figures and tables. Under these circumstances you solution has a side-effect: all tables are also omitted (I need the tables). I have updated my example to include a dummy table. – crsh May 6 '15 at 8:11
• Well, they don't require me to use apa6, but they require me to implement the formatting used in this class. Unfortunately, in my field it's not customary for journals to provide their own TeX-classes (in fact, most manuscripts are written in Word), so I have to settle for DIY solutions. I agree, this is not desirable, though. – crsh May 6 '15 at 8:21
• @crash A manual solution would be to remove the final figure pages with some PDF editing software (pdftk comes to mind), or with a document that just does \jncludepdf[pages=1-?]{filename} (where ? is the number of the last page with a table). – egreg May 6 '15 at 8:24

This is how I do it. I don't use the endfloat package.

Normal way to include figure

\begin{figure}
\centering
\includegraphics[width=4in]{somefigure.png}
\caption{some caption.}
\label{Fig: somefigure}
\end{figure}


%--------- modification ---------

\usepackage{caption}
\captionsetup{labelformat=empty}

\begin{figure}
\centering
%\includegraphics[width=4in]{somefigure.png}
\caption[some caption.]{}
\label{Fig: somefigure}
\end{figure}


This suppresses the figure and its caption in main document but shows the caption in list of figures.

First suppress the figure by removing the \includegraphics command. The caption label (Figure x., Table x. etc) is suppressed using caption package option, \captionsetup{labelformat=empty}. Note the \captionsetup{labelformat=empty} option suppress labels for all captions including tables. The caption in [] brackets shows up in list of figures while the caption in {} (which is kept empty) appears below the figure.

With these steps the figure and caption are suppressed in main document but you still get list of figures.