ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: nicola <vitacolo@dimi.uniud.it>
To: ntg-context@ntg.nl
Subject: Re: Label loops within a XeConTeXt document
Date: Sat, 23 Jun 2007 22:42:23 +0200	[thread overview]
Message-ID: <vitacolo-EBE3FC.22422323062007@sea.gmane.org> (raw)
In-Reply-To: <alpine.WNT.0.99.0706231512220.2368@nqvgln>

In article <alpine.WNT.0.99.0706231512220.2368@nqvgln>,
 Aditya Mahajan <adityam@umich.edu> 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	other threads:[~2007-06-23 20:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-23 18:12 nicola
2007-06-23 19:20 ` Aditya Mahajan
2007-06-23 20:42   ` nicola [this message]
2007-06-23 21:39     ` Aditya Mahajan
2007-06-23 22:09       ` nicola
2007-06-24  8:33       ` nicola

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vitacolo-EBE3FC.22422323062007@sea.gmane.org \
    --to=vitacolo@dimi.uniud.it \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).