
What would be the simple preferred way to define a document having not just odd and even pages but also alternating width is sets of two. e.g. two pages with width 118 mm followed by two pages of 178 mm followed by two pages with width 118 mm, ... all hints appreciated .Floris

Am 19.01.25 um 19:07 schrieb vm via ntg-context:
What would be the simple preferred way to define a document having not just odd and even pages but also alternating width is sets of two. e.g. two pages with width 118 mm followed by two pages of 178 mm followed by two pages with width 118 mm, ...
You can define different layouts like \definelayout[one][width=118mm] \definelayout[two][width=178mm] and then activate them for pages like \definelayout[1,2,5,6][one] \definelayout[4,5,7,8][two] To automate this for more pages, try a loop, either with \dorecurse or Lua. Calculations are probably easier in Lua. Hraban

On 19/01/2025 20:38, Henning Hraban Ramm wrote:
\definelayout[one][width=118mm] \definelayout[two][width=178mm]
and then activate them for pages like
\definelayout[1,2,5,6][one] \definelayout[4,5,7,8][two]
my current lmtx seems to ignore the \definelayout what am i missing? 8<--- \setuppapersize [A4] \setupheader [state=empty, no] \usetypescript[ibmplex] \setupbodyfont[ibmplex, serif, 11pt] \setupinterlinespace[14pt] \setuplayout[% backspace=10mm, topspace=20mm, header=0mm, footer=0mm, height=180mm, ] \definelayout[one][width=98.8mm] \definelayout[two][width=158.2mm] \definelayout[1,2,5,6][one] \definelayout[3,4,7,8][two] \starttext \showframe \dorecurse{30}{\input knuth} \stoptext --->8

If you are in the middle of a paragraph at the page break where the width
changes, it will not work.
Den sön 19 jan. 2025 21:40vm via ntg-context
On 19/01/2025 20:38, Henning Hraban Ramm wrote:
\definelayout[one][width=118mm] \definelayout[two][width=178mm]
and then activate them for pages like
\definelayout[1,2,5,6][one] \definelayout[4,5,7,8][two]
my current lmtx seems to ignore the \definelayout what am i missing?
8<---
\setuppapersize [A4] \setupheader [state=empty, no] \usetypescript[ibmplex] \setupbodyfont[ibmplex, serif, 11pt] \setupinterlinespace[14pt]
\setuplayout[% backspace=10mm, topspace=20mm, header=0mm, footer=0mm, height=180mm, ]
\definelayout[one][width=98.8mm] \definelayout[two][width=158.2mm] \definelayout[1,2,5,6][one] \definelayout[3,4,7,8][two]
\starttext \showframe \dorecurse{30}{\input knuth} \stoptext
--->8
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net
___________________________________________________________________________________

On 19/01/2025 21:43, Mikael Sundqvist wrote:
If you are in the middle of a paragraph at the page break where the width changes, it will not work.
ok, so the \definelayout will not work for defining alternate (odd/even) narrow, (odd/even) wide pages. Is there an different route? e.g. manually inserting page breaks and tex/paragraph width? .F

A proposal based on lmt_parshape, \startshapetext, and \getshapetext. Be sure to use \endgraf to break the line ==> it probably work only if you stay in the same par. % 8<--- \setuppapersize [A4] \setupheader [state=empty, no] \usetypescript[ibmplex] \setupbodyfont[ibmplex, serif, 11pt] % \setupinterlinespace[14pt] % LET DEFAULT \setuplayout[% backspace=10mm, topspace=20mm, header=0mm, footer=0mm, height=180mm, ] \definelayout[one][width=98.8mm] \definelayout[two][width=158.2mm] \definelayout[1,2,5,6][one] \definelayout[3,4,7,8][two] %================================================= \startuseMPgraphic{testA} path p ; p := fullsquare xscaled 98.8mm yscaled 180mm; lmt_parshape [ path = p,] ; \stopuseMPgraphic \startuseMPgraphic{testB} path p ; p := fullsquare xscaled 158.2mm yscaled 180mm; lmt_parshape [ path = p,] ; \stopuseMPgraphic \startshapetext [testA,testB,testA,testB,testA,testB, testA,testB,testA,testB,testA,testB, testA] \setupalign[verytolerant,stretch,normal] {\bf\strut This is the beginning}.\endgraf % DON'T FORGET THE STRUT HERE \dorecurse{30} {\strut\color[middlemagenta]{\bf \recurselevel}\endgraf \input knuth\endgraf} {\bf This is the end}. \stopshapetext %================================================= \showframe \showgrid \starttext \dorecurse{13}{\getshapetext} \stoptext % --->8

in particular \startsection for example breaks the mecanism \setuppapersize [A4] \setupheader [state=empty, no] \usetypescript[ibmplex] \setupbodyfont[ibmplex, serif, 11pt] % \setupinterlinespace[14pt] % LET DEFAULT \setuplayout[% backspace=10mm, topspace=20mm, header=0mm, footer=0mm, height=180mm, ] \definelayout[one][width=98.8mm] \definelayout[two][width=158.2mm] \definelayout[1,2,5,6][one] \definelayout[3,4,7,8][two] %================================================= \startuseMPgraphic{testA} path p ; p := fullsquare xscaled 98.8mm yscaled 180mm; lmt_parshape [ path = p,] ; \stopuseMPgraphic \startuseMPgraphic{testB} path p ; p := fullsquare xscaled 158.2mm yscaled 180mm; lmt_parshape [ path = p,] ; \stopuseMPgraphic \startshapetext [testA,testB,testA,testB,testA,testB, testA,testB,testA,testB,testA,testB, testA] \setupalign[verytolerant,stretch,normal] {\bf\strut This is the beginning}.\endgraf % DON'T FORGET THE STRUT HERE \dorecurse{30} {\strut\color[middlemagenta]{\bf \recurselevel}\endgraf \startsection[title={section \recurselevel}]\input knuth\stopsection} {\bf This is the end}. \stopshapetext %================================================= \showframe \showgrid \starttext \dorecurse{13}{\getshapetext} \stoptext
participants (4)
-
garulfo@azules.eu
-
Henning Hraban Ramm
-
Mikael Sundqvist
-
vm