[metapost] TeX formulas and withpen

Petr Kalinin petr at kalinin.nnov.ru
Thu Oct 1 17:18:58 CEST 2009


The following code

draw btex $\sqrt a \over b $ etex withpen pencircle scaled 2pt;

produces a formula with very thick lines in the fraction and in the 
square root sign over a. This seems very strange for me. Is there any 
way to override this without changing the actual draw command?

I have experimented with generated .mpx file and this seems to root from 
the possibility to override pen when drawing a picture, like following:

picture p;
addto p doublepath (0,0)--(1cm,0) withpen pencircle scaled 0.4;
draw p withpen pencircle scaled 2pt;

which results in a thick line, while removing "withpen pencircle scaled 
2pt" results in a thin line.

In fact, I was using GnuPlot to produce metapost output, and have found 
that GnuPlot changes the currentpen via drawoptions, thus affecting also 
the text typesetted via btex/etex. As a result, the lines in my 
fractions have different widths depending on the last plot line drawn 
before them. Can you suggest any way to override this problem?

Petr Kalinin,
petr at kalinin.nnov.ru

More information about the metapost mailing list