22

I have a figure that relates to two different issues discussed at very different point in a long document. Rather then send the reader back 50 pages to look up a figure, I would like to include the figure again at the later point.

However, I don't want it to appear twice in the list of figures or receive a new label number.

In this example, I would like it to appear in chapter 2 as figure 2.5 and again in chapter 4 as figure 2.5.

Is there a simple way to accomplish this? I am using Xelatex Version 3.1415926-2.5-0.9999.3 from the Texlive 2013 Arch Linux package.

  • 1
    A simple approach is just to omit the \caption in the second figure, and replace it with a simple paragraph of text, possibly using \ref to get the original figure number. But maybe you don't need formal captions? Tufte (for example) has none in his beautifully clear books. – Thruston Sep 08 '14 at 18:25
  • While either Thruston's or Steven's propositions will work, I just want to point out, that it might be confusing, if, using your example, figure 4.2 is followed by figure 2.5. If you plan a .pdf version only, without planning to print it, a hyperlink forward and backward for a reference and the figure is quite useful –  Sep 08 '14 at 19:09
  • @Hupfer, this is not so uncommon in technical literature, so I suppose my readers will understand. Also, it will be read in print, unfortunately. – Rikki-Tikki-Tavi Sep 08 '14 at 19:43
  • @Rikki-Tikki-Tavi: My user name is Christian Hupfer;-) -- I wasn't notified of your comment –  Sep 08 '14 at 20:21

2 Answers2

20

With caption it's easy to avoid a caption going in the list of figures.

\documentclass{book}
\usepackage{caption}

\newcommand{\repeatcaption}[2]{% \renewcommand{\thefigure}{\ref{#1}}% \captionsetup{list=no}% \caption{#2 (repeated from page \pageref{#1})}% \addtocounter{figure}{-1}% So that next figure after the repeat gets the right number. }

\newcommand{\fakeimage}{\fbox{Fake image}} % just for the example

\begin{document}

\frontmatter \listoffigures

\mainmatter

\chapter{A chapter title}

text

\begin{figure}[htp] \centering \fakeimage \caption{A caption}\label{figure:nice} \end{figure}

\chapter{Another title}

text

\begin{figure}[htp] \centering \fakeimage \caption{This is for the new figure}\label{figure:dull} \end{figure}

\begin{figure}[htp] \centering \fakeimage \repeatcaption{figure:nice}{A caption} \end{figure}

\end{document}

It's up to you whether defining a macro holding the figure to be repeated or one for the caption text.

enter image description here

egreg
  • 1,121,712
  • Another good solution, that keeps the second image floating. I have a hard time picking an accepted answer here. :) – Rikki-Tikki-Tavi Sep 08 '14 at 20:17
  • @Rikki-Tikki-Tavi Figures should float: it's a lost battle trying not to. You can influence the placement when the document is in its final form by moving the figure environment up or down in the document. Trial and error is the best strategy (when one has the time to do it) for getting an almost perfect printout. – egreg Sep 08 '14 at 20:21
  • also true. I guess I will just throw a coin ;)... – Rikki-Tikki-Tavi Sep 08 '14 at 22:59
  • 2
    Thanks so much. I think it's good to add \addtocounter{figure}{-1} after insertion of the repeated figure to decrement the figure counter. – Sali Hoo Jun 25 '17 at 23:53
  • Agreed with Sali Hoo! Just tested it and the counter still skips which is bad – Victor Archela Nov 29 '20 at 01:29
8

Here's one way, by stuffing the repeated figure content in a saved\vbox. However, in this case, the repeated figure will not be a float. EDITED to resolve List of Figures issue.

\documentclass{article}
\newsavebox\savefigure
\begin{document}
\listoffigures

\begin{figure}[ht]
\centering
\framebox{first figure}
\caption{First caption}
\end{figure}

\savebox\savefigure{\vbox{%
\centering
\framebox{second figure}
}}
\begin{figure}[ht]
\noindent\usebox{\savefigure}
\caption{Second caption}
\end{figure}

\begin{figure}[ht]
\centering
\framebox{third figure}
\caption{Third caption}
\end{figure}

{\centering
\medskip
\noindent\usebox{\savefigure}\par
\bigskip
Figure 2: Second caption\par}
\end{document}

enter image description here

  • Actually the second figure not floating is a plus, because the reader will not look go looking for figure 2.5 in chapter 4. Thank you! – Rikki-Tikki-Tavi Sep 08 '14 at 19:45