[metapost] label and for loop

Dan T. Abell dabell at bikerider.com
Sat Nov 24 01:07:44 CET 2012


Yes. One way is the following:


input TEX;

for i=1 upto 10:
  label(TEX("$A_{" & decimal(i) & "}$"), z[i]);
endfor;


See sec. 13 of a recent version of the MetaPost manual.

Cheers,
	-Dan

On 23 Nov 2012, at 16:16, Ranousse wrote:

> I would like to write something like
> 
> for i = 1 upto 10
>  label( btex $A_i$ etex, z[i])
> endfor
> 
> so that I get A_0 for z0, A_1 for z1,...
> 
> Is it possible ?
> --
> http://tug.org/metapost/



More information about the metapost mailing list