2

Currently the floats in my appendix are repositioned to the end of the document as well. Is there a way to except them from endfloat?

2
  • If you run \processdelayedfloats, everything after is normal (IIRC). Another possibility would be to create a new environment. This will require some experiments. Dec 12, 2019 at 15:58
  • Thank you for the reply, I am running \processdelayedfloats before the appendix but it still moves my appendix floats to the back and creates a second list of figures etc.
    – FPisker
    Dec 12, 2019 at 16:17

2 Answers 2

2

This both uses \processdelayedfloats and creates a new environment. (It will work without \processdelayedfloats, but the figure counter will get messed up.)

\documentclass{article}
\usepackage{endfloat}

\makeatletter
\newenvironment{nodelay}[1][tp]{\@float{figure}[#1]}{\end@float}
\makeatother

\begin{document}
text 1

\begin{figure}
  \caption{endfloat test}
\end{figure}

text2

\processdelayedfloats

\begin{nodelay}[h]
  \caption{nodelay test}
\end{nodelay}

\end{document}
1
  • This works perfectly, thank you.
    – FPisker
    Dec 12, 2019 at 16:24
3

The endfloat package uses a macro called \efloat@restorefloats to restore the old definitions of all environments it has re-defined.

So using \csname efloat@restorefloats\endcsname (or \makeatletter\efloat@restorefloats\makeatother) right after \processdelayedfloats will do the job:

\documentclass{article}
\usepackage{endfloat}

\begin{document}

\section{Whatever}

\begin{figure}
\caption{Figure 1}
\end{figure}
\begin{table}
\caption{Table 1}
\end{table}

\processdelayedfloats
\csname efloat@restorefloats\endcsname

\section{Appendix}

\begin{figure}
\caption{Figure 2}
\end{figure}
\begin{table}
\caption{Table 2}
\end{table}

\end{document}

Drawback: This uses an internal command of the endfloat package. But since it is there for a very long time (the oldest version I could find on the net is v2.4 from 1995) it is highly unlikely that it will go away in the future.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .