diff options
author | Karl Berry <karl@freefriends.org> | 2022-09-18 19:45:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-09-18 19:45:17 +0000 |
commit | 4edfb6788d8ab59568e86c853149d6eacd7f2ef2 (patch) | |
tree | 9d68970dfb64735db20b50aca06928e116c2193e | |
parent | 8c1f78ad1a590e86ae1e357a03ecfe9c8a00ad64 (diff) |
exam-zh (18sep22)
git-svn-id: svn://tug.org/texlive/trunk@64434 c570f23f-e606-0410-a88d-b1316a301751
16 files changed, 351 insertions, 131 deletions
diff --git a/Master/texmf-dist/doc/xelatex/exam-zh/CHANGELOG.md b/Master/texmf-dist/doc/xelatex/exam-zh/CHANGELOG.md index b4197df61e3..1fb88d27ec9 100644 --- a/Master/texmf-dist/doc/xelatex/exam-zh/CHANGELOG.md +++ b/Master/texmf-dist/doc/xelatex/exam-zh/CHANGELOG.md @@ -5,6 +5,29 @@ 格式参照 [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 并且此项目遵守 [Semantic Versioning](https://semver.org/spec/v2.0.0.html)。 +## [0.1.20] - 2022-09-18 + +### Added + +- 增加了 `textfigure/parindent` 键值 +- 增加 `exam-zh-textfigure` 模块对 `wrapstuff` 的检测 + +### Changed + +- 将 `question` 和 `problem` 的键值分开 + +### Removed + +- 去掉 `\goodluck` 命令 + + +## [0.1.20] - 2022-09-12 + +### Added + +- 增加页眉接口 + + ## [0.1.19] - 2022-08-27 ### Added 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 71e57ad21f1..f7968219366 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 @@ -1,5 +1,4 @@ % !TeX root = ../exam-zh-doc.tex - \section{使用说明} \subsection{基本用法} @@ -239,12 +238,12 @@ “绝密 $\bigstar$ 启用前”。格式命令默认为 |\bfseries|。 \end{function} -\begin{function}[updated = 2022-07-03]{\goodluck} - \begin{ccnusyntax}[emph={[1]goodluck}] - \goodluck(*\oarg{祝福语}*) - \end{ccnusyntax} - 祝福语命令。祝福语默认为 |祝考试顺利|。 -\end{function} +% \begin{function}[updated = 2022-07-03]{\goodluck} +% \begin{ccnusyntax}[emph={[1]goodluck}] +% \goodluck(*\oarg{祝福语}*) +% \end{ccnusyntax} +% 祝福语命令。祝福语默认为 |祝考试顺利|。 +% \end{function} \begin{function}[updated = 2022-07-26]{notice 环境} \begin{ccnusyntax}[emph={[2]notice}] @@ -989,7 +988,7 @@ \begin{function}{wrapstuff 环境} - \file{exam-zh-textfigure.sty} 模块默认加载 \pkg{wrapstuff} 宏包。具体 \env{wrapstuff} 环境使用请阅读手册。 + \file{exam-zh-textfigure.sty} 模块默认加载 \pkg{wrapstuff} 宏包,此宏包可以方便地实现图文绕排功能。此宏包是 \href{https://github.com/qinglee}{李清} 于 2022 年开发,如果使用的 \TeXLive 不是 2022 年版本的,则需要去项目主页手动 \href{https://github.com/qinglee/wrapstuff/releases}{下载发行版} 并安装。具体 \env{wrapstuff} 环境使用请阅读手册。 \end{function} @@ -1148,6 +1147,27 @@ 试卷尺寸。\opt{a4paper} 表示一页为 A4 纸大小;\opt{a3paper} 表示一页为 A3 纸大小,内容为连续两页 A4 拼接。此设置只能放在导言区。 \end{function} + +\begin{function}[added = 2022-09-12]{page/show-head} + \begin{ccnusyntax}[emph={[1]show-head}] + show-head = (*\TFF*) + \end{ccnusyntax} + 是否显示页眉。 +\end{function} + +\begin{function}[added = 2022-09-12]{page/head-content} + \begin{ccnusyntax}[emph={[1]foot-content}] + foot-content = (*\meta{页眉格式}*) + \end{ccnusyntax} + 页眉内容设置。内容为 \pkg{fancyhdr} 宏包的页眉命令,比如 +\begin{latexcode} + head-content = { + \fancyhead[ER, OL]{测试文本} + \fancyhead[C]{\includegraphics[height=1cm]{example-image.png}} + } +\end{latexcode} +\end{function} + \begin{function}[updated = 2022-07-24]{page/foot-type} \begin{ccnusyntax}[emph={[1]foot-type}] foot-type = (*<common|(separate)>*) @@ -1644,7 +1664,19 @@ question = (*\marg{键值列表}*) question/(*\meta{key}*) = (*\meta{value}*) \end{ccnusyntax} - 该选项包含许多子项目,用于设置题干。具体内容见下。 + 该选项包含许多子项目,用于设置 \env{question} 环境。具体内容见下。 +\end{function} + +\begin{function}[added = 2022-09-18]{problem} + \begin{ccnusyntax}[emph={[1]problem}] + problem = (*\marg{键值列表}*) + problem/(*\meta{key}*) = (*\meta{value}*) + \end{ccnusyntax} + 该选项包含许多子项目,用于设置 \env{problem} 环境。具体内容和下面所述的 \opt{question/} 类的键值基本相同,除了有以下区别:\env{problem} 环境 + \begin{enumerate} + \item 没有 \opt{combine-fillin} 和 \opt{combine-fillin-args} 键 + \item 没有 \opt{hang} 键 + \end{enumerate} \end{function} @@ -1750,7 +1782,7 @@ \begin{function}[added = 2022-08-12]{question/hang} \begin{ccnusyntax}[emph={[1]hang}] - combine-fillin = (*\TTF*) + hang = (*\TTF*) \end{ccnusyntax} \env{question} 环境是否是“悬挂效果”。 \end{function} @@ -1770,6 +1802,14 @@ } +\begin{function}[added = 2022-09-18]{question/points-prelabel,question/points-postlabel} + \begin{ccnusyntax}[emph={[1]points-prelabel,points-postlabel}] + points-prelabel = (*\meta{points 前面的内容}*) + points-postlabel = (*\meta{points 后面的内容}*) + \end{ccnusyntax} + \env{question} 环境的 \opt{points} 键值的显示前后内容设置,\opt{points-prelabel} 默认为 |(|,\opt{points-postlabel} 默认为 |分)|,即默认为 |(2分)| 效果。 +\end{function} + \subsubsection{选择题} \label{subsubsec:参数-选择题} \begin{function}{choices} @@ -2922,4 +2962,11 @@ top = (*\meta{integer}*) \end{ccnusyntax} \kvopt{fig-pos}{left-top} 时,图片顶部从文本的第几行开始排,效果和 \pkg{wrapstuff} 宏包的 \opt{top} 键值效果类似。 +\end{function} + +\begin{function}[added = 2022-09-18]{textfigure/parindent} + \begin{ccnusyntax}[emph={[1]parindent}] + parindent = (*\meta{dimension}*) + \end{ccnusyntax} + 文本部分的缩进长度,默认为 |2em|。 \end{function}
\ No newline at end of file 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 e0a12cc4027..d44f20d8a66 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 @@ -33,7 +33,7 @@ \title{\textcolor{MaterialIndigo800}{% \textbf{exam-zh: 高考试卷 \LaTeX \xpinyin[font=\sffamily,format=\color{MaterialIndigo800}]{模}{mu2}板}}} \author{李泽平,夏康玮,郭李军} -\date{2022/08/28\quad v0.1.19% +\date{\DocDate\quad \DocVersion% \thanks{% \url{https://gitee.com/xkwxdyy/exam-zh} } 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 b3732b8ebc8..9eea3d04811 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/doc/xelatex/exam-zh/doc/exam-zh-doc.tex b/Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc.tex index 956a94c3df8..e9362101e30 100644 --- a/Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc.tex +++ b/Master/texmf-dist/doc/xelatex/exam-zh/doc/exam-zh-doc.tex @@ -1,4 +1,7 @@ \documentclass{xdyydoc} + +\newcommand{\DocDate}{2022-9-18} +\newcommand{\DocVersion}{v0.1.20} \input{exam-zh-doc-setup.tex} \usepackage{amssymb} diff --git a/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-multiple.pdf b/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-multiple.pdf Binary files differindex 917fbee4302..36f483c7446 100644 --- a/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-multiple.pdf +++ b/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-multiple.pdf diff --git a/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-multiple.tex b/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-multiple.tex index 94c5471205e..b0b75c7f0ee 100644 --- a/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-multiple.tex +++ b/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-multiple.tex @@ -62,7 +62,7 @@ 本试卷共 4 页,22 题。全卷满分 150 分。考试用时 120 分钟。 -\goodluck + \begin{notice} \item 答题前,先将自己的姓名、准考证号、考场号、座位号填写在试卷和答题卡上, @@ -379,7 +379,7 @@ 本试卷共 4 页,22 题。全卷满分 150 分。考试用时 120 分钟。 -\goodluck + \begin{notice} \item 答题前,先将自己的姓名、准考证号、考场号、座位号填写在试卷和答题卡上, diff --git a/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-single.pdf b/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-single.pdf Binary files differindex 358ed541966..a49160b31e0 100644 --- a/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-single.pdf +++ b/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-single.pdf diff --git a/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-single.tex b/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-single.tex index d70cb9ae92d..f57cd8d3462 100644 --- a/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-single.tex +++ b/Master/texmf-dist/doc/xelatex/exam-zh/examples/example-single.tex @@ -6,7 +6,7 @@ paren/show-paren=true, paren/show-answer=false, fillin/show-answer=false, - solution/show-solution=false, + solution/show-solution=false } \ExamPrintAnswerSet{ @@ -40,7 +40,6 @@ 本试卷共 4 页,22 题。全卷满分 150 分。考试用时 120 分钟。 -\goodluck \begin{notice} \item 答题前,先将自己的姓名、准考证号、考场号、座位号填写在试卷和答题卡上, 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 eefffdac7d4..5ac358950d1 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-08-28} {v0.1.19} +\ProvidesExplPackage {exam-zh-chinese-english} {2022-9-18} {v0.1.20} {exam-zh chinese and english module} \PassOptionsToPackage { tcolorbox } { most } 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 05f66871c3a..07a4f106ae4 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-08-28} {v0.1.19} +\ProvidesExplPackage {exam-zh-choices} {2022-9-18} {v0.1.20} {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 76f943de1df..a63484a7dfd 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,7 +9,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {exam-zh-font} {2022-08-28} {v0.1.19} +\ProvidesExplPackage {exam-zh-font} {2022-9-18} {v0.1.20} {exam-zh font module} \RequirePackage { unicode-math } 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 9afcba5f7b1..dd9d76609e7 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,7 +9,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {exam-zh-question} {2022-08-28} {v0.1.19} +\ProvidesExplPackage {exam-zh-question} {2022-9-18} {v0.1.20} {exam-zh question module} @@ -74,6 +74,8 @@ \keys_define:nn { exam-zh } { question .meta:nn = { exam-zh / question } {#1} } +\keys_define:nn { exam-zh } + { problem .meta:nn = { exam-zh / problem } {#1} } \keys_define:nn { exam-zh / question } @@ -122,8 +124,11 @@ { left, center, right } { \tl_set_eq:NN \l__examzh_question_label_align_tl \l_keys_choice_tl }, hang .bool_set:N = \l__examzh_question_hang_bool, + points-prelabel .tl_set:N = \l__examzh_question_points_prelabel_tl, + points-postlabel .tl_set:N = \l__examzh_question_points_postlabel_tl, } + \keys_set:nn { exam-zh / question } { index = 1, @@ -136,10 +141,72 @@ label = \arabic*., combine-fillin = false, label-align = right, - hang = true + hang = true, + points-prelabel = {(}, + points-postlabel = {分)} } +\keys_define:nn { exam-zh / problem } + { + % 手动调整 question 环境的计数器 + index .int_gset:N = \g__examzh_question_index_int , + % 分数 + points .int_set:N = \l__examzh_question_points_int , + % 分数显示控制 + show-points .choice: , + show-points / auto .code:n = + { \bool_set_true:N \l__examzh_question_show_points_auto_bool } , + show-points / true .code:n = + { + \bool_set_true:N \l__examzh_question_show_points_bool + \bool_set_false:N \l__examzh_question_show_points_auto_bool + } , + show-points / false .code:n = + { + \bool_set_false:N \l__examzh_question_show_points_bool + \bool_set_false:N \l__examzh_question_show_points_auto_bool + } , + % 分数是否单独成段 + points-separate-par .bool_set:N = \l__examzh_problem_points_separate_par_bool, + % 是否显示答案 + % show-answer .bool_set:N = \l__examzh_question_show_answer_bool , + show-answer .choice: , + show-answer / true .code:n = + { + \bool_set_true:N \l__examzh_question_show_fillin_answer_bool + \bool_set_true:N \l__examzh_question_show_paren_answer_bool + }, + show-answer / false .code:n = + { + \bool_set_false:N \l__examzh_question_show_fillin_answer_bool + \bool_set_false:N \l__examzh_question_show_paren_answer_bool + }, + % 上方间距 + top-sep .skip_set:N = \l__examzh_problem_top_sep_skip , + % 下方间距 + bottom-sep .skip_set:N = \l__examzh_problem_bottom_sep_skip , + label .tl_set:N = \l__examzh_question_label_tl, + label-align .choices:nn = + { left, center, right } + { \tl_set_eq:NN \l__examzh_question_label_align_tl \l_keys_choice_tl }, + points-prelabel .tl_set:N = \l__examzh_problem_points_prelabel_tl, + points-postlabel .tl_set:N = \l__examzh_problem_points_postlabel_tl, + } +\keys_set:nn { exam-zh / problem } + { + index = 1, + points = 0 , + show-points = auto , + points-separate-par = true , + show-answer = false , + top-sep = .25em plus .25em minus .1em , + bottom-sep = .25em plus .25em minus .1em , + label = \arabic*., + label-align = right, + points-prelabel = {(}, + points-postlabel = {分)} + } % 是否按照解答题的格式排版 \bool_new:N \l__examzh_question_problem_style_bool @@ -157,18 +224,14 @@ \NewDocumentEnvironment { problem } { O { } +b } { \bool_set_true:N \l__examzh_question_problem_style_bool - \__examzh_question_begin:nn {#1}{#2} + \__examzh_problem_begin:nn {#1}{#2} } - { \__examzh_question_end:nn {#1}{#2} } + { \__examzh_problem_end:nn {#1}{#2} } \prg_generate_conditional_variant:Nnn \int_compare:nNn { xNn } { T } \cs_new:Npn \__examzh_question_begin:nn #1#2 { \par - % 根据是否按解答题方式排版来设置是否分数要分段 - \bool_if:NTF \l__examzh_question_problem_style_bool - { \keys_set:nn { exam-zh / question } { points-separate-par = true } } - { \keys_set:nn { exam-zh / question } { points-separate-par = false } } % \bool_if:NTF \l__examzh_question_combine_fillin_bool % { \keys_set:nn { exam-zh / question } { label-align = left } } % { \keys_set:nn { exam-zh / question } { label-align = right } } @@ -194,9 +257,7 @@ % 而解答题不太一样 \bool_if:NT \l__examzh_question_show_points_auto_bool { - \bool_if:NTF \l__examzh_question_problem_style_bool - { \bool_set_true:N \l__examzh_question_show_points_bool } - { \bool_set_false:N \l__examzh_question_show_points_bool } + \bool_set_false:N \l__examzh_question_show_points_bool } % 使用列表环境输出 \list @@ -233,33 +294,33 @@ \__examzh_question_begin_fillin_type_set: \__examzh_question_begin_labelsep_labelwidth_set: % \group_end: - \bool_if:NTF \l__examzh_question_problem_style_bool - { - % 解答题是正文 + 缩进 2em 的效果 - \bool_if:NTF \l__examzh_question_combine_fillin_bool - { - % 如果 combine 的话就和 question 一样的缩进 - \bool_if:NTF \l__examzh_question_hang_bool - { \dim_gset:Nn \itemindent { 0em } } - { \dim_gset:Nn \itemindent { 2em } } - \bool_if:NTF \l__examzh_question_combine_fillin_bool - { - \bool_if:NTF \l__examzh_question_hang_bool - { \dim_gset:Nn \leftmargin { 6em } } - { \dim_gset:Nn \leftmargin { 4em } } - } - { - \bool_if:NTF \l__examzh_question_hang_bool - { \dim_gset:Nn \leftmargin { 2em } } - { \dim_gset:Nn \leftmargin { 0em } } - } - } - { - \dim_gset:Nn \leftmargin { 0pt } - \dim_gset:Nn \itemindent { 2em } - } - } - { + % \bool_if:NTF \l__examzh_question_problem_style_bool + % { + % % 解答题是正文 + 缩进 2em 的效果 + % \bool_if:NTF \l__examzh_question_combine_fillin_bool + % { + % % 如果 combine 的话就和 question 一样的缩进 + % \bool_if:NTF \l__examzh_question_hang_bool + % { \dim_gset:Nn \itemindent { 0em } } + % { \dim_gset:Nn \itemindent { 2em } } + % \bool_if:NTF \l__examzh_question_combine_fillin_bool + % { + % \bool_if:NTF \l__examzh_question_hang_bool + % { \dim_gset:Nn \leftmargin { 6em } } + % { \dim_gset:Nn \leftmargin { 4em } } + % } + % { + % \bool_if:NTF \l__examzh_question_hang_bool + % { \dim_gset:Nn \leftmargin { 2em } } + % { \dim_gset:Nn \leftmargin { 0em } } + % } + % } + % { + % \dim_gset:Nn \leftmargin { 0pt } + % \dim_gset:Nn \itemindent { 2em } + % } + % } + % { % 选择和填空题是悬挂效果 \bool_if:NTF \l__examzh_question_hang_bool { \dim_gset:Nn \itemindent { 0em } } @@ -275,7 +336,7 @@ { \dim_gset:Nn \leftmargin { 2em } } { \dim_gset:Nn \leftmargin { 0em } } } - } + % } \dim_gset_eq:NN \listparindent \itemindent \group_end: } @@ -285,7 +346,7 @@ { % 如果设置了分数且 show-points 的 bool 是 true 的话就显示 \int_compare:nNnT { \l__examzh_question_points_int } > { 0 } - { ( \int_use:N \l__examzh_question_points_int ~ 分 ) } + { \l__examzh_question_points_prelabel_tl \int_use:N \l__examzh_question_points_int ~ \l__examzh_question_points_postlabel_tl } % 是否分段(解答题需要分段) \bool_if:NT \l__examzh_question_points_separate_par_bool % \par 分段之后使用 \nopagebreak 避免分页导致序号和分数出现在页面最后一行 @@ -402,6 +463,87 @@ \vspace { \l__examzh_question_bottom_sep_skip } } +\cs_new:Npn \__examzh_problem_begin:nn #1#2 + { + \par + % \bool_if:NTF \l__examzh_question_combine_fillin_bool + % { \keys_set:nn { exam-zh / question } { label-align = left } } + % { \keys_set:nn { exam-zh / question } { label-align = right } } + % 设置键值 + \keys_set:nn { exam-zh / problem } { #1 } + % 题干计数器的值加一 + \int_gincr:N \g__examzh_question_index_int + % 设置上方间距 + % \addvspace { \l__examzh_question_top_sep_skip } + \vspace { \l__examzh_problem_top_sep_skip } + % 严格禁止孤行和寡行 + \int_set:Nn \clubpenalty { 10000 } + \int_set:Nn \widowpenalty { 10000 } + % 尽量避免在题目中间换行 + \int_set:Nn \interlinepenalty { 301 } + % 这部分是仿照 source2e 中 enumerate 的定义写的 + % \@enumdepth 主要控制 enumerate 不同层级的编号 + % 这样设置后,在 problem 中使用 enumerate 会调用 level 2 的编号 + % 也就是 question 中的 enumerate 环境直接从第二层开始 + \int_incr:N \@enumdepth + % 如果 show-points = auto 那么解答题显示分数,选择题和填空题不显示分数 + % 这样设置考虑到选择题和填空题都是每道题一样的分数,在最开始的地方说明即可 + % 而解答题不太一样 + \bool_if:NT \l__examzh_question_show_points_auto_bool + { + \bool_set_true:N \l__examzh_question_show_points_bool + } + % 使用列表环境输出 + \list + { + % \int_use:N \g__examzh_question_index_int . + \__examzh_question_make_label:n + { + \__examzh_question_the_label: + } + } + { + % 用 group 是为了防止 combine-fillin 的 type 影响了环境里面的 fillin 的type + \group_begin: + \dim_gset:Nn \topsep { 0pt } + \dim_gset:Nn \partopsep { 0pt } + \dim_gset:Nn \itemsep { 0pt } + \dim_gset:Nn \parsep { 0pt } + % \group_begin: + % 上面 \fillin 里面的设置是局部的,这样的问题是 question 的可选参数改 type 的时候不会影响 \l__examzh_fillin_type_str 的值 + % 所以要把 \l__examzh_question_combine_fillin_args_tl 里关于 type 的选取出来 + \__examzh_question_begin_fillin_type_set: + \__examzh_question_begin_labelsep_labelwidth_set: + % \group_end: + \dim_gset:Nn \leftmargin { 0pt } + \dim_gset:Nn \itemindent { 2em } + \dim_gset_eq:NN \listparindent \itemindent + \group_end: + } + \item \relax + % 输出题目分数 + \bool_if:NT \l__examzh_question_show_points_bool + { + % 如果设置了分数且 show-points 的 bool 是 true 的话就显示 + \int_compare:nNnT { \l__examzh_question_points_int } > { 0 } + { \l__examzh_problem_points_prelabel_tl \int_use:N \l__examzh_question_points_int ~ \l__examzh_problem_points_postlabel_tl } + % 是否分段(解答题需要分段) + \bool_if:NT \l__examzh_problem_points_separate_par_bool + % \par 分段之后使用 \nopagebreak 避免分页导致序号和分数出现在页面最后一行 + { \par \nopagebreak } + } + } + +\cs_new:Npn \__examzh_problem_end:nn #1#2 + { + #2 + % 结束列表环境 + \endlist + % 增加下方间距 + % \addvspace { \l__examzh_question_bottom_sep_skip } + \vspace { \l__examzh_problem_bottom_sep_skip } + } + % 处理 question / problem 的 label \tl_new:N \l__examzh_question_counters_commands_set_tl 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 37115aa5a8b..8d46aa977f8 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-08-28} {v0.1.19} +\ProvidesExplPackage {exam-zh-symbols} {2022-9-18} {v0.1.20} {exam-zh symbols module} \RequirePackage { tikz } diff --git a/Master/texmf-dist/tex/latex/exam-zh/exam-zh-textfigure.sty b/Master/texmf-dist/tex/latex/exam-zh/exam-zh-textfigure.sty index 77a98eb0ba1..f42e3ec7397 100644 --- a/Master/texmf-dist/tex/latex/exam-zh/exam-zh-textfigure.sty +++ b/Master/texmf-dist/tex/latex/exam-zh/exam-zh-textfigure.sty @@ -7,21 +7,25 @@ \RequirePackage{expl3} -\ProvidesExplPackage {exam-zh-textfigure} {2022-08-28} {v0.1.19} +\ProvidesExplPackage {exam-zh-textfigure} {2022-9-18} {v0.1.20} {exam-zh text with figure module} -\RequirePackage { wrapstuff } + \RequirePackage { tabularray } \RequirePackage { varwidth } \RequirePackage { graphicx } \RequirePackage { filehook } - -\AtEndOfPackageFile* { exam-zh-choices } +\file_if_exist:nT { wrapstuff.sty } { - \AddToHook { env / choices / before } - { \wrapstuffclear } + \RequirePackage { wrapstuff } + \AtEndOfPackageFile* { exam-zh-choices } + { + \AddToHook { env / choices / before } + { \wrapstuffclear } + } } + %% multifigures 环境,排版多张图片 %% % \begin{multifigures} @@ -365,7 +369,8 @@ % 环境下方的额外距离 bottom-sep .skip_set:N = \l__examzh_textfigure_bottom_sep_skip, % 类似于 wrapstuff 的 top - top .int_set:N = \l__examzh_textfigure_top_int + top .int_set:N = \l__examzh_textfigure_top_int, + parindent .dim_set:N = \l__examzh_textfigure_text_parindent_dim } \keys_set:nn { exam-zh / textfigure } @@ -377,7 +382,8 @@ text-ratio = 0.95, top-sep = 0pt, bottom-sep = 1.5ex plus .5ex minus 0.5ex, - top = 0 + top = 0, + parindent = 2em } @@ -455,7 +461,7 @@ \hcoffin_set:Nn \l__examzh_textfigure_text_coffin { \begin{varwidth}{ \l__examzh_textfigure_text_width_dim } - \dim_set:Nn \parindent {2em} + \dim_set:Nn \parindent { \l__examzh_textfigure_text_parindent_dim } \ignorespaces #1 \unskip 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 3f98de7858d..12e450141d9 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-08-28} {v0.1.19} {LaTeX template for Chinese exam} +\ProvidesExplClass {exam-zh} {2022-9-18} {v0.1.20} {LaTeX template for Chinese exam} % 检查 LaTeX2e kernel 版本 \msg_new:nnn { exam-zh } { latex-too-old } @@ -719,20 +719,6 @@ \par } -% 祝考试顺利 -\NewDocumentCommand \goodluck { O{祝考试顺利} } - { - \group_begin: - \centering - \examzh_if_defined:NTF \lishu - { \lishu } - { \bfseries } - \Large - $\bigstar$ #1 $\bigstar$ - \par - \group_end: - } - % 注意事项环境 notice \keys_define:nn { exam-zh / notice } @@ -1224,6 +1210,7 @@ margin = 1in, inner = 1.3in, outer = 0.8in, + headheight = 0.7in } } { @@ -1232,6 +1219,7 @@ { paper = a4paper, margin = 1in, + headheight = 0.7in } } } @@ -1252,6 +1240,7 @@ margin = 1in, inner = 1.2in, outer = 0.8in, + headheight = 0.7in % showframe } } @@ -1264,6 +1253,7 @@ twocolumn, columnsep = 30mm, margin = 1in, + headheight = 0.7in } } } @@ -1589,13 +1579,16 @@ \keys_define:nn { exam-zh / page } { + show-head .bool_set:N = \l__examzh_show_head_bool, show-foot .bool_set:N = \l__examzh_show_foot_bool, + head-content .tl_set:N = \l__examzh_head_content_tl, foot-content .tl_set:N = \l__examzh_foot_content_format_tl % foo, bar: foo <page> bar % foo, bar, baz: foo <page> bar <lastpage> baz } \keys_set:nn { exam-zh / page } { + show-head = false, show-foot = true, foot-content = {数学试题第;页(共~;页)} } @@ -1778,74 +1771,81 @@ } -\fancypagestyle { plain } +\AtEndPreamble { - \fancyhf { } - \bool_if:cTF { g__examzh_page_size_a4paper_bool } + \fancypagestyle { plain } { - % a4paper - \bool_if:NT \l__examzh_show_foot_bool + \fancyhf { } + \bool_if:NT \l__examzh_show_head_bool { - \fancyfoot [ C ] - { - \small - \use:c { __examzh_foot_content_a4paper_output: } - % \l__exam_zh_subject_tl 试题第 \thepage { } 页(共 \pageref { LastPage } ~ 页) - } + \l__examzh_head_content_tl } - } - { - % a3paper - \bool_if:NT \l__examzh_show_foot_bool + \bool_if:cTF { g__examzh_page_size_a4paper_bool } { - \bool_if:cTF - { g__examzh_page_a3paper_foot_common_bool } + % a4paper + \bool_if:NT \l__examzh_show_foot_bool { - % 两页共用一个页脚 \fancyfoot [ C ] { \small + \use:c { __examzh_foot_content_a4paper_output: } % \l__exam_zh_subject_tl 试题第 \thepage { } 页(共 \pageref { LastPage } ~ 页) - \use:c { __examzh_foot_content_a3paper_common_output: } } } + } + { + % a3paper + \bool_if:NT \l__examzh_show_foot_bool { - % 每页一个页脚 - \fancyfoot [ L ] + \bool_if:cTF + { g__examzh_page_a3paper_foot_common_bool } { - \__examzh_column_box:n + % 两页共用一个页脚 + \fancyfoot [ C ] { \small - \use:c { __examzh_foot_content_a3paper_separate_left_output: } - % \l__exam_zh_subject_tl 试题第 - % % \thepage - % \int_eval:n { 2 * \c@page - 1 } - % { } 页 - % (共 - % % \pageref { LastPage } - % \int_eval:n { 2 * \l__examzh_tmp_int } - % ~ 页) - % \use:c { l__examzh_foot_content_a3paper_left_tl } + % \l__exam_zh_subject_tl 试题第 \thepage { } 页(共 \pageref { LastPage } ~ 页) + \use:c { __examzh_foot_content_a3paper_common_output: } } } - \fancyfoot [ R ] { - \__examzh_column_box:n + % 每页一个页脚 + \fancyfoot [ L ] { - \small - \use:c { __examzh_foot_content_a3paper_separate_right_output: } - % % \int_gincr:N \c@page - % \int_set:Nn \l__examzh_tmp_int { \lastpage@lastpage } - - % \l__exam_zh_subject_tl 试题第 - % \int_eval:n { 2 * \c@page } - % { } - % 页 - % (共 - % % \pageref { LastPage } - % \int_eval:n { 2 * \l__examzh_tmp_int } - % ~ 页) - % % \use:c { l__examzh_foot_content_a3paper_right_tl } + \__examzh_column_box:n + { + \small + \use:c { __examzh_foot_content_a3paper_separate_left_output: } + % \l__exam_zh_subject_tl 试题第 + % % \thepage + % \int_eval:n { 2 * \c@page - 1 } + % { } 页 + % (共 + % % \pageref { LastPage } + % \int_eval:n { 2 * \l__examzh_tmp_int } + % ~ 页) + % \use:c { l__examzh_foot_content_a3paper_left_tl } + } + } + \fancyfoot [ R ] + { + \__examzh_column_box:n + { + \small + \use:c { __examzh_foot_content_a3paper_separate_right_output: } + % % \int_gincr:N \c@page + % \int_set:Nn \l__examzh_tmp_int { \lastpage@lastpage } + + % \l__exam_zh_subject_tl 试题第 + % \int_eval:n { 2 * \c@page } + % { } + % 页 + % (共 + % % \pageref { LastPage } + % \int_eval:n { 2 * \l__examzh_tmp_int } + % ~ 页) + % % \use:c { l__examzh_foot_content_a3paper_right_tl } + } } } } |