目前我正在写一份包含一些缩写的文档。缩写的包是词汇表:
\usepackage[acronym,nonumberlist,nomain,toc]{glossaries}
\makeglossaries
我使用以下命令打印词汇表:
\printglossary[title={List of Abbreviations}]
文档类是一本双面书。我已经更改了第二页的标题样式,用于目录和图片列表、表格列表以及列表列表(均带有 scshape)。
\makeatletter
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\contentsname
\@mkboth{%
\scshape\contentsname}{\scshape\contentsname}
}
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
\makeatother
现在缩写已经到达第二页,我的问题就出现了。
我怎样才能更改第二个缩写页的页眉样式,以使其看起来与其他页眉相同?
以下是 MWE:
\documentclass[twoside,12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[ngerman,english]{babel}
\usepackage{fancyhdr}
\usepackage[explicit]{titlesec}
\usepackage[acronym,nonumberlist,nomain,toc]{glossaries}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RE]{\leftmark}
\fancyhead[LO]{\rightmark}
\fancyhead[LE,RO]{\thepage}
\makeatletter
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\contentsname
\@mkboth{%
\scshape\contentsname}{\scshape\contentsname}
}%
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
\makeatother
\makeglossaries
\begin{document}
\tableofcontents
\printglossary[title={List of Abbreviations}]
\chapter{Chapter One}
\section{Section One}
\gls{a} \gls{b} \gls{c} \gls{d} \gls{e} \gls{f} \gls{g}
\gls{h} \gls{i} \gls{j} \gls{k} \gls{l} \gls{m} \gls{n}
\gls{o} \gls{p} \gls{q} \gls{r}
\newacronym{a}{a}{AAAAAAA}
\newacronym{b}{be}{BBBBBB}
\newacronym{c}{c}{CCCCCC}
\newacronym{d}{de}{DDDDDDD}
\newacronym{e}{e}{EEEEEE}
\newacronym{f}{ef}{FFFFFFF}
\newacronym{g}{ge}{GGGGGGGG}
\newacronym{h}{ha}{HHHHHHHH}
\newacronym{i}{i}{IIIIIIIIII}
\newacronym{j}{jot}{JJJJJJJ}
\newacronym{k}{ka}{KKKKKKKK}
\newacronym{l}{el}{LLLLLLLLLL}
\newacronym{m}{em}{MMMMMMMM}
\newacronym{n}{en}{NNNNNNNNN}
\newacronym{o}{o}{OOOOOOO}
\newacronym{p}{pe}{PPPPPPPPPP}
\newacronym{q}{qu}{QQQQQQQQQ}
\newacronym{r}{er}{RRRRRRRRR}
\end{document}
这是差异的截图。缺少 \scshape
答案1
删除整个重新定义,\tableofcontents
并将排版命令添加到花式标题的定义中:
\fancyhead[RE]{\scshape\nouppercase{\leftmark}}
\fancyhead[LO]{\scshape\nouppercase{\rightmark}}
顺便说一句,为了编译您的示例,必须在使用缩写词定义之前将其移至文档的开头。
\documentclass[twoside,12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[ngerman,english]{babel}
\usepackage{fancyhdr}
\usepackage[explicit]{titlesec}
\usepackage[acronym,nonumberlist,nomain,toc]{glossaries}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RE]{\scshape\nouppercase{\leftmark}}
\fancyhead[LO]{\scshape\nouppercase{\rightmark}}
\fancyhead[LE,RO]{\thepage}
\makeglossaries
\newacronym{a}{a}{AAAAAAA}
\newacronym{b}{be}{BBBBBB}
\newacronym{c}{c}{CCCCCC}
\newacronym{d}{de}{DDDDDDD}
\newacronym{e}{e}{EEEEEE}
\newacronym{f}{ef}{FFFFFFF}
\newacronym{g}{ge}{GGGGGGGG}
\newacronym{h}{ha}{HHHHHHHH}
\newacronym{i}{i}{IIIIIIIIII}
\newacronym{j}{jot}{JJJJJJJ}
\newacronym{k}{ka}{KKKKKKKK}
\newacronym{l}{el}{LLLLLLLLLL}
\newacronym{m}{em}{MMMMMMMM}
\newacronym{n}{en}{NNNNNNNNN}
\newacronym{o}{o}{OOOOOOO}
\newacronym{p}{pe}{PPPPPPPPPP}
\newacronym{q}{qu}{QQQQQQQQQ}
\newacronym{r}{er}{RRRRRRRRR}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\printglossary[title={List of Abbreviations}]
\chapter{Chapter One}
\section{Section One}
\gls{a} \gls{b} \gls{c} \gls{d} \gls{e} \gls{f} \gls{g}
\gls{h} \gls{i} \gls{j} \gls{k} \gls{l} \gls{m} \gls{n}
\gls{o} \gls{p} \gls{q} \gls{r}
\Blindtext\Blindtext
\end{document}