Text Formatting ⇒ Changing size of typewriter typeface
Changing size of typewriter typeface
I'm setting a book in 11pt type and using the Listings package. The author thinks the \tt font is too big. I changed the parameters of the listing to \small and this looks great. Is there a way resize the rest of the typewriter font used in the document to "small"?
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Changing size of typewriter typeface
At least for Computer Modern (CM) he's mistaken. Are you using other fonts than CM? Show your document setup by a minimal example.nifty wrote:[…] The author thinks the \tt font is too big. […]
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Changing size of typewriter typeface
Here is a link to a sample page. We've set hundreds of textbooks with various "typewriter" faces including Courier, Letter Gothic, Monospace 821. We almost always have to drop a point size when using a monospace font to make it look the same size as the text. It would be nice if the type in #14 was the same size as #17. And, yes, to your question of whether we are using CM fonts.
http://www.necomp.us/pics/ttSample.pdf
http://www.necomp.us/pics/ttSample.pdf
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Changing size of typewriter typeface
The typewriter font on that sample page is not bigger than the serif font of the surrounding text. That's what your first post suggested. The font in the small script has been downscaled. You described that this is done by settings for the listings package. So far so good. But from my point of view there is still no counterexample for the claim that the typewriter font is too big.
Unfortunately you don't say anything about the in-line code in point #14 is written. Assumed that you have chosen basicstyle=\small\ttfamily as general option for your listings, you could use \lstinline|…| to get the desired result.
Unfortunately you don't say anything about the in-line code in point #14 is written. Assumed that you have chosen basicstyle=\small\ttfamily as general option for your listings, you could use \lstinline|…| to get the desired result.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Changing size of typewriter typeface
It's too big in relation to example 17. I realize that in example 14, both the basal text and the \tt font are 11 point. Optically, it looks bigger even though they are both 11 point. I don't want the \tt at 11 point. I'd like it smaller throughtout the document as in the listing. I thought there may be something I could put in the preamble that would change ONLY the \tt font to \small
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: Changing size of typewriter typeface
I have shown a possible solution in my last reply. Did you test it?
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10