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.

It seems that endfloat and ctable are incompatible:

\documentclass[a4paper]{article}
\usepackage{endfloat}
\usepackage{ctable}
\begin{document}

\ctable[caption = Queries available, pos = H, center, botcap]{ll}
{% notes
}
{% rows
\FL
search ``by='' & purpose
\ML
abstract & search terms in the publication abstract
\\\noalign{\medskip}
author & match authors in the publication
\\\noalign{\medskip}
id.taxon & Taxon identifier number from TreeBase
\\\noalign{\medskip}
tree & The title for the tree
\LL
}

Gives the error:

! Undefined control sequence.
\\  ->\let \reserved@e 
                       \relax \let \reserved@f \relax \@ifstar {\let \reserv...
l.21 }

Is there any way to work around this problem? Either

  1. an alternative to endfloat that works for ctable,
  2. or at least a way to make endfloat ignore the ctable instead of error?

Edit:

I'm looking for a solution that still uses ctable for the table. Ideally some option that I can set in the preamble to resolve the conflict, or create endfloat-style behavior without the endfloat package? (Editing the table itself isn't in the spirit of the endfloat package, since I could equally well move the table to the end manually, but that is not a good programmatic solution to apply over many documents.)

share|improve this question
    
8.1 of endfloat docs says: "as stated in sec 10.3, endfloat will utterly fail if one does something like \newenvironment{foo}{...\begin{table}...}{...\end{table}...}; there's a command \DeclareDelayedFloatFlavor ...; ctable does exactly that embedding game, so \DeclareDelayedFloatFlavor{ctable}{table} may solve your problem. –  wasteofspace Jun 27 '12 at 9:56
    
hmm, thanks for the hint... I tried adding \DeclareDelayedFloatFlavor{ctable}{table} to the preamble, which results in a different error: Runaway argument? ! File ended while scanning use of \efloat@xfloat. –  cboettig Jun 28 '12 at 0:06
add comment

1 Answer

up vote 4 down vote accepted

I don't know about alternatives to endfloat, but there's a pretty good alternative to ctable: the "regular" table and tabular environments, combined with the commands of the booktabs package. (Replace the \FL, \ML, and \LL macros with \toprule, \midrule, and \bottomrule, and you're mostly done converting the ctable. The similarity between the types of horizontal lines is of course anything but coincidental, given that ctable uses the bookstabs package internally.)

The following MWE produces a table that looks pretty much like the one your code produces, while being fully compatible with endfloat:

\documentclass[a4paper]{article}
\usepackage{endfloat,booktabs}
\begin{document}

\begin{table}
\renewcommand{\arraystretch}{1.35} % vary this to suit your needs
\centering
\begin{tabular}{ll}
\toprule
search ``by='' & purpose\\
\midrule
abstract & search terms in the publication abstract\\
author   & match authors in the publication\\
id.taxon & Taxon identifier number from TreeBase\\
tree     & The title for the tree\\
\bottomrule
\end{tabular}
\caption{Queries available}
\end{table}
\end{document}
share|improve this answer
1  
I'm only using ctable because it is the only option provided by pandoc. Sadly not a viable solution for this particular project. –  cboettig Jun 27 '12 at 22:17
    
Just to be clear -- Pandoc generates LaTeX code from other input sources; a markdown table in my case, but for some reason I do not understand chooses to use the ctable environment rather then the standard table environment. As such, I'm looking for a programmatic solution that can be accomplished by changing the preamble text, rather than changing the content of the ctable table itself. My apologies for not stating this in the original question. –  cboettig Jun 28 '12 at 0:10
1  
@cboettig -- Thanks for providing these additional explanations. I must confess I don't understand the innnards of the ctable package enough to provide additional suggestions on how you might be able to get it to work with endfloat. Your best bet may be to send an email message to the author/maintainer of the ctable package and ask for help, suggestions, or (depending on the cause of the problems) a bug fix. –  Mico Jun 28 '12 at 11:05
    
Thanks for the help. Though this doesn't solve my particular use case, since I have to use ctable in this context, avoiding ctable when possible & writing to the package maintainers seems the best advice, so I accept the answer. –  cboettig Aug 4 '12 at 22:47
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.