1

I am currently trying to write a document where I have breakable tcolorboxes with a vertical gradient, as in the code below. However, I am facing an issue where the color gradient resets each time there is a page break, is there a way of fixing this?

The below code illustrates my approach to the creation of the colorboxes and also what goes wrong.

\documentclass[a4paper, 11pt]{article}
\usepackage{lipsum}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\tcbuselibrary{breakable}
\tcbuselibrary{theorems}
\newtcbtheorem[number within=section]{Test}{Test Box}
{enhanced,interior style={white,opacity=0.8},frame style={top color=red!75!black,
bottom color=blue!75!black},sharpish corners,breakable,fonttitle=\bfseries}{th}
\begin{document}
\begin{Test}{I am a test box}{}
\lipsum[1-5]

\end{Test}
\end{document}

The following image shows the problem which occurs when there is a page break. color page break

1
  • 2
    you could set different gradients for the first and the last part, e.g. frame style={top color=red!75!black,bottom color=red!50!blue!75!black}, extras last={frame style={top color=red!50!blue!75!black,bottom color=blue!75!black},}, Feb 13 at 22:28

0

You must log in to answer this question.

Browse other questions tagged .