Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to change the teletype (\ttfamily) font that I'm using in my document. (I'm using the scrartcl class.) I've searched on stackexchange and Google, but all I can find are answers to how to change the base font to teletype.

How can I change just the teletype font for my document?

share|improve this question
    
What do you want to use instead? For example, to make it equal to the normal font \renewcommand{\ttfamily}{\rmfamily} –  Sigur Feb 4 at 15:34
    
I still want to use a teletype font, just one that also has bold. –  Jeremy Feb 4 at 16:12

2 Answers 2

up vote 8 down vote accepted

LaTeX remembers the default font family for \ttfamily in macro \ttdefault. The default for \ttdefault in LaTeX (and KOMA-Script) without any other font packages is cmtt and addresses the teletype font of the Computer Modern fonts. Other examples:

  • lmvtt: variable width teletype font of Latin Modern fonts
  • qcr: TeX Gyre Cursor (similar to Courier)

Manually the font family for \ttfamily can be redefined, e.g.:

\renewcommand*{\ttdefault}{qcr}

Often there are font packages that take care of this and some other things. For example, TeX Gyre Cursor can be enabled by package tgcursor:

\usepackage{tgcursor}

Users of XeTeX and LuaTeX that support Unicode and OpenType fonts can use package fontspec and its possibilities to define and setup teletype fonts (e.g. \setmonofont).

share|improve this answer
\renewcommand{\ttdefault}{pcr}

for instance, will set the default monospaced font to Adobe Courier. You need to give the Karl Berry's name of the font, provided it has been prepared for use with latex.

This link gives a list of tt fonts prepared for use with LaTeX. If you want to use a font that is not prepared for LaTeX, you will have to do the job yourself, for example with fontinst.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.