5

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}

1 Answer 1

6

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 @
4
  • 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
    Commented Jan 9, 2012 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
    Commented Jan 17, 2012 at 8:14
  • Kevin, I think notes below the table are fantastic. Thanks again!
    – Roberto
    Commented Jan 17, 2012 at 16:26
  • @godbyk: Please see tex.stackexchange.com/questions/57396/… Commented May 26, 2012 at 9:21

You must log in to answer this question.

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