{
    "mode": "info",
    "parameter": "mpost",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/mpost/json",
    "generated": "2026-11-14T11:01:52Z",
    "sections": {
        "File: web2c.info,  Node: mpost invocation,  Next: Initial MetaPost,  Up: MetaPost": {
            "content": "",
            "subsections": [
                {
                    "name": "7.1 'mpost' invocation",
                    "content": ""
                }
            ]
        },
        "MetaPost (installed as 'mpost') reads a series of pictures specified in": {
            "content": "the MetaPost programming language, and outputs corresponding PostScript\ncode.  This section merely describes the options available in the Web2c\nimplementation.  For a complete description of the MetaPost language,\nsee AT&T technical report CSTR-162, generally available in\n'TEXMF/doc/metapost/', where TEXMF is the root of TeX directory\nstructure.  The MetaPost home page: <https://tug.org/metapost>.\n\nAlso, a standard MetaPost package for drawing graphs is documented in\nAT&T technical report CSTR-164, available as the file 'mpgraph.ps',\ngenerally stored alongside 'mpman.ps'.\n\nMetaPost processes its command line and determines its memory dump\n(mem) file in a way analogous to Metafont and TeX (*note 'tex'\ninvocation: tex invocation, and *note Memory dumps::).  Synopses:\n\nmpost [OPTION]... [MPNAME[.mp]] [MP-COMMANDS]\nmpost [OPTION]... \\FIRST-LINE\nmpost [OPTION]... &MEM ARGS\n\nMetaPost searches the usual places for the main input file MPNAME\n(*note (kpathsea)Supported file formats::), extending MPNAME with '.mp'\nif necessary.  To see all the relevant paths, set the environment\nvariable 'KPATHSEADEBUG' to '-1' before running the program.\n\nMetaPost writes its PostScript output to a series of files\n'BASEMPNAME.NNN' (or perhaps 'BASEMPNAME.ps', very occasionally\n'BASEMPNAME.tfm'), where NNN are the figure numbers specified in the\ninput, typically to the 'beginfig' macro, and BASEMPNAME is the basename\nof MPNAME, or 'mpout' if no input file was specified.  MetaPost uses the\n'.ps' extension when the figure number is out of range, e.g., if you say\n'beginfig(-1)'.\n\nYou can use the output files as figures in a TeX document just as\nwith any other PostScript figures.  For example, with this TeX command:\n\\special{psfile=\"FILENAME\"}\nor by using 'epsf.tex' (*note (dvips)EPSF macros::).\n\nThe MetaPost construct\nbtex ... TEX-INPUT ... etex\ngenerates a MetaPost picture expression corresponding to TEX-INPUT.\n\nThe construct\nverbatimtex ... TEX-INPUT ... etex\nsimply passes the TEX-INPUT through to TeX.  For example, if you are\nusing LaTeX, your MetaPost input file must start with a 'verbatimtex'\nblock that gives the necessary '\\documentclass' (or '\\documentstyle')\n'\\begin{document}' command.  You will also need to set the environment\nvariable 'TEX' to 'latex'.\n\nTEX-INPUT need not be specifically TeX input; it could also be Troff.",
            "subsections": []
        },
        "In that case, you will need the '-m pictures' Troff macro package": {
            "content": "(unfortunately absent from many Troff implementations), or an equivalent\nsuch as the '-m pspic' macros from GNU groff described in grops(1).\n\nNaturally, you must use fonts that are supported by the typesetter;\nspecifically, you'll probably want to use standard PostScript fonts with",
            "subsections": []
        },
        "Troff.  And only the TeX system understands Computer Modern or other": {
            "content": "Metafont fonts; you can also use PostScript fonts with TeX, of course.\n\nMetaPost-generated PostScript figures which do use Computer Modern\nfonts for labels cannot be directly previewed or printed.  Instead, you\nmust include them in a TeX document and run the resulting DVI file\nthrough Dvips to arrange for the downloading of the required fonts\n(*note (dvips)Fonts in figures::).  To help with this, the MetaPost\ndistribution provides a small TeX file 'mproof.tex' which is typically\ncalled as:\ntex mproof MP-OUTPUT-FILES... ; dvips mproof -o\nThe resulting file 'mproof.ps' can then be printed or previewed.\n\nTo generate EPSF files, set the internal MetaPost variable\n'prologues' positive.  To make the output files self-contained, use only\nstandard PostScript fonts.  MetaPost reads the same 'psfonts.map' file\nas Dvips, to determine PostScript fonts that need to be downloaded\n(*note (dvips)psfonts.map::).\n\nIt is possible for pdfTeX to read MetaPost output directly; this is\nin contrast to general EPSF files, which have to be converted for use\nwith PDF output.  The easiest way is to name the MetaPost output files\nwith the '.mps' extension.  Then the LaTeX '\\includegraphics' command,\nfor example, will be able to read them, even when outputting PDF.\n\nMetaPost can write output files, via the 'write' primitive; this\nopens a security hole.  *Note tex invocation::.\n\nThe program accepts the following options, as well as the standard\n'-help' and '-version' (*note Common options::):\n'-[no]-file-line-error'\n'-fmt=FMTNAME'\n'-halt-on-error'\n'-ini'\n'-interaction=STRING'\n'-jobname=STRING'\n'-kpathsea-debug=NUMBER'\n'-[no]parse-first-line'\n'-output-directory'\n'-progname=STRING'\n'-recorder'\n'-translate-file=TCXFILE'\n'-8bit'\nThese options are common to TeX, Metafont, and MetaPost.  *Note\nCommon options::.\n\n'-T'\n'-troff'\nSet the 'prologues' internal variable to '1'.\n\n'-tex=TEXPROGRAM'\nWhen this option is given, the program TEXPROGRAM is used to\ntypeset the labels.\n",
            "subsections": []
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}