I have a document of a deep structure, in sense Part, Chapter....Paragraph which are all used, I want to make full paragraph path to be displayed in the header of each page, something like:

Physics->Quantum Physics->Foundations->Harmonic Oscillator->Ladder Operators...

I managed to do that in MS Word some time ago, but how can that be done in LaTeX ? and please note that it may need more than one line to display it fully.

1 Answer 1


Here's a solution using the titleps package and its extramarks option:



    \ifnum\value{section}>0 \guillemotright\ \else\fi%
    \ifnum\value{subsection}>0 \guillemotright\ \else\fi%
    \ifnum\value{subsubsection}>0 \guillemotright\ \else\fi%
    \ifnum\value{paragraph}>0 \guillemotright\ \else\fi%



\chapter{Test Chapter One}
\section{Test Section One One}
\subsection{Test Subsection One One One}
\subsection{Test Subsection One One Two}
\subsubsection{Test Subsection One One Two One}
\paragraph{Test Paragraph One One Two One One}


Some images taken from some of the pages to see the headers:

enter image description here


enter image description here

As a personal note, I don't think it's a good idea to use such longer headers.

  • Thx, basically it worked, but not in my document unfortunately, because it will not display the header at beginning of the new chapter page, and I'm using "\renewcommand\subsection{\newpage\stdsubsection}" to force new page for each subsection (the nature of my reference I'm writing requires that and such headers), can we fix that?
    – TMS
    Sep 20, 2012 at 13:28
  • @TMS please see my updated answer. I \let the plain style to be main, so first pages of chapters will also show the headers; I used a redefinition of \subsectionbreak (from the titlesec package) to allow each subsection to start on a new page. Sep 20, 2012 at 13:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .