[NTG-context] Restoring/switching paper size?

Procházka Lukáš Ing. LPr at pontex.cz
Mon Jul 18 16:41:06 CEST 2016


Hello,

thank you for the patch.

A solution which would not require named page sizes might be better as we don't necessary need to know the name of the "previous" (or "pushed") paper size (mostly we use "anonymous" page sizes, set up once in the document preamble).

Thus push/pop way would be a bit more flexible (like \pushpagebackground / \poppagebackground);
or making paper size local (enclosing paper setup into group - \start \setupppapersize ... \stop\page) would restore the previous paper size.

Thank you anyway.

Best regards

Lukas


On Mon, 18 Jul 2016 16:00:05 +0200, Wolfgang Schuster <schuster.wolfgang at gmail.com> wrote:

>> Procházka Lukáš Ing. <mailto:LPr at pontex.cz>
>> 18. Juli 2016 um 15:09
>> Hello,
>>
>> why this code doesn't restore A4-portrait for page 3?
>>
>> ----
>> \showframe
>>
>> \starttext
>>   Page 1
>>   \page
>>   \adaptpapersize[A4,landscape]
>>   Page 2
>>   \page
>>   Page 3
>> \stoptext
>> ----
> page-lay.mkiv
>
> \unexpanded\def\adaptpapersize
> - {\global\let\page_paper_reinstate\page_paper_reinstate_indeed
> + {\global\let\page_paper_reinstate\page_paper_restore
>     \setuppapersize}
>
> -\unexpanded\def\page_paper_reinstate_indeed
> -  {\page_paper_reinstate
> -   \global\let\page_paper_reinstate\relax}
>
> \appendtoks
>      \page_paper_reinstate
> +   \global\let\page_paper_reinstate\relax
> \to \everyaftershipout
>
>> (I need to mix A4 portrait/landscape pages in a document...)
>>
>> When I need to switch to landscape for more pages (e.g. for long large
>> tables; \adaptpapersize is not enough as it changes just one current
>> page), is there something like:
>>
>> \pushpapersize
>>   \page
>>   \setuppapersize[A4,landscape]
>>   ...
>>   more pages
>>   ...
>> \poppapersize
> There is no start/stop version like we have for layouts
> (\startlayout[...] ... \stoplayout) but you can use named sizes.
>
> \definepapersize [main]  [A4]           [A4]
> \definepapersize [extra] [A4,landscape] [A4,landscape]
>
> \starttext
>      Page 1. \page
>      Page 2. \page
>      \setuppapersize[extra]
>      Page 3. \page
>      Page 4. \page
>      \setuppapersize[main]
>      Page 5. \page
>      Page 6. \page
> \stoptext
>
> Wolfgang
>


-- 
Ing. Lukáš Procházka | mailto:LPr at pontex.cz
Pontex s. r. o.      | mailto:pontex at pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751 (+420 720 951 172)
Fax: +420 244 461 038



More information about the ntg-context mailing list