Re: [NTG-context] Problem with \setuplayout parameters being ignored

2023-03-05 Thread Keith McKay via ntg-context
Many thanks Wolfgang. Useful tips indeed.
Best Wishes
Keith McKay

On Sun, 5 Mar 2023, 17:24 Wolfgang Schuster, <
wolfgang.schuster.li...@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
>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Problem with \setuplayout parameters being ignored

2023-03-05 Thread Wolfgang Schuster via ntg-context

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Problem with \setuplayout parameters being ignored

2023-03-05 Thread Keith McKay via ntg-context
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
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Problem with \setuplayout parameters being ignored

2023-03-05 Thread Wolfgang Schuster via ntg-context

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Problem with \setuplayout parameters being ignored

2023-03-05 Thread Keith McKay via ntg-context

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
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___