4

I am using (in this case) the lmvtt font.

Consider the code

\documentclass{book}
\begin{document}
\thispagestyle{empty}
\LARGE
{\fontfamily{lmvtt}\selectfont{How to Obtain Typewriter Font Smallcaps}}
\end{document}

which produces

enter image description here

UPDATE

I am compiling with pdflatex


QUESTION: How may I, generally speaking, obtain smallcaps for typewriter fonts?

Thank you.

DDS
  • 8,816
  • 4
  • 9
  • 36
  • 3
    You need a font that has small caps (not many available, probably). You seem to be using pdflatex so not much you can do other than {\LARGE O}{\Large BTAIN} If you use luatex fontspec has features to fake small caps wih opentype fonts – David Carlisle Dec 14 '22 at 14:53
  • @DavidCarlisle Yes, I am using pdflatex. – DDS Dec 14 '22 at 15:00
  • Many thanks @DavidCarlisle – DDS Dec 14 '22 at 15:07
  • @mlchristians another reply of Sir David Carlisle also helps you, refer https://tex.stackexchange.com/questions/548078/parser-for-creating-manual-small-caps – MadyYuvi Dec 14 '22 at 15:14
  • @MadyYuvi Many thanks for the link. – DDS Dec 14 '22 at 15:19
  • actually Marijn shows that there are more tt sc fonts for pdftex than I guessed (Reading documentation or the font catalogue, shocking:-) – David Carlisle Dec 14 '22 at 15:52
  • @DavidCarlisle Perhaps the catalog is in need of updating:-) – DDS Dec 14 '22 at 15:56

2 Answers2

6

There are teletype/typewriter fonts that have smallcaps, like TeX Gyre Cursor.

\documentclass{article}
\usepackage{tgcursor}
\usepackage[T1]{fontenc}
\begin{document}
\noindent \texttt{How to Obtain Typewriter Font Smallcaps}\\
\texttt{\textsc{How to Obtain Typewriter Font Smallcaps}}
\end{document}

enter image description here

See the Font Catalogue for all tt fonts for pdfLaTeX with information on which font styles are available for each font.

For example Latin Modern Mono also has smallcaps:

enter image description here

Marijn
  • 37,699
6

An answer to this somewhat depends on what you really want given that you list lmvtt as the font you are currently using (which is a proportional typewriter, not a monospaced typewriter font):

If the proportional aspect is important to you

In that case you are largely out of luck. There aren't that many proportional typewriter fonts and non (to my knowledge for use with pdfTeX) that offer a small caps face.

This means you either have to use "fake small capitals" as suggested by David (with the disadvantage the the typographical quality is not very good as the stem width changes if you scale down the small capitals) or alternatively use not a real "typewriter font" but perhaps a slab serif font instead.

For the latter there are a few possibilities with pdfTeX, e.g. Concrete Roman, Roboto Slab and Source Serif Pro

If monospaced is fine

In that case there are a few more fonts that fit the bill, ie offering monospaced typewriter with a small caps face included, eg Computer Modern, Computer Modern Bright, Latin Modern, Courier (TX Gyre Cursor), Noto Sans Mono, and perhaps a few more, but again it is a rather limited set.