1

I tried something like this: Move tables to appendix to move tables and figures to the appendix.

However, longtables remain before the appendix. I solved this, following the manual ftp://ftp.rrzn.uni-hannover.de/pub/mirror/tex-archive/macros/latex/contrib/endfloat/endfloat.pdf

But now, I always get an error, if I try to use options for end float, in my case [nomarkers,nolists].

Any idea on how to solve this?

Currently, I get errors with all order of packages.

\usepackage[nomarkers,nolists]{longtable,threeparttable,booktabs,endfloat}
\DeclareDelayedFloatFlavour*{longtable}{table}
    \DeclareDelayedFloatFlavour{threeparttable}{table}
        \DeclareDelayedFloatFlavour{booktabs}{table}

or

\usepackage[nomarkers,nolists]{endfloat,longtable,threeparttable,booktabs}
\usepackage[nomarkers,nolists]{longtable,endfloat,threeparttable,booktabs}

and so on.

I really would like to know what to do about this.

I did not provide an MWE, as the problem is basically the error message, that LaTeX thinks [nomarkers,nolists] is an option to anything else than end float!

  • 4
    How about putting that package in a usepackage of its own ? – Elad Den Nov 25 '16 at 15:03
  • @Elad Den if I do that, something wired happens: the long table is then the first table in the appendix (numbered 19), before table 1, 2, ... – user82729 Nov 25 '16 at 15:08
  • If you want to use options when loading multiple packages at once, the options have to apply to all of the packages you load. I don't believe there's any way around that – Au101 Nov 25 '16 at 15:09
  • 2
    If it makes a difference if you use \usepackage{abc,xy} or \usepackage{abc} \usepackage{xy}, then something strange is going on with your document, as they are identical. Please add a MWE. – user36296 Nov 25 '16 at 15:11
  • 4
    there is no difference in using all the packages in one \usepackage or using separate \usepackage so you can always separate them and add the options individually. Or you can add the option to \documentclass – David Carlisle Nov 25 '16 at 15:12
1

What happens is that the tables are written to a file, and then at the end this file is \input and processed normally. Now your tables are floating, but longtable is not floating. Because you have [tb] as position specifier on your tables, these float to the top or the bottom of the page, so they can move across the longtable. If you want to preserve the order you can \usepackage{float} and give your tables the [H] specifier. Then the order will be preserved.

And as others have observed, put the other packages out of the [nomarkers,nolists] options. And the line \DeclareDelayedFloatFlavour{booktabs}{table} does not make sense, as booktabs is not an environment.

Here is a complete example.

\documentclass{report}
\usepackage[nomarkers,nolists]{endfloat}
\renewcommand{\efloatseparator}{\mbox{}} % allows tables to share a page
\usepackage{longtable,threeparttable,booktabs,endfloat}
\DeclareDelayedFloatFlavour*{longtable}{table}
\DeclareDelayedFloatFlavour{threeparttable}{table}
\usepackage{float}

\begin{document}
\chapter{A chapter}

As shown in Tables~\ref{tab:one} and \ref{tab:another}, we have two variables.
\begin{table}[H]
\centering
\begin{tabular}{cc}
A & B \\
1 & 2 \\
3 & 4
\end{tabular}
\caption{\label{tab:one} A Table}
\end{table}

\begin{longtable}{cc}
long & table \\
5 & 6 \\
7 & 8 \\
\caption{\label{tab:another} A Long Table}
\end{longtable}

\begin{table}[H]
\centering
\begin{tabular}{cc}
C & D \\
5 & 6 \\
7 & 8
\end{tabular}
\caption{\label{tab:another} A Second Table}
\end{table}

\appendix
\chapter{An appendix}

\processdelayedfloats

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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