LTXtable 和 endfloat / processdelayedfloat 的问题

LTXtable 和 endfloat / processdelayedfloat 的问题

我需要将所有表格和图形放在文档末尾。借助该enfloat包,我成功地将大多数表格放在了末尾。但是,我有一张很长的表格,只有通过该ltxtable包将其包含进去,它才对我有用。问题是我的 LTXtable 不会像所有其他表格一样浮动到文档末尾。我考虑过定义一个新的浮动环境,但不知道如何做。

我感谢任何建议!

我在下面放了一个最小的例子(我希望它适合目的):

\documentclass[12pt, a4paper, notitlepage]{article}
\usepackage{indentfirst}
\usepackage{amsmath}
\usepackage{epsfig}
\usepackage{graphicx}
\usepackage{ragged2e,array,longtable, afterpage}
\usepackage{lscape,booktabs}
\usepackage{tabu}
\usepackage{ltxtable}
\usepackage{pdflscape}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}  % use utf8 for all files
\usepackage[english]{babel}
\usepackage[capposition=top]{floatrow} %footnotes for figures
\usepackage[nolists]{endfloat} % place figures at the end 
\usepackage{setspace}

\usepackage{lipsum}

\begin{document}

\section{Section}

\lipsum[1-2]

\begin{table}
\caption{table 2}
bla bla
\end{table}

\lipsum[1-2]

\begin{landscape}
    \begin{spacing}{1}
        \LTXtable{\linewidth}{table 2}
    \end{spacing}
\end{landscape}

\lipsum[1-2]

\clearpage

\section{Print all tables here}

\processdelayedfloats
\makeatletter
\efloat@restorefloats
\makeatother

\end{document}

这是我保存在文件“表 2”中的 LTXtable:

\begin{longtable}[t!hbp]{x c c}}
    \caption{Table 2}\label{Tab: 2} \\ \toprule
    A very very long table
\end{longtable}   

答案1

您可以尝试这样的操作:

\documentclass[12pt, a4paper, notitlepage]{article}
\usepackage{indentfirst}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{ragged2e,array,longtable, afterpage}
\usepackage{booktabs}
\usepackage{tabu}
\usepackage{ltxtable}
\usepackage{pdflscape}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}  % use utf8 for all files
\usepackage[english]{babel}
\usepackage[capposition=top]{floatrow} %footnotes for figures
\usepackage[nolists]{endfloat} % place figures at the end
\newenvironment{mylongtable}{}{}
\DeclareDelayedFloatFlavour*{mylongtable}{table}
\usepackage{setspace}

\usepackage{lipsum}

\begin{document}

\section{Section}

\lipsum[1-2]

\begin{table}
\caption{table 2}
bla bla
\end{table}

\lipsum[1-2]
\begin{mylongtable}
\begin{landscape}
    \begin{spacing}{1}
    blblblblb    % \LTXtable{\linewidth}{table 2}
    \end{spacing}
\end{landscape}
\end{mylongtable}
\lipsum[1-2]

\clearpage

\section{Print all tables here}

\processdelayedfloats
\makeatletter
\efloat@restorefloats
\makeatother

\end{document}

相关内容