0

I'm using this style for the numbered chapters in my report but it doesn't use the same style for the unnumbered. How do I fix that?

\makeatletter
\def\thickhrulefill{\leavevmode \color{martec} \leaders \hrule height 1ex \hfill \kern \z@ }
\def\@makechapterhead#1{%
  %\vspace*{50\p@}%
  \vspace*{0\p@}%
  {\parindent \z@ \centering \reset@font
        \thickhrulefill\quad
        \scshape \@chapapp{} \thechapter
        \quad \thickhrulefill\color{martec1}
        \par\nobreak
        \vspace*{10\p@}%
        \interlinepenalty\@M
        \hrule height 0.3ex
        \vspace*{10\p@}%
        \Huge \bfseries #1\par\nobreak
        \par 
        \vspace*{5\p@}%
        \hrule height 0.1ex
    \vskip 30\p@
   % \vskip 100\p@
  }}
3
  • Welcome to TSE. Please post a Minimal Working Example, instead of a code snippet. Commented Oct 19, 2021 at 11:46
  • Thank you. I'm new to this forum, so I don't know what a Minimal Working Example is. Commented Oct 19, 2021 at 17:37
  • See here. Commented Oct 19, 2021 at 17:45

1 Answer 1

0

There are many packages to help you with the design of chapter styles.

Try for example the package fncychap.

(Unless of course you want to sharpen your TeX programming skills)

Meanwhile try this code.

a

b

\documentclass{book}

\usepackage{xcolor}

\makeatletter
\def\thickhrulefill{\leavevmode \color{red} \leaders \hrule height 1ex \hfill \kern \z@ }

\def\@makechapterhead#1{%
    %\vspace*{50\p@}%
    \vspace*{0\p@}%
    {\parindent \z@ \centering \reset@font
        \thickhrulefill\quad
        \scshape \@chapapp{} \thechapter
        \quad \thickhrulefill\color{green}
        \par\nobreak
        \vspace*{10\p@}%
        \interlinepenalty\@M
        \hrule height 0.3ex
        \vspace*{10\p@}%
        \Huge \bfseries #1\par\nobreak
        \par 
        \vspace*{5\p@}%
        \hrule height 0.1ex
        \vskip 30\p@
        % \vskip 100\p@
}}

\def\@makeschapterhead#1{%
        \vspace*{0\p@}%
    {\parindent \z@ \centering \reset@font  
         \thickhrulefill\color{green}
        \par\nobreak
        \vspace*{10\p@}%
        \interlinepenalty\@M
        \hrule height 0.3ex
        \vspace*{10\p@}%
        \Huge \bfseries #1\par\nobreak
        \par 
        \vspace*{5\p@}%
        \hrule height 0.1ex
        \vskip 30\p@
    }}

\makeatother

\begin{document}    
    
\chapter*{No numbered}

\chapter{With number}
    
\end{document}
1

You must log in to answer this question.

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