标题太长

标题太长

运行标题有时太长,我尝试使用 \sectionmark,但它不起作用......

梅威瑟:

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

答案1

对于这种情况,类似部分的命令有一个可选参数。

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

相关内容