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.

If I want to apply the courier font to a small piece of text in my file, how can I do that? I have searched around but can't seem to find information for the courier font.

share|improve this question
1  
By 'courier', are you actually referring to 'typewriter' (as part of the Computer Modern fonts, or to the specific mono-spaced font 'Courier'? –  Werner Aug 3 '11 at 20:25
    
I mean the specific mono-spaced font - Courier, that is typically used for programming code. –  Joeblackdev Aug 3 '11 at 20:34
3  
Courier is a very wide font. There are further mono-space fonts available if you are free to choose. –  Stefan Kottwitz Aug 3 '11 at 20:59
1  
I'd recommend Inconsolata: [ctan.org/pkg/inconsolata] –  Brent.Longborough Aug 4 '11 at 0:00

2 Answers 2

up vote 24 down vote accepted

Use the courier package. Consequently, the minimal example

\documentclass{article}
\usepackage{courier}
\begin{document}
This is not Courier font. \texttt{This is Courier font.}
\end{document}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

produces

Courier font in LaTeX

There is a marginal difference between the output generated via \texttt{...} with/without the courier package:

  • Without courier package:

Typewriter font in LaTeX

  • With courier package:

Courier font in LaTeX

share|improve this answer
    
Perfect. Thank you kindly for this. –  Joeblackdev Aug 3 '11 at 20:59

Is \texttt{} what you are looking for?

\documentclass{article}

\begin{document}
Here is some \texttt{fixed width} text.
\end{document}
share|improve this answer
2  
There is a difference between the output generated via \texttt{...} to what is produced when using the courier package. –  Werner Aug 3 '11 at 20:47
    
Even though there's a difference, Peter's answer is a good addition. Most viewers, like me, come here for the \texttt option as it is difficult to ask Google the question relevant to \texttt. –  Shashank Sawant Jun 6 at 4:09

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.