Skip to content

Commit

Permalink
fix the header of \chapter* in mainmatter
Browse files Browse the repository at this point in the history
Former-commit-id: 06fdb33
  • Loading branch information
HuangruiMo committed Oct 21, 2019
1 parent fc8d3db commit c409947
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@

## 重要通知

* `2019-10-12` 模板样式进行了修改,请查看下面的修改描述,以决定是否需要更新。
* `2019-10-21` 模板样式进行了修改,请查看下面的修改描述,以决定是否需要更新。

## 更新记录

* `2019-10-12` 根据 [huiwenzhang, issue #198](https://github.com/mohuangrui/ucasthesis/issues/198) 修复 'mainmatter' 下 '\chapter*' 的页眉错误。

* `2019-10-12` 根据 [Fancy0609, muzimuzhi, issue #195](https://github.com/mohuangrui/ucasthesis/issues/195) 调整由 AutoFakeBold 控制的伪粗体加粗程度。

* `2019-10-11` 根据 [Pantrick, issue #190](https://github.com/mohuangrui/ucasthesis/issues/190) 采用 [muzimuzhi](https://github.com/muzimuzhi) 提供的方法实现 \advisor{} 和 \institute{} 的自动换行功能。
Expand Down
25 changes: 13 additions & 12 deletions Style/artratex.sty
Original file line number Diff line number Diff line change
Expand Up @@ -617,16 +617,17 @@
%- Configure fancy style
\ifartx@xhf% user defined header and footer style
\pagestyle{fancy}%
\artxifcnt{chapter}{%
\providecommand{\CTEXthechapter}{\thechapter.}% compatibility for non ctex classes
\let\artxmark\CTEXthechapter%
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{}}% reset mark to actual name
\renewcommand{\sectionmark}[1]{\markright{\MakeUppercase{#1}}{}}% reset mark to actual name
}{%
\providecommand{\CTEXthesection}{\thesection.}% compatibility for non ctex classes
\let\artxmark\CTEXthesection%
\renewcommand{\sectionmark}[1]{\markright{\MakeUppercase{#1}}{}}% reset mark to actual name
}%
%- customizing headers and footers in LaTeX is a two-stage process
%- 1) \chapter|section call \chapter|sectionmark that call \markboth|right to define \left|rightmark
%- but \chapter*|section* do not call \chapter|sectionmark, then manually call \markboth|right is needed to update \left|rightmark
%- \markboth{here set \leftmark for chapter heading}{here set \rightmark for section heading}
%- 2) in header/footer definition, \left|rightmark represent the current chapter and section heading
%- original chaptermark and sectionmark for headings
%\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\chaptername\ \thechapter.\ #1}}{}}%
%\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}%
%- redefine to set mark to actual name
%\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{}}%
%\renewcommand{\sectionmark}[1]{\markright{\MakeUppercase{#1}}{}}%
%- Deactivate uppercase effect
\renewcommand{\MakeUppercase}[1]{#1}%
%- Define different kinds of header and footer for different parts
Expand All @@ -639,7 +640,7 @@
}
\fancypagestyle{mainmatterstyle}{% style for mainmatter
\fancyhf{}% clear fields
\fancyhead[C]{\footnotesize \ifnumodd{\value{page}}{\artxmark\enskip\leftmark}{\@title}}% structure elements
\fancyhead[C]{\footnotesize \ifnumodd{\value{page}}{\leftmark}{\@title}}% structure elements
\fancyfoot[C]{\footnotesize \ifnumodd{\value{page}}{\hspace*{\fill}\thepage}{\thepage\hspace*{\fill}}}% page number
\renewcommand{\headrulewidth}{0.8pt}% header rule
\renewcommand{\footrulewidth}{0pt}% footer rule
Expand Down Expand Up @@ -699,7 +700,7 @@
\fancyhead[C]{%
\begin{textblock}{1.0}[0.5,0.5](0.08,0.5)%
\rotatebox{90}{%
\footnotesize \ifnumodd{\value{page}}{\artxmark\enskip\leftmark}{\@title}%
\footnotesize \ifnumodd{\value{page}}{\leftmark}{\@title}%
}%
\end{textblock}%
\begin{textblock}{1.0}[0.5,0.5](0.08,0.5)%
Expand Down

0 comments on commit c409947

Please sign in to comment.