[metapost] nonstopmode interaction

Pétiard François petiard.francois at free.fr
Fri Oct 14 07:04:44 CEST 2011

Le 13/10/2011 23:32, Troy Henderson a écrit :
> Here is my dilemma.  I have written a homemade function grapher (which 
> currently does only 3D function surface plots but will eventually do 
> 2D function plots, 2D and 3D parametric curves/surfaces, and perhaps 
> more).
> http://www.tlhiv.org/mpgraph/ (Only tested in Mozilla Firefox currently)
> The user provides a function, a domain (and optional range) as well as 
> several other tweaks for the graph.  One of the tweaks is how the x,y, 
> and z axes are labeled.  Everything is computed internally with Perl 
> (CGI) and Perl simply writes a MetaPost file that stores everything 
> (filled paths, stroked paths, labels, etc.).  The only thing that the 
> user can "break" in the MetaPost file is providing a x,y,z axis label 
> (using TeX code) that does not typeset.  Everything else is generated 
> safely with the Perl script.
> So, I would like to either
> 1) have MetaPost continue through compilation errors caused by the 
> labels resulting in a nice picture without labels (which seems unlikely)
> 2) have some way to let the user know that a label has failed (which 
> seems doable, I'm just not clear how to do this)
> I would appreciate any ideas that anyone may have.
> Troy

Nice job!

An idea:

Can't you, with the three labels:
1/ create a file labels.tex
2/ latex labels.tex
3/ if there are no errors, OK, you insert the labels in the .mp file;
      if there are errors, you don't insert the labels in the .mp file.


More information about the metapost mailing list