3

I've defined a tcolorboxenvironment thusly:

\newtcolorbox{cajita}[1]{ boxrule=2pt,
  breakable,
  enhanced,
  arc=3mm,
  colback=Orange!15,
  colframe=Orange!70,
  colbacktitle=Orange!35,
  coltitle=black,
  fonttitle={\bfseries},
  attach boxed title to top left={xshift=10pt,yshift*={-\tcboxedtitleheight/2}},
  boxed title style={parbox,boxrule=2pt,boxsep=1.5mm},
  segmentation style={Orange!50,loosely dotted,line width=2pt},
  beforeafter skip=\topskip, title = {#1},
  parbox=false}{}

When a page break occcurs, the box stops just under the last line of text and then continues on the next page. However, I'd like the box to continue past the last line of text to the very bottom of the page, past the footer even. Just the box, not the text, of course.

I know this wouldn't make sense aesthetically in most situations, but I promise in this case does. I have an image overlay as the footer so the box would "disappear" behind that image rather than stopping awkwardly just before it.

Can this be done?

EDIT: Image to show what I mean. Image

EDIT: Minimal working example:

\documentclass[11pt]{article}
\usepackage{lipsum}
\usepackage[most]{tcolorbox}

\newtcolorbox{cajita}[1]{ boxrule=2pt,
  breakable,
  enhanced,
  arc=3mm,
  coltitle=black,
  fonttitle={\bfseries},
  attach boxed title to top left={xshift=10pt,yshift*={-\tcboxedtitleheight/2}},
  boxed title style={parbox,boxrule=2pt,boxsep=1.5mm},
  segmentation style={loosely dotted,line width=2pt},
  beforeafter skip=\topskip, title = {#1},
  parbox=false}{}

\begin{document}

\begin{cajita}{mybox}
\lipsum
\end{cajita}

\end{document}
11
  • 2
    It should be rather easy to extend the box. But the footer is the last thing drawn on a page, so it is always in the foreground. If it should get in the background you need to move its code into the header. Feb 3, 2019 at 11:10
  • You could place the tcolorbox inside a node of a centered tikz graph in an overlay like \begin{center}\begin{tikzpicture}\node (Here) at (0,0);\end{tikzpicture}\begin{tikzpicture}[remember picture,overlay]\node at (Here){\begin{tcolorbox} ... \end{tkolorbox}}\end{tikzpicture}\end{center}
    – koleygr
    Feb 3, 2019 at 11:39
  • @koleygr which would break completly the breakable option ... Feb 3, 2019 at 11:41
  • 1
    Well make a sensible minimal example. Feb 3, 2019 at 11:48
  • 1
    The point of an MWE is that we can use it for test. So it should compile for me (which it doesn't currently due to the pictures) and it shouldn't contain irrelevant stuff as this is distracting. Use your little gray cells ... Feb 3, 2019 at 12:33

1 Answer 1

2

You can use a combination of enlarge bottom at break by and bottomsep at break or pad before break:

\documentclass[11pt]{article}
\usepackage{lipsum}
\usepackage[most]{tcolorbox}

\newtcolorbox{cajita}[1]{ boxrule=2pt,
  breakable,
  enhanced,
  arc=3mm,
  coltitle=black,
  fonttitle={\bfseries},
  attach boxed title to top left={xshift=10pt,yshift*={-\tcboxedtitleheight/2}},
  boxed title style={parbox,boxrule=2pt,boxsep=1.5mm},
  segmentation style={loosely dotted,line width=2pt},
  beforeafter skip=\topskip, title = {#1},
  enlarge bottom at break by=-3cm,
  %pad before break=3cm,
  bottomsep at break=3cm,
  parbox=false}{}

\begin{document}

\begin{cajita}{mybox}
\lipsum
\end{cajita}

\end{document}

enter image description here

1
  • 1
    Thanks a lot, that solved the problem beautifully! Feb 3, 2019 at 13:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .