古詩詞大全網 - 字典詞典 - 如何消除beamer的警告

如何消除beamer的警告

在使用beamer制作幻燈片時,經常會出現壹些警告。比如如下最簡單的代碼:\documentclass{beamer}

\begin{document}

\begin{frame}

Test

\end{frame}

\end{document}

經過編譯之後,會給出如下警告:

LaTeX Font Warning: Font shape `OT1/cmss/m/n’ in size <4> not available

(Font) size <5> substituted on input line 6.

LaTeX Font Warning: Size substitutions with differences

(Font) up to 1.0pt have occurred

雖然該警告不會對輸出結果產生什麽影響,但是把問題搞清楚,並且消除警告,總是壹個更好的習慣。至少這麽做會讓我們不至於忽略非常重要的警告。

beamerbasefont.sty定義了命令\Tiny和\TINY來選擇非常小的字體大小。重新定義\Tiny或者載入壹個定義了大小的字體,比如Latin Modern,就能夠解決以上兩個問題。操作的時候,只需要在\documentclass{beamer}後加上語句\let\Tiny = \tiny即可。

\documentclass{beamer}

\let\Tiny=\tiny

\begin{document}

\begin{frame}

Test

\end{frame}

\end{document}