ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* eqno not in math
@ 2006-05-27 15:15 Hans van der Meer
  2006-05-29  7:01 ` Taco Hoekwater
  0 siblings, 1 reply; 4+ messages in thread
From: Hans van der Meer @ 2006-05-27 15:15 UTC (permalink / raw)


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

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

* Re: eqno not in math
  2006-05-27 15:15 eqno not in math Hans van der Meer
@ 2006-05-29  7:01 ` Taco Hoekwater
  2006-05-29 19:15   ` Hans van der Meer
  0 siblings, 1 reply; 4+ messages in thread
From: Taco Hoekwater @ 2006-05-29  7:01 UTC (permalink / raw)


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

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

* Re: eqno not in math
  2006-05-29  7:01 ` Taco Hoekwater
@ 2006-05-29 19:15   ` Hans van der Meer
  2006-05-29 21:20     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Hans van der Meer @ 2006-05-29 19:15 UTC (permalink / raw)



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

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

* Re: eqno not in math
  2006-05-29 19:15   ` Hans van der Meer
@ 2006-05-29 21:20     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2006-05-29 21:20 UTC (permalink / raw)


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

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

end of thread, other threads:[~2006-05-29 21:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-27 15:15 eqno not in math Hans van der Meer
2006-05-29  7:01 ` Taco Hoekwater
2006-05-29 19:15   ` Hans van der Meer
2006-05-29 21:20     ` Hans Hagen

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