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 via email to