I'm using tcolorbox which recommends not using float environments like figure and table inside a box, and instead suggests directly using includegrapghics and tabular combined with \captionof.

I guess one of the things a figure environment does is adding vertical spacing at the end. How can I achieve a similar thing for all my includegraphics? I can of course add vspace but is there a property I can set globally?


Do you want to add the space inside of the tcolorbox? If so, you can use the trim option for the \includegraphics command and set it globally via \setkeys{Gin}{trim=}.

\documentclass[12pt, a4paper]{scrartcl}
\usepackage{graphicx, tcolorbox}


Here is a figure 
without vertical spacing of 2cm \\ 

\setkeys{Gin}{trim=0pt -2cm 0pt -0cm}

And a figure 
with vertical spacing of 2cm below \\


This can add (or subtract, depending on the sign) a vertical space (here 2cm) above or below the image. However this only adds space inside of the tcolorbox:

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.