mktex scripts β Scripts to generate TeX-related files on the fly
| Use Case | Command | Description |
|---|---|---|
| π€ Generate a missing font PK | mktexpk |
Create bitmap font files (PK) when a document requests a font not yet installed |
| π Generate a missing TFM | mktextfm |
Create TeX font metric files (TFM) for fonts not yet available |
| π¨ Generate a missing Metafont source | mktexmf |
Create Metafont (.mf) input files on demand |
| π Generate a missing format | mktexfmt or fmtutil |
Create TeX .fmt, Metafont .base, or MetaPost .mem memory dumps |
| π€ Generate a missing Omega file | mkocp |
Create Omega compiled process files (.ocp) |
| π Generate a missing Omega font metric | mkofm |
Create Omega font metric files (.ofm) |
| π§ Override script name | DVIPSMAKEPK (env var) |
Set environment variable to override the default mktex script name |
| π Log missing font errors | missfont.log |
After a failed mktex invocation, append the command to this log file for later execution |
If Kpathsea cannot otherwise find a file, for some file types it is configured by default to invoke an external program to create it dynamically (see mktex configuration). These are collectively known as "'mktex' scripts", since most of them are named 'mktexβ¦'.
For example, this is useful for fonts (bitmaps, TFM's, and arbitrarily-sizable Metafont sources such as the Sauter and EC fonts), since any given document can use fonts never before referenced. Building all fonts in advance is therefore impractical, if not impossible.
It is also useful for the TeX '.fmt' (and Metafont '.base' and Metapost '.mem' files, see (Web2c)Memory dumps), where pre-generating every format consumes a lot of both time and space.
The script is passed the name of the file to create and possibly other arguments, as explained below. It must echo the full pathname of the file it created (and nothing else) to standard output; it can write diagnostics to standard error.
The list of file types and program names that can run an external program to create missing files is listed in the next section. In the absence of 'configure' options specifying otherwise, everything but 'mktextex' will be enabled by default. The 'configure' options to change the defaults are:
--without-mktexfmt-default
--without-mktexmf-default
--without-mktexocp-default
--without-mktexofm-default
--without-mktexpk-default
--without-mktextfm-default
--with-mktextex-default
The 'configure' setting is overridden if the environment variable or configuration file value named for the script is set; e.g., 'MKTEXPK' (see mktex script arguments).
'mktexfmt' reads a file 'fmtutil.cnf', typically located in 'texmf/web2c/' to glean its configuration information. The rest of the files and features in this section are primarily intended for the font generation scripts.
As distributed, all the scripts source a file 'texmf/web2c/mktex.cnf' if it exists, so you can override various defaults. See 'mktex.opt', for instance, which defines the default mode, resolution, some special directory names, etc. If you prefer not to change the distributed scripts, you can simply create 'mktex.cnf' with the appropriate definitions (you do not need to create it if you have nothing to put in it). 'mktex.cnf' has no special syntax; it's an arbitrary Bourne shell script. The distribution contains a sample 'mktex.cnf' for you to copy and modify as you please (it is not installed anywhere).
In addition, you can configure a number of features with the 'MT_FEATURES' variable, which you can define:
If none of the options below are enabled, 'mktexpk', 'mktextfm', and 'mktexmf' follow the following procedure to decide where fonts should be installed. Find the tree where the font's sources are, and test the permissions of the 'fonts' directory of that tree to determine whether it is writable. If it is, put the files in the tree in appropriate locations. If it isn't writable, see whether the tree is a system tree (named in 'SYSTEXMF'). If so, the 'VARTEXFONTS' tree is used. In all other cases the working directory is used.
The 'appendonlydir' option is enabled by default.
The following table shows the default name of the script for each of the file types which support runtime generation.
These names can be overridden by an environment variable specific to the programβfor example, 'DVIPSMAKEPK' for Dvipsk.
If a 'mktexβ¦' script fails, the invocation is appended to a file 'missfont.log' (by default) in the current directory. You can then execute the log file to create the missing files after fixing the problem.
If the current directory is not writable and the environment variable or configuration file value 'TEXMFOUTPUT' is set, its value is used. Otherwise, nothing is written. The name 'missfont.log' is overridden by the 'MISSFONT_LOG' environment variable or configuration file value.
The first argument to a 'mktex' script is always the name of the file to be created.
In the default 'mktexpk' implementation, additional arguments may also be passed:
--dpi NUM β Sets the resolution of the generated font to NUM.--mfmode NAME β Sets the Metafont mode to NAME.--bdpi NUM β Sets the "base dpi" for the font. This must match the mode being used.--mag STRING β A "magstep" string suitable for the Metafont 'mag' variable. This must match the combination of BDPI and DPI being used.--destdir STRING β A directory name. If the directory is absolute, it is used as-is. Otherwise, it is appended to the root destination directory set in the script.Generated by phpman v4.10.0-16-g1a0e228 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-22 03:48 @216.73.216.44
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)