我有以下文档,问题是当章节名称很长时,在页眉中显示时会被截断。我该如何解决这个问题?
\documentclass[a4paper,12pt]{book}
\ExplSyntaxOn
\usepackage{geometry}
\NewDocumentCommand \wvPage {}
%% 31x21 cm Page Size
{
\geometry{ paperwidth=13cm, paperheight=21cm,
textwidth=12cm, textheight=20cm,
left=8mm, right=8mm, top=8mm, bottom=8mm, includehead}
}
\wvPage
\ExplSyntaxOff
\title{Sections and Chapters}
\author{Ramanujan}
\date{\today}
\begin{document}
\maketitle
\tableofcontents
\chapter {This is an introduction to some topic}
\section{Test}
Some text
\subsection{A Subsection}
More text here
\subsubsection{A Subsubection}
And more text
\end{document}
答案1
解决这个问题的最便宜的方法是使用 为长章节标题指定一个缩短的标题\chaptermark{<shortened title>}
。这类似于使用可选参数来\chapter[<ToC entry>]{<title>}
显示ToC entry
与主文档中显示的内容不同的内容。
\documentclass[12pt]{book}
\usepackage{lipsum}% Just for this example
\usepackage{geometry}
%% 13x21 cm Page Size
\geometry{ paperwidth=13cm, paperheight=21cm,
%textwidth=12cm, textheight=20cm, % This is not needed
margin=8mm, includehead}
\begin{document}
\tableofcontents
\chapter{This is an introduction to some topic}
\chaptermark{Introduction}
\section{Test}\lipsum[1-10]
\subsection{A Subsection}\lipsum[11-20]
\subsubsection{A Subsubection}\lipsum[21-30]
\end{document}