如何在论文页眉中添加汉字?

如何在论文页眉中添加汉字?

我正在写一篇论文并使用硕士博士论文.cls格式。此格式在页眉中显示当前页面的章节名称和标题。我想在论文的每一页上添加中文特定字符。硕士博士论文.cls标题为:

\RequirePackage[markcase=used]{scrlayer-scrpage}
\providepairofpagestyles{thesisSimple}{%
    \clearpairofpagestyles%
    \automark[chapter]{chapter}
    \ihead{\headmark}% Inner header
    \ohead[\pagemark]{\pagemark}% Outer header
}
\ifoot{}% Inner footer
\ofoot{}% Outer footer
\pagestyle{thesisSimple}
\providepairofpagestyles[thesisSimple]{thesis}{%
    \automark*[section]{}%
}
\providepairofpagestyles[thesisSimple]{review}{%
    \ofoot[\shorttitle/\authorname]{\shorttitle/\authorname}
    \ifoot[\today]{\today}
}
\pagestyle{thesis}
\ifbool{headsepline}{\KOMAoption{headsepline}{true}}{}
\PreventPackageFromLoading[\ClassError{\classname}{Package `fancyhdr' is
incompatible\MessageBreak with this class}{The pagesyles are defined 
    using package `scrlayer-scrpage', please consult the\MessageBreak 
KOMA-script documentation for details.}]{fancyhdr}


\newcommand{\blank@p@gestyle}{empty}
\newcommand{\chapter@p@gestyle}{plain}
\NewDocumentCommand{\blankpagestyle}{ m }{%
    \ClassWarning{\classname}{\string\blankpagestyle\space is
    obsolete,\MessageBreak use \string\setblankpagestyle \space  instead}\renewcommand{\blank@p@gestyle}{}{#1}
}
\NewDocumentCommand{\setblankpagestyle}{ m }{\renewcommand{\blank@p@gestyle}{#1}}
\NewDocumentCommand{\setchapterpagestyle}{ m }{\renewcommand{\chapter@p@gestyle}{#1}}

\DeclareDocumentCommand\cleardoublepage{}{\clearpage\if@twoside \ifodd\c@page\else
    \hbox{}
    \thispagestyle{\blank@p@gestyle}
    \newpage
    \if@twocolumn\hbox{}\newpage\fi\fi\fi%
}

我需要在我的标题在此处输入图片描述

并且只需要在页脚中放置红线,例如: 在此处输入图片描述

为此,我使用了以下代码,但它不起作用:

\pagestyle{fancy} % all pages will follow same fancy header and footer style except title page
\fancyhf{} % Clear header and footer
\fancyhead[C]
{\begin{CJK*}{UTF8}{gkai}
        \fontsize{20}{20} \textbf{华\hspace{0.5cm}中\hspace{0.5cm}科\hspace{0.5cm}技\hspace{0.5cm}大\hspace{0.5cm}学\hspace{0.5cm}研\hspace{0.5cm}究\hspace{0.5cm}生\hspace{0.5cm}院} \end{CJK*}}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.7pt} % Line at the header visible

我该怎么办?请帮我解决这个问题?

答案1

添加footsepline到全局选项。

headsepline, % Uncomment to get a line under the header
footsepline,% <-------
%chapterinoneline, % Uncomment to place the chapter title next to the number on one line
%consistentlayout, % Uncomment to change the layout of the declaration, abstract and acknowledgements pages to match the default layout
]{MastersDoctoralThesis} % The class file specifying the document structure

%\usepackage[utf8]{inputenc} % Required for inputting international characters
%\usepackage[T1]{fontenc} % Output font encoding for international characters

%\usepackage{mathpazo} % Use the Palatino font by default
\usepackage{fontspec}
\setmainfont{Noto Serif CJK}
\clearpairofpagestyles
\cfoot*{\pagemark}
\chead{华\hspace{0.5cm}中\hspace{0.5cm}科\hspace{0.5cm}技\hspace{0.5cm}大\hspace{0.5cm}学\hspace{0.5cm}研\hspace{0.5cm}究\hspace{0.5cm}生\hspace{0.5cm}院}
\setkomafont{pagehead}{\normalfont\bfseries}
\addtokomafont{pageheadfoot}{\color{red!80!black}}

在我非常旧的安装中,LuaTeX 拒绝找到粗体字体粗细。我不会深入研究这个问题,因为这个问题很可能在全新安装 TeX Live 后就消失了,否则 TL17 的解决方案就过时了。

相关内容