I'm struggling with \usepackage{endfloat}
, \documentclass[12pt]{elsarticle}
, and the appendix.
What I want:
I want the main text, followed by tables and figures inserted/cited in the main text (floated to the end of the main document only), and then I want the appendix with its tables exactly where specified. I want the main text tables to be numbered 1, 2, …, T. I want the appendix tables to be numbered A1, A2, …, A.
I'd also like the main document through the end floated tables to be numbered 1, 2, …, P. Then I want the appendix to start over with roman numerals.
Here's what I tried:
\documentclass[12pt]{elsarticle}
\usepackage[notablist]{endfloat}
\usepackage{threeparttable}
\usepackage[toc,page]{appendix}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{}
\chead{}
\fancyfoot[C]{}
\rhead{My short title \thepage}
\renewcommand{\headrulewidth}{0pt}
% get rid of footer included in elsarticle
\makeatletter
\def\ps@pprintTitle{%
\let\@oddhead\@empty
\let\@evenhead\@empty
\def\@oddfoot{}%
\let\@evenfoot\@oddfoot}
\makeatother
% appendix page numbering
\let\origappendix\appendix % save the existing appendix command
\renewcommand\appendix{\clearpage\pagenumbering{roman}\origappendix}
\begin{document}\thispagestyle{empty}
\begin{frontmatter}
\title{My long title}
\author[add1]{Me\corref{cor1}}
\ead{me@email.com}
\author[add1]{You}
\ead{you@email.com}
\cortext[cor1]{Please address correspondence to me}
\address[add1]{Address}
\begin{abstract}
Abstract
\end{abstract}
\begin{keyword}
Keywords
\end{keyword}
\end{frontmatter}
My text page 1
\newpage
My text page 2 and Table \ref{tab}.
\newpage
My page 3
\newpage
\begin{table}
\centerline{\begin{threeparttable}
\caption{My table}
\label{tab}
\centering
\begin{tabular}{lrr}
\toprule
Col1 & Col2 & Col3 \\
\midrule
1 & 2 & 3 \\
4 & 5 & 6 \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\small
\item My note
\end{tablenotes}
\end{threeparttable}}
\end{table}
\thispagestyle{plain}
\makeatletter
\efloat@restorefloats
\makeatother
\setcounter{figure}{0} % Start again
\renewcommand\thefigure{\arabic{figure}}
\setcounter{table}{0} % Start again
\renewcommand\thefigure{\arabic{table}}
\appendix
My appendix and Table \ref{apptab}. I want the appendix to appear after Table \ref{tab} which should be floated to the end of the main document.
In other words, I want the main text, followed by tables and figures inserted in the main text (floated to the end), and then I want the appendix with its tables exactly where specified.
\begin{table}[H]
\centerline{\begin{threeparttable}
\caption{Table should be in appendix}
\label{apptab}
\centering
\begin{tabular}{lrr}
\toprule
Col1 & Col2 & Col3 \\
\midrule
7 & 8 & 9 \\
10 & 11 & 12 \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\small
\item My note
\end{tablenotes}
\end{threeparttable}}
\end{table}
\end{document}
Best Answer
From @wasteofspace:
This worked for me.