Graphics, Figures & TablesSmall Figure in another Figure's Caption

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
patrick
Posts: 2
Joined: Mon Oct 24, 2011 9:26 pm

Small Figure in another Figure's Caption

Post by patrick »

Hi,

i was wondering if there is an easy way to in insert a small figure (showing a symbol used in a diagram) in another figures caption?

Can anyone advise if there is a package that allows these type of things and how to?

Thanks
P

The \protect advise profes fine! Thanks
Last edited by patrick on Wed Oct 26, 2011 1:32 pm, edited 2 times 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

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Re: Small Figure in another Figure's Caption

Post by kaiserkarl13 »

I'm not precisely sure what you wish to do. If you mean insert a symbol like $\circ$, $\diamond$, or $\bullet$, then that's easy. The txfonts package also provides $\medcirc$ and similar constructs, and packages like mnsymbol provide lots of symbols for you.

If you want to include an image mid-text, you can use \includegraphics as usual; just don't put the usual centering tags around it and make sure your image is shorter than the height of the text.
patrick
Posts: 2
Joined: Mon Oct 24, 2011 9:26 pm

Small Figure in another Figure's Caption

Post by patrick »

Hi,

i'm trying to insert a picture mid-text in the \caption{text} and your suggestion works as long as it is not within the \caption{text} (see code bellow).

Code: Select all

\begin{figure} [t!b]
   \centering
   \includegraphics[scale=0.55]{mainfigure.pdf}
   \caption{Text text and text (\includegraphics[scale=0.065]{symbolfigure2.png}) Text and further text}
    \label{figtest}
 \end{figure}
The error message i receive unsing TeXShop 2.43 on Mac OS X is:
chapter5.tex:43: Undefined control sequence.
\hyper@makecurrent . . . hypertexnames \let \@number

\@firstofone \def \@fnsymb . . .
l.43 ....text text}

? chapter5.tex:43: Missing number, treated as zero.
<to be read again>
##
l.43 ....text text}

? chapter5.tex:43: Illegal parameter number in definition of \re
served@a.
<to be read again>

Thanks for further help or suggestions.
P
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Small Figure in another Figure's Caption

Post by sommerfee »

It should work as long as you offer an alternative text for the "List of Figures", for example:

Code: Select all

\documentclass{article}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure} [t!b]
   \centering
   \includegraphics[scale=0.55]{mainfigure.pdf}
   \caption[Text text and text] % <= Alternative text for "List of Figures"
    {Text text and text (\includegraphics[scale=0.065]{symbolfigure2.png}) Text and further text}
    \label{figtest}
 \end{figure}
\end{document}
Another option is "protecting" the \includegraphics command, for example:

Code: Select all

\documentclass{article}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure} [t!b]
   \centering
   \includegraphics[scale=0.55]{mainfigure.pdf}
   \caption
    {Text text and text (\protect\includegraphics[scale=0.065]{symbolfigure2.png}) Text and further text}
    \label{figtest}
 \end{figure}
\end{document}
Post Reply