[metapost] Strange behavior with verbatimtex

Brooks Moses bmoses at stanford.edu
Wed Jul 6 11:18:34 CEST 2005


At 02:03 AM 7/6/2005, Yann SALMON wrote:
>I am using Metapost 0.904 (MiKTeX 2.4) and I am surprised because the
>following code compiles
[...]
>But this causes a compilation error and I do not get any output file :
>--------------------------
>verbatimtex
>\documentclass{report}
>\begin{document}
[...]
>The problem is that I need to use LaTeX packages, and I cannot.

The reason for your problem is this: MetaPost, when called normally, 
processes the TeX input as plain TeX, not as LaTeX.  Thus, it's not 
surprising that your code worked fine until you included LaTeX-specific macros.

There are two methods that one can use to instruct MetaPost to process the 
TeX parts of the input file with LaTeX instead of plain TeX.  The first is 
to put a line containing just

   %&latex

as the first line of the file.  This is the simplest method, but it doesn't 
work on all systems.  Alternately, you can set an environment variable TEX 
to "latex", or run mpost with a command-line option, like so:

   mpost --tex=latex <myfile.mp>

where <myfile.mp> is the name of your MetaPost file.

Hope this helps,
- Brooks



More information about the metapost mailing list