1

This is a follow up question to: How to make a breakable tcolorbox which spans the total text height?

I want to add some text on the bottom of the last page inside of the colorbox. But \vfill doesn't work. Any ideas?

\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]

  \vfill

  Some text on the bottom of the last page.
\end{tcolorbox}

\end{document}
3
4

\vfill can't work. But you can cheat and add an overlay (the shift values aren't correct yet). Be aware that if your box is full, the overlay can overwrite the text.

\documentclass{article}

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

\usepackage{lipsum}

\begin{document}

\begin{tcolorbox}[breakable,height fixed for=all,enhanced,
   overlay last={\node[anchor=base west] at ([xshift=1cm,yshift=1cm]frame.south west){Some text on the bottom};}]
  \lipsum[1-10]

\end{tcolorbox}

\end{document}

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.