|
106 | 106 | { \bool_set_true:N \l__ustc_degree_graduate_bool } |
107 | 107 | \l__ustc_degree_hook_tl |
108 | 108 | } , |
| 109 | + fontset .choices:nn = |
| 110 | + { auto , windows , mac , ubuntu , fandol , none } |
| 111 | + { \str_set:NV \l__ustc_fontset_str \l_keys_choice_tl } , |
| 112 | + output .choice: , |
| 113 | + output / print .code:n = |
| 114 | + { \bool_set_false:N \l__ustc_output_electronic_bool } , |
| 115 | + output / electronic .code:n = |
| 116 | + { \bool_set_true:N \l__ustc_output_electronic_bool } , |
109 | 117 | degree-type .choices:nn = |
110 | 118 | { academic , professional , engineering } |
111 | 119 | { \str_set:NV \l__ustc_degree_type_str \l_keys_choice_tl } , |
|
120 | 128 | } , |
121 | 129 | review .bool_set:N = \l__ustc_review_bool , |
122 | 130 | reviewer .bool_set:N = \l__ustc_reviewer_bool , |
123 | | - fontset .choices:nn = |
124 | | - { auto , windows , mac , ubuntu , fandol , none } |
125 | | - { \str_set:NV \l__ustc_fontset_str \l_keys_choice_tl } , |
126 | 131 | font .choices:nn = |
127 | 132 | { auto , times , termes , stix , xits , libertinus , newcm , lm , newtx , cm , none } |
128 | 133 | { |
|
182 | 187 | \str_set:NV \l__ustc_cite_style_str \l_keys_choice_tl |
183 | 188 | \l__ustc_cite_style_hook_tl |
184 | 189 | } , |
185 | | - output .choice: , |
186 | | - output / print .code:n = |
187 | | - { \bool_set_false:N \l__ustc_output_electronic_bool } , |
188 | | - output / electronic .code:n = |
189 | | - { \bool_set_true:N \l__ustc_output_electronic_bool } , |
190 | 190 | section-style .choice: , |
191 | 191 | section-style / chinese .code:n = |
192 | 192 | { \bool_set_true:N \l__ustc_section_style_chinese_bool } , |
|
202 | 202 | { \bool_set_true:N \l__ustc_eqn_paren_style_full_bool } , |
203 | 203 | eqn-paren-style / half .code:n = |
204 | 204 | { \bool_set_false:N \l__ustc_eqn_paren_style_full_bool } , |
205 | | - unknown .code:n = |
206 | | - { \PassOptionsToClass { \CurrentOption } { ctexbook } } , |
| 205 | + unknown .code:n = { \PassOptionsToClass { \CurrentOption } { ctexbook } } , |
207 | 206 | } |
208 | 207 |
|
209 | 208 | \keys_set:nn { ustc } |
210 | 209 | { |
211 | 210 | degree = doctor , |
| 211 | + fontset = auto , |
| 212 | + output = print , |
212 | 213 | degree-type = academic , |
213 | 214 | language = chinese , |
214 | 215 | review = false , |
215 | 216 | reviewer = false , |
216 | | - fontset = auto , |
217 | 217 | font = auto , |
218 | 218 | cjk-font = auto , |
219 | 219 | math-font = auto , |
|
264 | 264 | \ProcessKeysOptions { ustc } |
265 | 265 | } |
266 | 266 |
|
267 | | -\keys_set:nn { ustc } |
268 | | - { unknown .undefine: } |
| 267 | +\clist_map_inline:nn { degree , fontset , output } |
| 268 | + { |
| 269 | + \keys_define:nn { ustc } |
| 270 | + { |
| 271 | + #1 .code:n = { \msg_error:nnnn { ustcthesis } { load-only } {##1} } , |
| 272 | + } |
| 273 | + } |
269 | 274 |
|
270 | | -\bool_if:NT \l__ustc_output_electronic_bool |
271 | | - { \PassOptionsToClass { oneside } { ctexbook } } |
| 275 | +\msg_new:nnn { ustcthesis } { load-only } |
| 276 | + { The~ '#1'~ option~ can~ only~ be~ used~ when~ loading~ the~ class. } |
| 277 | + |
| 278 | +\keys_define:nn { ustc } |
| 279 | + { unknown .undefine: } |
272 | 280 |
|
273 | 281 | \PassOptionsToPackage { no-math } { fontspec } |
274 | 282 |
|
|
283 | 291 | % 建议在模板开始处载入全部宏包,不要轻易改变加载顺序。 |
284 | 292 | % \pkg{hyperref} 一般在最后加载。 |
285 | 293 | \RequirePackage { amsmath } |
286 | | -\RequirePackage { fontspec } [ 2017/03/31 ] |
| 294 | +\RequirePackage { fontspec } |
287 | 295 | \RequirePackage { geometry } |
288 | 296 | \RequirePackage { graphicx } |
289 | 297 | \RequirePackage { fancyhdr } |
|
604 | 612 | \str_if_eq:VnT \l__ustc_fontset_str { auto } |
605 | 613 | { |
606 | 614 | \sys_if_platform_windows:TF |
607 | | - { \ustcsetup { fontset = windows } } |
| 615 | + { \str_set:Nn \l__ustc_fontset_str { windows } } |
608 | 616 | { |
609 | 617 | \fontspec_font_if_exist:nTF { SimSun } |
610 | | - { \ustcsetup { fontset = windows} } |
| 618 | + { \str_set:Nn \l__ustc_fontset_str { windows } } |
611 | 619 | { |
612 | 620 | \__ustc_if_platform_mac:TF |
613 | | - { \ustcsetup { fontset = mac } } |
614 | | - { \ustcsetup { fontset = fandol } } |
| 621 | + { \str_set:Nn \l__ustc_fontset_str { mac } } |
| 622 | + { \str_set:Nn \l__ustc_fontset_str { fandol } } |
615 | 623 | } |
616 | 624 | } |
617 | 625 | } |
|
0 commit comments