# Running Headers Too Long

The running headers are occasionally too long, I tried using \sectionmark but it doesn't work...

MWE:

\documentclass[twocolumn,a4paper,10pt]{book}
\usepackage{fancyhdr}
\pagestyle{fancy}

\usepackage{lipsum}

\begin{document}

\tableofcontents

\section{Introduction}

\lipsum{5}

\section{Here's long text that is two long for the page and I'd like to substitute it but can't figure out how}
\sectionmark[long text]

\lipsum{5}

\end{document}

• The fancyhdr documentation, section 33 "Large chapter/section titles" describes a couple of solutions. May 9, 2022 at 18:57

## 1 Answer

Section-like commands have an optional argument for such cases.

\documentclass[twocolumn,a4paper,10pt]{book}
\usepackage{fancyhdr}
\pagestyle{fancy}

\usepackage{lipsum}

\begin{document}

\tableofcontents

\section{Introduction}

\lipsum{5}

%The next line
\section[This is the shortened version]{Here's long text that is two long for the page and I'd like to substitute it but can't figure out how}
%\sectionmark[long text]

\lipsum{5}

\end{document}

• I don't see an answer here. May 9, 2022 at 19:14
• @user26732 Now the place is marked %The next line. May 9, 2022 at 19:16