3

I was trying to highlight some text as shown in this post, but I'm having problems. the following works for me

\documentclass{article}

\usepackage{xcolor}
\usepackage{mdframed}
\usepackage{lipsum}

\begin{document}
\begin{mdframed}[backgroundcolor=gray!20, linecolor=white]
\lipsum[1]
\end{mdframed}
\end{document}

but when I try to use his exact same code

\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}

I get an error "Undefined control sequence. l.10 \newmdtheoremenv".Do you know what could be the problem? I'm kind of new with latex and I have no clue.

  • 4
    Your code runs fine for me. May be it is time to update your tex distro! :-) – user11232 Oct 28 '12 at 23:07
  • 1
    Yes, you need at least a 2011 distribution. I can reproduce your problem with TeXLive 2010, but works fine with TeXLive 2011, and TeXLive 2012. – Peter Grill Oct 29 '12 at 0:17
  • 1
  • I think I had the 2011 distribution, but anyway, I updated it and it worked now. Thank you. – German Oct 29 '12 at 20:48