如何使 endfloats 和附录表格编号协同工作

如何使 endfloats 和附录表格编号协同工作

我正在尝试让 LaTeX 做两件事,这两件事可以独立工作,但不能一起完成。

我想要的结果是正文后跟参考书目和所有正常编号的表格和图形,后跟一些附录、附录参考书目以及所有附录图形和表格,编号为 A.1 A.2 等。并且它可以工作,只是在附录中 [此处的图 A.2] 的标记按与正文相同的顺序编号。例如这里 在此处输入图片描述

\documentclass[a4paper,11pt]{article}%\usepackage[landscape]{geometry}

\usepackage{rotating}

% \usepackage{beamerthemesplit} // Activate for custom appearance
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage [autostyle, english = american]{csquotes}
\usepackage{amsthm}
\usepackage{float}
\usepackage[modulo]{lineno}
\usepackage{subfig}
\newtheorem{proposition}{Proposition}
\usepackage{float}
\usepackage{placeins}
\usepackage{lscape}
\usepackage{gensymb}
\usepackage[top=1.5in, bottom=1.5in, left=1.1in, right=1.1in]{geometry}
\usepackage{multibib}

\newcites{SM}{Appendix References}
%\renewcommand{\efloatseparator}{\mbox{}}
%\usepackage{a4wide}
\usepackage{hyperref}
\usepackage{setspace}
\usepackage{epigraph}
%\bibliographystyle{ieeetr}
\usepackage[font=small,labelfont=bf]{caption}
%\usepackage[french]{babel}
\usepackage{natbib}
\usepackage[nolists]{endfloat}
\usepackage{marvosym}
\linenumbers
\usepackage{pbox}


\usepackage[toc, title]{appendix}

\title{The Ant and the Grasshopper: \\ Seasonality and the Invention of Agriculture}
\author{
\\ Author
} 


\date{\today}
\vspace{1cm}


\begin{document}


Table \ref{Table1}  does just fine

 \begin{table}[H] 
 \hspace*{-1.5cm}
\centering
 \scalebox{0.70}{%
    \renewenvironment{table}[1][]{\ignorespaces}{\unskip}%
     \begin{tabular}{c c}
    2 & 2
    \end{tabular}
    \unskip
}
\caption{This table is fine in all respects }\label{Table1} 
\end{table}


\newpage

\bibliographystyle{ecta}

\bibliography{naturebib} 

 \processdelayedfloats 

\appendix

\setcounter{table}{0}
\renewcommand{\thetable}{A\arabic{table}}
 \setcounter{figure}{0}
\renewcommand{\thefigure}{A\arabic{figure}}




\renewcommand{\thesection}{\Alph{section}}

\section{Econometric robustness}
\addcontentsline{toc}{section}{Appendices}
%\renewcommand{\thesubsection}{\Alph{subsection}}

%\subsection{Econometric robustness}

\renewcommand{\thesubsection}{\Alph{section}.\arabic{subsection}}




\subsection{Appendix subsection}
Table \ref{DistanceDateAdop} should be the same in this sentence and for the marker below.


\begin{table}
\scalebox{0.75}{%
    \renewenvironment{table}[1][]{\ignorespaces}{\unskip}%
    \begin{tabular}{c c}
    2 & 2
    \end{tabular}
    \unskip}
\caption{This table is titled fine} \label{DistanceDateAdop} 
\end{table}





\end{document}

答案1

endfloat 引入了一个新的计数器,因此您需要重新定义它;参见\renewcommand{\theposttable}{A\arabic{posttable}}

\documentclass[a4paper,11pt]{article}%\usepackage[landscape]{geometry}

\usepackage{float}

\usepackage{epigraph}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage[nolists]{endfloat}


\usepackage[toc, title]{appendix}

\title{The Ant and the Grasshopper: \\ Seasonality and the Invention of Agriculture}
\author{
\\ Author
} 


\date{\today}
\vspace{1cm}


\begin{document}


Table \ref{Table1}  does just fine

 \begin{table}[H] 
t
\caption{This table is fine in all respects }\label{Table1} 
\end{table}


\newpage




\appendix

\setcounter{table}{0}
\renewcommand{\thetable}{A\arabic{table}}
\renewcommand{\theposttable}{A\arabic{posttable}}
 \setcounter{figure}{0}
\renewcommand{\thefigure}{A\arabic{figure}}



\renewcommand{\thesection}{\Alph{section}}

\section{Econometric robustness}
\addcontentsline{toc}{section}{Appendices}
%\renewcommand{\thesubsection}{\Alph{subsection}}

%\subsection{Econometric robustness}

\renewcommand{\thesubsection}{\Alph{section}.\arabic{subsection}}


\processdelayedfloats


\subsection{Appendix subsection}
Table \ref{DistanceDateAdop} should be the same in this sentence and for the marker below.


\begin{table}
t1a 
\caption{This table is titled fine \label{DistanceDateAdop} }
\end{table}






\end{document}

相关内容