Theses, Books, Title pageschapter heading

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

chapter heading

Post by templateuser »

Is it possible to include the nice toc in the chapter headers of the previous version in this version? I tried to add

Code: Select all

% Section text styling
\titlecontents{lsection}[0em] % Indendating
{\footnotesize\sffamily} % Font settings
{}
{}
{}

% Subsection text styling
\titlecontents{lsubsection}[.5em] % Indentation
{\normalfont\footnotesize\sffamily} % Font settings
{}
{}
{}
and insert the piece of code that generates the toc in the previous version:

Code: Select all

% Chapter headings
...

\if@mainmatter
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.north west)
{\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north west,inner sep=0pt] at (0,0) {\includegraphics[width=\paperwidth]{\thechapterimage}};
%Commenting the 3 lines below removes the small contents box in the chapter heading
\draw[fill=white,opacity=.6] (1cm,0) rectangle (8cm,-7cm);
\node[anchor=north west] at (1cm,.25cm) {\parbox[t][8cm][t]{6.5cm}{\huge\bfseries\flushleft \printcontents{l}{1}{\setcounter{tocdepth}{2}}}};
\draw[anchor=west] (\Gm@lmargin,-9cm) node [line width=2pt,rounded corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner sep=15pt]{\strut\makebox[22cm]{}};
\draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}\thechapter. #1\strut};
\end{tikzpicture}};
\end{tikzpicture}
\else
...
but this makes appear the toc of the part instead of the toc of only the chapter.
Is it something I could fix, or should I just choose between the new and the old version? Thanks!

DRe

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

chapter heading

Post by templateuser »

You can remove the first part. This is already included. Then try what is indicated below.
You will have to manually calculate how to properly place the white transparent box and the table of contents.

Code: Select all

\if@mainmatter
\startcontents[sections]
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.north west)
{\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north west,inner sep=0pt] at (0,0) {\includegraphics[width=\paperwidth]{\thechapterimage}};
%Commenting the 3 lines below removes the small contents box in the chapter heading
\draw[fill=white,opacity=.6] (1cm,0) rectangle (8cm,-7cm);
\node[anchor=north
west] at (1cm,.25cm) 
{\parbox[t][8cm][t]{6.5cm}{\huge\bfseries\flushleft\printcontents[sections]{}{1}{}}};
\draw[anchor=west]
(\Gm@lmargin,-9cm) node [line width=2pt,rounded 
corners=15pt,draw=ocre,fill=white,fill opacity=0.5,inner 
sep=15pt]{\strut\makebox[22cm]{}};
\draw[anchor=west] (\Gm@lmargin+.3cm,-9cm) node {\huge\sffamily\bfseries\color{black}\thechapter. #1\strut};
\end{tikzpicture}};
\end{tikzpicture}
\else
.....
Mathias
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

chapter heading

Post by templateuser »

Hi, thanks for the solution. It works fine, but I wanted to be able to have a different layout (no pagenumbers, etc) for the chapter-headings. This is what I did:

Code: Select all

\titlecontents{rsection}[0em] {\footnotesize\sffamily} {}{}{}
\titlecontents{rsubsection}[.5em] {\normalfont\footnotesize\sffamily}{}{}{}
And     \if@mainmatter
\startcontents[sections]        
...
\draw[fill=white,opacity=.6] (1cm,0) rectangle (8cm,-7cm);
\node[anchor=north west] at (1cm,.25cm)
  {\parbox[t][8cm][t]{6.5cm}{\small\bfseries\flushleft
   \printcontents[sections]{r}{1}{\setcounter{tocdepth}{2}}}};
DRe
Post Reply