# Error using \ref in captions with Tufte and Babel

I am using the tufte-book class. When referencing with \ref within a caption using the babel package I get two errors:

"Argument of \@iiminipage has an extra }." and "Paragraph ended before \@iiminipage was complete."

The error does not occur when using \autoref instead of \ref or when deactivating babel.

Code example:

\documentclass[a4paper,twoside,justified,symmetric,notoc]{tufte-book}
\usepackage[utf8]{inputenc}
\usepackage[ngerman,english]{babel}
\usepackage{graphicx}

\begin{document}

\begin{marginfigure}
\includegraphics{fig1}
\caption{xxx}
\label{fig:one}
\end{marginfigure}

\begin{figure*}[t]
\includegraphics{fig2}
\caption{Figure \ref{fig:one}...}
\label{fig:two}
\end{figure*}

\end{document}


How can I resolve this issue?

• I'm investigating, but if you don't use shorthands in \ref you can use the package option safe=bib or safe=none. – Javier Bezos Jul 30 '14 at 13:52

The problem seems to lie in the redefinition of \ifthenelse made by babel and interaction with tufte-common.def that (wrongly) loads hyperref before other user packages.
Apparently, using \protect\ref in the argument to \caption (although theoretically it shouldn't be necessary) fixes the issue.
\begin{figure}[t]