Graphics, Figures & TablesFigure in list of figures but without caption

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
dax42
Posts: 11
Joined: Wed Jun 16, 2010 1:07 pm

Figure in list of figures but without caption

Post by dax42 »

Hi there,

Is it possible to have a silent caption on a figure?
Basically, my figure already includes its caption inside the figure file, so that I don't want to add another one with Latex. However, I do want the figure to appear in the list of figures! Is there any way to do that?

Thanks!
Winnie

Recommended reading 2024:

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

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

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Figure in list of figures but without caption

Post by gmedina »

Hi,

you can use the \addcontentsline command; an example (I used black rectangles to simulate actual figures, but of course you can use the standard \includegraphics command provided the graphicx package has been loaded):

Code: Select all

\documentclass{book}

\begin{document}
\listoffigures

\begin{figure}[!ht]
  \centering
  \rule{2cm}{2cm}
  \caption{A black rectangle with regular caption.}
\end{figure}

\begin{figure}[!ht]
  \centering
  \stepcounter{figure}
  \rule{2cm}{2cm}
  \addcontentsline{lof}{figure}{\protect\makebox[2.3em][l]{\thefigure}A black rectangle without caption but listed in the lof.}
\end{figure}

\begin{figure}[!ht]
  \centering
  \rule{2cm}{2cm}
  \caption{Another black rectangle with regular caption.}
\end{figure}

\end{document}
Even though I showed how to achieve what you requested, I would suggest you to include only the figure, if possible, and produce its caption using the standard \caption command to avoid font inconsistencies.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
dax42
Posts: 11
Joined: Wed Jun 16, 2010 1:07 pm

Re: Figure in list of figures but without caption

Post by dax42 »

Thanks a lot, that's really helpful!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Figure in list of figures but without caption

Post by localghost »

Now that the problem seems to be solved, please be so kind and mark the topic accordingly as described in Section 3 of the Board Rules.


Best regards
Thorsten
Post Reply