In the previous question, I tried to ask for one style per chapter. This time I would like to ask for customise the chapter opening. However, my case is a bit complicated, let us see the MWE first.
\documentclass[12pt,a4paper,headinclude,openright]{scrbook}
\usepackage{etoolbox}
\usepackage[usenames,dvipsnames,svgnames,x11names,table]{xcolor}
\usepackage{microtype}
\usepackage{graphicx}
\definecolor{color00}{HTML}{3F3A7D}
\definecolor{color01}{HTML}{660033}
\definecolor{color02}{HTML}{DC143C}
\definecolor{color03}{HTML}{FF4500}
\definecolor{color04}{HTML}{FF8000}
\definecolor{color05}{HTML}{FFD700}
\definecolor{color06}{HTML}{CCCC00}
\definecolor{color07}{HTML}{176C2E}
\definecolor{color08}{HTML}{20B2AA}
\definecolor{color09}{HTML}{00CED1}
\definecolor{color10}{HTML}{1E90FF}
\definecolor{color11}{HTML}{0000CD}
\definecolor{color12}{HTML}{800080}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{backgrounds}
\usetikzlibrary{fit}
\usetikzlibrary{shapes}
\usetikzlibrary{scopes}
\clearscrheadfoot
\usepackage{scrpage2}
\usepackage{tikz}
\lehead{\begin{tikzpicture}[remember picture,overlay]
\node[
inner sep=0pt,
fill=\chapterbackcolor,
font=\fontsize{40}{48}\selectfont\color{white}\sffamily,
anchor=north east,
align=center
]
(chapimage)
at (current page.north east)
{\includegraphics[height=1.5cm,width=3cm]{\hdicons}};
\node[
inner sep=0pt,
anchor=south east,
font=\color{\chapterbackcolor}\sffamily
]
(mark)
at ([xshift=-1em]chapimage.south west)
{\rightmark};
\draw[\chapterbackcolor,line width=1pt]
([xshift=12em]mark.south east) -- ++(-\paperwidth-12em,0);
\end{tikzpicture}%}
\lohead{\begin{tikzpicture}[remember picture,overlay]
\node[
text width=2cm,
text height=0.5cm,
text depth=1.5cm,
fill=\chapterbackcolor!20,
font=\Large\sffamily,
anchor=north east,
align=center
]
{\thepage};
\end{tikzpicture}}
\lefoot{...}
\rofoot{...}
\pagestyle{scrheadings}
% chapter style
\newcommand\hdicons{}
\renewcommand\hdicons{%
\ifcase\value{chapter}Icon00\or Icon01\or Icon02\or Icon03\or Icon04\else Icon\fi}
\renewcommand\chapterbackcolor{%
\ifcase\value{chapter}color00\or color01\or color02\or color03\or color04\or color05\or color06\or color07\or color08\or color09\or color10\or color11\else color12\fi}
\def\@chapter[#1]{\begin{tikzpicture}[remember picture,overlay]
\node(hd)at (current page.north west){\thechapter};
\begin{scope}[on background layer]
\node[text width=21cm,minimum height=10cm,fill=\chapterbackcolor,fit=(hd)]at(current page.north) {};
\end{scope}
\end{tikzpicture}%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}
\fi
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
}
\usepackage[listings,theorems,skins,breakable]{tcolorbox}
% for examples
\begin{document}
\frontmatter
\chapter*{Table of contents, figures and tables}
\tableofcontents
\mainmatter
\part{Part ONE}
\chapter{Sample Chapter 1}
\section{Section ONE}
\backmatter
\end{document}
The MWE is about the code I would like customise for a chapter opening. Given that I know in order to change the chapter opening style per each one is by define style variables (e.g. bgcolors etc.), I would like to know the followings:
- Does
\thechapterrepresents the chapter heading in the opening? - I would like to make a background under the chapter heading, how would the MWE modified so makes this possible?
Note:


\documentclass{...}, finishes with\end {document}and include all relevant (only relevant) packages to show the problem you want to solve. – Ignasi May 30 '14 at 06:39\begin{document} some text where we can test your problem \end{document}. And in any case, it stops working with! Undefined control sequence. l.26 \clearscrheadfoot. So, something is still missing. – Ignasi May 30 '14 at 09:19