Procházka Lukáš Ing. - Pontex s. r. o.
28. Dezember 2015 um 16:37
Hello,

On Mon, 28 Dec 2015 00:06:08 +0100, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

It’s a bug but for the moment you can call \setuplayout (no arguments
are necessary) after \setupapersize to have the correct sizes in the PDF.

OK, it works.

One question related to this theme:

How width and height of the current layout are adopted when switching to landscape?

I noticed that once I have set the layout "height", I have to reset the value manually.
If the default "height" is kept, no manual reset is necessary.

See this:

----
%\setuplayout[height=277mm] % This value is useful for portrait orientation; try to un/comment

\starttext
  Aaa

  \page
  \setuppapersize[A4,landscape] % "Height" should be reset
  \setuplayout

  Bbb

  \typefile{Text.txt}
\stoptext
----

Is there a way to "reset" to the default (landscape) layout?
(Even \setuplayout[reset] doesn't do the job.)
There is no reset possible because you change the default layout.

You can fix this with a custom layout for your document because afterwards you can
just switch back to the default setting when the papersize changes.

\definelayout[start][height=277mm]
\setuplayout [start]

\showframe

\starttext

\dorecurse{5}{\input knuth\par}

\page \setuppapersize[A4,landscape] \setuplayout[reset]

\dorecurse{5}{\input knuth\par}

\stoptext

Wolfgang