0

Here's the minimal example, verified on David Carlisle's TeXLive.net:

\documentclass{article}

\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\usepackage{xcolor}

\newtcolorbox{workinprogress}[1][]{
  breakable,
  #1
}

\begin{document}

\begin{workinprogress}[oversize]
\lipsum[1-4]
some text\footnote{\textcolor{red}{\lipsum[1-4]}}
\end{workinprogress}

\end{document}

As you can see from the screenshot below, the effect of \textcolor{red} is lost across a page break.

enter image description here

Unlike \textcolor{red}, however, other commands such as \emph, \textbf, \textit, and \textsc, are correctly retained after the page break.

1

1 Answer 1

2

colors in pdflatex are not like fonts. They add a literal and this can get lost at page breaks. Use lualatex and the luacolor package.

\documentclass{article}

\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{luacolor}
\newtcolorbox{workinprogress}[1][]{
  breakable,
  #1
}

\begin{document}

\begin{workinprogress}[oversize]
\lipsum[1-4] some text\footnote{\textcolor{red}{\lipsum[1-4]}} 
\end{workinprogress}

\end{document}

With pdflatex it should be possible too, but it would require additional code to add a color stack, see the pdfcolfoot package.

You must log in to answer this question.

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