# Hyperref problem with mdframed+pdflatex

I'm encountering a problem when I use hyperref with mdframed and pdflatex. Below is a MWE which gives the following error:

! Missing \endcsname inserted.
\bx@A
l.29    \end{defini}

If I don't use hyperref, the problem goes away; however, with a 100+ page document, having a hyperlinked table of contents is essentially a requirement. Here's the MWE:

\documentclass[11pt]{memoir}

\usepackage{lipsum}

\usepackage{mdframed}
\RequirePackage{ltxkeys}   %%% Different error if not there
\usepackage{xcolor}

\mdfdefinestyle{DefinitionStyle}{innertopmargin=5pt,linewidth=4pt,linecolor=red,backgroundcolor=blue!3}
\newcounter{definitioncount}[section]

\newenvironment{defini}{\refstepcounter{definitioncount} \begin{mdframed}[style=DefinitionStyle]%
\raisebox{4pt}[0pt][-5pt]{\hspace{-14pt}\fcolorbox{red}{red}%
{\bfseries \large\textcolor{white}{$\quad$Definition \thedefinitioncount $\quad$}}}\\}%
{\end{mdframed}}

\usepackage{hyperref}

\begin{document}

\chapter{Introduction}
\lipsum[2]
\lipsum[1]

\begin{defini}
\lipsum[1]
\end{defini}

\end{document}
-
Your code works OK in my system (TeX Live2012). Are you using an updated system? –  Gonzalo Medina Aug 28 '12 at 14:18
It worked! I had installed TeX on my new computer less than a month ago. I never suspected that I needed to update it, which I did using tlmgr. Could you write your comment as an answer so I can properly acknowledge it. –  André Aug 28 '12 at 14:49
Heiko has provided an informed answer, so you can acknowledge him ;-) –  Gonzalo Medina Aug 28 '12 at 16:06