In the below link


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.

  • 5
    check out the mdframed package. – user11232 Mar 5 '12 at 3:53
  • Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. – Tobi Mar 5 '12 at 4:03
  • 2
    In addition to Harish’s comment I recommend to define commands and environments for those thing you want to highlight. So all of them look the same but can be change easily afterword if necessary. After checking mdframed you may post a minimal working example (MWE) to show, what you’ve tried so far … – Tobi Mar 5 '12 at 4:06

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


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



\section{mdframed for the win}

  • This is not working for me due to some reason. I am not getting the output. – chandrasekhar Mar 5 '12 at 8:30
  • @chandrasekhar add \listfiles immediately before your \begin{document}- it sounds like your system needs to be updated – cmhughes Mar 5 '12 at 16:57

With tcolorbox:

\usepackage[breakable, theorems, skins]{tcolorbox}

\begin{tcolorbox}[   %% Adjust the following parameters at will.
        enlarge left by=0mm,
        arc=0pt,outer arc=0pt,



enter image description here

tcolorbox integrates flawlessly with theorem packages and math. Further, it can produce more fancier boxes than one can imagine. I feel that this is the best option to adopt when one has to highlight text / math / theorems. Though I have defined a command, new environments can also be defined with tcolorbox. For details, texdoc tcolorbox or visit www.texdoc.net.

A sample preposition:



\begin{Proposition}{This is my proposition}{}

Earlier attempt:

Sorry for joining late. I would like to add to cmhughes's excellent answer. Though his reply is already accepted as the answer, I wish to share mine. My method is simple and direct where colors can be changed very easily.

\section{First section}

enter image description here

  • 2
    this won't break across pages though... – cmhughes Mar 5 '12 at 16:58
  • @cmhughes Correct. But the file provided above by the OP does not require breaking across pages. It is for just highlighting small bits of text (like a line or two. I also go with mdframed for things like these. (as I commented above) My answer is added just for fun. – user11232 Mar 5 '12 at 22:52
  • @HarishKumar:Very nice way of doing it! – Thanos Oct 7 '12 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.