In a presentation of a colleague I saw that his examples were displayed in a filled grey square (he used powerpoint). This impressed me, because it highlighted the examples in a subtle and modest way. Now, I would like to know if anyone is able to change the \begin{exe}-\ex-\end{exe}-environment in such a way?

Note: I suppose that there is a local way to solve the problem and probably I would be able to do so myself. However, I am looking for a global solution.

  • You mean a filled grey square or a contour like a box?
    – Alenanno
    Jul 1, 2015 at 9:30
  • I mean a filled grey square (I added this point in the question)
    – Philip
    Jul 1, 2015 at 9:33

1 Answer 1


You can use the mdframed package to enhance the exe enviornment via e.g.


There are many options and styles that may be applied, see the mdframed documentation.

Sample output





  \ex\label{here} Here is one.
  \ex[*]{Here another is.}
  \ex Here are some with judgements.
    \ex[]{A grammatical sentence am I.}
    \ex[*]{An ungrammatical sentence is you.}
    \ex[??]{A dubious sentence is she.}
      \ex[**]{Need one a second embedding?}
    \ex Dare to judge me!
  \ex This concludes our demonstration.

  • When I try to compile it, it does not work. There is no output at all. I use OS X 10.6.6 and TexShop. Do you have an idea what could be the problem?
    – Philip
    Jul 2, 2015 at 7:05
  • What version of the files do you have? Add \listfiles to your source and look at the information in the log file. Jul 2, 2015 at 9:24
  • In my log file I found this "</usr/local/texlive/2013/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb><". In the console I found this: "This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)". Is that an appropriate answer to your question?
    – Philip
    Jul 2, 2015 at 12:32
  • No it is not the same information. That is just fonts being loaded and the format version. My compliation is on a texlive 2015 with mdframed version 2013/07/01 1.9b Jul 2, 2015 at 13:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .