A warning is unavoidable, unless much lower level code is used.
The issue is that babel-spanish
, by default, wants to use small caps Roman numerals instead of lowercase ones like in English.
However the Latin Modern fonts, contrary to European Modern (the default for the T1 encoding) don't have a boldface small caps font. Thus babel-spanish
uses a trick: it fakes the font by using capital letters from the normal boldface font, but at a reduced size (the size corresponding to subscripts).
You have three strategies. The first two strategies require some code to add before \begin{document}
.
Strategy 1
Substitute the Latin Modern nonexistent font with the corresponding one in European Modern.
\sbox0{%
\fontseries{bx}\scshape
\global\expandafter\let\csname T1/lmr/bx/sc/10\expandafter\endcsname\the\font
}
Disadvantage: you need to do this for every font size you need. For the TOC, which is the real problem, just 10
is needed (or 10.95
with the 11pt
option, or 12
for the 12pt
option).
Strategy 2
Since you know that the faked small caps Roman numerals will be used, avoid the checking business that just produce the annoying warnings.
\makeatletter
%% lmodern has no boldface small caps and we know it
%% so we avoid all the warnings related to the faking business
\def\es@xlsc#1#2#3{%
\leavevmode
\hbox{\check@mathfonts\fontsize\sf@size\z@\selectfont#1{#3}}%
}
\makeatother
Strategy 3
Use uppercase Roman numerals.
\usepackage[spanish,es-ucroman]{babel}
lmodern
. Either pick another font which has them (e.g.,kpfonts
does), or stick withlmodern
and use the automatic substitution to use normal bold (extended) instead. – Skillmon Nov 29 '20 at 10:53