\mathstrut in \underbrace and nath
Example: \usemodule[nath] \starttext \startnathequation \underbrace{\mathstrut rr\dots r}_{n \text{times}} \stopnathequation \stoptext Error: ! Missing } inserted. <inserted text> } <to be read again> \o@dollar \o@math ->\o@dollar \relax \finishddelimbox@ ->\mathclose {} \o@math \egroup \delim@l #1#2->\mathopen {} \finishddelimbox@ \put@ {\the \ht \sizebox }\ht@... \mathph@nt ...tbox \nextbox \voidb@x {$\m@th #1{#2 }$} ... l.4 ...race{\mathstrut rr\dots r}_{n \text{times}} ? My guess is that the expansion of \mathstrut, being \vphantom(, is being misinterpreted as a delimiter (as '(' is active in nath), but that's just a layman's guess. nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Wednesday, November 17, 2004 Nikolai Weibull wrote:
Example:
\usemodule[nath] \starttext \startnathequation \underbrace{\mathstrut rr\dots r}_{n \text{times}} \stopnathequation \stoptext
Error:
! Missing } inserted. <inserted text>
[snip]
My guess is that the expansion of \mathstrut, being \vphantom(, is being misinterpreted as a delimiter (as '(' is active in nath), but that's just a layman's guess. nikolai
Bingo. In nath this is now fixed by letting \mathstrut use | instead of (. I'll try to get the new amsl and nath modules out today. -- Giuseppe "Oblomov" Bilotta
* Giuseppe Bilotta
\usemodule[nath] \starttext \startnathequation \underbrace{\mathstrut rr\dots r}_{n \text{times}} \stopnathequation \stoptext
Error:
! Missing } inserted. <inserted text>
My guess is that the expansion of \mathstrut, being \vphantom(, is being misinterpreted as a delimiter (as '(' is active in nath), but that's just a layman's guess.
Bingo. In nath this is now fixed by letting \mathstrut use | instead of (.
:-)
I'll try to get the new amsl and nath modules out today.
Thanks, great work. I don't want to rain on your parade, but I just found another bug: \usemodule[nath] \starttext $A \longrightarrow B$ \stoptext gives ! Undefined control sequence. \dodosmash [#1]->\edef \@@smash {#1}\futurelet \nexttoken \dododosmash \relbar ->\mathrel {\smash -} \longrightarrow ->\relbar \joinrel \rightarrow <argument> A \longrightarrow B \inlinemath ...inemath@ {\noexpand \wrapfrac@ { #1 }} \endgroup \protectinlin... \imath@ ...mathoptions@on \o@math \inlinemath {#1} \o@math \mathoptions@off ... l.19 $A \longrightarrow B$ ? which seems a bit more difficult to fix. I can't do it anyway, nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Nikolai Weibull wrote:
! Undefined control sequence. \dodosmash [#1]->\edef \@@smash {#1}\futurelet \nexttoken \dododosmash \relbar ->\mathrel {\smash -}
Uh-uh. The problem is clear: \inlinemath tries (in the definition of \inlinemath@) to expand the formula (in the sense of TeX macro expansion). \longrightarrow cum suis are, however, not expandable in ConTeXt. Now, I do believe the xdef is a bug in nath, but the following workaround does work: \protected\def\longrightarrow {\relbar\joinrel\rightarrow} Hans, do you have a command that sort of changes an existing definition as if \protected had been used in the first place? regards, Christopher
Christopher Creutzig wrote:
Nikolai Weibull wrote:
! Undefined control sequence. \dodosmash [#1]->\edef \@@smash {#1}\futurelet \nexttoken \dododosmash \relbar ->\mathrel {\smash -}
Uh-uh. The problem is clear: \inlinemath tries (in the definition of \inlinemath@) to expand the formula (in the sense of TeX macro expansion). \longrightarrow cum suis are, however, not expandable in ConTeXt.
Now, I do believe the xdef is a bug in nath, but the following workaround does work:
\protected\def\longrightarrow {\relbar\joinrel\rightarrow}
Hans, do you have a command that sort of changes an existing definition as if \protected had been used in the first place?
first of all, \protected is not what you think it is; i had a \protected before etex was around; the context name is \unexpanded \let\unprotectedlongrightarrow\longrightarrow \unexpanded\def\longrightarrow{\unprotectedlongrightarrow} Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen wrote:
first of all, \protected is not what you think it is; i had a \protected before etex was around; the context name is \unexpanded
Ok, then what's \protected? Is it performing an \unprotect/\protect pair around the definition? But then, why did it work?
\let\unprotectedlongrightarrow\longrightarrow \unexpanded\def\longrightarrow{\unprotectedlongrightarrow}
Yes, I'd though of that, I justwanted to know if there is some higher level version already existing. regards, ccr
Christopher Creutzig wrote:
Hans Hagen wrote:
first of all, \protected is not what you think it is; i had a \protected before etex was around; the context name is \unexpanded
Ok, then what's \protected? Is it performing an \unprotect/\protect pair around the definition? But then, why did it work?
\let\unprotectedlongrightarrow\longrightarrow \unexpanded\def\longrightarrow{\unprotectedlongrightarrow}
ah, i though that you wanted the etex \protected -) in context protext/unprotect is to be used when ! @ ? are used inmacro names which was not the case here
Yes, I'd though of that, I justwanted to know if there is some higher level version already existing.
nop Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen wrote:
Ok, then what's \protected? Is it performing an \unprotect/\protect pair around the definition? But then, why did it work?
in context protext/unprotect is to be used when ! @ ? are used inmacro names which was not the case here
I know. So, does ConTeXt's \protected\def temporarily switch on one level of \unprotect? But for some strange reason, the whole thing worked ... regards, Christopher
* Hans Hagen
\let\unprotectedlongrightarrow\longrightarrow \unexpanded\def\longrightarrow{\unprotectedlongrightarrow}
Thanks, that works fine, nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Friday, November 19, 2004 Nikolai Weibull wrote:
* Hans Hagen
[Nov 19, 2004 16:40]: \let\unprotectedlongrightarrow\longrightarrow \unexpanded\def\longrightarrow{\unprotectedlongrightarrow}
Thanks, that works fine, nikolai
Shall this go in nath? Or, Hans, will you protect those macros? -- Giuseppe "Oblomov" Bilotta
Giuseppe Bilotta wrote:
Shall this go in nath? Or, Hans, will you protect those macros?
if so, i need to protect the lot, any system/logic behind what to protect ? Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Friday, November 19, 2004 h h extern wrote:
Giuseppe Bilotta wrote:
Shall this go in nath? Or, Hans, will you protect those macros?
if so, i need to protect the lot, any system/logic behind what to protect ?
I have no idea. Everything? What's the downside of protecting a macro? -- Giuseppe "Oblomov" Bilotta
Giuseppe Bilotta wrote:
Friday, November 19, 2004 h h extern wrote:
Giuseppe Bilotta wrote:
Shall this go in nath? Or, Hans, will you protect those macros?
if so, i need to protect the lot, any system/logic behind what to protect ?
I have no idea. Everything? What's the downside of protecting a macro?
sometimes you want it to be expandable \unexpanded\def\blabla{\handle{blabla}} will not expand even if \handle is expandable (could be a problem in for instance fallbacks for pdf bookmarks and such) \def\blabla{\handle{blabla}} now one can overload \handle, and \handle can be protected if needed Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (5)
-
Christopher Creutzig
-
Giuseppe Bilotta
-
h h extern
-
Hans Hagen
-
Nikolai Weibull