* \overrightarrow not working in mathmode in Metapost?
@ 2009-09-18 12:39 Matthijs Kooijman
2009-09-18 13:25 ` Aditya Mahajan
0 siblings, 1 reply; 7+ messages in thread
From: Matthijs Kooijman @ 2009-09-18 12:39 UTC (permalink / raw)
To: Mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1403 bytes --]
Hi,
I've been trying to use the \overrightarrow command within a metapost graphic,
but it doesn't work. Math mode does work, for example \vec works like
expected. Outside of metapost, \overrightarrow works as expected.
To illustrate the problem, I've created the following simple testcase:
\starttext
\startMPcode
draw btex $\vec{foo}$ etex;
draw btex $\overrightarrow{foo}$ etex;
\stopMPcode
\stoptext
This gives the following error output:
! Undefined control sequence.
\dodosmash [#1]->\edef \@@smash
{#1}\futurelet \nexttoken \dododosmash
\relbar ->\mathrel {\smash
-}
\mtharrowfill ...inmuskip \thickmuskip \relax #8#5
\mkern -#1mu \cleaders
\hb...
\dodohandlemathoverarrow ...{\ialign {##\crcr #2#3
\crcr \noalign {\kern
#1\n...
\mathpalette ...>\mathchoice {#1\displaystyle {#2}
}{#1\textstyle
{#2}}{#1\sc...
<argument> ...ex; draw btex $\overrightarrow {foo}
$ etex;
...
l.5 \stopMPcode
It seems the \overrightarrow command uses \@@smash, which isn't defined when
running from metapost?
Is this expected? Is this a bug?
Gr.
Matthijs
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 487 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \overrightarrow not working in mathmode in Metapost?
2009-09-18 12:39 \overrightarrow not working in mathmode in Metapost? Matthijs Kooijman
@ 2009-09-18 13:25 ` Aditya Mahajan
2009-09-18 13:31 ` Matthijs Kooijman
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Aditya Mahajan @ 2009-09-18 13:25 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Fri, 18 Sep 2009, Matthijs Kooijman wrote:
> Hi,
>
> I've been trying to use the \overrightarrow command within a metapost graphic,
> but it doesn't work. Math mode does work, for example \vec works like
> expected. Outside of metapost, \overrightarrow works as expected.
>
> To illustrate the problem, I've created the following simple testcase:
>
> \starttext
> \startMPcode
> draw btex $\vec{foo}$ etex;
> draw btex $\overrightarrow{foo}$ etex;
> \stopMPcode
> \stoptext
>
> This gives the following error output:
>
> It seems the \overrightarrow command uses \@@smash, which isn't defined when
> running from metapost?
>
> Is this expected? Is this a bug?
This is a bug in math-arr. All arrow macros should be unexpanded (but I
could not figure out how). Here is a workaround
\let\normaloverrightarrow\overrightarrow
\unexpanded\def\overrightarrow{\normaloverrightarrow}
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \overrightarrow not working in mathmode in Metapost?
2009-09-18 13:25 ` Aditya Mahajan
@ 2009-09-18 13:31 ` Matthijs Kooijman
2009-09-18 16:02 ` Hans Hagen
2009-10-30 11:30 ` Matthijs Kooijman
2 siblings, 0 replies; 7+ messages in thread
From: Matthijs Kooijman @ 2009-09-18 13:31 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 187 bytes --]
Hi Aditya,
> \let\normaloverrightarrow\overrightarrow
> \unexpanded\def\overrightarrow{\normaloverrightarrow}
I haven't got a clue what this means, but it worked! Thanks!
Gr.
Matthijs
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 487 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \overrightarrow not working in mathmode in Metapost?
2009-09-18 13:25 ` Aditya Mahajan
2009-09-18 13:31 ` Matthijs Kooijman
@ 2009-09-18 16:02 ` Hans Hagen
2009-10-30 11:30 ` Matthijs Kooijman
2 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2009-09-18 16:02 UTC (permalink / raw)
To: mailing list for ConTeXt users
Aditya Mahajan wrote:
> \let\normaloverrightarrow\overrightarrow
> \unexpanded\def\overrightarrow{\normaloverrightarrow}
ok, i made them all unexpandable
-----------------------------------------------------------------
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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \overrightarrow not working in mathmode in Metapost?
2009-09-18 13:25 ` Aditya Mahajan
2009-09-18 13:31 ` Matthijs Kooijman
2009-09-18 16:02 ` Hans Hagen
@ 2009-10-30 11:30 ` Matthijs Kooijman
2009-10-30 11:32 ` Taco Hoekwater
2 siblings, 1 reply; 7+ messages in thread
From: Matthijs Kooijman @ 2009-10-30 11:30 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 523 bytes --]
Hi all,
> >I've been trying to use the \overrightarrow command within a metapost graphic,
> >but it doesn't work. Math mode does work, for example \vec works like
> >expected. Outside of metapost, \overrightarrow works as expected.
This seems to broken for extensible math arrows like \xrightarrow as well.
> \let\normaloverrightarrow\overrightarrow
> \unexpanded\def\overrightarrow{\normaloverrightarrow}
And this fix helps there as well. Could this perhaps be fixed in general for
all extensible arrows?
Gr.
Matthijs
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 486 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \overrightarrow not working in mathmode in Metapost?
2009-10-30 11:30 ` Matthijs Kooijman
@ 2009-10-30 11:32 ` Taco Hoekwater
2009-10-30 11:57 ` Matthijs Kooijman
0 siblings, 1 reply; 7+ messages in thread
From: Taco Hoekwater @ 2009-10-30 11:32 UTC (permalink / raw)
To: mailing list for ConTeXt users
Matthijs Kooijman wrote:
> Hi all,
>
>>> I've been trying to use the \overrightarrow command within a metapost graphic,
>>> but it doesn't work. Math mode does work, for example \vec works like
>>> expected. Outside of metapost, \overrightarrow works as expected.
> This seems to broken for extensible math arrows like \xrightarrow as well.
>
>> \let\normaloverrightarrow\overrightarrow
>> \unexpanded\def\overrightarrow{\normaloverrightarrow}
> And this fix helps there as well. Could this perhaps be fixed in general for
> all extensible arrows?
Have you tried the new current yet? There was a whole bunch of extra
\unexpanded-s in it already.
Best wishes,
Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \overrightarrow not working in mathmode in Metapost?
2009-10-30 11:32 ` Taco Hoekwater
@ 2009-10-30 11:57 ` Matthijs Kooijman
0 siblings, 0 replies; 7+ messages in thread
From: Matthijs Kooijman @ 2009-10-30 11:57 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 251 bytes --]
Hi Taco,
> Have you tried the new current yet? There was a whole bunch of extra
> \unexpanded-s in it already.
You're right, thanks! I had built the new context but forgot to install it on
this particular machine :-)
Sorry for the noise,
Matthijs
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 486 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-10-30 11:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-18 12:39 \overrightarrow not working in mathmode in Metapost? Matthijs Kooijman
2009-09-18 13:25 ` Aditya Mahajan
2009-09-18 13:31 ` Matthijs Kooijman
2009-09-18 16:02 ` Hans Hagen
2009-10-30 11:30 ` Matthijs Kooijman
2009-10-30 11:32 ` Taco Hoekwater
2009-10-30 11:57 ` Matthijs Kooijman
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).