[texworks] How to color background

Aleks Kleyn Aleks_Kleyn at MailAPS.org
Fri Feb 26 00:13:46 CET 2021


I recently put attention that in LaTeX file I can change background of
theorem. I like this idea because it may help to see where statement is in
text. Some theorems I print in 2 columns (to compare them when somebody read
them) and after some search and trial I found the following code

\documentclass{amsbook}
\begin{document}
\usepackage{graphicx}
\usepackage{color}
\definecolor{Gray}{rgb}{.94,.95,.94}
\setlength{\parindent}{-9pt}
\colorbox{Gray}
{
\noindent
\begin{tabular}{@{}l|r}
\begin{minipage}{175pt}
\setlength{\parindent}{4mm}
Text 1
\end{minipage}
&
\begin{minipage}{175pt}
\setlength{\parindent}{4mm}
Text 2
\end{minipage}
\end{tabular}
}
\setlength{\parindent}{9pt}
\end{document}

I do not see using colorbox in this code because colorbox and minipage do
not flow from page to page, but this is problem for single theorem. Is there
way to change background color for single theorem?

Thank you
Aleks Kleyn




More information about the texworks mailing list.