Graphics, Figures & Tables ⇒ Wrapping a figure within its own caption
Wrapping a figure within its own caption
Sorry if this has been asked already but I didn't find anything really corresponding to my needs up until now. So here I go with my problem.
I need to have a figure wrapped within its own caption.
I know of the SCfigure package but if the caption exceeds the figure's height it stays squeezed. Basically, I would like something similar to what the wrapfigure environment proposes, but with the figure's caption, not external text.
Is it possible?
Thanks in advance.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Wrapping a figure within its own caption
A \caption is no magic, it's just the text preceeded by \figurename~\thefigure and separated by a some symbols - usually :~pierre wrote:Basically, I would like something similar to what the wrapfigure environment proposes, but with the figure's caption, not external text.
So you can easily typeset the caption by yourself to get the desired output, e.g.:
Code: Select all
\documentclass{article}
\newcommand\sample{Some text for our page
that is reused over and over again. }
\usepackage{wrapfig}
\usepackage{caption}
\begin{document}
\listoffigures
\bigskip
\begin{wrapfigure}[3]{l}[0.2\width]{0pt}
\centering
\fbox{This is a ``wrapfigure''.}
\end{wrapfigure}
\captionlistentry[figure]{An example of the wrapfigure environment}
\figurename~\thefigure:
This is an example of the wrapfigure environment.
This is an example of the wrapfigure environment.
This is an example of the wrapfigure environment.
This is an example of the wrapfigure environment.
This is an example of the wrapfigure environment.
This is an example of the wrapfigure environment.
This is an example of the wrapfigure environment.
This is an example of the wrapfigure environment.
\sample \sample \sample
\end{document}
HTH,
Axel
Re: Wrapping a figure within its own caption
Thanks for the quick reply, this definitely helps. Didn't know how to make a wrapfigure look like I wanted, mainly because I always failed to make its wrapping text look like its caption.
Thanks a lot for your solution.
