TransWikia.com

Remove vertical spacing in wrapfigure (above/below hrule)

TeX - LaTeX Asked by Anton Hinneck on May 8, 2021

I want to use wrapfigure to contain an (align) environment. How do I remove the excessive vertical spacing above and below the rule commands without using vspace? I don’t understand where this space comes from in the first place.

begin{wrapfigure}{r}{0.5textwidth}
    rule{0.5textwidth}{1pt}
    captionof{model}{MODEL hfill[LP]}
    rule{0.5textwidth}{1pt}
    begin{align}
        1 = 1
    end{align}
    rule{0.5textwidth}{1pt}
end{wrapfigure}

This is my current output:

enter image description here

I already set

setlength{abovedisplayskip}{0pt}
setlength{belowdisplayskip}{0pt}
setlength{abovedisplayshortskip}{0pt}
setlength{belowdisplayshortskip}{0pt}

in the beginning of the document. This successfully removes space around the align environment.

I want the hrules to wrap the caption tightly and symetrically. Furthermore, I want the top and bottom padding equal to the columnsep setting, i.e left and right padding.

Thanks a lot in advance.

EDIT:

Got there. I got this result with:

captionsetup[model]{skip=0.2em, labelsep=period}
usepackage{parskip}
setlength{parskip}{0pt}

and

vspace{-1.3em}
captionof{model}{MODEL hfill[LP]}

Still, for some reason vspace always feels like a dirty hack to me. I would feel better if the linebreak after the caption would not be produced in the first place. Is the use of vspace to be recommended, in general?

enter image description here

One Answer

See "Edit". I would still apperciate some thoughts on using vspace. Is there a way to achieve the same without this command?

Answered by Anton Hinneck on May 8, 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