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.
-
3By 'courier', are you actually referring to 'typewriter' (as part of the Computer Modern fonts, or to the specific mono-spaced font 'Courier'?– Werner ♦Commented Aug 3, 2011 at 20:25
-
1I mean the specific mono-spaced font - Courier, that is typically used for programming code.– JoeblackdevCommented Aug 3, 2011 at 20:34
-
6Courier is a very wide font. There are further mono-space fonts available if you are free to choose.– Stefan Kottwitz ♦Commented Aug 3, 2011 at 20:59
-
@Brent.Longborough Link appears broken.– HarryCBurnCommented Feb 18, 2015 at 16:21
-
@Iplodman Oops! I'd recommend Inconsolata– Brent.LongboroughCommented Feb 19, 2015 at 21:02
Add a comment
|
2 Answers
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
There is a marginal difference between the output generated via \texttt{...}
with/without the courier
package:
- Without
courier
package:
- With
courier
package:
-
Dear Werner. Can we apply courier font for the formula also?– anonimoCommented Aug 3, 2023 at 7:23
-
Is \texttt{}
what you are looking for?
\documentclass{article}
\begin{document}
Here is some \texttt{fixed width} text.
\end{document}
-
5There is a difference between the output generated via
\texttt{...}
to what is produced when using thecourier
package.– Werner ♦Commented Aug 3, 2011 at 20:47 -
26Even 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
. Commented Jun 6, 2014 at 4:09