134
LaTeX Font Warning: Font shape `OT1/cmss/m/n' in size <4> not available
LaTeX Font Warning: Size substitutions with differences

I am using the files from http://www.poirrier.be/~jean-etienne/info/latexbeamer/latex-beamer.tar.gz.

Alternatively, for a minimal working example, the presentation

\documentclass{beamer}
\begin{document}

\begin{frame}
\titlepage 
\end{frame}

\end{document} 

produces the warnings.


How to remove the above 2 warnings?

140

Add

\usepackage{lmodern}% http://ctan.org/pkg/lm

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.

|improve this answer|||||
  • 3
    I know this workaround, but I also know that if you do that, math accents will be typesetted very badly. You can try i.e. $\ddot u$ or $\tilde J$ – Wauzl Oct 17 '12 at 7:44
  • 1
    I used package lmodernand it worked fine until I used \scshape and no matter the size I still get the same error. Any ideas? – Evangelos Bempelis Jun 4 '14 at 14:22
  • 1
    @VagelisBebelis: Where are you using \scshape? Perhaps with a bold or italics font? They don't have small-caps included. – Werner Jun 4 '14 at 16:23
  • 2
    @AlexanderGelbukh: That's because lmodern only replaces the Computer Modern font family, not all fonts. – Werner Aug 7 '17 at 17:29
  • 1
    @Werner Perhaps you could clarify this in the answer. – Alexander Gelbukh Aug 12 '17 at 8:45
26

Add \usepackage{anyfontsize} to your preamble.

|improve this answer|||||
  • 1
    This is what worked for me. With lmodern suggested in the accepted answer, I stil got the warning LaTeX Font Warning: Font shape 'U/lasy/m/n' in size <13> not available. – Alexander Gelbukh Aug 7 '17 at 5:32
  • 3
    This scales all fonts, which is a reasonable fallback; but one should first fix warnings by selecting better fonts (like lmodern) where possible. – Blaisorblade Aug 29 '17 at 13:30
14

You can add this \let\Tiny=\tiny just after the documentclass declaration. So, it should look something like this:

\documentclass{beamer}
\let\Tiny=\tiny

Hope this helps! :)

Links: [1] http://texblog.net/latex-archive/presentations/beamer-warnings/

|improve this answer|||||
2

Beamer versions 3.44 and newer no longer produce this warning.

It was fixed in https://github.com/josephwright/beamer/commit/3bac00a7a4d95067ccb6e6aac0f0be1c9f802a1a

-1

In case someone finds themselves in my situation, I got this error message when I had forgotten to write \end{document}.

|improve this answer|||||
  • It's very unlikely that a forgotten \end{document} will trigger a font substitution warning. – Phelype Oleinik Oct 17 '18 at 1:52
  • @PhelypeOleinik But, it's what appeared in my error log, and I realized I'd forgotten to write it. Fixing that made it compile. Why isn't that what happened? It's the reason I came here. – Joe Johnson 126 Oct 17 '18 at 2:23
  • No, font substitution warnings are issued when you use \end{document}. See the conditional on line 4225 that triggers the warning. Forgetting the \end{document} is not only unrelated to the issue, it prevents the generation of such warning. BTW, the downvote isn't mine :/ – Phelype Oleinik Oct 17 '18 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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