8

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?

6
  • You have placed \label{fig:ushaped} inside \caption command. Try bringing that out. Also, 10pt is not a valid option in tufte
    – hpesoj626
    Commented Dec 17, 2012 at 14:57
  • Also, use width of your graphics to less than or equal to \textwidth
    – hpesoj626
    Commented Dec 17, 2012 at 15:00
  • When I put the label out, the \ref command fails and only a ?? is displayed instead of the figure number Commented Dec 17, 2012 at 15:03
  • Try compiling twice :)
    – hpesoj626
    Commented Dec 17, 2012 at 15:09
  • duplicate (?) tex.stackexchange.com/questions/85816/…
    – cmhughes
    Commented Dec 17, 2012 at 18:56

1 Answer 1

7

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

2
  • Thanks, it worked. Is this incompatibility new? The original file compiles perfectly in another computer were I didn't updated my linux distro. Commented Dec 17, 2012 at 15:14
  • @RafaelS.Calsaverini I don't know, since I'm not a tufte-book user; but the error you get seems due to interaction between tufte-book and caption. Actually, it works if you move the \label command outside \caption (which is the way I prefer, anyway). However, I would be cautious in loading caption with tufte-book.
    – egreg
    Commented Dec 17, 2012 at 15:19

You must log in to answer this question.

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