8

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?

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

1 Answer 1

5

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]
\includegraphics{fig2}
\caption{Figure \protect\ref{fig:one}...}
\label{fig:two}
\end{figure}

You must log in to answer this question.

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