[pdftex] coloring section headers

Michel Bovani michel.bovani at wanadoo.fr
Thu Feb 7 15:23:50 CET 2002


Hi all,

I try to have colored section headers. It appears that sometimes 
(when section headers are rejected on a new page ?) it does nor work. 
I use Cmactex4.1 (pdftex 1.00a), and pdftex.def v0.03i.

Here is a test file :

\documentclass[a4paper]{article}
\usepackage[pdftex]{color}
\makeatletter
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                    {-3.5ex \@plus -1ex \@minus -.2ex}%
                                    {2.3ex \@plus.2ex}%
                                    {%%
\Large\bfseries\color{red}}}
\makeatother


\begin{document}
\section{This header is red}
Some unbreakable material
\rule{1mm}{5cm}
\par
Some unbreakable  material
\rule{1mm}{6cm}
\par
Some unbreakable  material
\rule{1mm}{5cm}
\par

\section{This header should be red}
Other unbreakable  material
\rule{1mm}{4cm}

\section{This header is red}
Some material
\rule{1mm}{4cm}


\end{document}
-- 
Michel Bovani



More information about the pdftex mailing list