diff options
author | Karl Berry <karl@freefriends.org> | 2019-03-17 21:38:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-03-17 21:38:24 +0000 |
commit | 39948ee1306a518baab7bd81a847e11249643885 (patch) | |
tree | c553796b1fc65014f8f3139236889456dc917f6a /Master/texmf-dist/tex/latex/fduthesis/fduthesis-en.cls | |
parent | 256f8bfa32f3e9134067457fc40c38ee02d01253 (diff) |
fduthesis (17mar19)
git-svn-id: svn://tug.org/texlive/trunk@50428 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fduthesis/fduthesis-en.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/fduthesis/fduthesis-en.cls | 378 |
1 files changed, 258 insertions, 120 deletions
diff --git a/Master/texmf-dist/tex/latex/fduthesis/fduthesis-en.cls b/Master/texmf-dist/tex/latex/fduthesis/fduthesis-en.cls index b86e1a0132d..3e73df81e4e 100644 --- a/Master/texmf-dist/tex/latex/fduthesis/fduthesis-en.cls +++ b/Master/texmf-dist/tex/latex/fduthesis/fduthesis-en.cls @@ -6,7 +6,7 @@ %% %% fduthesis.dtx (with options: `class-en') %% -%% Copyright (C) 2017, 2018 by Xiangdong Zeng <xdzeng96@gmail.com> +%% Copyright (C) 2017--2019 by Xiangdong Zeng <xdzeng96@gmail.com> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -41,20 +41,18 @@ %% fduthesis.pdf, %% fduthesis-en.pdf, %% fduthesis-code.pdf, -%% latexmkrc, -%% latexmkrc-en, %% and README.md. %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo $Id: fduthesis.dtx 0.7b 2018-05-06 12:00:00Z Xiangdong Zeng <xdzeng96@gmail.com> $ +\GetIdInfo $Id: fduthesis.dtx 0.7c 2019-03-17 12:00:00Z Xiangdong Zeng <xdzeng96@gmail.com> $ {Thesis template for Fudan University (English version)} \ProvidesExplClass{\ExplFileName-en} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \RequirePackage { xparse, xtemplate, l3keys2e } \clist_map_inline:nn { expl3, xparse, xtemplate, l3keys2e } { - \@ifpackagelater {#1} { 2017/12/16 } + \@ifpackagelater {#1} { 2018/05/12 } { } { \msg_error:nnn { fduthesis } { l3-too-old } {#1} } } \msg_new:nnn { fduthesis } { l3-too-old } @@ -242,7 +240,9 @@ \__fdu_check_package:nnn { fontspec } { 2017/09/22 } { 2.6e } \__fdu_check_package:nnn { unicode-math } { 2017/11/18 } { 0.8i } \sys_if_engine_xetex:T - { \__fdu_check_package:nnn { xeCJK } { 2017/08/07 } { 3.5.0 } } + { \__fdu_check_package:nnn { xeCJK } { 2017/08/07 } { 3.5.0 } } +\sys_if_engine_luatex:T + { \__fdu_check_package:nnn { xunicode-addon } { 2018/04/30 } { 3.7.1 } } \geometry { paper = a4paper, @@ -251,127 +251,270 @@ headheight = 15 pt } \bool_if:NT \g__fdu_draft_bool { \geometry { showframe } } -\prop_new:N \g__fdu_font_name_prop -\prop_new:N \g__fdu_font_options_prop -\prop_new:N \g__fdu_cjk_font_name_prop -\prop_new:N \g__fdu_cjk_font_options_prop +\tl_new:N \g__fdu_font_set_tl \keys_define:nn { fdu / style } { - font .choice:, - font .value_required:n = true, - font / libertinus .code:n = + font .choices:nn = + { garamond, libertinus, lm, palatino, times, times*, none } + { \tl_set_eq:NN \g__fdu_font_set_tl \l_keys_choice_tl } + } +\cs_new_protected:Npn \__fdu_setmainfont:nn #1#2 + { \__fontspec_main_setmainfont:nn {#2} {#1} } +\cs_new_protected:Npn \__fdu_setsansfont:nn #1#2 + { \__fontspec_main_setsansfont:nn {#2} {#1} } +\cs_new_protected:Npn \__fdu_setmonofont:nn #1#2 + { \__fontspec_main_setmonofont:nn {#2} {#1} } +\cs_new_protected:Npn \__fdu_setmathfont:nn #1#2 + { \__um_setmathfont:nn {#2} {#1} } +\cs_new_protected:Npn \__fdu_set_font_helper:n #1 + { + \exp_args:Nc \RenewDocumentCommand { set #1 font } { O { } m O { } } { - \fdu_choose_font:nn { main } { Libertinus~ Serif } - \fdu_choose_font:nn { sans } { Libertinus~ Sans } - \fdu_choose_font_with_option:nnn { mono } - { TeX~ Gyre~ Cursor } { Ligatures = Common Off } - \fdu_choose_font:nn { math } { Libertinus~ Math } - \keys_set:nn { fdu / style } { footnote-style = libertinus } - }, - font / lm .code:n = + \ctex_at_end_preamble:n + { \use:c { __fdu_set #1 font:nn } {##2} { ##1, ##3 } } + } + } +\clist_map_inline:nn { main, sans, mono, math } { \__fdu_set_font_helper:n {#1} } +\cs_new_protected:Npn \__fdu_load_font_garamond: + { + \__fdu_setmainfont:nn { EBGaramond } { - \fdu_choose_font:nn { main } { Latin~ Modern~ Roman } - \fdu_choose_font:nn { sans } { Latin~ Modern~ Sans } - \fdu_choose_font:nn { mono } { Latin~ Modern~ Mono } - \fdu_choose_font:nn { math } { Latin~ Modern~ Math } - \keys_set:nn { fdu / style } { footnote-style = pifont } - }, - font / palatino .code:n = - { - \fdu_choose_font:nn { main } { TeX~ Gyre~ Pagella } - \fdu_choose_font:nn { sans } { TeX~ Gyre~ Heros } - \fdu_choose_font_with_option:nnn { mono } - { TeX~ Gyre~ Cursor } { Ligatures = Common Off } - \fdu_choose_font:nn { math } { TeX~ Gyre~ Pagella~ Math } - \keys_set:nn { fdu / style } { footnote-style = pifont } - }, - font / times .code:n = + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Italic, + BoldItalicFont = *-BoldItalic + } + \__fdu_setsansfont:nn { libertinussans } { - \fdu_choose_font_with_option:nnn { main } { XITS } - { - UprightFeatures = { SmallCapsFont = * }, - BoldFeatures = { SmallCapsFont = *~ Bold }, - ItalicFeatures = { SmallCapsFont = *~ Italic }, - BoldItalicFeatures = { SmallCapsFont = *~ Bold~ Italic }, - } - \fdu_choose_font:nn { sans } { TeX~ Gyre~ Heros } - \fdu_choose_font_with_option:nnn { mono } - { TeX~ Gyre~ Cursor } { Ligatures = Common Off } - \fdu_choose_font:nn { math } { XITS~ Math } - \keys_set:nn { fdu / style } { footnote-style = xits } - }, - font / none .code:n = + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic + } + \__fdu_setmonofont:nn { lmmonolt10 } + { + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-oblique, + BoldItalicFont = *-boldoblique + } + \__fdu_setmathfont:nn { Garamond-Math.otf } { } + } +\cs_new_protected:Npn \__fdu_load_font_libertinus: + { + \__fdu_setmainfont:nn { libertinusserif } + { + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic + } + \__fdu_setsansfont:nn { libertinussans } + { + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic + } + \__fdu_setmonofont:nn { lmmonolt10 } { - \__fdu_initialize_prop:Nn \g__fdu_font_name_prop - { main, sans, mono, math } - \__fdu_initialize_prop:Nn \g__fdu_font_options_prop - { main, sans, mono, math } - \keys_set:nn { fdu / style } { footnote-style = plain } + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-oblique, + BoldItalicFont = *-boldoblique } + \__fdu_setmathfont:nn { libertinusmath-regular.otf } { } } -\cs_new_protected:Npn \__fdu_initialize_prop:Nn #1#2 +\cs_new_protected:Npn \__fdu_load_font_lm: + { \__fdu_setmathfont:nn { latinmodern-math.otf } { } } +\cs_new_protected:Npn \__fdu_load_font_palatino: { - \prop_gclear:N #1 - \clist_map_inline:nn {#2} { \prop_gput:Nnn #1 {##1} { } } + \__fdu_setmainfont:nn { texgyrepagella } + { + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic + } + \__fdu_setsansfont:nn { libertinussans } + { + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, + Scale = MatchUppercase + } + \__fdu_setmonofont:nn { lmmonolt10 } + { + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-oblique, + BoldItalicFont = *-boldoblique + } + \__fdu_setmathfont:nn { texgyrepagella-math.otf } { } } -\clist_map_inline:nn - { main, sans, mono, math } +\cs_new_protected:Npn \__fdu_load_font_times: { - \exp_args:Nc \RenewDocumentCommand { set #1 font } { O { } m O { } } - { \fdu_choose_font_with_option:nnn { #1 } {##2} { ##1, ##3 } } + \__fdu_setmainfont:nn { XITS } + { + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Italic, + BoldItalicFont = *-BoldItalic, + UprightFeatures = { SmallCapsFont = *-Regular }, + BoldFeatures = { SmallCapsFont = *-Bold }, + ItalicFeatures = { SmallCapsFont = *-Italic }, + BoldItalicFeatures = { SmallCapsFont = *-BoldItalic } + } + \__fdu_setsansfont:nn { texgyreheros } + { + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic + } + \__fdu_setmonofont:nn { texgyrecursor } + { + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, + Ligatures = CommonOff + } + \__fdu_setmathfont:nn { XITSMath-Regular.otf }{ BoldFont = XITSMath-Bold.otf } } -\cs_new_protected:Npn \fdu_choose_font_with_option:nnn #1#2#3 +\cs_new_protected:cpn { __fdu_load_font_ times* : } { - \prop_gput:Nnn \g__fdu_font_name_prop {#1} {#2} - \prop_gput:Nnn \g__fdu_font_options_prop {#1} {#3} + \__fdu_setmainfont:nn { Times~ New~ Roman } { } + \__fdu_setsansfont:nn { Arial } { } + \__fdu_setmonofont:nn { Courier~ New } { } + \__fdu_setmathfont:nn { XITSMath-Regular.otf }{ BoldFont = XITSMath-Bold.otf } } -\cs_new_protected:Npn \fdu_choose_font:nn #1#2 +\cs_new_protected:Npn \__fdu_load_cjk_font_adobe: { - \prop_gput:Nnn \g__fdu_font_name_prop {#1} {#2} - \prop_gput:Nnn \g__fdu_font_options_prop {#1} { } + \__fdu_setCJKmainfont:n { AdobeSongStd-Light } + \__fdu_setCJKsansfont:n { AdobeHeitiStd-Regular } + \__fdu_setCJKmonofont:n { AdobeFangsongStd-Regular } + \__fdu_set_cjk_font_kai:n { AdobeKaitiStd-Regular } } -\cs_new_protected:Npn \fdu_choose_cjk_font_with_option:nnn #1#2#3 +\cs_new_protected:Npn \__fdu_load_cjk_font_fandol: { - \prop_gput:Nnn \g__fdu_cjk_font_name_prop {#1} {#2} - \prop_gput:Nnn \g__fdu_cjk_font_options_prop {#1} {#3} + \__fdu_setCJKmainfont:nn { FandolSong } + { + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Regular, + BoldItalicFont = *-Bold + } + \__fdu_setCJKsansfont:nn { FandolHei } + { + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Regular, + BoldItalicFont = *-Bold + } + \__fdu_setCJKmonofont:nn { FandolFang } + { + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Regular, + ItalicFont = *-Regular, + BoldItalicFont = *-Regular + } + \__fdu_set_cjk_font_kai:nn { FandolKai } + { + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Regular, + ItalicFont = *-Regular, + BoldItalicFont = *-Regular + } } -\cs_new_protected:Npn \fdu_choose_cjk_font:nn #1#2 +\cs_new_protected:Npn \__fdu_load_cjk_font_founder: { - \prop_gput:Nnn \g__fdu_cjk_font_name_prop {#1} {#2} - \prop_gput:Nnn \g__fdu_cjk_font_options_prop {#1} { } + \__fdu_setCJKmainfont:n { FZShuSong-Z01 } + \__fdu_setCJKsansfont:n { FZHei-B01 } + \__fdu_setCJKmonofont:n { FZFangSong-Z02 } + \__fdu_set_cjk_font_kai:n { FZKai-Z03 } } -\cs_new_protected:Npn \__fdu_set_font: +\cs_new_protected:Npn \__fdu_load_cjk_font_mac: { - \clist_map_inline:nn { main, sans, mono, math } + \__fdu_setCJKmainfont:nn { STSongti-SC } + { + UprightFont = *-Light, + BoldFont = *-Bold, + ItalicFont = *-Light, + BoldItalicFont = *-Bold + } + \__fdu_setCJKsansfont:nn { STHeitiSC } + { + UprightFont = *-Medium, + BoldFont = *-Medium, + ItalicFont = *-Medium, + BoldItalicFont = *-Medium + } + \__fdu_setCJKmonofont:n { STFangsong } + \__fdu_set_cjk_font_kai:nn { STKaitiSC } { - \prop_get:NnN \g__fdu_font_name_prop {##1} \l__fdu_tmpa_tl - \prop_get:NnN \g__fdu_font_options_prop {##1} \l__fdu_tmpb_tl - \tl_if_empty:NT \l__fdu_tmpa_tl - { \__fdu_error:nn { font-not-defined } {##1} } - \use:c { __fdu_set_ ##1 _font:VV } \l__fdu_tmpa_tl \l__fdu_tmpb_tl + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Regular, + BoldItalicFont = *-Bold } } -\clist_map_inline:nn { main, sans, mono } +\cs_new_protected:Npn \__fdu_load_cjk_font_sinotype: { - \cs_new_protected:cpx { __fdu_set_ #1 _font:nn } ##1 ##2 - { \exp_not:c { __fontspec_main_set #1 font:nn } {##2} {##1} } + \__fdu_setCJKmainfont:n { STSong } + \__fdu_setCJKsansfont:n { STHeiti } + \__fdu_setCJKmonofont:n { STFangsong } + \__fdu_set_cjk_font_kai:n { STKaiti } } -\cs_new_protected:Npn \__fdu_set_math_font:nn #1#2 - { \__um_setmathfont:nn {#2} {#1} } -\clist_map_inline:nn { main, sans, mono, math } - { \cs_generate_variant:cn { __fdu_set_ #1 _font:nn } { VV } } -\__fdu_msg_new:nn { font-not-defined } +\cs_new_protected:Npn \__fdu_load_cjk_font_sourcehan: { - \str_upper_case:f { \tl_head:n {#1} } \tl_tail:n {#1} ~ - font~ is~ not~ defined. \\\\ - You~ can~ set~ option~ "font"~ via~ "\string\fdusetup",~ - or~ use~ command~ \\ - "\string\set #1 font"~ to~ define~ new~ font~ families. + \__fdu_setCJKmainfont:nn { SourceHanSerifSC } + { + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Regular, + BoldItalicFont = *-Bold + } + \__fdu_setCJKsansfont:nn { SourceHanSansSC } + { + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Regular, + BoldItalicFont = *-Bold + } + \__fdu_warning:n { source-han } } -\ctex_at_end_preamble:n +\__fdu_msg_new:nn { source-han } + { Font~ set~ `sourcehan'~ does~ not~ contain~ kaiti~ and~ fangsong. } +\cs_new_protected:Npn \__fdu_load_cjk_font_windows: + { + \__fdu_setCJKmainfont:n { SimSun } + \__fdu_setCJKsansfont:n { SimHei } + \__fdu_setCJKmonofont:n { FangSong } + \__fdu_set_cjk_font_kai:n { KaiTi } + } +\cs_new_protected:Npn \__fdu_load_font: { - \__fdu_set_font: + \use:c { __fdu_load_font_ \tl_use:N \g__fdu_font_set_tl : } } +\ctex_at_end_preamble:n { \__fdu_load_font: } \keys_set:nn { unicode-math } { math-style = ISO, @@ -542,17 +685,17 @@ { \int_use:N #1 } \c__fdu_fn_style_libertinus_tl { - \fontspec { Libertinus~ Serif } + \fontspec { libertinusserif-regular.otf } \__fdu_fn_symbol_libertinus:n {#1} } \c__fdu_fn_style_libertinus_neg_tl { - \fontspec { Libertinus~ Serif } + \fontspec { libertinusserif-regular.otf } \__fdu_fn_symbol_libertinus_neg:n {#1} } \c__fdu_fn_style_libertinus_sans_tl { - \fontspec { Libertinus~ Sans } + \fontspec { libertinussans-regular.otf } \__fdu_fn_symbol_libertinus_sans:n {#1} } \c__fdu_fn_style_pifont_tl @@ -565,17 +708,17 @@ { \__fdu_fn_symbol_pifont_sans_neg:n {#1} } \c__fdu_fn_style_xits_tl { - \fontspec { XITS } + \fontspec { XITS-Regular.otf } \__fdu_fn_symbol_xits:n {#1} } \c__fdu_fn_style_xits_sans_tl { - \fontspec { XITS } + \fontspec { XITS-Regular.otf } \__fdu_fn_symbol_xits_sans:n {#1} } \c__fdu_fn_style_xits_sans_neg_tl { - \fontspec { XITS } + \fontspec { XITS-Regular.otf } \__fdu_fn_symbol_xits_sans_neg:n {#1} } } @@ -738,8 +881,7 @@ secret-level .choices:nn = { none, i, ii, iii } { - \int_compare:nTF - { \l_keys_choice_int >= 2 } + \int_compare:nTF { \l_keys_choice_int >= 2 } { \bool_set_true:N \l__fdu_secret_bool \tl_set:Nn \l__fdu_info_secret_level_tl @@ -844,15 +986,11 @@ } \cs_new_protected:Npn \__fdu_cover_degree: { - \int_compare:nNnT \g__fdu_thesis_type_int = \c_two + \int_compare:nT { \g__fdu_thesis_type_int != 3 } { - \tl_set:Nx \l__fdu_tmpa_tl - { - \clist_item:Nn \c__fdu_degree_type_clist - { \l__fdu_info_degree_type_int } - } \c__fdu_fullwidth_left_paren_tl - \l__fdu_tmpa_tl + \clist_item:Nn \c__fdu_degree_type_clist + { \l__fdu_info_degree_type_int } \c__fdu_fullwidth_right_paren_tl } } @@ -898,7 +1036,7 @@ \__fdu_quad: } } -\DeclareObjectType { fdu / cover } { \c_zero } +\DeclareObjectType { fdu / cover } { \c_zero_int } \NewDocumentCommand \DeclareCoverTemplate { m m } { \fdu_cover_declare_template:nn {#1} {#2} } \cs_new_protected:Npn \fdu_cover_declare_template:nn #1#2 @@ -946,9 +1084,9 @@ } \tl_new:N \l__fdu_cover_template_tl \cs_new_protected:Npn \__fdu_cover_declare_template_interface:nn #1#2 - { \DeclareTemplateInterface { fdu / cover } {#1} { \c_zero } {#2} } + { \DeclareTemplateInterface { fdu / cover } {#1} { \c_zero_int } {#2} } \cs_new_protected:Npn \__fdu_cover_declare_template_code:nnn #1#2#3 - { \DeclareTemplateCode { fdu / cover } {#1} { \c_zero } {#2} {#3} } + { \DeclareTemplateCode { fdu / cover } {#1} { \c_zero_int } {#2} {#3} } \cs_generate_variant:Nn \__fdu_cover_declare_template_interface:nn { nx } \cs_generate_variant:Nn \__fdu_cover_declare_template_code:nnn { nxn } \cs_new:Npn \__fdu_cover_key_type:n #1 @@ -1148,11 +1286,11 @@ section / tocline = { \bfseries - \CTEXnumberline {#1} #2 + \CTEXnumberline {#1} #2 }, subsection / tocline = { - \CTEXnumberline {#1} #2 + \CTEXnumberline {#1} #2 } } \__fdu_patch_cmd:Nnn \tableofcontents @@ -1329,9 +1467,9 @@ } \cs_new:Npn \__fdu_biblatex_allow_url_break: { - \int_set_eq:NN \c@biburlucpenalty \c_one - \int_set_eq:NN \c@biburlnumpenalty \c_one - \int_set_eq:NN \c@biburllcpenalty \c_one + \int_set_eq:NN \c@biburlucpenalty \c_one_int + \int_set_eq:NN \c@biburlnumpenalty \c_one_int + \int_set_eq:NN \c@biburllcpenalty \c_one_int } \cs_new:Npn \__fdu_set_cite_style_numerical: { |