Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem using endfloat with an elsarticle with an appendix

2,038 views
Skip to first unread message

Digby Symons

unread,
Dec 6, 2011, 10:21:55 AM12/6/11
to
I am using \documentclass[authoryear,preprint,review,12pt]{elsarticle}
and have been told to put all my figures and tables at the end of my
manuscript.
So I have used \usepackage{endfloat}
which does this for me.

However, my article has an \appendix and now all my figure and table
captions are given as Figure A.1, Figure A.2 etc. even though they are
not referenced from the Appendix.

How do I fix this?!
Thanks,

Digby Symons

Marc van Dongen

unread,
Dec 6, 2011, 10:49:14 AM12/6/11
to
To me it makes sense that the figures have these numbers because it's
not where the figure is referenced but where it's placed what
determines
the numbers of the figures. For example, if you reference a figure
that's
placed in chapter 1 in chapter 2 in a book, and if the number is of
the form <chapter>.<number> then you'd expect something like
1.<number>.
If this wasn't true, then how could you _find_ the figure?

Have you tried using the afterpage package?

Regards,


Marc van Dongen

Robin Fairbairns

unread,
Dec 6, 2011, 3:02:48 PM12/6/11
to
the one time i've had to accomodate this odd requirement, it was because
of a shambolic publisher who wanted to set the pictures separately and
then (physically) glue them where they "would" have been. thus the
original location contains <space for figure> and <caption>, while the
trailing pages contains a sequence of labelled figures, the labels
matching the captions in the first part of the document.

now, _i_ thought i had recommended endfloat in that context, and the
user was happy (i.e., didn't tell me otherwise)..

so, either my memory's at fault, or endfloat has changed.

> Have you tried using the afterpage package?

why would he do that?
--
Robin Fairbairns, Cambridge
my address is @cl.cam.ac.uk, regardless of the header. sorry about that.

Marc van Dongen

unread,
Dec 7, 2011, 4:01:54 AM12/7/11
to
I don't use the package myself, but when I read the UK TeX FAQ pages
about [ floating environments and stuff ], I thought that the package
was useful. The following paragraph is from the first page of the
documentation:

Sometimes LATEX’s float positioning mechanism gets overloaded, and
all
floating figures and tables drift to the end of the document. One
may
flush out all the unprocessed floats by issuing a \clearpage
command, but
this has the effect of making the current page end prematurely. Now
you
can issue \afterpage{\clearpage} and the current page will be filled
up
with text as usual, but then a \clearpage command will flush out all
the
floats before the next text page begins.

So, by putting an \afterpage{\clearpage} command at a suitable
position
before the appendices you can flush the pending floats gracefully, as
opposed to using [H] or [h], which I never encourage. This may not be
an
ideal solution but there are cases where this may help.

For example, the following effectively forces the figure to a
reasonable
position before the end of the next page:

\documentclass{article}
\usepackage{afterpage}
\usepackage{lipsum}
\newcommand\lipsumfigure[2][tbph]{%
\begin{figure}[#1]
\rule{\textwidth}{1pt}
\lipsum[#2]
\caption{Yet another figure.}
\rule{\textwidth}{1pt}
\end{figure}
}

\begin{document}
\lipsum[1]
%\lipsumfigure[tbph]{3-4}
%\clearpage
\lipsumfigure[tbph]{3-4}
\afterpage{\clearpage}
\lipsum[5-9]
\end{document}

If you comment out the two lines after the comments and uncomment
the first two commented lines then the result is much less
satisfactory. (And yes, I know that there's no need for the
[tbph] but I always put them in for clarity.:-)

Regards,


Marc van Dongen

axel.som...@googlemail.com

unread,
Dec 14, 2011, 6:57:10 AM12/14/11
to
On 6 Dez., 16:21, Digby Symons <dd...@hermes.cam.ac.uk> wrote:
> However, my article has an \appendix and now all my figure and table
> captions are given as Figure A.1, Figure A.2 etc. even though they are
> not referenced from the Appendix.
>
> How do I fix this?!

Either redefine \thefigure after \appendix, or save \thefigure before
and restore it after \appendix, e.g.:

\let\thefigureSAVED\thefigure
\appendix
\let\thefigure\thefigureSAVED

Axel

fre...@gmail.com

unread,
Dec 29, 2012, 11:09:05 PM12/29/12
to
This is useful.

If there is a figure in the appendix, the figure number will be the same as normal sections, which is also incorrect.

How to handle this case?

Axel Berger

unread,
Dec 30, 2012, 7:05:46 AM12/30/12
to
fre...@gmail.com wrote:
> How to handle this case?

I often use an appendix of colour figures and write:

\addtocontents{lof}{\protect\section*{Tafeln im Anhang}}
\addtokomafont{caption}{\small}
\captionsetup{font={sf,bf,small},textfont={md,rm},
singlelinecheck=false,justification=raggedright,
indention=2em}
\renewcommand*{\figurename}{Tafel}
\setcounter{figure}{0}
\include{Kap/Tafeln}

Perhaps you can adapt some of that.

Nino Hardt

unread,
Mar 2, 2021, 7:19:44 AM3/2/21
to
I have the exact same problem, so many years later. WTH

David Dalton

unread,
Mar 2, 2021, 9:04:29 PM3/2/21
to
On Mar 2, 2021, Nino Hardt wrote
(in article<38ee8877-72c3-45d3...@googlegroups.com>):

> I have the exact same problem, so many years later. WTH

The original article is no longer on my newsserver,
though perhaps it is on google groups.

So if you want many to be able to address the problem
you should quote some or all of the original article.

--
David Dalton dal...@nfld.com http://www.nfld.com/~dalton (home page)
http://www.nfld.com/~dalton/dtales.html Salmon on the Thorns (mystic page)
"I will stare at the sun until its light doesn’t blind me
I will walk into the fire until its heat doesn’t burn me" (S. McLachlan)

0 new messages