From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/6205 Path: main.gmane.org!not-for-mail From: Jose Luis Diaz Newsgroups: gmane.comp.tex.context Subject: MetaPost question Date: Sat, 17 Nov 2001 20:54:42 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <190113640906.20011117205442@telecable.es> Reply-To: Jose Luis Diaz NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035396746 8483 80.91.224.250 (23 Oct 2002 18:12:26 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:12:26 +0000 (UTC) Original-To: ConTeXt Mailing List Xref: main.gmane.org gmane.comp.tex.context:6205 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:6205 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