Add
\usepackage{lmodern}
to your document preamble.
Fonts are typically available only in certain sizes/increments. As an example, the basic article document class loads only the following sizes (from size10.clo):
\tiny @ 5pt;
\scriptsize @ 7pt;
\footnotesize @ 8pt;
\small @ 9pt;
\normalsize @ 10pt;
\large @ 12pt;
\Large @ 14.4pt;
\LARGE @ 17.28pt;
\huge @ 20.74pt; and
\Huge @ 24.88pt
So, requesting a 15pt font size using something like
\documentclass{article}
\begin{document}
\fontsize{15}{18}\selectfont Hello world.
\end{document}
leads to LaTeX complaining in the .log file:
LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <15> not available
(Font) size <14.4> substituted on input line 3.
...
LaTeX Font Warning: Size substitutions with differences
(Font) up to 0.6pt have occurred.
Using lmodern removes this restriction by allowing font sizes at arbitrary sizes. For more on font size requirements, see Fonts at arbitrary sizes.
$\ddot u$or$\tilde J$– Wauzl Oct 17 '12 at 07:44lmodernand it worked fine until I used\scshapeand no matter the size I still get the same error. Any ideas? – Evangelos Bempelis Jun 04 '14 at 14:22\scshape? Perhaps with a bold or italics font? They don't have small-caps included. – Werner Jun 04 '14 at 16:23beamer. The small-caps show nicely but I get the warning. So, I guess I just need to change font to one that supports small-caps? – Evangelos Bempelis Jun 04 '14 at 16:55svjourclass,lmodernstill gives an errorLaTeX Font Warning: Font shape 'U/lasy/m/n' in size <13> not available.\usepackage{anyfontsize}suggested by Dotene in another answer was what worked for me. – Alexander Gelbukh Aug 07 '17 at 05:34lmodernonly replaces the Computer Modern font family, not all fonts. – Werner Aug 07 '17 at 17:29lmorden, the number of warnings increased from less than 10 to 1K+... – Axia Mar 08 '24 at 15:14