ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jose Luis Diaz <jldiaz@telecable.es>
Subject: MetaPost question
Date: Sat, 17 Nov 2001 20:54:42 +0100	[thread overview]
Message-ID: <190113640906.20011117205442@telecable.es> (raw)

Hello ConTeXt users,

 Sorry  for posing a question not about ConTeXt, but I realize that in
 this  list there also are people very fluent in Metapost. My question
 is:

 How  can I convert a number in a string, concatenate this string with
 other strings and have TeX to typeset the whole result?

 I.e., suppose that I have an array of numbers:

    pair t[];
    t[1]=3; t[2]=20; t[3]=25;

 For example, these numbers are some points along an abcise axis. Then
 I want to put a big dot at each of these points. Not difficult:

  for i=1 upto 3: draw (0u, t[i]*u) withpen circlepen scaled 4mm;
  endfor;

 But  then  suppose  that  I also want a label below each dot, typeset
 with  TeX,  which  reads:  $t_1=3$,  $t_2=20$,  $t_3=25$. I can't use
 btex/etex  because I want to construct the text $t_1=3$ from the loop
 variable, something like:

  for i=1 upto 3:
    sprintf(string,"$f_%d=%d$",i,t[i]);  %This is not Metapost, obviusly
    label.bot(TEX(string), (0u, t[i]*u)); % This is
  endfor;

  How can be done?

  Thanks.

-- 
  Jose Luis Diaz


             reply	other threads:[~2001-11-17 19:54 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-17 19:54 Jose Luis Diaz [this message]
2001-11-18  6:18 ` Johannes H?sing
2001-11-18 11:57 ` Denis B. Roegel
2001-11-18 13:17   ` Re[2]: " Jose Luis Diaz
2005-06-14  6:54 Metapost question Tobias Burnus
2005-06-14  7:42 ` Taco Hoekwater
2005-06-14 10:51   ` h h extern
2005-06-14  7:56 ` Albrecht Kauffmann
2007-05-02 20:38 MetaPost question Tobias Burnus
2007-05-02 20:46 ` Aditya Mahajan
2007-05-04 21:18   ` Aditya Mahajan
2007-06-28 17:27 Tobias Burnus
2007-06-28 17:48 ` Taco Hoekwater
2007-10-08 13:47 metapost question Thomas A. Schmitz
2007-10-08 16:49 ` Otared Kavian
2007-10-08 17:34   ` Thomas A. Schmitz
2007-10-08 18:10   ` Jesse Alama
2007-10-23 12:17     ` Thomas A. Schmitz
2007-10-23 12:26       ` Hans Hagen
2007-10-23 20:58         ` Thomas A. Schmitz
2008-06-18 11:14 Thomas A. Schmitz
2008-06-18 11:43 ` Wolfgang Schuster
2008-06-18 11:58 ` Peter Rolf
2008-06-18 12:11   ` Thomas A. Schmitz
2009-05-11 15:14 Metapost question Jean Magnan de Bornier
2009-05-11 15:34 ` Peter Rolf
2009-05-11 16:27   ` Jean Magnan de Bornier
2009-05-11 15:42 ` Mojca Miklavec
2009-05-11 15:58   ` Mojca Miklavec
2009-05-11 16:31     ` Jean Magnan de Bornier
2009-05-11 16:52       ` Mojca Miklavec
2009-05-11 17:33         ` Jean Magnan de Bornier
2009-05-11 18:02           ` Mojca Miklavec
2009-05-12  4:33             ` Jean Magnan de Bornier
2009-05-12  7:42               ` Taco Hoekwater
2009-05-12 14:15                 ` Jean Magnan de Bornier
2009-05-12 14:32                   ` Aditya Mahajan
2009-05-12 15:11                     ` Jean Magnan de Bornier
2009-05-12 15:53                       ` Taco Hoekwater
2009-05-12 16:37                         ` Jean Magnan de Bornier
2009-05-13  6:45                           ` Taco Hoekwater
2009-05-13  8:19                             ` Jean Magnan de Bornier
2009-05-11 18:16           ` Jean Magnan de Bornier
2009-05-11 17:01   ` Hans Hagen
2009-05-11 18:08     ` Mojca Miklavec
2009-05-11 15:47 ` Aditya Mahajan
2011-10-21 13:05 metapost question Hans van der Meer
2011-10-21 15:13 ` Peter Rolf
2011-10-21 15:34   ` Meer, H. van der
2011-10-21 18:13   ` Meer, H. van der
2011-10-21 18:02 ` Nicola
2011-12-01 22:25 Hans van der Meer
2011-12-01 23:30 ` Peter Rolf
2015-12-06 20:54 MetaPost Question Context NTG
2015-12-06 21:49 ` Alan BRASLAU
2015-12-07 15:58 ` Context NTG

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=190113640906.20011117205442@telecable.es \
    --to=jldiaz@telecable.es \
    /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).