Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

  1. 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.
  2. how to define the two styles together in one document to be able to use both of them at the same time.
share|improve this question
    
You can (and should) format your code samples by highlighting them and clicking the {} 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. –  Jake May 21 '12 at 12:01

1 Answer 1

up vote 3 down vote accepted

You changed the correct commands related to \chapter (\@makechapterhead) and \chapter* (\@makeschapterhead).

The commands which differ are \LigneVerticale and \GrosCarreAvecUnChiffre.

So simple define one for the starred version and one for the normal one.

Something like:

Normal heading:

\def\LigneVerticale{...
\def\GrosCarreAvecUnChiffre#1{...

Starred version.

\def\LigneVerticaleS{...
\def\GrosCarreAvecUnChiffreS#1{...
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.