1

Consider this example:

\documentclass{article}

\usepackage{lmodern}       %% see below
\usepackage[T1]{fontenc}   %%

\begin{document}

Hello \textbf{World \texttt{of} Code!}
%%                  ^^^^^^^^^^^

\end{document}

Without the packages, the bold font would use series b. However, with the two packages above, the bold series becomes bx. Unfortunately, lmodern teletype doesn't have such a series, resulting in the following warnings:

LaTeX Font Info:    Font shape `T1/lmtt/bx/n' in size <10> not available
(Font)              Font shape `T1/lmtt/b/n' tried instead on input line 8.

So what I'd like to do is change the default bold series for the teletype font only from bx to b.

How can I do this?

  • 1
    The usual default is bx not b, so that is not changed by the packages. The substitution is already using the "silent" substitution ssub rather than sub (so it does not warn on the terminal, only the log) so basically the behaviour you describe is as designed. – David Carlisle Nov 19 '15 at 15:37
  • @DavidCarlisle: So you don't mind having the log file littered with substitution warnings like that? – Kerrek SB Nov 19 '15 at 15:40
  • 1
    The log from your test file has 140 lines, so those two don't worry me no, they are more informative than many of the others! – David Carlisle Nov 19 '15 at 15:42
4

The behaviour is as designed but if you want to lose all (log-only) font warnings then:

\documentclass{article}


\makeatletter
\def\@font@info#1{}
\makeatother


\usepackage{lmodern}       %% see below
\usepackage[T1]{fontenc}   %%

\begin{document}

Hello \textbf{World \texttt{of} Code!}
%%                  ^^^^^^^^^^^

\end{document}

has 66 rather than 140 lines in the log.

  • Something tells me that this isn't changing the font mappings at all :-) – Kerrek SB Nov 19 '15 at 15:48
  • @KerrekSB you do not want to change the font mappings. latex is already doing exactly what you ask. detecting tt and in that case using b rather than bx for bold. The only thing that you want differently is that you don't want to be told that it is happening. – David Carlisle Nov 19 '15 at 15:59

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.