diff options
-rw-r--r-- | Master/texmf-dist/doc/xelatex/exam-zh/CHANGELOG.md | 32 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/exam-zh/doc/back/package.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/exam-zh/doc/body/installation.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/exam-zh/doc/body/usage.tex | 44 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc-setup.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc.pdf | bin | 1085430 -> 1096057 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/latex/exam-zh/exam-zh-chinese-english.sty | 31 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exam-zh/exam-zh-choices.sty | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exam-zh/exam-zh-font.sty | 3 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exam-zh/exam-zh-question.sty | 278 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exam-zh/exam-zh-symbols.sty | 12 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exam-zh/exam-zh.cls | 29 |
12 files changed, 349 insertions, 90 deletions
diff --git a/Master/texmf-dist/doc/xelatex/exam-zh/CHANGELOG.md b/Master/texmf-dist/doc/xelatex/exam-zh/CHANGELOG.md index a8d56a3d528..5309e2dd9d9 100644 --- a/Master/texmf-dist/doc/xelatex/exam-zh/CHANGELOG.md +++ b/Master/texmf-dist/doc/xelatex/exam-zh/CHANGELOG.md @@ -5,6 +5,38 @@ 格式参照 [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 并且此项目遵守 [Semantic Versioning](https://semver.org/spec/v2.0.0.html)。 +## [0.1.15] - 2022-08-09 + +### Fixed + +- 增加 `\tl_map_inline:nn` 的变体函数修复报错 + + +## [0.1.15] - 2022-08-02 + +### Added + +- 增加直立的 pi:`\uppi` + +### Fixed + +- 修复 `poem` 环境没有 `\zhu` 的注解显示问题 + + +## [0.1.14] - 2022-07-30 + +### Added + +- 增加 `fillin/paren-type` 控制括号的半角全角 +- 增加 `fillin/width-type` 控制 `fillin/no-answer-type=none` 下 `width` 的表现 + +## [0.1.14] - 2022-07-29 + +### Fixed + +- 修复 `solution` 的颜色设置影响密封线问题(#I5JJT3) +- 修复 `fillin*` 内包含文字和公式的问题(https://gitee.com/zepinglee/exam-zh/issues/I4TJTO#note_12005992_link) +- 修复 `lstlistings` 环境影响密封线问题(#I5JJT3) ## [0.1.13] - 2022-07-28 diff --git a/Master/texmf-dist/doc/xelatex/exam-zh/doc/back/package.tex b/Master/texmf-dist/doc/xelatex/exam-zh/doc/back/package.tex index e4373420b65..6a67ac1504d 100644 --- a/Master/texmf-dist/doc/xelatex/exam-zh/doc/back/package.tex +++ b/Master/texmf-dist/doc/xelatex/exam-zh/doc/back/package.tex @@ -18,7 +18,7 @@ \item \pkg{enumitem}:列表 \item \pkg{tikz}、\pkg{tikzpagenodes}: \TikZ \item \pkg{hyperref}:超链接 - \item \pkg{zref-savepos}:记录。用于 \tn{score} 命令 + \item \pkg{zref}、\pkg{zref-savepos}:记录位置。 \item \pkg{ulem}:下划线 \item \pkg{tcolorbox}:彩框 \item \pkg{varwidth}:“弹性”的 \env{minipage} diff --git a/Master/texmf-dist/doc/xelatex/exam-zh/doc/body/installation.tex b/Master/texmf-dist/doc/xelatex/exam-zh/doc/body/installation.tex index dc0ac800147..445330d0c55 100644 --- a/Master/texmf-dist/doc/xelatex/exam-zh/doc/body/installation.tex +++ b/Master/texmf-dist/doc/xelatex/exam-zh/doc/body/installation.tex @@ -30,7 +30,7 @@ \begin{figure}[htbp] \centering - \includegraphics[width = \textwidth]{gitee-release.png} + \includegraphics[width = 0.8\textwidth]{gitee-release.png} \caption{gitee 发行版} \label{figure:gitee发行版} \end{figure} diff --git a/Master/texmf-dist/doc/xelatex/exam-zh/doc/body/usage.tex b/Master/texmf-dist/doc/xelatex/exam-zh/doc/body/usage.tex index 264d618e53e..8fa19b40f9e 100644 --- a/Master/texmf-dist/doc/xelatex/exam-zh/doc/body/usage.tex +++ b/Master/texmf-dist/doc/xelatex/exam-zh/doc/body/usage.tex @@ -50,18 +50,22 @@ \subsubsection{正体的数学常数} -\begin{function}{\eu} +\begin{function}[updated = 2022-08-02]{\eu,\upe} 正体的自然对数的底“e”。 \end{function} -\begin{function}{\iu} +\begin{function}[updated = 2022-08-02]{\iu,\upi} 正体的虚数单位“i”。 \end{function} \tn{eu} 可以理解为 “e upright” 的缩写或者 “Euler's number” 的首字母,\tn{iu} 可以理解为 “i upright” 或 “imaginary unit” 的缩写,这样更方便记忆。 -\begin{latexexample}{\tn{eu} 和 \tn{iu} 的效果} - $\eu \quad \iu$ +\begin{function}[added = 2022-08-02]{\uppi} + 正体的圆周率“$\pi$”: “$\uppi$”。 +\end{function} + +\begin{latexexample}{\tn{eu}、\tn{iu} 和 \tn{uppi} 的效果} + $\eu \quad \iu \quad \uppi$ \end{latexexample} @@ -1953,11 +1957,31 @@ \begin{function}[added = 2022-07-06]{fillin/width} \begin{ccnusyntax}[emph={[1]width}] - width = (*<skip>*) + width = (*<dimension>*) \end{ccnusyntax} - 控制 \kvopt{fillin/type}{line/paren/blank} 下 \tn{fillin} 不显示答案时的长度,可以为弹性长度,默认为 |3em plus 1em minus 1em|。 + 控制 \kvopt{fillin/type}{line/paren/blank} 下 \tn{fillin} 不显示答案时的长度,默认为 |3em|。 \end{function} +\begin{function}[added = 2022-07-30]{fillin/width-type} + \begin{ccnusyntax}[emph={[1]width-type}] + width-type = (*<(fill)|normal>*) + \end{ccnusyntax} + \kvopt{show-answer}{false} 且 \kvopt{no-answer-type}{none} 时 \opt{fillin/width} 设置时若 \meta{width} 的长度超过了当前行的剩余长度,则多余部分在下一行的表现。\opt{fill} 表示多余部分只要不超过 \tn{linewidth} 就自动 fill 为 \tn{linewidth} 的长度(此时建议 \opt{width} 的值不是 \tn{linewidth} 的整数倍,而是(以最终一共两行为例)比如 |1.5\linewidth|);\opt{normal} 表示多余部分严格按照 \meta{width} 的值排版。由于使用了 \pkg{linegoal},需要编译至少两次才能获得正确的效果。 +\end{function} + +\begin{latexexample}{\opt{width-type} 示例} + \examsetup{fillin/no-answer-type=none} + 测试 测试测试,测试 \fillin[width = 3em][答案] + + 测试 测试测试,测试 \fillin[width = 0.5\linewidth][答案] + + 测试 + \fillin[width = 1.1\linewidth][答案] 测试 + + 测试 + \fillin[width-type = normal, width = 1.1\linewidth][答案] 测试 +\end{latexexample} + \begin{function}[added = 2022-07-15]{fillin/color} \begin{ccnusyntax}[emph={[1]color}] color = (*\meta{color}*) @@ -1974,6 +1998,14 @@ \end{function} +\begin{function}[added = 2022-07-30]{fillin/paren-type} + \begin{ccnusyntax}[emph={[1]paren-type}] + paren-type = (*<(banjiao)|quanjiao>*) + \end{ccnusyntax} + 设置 \tn{fillin} 中 \kvopt{type}{paren} 时的括号类型。\opt{banjiao} 表示半角括号;\opt{quanjiao} 表示全角括号。 +\end{function} + + \subsubsection{解答题} \label{subsubsec:参数-解答题} \begin{function}[added = 2022-07-01]{solution} diff --git a/Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc-setup.tex b/Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc-setup.tex index 19b2ed0661d..0d58eb870dd 100644 --- a/Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc-setup.tex +++ b/Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc-setup.tex @@ -31,15 +31,13 @@ \title{\textcolor{MaterialIndigo800}{% \textbf{exam-zh: 高考试卷 \LaTeX \xpinyin[font=\sffamily,format=\color{MaterialIndigo800}]{模}{mu2}板}}} \author{李泽平,夏康玮,郭李军} -\date{2022/07/28\quad v0.1.13% +\date{2022/08/02\quad v0.1.15% \thanks{% \url{https://gitee.com/zepinglee/exam-zh} } } \ExplSyntaxOn -\NewDocumentCommand \eu { } { \mathrm{ e } } -\NewDocumentCommand \iu { } { \mathrm{ i } } \NewDocumentCommand { \scoringbox } { s } { \IfBooleanTF {#1} diff --git a/Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc.pdf b/Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc.pdf Binary files differindex e3cd445997f..c05b3ae4f41 100644 --- a/Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc.pdf +++ b/Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc.pdf diff --git a/Master/texmf-dist/tex/latex/exam-zh/exam-zh-chinese-english.sty b/Master/texmf-dist/tex/latex/exam-zh/exam-zh-chinese-english.sty index b27dfab271e..b0ccffa0fbd 100644 --- a/Master/texmf-dist/tex/latex/exam-zh/exam-zh-chinese-english.sty +++ b/Master/texmf-dist/tex/latex/exam-zh/exam-zh-chinese-english.sty @@ -8,7 +8,7 @@ \RequirePackage{expl3} -\ProvidesExplPackage {exam-zh-chinese-english} {2022-07-28} {v0.1.13} +\ProvidesExplPackage {exam-zh-chinese-english} {2022-08-09} {v0.1.15} {exam-zh chinese and english module} \PassOptionsToPackage { tcolorbox } { most } @@ -403,7 +403,7 @@ format = \kaishu, title-author-sep = 2em, top-sep = 0pt, - bottom-sep = 0pt, + bottom-sep = 1em, title-poem-sep = 0.25\baselineskip, type = chinese, align = l, @@ -427,6 +427,8 @@ #2 \endtabular \group_end: + \par + \addvspace { 1em } } { \__examzh_poem_end: @@ -480,17 +482,20 @@ } { \endcenter - \vspace*{-0.7em} - \small - \begin{description}[leftmargin = 2em] - \item[{[注]}] - \seq_map_indexed_inline:Nn \g__examzh_poem_zhu_store_seq - % ##1: index - % ##2: content - { - \__examzh_chinese_circled_number:n {##1} ~ ##2 - } - \end{description} + \seq_if_empty:NF \g__examzh_poem_zhu_store_seq + { + \vspace*{-0.7em} + \small + \begin{description}[leftmargin = 2em] + \item[{[注]}] + \seq_map_indexed_inline:Nn \g__examzh_poem_zhu_store_seq + % ##1: index + % ##2: content + { + \__examzh_chinese_circled_number:n {##1} ~ ##2 + } + \end{description} + } } } diff --git a/Master/texmf-dist/tex/latex/exam-zh/exam-zh-choices.sty b/Master/texmf-dist/tex/latex/exam-zh/exam-zh-choices.sty index 6eccb24867a..1f43e892908 100644 --- a/Master/texmf-dist/tex/latex/exam-zh/exam-zh-choices.sty +++ b/Master/texmf-dist/tex/latex/exam-zh/exam-zh-choices.sty @@ -9,7 +9,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {exam-zh-choices} {2022-07-28} {v0.1.13} +\ProvidesExplPackage {exam-zh-choices} {2022-08-09} {v0.1.15} {exam-zh choices module} \dim_new:N \l__examzh_choices_column_sep_dim diff --git a/Master/texmf-dist/tex/latex/exam-zh/exam-zh-font.sty b/Master/texmf-dist/tex/latex/exam-zh/exam-zh-font.sty index 15b173c9ef7..3ba6cbcbd88 100644 --- a/Master/texmf-dist/tex/latex/exam-zh/exam-zh-font.sty +++ b/Master/texmf-dist/tex/latex/exam-zh/exam-zh-font.sty @@ -9,11 +9,12 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {exam-zh-font} {2022-07-28} {v0.1.13} +\ProvidesExplPackage {exam-zh-font} {2022-08-09} {v0.1.15} {exam-zh font module} \RequirePackage { unicode-math } \RequirePackage { filehook } +\RequirePackage { etoolbox } \tl_new:N \g__examzh_font_font_tl \tl_new:N \g__examzh_font_math_font_tl diff --git a/Master/texmf-dist/tex/latex/exam-zh/exam-zh-question.sty b/Master/texmf-dist/tex/latex/exam-zh/exam-zh-question.sty index 825a6ad991b..6651de73834 100644 --- a/Master/texmf-dist/tex/latex/exam-zh/exam-zh-question.sty +++ b/Master/texmf-dist/tex/latex/exam-zh/exam-zh-question.sty @@ -9,22 +9,34 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {exam-zh-question} {2022-07-28} {v0.1.13} +\ProvidesExplPackage {exam-zh-question} {2022-08-09} {v0.1.15} {exam-zh question module} + \RequirePackage { amsthm } \@ifpackageloaded { tcolorbox } { \tcbuselibrary { breakable } } { \RequirePackage [ most ] { tcolorbox } } -\RequirePackage { zref-savepos } -\RequirePackage { ulem } +% \RequirePackage { zref-savepos } +\RequirePackage { xeCJKfntef } + +% https://github.com/CTeX-org/forum/issues/264#issuecomment-1200087776 +\disable@package@load { etex } + { + \cs_set_eq:NN \globcount \newcount + \cs_set_eq:NN \globdimen \newdimen + } +\RequirePackage { linegoal } + \ExplSyntaxOff + \usetikzlibrary{shapes.misc} \ExplSyntaxOn + \NewDocumentCommand \questionsetup { m } { \keys_set:nn { exam-zh / question } { #1 } } \NewDocumentCommand \fillinsetup { m } @@ -267,9 +279,10 @@ \prg_generate_conditional_variant:Nnn \regex_extract_once:nnN { nxN } { F } \cs_new:Npn \__examzh_question_begin_fillin_type_set: { - \regex_count:nVN { \[ } %] + \regex_count:nVN { \[ } % \] \l__examzh_question_combine_fillin_args_tl \l__examzh_question_begin_fillin_args_bracket_num_int + \use_none:n { \] } % 消去 \[ 的高亮影响 % \int_use:N \l__examzh_question_begin_fillin_args_bracket_num_int \int_compare:nNnT { \l__examzh_question_begin_fillin_args_bracket_num_int } = {2} { @@ -687,6 +700,12 @@ % fillin 的下划线样式控制 \str_new:N \l__examzh_fillin_type_str +% fillin type = paren 的括号类型 +\bool_new:N \l__examzh_fillin_paren_banjiao_bool + +% fillin 的 width 设置断行时是自动铺满行还是严格按照长度来 +\bool_new:N \l__examzh_fillin_width_fill_bool + % 不显示答案时显示的类型 \str_new:N \l__examzh_fillin_no_answer_type_str @@ -700,25 +719,37 @@ \str_set:Nn \l__examzh_fillin_type_str {#1} }, show-answer .bool_set:N = \l__examzh_question_show_fillin_answer_bool, - width .skip_set:N = \l__examzh_fillin_F_width_skip, + width .dim_set:N = \l__examzh_fillin_F_width_dim, + width-type .choice:, + width-type / fill .code:n = + { \bool_set_true:N \l__examzh_fillin_width_fill_bool }, + width-type / normal .code:n = + { \bool_set_false:N \l__examzh_fillin_width_fill_bool }, color .tl_set:N = \l__examzh_fillin_color_tl, text-color .tl_set:N = \l__examzh_fillin_text_color_tl, no-answer-type .choices:nn = { blacktriangle, counter, none } { \str_set:Nx \l__examzh_fillin_no_answer_type_str { \l_keys_choice_tl } }, no-answer-counter-index .int_gset:N = \g__examzh_fillin_no_answer_counter_int, - no-answer-counter-label .tl_set:N = \l__examzh_fillin_label_tl + no-answer-counter-label .tl_set:N = \l__examzh_fillin_label_tl, + paren-type .choice:, + paren-type / banjiao .code:n = + { \bool_set_true:N \l__examzh_fillin_paren_banjiao_bool }, + paren-type / quanjiao .code:n = + { \bool_set_false:N \l__examzh_fillin_paren_banjiao_bool }, } \keys_set:nn { exam-zh / fillin } { type = line, show-answer = false, - width = 3em plus 1em minus 1em, + width = 3em, color = black, text-color = black, no-answer-type = blacktriangle, no-answer-counter-index = 1, - no-answer-counter-label = \arabic* + no-answer-counter-label = \arabic*, + paren-type = banjiao, + width-type = fill, } \keys_define:nn { exam-zh } @@ -756,8 +787,7 @@ } } { - \keys_set:nn { exam-zh / fillin } - {#2} + \keys_set:nn { exam-zh / fillin } {#2} \bool_if:NTF \l__examzh_question_show_fillin_answer_bool { % 显示答案 @@ -776,7 +806,7 @@ \__examzh_fillin_no_answer_typeset: } } - \group_end: + \group_end: \space \ignorespaces } \msg_new:nnn { exam-zh / fillin } { no-such-noanswertype } @@ -924,22 +954,45 @@ } \cs_new:Npn \__examzh_fillin_uline_F: { - \uline { \hspace* { \l__examzh_fillin_F_width_skip } } - } -\cs_new:Nn \__examzh_fillin_uline: - { - \bgroup - \color{ \l__examzh_fillin_text_color_tl } - \markoverwith{\textcolor{black}{\rule[-0.7ex]{2pt}{0.4pt}}} - \ULon + % \uline { \hspace* { \l__examzh_fillin_F_width_dim } } + \__examzh_fillin_breakable_hspace:NN \CJKunderline \allowbreak + } +% \cs_new:Nn \__examzh_fillin_uline: + % { + % \bgroup + % \color{ \l__examzh_fillin_text_color_tl } + % \markoverwith{\textcolor{black}{\rule[-0.7ex]{2pt}{0.4pt}}} + % \ULon +% xeCJKfntef.sty +% xeCJK: 修复下划线中数学公式的错误处理 +% https://github.com/CTeX-org/ctex-kit/commit/ad44c6674bb377653544349f23b7c629bc9e4677 +\RenewDocumentCommand \CJKunderline { s t- s o } + { + \xeCJK_ulem_group_begin: + \xeCJK_fntef_boot:nnNNNn { underline } { uline } #1#2#3 {#4} + \xeCJK_fntef_initial:nnn + { \l__xeCJK_uline_depth_tl } + { \l__xeCJK_uline_sep_tl } + { + \l__xeCJK_uline_format_tl + \tex_vrule:D + height \dim_eval:n { \l__xeCJK_uline_thickness_tl } + depth \c_zero_dim + width .2em + } + % 给 CJKunderline 加了颜色控制 + \color { \l__examzh_fillin_text_color_tl } + \xeCJK_ulem_on:n } + % } \cs_new:Npn \__examzh_fillin_uline_breakline_T: { - % \CJKunderline* + \CJKunderline* % \uline - \__examzh_fillin_uline: + % \__examzh_fillin_uline: { \hspace* { 0.5em plus .5em minus .5em } + % \color{ \l__examzh_fillin_text_color_tl } \l_tmpa_tl % 答案很长时,不能完全显示,答案很长时,不能完全显示 \hspace* { 0.5em plus .5em minus .5em } @@ -947,27 +1000,65 @@ } \cs_new:Npn \__examzh_fillin_paren_T: { - ( - \hspace* { 0.5em plus .5em minus .5em } - \group_begin: - \box_use_drop:N \l_tmpa_box - \group_end: - \hspace* { 0.5em plus .5em minus .5em } - ) + \bool_if:NTF \l__examzh_fillin_paren_banjiao_bool + { + ( + \hspace* { 0.5em plus .5em minus .5em } + \group_begin: + \box_use_drop:N \l_tmpa_box + \group_end: + \hspace* { 0.5em plus .5em minus .5em } + ) + } + { + ( + \hspace* { 0.5em plus .5em minus .5em } + \group_begin: + \box_use_drop:N \l_tmpa_box + \group_end: + \hspace* { 0.5em plus .5em minus .5em } + ) + } } \cs_new:Npn \__examzh_fillin_paren_breakline_T: { - ( - \hspace* { 0.5em plus .5em minus .5em } - \group_begin: - \l_tmpa_tl - \group_end: - \hspace* { 0.5em plus .5em minus .5em } - ) + \bool_if:NTF \l__examzh_fillin_paren_banjiao_bool + { + ( + \hspace* { 0.5em plus .5em minus .5em } + \group_begin: + \l_tmpa_tl + \group_end: + \hspace* { 0.5em plus .5em minus .5em } + ) + } + { + ( + \hspace* { 0.5em plus .5em minus .5em } + \group_begin: + \l_tmpa_tl + \group_end: + \hspace* { 0.5em plus .5em minus .5em } + ) + } } +\box_new:N \c__examzh_banjiao_right_brace_box +\box_new:N \c__examzh_quanjiao_right_brace_box +\hbox_set:Nn \c__examzh_banjiao_right_brace_box { ) } +\hbox_set:Nn \c__examzh_quanjiao_right_brace_box { ) } +\dim_const:Nn \c__examzh_banjiao_right_brace_width_dim % ( + { \box_wd:N \c__examzh_banjiao_right_brace_box } +\dim_const:Nn \c__examzh_quanjiao_right_brace_width_dim % ( + { \box_wd:N \c__examzh_quanjiao_right_brace_box } \cs_new:Npn \__examzh_fillin_paren_F: { - ( \hspace* { \l__examzh_fillin_F_width_skip} ) + \bool_if:NTF \l__examzh_fillin_paren_banjiao_bool + { + ( \__examzh_fillin_breakable_hspace:NN \use:n \nobreak \kern-\c__examzh_banjiao_right_brace_width_dim ) \allowbreak + } + { + ( \__examzh_fillin_breakable_hspace:NN \use:n \nobreak \kern-\c__examzh_quanjiao_right_brace_width_dim )\allowbreak + } } \cs_new:Npn \__examzh_fillin_blank_T: { @@ -987,7 +1078,8 @@ } \cs_new:Npn \__examzh_fillin_blank_F: { - \hspace* { \l__examzh_fillin_F_width_skip } + % \hspace* { \l__examzh_fillin_F_width_dim } + \__examzh_fillin_breakable_hspace:NN \use:n \allowbreak } \tikzset { @@ -1037,6 +1129,77 @@ \hspace* { 0.5em plus .5em minus .5em } } +% 通过循环来达到自动断行的空白下划线 +\cs_generate_variant:Nn \dim_sub:Nn { NV } +\cs_generate_variant:Nn \dim_add:Nn { NV } +\cs_generate_variant:Nn \dim_set:Nn { NV, Nx } +% 用来检测是否处于 list 环境中 +\bool_new:N \l__if_list_bool +\int_new:N \l__list_depth_int +\cs_generate_variant:Nn \dim_set:Nn { Nx } +\AddToHook { cmd / list / after } + { + \bool_set_true:N \l__if_list_bool + \int_incr:N \l__list_depth_int + \dim_if_exist:cF { l__list_leftmargin_ \int_to_roman:n { \l__list_depth_int } _dim } + { + \dim_new:c { l__list_leftmargin_ \int_to_roman:n { \l__list_depth_int } _dim } + } + % 用来储存相应层级的 \leftmargin 值 + \dim_set_eq:cN { l__list_leftmargin_ \int_to_roman:n { \l__list_depth_int } _dim } \leftmargin + } +\AddToHook { cmd / endlist / before } + { \int_zero:N \l__list_depth_int } + +\cs_new:Npn \__examzh_fillin_breakable_hspace:NN #1#2 + % #1: CJKunderline / use:n + % #2: \allowbreak + { + % 比较 \l__examzh_fillin_F_width_dim 和 linegoal + \dim_compare:nNnTF { \l__examzh_fillin_F_width_dim } > { \linegoal } + { + % 超过 linegoal 就排一段 linegoal,然后 \l__examzh_fillin_F_width_dim 减去 linegoal 长度 + \dim_set:NV \l_tmpa_dim \linegoal + % 是否处于 list 环境中 + \bool_if:NTF \l__if_list_bool + { + % 加上 1 到 当前层级的 leftmargin 才能让 list 中的 linegoal 正常 + \int_step_inline:nn { \l__list_depth_int } + { + \dim_add:Nn \l_tmpa_dim { \dim_use:c { l__list_leftmargin_ \int_to_roman:n { ##1 } _dim } } + } + #1 { \hspace { \l_tmpa_dim } } + } + { + % 正文中 + #1 { \hspace { \linegoal } } + } + \dim_sub:NV \l__examzh_fillin_F_width_dim \l_tmpa_dim + \dim_while_do:nNnn { \l__examzh_fillin_F_width_dim } > { \linewidth } + { + % 循环:\l__examzh_fillin_F_width_dim 和 \linewidth 比较,大的话就排一个,然后减掉 linewidth + \\ #1 { \hspace* { \linewidth } } + \dim_sub:Nn \l__examzh_fillin_F_width_dim { \linewidth } + } + % \\ #1 { \hspace* { \linewidth } } + \dim_compare:nNnT { \l__examzh_fillin_F_width_dim } < { \linewidth } + { + % 最后一行是否 fill + \bool_if:NTF \l__examzh_fillin_width_fill_bool + { + \\ #1 { \hspace* { \linewidth } } + } + { + \\ #1 { \hspace* { \l__examzh_fillin_F_width_dim } } + } + } + } + { + #1 { \hspace* { \l__examzh_fillin_F_width_dim } } + } + #2 + } + \dim_new:N \l__examzh_blacktriangle_length_dim \dim_set:Nn \l__examzh_blacktriangle_length_dim { .7em } @@ -1149,9 +1312,11 @@ % \ignorespaces % 是否要新起一段开始 \bool_if:NT \l__examzh_solution_par_break_bool { \par } - \group_begin: + % \group_begin: + \begingroup \color { \l__examzh_solution_text_color_tl } #1 - \group_end: + \endgroup + % \group_end: \bool_if:NT \l__examzh_solution_show_qed_bool { \popQED } % \endtrivlist @@ -1164,6 +1329,7 @@ \NewDocumentCommand { \score } { O{} m } { \group_begin: + \keys_set:nn { exam / question } {#1} \mode_if_math:TF { \__examzh_score_math_version:n { #2 } @@ -1179,20 +1345,24 @@ { \__examzh_math_cdotfill:n { - \l__examzh_score_format_tl - \l__examzh_score_pre_content_tl - #1 - \l__examzh_score_post_content_tl + \group_begin: + \l__examzh_score_format_tl + \l__examzh_score_pre_content_tl + #1 + \l__examzh_score_post_content_tl + \group_end: } } { \__examzh_math_nodotfill:n { { - \l__examzh_score_format_tl - \l__examzh_score_pre_content_tl - #1 - \l__examzh_score_post_content_tl + \group_begin: + \l__examzh_score_format_tl + \l__examzh_score_pre_content_tl + #1 + \l__examzh_score_post_content_tl + \group_end: } } } @@ -1201,14 +1371,18 @@ { \bool_if:NTF \l__examzh_score_show_leader_bool { - \__examzh_cdotfill: - \l__examzh_score_format_tl - \l__examzh_score_pre_content_tl #1 \l__examzh_score_post_content_tl + \group_begin: + \__examzh_cdotfill: + \l__examzh_score_format_tl + \l__examzh_score_pre_content_tl #1 \l__examzh_score_post_content_tl + \group_end: } { \hfill - \l__examzh_score_format_tl - \l__examzh_score_pre_content_tl #1 \l__examzh_score_post_content_tl + \group_begin: + \l__examzh_score_format_tl + \l__examzh_score_pre_content_tl #1 \l__examzh_score_post_content_tl + \group_end: } \par \noindent \ignorespaces } diff --git a/Master/texmf-dist/tex/latex/exam-zh/exam-zh-symbols.sty b/Master/texmf-dist/tex/latex/exam-zh/exam-zh-symbols.sty index e0f147aab3c..246335ef0a3 100644 --- a/Master/texmf-dist/tex/latex/exam-zh/exam-zh-symbols.sty +++ b/Master/texmf-dist/tex/latex/exam-zh/exam-zh-symbols.sty @@ -8,7 +8,7 @@ \RequirePackage{expl3} -\ProvidesExplPackage {exam-zh-symbols} {2022-07-28} {v0.1.13} +\ProvidesExplPackage {exam-zh-symbols} {2022-08-09} {v0.1.15} {exam-zh symbols module} \RequirePackage { tikz } @@ -17,6 +17,16 @@ { symbols .meta:nn = { exam-zh / symbols } {#1} } +% 正体的 e 和 i +\NewDocumentCommand \eu { } { \mathrm{ e } } +\NewDocumentCommand \upe { } { \mathrm{ e } } +\NewDocumentCommand \iu { } { \mathrm{ i } } +\NewDocumentCommand \upi { } { \mathrm{ i } } + +\NewDocumentCommand \uppi { } { \mathrm{ \pi } } + + + % 分数 \frac \dfrac \int_new:N \l__examzh_symbols_frac_numerator_str_int % frac 分子字符数 \int_new:N \l__examzh_symbols_frac_denominator_str_int % frac 分母字符数 diff --git a/Master/texmf-dist/tex/latex/exam-zh/exam-zh.cls b/Master/texmf-dist/tex/latex/exam-zh/exam-zh.cls index 7deb619de63..d9fc8090014 100644 --- a/Master/texmf-dist/tex/latex/exam-zh/exam-zh.cls +++ b/Master/texmf-dist/tex/latex/exam-zh/exam-zh.cls @@ -6,7 +6,7 @@ \NeedsTeXFormat{LaTeX2e}[2017/04/15] \RequirePackage{expl3} -\ProvidesExplClass {exam-zh} {2022-07-28} {v0.1.13} {LaTeX template for Chinese exam} +\ProvidesExplClass {exam-zh} {2022-08-09} {v0.1.15} {LaTeX template for Chinese exam} % 检查 LaTeX2e kernel 版本 \msg_new:nnn { exam-zh } { latex-too-old } @@ -29,7 +29,6 @@ - % 加载文档类和宏包 % 处理文档类选项 @@ -82,8 +81,8 @@ \usetikzlibrary { decorations.text } \ExplSyntaxOn -\RequirePackage { exam-zh-font } \RequirePackage { exam-zh-question } +\RequirePackage { exam-zh-font } \RequirePackage { exam-zh-choices } \RequirePackage { exam-zh-symbols } \RequirePackage { exam-zh-chinese-english } @@ -128,6 +127,9 @@ \examzh_package_conflict:nn { enumitem } { paralist } +% 生成函数变体 +\cs_generate_variant:Nn \tl_map_inline:nn { xn } + % 标点处理 \tl_const:Nn \c__examzh_fwid_full_stop_tl { ^^^^ff0e } @@ -778,10 +780,6 @@ } -% 正体的 e 和 i -\NewDocumentCommand \eu { } { \mathrm{ e } } -\NewDocumentCommand \iu { } { \mathrm{ i } } - % 兼容 siunitx v2.x 的一些命令 \AtEndOfPackageFile* { siunitx } @@ -995,7 +993,7 @@ text-xshift = 11mm, text-yshift = 0pt, text-width = 0.8\textheight, - text-format = \zihao{4}\sffamily, + text-format = \zihao{4}\sffamily\color{black}, text-xscale = 1.0, text-yscale = 0.8, text-direction-vertical = false, @@ -1025,7 +1023,7 @@ \AddToHook { shipout / firstpage } [ sealline ] { \put (0cm, 0cm) - { \__examzh_sealline_odd: } + { \color{black} \__examzh_sealline_odd: } } } % 只在第一页和最后一页出现 @@ -1034,12 +1032,13 @@ \AddToHook { shipout / firstpage } [ sealline ] { \put (0cm, 0cm) - { \__examzh_sealline_odd: } + { \color{black} \__examzh_sealline_odd: } } \AddToHook { shipout / lastpage } [ sealline ] { \put (0cm, 0cm) { + \color{black} \int_if_odd:nTF { \c@page } { \__examzh_sealline_odd: } { \__examzh_sealline_even: } @@ -1053,6 +1052,7 @@ { \put (0cm, 0cm) { + \color{black} \int_if_odd:nT { \c@page } { \__examzh_sealline_odd: } } @@ -1065,6 +1065,7 @@ { \put (0cm, 0cm) { + \color{black} \int_if_odd:nTF { \c@page } { \__examzh_sealline_odd: } { \__examzh_sealline_even: } @@ -1078,6 +1079,7 @@ { \put (0cm, 0cm) { + \color{black} \int_compare:nNnT { \int_mod:nn { \c@page } { 2 } } = {1} { \__examzh_sealline_odd: } } } @@ -1089,6 +1091,7 @@ { \put (0cm, 0cm) { + \color{black} \int_compare:nNnT { \int_mod:nn { \c@page } { 3 } } = {1} { \__examzh_sealline_odd: } } } @@ -1100,6 +1103,7 @@ { \put (0cm, 0cm) { + \color{black} \int_compare:nNnT { \int_mod:nn { \c@page } { 4 } } = {1} { \__examzh_sealline_odd: } } } @@ -1111,11 +1115,14 @@ { \put (0cm, 0cm) { + \color{black} \int_compare:nNnT { \int_mod:nn { \c@page } { 6 } } = {1} { \__examzh_sealline_odd: } } } } +% https://github.com/CTeX-org/ctex-kit/issues/632#issuecomment-1199675064 +\AddToHook{shipout/before}{\xeCJKShipoutHook} \AtBeginDocument { \__examzh_sealline_set: } @@ -1256,7 +1263,7 @@ \begin{tikzpicture} [ remember~picture, - overlay, + overlay ] % 密封线:线 \__examzh_sealline_odd_line: |