About

{typewriter} is the term used for a "monospaced" font, that is, a font in which all characters have the same width.

is the term used for a monospaced font, that is, a font in which all characters have the same width.

This style of type is typically used to set examples of typesetting, source code listings, and screenplays.

There are a few different ways to achieve this effect in LaTeX.

  • The command \texttt{} will convert letters and numbers into monospaced font; however, it doesn't convert symbols such as _ and \.
  • \mathtt{} does the same thing in math mode, though its use is rare.
  • \verb converts all letters, numbers, and symbols in its argument into monospaced font. For longer passages, consider the or packages.
  • If you specifically want to typeset a URL, use the url package.
  • \tt is deprecated. Don't use it.

Frequently Asked Questions

  1. How can I get a good-looking underscore in text?
  2. How can I get bold, monospaced font?
  3. When should one use \verb versus \texttt?
  4. How can I break lines in long sections of \texttt?
history | excerpt history