From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Value of Metapost variable as a label
Date: Sat, 21 Mar 2009 18:04:25 -0400 (EDT) [thread overview]
Message-ID: <alpine.LNX.2.00.0903211802330.13753@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <3b4b12310903211339h5b325c67k3e504e81cdc33e0c@mail.gmail.com>
On Sat, 21 Mar 2009, Curiouslearn wrote:
> Hello,
>
> First of all, Mojca thanks very much for the update about TikZ. (I could not
> find an option to reply in Context Garden mailing list).
>
> My new question is the following. I have the following code to generate the
> labels for the tick marks:
>
> for i = 0 step 5 until 45:
> draw (i,0)*u -- (i,-0.2)*u;
> label.bot(decimal(i) ,(i,-0.2)*u);
> endfor;
>
> As you can see I use "decimal(i)" to get the labels (0,5,10,... and so on).
> But the font of these numbers is not the same as when I use the "btex
> label_text etex" command, which I have set to palatino. How can I typeset
> the value of Metapost variables (such as "i" in this case), using tex
> commands.
label.bot (textext(decimal(i)), (...)) ;
> For example, if I had to typeset (n_{1},n{2},...,n_{100}), how
> could I do that.
label.bot (textext("$n_{" & decimal i & "}"), ... ) ;
etc.
> On page 63 of John Hobby's metapost manual, he talks about how this could be
> achieved using TEX.mp. I tried typing \input TEX before \starttext, however,
> I get the error "I can't find file `TEX;' If I put it within the
> \startuseMPgraphic and \stopuseMPgraphic, it still does not work. Do I have
> to download this from somewhere or does Context have another solution?
Use textext.
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
___________________________________________________________________________________
next prev parent reply other threads:[~2009-03-21 22:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-21 20:39 Curiouslearn
2009-03-21 22:04 ` Aditya Mahajan [this message]
2009-03-21 22:40 ` Curious Learn
2009-03-22 2:53 ` Eythan Weg
2009-03-23 0:36 ` Mojca Miklavec
2009-03-23 2:24 ` Aditya Mahajan
2009-03-24 1:57 ` Eythan Weg
2009-03-24 4:16 ` Aditya Mahajan
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=alpine.LNX.2.00.0903211802330.13753@ybpnyubfg.ybpnyqbznva \
--to=adityam@umich.edu \
--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).