Something strange occurs in math, doing: \placeformula\startformula H(K|M,C) = H(K|C) - H(M|C)\eqno{\hbox{(\in{}[eq:keyapp])}} \stopformula produces the following error: ------------------------------------ ! You can't use `\eqno' in math mode. <argument> \normalreqno {\doformulanumber [][][]{}} \secondoftwoarguments #1#2->#2 \dostopformula ->\doplaceformulanumber \getvalue {\e!stop \formulaparameter ... l.20 \stopformula ------------------------------------ Why cannot \eqno be used in math mode? It is its raison d'etre! Plain TeX typesets the following input without problems: $$ a = b + c\eqno{(12)} $$ \end Strange enough the following does work as expected: \placeformula\startformula \eqalignno{ H(K|M,C) &= H(K|C) - H(M|C)&\eqno{\hbox{(\in{}[eq:keyapp])}}\cr } \stopformula Is this a little bug perhaps? Hans van der Meer
Hans van der Meer wrote:
Something strange occurs in math, doing:
\placeformula\startformula H(K|M,C) = H(K|C) - H(M|C)\eqno{\hbox{(\in{}[eq:keyapp])}} \stopformula
Please use: \placeformula[-]\startformula
produces the following error: ------------------------------------ ! You can't use `\eqno' in math mode.
This message is a bit misleading. Knuth means to say: ! You can't use `\eqno' in non-display math mode. ... and that is precisely what happens when you try to use \eqno in a formula that is numbered automatically already. Cheers, taco
On May 29, 2006, at 9:01, Taco Hoekwater wrote:
Hans van der Meer wrote:
Something strange occurs in math, doing:
\placeformula\startformula H(K|M,C) = H(K|C) - H(M|C)\eqno{\hbox{(\in{}[eq:keyapp])}} \stopformula
Please use:
\placeformula[-]\startformula
produces the following error: ------------------------------------ ! You can't use `\eqno' in math mode.
This message is a bit misleading. Knuth means to say:
! You can't use `\eqno' in non-display math mode.
Taco, Thanks for that explanation. I would not have found out by myself that this error is not about being in math mode, but about being in a numbered equation. I am inclined to stick to this as a bug. Not of ConTeXt, of course, but of TeX's error reporting system. It would be nice if someone in the pdfetex community took it as a challenge to make this error item more to the point. Hans van der Meer
Hans van der Meer wrote:
On May 29, 2006, at 9:01, Taco Hoekwater wrote:
Hans van der Meer wrote:
Something strange occurs in math, doing:
\placeformula\startformula H(K|M,C) = H(K|C) - H(M|C)\eqno{\hbox{(\in{}[eq:keyapp])}} \stopformula
Please use:
\placeformula[-]\startformula
produces the following error: ------------------------------------ ! You can't use `\eqno' in math mode.
This message is a bit misleading. Knuth means to say:
! You can't use `\eqno' in non-display math mode.
Taco,
Thanks for that explanation. I would not have found out by myself that this error is not about being in math mode, but about being in a numbered equation. I am inclined to stick to this as a bug. Not of ConTeXt, of course, but of TeX's error reporting system. It would be nice if someone in the pdfetex community took it as a challenge to make this error item more to the point.
something like this ... but i first need proper testing by the math gurus here \unprotect \definemessageconstant{math} \startmessages all library: math title: math 1: don't use -- here (line \the\inputlineno) \stopmessages \def\invalidmathcommand#1{\showmessage\m!math1{#1}} \let\normaleqno \eqno \let\normalleqno\leqno \appendtoks \def\eqno {\invalidmathcommand{\string\eqno }}% \def\leqno{\invalidmathcommand{\string\leqno}}% \to \everydisplay \appendtoks \let\eqno\normaleqno \let\leqno\normaleqno \to \everymath \protect \placeformula\startformula H(K|M,C) = H(K|C) - H(M|C)\eqno{\hbox{(\in{}[eq:keyapp])}} \stopformula ----------------------------------------------------------------- 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 (3)
-
Hans Hagen
-
Hans van der Meer
-
Taco Hoekwater