I'm using document class report
and I have decided for chapter headings to use one of the predefined style of Vincent Zoonekynd's with some modification. I would prefer to have \chapter
and \chapter*
defined differently.
For chapter this style:
\documentclass{report}
\usepackage{xcolor}
\makeatletter
\def\LigneVerticale{\vrule height 1.5cm depth 0.9cm\hspace{0.1cm}\relax}
\def\LignesVerticales{%
\let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}
\def\GrosCarreAvecUnChiffre#1{%
\rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%
\rlap{\hbox to 1cm{\hss\mbox{\white #1}\hss}}%
\vrule height 0pt width 1cm depth 0pt}
\def\@makechapterhead#1{
\vspace*{-20pt}
\hbox{%
\huge\bfseries
\LignesVerticales
\hspace{-0.62cm}%
\GrosCarreAvecUnChiffre{\thechapter}
\hspace{0.2cm}\hbox{#1}%
}\par\vskip 0.5cm}
\makeatother
\begin{document}
\chapter{Name}
\end{document}
For \chapter*
this style:
\documentclass{report}
\usepackage{xcolor}
\makeatletter
\def\LigneVerticale{\vrule height 1.5cm depth 0.9cm\hspace{0.1cm}\relax}
\def\LignesVerticales{%
\let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}
\def\GrosCarreAvecUnChiffre#1{{%
\color{white}%
\rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%
\rlap{\hbox to 1cm{\hss\mbox{\color{black}#1}\hss}}%
\vrule height 0pt width 1cm depth 0pt}}
\def\@makeschapterhead#1{
\vspace*{-20pt}
\hbox{%
\huge\bfseries
\LignesVerticales
\hspace{-0.62cm}%
\GrosCarreAvecUnChiffre{\thechapter}
\hspace{0.2cm}\hbox{#1}%
}\par\vskip 0.5cm}
\makeatother
\begin{document}
\chapter*{Names}
\end{document}
Now, I have two questions:
- How to modife the second style (for
\chapter*
) to have this output- no number {zero} and the name of the chapter move to the left in the space between the vertical lines. - how to define the two styles together in one document to be able to use both of them at the same time.
{}
button in the editor. Alternatively, you can indent all lines of a code block by four spaces, and enclose inline code samples in back ticks.