TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.)

share|improve this question
As always a minimal working example (MWE) as reference would be very much appreciated. People could then use it to implement, test and compare their solutions. – Martin Scharrer Jul 4 '11 at 0:40
@Martin: I've avoided giving MWE on purpose. I prefer to make this a more general question, but I still gave a specific example w/ bold small caps and lmodern+cm-super, because sometimes people just prefer to think about concrete case. – przemoc Jul 4 '11 at 0:48
up vote 20 down vote accepted

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:


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


{\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`

share|improve this answer
Effort appreciated. It is good as it works for my exemplary case, but at the same time I cannot say I like it, because it requires checking and copying some stuff from .fd file, which I believe should be avoidable, as we're ultimately reusing family+series+shape already defined out there. – przemoc Jul 4 '11 at 1:14
Mmm, Adobe Acrobat Reader crashes with the above MWE when I try to display Properties->Fonts! pdffonts actually displays the fonts nicely, so does evince. – Martin Scharrer Jul 4 '11 at 1:15
You can use the sub (or ssub) function to declare the substituation: \usepackage{lmodern} \normalfont %to load T1lmr.fd \DeclareFontShape{T1}{lmr}{bx}{sc} { <-> ssub * cmr/bx/sc }{} – Ulrike Fischer Jul 4 '11 at 9:06
@Ulrike: Thank you! This is exactly what I was looking for and I believe this is the best solution. Could you "transform" your comment into separate answer? You can make it a bit more elaborate if you want. I will happily accept it after day or two. :-) – przemoc Jul 4 '11 at 9:29
Martin can include it in his answer. – Ulrike Fischer Jul 4 '11 at 9:46

I was trying to use the technique from the previous comment, until I realised I was using a sans font and that the CM fonts dont have a 'sans serif' bold small caps...

To solve it, I used the helvet package which has them. There is an additional trick as you have to re-load the declaration for \sfdefault as \usepackage{helvet} overwrites it! Then it defaults to lmodern except for the sans small caps where you use helvet...

Just posting the code here in case it is useful to someone!



\sffamily %to load T1lmss.fd 

% Load 'sans small caps' from helvet:
\sffamily %to load T1phvss.fd 
% Substitute non-existing lmss/bx/sc with phv/bx/sc
\DeclareFontShape{T1}{lmss}{bx}{sc} { <-> ssub * phv/bx/sc }{}
% Can also pick the sans small caps:
\DeclareFontShape{T1}{lmss}{m}{sc} { <-> ssub * phv/m/sc }{}

% Use lmodern to override helvet:


This is lmodern roman (lmr) -- default

{\sffamily This is lmodern sans (lmss)}

{\scshape This is small caps from lmodern (lmr)}

{\sffamily \scshape This is sans small caps from helvet (phv)}

{\sffamily \bfseries \scshape This is sans bold small caps from helvet (phv)}

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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