I want to have a float (illustration for fiction, with caption) that takes up just one page, irrespective of the size of the image in the figure. This can be done with a \startmakeup, but makeup pages do not float, as near as I can tell; they interrupt the text (leaving a partly blank page); and of course they will not include headers and footers. And a float with [page] will start the figure on a new page as desired, but if the image is too small, other text will end up on the page, which is not the desired result. I want to vertically (and horizontally) center the figure on the page, with no other content but glue, in the main text block. Headers and footers should appear as normal. Is there a simple way to accomplish this? Mike
On Tuesday, March 29, 2022 4:18 AM Michael Urban via ntg-context wrote:
Is there a simple way to accomplish this?
I suppose you need 'postponing'. See https://wiki.contextgarden.net/Command/startpostponing [One can specify a page explicitly, or, more conveniently, an offset] First, we define a makeup and enable header, footer and page for it. Then we can put the float inside the makeup and wrap it with \start...\stoppostponing. Here is a MWE: %%% start example \setupexternalfigures[location=default] \definemakeup [FloatPage] \setupmakeup [FloatPage] [headerstate=normal, pagestate=start, align=middle, footerstate=normal] \setupheadertexts[] \setupheadertexts[chapter][\date] \setupfootertexts[pagenumber] \starttext \startchapter [title={Chapter title}] \startpostponing[+1] \startFloatPagemakeup \placefigure{a floating cow}{\externalfigure[cow]} \stopFloatPagemakeup \stoppostponing \dorecurse{6}{\samplefile{knuth}} \blank \dorecurse{2}{\samplefile{tufte}} \stopchapter \stoptext %%% stop example Of course, I think some manual hand-tuning is required (in the final stages of the document) in deciding the right place to put the postponing block and in deciding what offset is best. Sreeram
Almost there. But if I add \setuppagenumbering [alternative=doublesided] to the example, there is a blank page before the makeup page, and an unnumbered blank page after. If I add doublesided=no to the \setupmakeup options, the unnumbered blank page is not there, but there is still a blank page before. It is seemingly forcing a right-hand page for some reason I do not understand. Mike
On Mar 28, 2022, at 6:37 PM, śrīrāma via ntg-context
wrote: On Tuesday, March 29, 2022 4:18 AM Michael Urban via ntg-context wrote:
Is there a simple way to accomplish this?
I suppose you need 'postponing'. See https://wiki.contextgarden.net/Command/startpostponing [One can specify a page explicitly, or, more conveniently, an offset]
First, we define a makeup and enable header, footer and page for it. Then we can put the float inside the makeup and wrap it with \start...\stoppostponing. Here is a MWE:
%%% start example \setupexternalfigures[location=default] \definemakeup [FloatPage] \setupmakeup [FloatPage] [headerstate=normal, pagestate=start, align=middle, footerstate=normal]
\setupheadertexts[] \setupheadertexts[chapter][\date] \setupfootertexts[pagenumber]
\starttext \startchapter [title={Chapter title}] \startpostponing[+1] \startFloatPagemakeup \placefigure{a floating cow}{\externalfigure[cow]} \stopFloatPagemakeup \stoppostponing \dorecurse{6}{\samplefile{knuth}} \blank
\dorecurse{2}{\samplefile{tufte}} \stopchapter \stoptext %%% stop example
Of course, I think some manual hand-tuning is required (in the final stages of the document) in deciding the right place to put the postponing block and in deciding what offset is best.
Sreeram
___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
On Thursday, March 31, 2022 3:11 AM Michael Urban via ntg-context wrote:
Almost there. But if I add \setuppagenumbering [alternative=doublesided] to the example, there is a blank page before the makeup page, and an unnumbered blank page after. If I add doublesided=no to the \setupmakeup options, the unnumbered blank page is not there, but there is still a blank page before. It is seemingly forcing a right-hand page for some reason I do not understand.
That is an easy fix: \setupmakeup, just like \setuphead, has a 'page' key which controls this. So, using the below setup for the 'FloatPage' makeup you can get rid of the unwanted page: \setupmakeup [FloatPage] [ headerstate=normal, pagestate=start, align=middle, footerstate=normal, page=no, doublesided=no] Sreeram
On 3/30/2022 11:41 PM, Michael Urban via ntg-context wrote:
Almost there. But if I add \setuppagenumbering [alternative=doublesided] to the example, there is a blank page before the makeup page, and an unnumbered blank page after. If I add doublesided=no to the \setupmakeup options, the unnumbered blank page is not there, but there is still a blank page before. It is seemingly forcing a right-hand page for some reason I do not understand. does adding page=no help?
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On Tuesday, March 29, 2022 4:18 AM Michael Urban via ntg-context wrote:
Is there a simple way to accomplish this?
Aside from the other solution using makeup, a simpler way might be to just use the 'page' option for positioning the float. The following MWE achieves the same result as that with the makeup: \setuppagenumbering[alternative=doublesided] \setupexternalfigures[location=default] \setupheadertexts[] \setupheadertexts[chapter][\date] \setupfootertexts[pagenumber] \starttext \startchapter [title={Chapter title}] \dorecurse{2}{\samplefile{knuth}} \placefigure[page]{a floating cow}{\externalfigure[cow]} \dorecurse{4}{\samplefile{knuth}} \blank \dorecurse{2}{\samplefile{tufte}} \stopchapter \stoptext Sreeram
participants (3)
-
Hans Hagen
-
Michael Urban
-
śrīrāma