# Re: [NTG-context] place figures at the end of document

On Fri, 18 Jan 2008 17:36:26 +0100
"Peter I. Hansen" <[EMAIL PROTECTED]> wrote:

> Hi,
>
> Is there a way in ConTeXt to place figures (and other floats) at the
> very end of the document?
>
> More specifically I would like to keep on having to placefigure code
> at the relevant place in the text where I would normally typeset with
> the option [here], but sometimes readers want all figures moved to the
> end of the document and it would be handy if this could be done by
> changing a keyword.
>
> thanks, Peter

Interesting but very hard topic, I found a solution but it did only
work for a few pictures.

\unprotect

\installfloathandler {save} \somesavefloat

\def\placesomesavefloat{\OTRcommand\somesavefloat}

%\def\somesavefloat[#1]{\dosavefloat}
\def\somesavefloat{\placesomesavefloat}

\def\somesavefloat[#1]%
{\global\setbox\floatlist\vbox
{\nointerlineskip
\unvbox\floatlist
\uncenteredfloatbox}}

%\def\OTRONEsomesavefloat[#1]{\savefloat}
\def\OTRONEsomesavefloat[#1]{\setbox\floatbox\vbox{\box\floatbox}}

\def\placesavedfloats{\box\floatlist}

%\def\placesavedfloats
%  {\loop\ifdim\ht\floatlist>0pt
%     \vsplit\floatlist to\lineheight
%   \repeat}

\protect

\starttext

\dorecurse{4} % 5 and more did fail
{\input knuth\par
\expanded{\placefigure[save]{Figure
\recurselevel}{\blackrule[width=6cm,height=4cm]}}}

\page

\placesavedfloats

\stoptext

Wolfgang
___________________________________________________________________________________