Ejecutar encabezados demasiado tiempo

Ejecutar encabezados demasiado tiempo

Los encabezados en ejecución a veces son demasiado largos. Intenté usar \sectionmark pero no funciona...

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}

Respuesta1

Los comandos tipo sección tienen un argumento opcional para tales casos.

\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}

información relacionada