Skip to content

Commit

Permalink
增加 open 选项控制是否奇数页输出 \chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
sikouhjw committed Mar 10, 2022
1 parent 0d8c72d commit f1a22af
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
46 changes: 44 additions & 2 deletions gdutthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@
}
\bool_if:NT \g__gdut_draft_bool { \geometry { showframe } }
\bool_new:N \l__gdut_cover_bool
\bool_new:N \l__gdut_open_bool
\keys_define:nn { gdut / style }
{
cover .choice:,
Expand All @@ -398,6 +399,12 @@
{ \bool_set_true:N \l__gdut_cover_bool },
cover / false .code:n =
{ \bool_set_false:N \l__gdut_cover_bool },
open .choice:,
open .value_required:n = true,
open / true .code:n =
{ \bool_set_true:N \l__gdut_open_bool },
open / false .code:n =
{ \bool_set_false:N \l__gdut_open_bool },
}
\tl_new:N \g__gdut_fontset_tl
\tl_new:N \g__gdut_cjk_fontset_tl
Expand Down Expand Up @@ -909,6 +916,28 @@
fixskip = true,
},
}
\ctex_at_end_preamble:n
{
\bool_if:NTF \l__gdut_open_bool
{
\keys_set:nn { ctex }
{
chapter / break =
{
\clearpage
}
}
\xpatchcmd { \mainmatter }
{
\cleardoublepage
}
{
\clearpage
}
{ } { \fail }
}
{ }
}
\tl_new:N \l__gdut_thm_header_font_tl
\tl_new:N \l__gdut_thm_body_font_tl
\tl_new:N \l__gdut_thm_qed_tl
Expand Down Expand Up @@ -1164,7 +1193,13 @@
\NewDocumentCommand {\gdutstatement} { s o } {
\IfBooleanTF {#1}
{
\if@openright\cleardoublepage\else\clearpage\fi
\bool_if:NTF \l__gdut_open_bool
{
\clearpage
}
{
\if@openright\cleardoublepage\else\clearpage\fi
}
\phantomsection
\addcontentsline{toc}{chapter}{学位论文独创性声明及学位论文版权使用授权声明}
\addcontentsline{tec}{chapter}{Statement~of~original~authorship~and~copyright~licensing~declaration}
Expand All @@ -1189,7 +1224,13 @@
\begingroup \centering \hspace*{5\ccwd}论文作者签名:\hspace*{5\ccwd}日期:\par \endgroup
\vspace*{\baselineskip}
\begingroup \centering \hspace*{5\ccwd}指导教师签名:\hspace*{5\ccwd}日期:\par \endgroup
\ctexset{chapter/break = \if@openright\cleardoublepage\else\clearpage\fi}
\bool_if:NTF \l__gdut_open_bool
{
\ctexset{chapter/break = \clearpage}
}
{
\ctexset{chapter/break = \if@openright\cleardoublepage\else\clearpage\fi}
}
}
}
\cs_new:Npn \gdutappendix {
Expand Down Expand Up @@ -1493,6 +1534,7 @@
\keys_set:nn { gdut }
{
style / cover = false,
style / open = false,
style / font = times,
style / cjk-font = fandol,
style / fullwidth-stop = false,
Expand Down
2 changes: 2 additions & 0 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
style = {
% cover = {true},
cover = {false},
% open = {true},
open = {false},
% font = {garamond},
% font = {libertinus},
% font = {lm},
Expand Down
8 changes: 8 additions & 0 deletions user-manual/gdutthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,14 @@ Copyright (C) 2017&ndash;2021 by Xiangdong Zeng <[email protected]>.
% 设置是否输出封面。
% \end{function}
%
% \begin{function}{style/open}
% \begin{fdusyntax}[emph={[1]open}]
% open = (*<true|(false)>*)
% \end{fdusyntax}
%^^A-
% 设置是否不分奇偶页输出新的一章,|true| 为任意页可输出新的一章,|false| 为奇数页输出新的一章。
% \end{function}
%
% \begin{function}{style/font}
% \begin{fdusyntax}[emph={[1]font}]
% font = (*<garamond|libertinus|lm|palatino|(times)|times*|none>*)
Expand Down

0 comments on commit f1a22af

Please sign in to comment.