我目前正在使用提供的类文件撰写论文。在此类文件中,标题使用以下代码定义:
% Page geometry and spacing (same for even and odd pages)
\geometry{left=4cm, right=4cm, top=4cm, bottom=4.5cm}
\frenchspacing
% Roman page numbers from the beginning of the document
\pagenumbering{roman}
\setcounter{page}{3}
% Switch to Arabic page numbering at the beginning of the first numbered chapter
\newif\iffirstchapter
\firstchaptertrue
\let\std@chapter\@chapter
\def\@chapter{
\iffirstchapter
\pagenumbering{arabic}
\firstchapterfalse
\fi
\std@chapter
}
% Add unnumbered chapters to table of contents and headings
\let\std@schapter\@schapter
\def\@schapter#1{
\std@schapter{#1}
\addcontentsline{toc}{chapter}{#1}
\def\ch@ptermark{#1}
}
% Dotted line and tighter vertical spacing for chapters in the table of contents
\def\l@chapter#1#2{\@dottedtocline{1}{0em}{1.5em}{\bf #1}{\bf #2}}
% Support for included papers (for compiled PhD theses)
\newcounter{paper}
\setcounter{paper}{0}
\def\thepaper{\Roman{paper}}
\newenvironment{paper}[2]
{
\refstepcounter{paper}
\def\include@papername{#1}
\chapter*{\papername~\thepaper}
\label[paper]{#2}
}{
\cleardoublepage
\includepdf[pages=-]{\include@papername}
}
% Allow for two versions of title and authors – full and short
\def\title#1{\def\@title{#1}\def\@shorttitle{#1}}
\def\shorttitle#1{\def\@shorttitle{#1}}
\def\author#1{\def\@author{#1}\def\@shortauthor{#1}}
\def\shortauthor#1{\def\@shortauthor{#1}}
% Headers and footers
\def\ps@customheadings{%
\let\@evenfoot\@empty
\let\@oddfoot\@empty
\def\@evenhead{\small\thepage\hfil\textit{\@shortauthor: \@shorttitle}}
\def\@oddhead{\small\textit{\ch@ptermark}\hfil\thepage}
\def\chaptermark##1{\def\ch@ptermark{\chaptername\ \thechapter: ##1}}
}
\pagestyle{customheadings}
对于论文的前半部分(如“前言”等),我使用带星号的章节,结果出现了“第 0 章:”标题。有没有办法重写上面的代码,使我的标题变成
<Title>
对于已加星标的章节,以及
Chapter x: <Title>
对于“普通”章节?理想情况下,应该可以选择是否在未加星标的章节之间增加加星标的章节的章节计数器。