Mlpost manual

Usage

To make PostScript figures with Mlpost, follow these steps:
  1. Define your figures in an Ocaml file fig.ml
    	 let fig_a = ...
    	 let fig_b = ...
    
    Each figure has type Command.figure.
  2. Add some code to emit Metapost code, as follows
      
    	let () = Metapost.emit "file_a" fig_a
    	let () = Metapost.emit "file_b" fig_b
    
  3. Then run the mlpost program on this file
           mlpost fig.ml
    
    It will create PostScript figures in files file_a.1, file_b.1, etc.

Options

mlpost supports the following options:
-pdf
creates .mps files instead of .1, for inclusion in LaTeX files compiled with pdflatex (the PostScript file is actually the same, but the suffix is used by pdflatex to identify PostScript produced by Metapost)

-latex main.tex
indicates the main LaTeX file, from which the prelude is extracted to be passed to Metapost (this way you can use macros, fonts and packages from your LaTeX document in your figures). main.tex has to contain at least a documentclass and the line "\begin{document}". The contents of this file are taken into account up to the "\begin{document}" part.

Français / English / Deutsch