0

Edit: clarified title and requirement.

How do I make the graphic below take up space equal to the size of the graphic, and then have the caption fill the remaining space?

enter image description here

\documentclass{article}
\usepackage{lipsum}
\usepackage{mwe}
\usepackage{floatrow}

\floatsetup[figure]{capposition=beside,capbesideposition={top,right}}

\begin{document}
\lipsum[1]
\begin{figure}[H]
\includegraphics[width=0.2\textwidth]{example-image-a}
\caption{\protect\lipsum[2]}
%\lipsum[3]
\end{figure}
\end{document}

I believe the option \fcapside[\FBwidth] may be relevant, but I don't know how to use it. (I’m finding the 107-page floatrow manual hard work for my simple needs; perhaps I should be using a simpler package.)

3
  • I think you are look for a wrapfig, if yes, please go through this link texblog.org/2010/05/13/wrap-text-around-figures-and-tables
    – Samjith
    Dec 9, 2019 at 13:58
  • Not quite - I’m not looking to wrap, but only to have the graphic occupy its “natural” size (rather than what looks like `0.5\textwidth), and then the caption occupy the rest. If the caption text would then extend below the figure, I don't want it to wrap, but to maintain its original width.
    – Roly
    Dec 9, 2019 at 14:01
  • Got it!. There should be a easier solution for that.
    – Samjith
    Dec 9, 2019 at 14:05

1 Answer 1

1

Use \fcapside[\FBwidth]:

\documentclass{article}
\usepackage{lipsum}
\usepackage{mwe}
\usepackage{floatrow}

\floatsetup[figure]{capposition=beside,capbesideposition={top,right}}

\begin{document}
\lipsum[1]
\begin{figure}[H]
\fcapside[\FBwidth]
{\includegraphics[width=0.2\textwidth]{example-image-a}}
{\caption{\protect\lipsum[2]}}
%\lipsum[3]
\end{figure}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .