In article <[EMAIL PROTECTED]>,
 Aditya Mahajan <[EMAIL PROTECTED]> wrote:

> On Sat, 23 Jun 2007, nicola wrote:
> 
> > Hi,
> > given the following XeConTeXt document (I use ConTeXt  ver: 2007.01.12):
> >
> > \definetypeface[MyMainFace][rm][Xserif][Charis SIL][default][encoding=uc]
> > \definetypeface[MyMainFace][mm][math][euler][euler]
> > \setupbodyfont[MyMainFace,10pt]
> >
> > \startuseMPgraphic{foo}
> >   for i = 0 upto 10:
> >      % Draw a label at position (i*cm,0)
> >   endfor;
> > \stopuseMPgraphic
> >
> > \starttext
> > \midaligned{\useMPgraphic{foo}}
> > \stoptext
> >
> > is it possible to replace the comment with an instruction (or a macro),
> > such that I do not get compilation errors and I get consistent font
> > usage?
> >
> > I have tried the following possibilities:
> >
> > a) label("test",(i*cm,0)); % Complains about missing metrics for font
> > b) label(\textext{test},(i*cm,0)); % Ditto
> 
> This is strange. Do you also get this error if you use pdftex instead 
> of xetex?
> 
> > c) label(btex test $x$ etex,(i*cm,0));  % Results in wrong font
> > d) label(\sometxt{test},(i*cm,0)); % Ok, right font, but loop is ignored
> >
> > The best option to my knowledge is \sometxt, but I have read that it
> > cannot be used in loops. Before I start unrolling all the loops in my
> > figures
> >
> > 1) is it possible to specify the fonts in an MPenviroment? If so, how?
> 
> Just as you will specify fonts in your regular document. 

Putting the same definitions inside \startMPinclusions... 
\stopMPinclusions does not seem to work with XeTeX.

> Have you checked \startTeXtexts ...\stopTeXtexts? See Section 4.4 of 
> Mojca's MyWay on \sometxt 
> (http://dl.contextgarden.net/myway/sometxt.pdf)

Ah, I did not know about those commands: that works! Just a silly 
question, though: how do I change

\startTeXtexts 
   \dorecurse{10}{\TeXtext{\recurselevel}{$x_{\recurselevel}$}} 
\stopTeXtexts 

so that I can print labels from x_0 up to x_9? Do I need to use 
\defineconversion and \convertnumber?

Nicola

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

Reply via email to