Removing font warning

As @Skillmon said, the "problem" is that somewhere you are trying to use a font that the lmodern suite does not have (something bold in a part title maybe? I do not know), so a substitution is done.

If you are happy with the substitution, you can just hide the warning under the carpet. Given that the warning(s) are:

LaTeX Font Warning: Font shape `T1/lmr/bx/sc' undefined
(Font)              using `T1/lmr/bx/n' instead on input line 2.


Package spanish Warning: Replacing `T1/lmr/bx/sc' by 
(spanish)                faked small caps on input line 2.

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

you can use this before your \documentclass:

\RequirePackage{silence}
\WarningFilter{latexfont}{Font shape `T1/lmr/bx/sc'}
\WarningFilter{spanish}{Replacing `T1/lmr/bx/sc'}
% I normally leave that last one alone, as a reminder I am shoving
% things under the carpet, but well...
\WarningFilter{latexfont}{Some font shapes were}

...and hala, no warnings ;-)

(This is cheating, though, so use it sparingly and only if you are sure about it).

On a side note, PGF-Tikz has nothing to do with this!


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}