ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Why the way key-value argument is called affected the document's output?
@ 2024-01-08 22:05 111414w
  2024-01-08 22:16 ` [NTG-context] " Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: 111414w @ 2024-01-08 22:05 UTC (permalink / raw)
  To: ntg-context

Hi,

I was cleaning and formatting my context file and then when I compiled it, the output I got introduced extra vertical spacings at the section headings that weren't there in the previous compilations. I had to spend enormous amount of time trying to fix it so to emulate my previous outputs. Turns out the problem was how I called one of the key-value argument in the document.

I really wanna know the reason why it did influenced the output?

Provided below is the minimal source code (and it is producing different outputs, meaning the vertical spacings are not same, on my device running the version released in the September and also tested with the latest release.)


"""
%% differences in outputs, for how "grid=yes" is called.

%% Type 1.
%\setuplayout[grid=yes]

%% Type 2.
%\setuplayout[
%grid=yes
%]

\setuphead[section][grid=low] %% needed to observe the output difference
\starttext

\title{Alpha}
\subsection{Beta}
\input{knuth}

\stoptext
"""


Best regards,
Ali
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Why the way key-value argument is called affected the document's output?
  2024-01-08 22:05 [NTG-context] Why the way key-value argument is called affected the document's output? 111414w
@ 2024-01-08 22:16 ` Hans Hagen
  2024-01-08 22:33   ` Ali Ali
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2024-01-08 22:16 UTC (permalink / raw)
  To: ntg-context

On 1/8/2024 11:05 PM, 111414w@gmail.com wrote:
> Hi,
> 
> I was cleaning and formatting my context file and then when I compiled it, the output I got introduced extra vertical spacings at the section headings that weren't there in the previous compilations. I had to spend enormous amount of time trying to fix it so to emulate my previous outputs. Turns out the problem was how I called one of the key-value argument in the document.
> 
> I really wanna know the reason why it did influenced the output?
> 
> Provided below is the minimal source code (and it is producing different outputs, meaning the vertical spacings are not same, on my device running the version released in the September and also tested with the latest release.)
> 
> 
> """
> %% differences in outputs, for how "grid=yes" is called.
> 
> %% Type 1.
> %\setuplayout[grid=yes]

Here you set the grid variable to "yes".

> %% Type 2.
> %\setuplayout[
> %grid=yes
> %]

Here you set the grid variable to "yes " so a trailing space.

> \setuphead[section][grid=low] %% needed to observe the output difference
> \starttext
> 
> \title{Alpha}
> \subsection{Beta}
> \input{knuth}
> 
> \stoptext
So this is ok:

\setupfoo
  [a=A,
   b=B]

\setupfoo
  [a=A,
   b=B,
  ]

I'm not aware of funmdamental changes in the parse, apart from that in 
many setup commands one can now do this:

\setupfoo
   [A=\this[works],
    B=\that[doestoo]]

as nested brackets are handled.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Why the way key-value argument is called affected the document's output?
  2024-01-08 22:16 ` [NTG-context] " Hans Hagen
@ 2024-01-08 22:33   ` Ali Ali
  2024-01-08 22:40     ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Ali Ali @ 2024-01-08 22:33 UTC (permalink / raw)
  To: ntg-context

So is
"\setuplayout[grid=yes]"
AND
"\setuplayout[
grid=yes
]"
not same?

I mean, we are initializing "grid" to "yes" in both cases.

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Why the way key-value argument is called affected the document's output?
  2024-01-08 22:33   ` Ali Ali
@ 2024-01-08 22:40     ` Wolfgang Schuster
  2024-01-08 22:53       ` Ali Ali
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2024-01-08 22:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Ali Ali

Ali Ali schrieb am 08.01.2024 um 23:33:
> So is
> "\setuplayout[grid=yes]"
> AND
> "\setuplayout[
> grid=yes
> ]"
> not same?
>
> I mean, we are initializing "grid" to "yes" in both cases.

No, in the first case you end the value of the grid-key with ] which 
results in "yes" as argument but in the second case you have a linebreak 
before ] which adds a space to the argument which results in "yes " 
(with a trailing space) as argument.

Wolfgang

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Why the way key-value argument is called affected the document's output?
  2024-01-08 22:40     ` Wolfgang Schuster
@ 2024-01-08 22:53       ` Ali Ali
  2024-01-13 16:39         ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Ali Ali @ 2024-01-08 22:53 UTC (permalink / raw)
  To: ntg-context

Since in the "setup-en.pdf" on p. 234, in "\setuplayout" the possible values for "grid" key is "yes", "no" (default), and "off" respectively.

So what does the "yes " (with a trailing space) sets "grid" key to?

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Why the way key-value argument is called affected the document's output?
  2024-01-08 22:53       ` Ali Ali
@ 2024-01-13 16:39         ` Wolfgang Schuster
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2024-01-13 16:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Ali Ali

Ali Ali schrieb am 08.01.2024 um 23:53:
> Since in the "setup-en.pdf" on p. 234, in "\setuplayout" the possible values for "grid" key is "yes", "no" (default), and "off" respectively.

The commands in the document are not always up to date and somtimes miss 
entries or list no longer valid ones, in this case the NAME placeholder 
is missing.

> So what does the "yes " (with a trailing space) sets "grid" key to?

The expected behavior is to ignore invalid arguments and fall back to a 
default (in this case "no")option.

Wolfgang

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-01-13 16:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-08 22:05 [NTG-context] Why the way key-value argument is called affected the document's output? 111414w
2024-01-08 22:16 ` [NTG-context] " Hans Hagen
2024-01-08 22:33   ` Ali Ali
2024-01-08 22:40     ` Wolfgang Schuster
2024-01-08 22:53       ` Ali Ali
2024-01-13 16:39         ` Wolfgang Schuster

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