summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fduthesis/fduthesis.cls
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/fduthesis/fduthesis.cls')
-rw-r--r--Master/texmf-dist/tex/latex/fduthesis/fduthesis.cls254
1 files changed, 124 insertions, 130 deletions
diff --git a/Master/texmf-dist/tex/latex/fduthesis/fduthesis.cls b/Master/texmf-dist/tex/latex/fduthesis/fduthesis.cls
index cdfa7c20913..201d345de8a 100644
--- a/Master/texmf-dist/tex/latex/fduthesis/fduthesis.cls
+++ b/Master/texmf-dist/tex/latex/fduthesis/fduthesis.cls
@@ -45,7 +45,7 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo $Id: fduthesis.dtx 0.7c 2019-03-17 12:00:00Z Xiangdong Zeng <xdzeng96@gmail.com> $
+\GetIdInfo $Id: fduthesis.dtx 0.7d 2019-04-03 12:00:00Z Xiangdong Zeng <xdzeng96@gmail.com> $
{Thesis template for Fudan University}
\ProvidesExplClass{\ExplFileName}
{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
@@ -283,16 +283,16 @@
{ \__fdu_set_family:nnn { fdu@kai } {#2} {#1} }
\cs_new_protected:Npn \fdu@kai
{ \__fdu_switch_family:n { fdu@kai } }
-\tl_const:Nn \c__fdu_cjk_font_options_tl
- { UprightFont = *, BoldFont = *, ItalicFont = *, BoldItalicFont = * }
+\tl_const:Nn \__fdu_cjk_font_options:
+ { UprightFont = *, ItalicFont = *, AutoFakeBold = true }
\cs_new_protected:Npx \__fdu_setCJKmainfont:n #1
- { \__fdu_setCJKmainfont:nn {#1} { \c__fdu_cjk_font_options_tl } }
+ { \__fdu_setCJKmainfont:nn {#1} { \__fdu_cjk_font_options: } }
\cs_new_protected:Npx \__fdu_setCJKsansfont:n #1
- { \__fdu_setCJKsansfont:nn {#1} { \c__fdu_cjk_font_options_tl } }
+ { \__fdu_setCJKsansfont:nn {#1} { \__fdu_cjk_font_options: } }
\cs_new_protected:Npx \__fdu_setCJKmonofont:n #1
- { \__fdu_setCJKmonofont:nn {#1} { \c__fdu_cjk_font_options_tl } }
+ { \__fdu_setCJKmonofont:nn {#1} { \__fdu_cjk_font_options: } }
\cs_new_protected:Npx \__fdu_set_cjk_font_kai:n #1
- { \__fdu_set_cjk_font_kai:nn {#1} { \c__fdu_cjk_font_options_tl } }
+ { \__fdu_set_cjk_font_kai:nn {#1} { \__fdu_cjk_font_options: } }
\sys_if_engine_xetex:TF
{
\cs_new_eq:NN \__fdu_set_family:nnn \xeCJK_set_family:nnn
@@ -549,8 +549,8 @@
}
\cs_new_protected:Npn \__fdu_load_font:
{
- \use:c { __fdu_load_font_ \tl_use:N \g__fdu_font_set_tl : }
- \use:c { __fdu_load_cjk_font_ \tl_use:N \g__fdu_cjk_font_set_tl : }
+ \use:c { __fdu_load_font_ \g__fdu_font_set_tl : }
+ \use:c { __fdu_load_cjk_font_ \g__fdu_cjk_font_set_tl : }
}
\ctex_at_end_preamble:n { \__fdu_load_font: }
\keys_set:nn { unicode-math }
@@ -604,9 +604,37 @@
}
\cs_new:Npn \__fdu_set_fullwidth_stop_catcode:
{
- \char_set_active_eq:nN { "3002 } \c__fdu_fullwidth_full_stop_tl
+ \char_set_active_eq:nN { "3002 } \c__fdu_fwid_full_stop_tl
\char_set_catcode_active:n { "3002 }
}
+\fancyhf { }
+\tl_new:N \l__fdu_header_center_mark_tl
+\bool_if:NTF \g__fdu_twoside_bool
+ {
+ \fancyhead [ EL ] { \small \nouppercase { \fdu@kai \leftmark } }
+ \fancyhead [ OR ] { \small \nouppercase { \fdu@kai \rightmark } }
+ }
+ {
+ \fancyhead [ L ] { \small \nouppercase { \fdu@kai \leftmark } }
+ \fancyhead [ R ] { \small \nouppercase { \fdu@kai \rightmark } }
+ \fancyhead [ C ]
+ {
+ \small \nouppercase
+ { \fdu@kai \l__fdu_header_center_mark_tl }
+ }
+ }
+\fancyfoot [ C ] { \small \thepage }
+\RenewDocumentCommand \cleardoublepage { }
+ {
+ \clearpage
+ \bool_if:NT \g__fdu_twoside_bool
+ {
+ \int_if_odd:nF \c@page
+ { \hbox:n { } \thispagestyle { empty } \newpage }
+ }
+ \tl_gset:Nn \l__fdu_header_center_mark_tl { }
+ }
+\pagestyle { fancy }
\keys_set:nn { ctex }
{
chapter =
@@ -632,24 +660,23 @@
fixskip = true
}
}
-\fancyhf { }
-\tl_new:N \l__fdu_header_center_mark_tl
-\bool_if:NTF \g__fdu_twoside_bool
+\cs_new_protected:Npn \__fdu_chapter:n #1
{
- \fancyhead [ EL ] { \small \nouppercase { \fdu@kai \leftmark } }
- \fancyhead [ OR ] { \small \nouppercase { \fdu@kai \rightmark } }
+ \group_begin:
+ \ctexset { chapter / numbering = false }
+ \chapter {#1}
+ \__fdu_chapter_header:n {#1}
+ \group_end:
}
+\cs_generate_variant:Nn \__fdu_chapter:n { V }
+\cs_new_protected:Npn \__fdu_chapter_no_toc:n #1
{
- \fancyhead [ L ] { \small \nouppercase { \fdu@kai \leftmark } }
- \fancyhead [ R ] { \small \nouppercase { \fdu@kai \rightmark } }
- \fancyhead [ C ]
- {
- \small \nouppercase
- { \fdu@kai \l__fdu_header_center_mark_tl }
- }
+ \chapter * {#1}
+ \__fdu_chapter_header:n {#1}
+ \pdfbookmark [0] {#1} { toc }
}
-\fancyfoot [ C ] { \small \thepage }
-\cs_new:Npn \fdu_front_matter_header:n #1
+\cs_generate_variant:Nn \__fdu_chapter_no_toc:n { V }
+\cs_new_protected:Npn \__fdu_chapter_header:n #1
{
\bool_if:NTF \g__fdu_twoside_bool
{ \markboth {#1} {#1} }
@@ -658,17 +685,6 @@
\tl_gset:Nn \l__fdu_header_center_mark_tl {#1}
}
}
-\RenewDocumentCommand \cleardoublepage { }
- {
- \clearpage
- \bool_if:NT \g__fdu_twoside_bool
- {
- \int_if_odd:nF \c@page
- { \hbox:n { } \thispagestyle { empty } \newpage }
- }
- \tl_gset:Nn \l__fdu_header_center_mark_tl { }
- }
-\pagestyle { fancy }
\clist_map_inline:nn
{
{ plain } { plain },
@@ -1022,7 +1038,7 @@
\cs_new:Npn \__fdu_cover_id_aux:n #1
{
\tl_use:c { c__fdu_name_ #1 _tl }
- \c__fdu_fullwidth_colon_tl
+ \c__fdu_fwid_colon_tl
\tl_use:c { l__fdu_info_ #1 _tl }
}
\cs_new_protected:Npn \__fdu_cover_logo:
@@ -1053,10 +1069,10 @@
{
\int_compare:nT { \g__fdu_thesis_type_int != 3 }
{
- \c__fdu_fullwidth_left_paren_tl
+ \c__fdu_fwid_left_paren_tl
\clist_item:Nn \c__fdu_degree_type_clist
{ \l__fdu_info_degree_type_int }
- \c__fdu_fullwidth_right_paren_tl
+ \c__fdu_fwid_right_paren_tl
}
}
\cs_new_protected:Npn \__fdu_cover_info:
@@ -1086,7 +1102,7 @@
\clist_pop:NN \l__fdu_tmpa_clist \l__fdu_tmpa_tl
\clist_pop:NN \l__fdu_tmpb_clist \l__fdu_tmpb_tl
\__fdu_spread_box:nn { 6 em } { \l__fdu_tmpa_tl }
- \c__fdu_fullwidth_colon_tl
+ \c__fdu_fwid_colon_tl
\__fdu_center_box:Vn \l__fdu_tmpb_dim { \l__fdu_tmpb_tl }
\skip_vertical:n { 1 ex }
}
@@ -1096,7 +1112,7 @@
{
\clist_map_inline:Nn #1
{
- ##1 \c__fdu_fullwidth_colon_tl
+ ##1 \c__fdu_fwid_colon_tl
\__fdu_blank_underline:n { 6 em }
\__fdu_quad:
}
@@ -1262,9 +1278,8 @@
id / format = \zihao { -5 },
type / format = \zihao { 2 },
degree / format = \zihao { 4 },
- title / format = \zihao { -2 } \sffamily,
- title-en / format =
- \__fdu_line_spread:n { 1.2 } \zihao { 4 } \bfseries,
+ title / format = \zihao { -2 } \bfseries,
+ title-en / format = \__fdu_line_spread:n { 1.2 } \zihao { 4 } \bfseries,
id / bottom-skip = 0 pt plus 1.6 fill,
logo / bottom-skip = 0 pt plus 0.3 fill,
type / bottom-skip = -18 pt,
@@ -1334,14 +1349,12 @@
}
\AtEndDocument
{ \bool_if:NT \l__fdu_auto_make_cover_bool { \makecoveriii } }
-\tl_const:Nn \__fdu_chapter_toc_format: { \normalfont \sffamily }
-\tl_const:Nn \__fdu_chapter_toc_en_format: { \bfseries }
\keys_set:nn { ctex }
{
contentsname = \c__fdu_name_toc_tl,
chapter / tocline =
{
- \__fdu_chapter_toc_format:
+ \normalfont \sffamily
\CTEXnumberline {#1} #2
},
section / tocline =
@@ -1360,60 +1373,50 @@
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
}
- {
- \chapter* { \contentsname }
- \fdu_front_matter_header:n { \c__fdu_name_toc_tl }
- }
+ { \__fdu_chapter_no_toc:V \contentsname }
\NewDocumentEnvironment { abstract } { }
{ \__fdu_abstract_begin: } { \__fdu_abstract_end: }
\NewDocumentEnvironment { abstract* } { }
{ \__fdu_abstract_en_begin: } { \__fdu_abstract_en_end: }
\cs_new_protected:Npn \__fdu_abstract_begin:
- {
- \chapter* { \c__fdu_name_abstract_tl }
- \fdu_front_matter_header:n { \c__fdu_name_abstract_tl }
- \addcontentsline { toc } { chapter }
- {
- \__fdu_chapter_toc_format:
- \c__fdu_name_abstract_tl
- }
- }
+ { \__fdu_chapter:V \c__fdu_name_abstract_tl }
\cs_new_protected:Npn \__fdu_abstract_en_begin:
- {
- \chapter* { \c__fdu_name_abstract_en_tl }
- \fdu_front_matter_header:n { \c__fdu_name_abstract_en_tl }
- \addcontentsline { toc } { chapter }
- {
- \__fdu_chapter_toc_format:
- \c__fdu_name_abstract_en_tl
- }
- }
+ { \__fdu_chapter:V \c__fdu_name_abstract_en_tl }
\cs_new_protected:Npn \__fdu_abstract_end:
{
- \__fdu_keywords_par:
- \textsf { \c__fdu_name_keywords_tl \c__fdu_fullwidth_colon_tl }
- \clist_use:Nn \l__fdu_info_keywords_clist
- { \c__fdu_fullwidth_semicolon_tl }
- \__fdu_clc_par:
- \textsf { \c__fdu_name_clc_tl \c__fdu_fullwidth_colon_tl }
- \l__fdu_info_clc_tl
+ \__fdu_keywords:nNn
+ { \sffamily \c__fdu_name_keywords_tl \c__fdu_fwid_colon_tl }
+ \l__fdu_info_keywords_clist { \c__fdu_fwid_semicolon_tl }
+ \__fdu_clc:nn
+ { \sffamily \c__fdu_name_clc_tl \c__fdu_fwid_colon_tl }
+ { \l__fdu_info_clc_tl }
}
\cs_new_protected:Npn \__fdu_abstract_en_end:
{
- \__fdu_keywords_par:
- \textbf { \c__fdu_name_keywords_en_tl } \__fdu_quad:
- \clist_use:Nn \l__fdu_info_keywords_en_clist { \__fdu_quad: }
- \__fdu_clc_par:
- \textbf { \c__fdu_name_clc_en_tl } \__fdu_quad:
- \l__fdu_info_clc_tl
+ \__fdu_keywords:nNn
+ { \bfseries \c__fdu_name_keywords_en_tl \__fdu_quad: }
+ \l__fdu_info_keywords_en_clist { ; ~ }
+ \__fdu_clc:nn
+ { \bfseries \c__fdu_name_clc_en_tl \__fdu_quad: }
+ { \l__fdu_info_clc_tl }
+ }
+\cs_new_protected:Npn \__fdu_keywords:nNn #1#2#3
+ {
+ \par \mode_leave_vertical: \par \noindent
+ \__fdu_get_text_width:Nn \l__fdu_tmpa_dim {#1}
+ \group_begin: #1 \group_end:
+ \parbox [t] { \dim_eval:n { \textwidth - \l__fdu_tmpa_dim } }
+ {
+ \clist_use:Nn #2 {#3} \par
+ \cs_gset:Npx \__fdu_keywords_prevdepth: { \dim_use:N \tex_prevdepth:D }
+ }
}
-\cs_new:Npn \__fdu_keywords_par:
+\cs_new_protected:Npn \__fdu_clc:nn #1#2
{
- \par \mode_leave_vertical: \par
- \noindent \hangindent = 4 em \hangafter = 1
+ \par \tex_prevdepth:D \__fdu_keywords_prevdepth: \noindent
+ \group_begin: #1 \group_end:
+ #2
}
-\cs_new:Npn \__fdu_clc_par:
- { \par \noindent }
\NewDocumentEnvironment { notation } { O { l p { 7.5 cm } } }
{
\__fdu_notation_begin:
@@ -1427,18 +1430,12 @@
}
\cs_new_protected:Npn \__fdu_notation_begin:
{
- \chapter* { \c__fdu_name_notation_tl }
- \fdu_front_matter_header:n { \c__fdu_name_notation_tl }
- \addcontentsline { toc } { chapter }
- {
- \__fdu_chapter_toc_format:
- \c__fdu_name_notation_tl
- }
+ \__fdu_chapter:V \c__fdu_name_notation_tl
}
\cs_new_protected:Npn \__fdu_notation_long_table_setup:
{
- \dim_set_eq:NN \LTpre \c_zero_dim
- \dim_set_eq:NN \LTpost \c_zero_dim
+ \dim_set_eq:NN \LTpre \c_zero_dim
+ \dim_set_eq:NN \LTpost \c_zero_dim
}
\bool_new:N \l__fdu_bibtex_bool
\tl_new:N \l__fdu_bib_style_tl
@@ -1483,24 +1480,14 @@
{
\RequirePackage [ sort & compress ] { natbib }
\__fdu_bibtex_setup:
- \NewDocumentCommand \printbibliography { o }
- {
- \exp_args:NV \bibliography \l__fdu_bib_resource_tl
- \IfValueT {#1}
- { \__fdu_warning:nn { invalid-option-in-bibtex } {#1} }
- }
}
{
- \__fdu_biblatex_setup:
- \RequirePackage [ backend = biber, hyperref = manual, natbib ]
- { biblatex }
- \exp_args:NV \addbibresource \l__fdu_bib_resource_tl
- \__fdu_biblatex_allow_url_break:
+ \__fdu_biblatex_pre_setup:
+ \RequirePackage { biblatex }
+ \__fdu_biblatex_post_setup:
}
}
-\__fdu_msg_new:nn { invalid-option-in-bibtex }
- { Option(s)~ "#1"~ are~ invalid~ in~ BibTeX. }
-\cs_new:Npn \__fdu_bibtex_setup:
+\cs_new_protected:Npn \__fdu_bibtex_setup:
{
\tl_if_empty:NTF \l__fdu_bib_style_tl
{
@@ -1519,26 +1506,40 @@
}
}
{ \exp_args:NV \bibliographystyle \l__fdu_bib_style_tl }
+ \cs_set:Npn \bibsection { \__fdu_chapter:V \bibname }
+ \NewDocumentCommand \printbibliography { o }
+ {
+ \exp_args:NV \bibliography \l__fdu_bib_resource_tl
+ \IfValueT {##1}
+ { \__fdu_warning:nn { invalid-option-in-bibtex } {##1} }
+ }
}
-\cs_new:Npn \__fdu_biblatex_setup:
+\__fdu_msg_new:nn { invalid-option-in-bibtex }
+ { Option(s)~ "#1"~ are~ invalid~ in~ BibTeX. }
+\cs_new_protected:Npn \__fdu_biblatex_pre_setup:
{
\tl_if_empty:NTF \l__fdu_bib_style_tl
{
\tl_if_eq:VnTF \l__fdu_bib_gb_style_tl { numerical }
- { \PassOptionsToPackage { style = gb7714-2015 } }
+ { \__fdu_pass_options_to_biblatex:n { style = gb7714-2015 } }
{
\tl_if_eq:VnT \l__fdu_bib_gb_style_tl { author-year }
- { \PassOptionsToPackage { style = gb7714-2015ay } }
+ { \__fdu_pass_options_to_biblatex:n { style = gb7714-2015ay } }
}
}
- { \PassOptionsToPackage { style = \l__fdu_bib_style_tl } }
- { biblatex }
+ { \__fdu_pass_options_to_biblatex:n { style = \l__fdu_bib_style_tl } }
\tl_if_empty:NF \l__fdu_cite_style_tl
- {
- \PassOptionsToPackage { citestyle = \l__fdu_bib_style_tl }
- { biblatex }
- }
+ { \__fdu_pass_options_to_biblatex:n { citestyle = \l__fdu_bib_style_tl } }
+ \__fdu_pass_options_to_biblatex:n { backend = biber, hyperref = manual, natbib }
+ }
+\cs_new_protected:Npn \__fdu_biblatex_post_setup:
+ {
+ \exp_args:NV \addbibresource \l__fdu_bib_resource_tl
+ \__fdu_biblatex_allow_url_break:
+ \defbibheading { bibliography } [ \bibname ] { \__fdu_chapter:n {##1} }
}
+\cs_new_protected:Npn \__fdu_pass_options_to_biblatex:n #1
+ { \PassOptionsToPackage {#1} { biblatex } }
\cs_new:Npn \__fdu_biblatex_allow_url_break:
{
\int_set_eq:NN \c@biburlucpenalty \c_one_int
@@ -1555,18 +1556,11 @@
\cs_new:Npn \__fdu_set_cite_style_author_year:
{
\NAT@numbersfalse
- \cs_set_eq:NN \NAT@open \c__fdu_fullwidth_left_paren_tl
- \cs_set_eq:NN \NAT@close \c__fdu_fullwidth_right_paren_tl
- \cs_set_eq:NN \NAT@sep \c__fdu_fullwidth_semicolon_tl
- \cs_set_eq:NN \NAT@aysep \c__fdu_fullwidth_comma_tl
- \cs_set_eq:NN \NAT@yrsep \c__fdu_ideographic_comma_tl
- }
-\cs_set:Npn \bibsection
- {
- \chapter* { \bibname }
- \fdu_front_matter_header:n { \bibname }
- \addcontentsline { toc } { chapter }
- { \__fdu_chapter_toc_format: \bibname }
+ \cs_set_eq:NN \NAT@open \c__fdu_fwid_left_paren_tl
+ \cs_set_eq:NN \NAT@close \c__fdu_fwid_right_paren_tl
+ \cs_set_eq:NN \NAT@sep \c__fdu_fwid_semicolon_tl
+ \cs_set_eq:NN \NAT@aysep \c__fdu_fwid_comma_tl
+ \cs_set_eq:NN \NAT@yrsep \c__fdu_ideo_comma_tl
}
\NewDocumentCommand \hypersetup { m }
{ \fdu_hyperref_setup:n {#1} }