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