2

My goal is to insert a page into the body text with a different layout and with items in a layer. The MWE appears to work fine. See screenshot below.

Question 1: \setupbackgrounds … has to be before \startpostponing …. If I move \setupbackgrounds … into the postponed block I don't see the layer. Why?

Question 2: If I remove the % from %\flushlayer[mine] then it still works but the photo & caption are moved about 60 mm down and right. Why?

\showframe
\setuppapersize[A4][A3,landscape] \setuparranging[2SIDE]

\setuplayout[backspace=80mm, width=100mm, topspace=50mm, header=0mm, footer=0mm, height=200mm, margindistance=10mm, leftmargin=40mm]

\definelayout[new][backspace=80mm, width=100mm, topspace=50mm, header=0mm, footer=0mm, height=80mm, margindistance=10mm, leftmargin=40mm]
%--------------------------------------------------------------------
% macros
% a caption
\define [1]\layercaption % a caption
    {\setlayer[mine]    
    [hoffset=30mm, voffset=170mm] 
    {\framed[frame=off, location=middle,align=flushleft,width=\leftmarginwidth, height=50mm]{#1} } }
% a photo
\define [1]\layerphoto    % photo across bottom
    {\setlayer[mine]    % name of the layer
    [hoffset=80mm, voffset=170mm] 
    {\externalfigure[#1][width=100mm]} }

\definelayer[mine][x=0mm, y=0mm, width=\paperwidth, height=\paperheight] 
%--------------------------------------------------------------------
\starttext 
\dorecurse{2}{\input{knuth} }   %start body text

\definelayout[\nextpage][new]   % set up layout for next page
\setupbackgrounds[page][background=mine]        
\startpostponing        % set up background for next page
\layercaption {Hi there all}
\layerphoto {cow}
%\flushlayer[mine]
\setuplayout[reset] 
\stoppostponing

\dorecurse{3}{\input{knuth} }   %continue body text
\stoptext 
%--------------------------------------------------------------------

MWE ok

1 Answer 1

2

There seem to be order problems with your approach.

  1. If you do the \setupbackgrounds inside the postponing environment, it gets lost inside a group.
  2. I think that is because there are two different layouts in action, and you somehow get out of sync, but I have not looked closer.

I guess that you sometimes want to put figures on the next page. Changing the layout from page to page is a bit like asking for problems. One way could be instead to postpone the float that is positioned at the bottom.

\showframe
\setuppapersize[A4][A3,landscape]
\setuparranging[2SIDE]

\setupexternalfigures[location=default]

\setuplayout[backspace=80mm, width=100mm, topspace=50mm, header=0mm, footer=0mm, height=200mm, margindistance=10mm, leftmargin=40mm]

\definefloat[bottomfigure][figure][
    default=bottom,
]

\setupcaption[bottomfigure][
    location=innermargin,
    width=40mm,
    align={flushleft},
]


\starttext 
\samplefile{knuth}\par

\startpostponing[+1]
\startplacebottomfigure[title={The dutch cow looks to the left to get the margin right.}]
\externalfigure[cow][width=\textwidth]
\stopplacebottomfigure
\stoppostponing

\dorecurse{7}{\samplefile{tufte}\par}
\stoptext 

A postponed figure

1
  • 1
    Yes, that's a much better approach. Thank you.
    – Stanley
    Commented Dec 4, 2022 at 18:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .