ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Problem with \setuplayout parameters being ignored
@ 2023-03-05 16:54 Keith McKay via ntg-context
  2023-03-05 16:58 ` Wolfgang Schuster via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Keith McKay via ntg-context @ 2023-03-05 16:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Keith McKay


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

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

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

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

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

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

* Re: Problem with \setuplayout parameters being ignored
  2023-03-05 16:54 Problem with \setuplayout parameters being ignored Keith McKay via ntg-context
@ 2023-03-05 16:58 ` Wolfgang Schuster via ntg-context
  2023-03-05 17:10   ` Keith McKay via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2023-03-05 16:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Keith McKay via ntg-context
  Cc: Wolfgang Schuster, Keith McKay


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

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


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

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

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

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

* Re: Problem with \setuplayout parameters being ignored
  2023-03-05 16:58 ` Wolfgang Schuster via ntg-context
@ 2023-03-05 17:10   ` Keith McKay via ntg-context
  2023-03-05 17:24     ` Wolfgang Schuster via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Keith McKay via ntg-context @ 2023-03-05 17:10 UTC (permalink / raw)
  To: Wolfgang Schuster, mailing list for ConTeXt users; +Cc: Keith McKay


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

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
>

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

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

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

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

* Re: Problem with \setuplayout parameters being ignored
  2023-03-05 17:10   ` Keith McKay via ntg-context
@ 2023-03-05 17:24     ` Wolfgang Schuster via ntg-context
  2023-03-05 17:41       ` Keith McKay via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2023-03-05 17:24 UTC (permalink / raw)
  To: Keith McKay; +Cc: Wolfgang Schuster, mailing list for ConTeXt users

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
___________________________________________________________________________________

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

* Re: Problem with \setuplayout parameters being ignored
  2023-03-05 17:24     ` Wolfgang Schuster via ntg-context
@ 2023-03-05 17:41       ` Keith McKay via ntg-context
  0 siblings, 0 replies; 5+ messages in thread
From: Keith McKay via ntg-context @ 2023-03-05 17:41 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: Keith McKay, mailing list for ConTeXt users


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

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

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

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

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

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

end of thread, other threads:[~2023-03-05 17:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-05 16:54 Problem with \setuplayout parameters being ignored Keith McKay via ntg-context
2023-03-05 16:58 ` Wolfgang Schuster via ntg-context
2023-03-05 17:10   ` Keith McKay via ntg-context
2023-03-05 17:24     ` Wolfgang Schuster via ntg-context
2023-03-05 17:41       ` Keith McKay via ntg-context

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).