---
name: "mft"
section: "1"
platform: "linux"
package: "texlive-doc"
version: "2026.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/mft"
---

# mft(1)

translate Metafont or MetaPost code to TeX for prettyprinting

## NAME

mft - translate Metafont or MetaPost code to TeX for prettyprinting

## SYNOPSIS

**mft** \[*options*\] ***source\_file***\[**.mf**\|**.mp**\]

## DESCRIPTION

The **mft** program creates a TeX file from a Metafont or MetaPost program. It takes appropriate care of typographic details like page layout and the use of indentation, italics, boldface, etc., as illustrated in the book *Computer Modern Typefaces* by Donald Knuth.

Special conventions in Metafont and MetaPost comments allow you to control things that would not otherwise come out right; section 1 of the **mft** source program and the mft section in the Web2C manual explain these rules.

The **mft** program uses an optional change file (which works just as the change files to [**tangle**(1)](/tangle/1.md) and [**weave**(1)](/weave/1.md) do) and one or several style files (which are prepended to everything). If no style file is specified, the style file **plain.mft** for Metafont, or **mplain.mft** for MetaPost, is used.  These files are specified via the options below.

The *source\_file*, as well as any change and style files, are searched for using the MFINPUTS (for Metafont) or MPINPUTS (for MetaPost) and MFTINPUTS environment variables if you have set them, or else the corresponding system defaults.

The output TeX file name is formed by using **.tex** in place of the extension of *source\_file*.

## OPTIONS

See [**tex**(1)](/tex/1.md) for details of command-line parsing.

- **-change=***change\_file***\[.ch\]**

  Apply the change file *change\_file* to *mf\_file*.

- **-metapost**

  Consider *source\_file* to be a MetaPost source file; this is the default if *mf\_file* has the extension **.mp**.

- **-style=***style\_file***\[.mft\]**

  Use the style file *style\_file* instead of **plain.mft** or **mplain.mft**; this option can be given more than once.

The standard **-help** and **-version** options are also supported.

## FILES

- *mftmac.tex, mptmac.tex*

  TeX macros used by the output from **mft** for Metafont and MetaPost input, respectively.

- *plain.mft*, *mplain.mft*

  Default style files.

- *cmbase.mft*

  Style file for Computer Modern.

- *e.mft*

  Style file for Knuth's Volume E: Computer Modern Typefaces.

## SEE ALSO

[**mf**(1)](/mf/1.md), [**mpost**(1)](/mpost/1.md), [**weave**(1)](/weave/1.md).\
 Donald E. Knuth, *Computer Modern Typefaces* (Volume E of *Computers & Typesetting*).\
 Donald E. Knuth et al., *Metafontware*.

Package page on CTAN: https://ctan.org/pkg/mft\
 Section in the Web2c manual: https://tug.org/texinfohtml/web2c.html#mft-invocation\
 Typeset source code, including the typesetting controls: https://ctan.org/pkg/knuth-pdf

## AUTHORS

Donald E. Knuth wrote and still maintains the program. He ported it to Unix with the help of Pierre MacKay and the Unix port of **weave** by Howard Trickey and Pavel Curtis.

Public discussion list and bug reports: https://lists.tug.org/tex-k
