I am looking for a tcolorbox that has the hight like a \vfill
.
I have a page with tcolorbox
es.
If there is some space left on the page, I would like to extend the hight of a box in the middle of the page. The box should have the hight of a \vfill
.
There is alreadey a very nice feature, the option height fill
that does exactly what I want but just for the last box on the page.
Would be great, if the solution also works for a raster like the example.
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{raster}
\tcbuselibrary{breakable}
\begin{document}
other
\clearpage
\begin{tcolorbox}a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\end{tcolorbox}
\begin{tcbraster}[%
raster columns=2,
raster rows=1,
raster height=6cm, % manual adjustment :-(
%raster height=\vfill,% I would like to have the hight like \vfill
%height fill,% Nice, but only working at the end of the page :-(
]
\begin{tcolorbox}
Here we will have a plot that is nice to extend if there is some space left on the page.
\end{tcolorbox}
\begin{tcolorbox}
Here we will have a plot that is nice to extend if there is some space left on the page.
\end{tcolorbox}
\end{tcbraster}
\begin{tcolorbox}a\\a\\a\\a\\a\\a\\a\\a\\a\\a
\end{tcolorbox}
\clearpage
other
\end{document}
@cfr
As you advised, I have put all boxes in the raster. The first and the last box should be natural height
. Could you please show me how to extend the two boxes in the middle to fill the page?
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{raster}
\tcbuselibrary{breakable}
\begin{document}
other
\clearpage
\begin{tcbraster}[%
raster columns=1,
raster rows=3,
raster height=\textheight,
]
\begin{tcolorbox}[reset,natural height]
a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a
\end{tcolorbox}
\begin{tcbraster}[%
raster columns=2,
raster rows=1,
raster height=6cm,% how to extend the height to fill the page?
]
\begin{tcolorbox}
Here we will have a plot that is nice to extend if there is some space left on the page.
\end{tcolorbox}
\begin{tcolorbox}
Here we will have a plot that is nice to extend if there is some space left on the page.
\end{tcolorbox}
\end{tcbraster}
\begin{tcolorbox}[reset,natural height]
a\\a\\a\\a\\a\\a\\a\\a\\a\\a
\end{tcolorbox}
\end{tcbraster}
\clearpage
other
\end{document}
Best Answer
This needs some manual effort. In my code, the height of the top and bottom boxes are saved by
equal height groups
of nametopbox
andbottombox
. Now, the height of the middle boxes are set to\textheight-\topboxheight-\bottomboxheight-4mm
where2mm
is the space between the boxes.