[Tex/LaTex] Enumerated text and formula with background color

backgroundscolorhighlighting

I want to have an enumeration with text and formulas with a background color, but \colorbox does not work, here's my code:

\documentclass{book}
\usepackage{xcolor}
\usepackage{shadethm}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{wrapfig}
\usepackage{amssymb}
\usepackage{graphicx} 

\definecolor{usethiscolorhere}{rgb}{0.86666,0.78431,0.78431}


\begin{document}
%\colorbox{usethiscolorhere}{
\begin{enumerate}
\item bla bla
\item bla bla
\item $\begin{aligned}[t]\lim _{x \rightarrow -\infty}F(x)=0 \end{aligned}$ and $\begin{aligned}[t]lim_{x \rightarrow \infty} F(x)=1\end{aligned}$
\end{enumerate}
%}
\end{document}

The color should be one of my self defined colors.

Best Answer

You need to avoid the indentation and also to take into account the padding of \colorbox:

\documentclass{book}
\usepackage{xcolor}
\usepackage{amsmath}

\definecolor{usethiscolorhere}{rgb}{0.86666,0.78431,0.78431}

\begin{document}
\noindent\colorbox{usethiscolorhere}{%
\begin{minipage}{\dimexpr\textwidth-2\fboxsep}
\begin{enumerate}
\item bla bla
\item bla bla
\item $\lim\limits_{x\to -\infty}F(x)=0$ and 
  $\lim\limits_{x\to\infty} F(x)=1$
\end{enumerate}
\end{minipage}%
}
\end{document}

Note the two % characters for avoiding spurious spaces in the output and \limits to get the subscript underneath "lim".

enter image description here