0% found this document useful (0 votes)
109 views1 page

Myspace

This document describes the "/tcb/space to" option in tcolorbox, which saves the difference between the natural height of a box and its forced height into a macro. This macro, called "hmacroi", can then be used to add content that matches the extra vertical space. The key points are: - "/tcb/space to" saves the height difference into a macro for adding matching content. - The macro is dynamically adapted over multiple compilations to accurately reflect the space. - Content can be sized to hmacroi plus an offset, but never multiplied or split without summing to it. - It should not be used with "/tcb/fit". -

Uploaded by

jimusos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views1 page

Myspace

This document describes the "/tcb/space to" option in tcolorbox, which saves the difference between the natural height of a box and its forced height into a macro. This macro, called "hmacroi", can then be used to add content that matches the extra vertical space. The key points are: - "/tcb/space to" saves the height difference into a macro for adding matching content. - The macro is dynamically adapted over multiple compilations to accurately reflect the space. - Content can be sized to hmacroi plus an offset, but never multiplied or split without summing to it. - It should not be used with "/tcb/fit". -

Uploaded by

jimusos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

/tcb/space to both

(style)
This is an abbreviation for space=0.5, i. e. the extra space equally distributed between the
upper and the lower part.
\tcbset{width=(\linewidth-2mm)/3,before=,after=\hfill,
colframe=blue!75!black,colback=white,height=3cm}
\foreach \myspace in {space to upper,space to both,space to lower}
{\begin{tcolorbox}[\myspace]
This is the upper part.
\tcblower
This is the lower part.
\end{tcolorbox}}

This is the upper part.

This is the upper part.

This is the upper part.


This is the lower part.

This is the lower part.


This is the lower part.

N 2015-02-15

/tcb/space to=hmacroi
(no default, initially unset)
If the height of a tcolorbox is not the natural height, the space difference between the
forced and the natural size is saved into the given local hmacroi. This hmacroi can and
should be used inside the box content to add content which is vertically sized to match
hmacroi.

The actual length saved into hmacroi is adapted dynamically during several
compilations at least two, but maybe more.
Due to the adaption algorithm, objects can be sized with hmacroi plus any offset
length.
Never ever use hmacroi multiplied with a factor. The only exception to this rule
is that the space can be split into parts which sum to hmacroi.
Never use this in combination with /tcb/fit P. 385 .
\begin{tcolorbox}[colframe=blue!75!black,colback=white,height=3cm,
space to=\myspace]
This is my box of height 3cm. The space is filled with a picture:\\[2mm]
\includegraphics[width=\linewidth,height=\myspace]{goldshade.png}\\[1mm]
This is some other text.
\end{tcolorbox}

This is my box of height 3cm. The space is filled with a picture:

This is some other text.

57

You might also like