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.

When using ctable with the tufte-latex class (in xelatex), I get an error when defining a caption (and hence a label).

! Undefined control sequence. \@tufte@stored@caption ->\@ctblcaptionarg**

Anybody knows a way to correctly place a caption and a label, maybe using the doinside option of ctable? It's not possible to enclose ctable in another float.

Here's a small example:

\documentclass[nols,nofonts]{tufte-handout}

\usepackage{textcomp}
\usepackage{fontspec}

\usepackage{ctable}
\usepackage{pdflscape}



\begin{document}

\ctable[pos = Htbp, 
    left,
    caption = thisisacaption,
    label = thisisalabel
    ]{lrcr}
{% notes
}
{% rows
\FL
\parbox[b]{0.41\columnwidth}{\raggedright
\emph{This}
} & \parbox[b]{0.20\columnwidth}{\raggedleft
\emph{Is}
} & \parbox[b]{0.20\columnwidth}{\centering
\emph{An}
} & \parbox[b]{0.18\columnwidth}{\raggedleft
\emph{Example}
}
\LL
}

\end{document}
share|improve this question
add comment

1 Answer 1

If you'd like to use the ctable-style captions (as opposed to the Tufte-style captions), then you can add the following block of code to the preamble of your document (just prior to the \begin{document} line):

% Disable Tufte-style captions for ctables
\makeatletter % allows @ in macro names
\def\@ctblCaption{
   \ifx\@ctblcap\undefined\let\@ctblcap\@ctblcaption\fi
   \ifx\@ctblcaption\empty\else
      \gdef\@ctblcaptionarg{\ifx\@ctbllabel\empty\else\label{\@ctbllabel}\fi
         \@ctblcaption\ \@ctblcontinued\strut}
      \ifx\@ctblcap\empty
         \caption[]{\@ctblcaptionarg}
      \else
         \caption[\@ctblcap]{\@ctblcaptionarg}
      \fi
   \fi
}
\makeatother % restores original meaning of @
share|improve this answer
    
Kevin, fantastic, thank you so much. It'd be great if you could write also how to use the Tufte-style captions, but this solves it more than acceptably. Thanks again. –  Roberto Jan 9 '12 at 5:30
    
@Roberto: I've updated the code to use Tufte-style captions. Should the table notes appear below the table (as they currently do) or as part of the caption or a separate sidenote? –  godbyk Jan 17 '12 at 8:14
    
Kevin, I think notes below the table are fantastic. Thanks again! –  Roberto Jan 17 '12 at 16:26
    
@godbyk: Please see tex.stackexchange.com/questions/57396/… –  Marco Daniel May 26 '12 at 9:21
add comment

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.