TransWikia.com

Combining the Endfloat package and an appendix with different figure numbering

TeX - LaTeX Asked by geolguy on March 30, 2021

I’ve been struggling with this issue a while, and I’ve looked at several other related questions on here to no avail.

I’m submitting an article to a journal using the elsarticle class file, and figures, tables, figure/table lists must be provided at the end of the text. Normally the endfloat package would be perfect for this, however I have an appendices environment at the end, including figures labelled A.1, A.2, etc. When I use endfloat, the A. prefix to the appendix figures is removed and they are relabelled to follow the figure list in the main text.

Essentially I need endfloat to behave as normal, but to list the appendix figures with my preferred figure numbers/letters rather than tacking them on as Fig. 13, 14 etc. Is this doable?

Basic working example below, with endfloat enabled and causing trouble:

documentclass[authoryear,review]{elsarticle}

usepackage[titletoc]{appendix}
usepackage{lipsum}
usepackage{array}
usepackage{booktabs}
usepackage[nomarkers]{endfloat}
    DeclareDelayedFloatFlavor{sidewaystable}{table}

newcolumntype{C}{ >{centeringarraybackslash} m{1cm} }

begin{document}

LipsumPar{1}

begin{figure}[ht]
centering
A FIGURE
caption{First  figure}
end{figure}

LipsumPar{2}

begin{figure}[ht]
centering
ANOTHER FIGURE
caption{Second figure}
end{figure}

begin{table}[ht]
centering
begin{tabular}{CCCCCCC} toprule
1&2&3&4&5&6&7  bottomrule
end{tabular}
caption{A table}
label{table}
end{table}

clearpage
begin{appendices}
renewcommand{thefigure}{Aarabic{figure}}
setcounter{figure}{0}

appendixpage

section{Appendix A}
label{Appendix A}

begin{figure}[ht]
centering
APPENDIX FIGURE
caption{Appendix figure 1}
end{figure}

begin{figure}[ht]
centering
ANOTHER APPENDIX FIGURE
caption{Appendix figure 2}
end{figure}

end{appendices}

end{document}

2 Answers

One can use addtodelayedfloat{figure}{...} to add commands to the fff file before the next figure.

documentclass[authoryear,review]{elsarticle}

usepackage[titletoc]{appendix}
usepackage{lipsum}
usepackage{array}
usepackage{booktabs}
usepackage[nomarkers]{endfloat}
    DeclareDelayedFloatFlavor{sidewaystable}{table}

newcolumntype{C}{ >{centeringarraybackslash} m{1cm} }

begin{document}

LipsumPar{1}

begin{figure}[ht]
centering
A FIGURE
caption{First  figure}
end{figure}

LipsumPar{2}

begin{figure}[ht]
centering
ANOTHER FIGURE
caption{Second figure}
end{figure}

begin{table}[ht]
centering
begin{tabular}{CCCCCCC} toprule
1&2&3&4&5&6&7  bottomrule
end{tabular}
caption{A table}
label{table}
end{table}

clearpage
begin{appendices}
addtodelayedfloat{figure}{renewcommand{thefigure}{Aarabic{figure}}%
  setcounter{figure}{0}}%

appendixpage

section{Appendix A}
label{Appendix A}

begin{figure}[ht]
centering
APPENDIX FIGURE
caption{Appendix figure 1}
end{figure}

begin{figure}[ht]
centering
ANOTHER APPENDIX FIGURE
caption{Appendix figure 2}
end{figure}

end{appendices}

end{document}

Correct answer by John Kormylo on March 30, 2021

The suggest solution works only when there are no markers. However, if you activate markers, they say [Insert figure 3 about here] instead of [insert figure A1 about here]

Answered by Inferrator on March 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP