Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

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

1 Answer 1

up vote 7 down vote accepted

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

share|improve this answer
    
Thanks, it worked. Is this incompatibility new? The original file compiles perfectly in another computer were I didn't updated my linux distro. –  Rafael S. Calsaverini Dec 17 '12 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 Dec 17 '12 at 15:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.