# How to make a breakable tcolorbox which spans the total text height?

How to make a breakable tcolorbox which spans the total text height? I tried this:

\documentclass{article}

\usepackage[breakable]{tcolorbox}
\usepackage[top=2cm,bottom=2cm,hmargin=2.2cm]{geometry}

\usepackage{lipsum}

\begin{document}

\begin{tcolorbox}[breakable,height fill]
\lipsum[1-10]
\end{tcolorbox}

\end{document}


The problem is that the tcolorbox on the second page doesn't have \textheight (i.e. the box should like a border around the page):

One possibility is to use the height fixed for=all key.

This has the advantage that the height will be same for any part of the broken box, i.e. if there are more than two parts, say 3, the middle box will have the same height as well.

\documentclass{article}

\usepackage[breakable]{tcolorbox}
\usepackage[top=2cm,bottom=2cm,hmargin=2.2cm]{geometry}

\usepackage{lipsum}

\begin{document}

\begin{tcolorbox}[breakable,height fixed for=all]
\lipsum[1-10]
\end{tcolorbox}

\end{document}


• Another possibility, if the frame is to go on every page, is to use a background. Feb 22, 2017 at 17:54
• I want to use tcolorbox because the look should be consistent with another document where I use tcolorboxes not only as a frame. I just noticed that this doesn't work with vfill, here is a follow up question to this: tex.stackexchange.com/q/355199/21557 Feb 22, 2017 at 17:59
• @Julia: \vfill can be enabled with text fill option, however, the box isn't breakable then :-(
– user31729
Feb 22, 2017 at 18:00