ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Beta: bug in \setuphead[chapter]
@ 2012-01-03  5:41 Otared Kavian
  2012-01-03  7:38 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Otared Kavian @ 2012-01-03  5:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear Hans, dear all,

My best wishes to all the community for this New Year!
With the latest beta, \setuphead[chapter] has a strange behavior: the order of two keys seems to be important…
More precisely

\setuphead
	[chapter]
	[header=high,
	align=middle
	]

results in an error (see below), while

\setuphead
	[chapter]
	[align=middle,
	header=high
	]

works as expected (I had a tough time to find the bug and this minimal example…).
Minimal example that does not work:

%%% begin bug-setuphead.tex
\setuphead
	[chapter]
	[header=high,
	align=middle
	]

\starttext
 \chapter{My chapter title}
 \input knuth
\stoptext
%%% end bug-setuphead.tex

The error message points to:

	\page_layouts_synchronize_element_indeed ...ounds 
                      						                            \else \ifx \previoustextst...
	\page_layouts_synchronize_element ...t_indeed {#1}
                                                  \fi 
	<inserted text> ..._element \currentlayoutelement 
                                                  \fi 
	\docommand ...=high]\the \everysetuplayoutelement 
                                                  
	\next1 #1,->\docommand {#1}
                           \syst_helpers_do_process_comma_item 
	\syst_helpers_do_process_comma_list ...rgument #1,
                            				                      ]\relax \global \advance \…


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Beta: bug in \setuphead[chapter]
  2012-01-03  5:41 Beta: bug in \setuphead[chapter] Otared Kavian
@ 2012-01-03  7:38 ` Wolfgang Schuster
  2012-01-03 12:58   ` Otared Kavian
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2012-01-03  7:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 03.01.2012 um 06:41 schrieb Otared Kavian:

> Dear Hans, dear all,
> 
> My best wishes to all the community for this New Year!
> With the latest beta, \setuphead[chapter] has a strange behavior: the order of two keys seems to be important…
> More precisely
> 
> \setuphead
> 	[chapter]
> 	[header=high,
> 	align=middle
> 	]

You need a command after “align=middle” because you assign “middle ” (with a space) to the align key.

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Beta: bug in \setuphead[chapter]
  2012-01-03  7:38 ` Wolfgang Schuster
@ 2012-01-03 12:58   ` Otared Kavian
  2012-01-03 13:05     ` Aditya Mahajan
  2012-01-03 13:06     ` Wolfgang Schuster
  0 siblings, 2 replies; 6+ messages in thread
From: Otared Kavian @ 2012-01-03 12:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 3 janv. 2012, at 08:38, Wolfgang Schuster wrote:

> […]
> You need a command after “align=middle” because you assign “middle ” (with a space) to the align key.


Hi Wolfgang,

I didn't get exactly what you mean, but saying either of the following:

	\setuphead[chapter][header=high,align=middle]
or
	\setuphead[chapter][align=middle,header=high]
or
	\setuphead[chapter][align=middle,
	 header=high]
or
	\setuphead[chapter][header=high,
	align=middle
	]

results in an error. While 

	\setuphead[chapter][align=middle, 
	 header=high
	 ]

works fine… 
On the other hand I should say that the settings I have in a document with over 120 pages used to work until version 2011.11.29, but since the betas of December something seems to be broken and that's why I was reporting the bug to Hans' attention and yours.
In fact using any other key in \setuphead together with "align=middle" either results an error or else destroys the middle alignment.

Best regards: OK


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Beta: bug in \setuphead[chapter]
  2012-01-03 12:58   ` Otared Kavian
@ 2012-01-03 13:05     ` Aditya Mahajan
  2012-01-03 13:06     ` Wolfgang Schuster
  1 sibling, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2012-01-03 13:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 778 bytes --]

On Tue, 3 Jan 2012, Otared Kavian wrote:

> On 3 janv. 2012, at 08:38, Wolfgang Schuster wrote:
>
>> […]
>> You need a command after “align=middle” because you assign “middle ” (with a space) to the align key.
>
> I didn't get exactly what you mean, but saying either of the following:

I have not checked why the extra space is being introduced, but what 
Wolfgang meant was that

\setup<whatever>[key=value]

is the same as

\setup<whatever>
        [
          key=value,
        ]

but not the same as

\setup<whatever>
       [
         key=value
       ]

Whitespace is significant in ConTeXt setups. The last style is equivalent 
to

\setup<whatever>[key={value\n}]

and that could be the reason that you are seeing extra space.

Aditya

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

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Beta: bug in \setuphead[chapter]
  2012-01-03 12:58   ` Otared Kavian
  2012-01-03 13:05     ` Aditya Mahajan
@ 2012-01-03 13:06     ` Wolfgang Schuster
  2012-01-03 13:17       ` Otared Kavian
  1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2012-01-03 13:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 03.01.2012 um 13:58 schrieb Otared Kavian:

> On 3 janv. 2012, at 08:38, Wolfgang Schuster wrote:
> 
>> […]
>> You need a command after “align=middle” because you assign “middle ” (with a space) to the align key.
> 
> Hi Wolfgang,
> 
> I didn't get exactly what you mean, but saying either of the following:
> 
> 	\setuphead[chapter][header=high,align=middle]
> or
> 	\setuphead[chapter][align=middle,header=high]
> or
> 	\setuphead[chapter][align=middle,
> 	 header=high]
> or
> 	\setuphead[chapter][header=high,
> 	align=middle
> 	]
> 
> results in an error. While 
> 
> 	\setuphead[chapter][align=middle, 
> 	 header=high
> 	 ]
> 
> works fine… 

It’s a typo in the core, see Adityas mail but in the last case you need a comma after the high otherwise you pass the value “high ” (with a space at the end) to context.

Here is a simple example where you can that spaces matter:

\definehighlight[one][color=red ]
\definehighlight[two][color=blue]
\starttext
\one{Red} \two{Blue}
\stoptext

In the first definition i pass “red ” with a space at the end which is different from “red” (without a space).

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Beta: bug in \setuphead[chapter]
  2012-01-03 13:06     ` Wolfgang Schuster
@ 2012-01-03 13:17       ` Otared Kavian
  0 siblings, 0 replies; 6+ messages in thread
From: Otared Kavian @ 2012-01-03 13:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks to both of you, Wolfgang and Aditya, for the explanantions.
After applying the patch Wolfgang sent to Aditya, the error message is gone.

I guess the patch will be in the next beta.

Best regards: OK

On 3 janv. 2012, at 14:06, Wolfgang Schuster wrote:

> 
> Am 03.01.2012 um 13:58 schrieb Otared Kavian:
> 
>> On 3 janv. 2012, at 08:38, Wolfgang Schuster wrote:
>> 
>>> […]
>>> You need a command after “align=middle” because you assign “middle ” (with a space) to the align key.
>> 
>> Hi Wolfgang,
>> 
>> I didn't get exactly what you mean, but saying either of the following:
>> 
>> 	\setuphead[chapter][header=high,align=middle]
>> or
>> 	\setuphead[chapter][align=middle,header=high]
>> or
>> 	\setuphead[chapter][align=middle,
>> 	 header=high]
>> or
>> 	\setuphead[chapter][header=high,
>> 	align=middle
>> 	]
>> 
>> results in an error. While 
>> 
>> 	\setuphead[chapter][align=middle, 
>> 	 header=high
>> 	 ]
>> 
>> works fine… 
> 
> It’s a typo in the core, see Adityas mail but in the last case you need a comma after the high otherwise you pass the value “high ” (with a space at the end) to context.
> 
> Here is a simple example where you can that spaces matter:
> 
> \definehighlight[one][color=red ]
> \definehighlight[two][color=blue]
> \starttext
> \one{Red} \two{Blue}
> \stoptext
> 
> In the first definition i pass “red ” with a space at the end which is different from “red” (without a space).
> 
> Wolfgang
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2012-01-03 13:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-03  5:41 Beta: bug in \setuphead[chapter] Otared Kavian
2012-01-03  7:38 ` Wolfgang Schuster
2012-01-03 12:58   ` Otared Kavian
2012-01-03 13:05     ` Aditya Mahajan
2012-01-03 13:06     ` Wolfgang Schuster
2012-01-03 13:17       ` Otared Kavian

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