|
948 | 948 | % \end{optdesc}
|
949 | 949 | % \end{function}
|
950 | 950 | %
|
| 951 | +% \begin{function}[added=2023-03-29]{style/mathFont} |
| 952 | +% \begin{bitsyntax}[emph={[1]mathFont}] |
| 953 | +% mathFont = (*(cm)|asana|fira|...|xits|none*) |
| 954 | +% \end{bitsyntax} |
| 955 | +% 设置数学字体,具体配置见表~\ref{tab:math-font}。除 |Computer Mordern| (默认)字体以外,均使用 \pkg{unicode-math} 宏包调用字体。 |
| 956 | +% |
| 957 | +% \end{function} |
| 958 | +% |
| 959 | +% \begin{table}[] |
| 960 | +% \begin{tabular}{cc|cc} |
| 961 | +% \toprule |
| 962 | +% \textbf{选项名称} & \textbf{字体名称} & \textbf{选项名称} & \textbf{字体名称} \\ \midrule |
| 963 | +% cm & Computer Mordern & \cellcolor[HTML]{EFEFEF}newcm & \cellcolor[HTML]{EFEFEF}New Computer Modern Math \\ |
| 964 | +% \cellcolor[HTML]{EFEFEF}asana & \cellcolor[HTML]{EFEFEF}Asana Math & stix & STIX Math \\ |
| 965 | +% concrete & Concrete Math & \cellcolor[HTML]{EFEFEF}stix2 & \cellcolor[HTML]{EFEFEF}STIX Two Math \\ |
| 966 | +% \cellcolor[HTML]{EFEFEF}erewhon & \cellcolor[HTML]{EFEFEF}Erewhon Math & xcharter & XCharter Math \\ |
| 967 | +% euler & Euler Math & \cellcolor[HTML]{EFEFEF}xits & \cellcolor[HTML]{EFEFEF}XITS Math \\ |
| 968 | +% \cellcolor[HTML]{EFEFEF}fira & \cellcolor[HTML]{EFEFEF}Fira Math & bonum & TeX Gyre Bonum Math \\ |
| 969 | +% garamond & Garamond Math & \cellcolor[HTML]{EFEFEF}dejavu & \cellcolor[HTML]{EFEFEF}TeX Gyre DejaVu Math \\ |
| 970 | +% \cellcolor[HTML]{EFEFEF}gfsneohellenic & \cellcolor[HTML]{EFEFEF}GFS Neohellenic Math & pagella & TeX Gyre Pagella Math \\ |
| 971 | +% kp & KpMath & \cellcolor[HTML]{EFEFEF}schola & \cellcolor[HTML]{EFEFEF}TeX Gyre Schola Math \\ |
| 972 | +% \cellcolor[HTML]{EFEFEF}libertinus & \cellcolor[HTML]{EFEFEF}Libertinus Math & termes & TeX Gyre Termes Math \\ |
| 973 | +% lm & Latin Modern Math & & \\ \bottomrule |
| 974 | +% \end{tabular} |
| 975 | +% \caption{数学字体配置选项与名称说明} |
| 976 | +% \label{tab:math-font} |
| 977 | +% \end{table} |
| 978 | +% |
| 979 | +% \begin{function}[added=2023-03-29]{style/unicodeMathOptions} |
| 980 | +% \begin{bitsyntax}[emph={[1]unicodeMathOptions}] |
| 981 | +% unicodeMathOptions = (*({})|任意选项*) |
| 982 | +% \end{bitsyntax} |
| 983 | +% |
| 984 | +% 传递给 \pkg{unicode-math} 的选项。 |
| 985 | +% |
| 986 | +% \end{function} |
| 987 | +% |
951 | 988 | % \subsubsection{目录选项}
|
952 | 989 | %
|
953 | 990 | % \begin{function}{TOC}
|
|
1080 | 1117 | % \end{bitsyntax}
|
1081 | 1118 | %
|
1082 | 1119 | % 影响所有名称列表(author、editor 等)的限制值。如果某个列表包含的姓名数量超
|
1083 |
| -% 过 \marg{正整数},那么就会自动截断至 |minbibnames| 个姓名。|minbibnames| 的值必须小于或 |
| 1120 | +% 过 |maxbibnames| 个,那么就会自动截断至 |minbibnames| 个姓名。|minbibnames| 的值必须小于或 |
1084 | 1121 | % 等于 |maxbibnames|。
|
1085 | 1122 | %
|
1086 | 1123 | % 对于用户来说,可以将 |minbibnames| 理解为「姓名列表的最小长度」。
|
1087 |
| -% 例如,你在全部文献中最低排在第四位,那么可以将 |minbibnames| 和 |maxbibnames| 都设置为 4。 |
| 1124 | +% \textbf{例如,你在全部文献中最低排在第四位,那么可以将 |minbibnames| 和 |maxbibnames| 都设置为 4。} |
1088 | 1125 | %
|
1089 | 1126 | % \end{function}
|
1090 | 1127 | %
|
|
2293 | 2330 | { \flushbottom }
|
2294 | 2331 | },
|
2295 | 2332 | pageVerticalAlign .initial:n = {top},
|
| 2333 | + % 数学字体配置 |
| 2334 | + mathFont .choices:nn = { |
| 2335 | + asana, bonum, cm, concrete, dejavu, erewhon, euler, |
| 2336 | + fira, garamond, gfsneohellenic, kp, libertinus, lm, newcm, |
| 2337 | + pagella, schola, stix, stix2, termes, xcharter, xits, none, |
| 2338 | + } { \tl_set_eq:NN \l_@@_style_math_font_tl \l_keys_choice_tl }, |
| 2339 | + mathFont .initial:n = {cm}, |
| 2340 | + % Options that will be pass to `unicode-math` pkgs. |
| 2341 | + unicodeMathOptions .tl_set:N = \l_@@_unicode_math_options_tl, |
2296 | 2342 | }
|
2297 | 2343 | % \end{macrocode}
|
2298 | 2344 | %
|
|
2468 | 2514 | }
|
2469 | 2515 | % \end{macrocode}
|
2470 | 2516 | %
|
| 2517 | +% \subsubsection{定义字体相关选项} |
| 2518 | +% |
2471 | 2519 | % 设置 Times New Roman 字体。
|
2472 | 2520 | % 根据学校规范要求,默认情况下也使用 Times New Roman 字体。
|
2473 | 2521 | % \begin{macrocode}
|
2474 | 2522 | \setmainfont{Times~New~Roman}
|
2475 | 2523 | \setromanfont{Times~New~Roman}
|
2476 | 2524 | % \end{macrocode}
|
2477 | 2525 | %
|
| 2526 | +% \begin{macro}{\@@_font_path:} |
| 2527 | +% 当选择使用字体文件配置字体时,设置字体文件路径。 |
| 2528 | +% \begin{macrocode} |
| 2529 | +\cs_new:Npn \@@_font_path: |
| 2530 | + { |
| 2531 | + \str_if_eq:NNTF { \l_@@_font_type_tl } { font } |
| 2532 | + { } |
| 2533 | + { Path = \l_@@_font_path_tl / , } |
| 2534 | + } |
| 2535 | +% \end{macrocode} |
| 2536 | +% \end{macro} |
| 2537 | +% |
| 2538 | +% \begin{macro}{\@@_load_unicode_math_pkg:} |
| 2539 | +% 加载\pkg{unicode-math}宏包。 |
| 2540 | +% \begin{macrocode} |
| 2541 | +\cs_new:Npn \@@_load_unicode_math_pkg: |
| 2542 | + { |
| 2543 | + \PassOptionsToPackage { \l_@@_unicode_math_options_tl } { unicode-math } |
| 2544 | + \RequirePackage { unicode-math } |
| 2545 | + } |
| 2546 | +% \end{macrocode} |
| 2547 | +% \end{macro} |
| 2548 | +% |
| 2549 | +% \begin{macro}{\@@_define_math_font:nn} |
| 2550 | +% 批量定义数学字体配置。 |
| 2551 | +% \begin{arguments} |
| 2552 | +% \item 配置名称。 |
| 2553 | +% \item 字体名称。 |
| 2554 | +% \end{arguments} |
| 2555 | +% \begin{macrocode} |
| 2556 | +\cs_new:Npn \@@_define_math_font:nn #1#2 |
| 2557 | + { |
| 2558 | + \cs_new:cpn { @@_load_math_font_ #1 : } |
| 2559 | + { |
| 2560 | + \@@_load_unicode_math_pkg: |
| 2561 | + \setmathfont { #2 } |
| 2562 | + } |
| 2563 | + } |
| 2564 | +\clist_map_inline:nn |
| 2565 | + { |
| 2566 | + { asana } { Asana-Math.otf }, |
| 2567 | + { concrete } { Concrete-Math.otf }, |
| 2568 | + { erewhon } { Erewhon-Math.otf }, |
| 2569 | + { euler } { Euler-Math.otf }, |
| 2570 | + { fira } { FiraMath-Regular.otf }, |
| 2571 | + { garamond } { Garamond-Math.otf }, |
| 2572 | + { gfsneohellenic } { GFSNeohellenicMath.otf }, |
| 2573 | + { kp } { KpMath-Regular.otf }, |
| 2574 | + { libertinus } { LibertinusMath-Regular.otf }, |
| 2575 | + { lm } { latinmodern-math.otf }, |
| 2576 | + { newcm } { NewCMMath-Regular.otf }, |
| 2577 | + { stix } { STIXMath-Regular.otf }, |
| 2578 | + { stix2 } { STIXTwoMath-Regular.otf }, |
| 2579 | + { xcharter } { XCharter-Math.otf }, |
| 2580 | + { xits } { XITSMath-Regular.otf }, |
| 2581 | + { bonum } { texgyrebonum-math.otf }, |
| 2582 | + { dejavu } { texgyredejavu-math.otf }, |
| 2583 | + { pagella } { texgyrepagella-math.otf }, |
| 2584 | + { schola } { texgyreschola-math.otf }, |
| 2585 | + { termes } { texgyretermes-math.otf } |
| 2586 | + } |
| 2587 | + { \@@_define_math_font:nn #1 } |
| 2588 | +% \end{macrocode} |
| 2589 | +% \end{macro} |
| 2590 | +% |
| 2591 | +% \begin{macro}{\@@_load_math_font_cm:} |
| 2592 | +% 数学字体配置 |cm|。 |
| 2593 | +% \begin{macrocode} |
| 2594 | +\cs_new:Npn \@@_load_math_font_cm: { } |
| 2595 | +% \end{macrocode} |
| 2596 | +% \end{macro} |
| 2597 | +% |
| 2598 | +% \begin{macro}{\@@_load_math_font_none:} |
| 2599 | +% 数学字体配置 |none|。 |
| 2600 | +% \begin{macrocode} |
| 2601 | +\cs_new:Npn \@@_load_math_font_none: { } |
| 2602 | +% \end{macrocode} |
| 2603 | +% \end{macro} |
| 2604 | +% |
| 2605 | +% \begin{macro}{\@@_load_font:} |
| 2606 | +% 加载数学字体 |
| 2607 | +% \begin{macrocode} |
| 2608 | +\cs_new:Npn \@@_load_font: |
| 2609 | + { |
| 2610 | + \use:c { @@_load_math_font_ \l_@@_style_math_font_tl : } |
| 2611 | + } |
| 2612 | +% \end{macrocode} |
| 2613 | +% \end{macro} |
| 2614 | +% |
| 2615 | +% \paragraph{定义导言区末尾加载内容} |
| 2616 | +% |
2478 | 2617 | % 在 |preamble| 中,加载各个模板需要的字体。
|
2479 | 2618 | % \begin{macrocode}
|
2480 | 2619 | \ctex_at_end_preamble:n {
|
| 2620 | + % 在导言区末尾加载数学字体。 |
| 2621 | + \@@_load_font: |
| 2622 | + |
2481 | 2623 | \@@_if_thesis_english:TF {
|
2482 | 2624 | \@@_if_thesis_int_type:nT {3} {
|
2483 | 2625 | % 对于本科全英文专业模板
|
@@ -6310,7 +6452,7 @@ footskip=0.7cm% 页脚 1.8cm %
|
6310 | 6452 | \RequirePackage{array,longtable,booktabs}
|
6311 | 6453 | \RequirePackage{listings}
|
6312 | 6454 | \RequirePackage{fancyhdr}
|
6313 |
| -\RequirePackage[dvipsnames]{xcolor} |
| 6455 | +\RequirePackage[dvipsnames,table,xcdraw]{xcolor} |
6314 | 6456 | \RequirePackage{awesomebox}
|
6315 | 6457 | % \RequirePackage{etoolbox}
|
6316 | 6458 | \RequirePackage{dirtree}
|
@@ -6404,8 +6546,6 @@ footskip=0.7cm% 页脚 1.8cm %
|
6404 | 6546 | }
|
6405 | 6547 | }
|
6406 | 6548 |
|
6407 |
| - |
6408 |
| - |
6409 | 6549 | \ifthenelse{\equal{\@nameuse{g__ctex_fontset_tl}}{mac}}{
|
6410 | 6550 | \setmainfont{Palatino}
|
6411 | 6551 | \setsansfont[Scale=MatchLowercase]{Helvetica}
|
|
0 commit comments