\documentclass{report}
\usepackage{showframe}% http://ctan.org/pkg/showframe
\usepackage{xcolor}% http://ctan.org/pkg/xcolor
\makeatletter
\def\LigneVerticale{\vrule height 2cm depth 1.4cm\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\@makechapterhead#1{\hbox{%
\huge\bfseries
\LignesVerticales
\hspace{-0.5cm}%
\GrosCarreAvecUnChiffre{\thechapter}
\hspace{0.2cm}\hbox{#1}%
}\par\vskip 0.3cm}
\def\@makeschapterhead#1{\hbox{%
\huge\bfseries
\LignesVerticales
%\hspace{0.5cm}%
\hbox{#1}%
}\par\vskip 0.3cm}
\def\GrosCarreAvecUnChiffre#1{{\setlength{\fboxsep}{-\fboxrule}%
\fbox{\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}}}
\makeatother
\begin{document}
\chapter{A chapter}
\chapter*{A chapter}
\end{document}
选自:http://tex.stackexchange.com/questions/56409/modification-of-chapter-headings
发表评论 取消回复