1

Possible Duplicate:
Chapter title in header too long

I'm using LaTeX to write a report, but some of the sections and subsections have long titles, and these titles overlap in the header of the pages. An example code of what I mean is below.

\documentclass[a4paper,11pt]{article}
\usepackage{fancyhdr} % Used for header

\begin{document}
\pagestyle{fancy} % makes the header look fancy

\section{this is a very long section}
\subsection{this is a bery long subsection. Going to overlap}

test1

\newpage

test2

\end{document}

If you look at the second page of the PDF that is generated the header is overlapping. Is there a way of auto-scaling or manually scaling the header sizes so they don't overlap?

4

1 Answer 1

6

As @egreg commented, your header text is probably too long, so it's probably worth mentioning the optional argument

 \section[short header]{this is a very long section}

This puts a short version of the title in the head (and table of contents).

1
  • 1
    is there a way of changing only the title in the head, and not in the TOC?
    – jrjrjr
    Mar 12, 2020 at 14:45

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