Problem with \setuplayout parameters being ignored
Hi I'm having a strange problem with the \setuplayout command with the parameters being ignored. In the code below the only parameter which does get setup is the backspace parameter, the header, footer, width, and margin parameters are setup differently according to the log. I'm probably missing something fairly obvious so hints would be helpful. The document I'm trying to setup will probably be a maximum of 50 pages and I would like to reduce the space at the top and bottom of the page. Best Wishes Keith McKay %%%%%%%%% Code so far %%%%%%%%%%% \setuppapersize[A4] \setuplayout[ backspace = 2.5cm, margin = 0.5cm, width = 16cm, header = 1cm, footer = 1cm, ] \setupbackgrounds[state=repeat] \defineoverlay[apage][ {\startMPcode StartPage; definecolor[ name = "MyColor1", r = uniformdeviate(1), g = uniformdeviate(1), b = uniformdeviate(1) ] ; definecolor[ name = "MyColor2", r = uniformdeviate(1), g = uniformdeviate(1), b = uniformdeviate(1) ] ; draw lmt_shade [ path = Page, direction = "down", alternative = "linear", colors = { "MyColor2", "MyColor1" }, ] ; draw lmt_shade [ path = Field[Text][Text], direction = "down", alternative = "linear", colors = { "MyColor1", "MyColor2" }, ] ; StopPage; \stopMPcode} ] \showframe \setupbackgrounds[page][background=apage] \setupbackgrounds[footer][text] [background=color, backgroundcolor=blue] \setupbackgrounds[header][text] [background=color, backgroundcolor=red] \setuppagenumbering[state=start,alternative=doublesided,location=footer] \showlayout \starttext \showsetups \dorecurse{10}{ Page \recurselevel \page } \stoptext
Keith McKay via ntg-context schrieb am 05.03.2023 um 17:54:
Hi
I'm having a strange problem with the \setuplayout command with the parameters being ignored. In the code below the only parameter which does get setup is the backspace parameter, the header, footer, width, and margin parameters are setup differently according to the log. I'm probably missing something fairly obvious so hints would be helpful. The document I'm trying to setup will probably be a maximum of 50 pages and I would like to reduce the space at the top and bottom of the page.
Best Wishes
Keith McKay
%%%%%%%%% Code so far %%%%%%%%%%%
\setuppapersize[A4]
\setuplayout[
backspace = 2.5cm,
margin = 0.5cm,
width = 16cm,
header = 1cm,
footer = 1cm,
]
Remove the spaces before and after = in the settings. While LaTeX ignores spaces around = ConTeXt doesn't. Wolfgang
Thank you so much Wolfgang! I should have realised that. It's what I get for trying to write readable code. Best Wishes Keith McKay On 05/03/2023 16:58, Wolfgang Schuster wrote:
Keith McKay via ntg-context schrieb am 05.03.2023 um 17:54:
Hi
I'm having a strange problem with the \setuplayout command with the parameters being ignored. In the code below the only parameter which does get setup is the backspace parameter, the header, footer, width, and margin parameters are setup differently according to the log. I'm probably missing something fairly obvious so hints would be helpful. The document I'm trying to setup will probably be a maximum of 50 pages and I would like to reduce the space at the top and bottom of the page.
Best Wishes
Keith McKay
%%%%%%%%% Code so far %%%%%%%%%%%
\setuppapersize[A4]
\setuplayout[
backspace = 2.5cm,
margin = 0.5cm,
width = 16cm,
header = 1cm,
footer = 1cm,
]
Remove the spaces before and after = in the settings. While LaTeX ignores spaces around = ConTeXt doesn't.
Wolfgang
Keith McKay schrieb am 05.03.2023 um 18:10:
Thank you so much Wolfgang! I should have realised that. It's what I get for trying to write readable code.
You can use the = to align keys and values, e.g. \setuplayout [backspace=2.5cm, margin=0.5cm, width=16cm, header=1cm, footer=1cm] Another useful method is to put large settings into a setups-blocks and pass the block to a setup-command. \startsetups [apage] \startMPcode StartPage; ... StopPage; \stopMPcode \stopsetups \defineoverlay[apage][\directsetup{apage}] Wolfgang
Many thanks Wolfgang. Useful tips indeed. Best Wishes Keith McKay On Sun, 5 Mar 2023, 17:24 Wolfgang Schuster, < wolfgang.schuster.lists@gmail.com> wrote:
Keith McKay schrieb am 05.03.2023 um 18:10:
Thank you so much Wolfgang! I should have realised that. It's what I get for trying to write readable code.
You can use the = to align keys and values, e.g.
\setuplayout [backspace=2.5cm, margin=0.5cm, width=16cm, header=1cm, footer=1cm]
Another useful method is to put large settings into a setups-blocks and pass the block to a setup-command.
\startsetups [apage] \startMPcode StartPage; ... StopPage; \stopMPcode \stopsetups
\defineoverlay[apage][\directsetup{apage}]
Wolfgang
participants (2)
-
Keith McKay
-
Wolfgang Schuster