2

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}
3

1 Answer 1

2

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}
1
  • @PaulLara Then please try to find the conflicting piece of code and try to either update your question or ask a new one (for option two: please accept this answer, because it solves your problem with this MWE).
    – TeXnician
    Commented Feb 6, 2017 at 8:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .