Graphics, Figures & TablesInserting a Figure within a Figure caption

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
lankks
Posts: 1
Joined: Wed Mar 07, 2012 3:46 pm

Inserting a Figure within a Figure caption

Post by lankks »

Hi everyone,

First time posting here,

I've got a figure, which has two different symbols with two different trendlines through in it. I can't have a figure legend, because that's against convention, so the usual thing to do is insert the symbol next to the description in the caption.

I've got the appropriate symbols in little EPS files, which I want to insert in the X Y Z W slots below. I tried using \begin{figure}[H] includegraphics[scale=0.9\textheight]{X} \end{figure}, but all I get is syntax.

Code: Select all

\begin{landscape}
\begin{figure}
  \centering
  \subfloat{\label{fig:sp}\includegraphics[width=0.8\textwidth]{sptime}}~
  \subfloat{\label{fig:ulm}\includegraphics[width=0.8\textwidth]{ulmtime}}
  \caption{Blah Blah Blah Blah (X) Blu Blu Blu Blu (Y) BLAH BLAH BLAH (Z) BLU BLU BLU BLU (W)}
  \label{fig:devtimes}
\end{figure}
\end{landscape}
Really have no idea how to do this one, tried researching to no avail. So the question is: Is it possible to insert little pictures inside figure captions that are in line with the text?
Last edited by Stefan Kottwitz on Wed Mar 07, 2012 4:18 pm, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Inserting a Figure within a Figure caption

Post by Stefan Kottwitz »

Hi lankks,

welcome to the board!
lankks wrote:Is it possible to insert little pictures inside figure captions that are in line with the text?
You could directly use \includegraphics within the \caption command. Use \protect to prevent early expansion of the \includegraphics command, when it is written to the .lof file.

Here's an example. I just used the demo option for the graphicx package, such that images are replaced by black filled rectangles, for demonstration purpose, so we don't need to provide additional image files.

Code: Select all

\documentclass[12pt]{article}
\usepackage[demo]{graphicx}
\begin{document}
\listoffigures
\begin{figure}
  \centering
  \includegraphics{bigpicture}
  \caption{A caption with a small picture:
    \protect\includegraphics[width=1.5ex,height=1.5ex]{smallpicture}}
\end{figure}
\end{document}
Stefan
LaTeX.org admin
Post Reply