# Daleif1 Theme : how to get part's title above chapter?

I am using the daleif1 theme, and I would like to have the \part's title juste above the \chapter's title on the same page.

\documentclass{memoir}
\usepackage[explicit]{titlesec}
\usepackage{calc,graphicx,soul}
\usepackage{color}

\begin{document}
\definecolor{nicered}{rgb}{.647,.129,.149}
\makeatletter
\newlength\dlf@normtxtw
\setlength\dlf@normtxtw{\textwidth}
\def\myhelvetfont{\def\sfdefault{mdput}}
\newsavebox{\feline@chapter}
\newcommand\feline@chapter@marker[1][4cm]{%
\sbox\feline@chapter{%
\resizebox{!}{#1}{\fboxsep=1pt%
\colorbox{nicered}{\color{white}\bfseries\sffamily\thechapter}%
}}%
\rotatebox{90}{%position titre "Chapitre"
\resizebox{%
\heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%
\raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
}
\newcommand\feline@chm[1][4cm]{%
\sbox\feline@chapter{\feline@chapter@marker[#1]}%
\makebox[0pt][l]{% aka \rlap
\makebox[18cm][r]{\usebox\feline@chapter}%
}}
\makechapterstyle{daleif1}{
\renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}
\renewcommand\chaptitlefont{\normalfont\huge\bfseries\scshape\color{nicered}}
\renewcommand\printchaptername{\color{black}}
\renewcommand\printchapternum{\feline@chm[2.5cm]} % taille de la box
\setlength\beforechapskip{-1cm}
\renewcommand\afterchapternum{\par\vskip\midchapskip}
\renewcommand\printchaptertitle[1]{\chaptitlefont\raggedleft\underline{##1}\par}
}

\makeatother
\chapterstyle{daleif1}

\part{Part ONE}

\chapter{Chapter ONE of PART ONE}
\chapter{Chapter TWO of PART ONE}

\end{document}


I dont have the slighest idea how to do it. I tried to use \printparttitle but it doesn't work.

• @daleif One for you ;-) Sep 7, 2014 at 9:07

You can make \printpartitle to remember the current part title. I added also an interface for resetting the title to nothing.

\documentclass{memoir}
\usepackage{calc,graphicx}
\usepackage{color}

\definecolor{nicered}{rgb}{.647,.129,.149}
\makeatletter
\newlength\dlf@normtxtw
\setlength\dlf@normtxtw{\textwidth}
\def\myhelvetfont{\def\sfdefault{mdput}}
\newsavebox{\feline@chapter}
\newcommand\feline@chapter@marker[1][4cm]{%
\sbox\feline@chapter{%
\resizebox{!}{#1}{\fboxsep=1pt%
\colorbox{nicered}{\color{white}\bfseries\sffamily\thechapter}%
}}%
\rotatebox{90}{%position titre "Chapitre"
\resizebox{%
\heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%
\raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
}
\newcommand\feline@chm[1][4cm]{%
\sbox\feline@chapter{\feline@chapter@marker[#1]}%
\makebox[0pt][l]{% aka \rlap
\makebox[18cm][r]{\usebox\feline@chapter}%
}}
\makechapterstyle{daleif1}{
\renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft}
\renewcommand\chaptitlefont{\normalfont\huge\scshape\color{nicered}}
\renewcommand\printchaptername{\color{black}}
\renewcommand\printchapternum{\feline@chm[2.5cm]} % taille de la box
\setlength\beforechapskip{-1cm}
\renewcommand\afterchapternum{\par\vskip\midchapskip}
\renewcommand\printchaptertitle[1]{%
\chaptitlefont\raggedleft
{\normalfont\itshape\currentparttitle}##1\par}
}

\renewcommand{\printparttitle}[1]{%
\gdef\currentparttitle{#1\\}%
\parttitlefont{#1}%
}

\newcommand{\resetparttitle}{\gdef\currentparttitle{\strut}}
\resetparttitle

\makeatother
\chapterstyle{daleif1}

\begin{document}

\chapter*{Introduction}

\part{Part ONE}

\chapter{Chapter ONE of PART ONE}
\chapter{Chapter TWO of PART ONE}

\resetparttitle
\chapter*{PPP} % emulate the back matter such as the bibliography

\end{document}


Note that I removed underlining, which has little to do with good typography. Also boldface is in conflict with small caps: there are fonts with boldface small caps, but this is a punch in the eye. Use either boldface or small caps, not both: double emphasis is too much.

If you don't want a part page, then don't issue the \part command, of course.

You can define

\newcommand\newpart[1]{%
\cleardoublepage
%\phantomsection % if you use hyperref uncomment this line

• @Terriguest That's a very different question. Just don't use \part and set \currentparttitle. Sep 7, 2014 at 13:00