place figures at the end of document
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
On Fri, 18 Jan 2008 17:36:26 +0100
"Peter I. Hansen"
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
Dear Peter, please be aware that I am still a ConTeXt newbie, therefore, I am not sure if this is really the way things "should" be done, only that it seems to work with up to a 999 figures (tested) and probably more ;-) Nonetheless, the following code probably does the trick you were looking for.... It has the further benefit that only those figures with the option [list] will go to the list and that you can do all the other tricks with this list of figures that you can do with any sort of list. Unfortunately you have to change all \placefigure to \PlaceFigure (or some other name of your choosing for this macro) Cheers Carsten %------ setting things up --------- \definesorting[Figure][Figures] \setupsorting[Figure][criterium=all] \newcounter\FigureCounter \def\PlaceFigure{\dodoubleempty\doPlaceFigure} \def\doPlaceFigure[#1][#2]#3#4{ \ifsecondargument \doifsamestringelse{#1}{list}{ \expanded{\Figure[\FigureCounter]{\noexpand\placefigure[#2]{#3} {{#4}} }} \increment\FigureCounter }{ \placefigure[#1][#2]{#3}{#4} } \else \placefigure[#2]{#3}{#4} \fi } %------ the actual "text" --------- \starttext \dorecurse{100}{ \PlaceFigure[here][fig:\recurselevel]{Blackbox in text at level \recurselevel}{\blackrule[width=6cm,height=4cm]} \input knuth\par \PlaceFigure[list][fig:\recurselevel]{Blackbox in list at level \recurselevel}{\blackrule[width=6cm,height=4cm]} } \page \placelistofFigures \stoptext On 18.01.2008 at 17:36 wrote Peter I. Hansen:
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 ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
participants (3)
-
Carsten Fechtmann
-
Peter I. Hansen
-
Wolfgang Schuster