Re: [NTG-context] Ampersand in Metapost

2010-05-14 Thread Marco
On Fri, 14 May 2010 17:20:35 +0200, Mojca Miklavec wrote: [...] > > Here are my results: > > > > -There is one obvious reason: speed > > > > Average runtime: > >    textext  variant: 56s > >    \sometxt variant: 57s > > > > That is the same. Maybe my test file is not appropriate to test the > > sp

Re: [NTG-context] Ampersand in Metapost

2010-05-14 Thread Mojca Miklavec
On Fri, May 14, 2010 at 12:06, Marco wrote: > On Fri, 14 May 2010 00:37:44 +0200, Mojca Miklavec wrote: > >> PS: I would say: better use \sometxt which is far more reliable unless >> you have to use textext to do string manipulation. > I don't know exactly which transformations are considered as »s

Re: [NTG-context] Ampersand in Metapost

2010-05-14 Thread Hans Hagen
On 14-5-2010 3:07, Aditya Mahajan wrote: This is because the commands are interpreted with TeX before they are written to mpgraph.mp. The \letterampersand or \& generates the character & alone: you need to preceed it with backslash, so that metapost finally knows what to do. So, should all the

Re: [NTG-context] Ampersand in Metapost

2010-05-14 Thread Hans Hagen
On 14-5-2010 1:45, Marco wrote: On Fri, 14 May 2010 12:44:47 +0200, Hans Hagen wrote: On 14-5-2010 12:06, Marco wrote: for i=0 downto -3: ran; label(\sometxt{\bold{Test}}, (7cm,-4cm)) rotatedaround ((7cm,-4cm),i*20) withcolor transparent("normal", .2, (r,g,b)); endfor; b

Re: [NTG-context] Ampersand in Metapost

2010-05-14 Thread Marco
On Fri, 14 May 2010 12:44:47 +0200, Hans Hagen wrote: > On 14-5-2010 12:06, Marco wrote: > > for i=0 downto -3: > >ran; > >label(\sometxt{\bold{Test}}, (7cm,-4cm)) > > rotatedaround ((7cm,-4cm),i*20) > > withcolor transparent("normal", .2, (r,g,b)); > > endfor; > > because tran

Re: [NTG-context] Ampersand in Metapost

2010-05-14 Thread Hans Hagen
On 14-5-2010 12:06, Marco wrote: for i=0 downto -3: ran; label(\sometxt{\bold{Test}}, (7cm,-4cm)) rotatedaround ((7cm,-4cm),i*20) withcolor transparent("normal", .2, (r,g,b)); endfor; because transparent overloads the mechanism that sometxt (textext) uses for passing info to te

Re: [NTG-context] Ampersand in Metapost

2010-05-14 Thread Hans Hagen
On 14-5-2010 12:06, Marco wrote: iii) Why should I better use \sometxt? sometxt was introduced in mkii to avoid text processing mp, i.e. it is done at the context end in the current run and mp only gets dimensions; so, it avoids the nested tex run in mkii there is some more trickery and

Re: [NTG-context] Ampersand in Metapost

2010-05-14 Thread Marco
> > - label(textext("\letterbackslash\letterampersand"),origin); > > - label(textext("\letterbackslash\&"),origin); > > > > This is because the commands are interpreted with TeX before they > > are written to mpgraph.mp. The \letterampersand or \& generates the > > character & alone: you need to pr

Re: [NTG-context] Ampersand in Metapost

2010-05-14 Thread Marco
On Fri, 14 May 2010 00:37:44 +0200, Mojca Miklavec wrote: > On Thu, May 13, 2010 at 23:45, Marco wrote: > > On Thu, 13 May 2010 22:58:46 +0200, Hans Hagen > > wrote: > >> On 13-5-2010 9:18, Marco wrote: > >> > Hi, > >> > > >> > I have a problem producing an ampersand in metapost. In ConTeXt > >

Re: [NTG-context] Ampersand in Metapost

2010-05-13 Thread Aditya Mahajan
On Fri, 14 May 2010, Mojca Miklavec wrote: On Thu, May 13, 2010 at 23:45, Marco wrote: On Thu, 13 May 2010 22:58:46 +0200, Hans Hagen wrote: On 13-5-2010 9:18, Marco wrote: > Hi, > > I have a problem producing an ampersand in metapost. In ConTeXt it > works as expected. Have a look at the fo

Re: [NTG-context] Ampersand in Metapost

2010-05-13 Thread Mojca Miklavec
On Thu, May 13, 2010 at 23:45, Marco wrote: > On Thu, 13 May 2010 22:58:46 +0200, Hans Hagen wrote: >> On 13-5-2010 9:18, Marco wrote: >> > Hi, >> > >> > I have a problem producing an ampersand in metapost. In ConTeXt it >> > works as expected. Have a look at the following example. >> > >> > \sta

Re: [NTG-context] Ampersand in Metapost

2010-05-13 Thread Marco
On Thu, 13 May 2010 22:58:46 +0200, Hans Hagen wrote: > On 13-5-2010 9:18, Marco wrote: > > Hi, > > > > I have a problem producing an ampersand in metapost. In ConTeXt it > > works as expected. Have a look at the following example. > > > > \starttext > > \& % OK > > \startMPcode > > label(textex

Re: [NTG-context] Ampersand in Metapost

2010-05-13 Thread Mojca Miklavec
On Thu, May 13, 2010 at 22:58, Hans Hagen wrote: > On 13-5-2010 9:18, Marco wrote: >> >> I have a problem producing an ampersand in metapost. In ConTeXt it works >> as expected. Have a look at the following example. >> >> \starttext >> \&  % OK >> \startMPcode >> label(textext("\&"),origin); % prod

Re: [NTG-context] Ampersand in Metapost

2010-05-13 Thread Hans Hagen
On 13-5-2010 9:18, Marco wrote: Hi, I have a problem producing an ampersand in metapost. In ConTeXt it works as expected. Have a look at the following example. \starttext \& % OK \startMPcode label(textext("\&"),origin); % produces error \stopMPcode \stoptext The compile time error message is

[NTG-context] Ampersand in Metapost

2010-05-13 Thread Marco
Hi, I have a problem producing an ampersand in metapost. In ConTeXt it works as expected. Have a look at the following example. \starttext \& % OK \startMPcode label(textext("\&"),origin); % produces error \stopMPcode \stoptext The compile time error message is as follows: ! Misplaced alignmen