TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

share|improve this answer
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 '12 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. – Gonzalo Medina Sep 20 '12 at 13:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.