1

I'm trying to format the Chapter title (I'm using Ubuntu which has komascript 3.12) using Tikz to add a minitoc. I can format the number and chapter prefix but the chapter title does not change position, I want to put it at the top. To add the minitoc I think I have to add that to the tikz part of the code.

Here is what I've got so far:

\documentclass{scrbook}

\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{lipsum}
\definecolor{back}{HTML}{141414}
\definecolor{fore}{HTML}{FC4508}

\newcommand*\chapterimageheight{.2\paperheight}% height of the chapter images
\newcommand*\chapterhalfimageheight{.1\paperheight}% height of the chapter images

\usepackage{tikz}
\usetikzlibrary{positioning, backgrounds}
\usepackage{tikzpagenodes}

\renewcommand\chapterformat{%
  %\hspace*{-1in} %customize this to your needs
  \begin{tikzpicture}[remember picture, overlay]
        \fill[back] 
        ([yshift=-\chapterimageheight] current page.north west) 
        rectangle (current page.north east);%
%
        \node[anchor=center] at ([yshift=-1cm, xshift=-2cm] current page.north east) %
            {\color{white} \chapapp};
%
        \node[anchor=center] at ([yshift=-3.7cm, xshift=-2cm] current page.north east) %
            {\color{fore} {\rmfamily \fontsize{120}{120} \selectfont\thechapter}};
  \end{tikzpicture}
}

\usepackage{etoolbox}
\appto\chapterheadstartvskip{\noindent\vspace*{2cm}}


\begin{document}

\chapter{Introduction}  
\lipsum[2]
\section{My Section}

$$
\int f(x) dx = \frac{\partial g}{\partial y}
$$

\end{document}
3

I do not really understand want you want to do and version 3.12 is really old. My oldest version for testing is 3.16, current version on CTAN is 3.19a. But you have to change the font element chapter to get it visible on the black background. To shift it up use a negative value for \vspace*.

\documentclass{scrbook}
\usepackage{lmodern}% <- added
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{lipsum}
\definecolor{back}{HTML}{141414}
\definecolor{fore}{HTML}{FC4508}

\newcommand*\chapterimageheight{.2\paperheight}% height of the chapter images
\newcommand*\chapterhalfimageheight{.1\paperheight}% height of the chapter images

\usepackage{tikz}
\usetikzlibrary{positioning, backgrounds}
\usepackage{tikzpagenodes}

\renewcommand\chapterformat{%
  %\hspace*{-1in} %customize this to your needs
  \begin{tikzpicture}[remember picture, overlay]
        \fill[back] 
        ([yshift=-\chapterimageheight] current page.north west) 
        rectangle (current page.north east);%
%
        \node[anchor=center] at ([yshift=-1cm, xshift=-2cm] current page.north east) %
            {\color{white} \chapapp};
%
        \node[anchor=center] at ([yshift=-3.7cm, xshift=-2cm] current page.north east) %
            {\color{fore} {\rmfamily \fontsize{120}{120} \selectfont\thechapter}};
  \end{tikzpicture}%
}

\renewcommand\chapterheadstartvskip{%
  \vspace*{\dimexpr-1in-\headsep-\headheight-\topmargin-\topskip+.75cm\relax}}
\usepackage{etoolbox}
\appto\chapterheadendvskip{%
  \vspace{\dimexpr 1in+\headsep+\headheight+\topmargin+\topskip+2cm\relax}}

\addtokomafont{chapter}{\color{white}}

\begin{document}
\chapter{Introduction}  
\lipsum[2]
\section{My Section}
\[
  \int f(x) dx = \frac{\partial}{\partial y}
\]
Used version: \KOMAScriptVersion
\end{document}

Result:

enter image description here

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.