[metapost] Open/True Type Fonts

Hans Hagen pragma at wxs.nl
Tue May 20 09:57:46 CEST 2008

Dan Luecking wrote:
> At 04:48 PM 5/18/2008, you wrote:
>> On Sun, May 18, 2008 at 2:37 AM, Troy Henderson wrote:
>>>  Does \sometxt do the same (or
>>> similar) as btex ... etex?
>> It has a similar purpose, but different mechanism. btex ... etex is
>> just as stupid as it can get. A while ago I wrote some code that
>> exported gnuplot graphs into ConTeXt. Now imagine 10 graphs with 20
>> labels each (to label axis with 0, 1, 2, 3, ... 10, a title of the
>> graph and so on ...). For each image (graph in my case), ConTeXt calls
>> metapost,
> That is probably he most inefficient way to proceed. If you need a 
> second context run anyway, all the graphs shoul be accumulated an 
> metapost called just once.

there is the option to do that but even then it may demand an extra pass 
because there can be multipass optimizations or situations where the 
first run provides info for the second run

anyhow, when luatex/mkiv is used mp processing time in a document comes 
close to zero (including embedded text); thousands of graphics per 
second is quite normal then

>> so that means 10 metapost runs inside a ConTeXt run. But
>> then each metapost calls another TeX instance to handle labels. Now,
>> I'm not really sure if it called TeX a single time or if it called it
>> 20 times, but I wouldn't be surprised if it called it 20 times,
> TeX is called just once for _each_ metapost input file if you use
> btex...etex. When any btex or verbatimtex is encountered, mpto is
> called, which scans the file for btex and passes all of them to TeX.
> If this has happened before and the .mp file was not changed, mpto
> detects that there is no need to regenerate labels and doesn't call
> TeX even once.

huh? in context btex/etex stuff is collected and there is never a direct 
call to tex

> (If you use the TEX() macro, it will write and then input a file for
> each macro call so TeX is called once per TEX() macro. That is
> remarkably inefficient, but should be avoided.)

i dunno that one

> If you write a script that puts all 10 graphs into one .mp file you get
> one call to Metapost and one to TeX. So btex/etex is not so stupid.


                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl

More information about the metapost mailing list