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.

\lehead{\begin{tikzpicture}[remember picture,overlay]
    inner sep=0pt,
    anchor=north east,
    at (current page.north east) 
     inner sep=0pt,
     anchor=south east,
       at ([xshift=-1em]chapimage.south west) 
       \draw[\chapterbackcolor,line width=1pt] 
     ([xshift=12em]mark.south east) -- ++(-\paperwidth-12em,0);
\lohead{\begin{tikzpicture}[remember picture,overlay]
    text width=2cm,
    text height=0.5cm,
    text depth=1.5cm,
    anchor=north east,
% chapter style
\ifcase\value{chapter}Icon00\or Icon01\or Icon02\or Icon03\or Icon04\else Icon\fi}
\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) {};
              \ifnum \c@secnumdepth >\m@ne
% for examples
\chapter*{Table of contents, figures and tables}
\part{Part ONE}
\chapter{Sample Chapter 1}
\section{Section ONE}

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 \thechapter represents 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?


  • As I am sticking on the koma-script, I would like the answer using the koma-script-compatible packages.
  • Please allow me acknowledge where the code comes from, which are here and here.
  • Your MWE is just part of a complete MWE. Would be better if your examples start with \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 6:39
  • @Ignasi I have edited the MWE, is this possible to solve the question? – SHY.John May 30 '14 at 6:54
  • It's going better, but this is just the preamble, there is no \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 9:19
  • @Ignasi I have expanded the MWE, but it is just ordinary chapters and paragraphs (Since I haven't start to author the book yet). Sometimes I prefer to compile it in two clicks, as I occasionally got errors but solved through by compile it again. – SHY.John May 30 '14 at 10:51

While I was waiting someone could answer this question, I could (sort of) figure it out. However, I have to answer some of the questions at first.

Does \thechapter represents the chapter heading in the opening?

I found that this question makes every one confused, while I was experimenting the codes, the \thechapter does nothing with my scope.

I would like to make a background under the chapter heading, how would the MWE modified so makes this possible?

This is the content of while one would like to know about chapter-opening decorations. Should assert that there are may possible choices, this is one of the possibilities.

My option is to use \setchapterpreamble from KOMA-Script and the option o for above the chapter heading. \begin{tikzpicture} therefore can be used inside the command.

A sample page of my new writing


  1. Since I experiment not only the decorations of chapter opening, but also the opening of each parts. What I would like to do is to make the double page with an image background and the text color as white. Such as the image below. The MWE is as:

    % changing the font of part heading
    % cont'd from above MWE
    % NOTE: the openright option can only switch manually to the left page, depends on the previous page
    \part{Blah, blah, blah}

    As well as the sample image:

    A sample part opening spread of my new writing

  2. As I said, there are many options to do so. However, I have not experimented with these.

Please let me reference the image I have used in here, they are from Flickr by Wendy Piersall.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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