ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \mathematics
@ 2006-08-14 15:46 Boris Tschirschwitz
  2006-08-14 18:11 ` \mathematics taco hoekwater
  0 siblings, 1 reply; 3+ messages in thread
From: Boris Tschirschwitz @ 2006-08-14 15:46 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 1125 bytes --]

Hi.

When writing math I like avoiding $ whenever possible by defining my math
operators with \mathematics, e.g.
\def\grp{\mathematics{G}}.
So far I was using this like I use \EnsureMath in LaTeX, but now I'm running
into problems in MPgraphics:
Texexec compiles the following file fine until I add the paragraph called
"Math in Math in MP". There it seems to somehow
choke on too many $ and \relax.

Is there a better way to do such definitions?

Thanks,
Boris.

PS: There's already a problem in the second to last paragraph where the G is
not set in math mode any more.


The example file:

\def\grp{\mathematics{G}}
\starttext
Test.

Running text:

A group \grp

Math:

$\grp$

$\grp_{\grp}$

Text in MP:

\startusableMPgraphic{groupone}
label(textext("\grp"),origin) ;
\stopusableMPgraphic

\useMPgraphic{groupone}

Math in MP:

\startusableMPgraphic{grouptwo}
label(textext("\mathematics{\grp}"),origin) ;
\stopusableMPgraphic

\useMPgraphic{grouptwo}

Math in Math in MP:

\startusableMPgraphic{groupthree}
label(textext("\mathematics{\grp_{\grp}}"),origin) ;
\stopusableMPgraphic

\useMPgraphic{groupthree}

\stoptext

[-- Attachment #1.2: Type: text/html, Size: 1346 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: \mathematics
  2006-08-14 15:46 \mathematics Boris Tschirschwitz
@ 2006-08-14 18:11 ` taco hoekwater
  2006-08-14 18:31   ` \mathematics Boris Tschirschwitz
  0 siblings, 1 reply; 3+ messages in thread
From: taco hoekwater @ 2006-08-14 18:11 UTC (permalink / raw)


Boris Tschirschwitz wrote:
> Hi.
> 
> When writing math I like avoiding $ whenever possible by defining my 
> math operators with \mathematics, e.g.
> \def\grp{\mathematics{G}}.
> So far I was using this like I use \EnsureMath in LaTeX, but now I'm 
> running into problems in MPgraphics:
> Texexec compiles the following file fine until I add the paragraph 
> called "Math in Math in MP". There it seems to somehow
> choke on too many $ and \relax.
> 
> Is there a better way to do such definitions?

I've changed my local definition of \mathematics to:

   \unexpanded\long\def\mathematics#1%
     {\relax\ifmmode#1\else $#1$\fi}

And that works nicely.

Cheers, Taco

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

* Re: \mathematics
  2006-08-14 18:11 ` \mathematics taco hoekwater
@ 2006-08-14 18:31   ` Boris Tschirschwitz
  0 siblings, 0 replies; 3+ messages in thread
From: Boris Tschirschwitz @ 2006-08-14 18:31 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 961 bytes --]

Cool, it works nicely here, too.

Thanks,
Boris.

On 8/14/06, taco hoekwater <taco@elvenkind.com> wrote:
>
> Boris Tschirschwitz wrote:
> > Hi.
> >
> > When writing math I like avoiding $ whenever possible by defining my
> > math operators with \mathematics, e.g.
> > \def\grp{\mathematics{G}}.
> > So far I was using this like I use \EnsureMath in LaTeX, but now I'm
> > running into problems in MPgraphics:
> > Texexec compiles the following file fine until I add the paragraph
> > called "Math in Math in MP". There it seems to somehow
> > choke on too many $ and \relax.
> >
> > Is there a better way to do such definitions?
>
> I've changed my local definition of \mathematics to:
>
>    \unexpanded\long\def\mathematics#1%
>      {\relax\ifmmode#1\else $#1$\fi}
>
> And that works nicely.
>
> Cheers, Taco
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>

[-- Attachment #1.2: Type: text/html, Size: 1452 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

end of thread, other threads:[~2006-08-14 18:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-14 15:46 \mathematics Boris Tschirschwitz
2006-08-14 18:11 ` \mathematics taco hoekwater
2006-08-14 18:31   ` \mathematics Boris Tschirschwitz

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