# gb4e: Highlighting examples

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? Jul 1 '15 at 9:30
• I mean a filled grey square (I added this point in the question) Jul 1 '15 at 9:33

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

\surroundwithmdframed[backgroundcolor=gray!20]{exe}


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

\documentclass{article}

\usepackage{xcolor,mdframed,gb4e}

\surroundwithmdframed[backgroundcolor=gray!20]{exe}

\begin{document}

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

\end{document}

• 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? Jul 2 '15 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 '15 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? Jul 2 '15 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 '15 at 13:58