ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] [ page setup ]
@ 2025-01-19 18:07 vm via ntg-context
  2025-01-19 19:38 ` [NTG-context] " Henning Hraban Ramm
  0 siblings, 1 reply; 8+ messages in thread
From: vm via ntg-context @ 2025-01-19 18:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: vm


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





___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [NTG-context] Re: [ page setup ]
  2025-01-19 18:07 [NTG-context] [ page setup ] vm via ntg-context
@ 2025-01-19 19:38 ` Henning Hraban Ramm
  2025-01-19 20:13   ` vm via ntg-context
  2025-01-19 20:38   ` vm via ntg-context
  0 siblings, 2 replies; 8+ messages in thread
From: Henning Hraban Ramm @ 2025-01-19 19:38 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [NTG-context] Re: [ page setup ]
  2025-01-19 19:38 ` [NTG-context] " Henning Hraban Ramm
@ 2025-01-19 20:13   ` vm via ntg-context
  2025-01-19 20:38   ` vm via ntg-context
  1 sibling, 0 replies; 8+ messages in thread
From: vm via ntg-context @ 2025-01-19 20:13 UTC (permalink / raw)
  To: ntg-context; +Cc: vm



On 19/01/2025 20:38, Henning Hraban Ramm wrote:
> 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]


That helps indeed, Thank you!

.F

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [NTG-context] Re: [ page setup ]
  2025-01-19 19:38 ` [NTG-context] " Henning Hraban Ramm
  2025-01-19 20:13   ` vm via ntg-context
@ 2025-01-19 20:38   ` vm via ntg-context
  2025-01-19 20:43     ` Mikael Sundqvist
  1 sibling, 1 reply; 8+ messages in thread
From: vm via ntg-context @ 2025-01-19 20:38 UTC (permalink / raw)
  To: ntg-context; +Cc: vm



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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [NTG-context] Re: [ page setup ]
  2025-01-19 20:38   ` vm via ntg-context
@ 2025-01-19 20:43     ` Mikael Sundqvist
  2025-01-19 21:08       ` vm via ntg-context
  0 siblings, 1 reply; 8+ messages in thread
From: Mikael Sundqvist @ 2025-01-19 20:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1603 bytes --]

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 <ntg-context@ntg.nl> skrev:

>
>
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 2577 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [NTG-context] Re: [ page setup ]
  2025-01-19 20:43     ` Mikael Sundqvist
@ 2025-01-19 21:08       ` vm via ntg-context
  2025-01-26 18:04         ` garulfo
  0 siblings, 1 reply; 8+ messages in thread
From: vm via ntg-context @ 2025-01-19 21:08 UTC (permalink / raw)
  To: Mikael Sundqvist, mailing list for ConTeXt users; +Cc: vm



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

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [NTG-context] Re: [ page setup ]
  2025-01-19 21:08       ` vm via ntg-context
@ 2025-01-26 18:04         ` garulfo
  2025-01-26 18:33           ` garulfo
  0 siblings, 1 reply; 8+ messages in thread
From: garulfo @ 2025-01-26 18:04 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [NTG-context] Re: [ page setup ]
  2025-01-26 18:04         ` garulfo
@ 2025-01-26 18:33           ` garulfo
  0 siblings, 0 replies; 8+ messages in thread
From: garulfo @ 2025-01-26 18:33 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-01-26 18:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-19 18:07 [NTG-context] [ page setup ] vm via ntg-context
2025-01-19 19:38 ` [NTG-context] " Henning Hraban Ramm
2025-01-19 20:13   ` vm via ntg-context
2025-01-19 20:38   ` vm via ntg-context
2025-01-19 20:43     ` Mikael Sundqvist
2025-01-19 21:08       ` vm via ntg-context
2025-01-26 18:04         ` garulfo
2025-01-26 18:33           ` garulfo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).