4

When I use colored text (textcolor) in a - breakable - tcolorbox the color is restored to black after a page break. What must be changed to have, say, blue text within the whole tcolorbox?

\documentclass[11pt,a4paper,oneside]{report}
\usepackage{color}
\usepackage{tcolorbox} % Frames
\tcbuselibrary{theorems}
\tcbuselibrary{breakable}
\usepackage{cleveref} % references in tcolorboxes
\usepackage{lipsum} % references in tcolorboxes

\newtcbtheorem[auto counter, number within = chapter,
crefname={beispiel}{example},
Crefname={Beispiel}{Example} ]
{Exa}{Beispiel}{%
    breakable,
    fonttitle = \bfseries,
    colframe = green!35!black,
    colback = green!5
}{exa}


\begin{document}


\begin{Exa}{Differenzialgleichung}{DGL}
\textcolor{blue}
{
\lipsum[1-10]
}
\end{Exa}

\end{document}
2

1 Answer 1

6

You can use the font colour mechanism of tcolorbox and set it as optional argument of your exa environment:

\documentclass[11pt,a4paper,oneside]{report}
\usepackage{color}
\usepackage{tcolorbox} % Frames
\tcbuselibrary{theorems}
\tcbuselibrary{breakable}
\usepackage{cleveref} % references in tcolorboxes
\usepackage{lipsum} % references in tcolorboxes

\newtcbtheorem[auto counter, number within = chapter,
crefname={beispiel}{example},
Crefname={Beispiel}{Example} ]
{Exa}{Beispiel}{%
    breakable,
    fonttitle = \bfseries,
    colframe = green!35!black,
    colback = green!5
}{exa}


\begin{document}


\begin{Exa}[coltext=red]{Differenzialgleichung}{DGL}

\lipsum[1-10]

\end{Exa}

test

\end{document}

enter image description here

2

You must log in to answer this question.

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