I am using catchfilebetweentags
to add figures to a document as described here. I get an error when additionally using the endfloat package. Here is an example:
Main file:
\documentclass[11pt]{article}
\usepackage{catchfilebetweentags}
\newcommand{\loadFigure}[1]{ % define command to load figures
\ExecuteMetaData[figures_file]{#1}
}
%\usepackage{endfloat} %un-comment to produce error
\begin{document}
Hello world\\
\loadFigure{fig:figure1}
\end{document}
Secondary/figures file (figures_file.tex):
%<*fig:figure1>
\begin{figure}[htpb!]
\caption{A figure}
\end{figure}
%</fig:figure1>
The error is produced by un-commenting \usepackage{endfloat}
. Error message:
! Undefined control sequence.
\GenericError ...
#4 \errhelp \@err@ ...
l.9 \loadFigure{fig:figure1}
I know this might seem like an odd thing to want to do, but I mostly want the figures at position in the text, but occasionally want them at the end (e.g. if en editor asks me to put them there).