6

I would like to print very large (e.g., font size 43) monospaced bold text. The methods I know don't seem to go together:

\documentclass[10pt, a4paper]{article}
\usepackage{anyfontsize}
\font\btt=rm-lmtk10

\begin{document}

{\btt TEXT1}

{\fontsize{43}{48}\selectfont TEXT2}

{\fontsize{43}{48}\selectfont \btt TEXT3}    %not working

\end{document}

enter image description here

5

use another font, eg:

\documentclass[10pt, a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{bera}
\begin{document}

{\ttfamily TEXT1}

{\fontsize{43}{48}\selectfont TEXT2}

{\fontsize{43}{48}\selectfont \ttfamily TEXT3} 

\end{document}

if you prefer the Latin Modern then use instead

\documentclass[10pt, a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\begin{document}
...
  • Thanks! I like the rm-lmtk font better. If there's no other way, \ttfamily would be ok. Scaling a font up in my mind seems like such a simple task... – Frank Seifert Oct 13 '13 at 18:58
  • see my edit. You can simply load the lm fonts with the package lmodern – user2478 Oct 13 '13 at 19:07
  • @FrankSeifert - the font rm-lmtk10 is in the typewriter font for the Lating Modern font family. If you load the lmodern package, you'll get rm-lmtk10 when specifying \ttfamily. – Mico Oct 13 '13 at 19:12
  • Perfect, much appreciated. – Frank Seifert Oct 13 '13 at 19:22
6

The \font instruction should never be used with LaTeX. One of the reasons is what you discovered: the \btt font you defined cannot be scaled with instructions such as \fontsize{43}{48}\selectfont, because it is at a fixed size.

When one issues a font selection command, LaTeX looks in its internal tables and decides what font to use (remembering those it has already looked up and defined), finally issuing a \font<command>=<tfm-file> assignment, if needed, and the command <command> (for instance, \OT1/cmr/m/n/10 for the standard font). However this happens deep in the internals and the user should never rely on explicit font selection commands.

The rm-lmtk10 font is what lmodern chooses (scaling it if necessary) when the user requests for

OT1 encoding, lmtt family (Latin Modern Typewriter), bold series, upright shape

as one can read from the entry in the ot1lmtt.fd file:

\DeclareFontShape{OT1}{lmtt}{b}{n}
     {<-> rm-lmtk10}{}

Therefore you can simply use the already defined infrastructure and say

\fontsize{43}{48}\usefont{OT1}{lmtt}{b}{n}

maybe defining a personal command such as

\newcommand{\btt}{\fontsize{43}{48}\usefont{OT1}{lmtt}{b}{n}}

Note that \usefont issues internally \selectfont so it's not needed after \fontsize.

Loading lmodern is better, but it's not required.

\documentclass{article}
\begin{document}
\fontsize{43}{48}\usefont{OT1}{lmtt}{b}{n}
\noindent
TEXT\\
\fontname\font % print the name of the current external font
\end{document}

enter image description here

Note: I used \font, but just for accessing the name of the current font, not for defining a new one.

  • Outstanding answer. And a great reference for me to start learning Latex fonts. – Frank Seifert Oct 13 '13 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.