[metapost] Typeset the value of a variabe using LaTeX in METAPOST

Ph.Ivaldi philo_fr_11 at tele2.fr
Tue Oct 24 01:08:55 CEST 2006


Le 23 octobre 2006 à 23h54:59,
j.romildo at gmail.com écrivit :

> Hello.

Hello,

>
> How can  I typeset with LaTeX  the value of variable  in Metapost. Say
> for instance that I  want to put an axe in a  row and have its tickets
> labeled, with the labels formatted with LaTeX:

prologue:=2;
verbatimtex
%&latex
\documentclass{article}
\begin{document}
etex

input TEX;

beginfig(0)
  u := 6mm;
  drawarrow (0,0)--(11u,0);
  for i = 0 upto 10:
    draw (i*u,-1mm) -- (i*u,1mm);
    label.bot (TEX decimal(i), (i*u,-1mm) );
   %           ^^^^^^^^^^^^^^
  endfor;
endfig;

verbatimtex
\end{document}
etex

end;

Regards,
-- 
   Philippe Ivaldi.
http://home.tele2.fr/phivaldi/index.html


More information about the metapost mailing list