如何更改回忆录中的标题字体样式?

如何更改回忆录中的标题字体样式?

请看下面的图片。我如何更改标题字体样式?如您所见,由于章节标题太长,它换行了两行。我确实读过回忆录手册,但我唯一找到的是,\makeheadrule我已经用它来获得标题的下划线效果(\makeheadrule{headings}{\textwidth}{0.3pt})。我不确定如何进一步更改它以减小字体大小,因为它使用内置headings样式。我不知道如何修改headings样式。有什么想法吗?

另外,在我改变尺寸之后,我想将其重置回来以适应后续章节,因为它们没有那么长的章节标题。

在此处输入图片描述

答案1

您可以使用\markboth命令手动自定义特定章节页眉中使用的标记(特别是标记所用的字体)。我不喜欢这种方法,因为它会导致文档布局不一致(某些章节的页眉为正常大小,而某个章节的页眉则为较小字体)。

更好的选择是使用\chapter命令的第二个可选参数(在中实现的功能memoir)来使用更短的文本作为标题;以下示例说明了这些方法:

\documentclass{memoir}
\usepackage{lipsum}

\pagestyle{headings}

\begin{document}

% using \markboth to change the mark used
\chapter{Selective printing and deleting of certain lines}
\markboth{\small \chaptername\ \thechapter. Selective printing and deleting of certain lines}{}
\section{Test section}
\lipsum[1-30]
% using the second optional argument of \chapter to change the header text
\chapter[Selective printing and deleting of certain lines][Selective action on lines]{Selective printing and deleting of certain lines}
\section{Test section}
\lipsum[1-30]

\end{document}

答案2

使用\copypagestyle宏(回忆录手册,第 121 页)克隆headings页面样式,并向默认定义添加一个改变字体大小的宏(可在第 124 页找到)。更好的方法是,按照 Gonzalo Medina 的建议,为页眉使用一个较短的标题。

\documentclass[12pt]{memoir}

\makeheadrule{headings}{\textwidth}{0.3pt}

\copypagestyle{fnsizeheadings}{headings}
\makeevenhead{fnsizeheadings}{\thepage}{}{\footnotesize\slshape\leftmark}
\makeoddhead{fnsizeheadings}{\footnotesize\slshape\rightmark}{}{\thepage}

\usepackage{lipsum}

\begin{document}

\pagestyle{fnsizeheadings}

\chapter{Selective printing and deleting of certain lines}

\section{foo}

\lipsum[1-8]

\cleardoublepage
\pagestyle{headings}

\chapter[Selective printing and deleting]{Selective printing and deleting of certain lines}

\section{foo}

\lipsum[1-8]

\end{document}

答案3

第三件事是不要在标题中使用纯大写字母,它们占用了大量空间。

简单发行

\nouppercaseheads

在激活页面样式之前将停用自动大写功能

答案4

这是一个有点长的解决方案(使用 Memoir 类):

% New Page Style
\makepagestyle{MPS} 
%
\makeatletter % \@chapapp
\makepsmarks{MPS}{%
\nouppercaseheads
\createmark      {chapter}      {both} {shownumber} {\@chapapp }{. \ }
\createmark      {section}      {right}{shownumber} {}{. \ }
\createmark      {subsection}   {right}{shownumber}   {}{. \ }
\createmark      {subsubsection}{right}{shownumber}   {}{. \ }
\createplainmark {toc}          {both} {\contentsname}
\createplainmark {lof}          {both} {\listfigurename}
\createplainmark {lot}          {both} {\listtablename}
\createplainmark {bib}          {both} {\bibname}
\createplainmark {index}        {both} {\indexname}
\createplainmark {glossary}     {both} {\glossaryname}   
}

\makeheadrule{MPS}{\textwidth}{2\normalrulethickness}

\makeevenhead{MPS}{ 
\fontencoding{T1}\fontfamily{lmss}\selectfont \small\thepage}
{}{ 
\fontencoding{T1}
\fontfamily{lmss}\selectfont 
\small\leftmark 
}

\makeoddhead{MPS}{
\fontencoding{T1}
\fontfamily{lmss}\selectfont 
\small\rightmark 
}
{}
{\fontencoding{T1}
\fontfamily{lmss}\selectfont
\small\thepage} 

其中使用拉丁现代无衬线字体,如背面的文档中所示。

相关内容