[Tex/LaTex] How to highlight important parts (with a gray background)

boxescolorframedhighlighting

In the below link

http://www.math.uiowa.edu/~goodman/algebrabook.dir/bookmt.pdf

the author highlights anything which is important using a greyish color background. For example, if you see Equation 1.5.3 (which on page 22 of the book) it is highlighted in grey. I would like to know the TeX commands for producing similar output.

Best Answer

As mentioned in the comments, mdframed is perfect for this. You can combine it with your favourite theorem package too- in the MWE below I've used it with ntheorem, but there's nothing to stop you from using amsthm or something similar.

enter image description here

This example is very simple, but you can get very sophisticated using tikz or pstricks as the engine, as shown in the excellent documentation

\documentclass{article}

\usepackage{xcolor}     % for colour
\usepackage{lipsum}     % for sample text
\usepackage{ntheorem}   % for theorem-like environments
\usepackage{mdframed}   % for framing

\theoremstyle{break}
\theoremheaderfont{\bfseries}
\newmdtheoremenv[%
linecolor=gray,leftmargin=60,%
rightmargin=40,
backgroundcolor=gray!40,%
innertopmargin=0pt,%
ntheorem]{myprop}{Proposition}[section]

\begin{document}

\section{mdframed for the win}
\begin{myprop}
\lipsum[1]
\end{myprop}

\end{document}
Related Question