Beta: bug in \setuphead[chapter]
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
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
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
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
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
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 ___________________________________________________________________________________
participants (3)
-
Aditya Mahajan
-
Otared Kavian
-
Wolfgang Schuster