The format of my thesis is as follows:
\documentclass[oneside,11pt,english]{book}
\usepackage{lipsum}
\usepackage{fancyhdr}
\usepackage{titlesec}
\setlength{\headheight}{26pt}
\fancypagestyle{anfang}{%
\fancyhead{\test}
\renewcommand{\headrulewidth}{0.4pt}
\fancyhf{}%
\fancyhead[L]{\rightmark}
\fancyfoot[C]{\thepage}
\lhead{\nouppercase{\leftmark}}
}
\fancypagestyle{rest}{
\fancyhf{}
\fancyhead[L,R]{ \rightmark}
\fancyhead[L,R]{ \leftmark}
\fancyfoot[C]{\thepage}
\rhead{\nouppercase{\rightmark}}
\lhead{\nouppercase{\leftmark}}
}
\titleformat{\part}[display]
{\normalfont\center}{\huge\scshape\partname\ \thepart\\*[-15pt]\hrulefill} {-13pt}{\huge\scshape\bfseries}[\vspace{-25pt}\hrulefill]
\titleformat{\chapter}[display]
{\normalfont\filleft}{\LARGE\scshape\chaptertitlename\ \thechapter\\*[-15pt]\hrulefill}{-13pt}{\scshape\LARGE\bfseries}[\vspace{-25pt}\hrulefill]
\titlespacing*{ \chapter}{0pt}{65pt}{40pt}
\titleformat{name=\chapter,numberless}[display]
{\normalfont\filleft}{\vspace{-15pt} \hrulefill}{-13pt} {\scshape\LARGE\bfseries}[\vspace{-25pt}\hrulefill]
\titlespacing*{\chapter}{0pt}{65pt}{40pt}
\begin{document}
\pagestyle{rest}
\chapter[chapter title for the toc]{Title of the chapter as displayed in the thesis\chaptermark{chapter title as in the header}}
\chaptermark{chapter title as in the header}
\lipsum \lipsum
\section[section title for the toc]{section title as displayed in the thesis\sectionmark{section title as in the header}}
\sectionmark{section title as in the header}
\lipsum
\subsection[subsection title for the toc]{subsection title as displayed in the thesis}
\subsectionmark{subsection title as in the header}
\lipsum
\part{here we have a part}
\end{document}
The problem occurs because the titlesec package that I am using to produce the layout of the beginning of the chapters and parts clashes somehow with the use of sectionmark so that the title of the section in the header on the first page on which the section occurs is the one that is supposed to be in the toc. In fact, the sectionmark does not really do anything for this first page, on the second page everything is as it should. The header on my second page looks like:

instead of the one on page 3:

What I want is to have the "section title for the header" to appear in the header of every page instead of the "section title for the toc".
Does anyone know how I can solve this issue?
TitleAfor the section in display,TitleBin the header andTitleCin the ToC? – Werner Sep 05 '13 at 17:48titlesec, so you want something that works with it rather than abandoning it altogether. – Werner Sep 05 '13 at 18:39