I have a long .tex document and I want to change the background color of the parts I have already checked for typos to a light green. I am looking for an easy command that can be used like
\HIGHLIGHT{
<here I want to put a part of my tex file that contains different environments like theorems, figures...>
}
But the \hl{} command cannot contain other environments, the following example does not work:
\documentclass[10pt]{article}
\usepackage[english]{babel}
\usepackage{amssymb,amsmath,amsthm,amsfonts}
\usepackage{xcolor,soul}
\newtheorem{theorem}{Theorem}
\begin{document}
\section{Introduction}
\hl{
\begin{theorem}
A theorem.
\end{theorem}
}
\end{document}
Do you have any suggestions which command could be used here (the typesetting shall not be changed, only the color)?


tcolorboxand using it's theorem features, as such you can easily change the background colour – Jan 21 '17 at 21:40tcolorboxdoes not set the boxes at the top of a new page. – Jan 22 '17 at 09:30\hl{...}statements you would have to do that anyway – Jan 22 '17 at 09:36\tcbuselibrary{breakable}and\begin{tcolorbox}[breakable], it does not realign the box and spans over multiple pages. So this is a solution that does what I want. Thanks for pointing me in the right direction! – phinz Jan 22 '17 at 10:22TCBwizard is Thomas Sturm of course – Sep 16 '17 at 20:48