On page 9 of the generated document, you can see that the section title is so long that is gets on two lines and overrides the chapter title. In some programming languages, I would think of including some kind of "truncate" version in my header definition. I also read things about having shorter versions of chapter/section title, (something like \sectionmark) , but this was not recognised by my compiler.

What would be a way to have a shorter title in header.

Code: Main.tex




    \renewcommand{\cftchappresnum}{Chapter }
    \AtBeginDocument{\addtolength\cftchapnumwidth{\widthof{\bfseries Chapter }}}




\rfoot{Page \thepage/\pageref{LastPage}}

  \fancyfoot[R]{Page \thepage/\pageref{LastPage}}%
  \renewcommand{\headrulewidth}{0pt}% Line at the header invisible
  \renewcommand{\footrulewidth}{0.1pt}% Line at the footer visible

        \chapter{Chapter title}
            \section{This section title is toooooooooooooooooooooooooooo long}
        \chapter{Chapter title}
        \chapter{Chapter title}
        \chapter{Chapter title}
        \chapter{Chapter title}
        \chapter{Chapter title}
            %\section{SectionTitle}  %Testing what happens in table of contents when there is a chapter without section.
        \chapter{Chapter title}


\begin{titlepage} \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\HRule \\[0.9cm]
    \textsc{\Huge Title}\\[1cm]
    \textsc{\LARGE Subtitle}\\[1.5cm]
\HRule \\[1.5cm]

\begin{center} \Large
    \begin{tabular}{ l r }  
        \emph{Text} & Text\\ 
        \emph{Text} & Text


\begin{center} \large
    \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l r @{}}
        \ Text & Text\\
        \ Text & Text\\
        \ Text & Text\\
        \ Text & Text\\
        \ Text & Text


  • 6
    You can use the optional argument of \section to define a short version for the header.(and the table of contents). – Bernard Mar 7 at 21:15
  • Thanks I didn't know you could write this: \section[test]{Section 4} – TTT Mar 7 at 21:20
  • Hello, I back working on this document ... I notice 2 problems with this solution: I get titles overlapping on two lines ... I truncate what I think would be enough from section optional name, then both titles get condense on one single line. And I come to situations where I cannot have a single word in my section name without overlapping the chaptername. Hence I tried removed the shortened title like this: \section[]{Section X title} ... but then my sections don't have a title in my table of content... I don"t think that the shortened title should be impacting the table of content at all... – TTT May 14 at 19:19
  • I found a solution to this new problem here: tex.stackexchange.com/questions/343188/… – TTT May 16 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.