[Tex/LaTex] How to get rid of “Font shape `OT1/cmr/bx/sc’ undefined” warning

chaptersfonts

A teacher handed me a chapter style (i donĀ“t know where it came from) for a report wich I call using the "input" command.

Everytime I compile my report it shows the next two warnings:

  • LaTeX Font Warning: Font shape `OT1/cmr/bx/sc' undefined
  • LaTeX Font Warning: Some font shapes were not available, defaults substituted.

I want to get rid of those warnings, here is the code of the chapter style:

\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
  \vspace*{10\p@}%
  {\parindent \z@ \centering \reset@font
        \thickhrulefill
        \par\nobreak
        \scshape \@chapapp{} \strut\thechapter
        \par\nobreak
        \interlinepenalty\@M
        \hrule
        \vspace*{10\p@}%
        {\Huge \bfseries #1}\par\nobreak
        \thickhrulefill
        \vspace*{10\p@}%
    \vskip 100\p@
  }}
\def\@makeschapterhead#1{%
  \vspace*{10\p@}%
  {\parindent \z@ \centering \reset@font
        \thickhrulefill
        \par\nobreak
        {\Huge \bfseries \strut #1}\par\nobreak
        \interlinepenalty\@M
        \hrule
        \vspace*{10\p@}%
    \vskip 100\p@
  }}

This is my MWE:

\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc} 
\usepackage[spanish,mexico]{babel}
\input{chapterformat.tex}
\begin{document}
\chapter{A chapter}
\end{document}

Best Answer

You could just use the package bold-extra. This not only removes the warnings, but also prints the chapter heading as wanted in \scshape and \bfseries.

the result

Here's the complete MWE:

\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc} 
\usepackage[spanish,mexico]{babel}
\usepackage{bold-extra} % that's new
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
  \vspace*{10\p@}%
  {\parindent \z@ \centering \reset@font
        \thickhrulefill
        \par\nobreak
        \scshape \@chapapp{} \strut\thechapter
        \par\nobreak
        \interlinepenalty\@M
        \hrule
        \vspace*{10\p@}%
        {\Huge \bfseries #1}\par\nobreak
        \thickhrulefill
        \vspace*{10\p@}%
    \vskip 100\p@
  }}
\def\@makeschapterhead#1{%
  \vspace*{10\p@}%
  {\parindent \z@ \centering \reset@font
        \thickhrulefill
        \par\nobreak
        {\Huge \bfseries \strut #1}\par\nobreak
        \interlinepenalty\@M
        \hrule
        \vspace*{10\p@}%
    \vskip 100\p@
  }}
\begin{document}
\chapter{A chapter}
\end{document}