Text Formatting ⇒ How to use two different typewriter fonts?
How to use two different typewriter fonts?
I am using the courier package in a very large document, for listing/verbatim/etc. I would like to keep using this package and I would like everything to remain exactly as it is at the moment.
I just want to make one small adjustment: I want my email at the start of the document to be displayed in the default CMU typewriter font (i.e. the way it would be displayed if I did not use the courier package and just used the \texttt command).
It seems like such a simple thing to do, but I cannot figure it out. I've been trying for hours.
I am using Latex => PS => PDF.
Thank you in advance,
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
How to use two different typewriter fonts?
Code: Select all
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{courier}
\begin{document}
{\fontfamily{cmtt}\selectfont This is in Computer Modern Typewriter.}
\texttt{This is in courier.}
(Both are ugly. Ever considered beramono or inconsolata?)
\end{document}
Re: How to use two different typewriter fonts?
And I've never even heard of the other fonts!
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How to use two different typewriter fonts?
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
How to use two different typewriter fonts?
See the LaTeX Font Catalogue: Subsection: Typewriter Fonts.gmiwenht wrote:Thank you, worked perfectly.
And I've never even heard of the other fonts!
Re: How to use two different typewriter fonts?
Sorry, I did not read the rules before I posted, as I should have.
Thank you again for the response, and for the font suggestions.