TransWikia.com

floatrow: have graphic occupy space equal to its size, and caption fill remaining space

TeX - LaTeX Asked by Roly on February 27, 2021

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.2textwidth]{example-image-a}
caption{protectlipsum[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.)

One Answer

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.2textwidth]{example-image-a}}
{caption{protectlipsum[2]}}
%lipsum[3]
end{figure}
end{document}

enter image description here

Answered by Roly on February 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP