Download User guide
Transcript
3
E Standalone picture files
35
F Related packages
36
1 Usage
1.1 Structure of a METAPOST file using drv
Preamble
input drv;
verbatimtex%&latex
hLATEX preamblei
\begin{document}
etex;
Figures
hoptional drv tuningsi
beginfig(hindexi)
hjudgment and inference declarationsi
draw drv_tree;
hoptional extra METAPOST codei
endfig;
Postamble
end
For each “beginfig(hindexi), endfig;” pair in a file hjobnamei.mp, METAPOST generates an Encapsulated PostScript file hjobnamei.hindexi.
1.2 Running METAPOST
You have to run at least twice
mpost hjobnamei.mp
(once more if you use sub-tree delimiters, see § 2.4). On the first run METAPOST
collects the LATEX code generated by drv declaration macros and writes it to the file
hjobnamei-delayed.mp. On the second run METAPOST preprocesses the LATEX
code in hjobnamei-delayed.mp and then typesets the derivation trees.
If you get an error on the first run then it comes from the drv/METAPOST
code. If you get an error on the second run then it comes from the LATEX code. In
both cases, correct the error (see Appendix A), delete hjobnamei-delayed.mp and
run “mpost hjobnamei.mp” twice again (a makefile can do that for you).