在页眉中添加附录一词

在页眉中添加附录一词

我正在完成我的博士论文模板。除附录标题外,其他一切都按预期进行。

到目前为止,它仅显示标题:“期刊文章“。我想要的是:”附录 A 期刊文章“。

文档类别是回忆录下面是显示该问题的 MWE:

\documentclass[b5paper]{memoir}
\usepackage[utf8]{inputenc}
\usepackage{blindtext} 

%%%%%%%%% HEADER AND FOOTER FORMAT  %%%%%%%%%

\def\hffont{\sffamily\small}
\makepagestyle{myruled}
\makeheadrule{myruled}{\textwidth}{\normalrulethickness}
\makeevenhead{myruled}{\hffont\thepage}{}{\hffont\leftmark}
\makeoddhead{myruled}{\hffont\rightmark}{}{\hffont\thepage}
\makeevenfoot{myruled}{}{}{}
\makeoddfoot{myruled}{}{}{}
\makepsmarks{myruled}{
    \nouppercaseheads
    \createmark{chapter}{both}{shownumber}{}{\space}
    \createmark{section}{right}{shownumber}{}{\space}
    \createplainmark{toc}{both}{\contentsname}
    \createplainmark{lof}{both}{\listfigurename}
    \createplainmark{lot}{both}{\listtablename}
    \createplainmark{bib}{both}{\bibname}
    \createplainmark{index}{both}{\indexname}
    \createplainmark{glossary}{both}{\glossaryname}
}
\pagestyle{myruled}
\copypagestyle{cleared}{myruled}      % When \cleardoublepage, use myruled instead of empty
\makeevenhead{cleared}{\hffont\thepage}{}{} % Remove leftmark on cleared pages
\makeevenfoot{plain}{}{}{}            % No page number on plain even pages (chapter begin)
\makeoddfoot{plain}{}{}{}  

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{document}

\appendix
\chapter{Test on header}
\blindtext[10]

\end{document}

我希望你能帮我解决这个问题。提前谢谢!

答案1

感谢新的 MWE --- 非常有帮助。

也许您 MWE 的以下编辑版本会满足您的要求。

% appendixheaderprob.tex SE 518282 add Appendix to header

\documentclass[b5paper]{memoir}
\usepackage[utf8]{inputenc}
\usepackage{blindtext} 

%%%%%%%%% HEADER AND FOOTER FORMAT  %%%%%%%%%

\def\hffont{\sffamily\small}
\makepagestyle{myruled}
\makeheadrule{myruled}{\textwidth}{\normalrulethickness}
\makeevenhead{myruled}{\hffont\thepage}{}{\hffont\leftmark}
\makeoddhead{myruled}{\hffont\rightmark}{}{\hffont\thepage}
\makeevenfoot{myruled}{}{}{}
\makeoddfoot{myruled}{}{}{}
%%%%%% new code
\makepagestyle{appruled}
\makeheadrule{appruled}{\textwidth}{\normalrulethickness}
\makeevenhead{appruled}{\hffont\thepage}{}{\hffont\appendixname~\leftmark}
\makeoddhead{appruled}{\hffont\appendixname~\rightmark}{}{\hffont\thepage}
\makeevenfoot{appruled}{}{}{}
\makeoddfoot{appruled}{}{}{}
%%%% end new code
\makepsmarks{myruled}{
    \nouppercaseheads
    \createmark{chapter}{both}{shownumber}{}{\space}
    \createmark{section}{right}{shownumber}{}{\space}
    \createplainmark{toc}{both}{\contentsname}
    \createplainmark{lof}{both}{\listfigurename}
    \createplainmark{lot}{both}{\listtablename}
    \createplainmark{bib}{both}{\bibname}
    \createplainmark{index}{both}{\indexname}
    \createplainmark{glossary}{both}{\glossaryname}
\createplainmark{appendix}{both}{\appendixname}
}
\pagestyle{myruled}
\copypagestyle{cleared}{myruled}      % When \cleardoublepage, use myruled instead of empty
\makeevenhead{cleared}{\hffont\thepage}{}{} % Remove leftmark on cleared pages
\makeevenfoot{plain}{}{}{}            % No page number on plain even pages (chapter begin)
\makeoddfoot{plain}{}{}{}  

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{document}

\chapter{A chapter}
\blindtext[10]

\appendix
\pagestyle{appruled}  %%%% new code
\chapter{Test on appendix header}
\blindtext[10]

\end{document}

相关内容