[Tex/LaTex] Problem with tufte-book and subfigure

incompatibilitysubfloatstufte

I'm having a problem using both the tufte-book class and the subfigure package. This problem started after a fresh install of texlive, and I can't find a reason for it.

Consider the following document:

\documentclass[a4paper,10pt]{tufte-book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{subfigure}
\usepackage{graphicx}


%opening
\title{Test.}
\author{Myself}

\begin{document}
\maketitle
\section{adsf}
adsadfasdf
\begin{figure}
    \centering
    \includegraphics[width = 1.1\textwidth]{./path/to/figure}
    \caption{ \label{fig:ushaped} Ilustração da história da organização social dos humanos e primatas pré-humanos.}

\end{figure}

See figure \ref{fig:ushaped}.


\end{document}

If I set the class to article it works ok. If I set the class to tufte-book it gives the following errors:

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

I also notice that if I delete the \label{fig:ushaped} command, it works alright.

The problem is the same with the subfloats package.

I can't find the what's causing the problem. Anybody have an idea?

Best Answer

The problem is that subfig loads the caption package, which is incompatible with tufte-book. A solution is to load the subfig package (the successor to the obsolete subfigure) with the [caption=false] option.

\documentclass[a4paper]{tufte-book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[caption=false]{subfig}
\usepackage[demo]{graphicx}


%opening
\title{Test.}
\author{Myself}

\begin{document}
\maketitle
\section{adsf}
adsadfasdf
\begin{figure}
\centering
\subfloat[]{\includegraphics[width=3cm]{x}}\qquad
\subfloat[]{\includegraphics[width=3cm]{y}}

\includegraphics[width = 0.9\textwidth]{./path/to/figure}
\caption{Ilustração da história da organização social dos humanos
             e primatas pré-humanos.\label{fig:ushaped}}
\end{figure}

See figure \ref{fig:ushaped}.


\end{document}

The demo option for graphicx is just to produce mock figures.

enter image description here