Graphics, Figures & TablesEndfloat problem

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
PvandenAkker
Posts: 1
Joined: Thu Nov 18, 2010 3:12 pm

Endfloat problem

Post by PvandenAkker »

I want to put my figures at the end of the document, and the captions separately in a list. Exactly what the endfloat package promises to do.
But when I try to remove the captions from below the figures, in the way the endfloat package advises, I get an error.
Minimal example:

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\usepackage{endfloat}
\renewcommand{\@makecaption}[2]{\vskip\abovecaptionskip \hbox to \hsize{\hfil #1\hfil} \vskip\belowcaptionskip}
\begin{document}
\begin{figure}
\includegraphics{figure1}
\caption{Test caption}
\end{figure}
\end{document}
Error:
! LaTeX Error: Missing \begin{document}
It looks like it is the same error as reported on http://www.latex-community.org/index.ph ... Itemid=112 by Albart Coster, but it was not solved there.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Endfloat problem

Post by sommerfee »

Use \makeatletter...\makeatother to (re)define macros with a @ in it:

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\usepackage{endfloat}
\makeatletter
\renewcommand{\@makecaption}[2]{\vskip\abovecaptionskip \hbox to \hsize{\hfil #1\hfil} \vskip\belowcaptionskip}
\makeatother
\begin{document}
\begin{figure}
\includegraphics{figure1}
\caption{Test caption}
\end{figure}
\end{document}
Post Reply