[Tex/LaTex] Choosing font for bold small caps (or any other particular family+series+shape combination)

best practicesfontssmall-caps

What is the best way (most proper and general solution) to get rid of the warning

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

by explicitly setting which font should be used for particular family+series+shape combination in edited document?


Bold small-caps are not widely available font-wise. E.g. they are available in CM-Super (which the default font for T1 encoding), but not in overall better Latin Modern.

Let's say I use Latin Modern as the default font (\usepackage{lmodern}). What should be done to make LaTeX fallback to CM-Super in case of bold small caps?
(And only in the case of bold small caps, medium small caps should remain typed using Latin Modern.)

Best Answer

AFAIK you just need to declare that font shape using \DeclareFontShape. You can just declare the font shape to use the font shape of the standard font. This should lead to the same result as before just without the warning.

Using `lmodern` with `T1` font encoding you get the following warning with `\scshape\bfseries`:
LaTeX Font Warning: Font shape `T1/lmr/bx/sc' undefined
(Font)              using `T1/lmr/bx/n' instead on input line 19.

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

So you need to declare the font shape T1/lmr/bx/sc. As Ulrike pointed out you can substitute another font using the following code:

\documentclass{article}
\usepackage[T1]{fontenc}

\usepackage{lmodern} \normalfont %to load T1lmr.fd 
\DeclareFontShape{T1}{lmr}{bx}{sc} { <-> ssub * cmr/bx/sc }{}

\begin{document}

{\normalfont normal font}
{\scshape small caps}
{\ttfamily tt family}
{\bfseries bold font}
{\scshape\bfseries bold small caps}% works and uses `cmr` font instead of `lmr`

\end{document}
Related Question