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?

Harpalss
  • 133
  • You're putting too much information in you headers; even scaling them you will get overlaps or unreadable text – egreg Mar 14 '12 at 16:15
  • @Mark: In most cases, we can get rid of "LaTeX:" in the question title altogether. This is often the case with questions migrated from [SO]. – doncherry Mar 14 '12 at 16:17
  • @doncherry: That's a good point, but it's useful to differentiate it from, say, ConTeXt in some cases. You're definitely right here though. – qubyte Mar 14 '12 at 16:21
  • also http://tex.stackexchange.com/questions/6862/how-can-i-display-a-short-chapter-name-in-the-header-and-a-long-chapter-name-in or http://tex.stackexchange.com/questions/23121/heading-exceeds-margins – Thorsten Mar 14 '12 at 16:43

1 Answers1

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).

cmhughes
  • 100,947
David Carlisle
  • 757,742