2

I'm using document class report and I have decided to use one of the predefined styles of Vincent Zoonekynd's for chapter headings, with some modifications.

\documentclass[11pt,a4paper,oneside]{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{\color{white}#1}\hss}}%
  \vrule height 0pt width 1cm depth 0pt}
\def\GrosCarreAvecUnChiffres#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\@makechapterhead#1{
    \vspace*{-20pt}
    \hbox{%
    \huge\bfseries
    \LignesVerticales
    \hspace{-0.62cm}%
    \GrosCarreAvecUnChiffre{\thechapter}
    \hspace{0.2cm}\hbox{#1}%
    }\par\vskip 0.5cm}
 \def\@makeschapterhead#1{
    \vspace*{-20pt}
    \hbox{%
    \huge\bfseries
    \LignesVerticales
    \hspace{-0.62cm}%
    \GrosCarreAvecUnChiffres{\thechapter}
    \hspace{0.2cm}\hbox{#1}%
    }\par\vskip 0.5cm}
\makeatother

\begin{document}
\chapter{Name}
\chapter*{Surname}
\end{document}

I would like to make other modifications and don't know how to do this. The definition for \chapter is alright, no other modification is needed. The only change is about \chapter*s. I would like to put any number (zero) away and move the name of the chapter to the left in the white box. Does anyone know how to change this?

2
  • 1
    Hi Jane! :) A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). May 22, 2012 at 11:25
  • I assume where your code said \white it was supposed to say \color{white}. I fixed that, hope that's ok.
    – doncherry
    May 22, 2012 at 11:33

1 Answer 1

3

Via trial and error, I modified the following part as follows, which seems to work:

\def\GrosCarreAvecUnChiffres#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%
  \hspace{-0.25cm}% This is new
  }}

screenshot of output

2
  • Great job!!:-))
    – Laura
    May 22, 2012 at 12:04
  • 2
    @Jane: Glad I could help. It'd be nice if you upvoted this answer, as well as some of the answers to your other questions. I see you have ten questions, nine of which have an accepted answer, but you only voted three times.
    – doncherry
    May 22, 2012 at 12:06

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