diff options
author | Norbert Preining <norbert@preining.info> | 2024-02-12 03:02:04 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-02-12 03:02:04 +0000 |
commit | 275a181f003d2af5b7d9ca34f2b15f6511b3ea29 (patch) | |
tree | 1be7d2ce2d1defcfd5cb3a856708e7a6b4968a28 /macros | |
parent | 67c0d9d706bb2de18260161a21ed2c01d11f0a4e (diff) |
CTAN sync 202402120302
Diffstat (limited to 'macros')
26 files changed, 1159 insertions, 217 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index fb12b1d6d1..8124d21bad 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -15,7 +15,7 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2021/11/15] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2024/02/08}{2024z} +\ProvidesExplClass{easybook}{2024/02/11}{2024ab} {Easily typesetting Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -297,7 +297,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2021/11/15] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2024/02/08}{2024z} +\ProvidesExplPackage{easybase}{2024/02/11}{2024ab} {Easily typesetting Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -738,18 +738,42 @@ { \ding{\int_eval:n { 191 + #1 }} } \cs_new_protected:Npn \eb_fnmarktext_counter_pisans_neg:N #1 { \ding{\int_eval:n { 201 + #1 }} } -\cs_new_protected:Npn \DefineFntSymbols #1#2#3 +\cs_new:Npn \eb_fnt_map_symbols_list:n #1 + { + \eb_fnt_map_symbols_list:nn #1 + \q_recursion_tail \q_recursion_tail + \q_recursion_stop + } +\cs_new:Npn \eb_fnt_map_symbols_list:nn #1#2 + { + \quark_if_recursion_tail_stop:n {#1} + \quark_if_recursion_tail_stop:n {#2} + { #1 + \int_use:N \c@footnote } {#2} + \eb_fnt_map_symbols_list:nn + } +\cs_new_protected:Npn \SetFntSymbsList #1#2#3 { \cs_set_protected:cpn { eb@use@fnt@symbol@#1 } { - \cs_set:Npn \eb_int_to_symbols:n ####1 - { \int_to_symbols:nnn {####1} {#2} {#3} } + \cs_set:Npx \eb_int_to_symbols:n ####1 + { + \exp_not:N \int_to_symbols:nnn {####1} + { #2 + \int_use:N \c@footnote } + { \eb_fnt_map_symbols_list:n {#3} } + } } } -\cs_new_protected:Npn \setfntsymbol #1 - { \use:c { eb@use@fnt@symbol@#1 } } -\DefineFntSymbols{empty}{1}{} -\setfntsymbol{empty} +\cs_new_protected:Npn \UseFntSymbsList #1 + { + \cs_if_exist_use:cF { eb@use@fnt@symbol@#1 } + { \msg_warning:nnn { easybase } { undefined-fntsymbol } {#1} } + } +\msg_new:nnn { easybase } { undefined-fntsymbol } + { The~list~of~footnote~symbols~'#1'~isn't~defined. } +\SetFntSymbsList{empty}{1}{} +\UseFntSymbsList{empty} +\cs_set_eq:NN \DefineFntSymbols \SetFntSymbsList +\cs_set_eq:NN \setfntsymbol \UseFntSymbsList \cs_new:Npn \eb_int_format_trans:NN #1 { \str_case:nn {#1} @@ -846,13 +870,13 @@ \clist_new:N \l__eb_footnote_value_clist \ctex_define:nn { hdrset } { - fnfirstindent .dim_set:N = \fnfirstindent, - fnfirstindent .initial:n = 0.8em, - fnafterindent .dim_set:N = \fnafterindent, + fnfirstindent .tl_set:N = \fnfirstindent, + fnfirstindent .initial:n = 1em, + fnafterindent .tl_set:N = \fnafterindent, fnafterindent .initial:n = 2em, - fnparskip .skip_set:N = \fnparskip, + fnparskip .tl_set:N = \fnparskip, fnparskip .initial:n = 0ex plus .1ex, - footnotesep .skip_set:N = \footnotesep, + footnotesep .dim_set:N = \footnotesep, fnpara-format .tl_set:N = \l__eb_fnpara_format_tl, fntext-pos .tl_set:N = \l__eb_fntext_position_tl, fntext-pos .initial:n = super, @@ -1478,7 +1502,7 @@ \tl_use:c { l__eb_toc_#1_after_tl } } } -\cs_new_protected:Npn \eb@toc@format@define #1 +\cs_new_protected:Npn \eb_toc_format_define:n #1 { \ctex_define:n { @@ -1492,7 +1516,7 @@ #1/tocbelow .tl_set:c = l__eb_toc_#1_below_tl } } -\cs_new_protected:Npn \eb@toc@format@initial #1 +\cs_new_protected:Npn \eb_toc_format_initial:n #1 { \titlecontents{#1} [\dim_use:c { l__eb_toc_#1_indent_dim }] @@ -1509,8 +1533,8 @@ } \cs_new_protected:Npn \RegisterTocName #1 { - \eb@toc@format@define{#1} - \eb@toc@format@initial{#1} + \eb_toc_format_define:n {#1} + \eb_toc_format_initial:n {#1} } \seq_map_function:NN \c__ctex_headings_seq \RegisterTocName @@ -1583,12 +1607,12 @@ \cs_set_eq:NN \eb@ctexsetii \ctex_set:nn \cs_new_protected:Npn \SetTocStyle #1#2#3 { - \tl_set:cn { eb@toc@style@set@#1@#2 } + \cs_set:cpn { eb@toc@style@set@#1@#2 } { \eb@ctexsetii{#1}{#3} } } \cs_new_protected:Npn \UseTocStyle #1#2#3 { - \tl_if_exist:cTF { eb@toc@style@set@#1@#2 } + \cs_if_exist:cTF { eb@toc@style@set@#1@#2 } { \addtocontents{#3}{\@nameuse{eb@toc@style@set@#1@#2}} } { \msg_warning:nnnn { easybase } { undefined-toc-style } {#2} {#1} } } @@ -2319,7 +2343,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2024/02/08}{2024z} +\ProvidesExplFile{eb-tcolorbox.cfg}{2024/02/11}{2024ab} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \addtotcbstyle #1#2 diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf Binary files differindex 09c0e1911b..06127742ca 100644 --- a/macros/latex/contrib/easybook/easybook.pdf +++ b/macros/latex/contrib/easybook/easybook.pdf diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex index f22b361a7d..0d4867eaa7 100644 --- a/macros/latex/contrib/easybook/easybook.tex +++ b/macros/latex/contrib/easybook/easybook.tex @@ -23,8 +23,8 @@ name = easybook, color-scheme = blue, title = EASYBOOK使用手册, - version = v2024z, - date = 2024/02/08, + version = v2024ab, + date = 2024/02/11, authors = 瞿毅, info = 简便地排版中文学位论文或书籍, email = toquyi@163.com, @@ -466,7 +466,7 @@ \keyval{caption-every}{数值}\Default{1.2} 同时设置图片、表格和代码题注的行距因子。 \keyval{footnote}{数值}\Default{1.2} - 脚注内容整体的行距因子。可以使用 \option{fnpara-format} 的代码覆盖每个脚注单独的行距,从而与不同脚注的段落间距不同\footnote{若在正文区中更改脚注行距,脚注横线下方的间距不会随当前行距改变。}。 + 脚注内容整体的行距因子。可以使用 \module*{hdrset} 模块 \option{fnpara-format} 选项的代码单独覆盖每个脚注的行距,从而使脚注间和内容文本自身的行距不同。 \begin{ctexexam} \ebspread{footnote = 1.3} \ebhdrset{fnpara-format = \linespread{1.2}\selectfont} @@ -701,13 +701,13 @@ \ebhdrset{footnotetype = plain,footnotetype = bottom} \ebhdrset{footnotetype = {hang,bottom}} \end{ctexexam} - \keyval{fnfirstindent}{刚性长度}\Default{0.8em} + \keyval{fnfirstindent}{刚性长度}\Default{1em} 每个脚注首段的首行缩进(悬挂缩进 \code{hang} 为整段缩进),等于长度 \cs{fnfirstindent} 的值。 \keyval{fnafterindent}{刚性长度}\Default{2em} 每个脚注第二段及之后段落的首行缩进,等于长度 \cs{fnafterindent} 的值。 \keyval{fnparskip}{弹性长度}\Default{0ex plus .1ex} 不同脚注自身的段落间距,脚注内容文本分段时生效,等于长度 \cs{fnparskip} 的值。 - \keyval{footnotesep}{弹性长度}\newtag% + \keyval{footnotesep}{刚性长度}\newtag% 不同脚注之间的距离,默认情况下它自适应 \module*{spread} 模块脚注行距选项 \option{footnote} 的值。 \keychoice{fntext-pos}{normal,\fbox{super}} 设置脚注内容标记的位置,正常文本或是上标形式。 @@ -724,12 +724,12 @@ \ebhdrset{fnmark-num = (a)} \end{ctexexam} \begin{commands}\noitemsep - \command{DefineFntSymbols}[\marg{符号表名}\marg{符号数量}\marg{符号列表}]\default{} - \command{setfntsymbol}[\marg{符号表名}] - 这两个命令用于在脚注短编号标记为 \code{s} 自定义符号型时设置符号列表。\cs{DefineFntSymbols} 命令用于设置符号列表,\cs{setfntsymbol} 命令用于选择已定义的符号列表。默认的脚注符号列表是空的,定义新列表时应注意 \meta{符号列表} 的写法和命令顺序: + \command{SetFntSymbsList}[\marg{符号表名}\marg{符号数量}\marg{符号列表}]\default{} + \command{UseFntSymbsList}[\marg{符号表名}]\newtag[Chg]% + 这两个命令用于在脚注短编号标记为 \code{s} 自定义符号型时设置符号列表。\cs{SetFntSymbsList} 命令用于定义名为 \meta{符号表名} 的符号列表,\cs{UseFntSymbsList} 命令用于启用已定义的符号列表。默认的脚注符号列表是空的,注意使用符号型脚注时计数器 \code{footnote} 的值仍然是递增的,以及定义新列表时 \meta{符号列表} 的写法和命令顺序: \begin{ctexexam} - \DefineFntSymbols{fancy}{2}{{1}{*}{2}{@}} - \setfntsymbol{fancy} + \SetFntSymbsList{fancy}{2}{{1}{*}{2}{\P}} + \UseFntSymbsList{fancy} \ebhdrset{fnmark-num = s} \end{ctexexam} \end{commands} @@ -1352,7 +1352,7 @@ \shortversion{v = 1.638,date = 2022/03/04,changes = 增加目录条目样式选项注册命令 \cs{RegisterTocName}。} \shortversion{v = 1.644,date = 2022/03/10,changes = 增加浮动环境目录声明命令 \cs{DeclareFloatList} 配合 \pkg*{caption} 宏包。} \shortversion{v = 1.682,date = 2022/05/01,changes = 将迷你页判断命令 \cs{notminipage} 改为被保护命令兼容 \pkg*{circledtext} 宏包。} - \begin{version}[v = 2024z,date = 2024/02/08,simple] + \begin{version}[v = 2024ab,date = 2024/02/11,simple] \item 核对依赖宏包的更新改动,优化使用手册的内容细节。 \item 修复图表等浮动环境题注目录中条目标签编号的计数器值显示错误问题。 \item 修复附录命令 \cs{appendix} 的可选参数设置英文目录中条目名字和编号失效的问题。 diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf Binary files differindex be43e21c1c..219a826ef9 100644 --- a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex index 52f82ea024..3cef2b2503 100644 --- a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex @@ -5,8 +5,8 @@ % arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') \documentclass[a4paper,french,11pt]{article} -\def\PLversion{3.02a} -\def\PLdate{7 février 2024} +\def\PLversion{3.02b} +\def\PLdate{9 février 2024} \usepackage{amsfonts} \usepackage{ProfLycee} \useproflyclib{piton,minted,pythontex,ecritures} diff --git a/macros/latex/contrib/proflycee/tex/ProfLycee.sty b/macros/latex/contrib/proflycee/tex/ProfLycee.sty index fecfe1ead6..ba0cd72932 100644 --- a/macros/latex/contrib/proflycee/tex/ProfLycee.sty +++ b/macros/latex/contrib/proflycee/tex/ProfLycee.sty @@ -3,7 +3,8 @@ % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfLycee}[2024/02/07 3.02a Aide pour l'utilisation de LaTeX en lycee] +\ProvidesPackage{ProfLycee}[2024/02/09 3.02b Aide pour l'utilisation de LaTeX en lycee] +% 3.02b Amélioration du code pour les arbres de probas (tks M. Degrange pour les suggestions) % 3.02a Ajout des [ecritures] proba conditionnelle, norme, valeur absolue et IF/IC % 3.01g Ajout de commandes internes, en phase de test (et non documentées à 100%...) % 3.01f PseudoCode avec piton (avec langage=minimal de FP ^^) + Suppression Terminal (doublon avec sim-os-menus) diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-ecritures.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-ecritures.tex index f178c5b909..3b05d92764 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-ecritures.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-ecritures.tex @@ -345,8 +345,8 @@ }% = \IfStrEqCase{\intflucconfNiv}{% - {2de}{\IntervalleFF{ \ValIFpD - \dfrac{1}{\sqrt{\intflucconfN}} }{ \ValIFpD + \dfrac{1}{\sqrt{\intflucconfN}}}}% - {Term}{\IntervalleFF{ \ValIFpD-\num{\ualpha}\dfrac{\sqrt{\ValIFp\mleft(1-\ValIFp\mright)}}{\sqrt{\intflucconfN}} }{ \ValIFpD+\num{\ualpha}\dfrac{\sqrt{\ValIFp\mleft(1-\ValIFp\mright)}}{\sqrt{\intflucconfN}} }}% + {2de}{\IntervalleFF{ \ValIFpD - \dfrac{1}{\sqrt{\num{\intflucconfN}}} }{ \ValIFpD + \dfrac{1}{\sqrt{\num{\intflucconfN}}}}}% + {Term}{\IntervalleFF{ \ValIFpD-\num{\ualpha}\dfrac{\sqrt{\ValIFp\mleft(1-\ValIFp\mright)}}{\sqrt{\num{\intflucconfN}}} }{ \ValIFpD+\num{\ualpha}\dfrac{\sqrt{\ValIFp\mleft(1-\ValIFp\mright)}}{\sqrt{\num{\intflucconfN}}} }}% }% }% {}% diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex index 963ac25f7a..41f8ca7ea5 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex @@ -233,6 +233,8 @@ } %%------ARBRESPROBAS +\NewDocumentCommand\numdots{}{\vphantom{0,5}\ldots} + \defKV[PLTIKZARBRE]{% Unite=\def\PLAPunite{#1},% EspaceNiveau=\def\PLAPespniv{#1},% @@ -241,7 +243,9 @@ Police=\def\PLAPfont{#1},% PoliceProbas=\def\PLAPfontproba{#1},% StyleTrait=\def\PLAPtypetrait{#1},% - EpaisseurTrait=\def\PLAPeptrait{#1} + EpaisseurTrait=\def\PLAPeptrait{#1},% + PositionProbas=\def\PLAPposprob{#1},% + CouleurFond=\def\PLAPcolback{#1} } \setKVdefault[PLTIKZARBRE]{% @@ -254,7 +258,24 @@ InclineProbas=true,% Fleche=false,% StyleTrait={},% - EpaisseurTrait=semithick + EpaisseurTrait=semithick,% + PositionProbas={},% + CouleurFond=white +} + +\NewDocumentCommand\IntPlaceProbasArbre{ m m m m m }{% + %1=nœud initial + %2=nœud final + %3=positionlistofitems + %4=probaslistofitems + %5=auto + \IfStrEqCase{\PLAPposprob}{% + {}{\draw[PLfleche] (#1)--(#2) node[probas,PLetiquette,{#3},fill=\PLAPcolback] {{#4}} ;}%PositionProbas vide = on lit + {auto}{\draw[PLfleche] (#1)--(#2) node[probas,PLetiquette,#5] {{#4}} ;}% + {dessus}{\draw[PLfleche] (#1)--(#2) node[probas,PLetiquette,above=1pt] {{#4}} ;}% + {dessous}{\draw[PLfleche] (#1)--(#2) node[probas,PLetiquette,below=1pt] {{#4}} ;}% + {sur}{\draw[PLfleche] (#1)--(#2) node[probas,PLetiquette,fill=\PLAPcolback] {{#4}} ;}% + }% } \NewDocumentCommand\ArbreProbasTikz{ O{} m }{%1=options,2=libellés @@ -267,8 +288,8 @@ \tikzstyle{noeud} = [font=\PLAPfont] \tikzstyle{probas}= [font=\PLAPfontproba] \ifboolKV[PLTIKZARBRE]{InclineProbas} - {\tikzstyle{PLetiquette}=[pos=0.525,sloped,fill=white]} - {\tikzstyle{PLetiquette}=[pos=0.525,fill=white]} + {\tikzstyle{PLetiquette}=[pos=0.525,sloped,inner sep=2pt,outer sep=2pt,rectangle]} + {\tikzstyle{PLetiquette}=[pos=0.525,inner sep=2pt,outer sep=2pt,rectangle]} \ifboolKV[PLTIKZARBRE]{Fleche} {\tikzstyle{PLfleche}=[->,>=latex,\PLAPtypetrait,\PLAPeptrait]} {\tikzstyle{PLfleche}=[\PLAPtypetrait,\PLAPeptrait]} @@ -284,22 +305,40 @@ \node[noeud] (A24) at ({2*\PLAPespniv},{-3*\PLAPespfeuille}) {\PLARBREDONNES[6,1]}; \ifstrempty{\PLARBREDONNES[1,2]} {\draw[PLfleche] (R)--(A11) ;} - {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + {% + \IntPlaceProbasArbre{R}{A11}{\PLARBREDONNES[1,3]}{\PLARBREDONNES[1,2]}{above=1pt} + %\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;% + }% \ifstrempty{\PLARBREDONNES[2,2]} {\draw[PLfleche] (A11)--(A21) ;} - {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + {% + \IntPlaceProbasArbre{A11}{A21}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[2,2]}{above=1pt} + %\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;% + }% \ifstrempty{\PLARBREDONNES[3,2]} {\draw[PLfleche] (A11)--(A22) ;} - {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + {% + \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[3,2]}{below=1pt} + %\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ; + }% \ifstrempty{\PLARBREDONNES[4,2]} {\draw[PLfleche] (R)--(A12) ;} - {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + {% + \IntPlaceProbasArbre{R}{A12}{\PLARBREDONNES[4,3]}{\PLARBREDONNES[4,2]}{below=1pt} + %\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;% + }% \ifstrempty{\PLARBREDONNES[5,2]} {\draw[PLfleche] (A12)--(A23) ;} - {\draw[PLfleche] (A12)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + {% + \IntPlaceProbasArbre{A12}{A23}{\PLARBREDONNES[5,3]}{\PLARBREDONNES[5,2]}{above=1pt} + %\draw[PLfleche] (A12)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;% + }% \ifstrempty{\PLARBREDONNES[6,2]} {\draw[PLfleche] (A12)--(A24) ;} - {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + {% + \IntPlaceProbasArbre{A12}{A24}{\PLARBREDONNES[6,3]}{\PLARBREDONNES[6,2]}{below=1pt} + %\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;% + }% }{} %arbre3x2 \IfEq{\PLAPtype}{3x2} @@ -318,31 +357,58 @@ %branches \ifstrempty{\PLARBREDONNES[1,2]} {\draw[PLfleche] (R)--(A11) ;} - {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + {% + \IntPlaceProbasArbre{R}{A11}{\PLARBREDONNES[1,3]}{\PLARBREDONNES[1,2]}{above=1pt} + %\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;% + }% \ifstrempty{\PLARBREDONNES[2,2]} {\draw[PLfleche] (A11)--(A21) ;} - {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + {% + \IntPlaceProbasArbre{A11}{A21}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[2,2]}{above=1pt} + %\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ; + }% \ifstrempty{\PLARBREDONNES[3,2]} {\draw[PLfleche] (A11)--(A22) ;} - {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[3,3]}{\PLARBREDONNES[3,2]}{below=1pt} + %\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;% + } \ifstrempty{\PLARBREDONNES[4,2]} {\draw[PLfleche] (R)--(A12) ;} - {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + { + \IntPlaceProbasArbre{R}{A12}{\PLARBREDONNES[4,3]}{\PLARBREDONNES[4,2]}{above=-1pt} + %\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ; + } \ifstrempty{\PLARBREDONNES[5,2]} {\draw[PLfleche] (A12)--(A23) ;} - {\draw[PLfleche] (A12)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A23}{\PLARBREDONNES[5,3]}{\PLARBREDONNES[5,2]}{above=1pt} + %\draw[PLfleche] (A12)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ; + } \ifstrempty{\PLARBREDONNES[6,2]} {\draw[PLfleche] (A12)--(A24) ;} - {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A24}{\PLARBREDONNES[6,3]}{\PLARBREDONNES[6,2]}{below=1pt} + %\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ; + } \ifstrempty{\PLARBREDONNES[7,2]} {\draw[PLfleche] (R)--(A13) ;} - {\draw[PLfleche] (R)--(A13) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ;} + { + \IntPlaceProbasArbre{R}{A13}{\PLARBREDONNES[7,3]}{\PLARBREDONNES[7,2]}{below=1pt} + %\draw[PLfleche] (R)--(A13) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ; + } \ifstrempty{\PLARBREDONNES[8,2]} {\draw[PLfleche] (A13)--(A25) ;} - {\draw[PLfleche] (A13)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ;} + { + \IntPlaceProbasArbre{A13}{A25}{\PLARBREDONNES[8,3]}{\PLARBREDONNES[8,2]}{above=1pt} + %\draw[PLfleche] (A13)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ; + } \ifstrempty{\PLARBREDONNES[9,2]} {\draw[PLfleche] (A13)--(A26) ;} - {\draw[PLfleche] (A13)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[9,3]}] {{\PLARBREDONNES[9,2]}} ;} + { + \IntPlaceProbasArbre{A13}{A26}{\PLARBREDONNES[9,3]}{\PLARBREDONNES[9,2]}{below=1pt} + %\draw[PLfleche] (A13)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[9,3]}] {{\PLARBREDONNES[9,2]}} ; + } }{} %arbre2x3 \IfEq{\PLAPtype}{2x3} @@ -360,28 +426,52 @@ %branches \ifstrempty{\PLARBREDONNES[1,2]} {\draw[PLfleche] (R)--(A11) ;} - {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + { + \IntPlaceProbasArbre{R}{A11}{\PLARBREDONNES[1,3]}{\PLARBREDONNES[1,2]}{above=1pt} + %\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ; + } \ifstrempty{\PLARBREDONNES[5,2]} {\draw[PLfleche] (R)--(A12) ;} - {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + { + \IntPlaceProbasArbre{R}{A12}{\PLARBREDONNES[5,3]}{\PLARBREDONNES[5,2]}{below=1pt} + %\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ; + } \ifstrempty{\PLARBREDONNES[2,2]} {\draw[PLfleche] (A11)--(A21) ;} - {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A21}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[2,2]}{above=1pt} + %\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ; + } \ifstrempty{\PLARBREDONNES[3,2]} {\draw[PLfleche] (A11)--(A22) ;} - {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[2,2]}{above=-1pt} + %\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ; + } \ifstrempty{\PLARBREDONNES[4,2]} {\draw[PLfleche] (A11)--(A23) ;} - {\draw[PLfleche] (A11)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A23}{\PLARBREDONNES[4,3]}{\PLARBREDONNES[4,2]}{below=1pt} + %\draw[PLfleche] (A11)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ; + } \ifstrempty{\PLARBREDONNES[6,2]} {\draw[PLfleche] (A12)--(A24) ;} - {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A24}{\PLARBREDONNES[6,3]}{\PLARBREDONNES[6,2]}{above=1pt} + %\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ; + } \ifstrempty{\PLARBREDONNES[7,2]} {\draw[PLfleche] (A12)--(A25) ;} - {\draw[PLfleche] (A12)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A25}{\PLARBREDONNES[7,3]}{\PLARBREDONNES[7,2]}{above=-1pt} + %\draw[PLfleche] (A12)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ; + } \ifstrempty{\PLARBREDONNES[8,2]} {\draw[PLfleche] (A12)--(A26) ;} - {\draw[PLfleche] (A12)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A26}{\PLARBREDONNES[8,3]}{\PLARBREDONNES[8,2]}{below=1pt} + %\draw[PLfleche] (A12)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ; + } }{} %arbre2x3 \IfEq{\PLAPtype}{3x3} @@ -403,41 +493,77 @@ %branches \ifstrempty{\PLARBREDONNES[1,2]} {\draw[PLfleche] (R)--(A11) ;} - {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + { + \IntPlaceProbasArbre{R}{A11}{\PLARBREDONNES[1,3]}{\PLARBREDONNES[1,2]}{above=1pt} + %\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ; + } \ifstrempty{\PLARBREDONNES[5,2]} {\draw[PLfleche] (R)--(A12) ;} - {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + { + \IntPlaceProbasArbre{R}{A12}{\PLARBREDONNES[5,3]}{\PLARBREDONNES[5,2]}{above=-1pt} + %\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ; + } \ifstrempty{\PLARBREDONNES[9,2]} {\draw[PLfleche] (R)--(A13) ;} - {\draw[PLfleche] (R)--(A13) node[probas,PLetiquette,{\PLARBREDONNES[9,3]}] {{\PLARBREDONNES[9,2]}} ;} + { + \IntPlaceProbasArbre{R}{A13}{\PLARBREDONNES[9,3]}{\PLARBREDONNES[9,2]}{below=1pt} + %\draw[PLfleche] (R)--(A13) node[probas,PLetiquette,{\PLARBREDONNES[9,3]}] {{\PLARBREDONNES[9,2]}} ; + } %N2 \ifstrempty{\PLARBREDONNES[2,2]} {\draw[PLfleche] (A11)--(A21) ;} - {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A21}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[2,2]}{above=1pt} + %\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ; + } \ifstrempty{\PLARBREDONNES[3,2]} {\draw[PLfleche] (A11)--(A22) ;} - {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[3,3]}{\PLARBREDONNES[3,2]}{above=-1pt} + %\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ; + } \ifstrempty{\PLARBREDONNES[4,2]} {\draw[PLfleche] (A11)--(A23) ;} - {\draw[PLfleche] (A11)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A23}{\PLARBREDONNES[4,3]}{\PLARBREDONNES[4,2]}{below=1pt} + %\draw[PLfleche] (A11)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ; + } \ifstrempty{\PLARBREDONNES[6,2]} {\draw[PLfleche] (A12)--(A24) ;} - {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A24}{\PLARBREDONNES[6,3]}{\PLARBREDONNES[6,2]}{above=1pt} + %\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ; + } \ifstrempty{\PLARBREDONNES[7,2]} {\draw[PLfleche] (A12)--(A25) ;} - {\draw[PLfleche] (A12)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A25}{\PLARBREDONNES[7,3]}{\PLARBREDONNES[7,2]}{above=-1pt} + %\draw[PLfleche] (A12)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ; + } \ifstrempty{\PLARBREDONNES[8,2]} {\draw[PLfleche] (A12)--(A26) ;} - {\draw[PLfleche] (A12)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A26}{\PLARBREDONNES[8,3]}{\PLARBREDONNES[8,2]}{below=1pt} + %\draw[PLfleche] (A12)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ; + } \ifstrempty{\PLARBREDONNES[10,2]} {\draw[PLfleche] (A13)--(A27) ;} - {\draw[PLfleche] (A13)--(A27) node[probas,PLetiquette,{\PLARBREDONNES[10,3]}] {{\PLARBREDONNES[10,2]}} ;} + { + \IntPlaceProbasArbre{A13}{A27}{\PLARBREDONNES[10,3]}{\PLARBREDONNES[10,2]}{above=1pt} + %\draw[PLfleche] (A13)--(A27) node[probas,PLetiquette,{\PLARBREDONNES[10,3]}] {{\PLARBREDONNES[10,2]}} ; + } \ifstrempty{\PLARBREDONNES[11,2]} {\draw[PLfleche] (A13)--(A28) ;} - {\draw[PLfleche] (A13)--(A28) node[probas,PLetiquette,{\PLARBREDONNES[11,3]}] {{\PLARBREDONNES[11,2]}} ;} + { + \IntPlaceProbasArbre{A13}{A28}{\PLARBREDONNES[11,3]}{\PLARBREDONNES[11,2]}{above=-1pt} + %\draw[PLfleche] (A13)--(A28) node[probas,PLetiquette,{\PLARBREDONNES[11,3]}] {{\PLARBREDONNES[11,2]}} ; + } \ifstrempty{\PLARBREDONNES[12,2]} {\draw[PLfleche] (A13)--(A29) ;} - {\draw[PLfleche] (A13)--(A29) node[probas,PLetiquette,{\PLARBREDONNES[12,3]}] {{\PLARBREDONNES[12,2]}} ;} + { + \IntPlaceProbasArbre{A13}{A29}{\PLARBREDONNES[12,3]}{\PLARBREDONNES[12,2]}{below=1pt} + %\draw[PLfleche] (A13)--(A29) node[probas,PLetiquette,{\PLARBREDONNES[12,3]}] {{\PLARBREDONNES[12,2]}} ; + } }{} \end{tikzpicture} } @@ -453,8 +579,8 @@ \tikzstyle{noeud} = [font=\PLAPfont] \tikzstyle{probas}= [font=\PLAPfontproba] \ifboolKV[PLTIKZARBRE]{InclineProbas} - {\tikzstyle{PLetiquette}=[pos=0.525,sloped,fill=white]} - {\tikzstyle{PLetiquette}=[pos=0.525,fill=white]} + {\tikzstyle{PLetiquette}=[pos=0.525,sloped,inner sep=2pt,outer sep=2pt,rectangle]} + {\tikzstyle{PLetiquette}=[pos=0.525,inner sep=2pt,outer sep=2pt,rectangle]} \ifboolKV[PLTIKZARBRE]{Fleche} {\tikzstyle{PLfleche}=[->,>=latex,\PLAPtypetrait,\PLAPeptrait]} {\tikzstyle{PLfleche}=[\PLAPtypetrait,\PLAPeptrait]} @@ -470,22 +596,40 @@ \node[noeud] (A24) at ({2*\PLAPespniv},{-3*\PLAPespfeuille}) {\PLARBREDONNES[6,1]}; \ifstrempty{\PLARBREDONNES[1,2]} {\draw[PLfleche] (R)--(A11) ;} - {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + {% + \IntPlaceProbasArbre{R}{A11}{\PLARBREDONNES[1,3]}{\PLARBREDONNES[1,2]}{above=1pt} + %\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;% + }% \ifstrempty{\PLARBREDONNES[2,2]} {\draw[PLfleche] (A11)--(A21) ;} - {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + {% + \IntPlaceProbasArbre{A11}{A21}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[2,2]}{above=1pt} + %\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;% + }% \ifstrempty{\PLARBREDONNES[3,2]} {\draw[PLfleche] (A11)--(A22) ;} - {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + {% + \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[3,2]}{below=1pt} + %\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ; + }% \ifstrempty{\PLARBREDONNES[4,2]} {\draw[PLfleche] (R)--(A12) ;} - {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + {% + \IntPlaceProbasArbre{R}{A12}{\PLARBREDONNES[4,3]}{\PLARBREDONNES[4,2]}{below=1pt} + %\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;% + }% \ifstrempty{\PLARBREDONNES[5,2]} {\draw[PLfleche] (A12)--(A23) ;} - {\draw[PLfleche] (A12)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + {% + \IntPlaceProbasArbre{A12}{A23}{\PLARBREDONNES[5,3]}{\PLARBREDONNES[5,2]}{above=1pt} + %\draw[PLfleche] (A12)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;% + }% \ifstrempty{\PLARBREDONNES[6,2]} {\draw[PLfleche] (A12)--(A24) ;} - {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + {% + \IntPlaceProbasArbre{A12}{A24}{\PLARBREDONNES[6,3]}{\PLARBREDONNES[6,2]}{below=1pt} + %\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;% + }% }{} %arbre3x2 \IfEq{\PLAPtype}{3x2} @@ -504,31 +648,58 @@ %branches \ifstrempty{\PLARBREDONNES[1,2]} {\draw[PLfleche] (R)--(A11) ;} - {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + {% + \IntPlaceProbasArbre{R}{A11}{\PLARBREDONNES[1,3]}{\PLARBREDONNES[1,2]}{above=1pt} + %\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;% + }% \ifstrempty{\PLARBREDONNES[2,2]} {\draw[PLfleche] (A11)--(A21) ;} - {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + {% + \IntPlaceProbasArbre{A11}{A21}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[2,2]}{above=1pt} + %\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ; + }% \ifstrempty{\PLARBREDONNES[3,2]} {\draw[PLfleche] (A11)--(A22) ;} - {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[3,3]}{\PLARBREDONNES[3,2]}{below=1pt} + %\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;% + } \ifstrempty{\PLARBREDONNES[4,2]} {\draw[PLfleche] (R)--(A12) ;} - {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + { + \IntPlaceProbasArbre{R}{A12}{\PLARBREDONNES[4,3]}{\PLARBREDONNES[4,2]}{above=-1pt} + %\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ; + } \ifstrempty{\PLARBREDONNES[5,2]} {\draw[PLfleche] (A12)--(A23) ;} - {\draw[PLfleche] (A12)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A23}{\PLARBREDONNES[5,3]}{\PLARBREDONNES[5,2]}{above=1pt} + %\draw[PLfleche] (A12)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ; + } \ifstrempty{\PLARBREDONNES[6,2]} {\draw[PLfleche] (A12)--(A24) ;} - {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A24}{\PLARBREDONNES[6,3]}{\PLARBREDONNES[6,2]}{below=1pt} + %\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ; + } \ifstrempty{\PLARBREDONNES[7,2]} {\draw[PLfleche] (R)--(A13) ;} - {\draw[PLfleche] (R)--(A13) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ;} + { + \IntPlaceProbasArbre{R}{A13}{\PLARBREDONNES[7,3]}{\PLARBREDONNES[7,2]}{below=1pt} + %\draw[PLfleche] (R)--(A13) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ; + } \ifstrempty{\PLARBREDONNES[8,2]} {\draw[PLfleche] (A13)--(A25) ;} - {\draw[PLfleche] (A13)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ;} + { + \IntPlaceProbasArbre{A13}{A25}{\PLARBREDONNES[8,3]}{\PLARBREDONNES[8,2]}{above=1pt} + %\draw[PLfleche] (A13)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ; + } \ifstrempty{\PLARBREDONNES[9,2]} {\draw[PLfleche] (A13)--(A26) ;} - {\draw[PLfleche] (A13)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[9,3]}] {{\PLARBREDONNES[9,2]}} ;} + { + \IntPlaceProbasArbre{A13}{A26}{\PLARBREDONNES[9,3]}{\PLARBREDONNES[9,2]}{below=1pt} + %\draw[PLfleche] (A13)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[9,3]}] {{\PLARBREDONNES[9,2]}} ; + } }{} %arbre2x3 \IfEq{\PLAPtype}{2x3} @@ -546,28 +717,52 @@ %branches \ifstrempty{\PLARBREDONNES[1,2]} {\draw[PLfleche] (R)--(A11) ;} - {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + { + \IntPlaceProbasArbre{R}{A11}{\PLARBREDONNES[1,3]}{\PLARBREDONNES[1,2]}{above=1pt} + %\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ; + } \ifstrempty{\PLARBREDONNES[5,2]} {\draw[PLfleche] (R)--(A12) ;} - {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + { + \IntPlaceProbasArbre{R}{A12}{\PLARBREDONNES[5,3]}{\PLARBREDONNES[5,2]}{below=1pt} + %\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ; + } \ifstrempty{\PLARBREDONNES[2,2]} {\draw[PLfleche] (A11)--(A21) ;} - {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A21}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[2,2]}{above=1pt} + %\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ; + } \ifstrempty{\PLARBREDONNES[3,2]} {\draw[PLfleche] (A11)--(A22) ;} - {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[2,2]}{above=-1pt} + %\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ; + } \ifstrempty{\PLARBREDONNES[4,2]} {\draw[PLfleche] (A11)--(A23) ;} - {\draw[PLfleche] (A11)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A23}{\PLARBREDONNES[4,3]}{\PLARBREDONNES[4,2]}{below=1pt} + %\draw[PLfleche] (A11)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ; + } \ifstrempty{\PLARBREDONNES[6,2]} {\draw[PLfleche] (A12)--(A24) ;} - {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A24}{\PLARBREDONNES[6,3]}{\PLARBREDONNES[6,2]}{above=1pt} + %\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ; + } \ifstrempty{\PLARBREDONNES[7,2]} {\draw[PLfleche] (A12)--(A25) ;} - {\draw[PLfleche] (A12)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A25}{\PLARBREDONNES[7,3]}{\PLARBREDONNES[7,2]}{above=-1pt} + %\draw[PLfleche] (A12)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ; + } \ifstrempty{\PLARBREDONNES[8,2]} {\draw[PLfleche] (A12)--(A26) ;} - {\draw[PLfleche] (A12)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A26}{\PLARBREDONNES[8,3]}{\PLARBREDONNES[8,2]}{below=1pt} + %\draw[PLfleche] (A12)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ; + } }{} %arbre2x3 \IfEq{\PLAPtype}{3x3} @@ -587,46 +782,82 @@ \node[noeud] (A28) at ({2*\PLAPespniv},{-7*\PLAPespfeuille}) {\PLARBREDONNES[11,1]}; \node[noeud] (A29) at ({2*\PLAPespniv},{-8*\PLAPespfeuille}) {\PLARBREDONNES[12,1]}; %branches - \ifstrempty{\PLARBREDONNES[1,2]}{} + \ifstrempty{\PLARBREDONNES[1,2]} {\draw[PLfleche] (R)--(A11) ;} - {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} - \ifstrempty{\PLARBREDONNES[5,2]}{} + { + \IntPlaceProbasArbre{R}{A11}{\PLARBREDONNES[1,3]}{\PLARBREDONNES[1,2]}{above=1pt} + %\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ; + } + \ifstrempty{\PLARBREDONNES[5,2]} {\draw[PLfleche] (R)--(A12) ;} - {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} - \ifstrempty{\PLARBREDONNES[9,2]}{} + { + \IntPlaceProbasArbre{R}{A12}{\PLARBREDONNES[5,3]}{\PLARBREDONNES[5,2]}{above=-1pt} + %\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ; + } + \ifstrempty{\PLARBREDONNES[9,2]} {\draw[PLfleche] (R)--(A13) ;} - {\draw[PLfleche] (R)--(A13) node[probas,PLetiquette,{\PLARBREDONNES[9,3]}] {{\PLARBREDONNES[9,2]}} ;} + { + \IntPlaceProbasArbre{R}{A13}{\PLARBREDONNES[9,3]}{\PLARBREDONNES[9,2]}{below=1pt} + %\draw[PLfleche] (R)--(A13) node[probas,PLetiquette,{\PLARBREDONNES[9,3]}] {{\PLARBREDONNES[9,2]}} ; + } %N2 \ifstrempty{\PLARBREDONNES[2,2]} {\draw[PLfleche] (A11)--(A21) ;} - {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A21}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[2,2]}{above=1pt} + %\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ; + } \ifstrempty{\PLARBREDONNES[3,2]} {\draw[PLfleche] (A11)--(A22) ;} - {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[3,3]}{\PLARBREDONNES[3,2]}{above=-1pt} + %\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ; + } \ifstrempty{\PLARBREDONNES[4,2]} {\draw[PLfleche] (A11)--(A23) ;} - {\draw[PLfleche] (A11)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + { + \IntPlaceProbasArbre{A11}{A23}{\PLARBREDONNES[4,3]}{\PLARBREDONNES[4,2]}{below=1pt} + %\draw[PLfleche] (A11)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ; + } \ifstrempty{\PLARBREDONNES[6,2]} {\draw[PLfleche] (A12)--(A24) ;} - {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A24}{\PLARBREDONNES[6,3]}{\PLARBREDONNES[6,2]}{above=1pt} + %\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ; + } \ifstrempty{\PLARBREDONNES[7,2]} {\draw[PLfleche] (A12)--(A25) ;} - {\draw[PLfleche] (A12)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A25}{\PLARBREDONNES[7,3]}{\PLARBREDONNES[7,2]}{above=-1pt} + %\draw[PLfleche] (A12)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ; + } \ifstrempty{\PLARBREDONNES[8,2]} {\draw[PLfleche] (A12)--(A26) ;} - {\draw[PLfleche] (A12)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ;} + { + \IntPlaceProbasArbre{A12}{A26}{\PLARBREDONNES[8,3]}{\PLARBREDONNES[8,2]}{below=1pt} + %\draw[PLfleche] (A12)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ; + } \ifstrempty{\PLARBREDONNES[10,2]} {\draw[PLfleche] (A13)--(A27) ;} - {\draw[PLfleche] (A13)--(A27) node[probas,PLetiquette,{\PLARBREDONNES[10,3]}] {{\PLARBREDONNES[10,2]}} ;} + { + \IntPlaceProbasArbre{A13}{A27}{\PLARBREDONNES[10,3]}{\PLARBREDONNES[10,2]}{above=1pt} + %\draw[PLfleche] (A13)--(A27) node[probas,PLetiquette,{\PLARBREDONNES[10,3]}] {{\PLARBREDONNES[10,2]}} ; + } \ifstrempty{\PLARBREDONNES[11,2]} {\draw[PLfleche] (A13)--(A28) ;} - {\draw[PLfleche] (A13)--(A28) node[probas,PLetiquette,{\PLARBREDONNES[11,3]}] {{\PLARBREDONNES[11,2]}} ;} + { + \IntPlaceProbasArbre{A13}{A28}{\PLARBREDONNES[11,3]}{\PLARBREDONNES[11,2]}{above=-1pt} + %\draw[PLfleche] (A13)--(A28) node[probas,PLetiquette,{\PLARBREDONNES[11,3]}] {{\PLARBREDONNES[11,2]}} ; + } \ifstrempty{\PLARBREDONNES[12,2]} {\draw[PLfleche] (A13)--(A29) ;} - {\draw[PLfleche] (A13)--(A29) node[probas,PLetiquette,{\PLARBREDONNES[12,3]}] {{\PLARBREDONNES[12,2]}} ;} + { + \IntPlaceProbasArbre{A13}{A29}{\PLARBREDONNES[12,3]}{\PLARBREDONNES[12,2]}{below=1pt} + %\draw[PLfleche] (A13)--(A29) node[probas,PLetiquette,{\PLARBREDONNES[12,3]}] {{\PLARBREDONNES[12,2]}} ; + } }{} - } - { +} +{ \end{tikzpicture} } diff --git a/macros/texinfo/latest/texinfo.tex b/macros/texinfo/latest/texinfo.tex index c96d4d7b28..1ef4915882 100644 --- a/macros/texinfo/latest/texinfo.tex +++ b/macros/texinfo/latest/texinfo.tex @@ -3,9 +3,9 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2023-09-19.19} +\def\texinfoversion{2024-02-10.22} % -% Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc. +% Copyright 1985, 1986, 1988, 1990-2024 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -5238,14 +5238,14 @@ $$% % the current value of \escapechar. \def\escapeisbackslash{\escapechar=`\\} -% Use \ in index files by default. texi2dvi didn't support @ as the escape -% character (as it checked for "\entry" in the files, and not "@entry"). When -% the new version of texi2dvi has had a chance to become more prevalent, then -% the escape character can change back to @ again. This should be an easy -% change to make now because both @ and \ are only used as escape characters in -% index files, never standing for themselves. +% Uncomment to use \ in index files by default. Old texi2dvi (before 2019) +% didn't support @ as the escape character (as it checked for "\entry" in +% the files, and not "@entry"). +% In the future we can remove this flag and simplify the code for +% index files and backslashes, once the support is no longer likely to be +% useful. % -\set txiindexescapeisbackslash +% \set txiindexescapeisbackslash % Write the entry in \indextext to the index file. % @@ -6137,8 +6137,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % normally unnmhead0 calls unnumberedzzz: \outer\parseargdef\unnumbered{\unnmhead0{#1}} \def\unnumberedzzz#1{% - \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 - \global\advance\unnumberedno by 1 + \global\advance\unnumberedno by 1 % % Since an unnumbered has no number, no prefix for figures. \global\let\chaplevelprefix = \empty @@ -6194,8 +6193,8 @@ might help (with 'rm \jobname.?? \jobname.??s')% % normally calls unnumberedseczzz: \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} \def\unnumberedseczzz#1{% - \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 - \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% + \global\advance\unnumberedno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno}% } % Subsections. @@ -6218,9 +6217,8 @@ might help (with 'rm \jobname.?? \jobname.??s')% % normally calls unnumberedsubseczzz: \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} \def\unnumberedsubseczzz#1{% - \global\subsubsecno=0 \global\advance\subsecno by 1 - \sectionheading{#1}{subsec}{Ynothing}% - {\the\unnumberedno.\the\secno.\the\subsecno}% + \global\advance\unnumberedno by 1 + \sectionheading{#1}{subsec}{Ynothing}{\the\unnumberedno}% } % Subsubsections. @@ -6244,9 +6242,8 @@ might help (with 'rm \jobname.?? \jobname.??s')% % normally unnumberedsubsubseczzz: \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} \def\unnumberedsubsubseczzz#1{% - \global\advance\subsubsecno by 1 - \sectionheading{#1}{subsubsec}{Ynothing}% - {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% + \global\advance\unnumberedno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}{\the\unnumberedno}% } % These macros control what the section commands do, according @@ -8205,8 +8202,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% \let\commondummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup - \else - \errmessage{Macro #1 not defined}% \fi } diff --git a/macros/xetex/latex/exam-zh/CHANGELOG.md b/macros/xetex/latex/exam-zh/CHANGELOG.md index 9fba646315..cd4627352f 100644 --- a/macros/xetex/latex/exam-zh/CHANGELOG.md +++ b/macros/xetex/latex/exam-zh/CHANGELOG.md @@ -5,6 +5,37 @@ 格式参照 [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 并且此项目遵守 [Semantic Versioning](https://semver.org/spec/v2.0.0.html)。 +## [0.2.1] - 2024-02-11 + +### Added + +- 增加答案控制功能 +- 增加计算题排版环境 `calculations` + +### Fixed + +- 修复 `section` 的超链接问题 + + +## [0.1.29] - 2024-02-07 + +### Added + +- 增加 `fig-pos` 的同义选项 `pos` + +### Changed + +- 修改 `textfigure` 的选项的一些默认值 + + + +## [0.1.28] - 2023-07-14 + +### Changed + +- 修改 `\paren` 的宽度细节 + + ## [0.1.27] - 2023-06-27 ### Added diff --git a/macros/xetex/latex/exam-zh/doc/back/main-changelog.tex b/macros/xetex/latex/exam-zh/doc/back/main-changelog.tex index f3a51e79e1..1b339b2a64 100644 --- a/macros/xetex/latex/exam-zh/doc/back/main-changelog.tex +++ b/macros/xetex/latex/exam-zh/doc/back/main-changelog.tex @@ -8,4 +8,5 @@ \item 2022.6 开发密封线、草稿纸、评分框 \item 2022.7 增加语文英语题型 \item 2022.8 开发图文排版模版 + \item 2024.2 发布答案控制功能、计算题排版功能 \end{itemize}
\ No newline at end of file diff --git a/macros/xetex/latex/exam-zh/doc/body/usage.tex b/macros/xetex/latex/exam-zh/doc/body/usage.tex index 9d1191f76b..85566213f4 100644 --- a/macros/xetex/latex/exam-zh/doc/body/usage.tex +++ b/macros/xetex/latex/exam-zh/doc/body/usage.tex @@ -20,6 +20,9 @@ 按照~\ref{subsec:编译方式} 小节中的方式编译,您应当得到一篇 1 页的文档。 +注意,如果您要在 Overleaf 或者 TeXPage 等在线编辑器上使用 \cls{exam-zh},请在 \verb|\documentclass{exam-zh}| 前加一行代码:\verb|\let\stop\empty|. + + \subsection{编译方式} \label{subsec:编译方式} 本模板不支持 \pdfTeX{} 引擎,仅支持使用 \XeLaTeX{} 。为了生成正确的目录、脚注以及交叉引用,您至少需要连续编译两次。 @@ -570,11 +573,11 @@ 下面所有和 \env{solution} 有关的示例都默认加载了 \begin{latexcode} - \examsetup{solution/show-solution = true} + \examsetup{solution/show-solution = show-stay} \end{latexcode} \examsetup{ - solution/show-solution=true + solution/show-solution=show-stay } @@ -854,7 +857,7 @@ \geometry{showframe} ]{ page/size=a3paper, - solution/show-solution=true, + solution/show-solution=show-stay, paren/show-paren=true, paren/show-answer=true } @@ -1006,6 +1009,40 @@ \end{latexcode} 将用户设置放在 \cls{exam-zh} 的默认设置后从而使其产生作用。 + +\subsubsection{数学-计算题排版} + +\begin{function}[added = 2024-02-11]{calculations 环境} + \begin{ccnusyntax}[emph={[2]calculations}] + \begin{calculations}(*\oarg{键值列表}*) + \item (*\meta{内容1}*) + \item (*\meta{内容2}*) + ... + \end{calculations} + \end{ccnusyntax} + 计算题排版环境。用户可根据效果实现更多应用。\oarg{键值列表} 见~\ref{subsubsec:参数-计算题排版} 节。 +\end{function} + +\begin{latexexample}{\env{calculations} 环境示例} + \begin{calculations}[ + % index = 3, % 从 3 开始编号 + label = \arabic*., % 样式,和 question 环境的一样 + columns = 2, % 每行多少项 + hsep = 0pt, % 两列之间的间距 + vsep = 4cm % 两行之间的间距 + ] + \item + $(-10) + \dfrac{1}{3} - (-3)$ + \item(5分) + $(-10) + 5 - (-3)$ + \item + $(-10) + 5 - (-3)$ + \item(5分) + $(-10) + 5 - (-3)$ + \end{calculations} +\end{latexexample} + + \subsection{参数设置} \begin{function}{\examsetup} @@ -1195,9 +1232,9 @@ \end{ccnusyntax} 页脚内容设置。 \begin{itemize} - \item 若\meta{页脚格式} 中不含西文分号 |;|,则页脚内容为 \meta{页脚格式} 直接输出; - \item 若\meta{页脚格式} 中含一个西文分号 |;|,如 |foo;bar|,则页脚为 |foo<the page>bar|,即西文分号代替了页码的位置; - \item 若\meta{页脚格式} 中含两个西文分号 |;|,如 |foo;bar;baz|,则页脚为 |foo<the page>bar<total page>baz|,即第一个西文分号代替了页码的位置,第二个代替了总页码。 + \item 若 \meta{页脚格式} 中不含西文分号 |;|,则页脚内容为 \meta{页脚格式} 直接输出; + \item 若 \meta{页脚格式} 中含一个西文分号 |;|,如 |foo;bar|,则页脚为 |foo<the page>bar|,即西文分号代替了页码的位置; + \item 若 \meta{页脚格式} 中含两个西文分号 |;|,如 |foo;bar;baz|,则页脚为 \\|foo<the page>bar<total page>baz|,即第一个西文分号代替了页码的位置,第二个代替了总页码。 \end{itemize} \end{function} @@ -2193,9 +2230,9 @@ \fillin[width-type = normal, width = 1.1\linewidth][答案] 测试 \end{latexexample} -\begin{function}[added = 2022-07-15]{fillin/color} +\begin{function}[added = 2022-07-15, updated = 2023-07-03]{fillin/box-color} \begin{ccnusyntax}[emph={[1]color}] - color = (*\meta{color}*) + box-color = (*\meta{color}*) \end{ccnusyntax} 设置 \kvopt{fillin/type}{circle/rectangle} 类型的 \tn{fillin} 的边框颜色。 \end{function} @@ -2228,12 +2265,11 @@ \end{function} -\begin{function}[added = 2022-07-01,updated = 2022-08-17]{solution/show-solution,solution/show-answer} - \begin{ccnusyntax}[emph={[1]show-solution,show-answer}] - show-solution = (*\TTF*) - show-answer = (*\TTF*) +\begin{function}[added = 2022-07-01,updated = 2024-02-11]{solution/show-solution} + \begin{ccnusyntax}[emph={[1]show-solution}] + show-solution = (*<(show-hide)|show-stay|show-move>*) \end{ccnusyntax} - 是否显示解答环境 \env{solution} 的内容。\opt{show-solution} 和 \opt{show-answer} 两者等效。 + 是否显示或移动解答环境 \env{solution} 的内容。\opt{show-hide} 表示隐藏,\opt{show-stay} 表示显示在原处,\opt{show-move} 表示显示在章节最后。 \end{function} \begin{function}[added = 2022-07-20]{solution/parbreak} @@ -2983,4 +3019,85 @@ parindent = (*\meta{dimension}*) \end{ccnusyntax} 文本部分的缩进长度,默认为 |2em|。 +\end{function} + + +\subsubsection{数学-计算题排版环境} \label{subsubsec:参数-计算题排版} + +\begin{function}[updated = 2024-02-11]{calculations} + \begin{ccnusyntax}[emph={[1]calculations}] + calculations = (*\marg{键值列表}*) + calculations/(*\meta{key}*) = (*\meta{value}*) + \end{ccnusyntax} + 该选项包含多个子项目。用于设置 \env{calculations} 环境。可以在 \tn{examsetup} 中使用,也可以在 \env{calculations} 环境的可选参数中使用。 +\end{function} + +\begin{function}[added = 2024-02-11]{calculations/index} + \begin{ccnusyntax}[emph={[1]index}] + index = (*\meta{integer}*) + \end{ccnusyntax} + 第一个题干的序号。默认为 |1|。 +\end{function} + +\begin{function}[added = 2024-02-11]{calculations/columns} + \begin{ccnusyntax}[emph={[1]columns}] + columns = (*\meta{integer}*) + \end{ccnusyntax} + 每行多少项。默认为 |2|。 +\end{function} + +\begin{function}[added = 2024-02-11]{calculations/fig-pos} + \begin{ccnusyntax}[emph={[1]fig-pos}] + fig-pos = (*<top|above|bottom|below|left|right|(left-top)>*) + \end{ccnusyntax} + 题干相对于标签的位置。\opt{top} 和 \opt{above} 同义、\opt{bottom} 和 \opt{below} 同义。 +\end{function} + +\begin{function}[added = 2024-02-11]{calculations/top-sep} + \begin{ccnusyntax}[emph={[1]top-sep}] + top-sep = (*\meta{dimension}*) + \end{ccnusyntax} + \env{calculations} 环境上方额外弹性间距。默认为 |1ex plus .5ex minus .5ex|。 +\end{function} + +\begin{function}[added = 2024-02-11]{calculations/bottom-sep} + \begin{ccnusyntax}[emph={[1]bottom-sep}] + bottom-sep = (*\meta{dimension}*) + \end{ccnusyntax} + \env{calculations} 环境下方额外弹性间距。默认为 |0pt|。 +\end{function} + +\begin{function}[added = 2024-02-11]{calculations/hsep,calculations/vsep} + \begin{ccnusyntax}[emph={[1]hsep,vsep}] + hsep = (*\meta{dimension}*) + vsep = (*\meta{dimension}*) + \end{ccnusyntax} + \opt{hsep} 表示题干之间的水平间距,\opt{vsep} 表示题干之间的垂直间距。\opt{hsep} 默认为 |2em|,\opt{vsep} 默认为 |0em|。 +\end{function} + +\begin{function}[added = 2024-02-11]{calculations/align} + \begin{ccnusyntax}[emph={[1]align}] + align = (*<(t)|m|b>*) + \end{ccnusyntax} + 题干和标签的整体对齐方式。\opt{t} 表示顶部对齐、\opt{m} 表示居中对齐、\opt{b} 表示底部对齐。 +\end{function} + +\begin{function}[added = 2024-02-11]{calculations/xshift,calculations/hshift,calculations/yshift,calculations/vshift} + \begin{ccnusyntax}[emph={[1]xshift,hshift,yshift,vshift}] + xshift = (*\meta{dimension}*) + hshift = (*\meta{dimension}*) + yshift = (*\meta{dimension}*) + vshift = (*\meta{dimension}*) + \end{ccnusyntax} + 题干和标签整体的水平和垂直的偏移量。\opt{xshift} 和 \opt{hshift} 同义,表示水平;\opt{yshift} 和 \opt{vshift} 同义,表示垂直。 +\end{function} + +\begin{function}[added = 2024-02-11]{calculations/label-xshift,calculations/label-hshift,calculations/label-yshift,calculations/label-vshift} + \begin{ccnusyntax}[emph={[1]xshift,hshift,yshift,vshift}] + label-xshift = (*\meta{dimension}*) + label-hshift = (*\meta{dimension}*) + label-yshift = (*\meta{dimension}*) + label-vshift = (*\meta{dimension}*) + \end{ccnusyntax} + 标签相对题干的水平和垂直的偏移量。\opt{label-xshift} 和 \opt{label-hshift} 同义,表示水平;\opt{label-yshift} 和 \opt{label-vshift} 同义,表示垂直。 \end{function}
\ No newline at end of file diff --git a/macros/xetex/latex/exam-zh/doc/exam-zh-doc-setup.tex b/macros/xetex/latex/exam-zh/doc/exam-zh-doc-setup.tex index 9a1f2a6844..d67b599cee 100644 --- a/macros/xetex/latex/exam-zh/doc/exam-zh-doc-setup.tex +++ b/macros/xetex/latex/exam-zh/doc/exam-zh-doc-setup.tex @@ -7,6 +7,7 @@ \usepackage{../exam-zh-symbols} \usepackage{../exam-zh-chinese-english} \usepackage{../exam-zh-textfigure} +\usepackage{../exam-zh-math} \ExplSyntaxOn \NewDocumentCommand \examsetup { m } @@ -32,7 +33,10 @@ \title{\textcolor{MaterialIndigo800}{% \textbf{exam-zh: 中国试卷 \LaTeX \xpinyin[font=\sffamily,format=\color{MaterialIndigo800}]{模}{mu2}板}}} -\author{李泽平,夏康玮,郭李军} +\author{% + 夏康玮\thanks{% + 李泽平构建了 \cls{exam-zh} 的最初的基本框架;郭李军开发了连线题环境} +} \date{\DocDate\quad \DocVersion% \thanks{% \url{https://gitee.com/xkwxdyy/exam-zh} \\ diff --git a/macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdf b/macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdf Binary files differindex 513f8d06a0..734be0a38f 100644 --- a/macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdf +++ b/macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdf diff --git a/macros/xetex/latex/exam-zh/doc/exam-zh-doc.tex b/macros/xetex/latex/exam-zh/doc/exam-zh-doc.tex index b8eb07a3a6..6beca867a6 100644 --- a/macros/xetex/latex/exam-zh/doc/exam-zh-doc.tex +++ b/macros/xetex/latex/exam-zh/doc/exam-zh-doc.tex @@ -1,7 +1,7 @@ \documentclass{xdyydoc} -\newcommand{\DocDate}{2022-10-4} -\newcommand{\DocVersion}{v0.1.27} +\newcommand{\DocDate}{2024-02-11} +\newcommand{\DocVersion}{v0.2.1} \input{exam-zh-doc-setup.tex} \usepackage{amssymb} @@ -61,28 +61,28 @@ \begin{itemize} % \item 增加试卷范例(语文,英语) - \item 答案控制 - \begin{itemize} - \item 选择题 - \begin{itemize} - \item 题目下方 - \item 括号内 - \item 最后:列表形式、表格形式 - \end{itemize} - \item 填空题 - \begin{itemize} - \item 题目下方 - \item 划线内 - \item 最后 - \end{itemize} - \item 解答题 - \begin{itemize} - \item 题目下方 - \item 移动到最后 - \end{itemize} - \end{itemize} + % \item 答案控制 + % \begin{itemize} + % \item 选择题 + % \begin{itemize} + % \item 题目下方 + % \item 括号内 + % \item 最后:列表形式、表格形式 + % \end{itemize} + % \item 填空题 + % \begin{itemize} + % \item 题目下方 + % \item 划线内 + % \item 最后 + % \end{itemize} + % \item 解答题 + % \begin{itemize} + % \item 题目下方 + % \item 移动到最后 + % \end{itemize} + % \end{itemize} \item 选择题答案标记 - \item \env{choices} 环境“均分”效果 + % \item \env{choices} 环境“均分”效果 % \item 图文排版(参考 xkwxdyy 的 \pkg{text-figure} 宏包和 qinglee 的 \pkg{wrapstuff} 宏包) \item 测试兼容性 \item \env{question} 环境的引用 @@ -95,6 +95,7 @@ \item 通过 \tn{CJKunderline} 的 \meta{hidden} 键实现 \tn{fillin} 的无答案的时候,长度是答案的长度 \item \env{poem} 环境的引用字体不是斜体 \item 用 meta 优化键值,比如统一的 show-answer + \item 设置 \tn{vec} 命令的定制开关。 \end{itemize} diff --git a/macros/xetex/latex/exam-zh/examples/example-multiple.pdf b/macros/xetex/latex/exam-zh/examples/example-multiple.pdf Binary files differindex e6b4c80c25..29b1dc4883 100644 --- a/macros/xetex/latex/exam-zh/examples/example-multiple.pdf +++ b/macros/xetex/latex/exam-zh/examples/example-multiple.pdf diff --git a/macros/xetex/latex/exam-zh/examples/example-single.pdf b/macros/xetex/latex/exam-zh/examples/example-single.pdf Binary files differindex 66c7da9b6e..1ecd7749c5 100644 --- a/macros/xetex/latex/exam-zh/examples/example-single.pdf +++ b/macros/xetex/latex/exam-zh/examples/example-single.pdf diff --git a/macros/xetex/latex/exam-zh/examples/example-single.tex b/macros/xetex/latex/exam-zh/examples/example-single.tex index 4a9e7e3033..d2f1506c26 100644 --- a/macros/xetex/latex/exam-zh/examples/example-single.tex +++ b/macros/xetex/latex/exam-zh/examples/example-single.tex @@ -6,15 +6,7 @@ paren/show-paren=true, paren/show-answer=true, fillin/show-answer=false, - solution/show-solution=false -} - -\ExamPrintAnswerSet{ - sealline/show=true, - page/size=a3paper, - paren/show-answer=false, - fillin/show-answer=false, - solution/show-solution=false, + solution/show-solution=show-move } @@ -60,7 +52,7 @@ % 1. \begin{question}[points = 2] - 设集合 $A = \{x \mid -1 < x < 4\}$,$B = \{2, 3, 4, 5\}$,则 $A \cap B = $ \paren[B] + 设集合 $A = \{x \mid -1 < x < 4\}$,$B = \{2, 3, 4, 5\}$,则 $A \cap B = $ \paren[A] \begin{choices} \item $\{2\}$ @@ -222,6 +214,10 @@ 已知函数 $f(x) = x^3 (a \cdot 2^x - 2^{-x})$ 是偶函数,则 $a = $ \fillin[$1$] 。 \end{question} +\begin{solution} + 由 $f(x) = f(-x)$,得 $a = 1$。 +\end{solution} + % 14. \begin{question} 已知 $O$ 为坐标原点,抛物线 $C \colon y^2 = 2px$($p > 0$)的焦点为 $F$, diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-chinese-english.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-chinese-english.sty index 5099c6ca11..845eabfca1 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh-chinese-english.sty +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-chinese-english.sty @@ -8,7 +8,7 @@ \RequirePackage{expl3} -\ProvidesExplPackage {exam-zh-chinese-english} {2023-06-28} {v0.1.27} +\ProvidesExplPackage {exam-zh-chinese-english} {2024-02-11} {v0.2.1} {exam-zh chinese and english module} \PassOptionsToPackage { tcolorbox } { most } diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-choices.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-choices.sty index 47cbd287bc..b66f974d2b 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh-choices.sty +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-choices.sty @@ -9,7 +9,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {exam-zh-choices} {2023-06-28} {v0.1.27} +\ProvidesExplPackage {exam-zh-choices} {2024-02-11} {v0.2.1} {exam-zh choices module} \dim_new:N \l__examzh_choices_column_sep_dim diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-font.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-font.sty index 9f0bb0171f..85f7bb1782 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh-font.sty +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-font.sty @@ -9,7 +9,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {exam-zh-font} {2023-06-28} {v0.1.27} +\ProvidesExplPackage {exam-zh-font} {2024-02-11} {v0.2.1} {exam-zh font module} \RequirePackage { unicode-math } diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-math.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-math.sty new file mode 100644 index 0000000000..e11281f077 --- /dev/null +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-math.sty @@ -0,0 +1,427 @@ +% +% Copyright (c) 2022 Kangwei Xia +% Released under the LaTeX Project Public License v1.3c License. +% Repository: https://gitee.com/xkwxdyy/exam-zh +% + +\NeedsTeXFormat{LaTeX2e} + +\RequirePackage{expl3} + +\ProvidesExplPackage {exam-zh-math} {2024-02-11} {v0.2.1} + {exam-zh math module} + +\RequirePackage { tabularray } +\RequirePackage { varwidth } +\RequirePackage { graphicx } +\RequirePackage { filehook } +\file_if_exist:nT { wrapstuff.sty } + { + \RequirePackage { wrapstuff } + \AtEndOfPackageFile* { exam-zh-choices } + { + \AddToHook { env / choices / before } + { \wrapstuffclear } + } + } + + +\keys_define:nn { exam-zh } + { calculations .meta:nn = { exam-zh / calculations } {#1} } + +%% calculations 环境 %% + + +% 图片相对于 label 的方位 +\str_new:N \l__examzh_calculations_figure_position_str +% coffin type 的对齐方式 +\str_new:N \l__examzh_calculations_coffin_align_str + + +\keys_define:nn { exam-zh / calculations } + { + % calculations 环境的 label 从几开始(但是其实是 index + seq 函数的 ##1 才是最终的 index) + index .int_set:N = \l__examzh_calculations_label_index_shift_int, + % 每行多少个(等价于有多少列) + columns .int_set:N = \l__examzh_calculations_column_int, + % 图片相对于文字的位置(上下左右) + fig-pos .choices:nn = + { top, above, bottom, below, left, right, left-top } + { \str_set:Nx \l__examzh_calculations_figure_position_str { \l_keys_choice_tl } }, + % 环境上方的额外距离 + top-sep .skip_set:N = \l__examzh_calculations_top_sep_skip, + % 环境下方的额外距离 + bottom-sep .skip_set:N = \l__examzh_calculations_bottom_sep_skip, + % 两列之间的水平间距 + hsep .skip_set:N = \l__examzh_calculations_hsep_skip, + % 两行之间的垂直间距 + vsep .skip_set:N = \l__examzh_calculations_vsep_skip, + % 整体的偏移量 + xshift .dim_set:N = \l__examzh_calculations_xshift_dim, + hshift .dim_set:N = \l__examzh_calculations_xshift_dim, + yshift .dim_set:N = \l__examzh_calculations_yshift_dim, + vshift .dim_set:N = \l__examzh_calculations_yshift_dim, + % label 的偏移量 + label-xshift .dim_set:N = \l__examzh_calculations_label_xshift_dim, + label-hshift .dim_set:N = \l__examzh_calculations_label_xshift_dim, + label-yshift .dim_set:N = \l__examzh_calculations_label_yshift_dim, + label-vshift .dim_set:N = \l__examzh_calculations_label_yshift_dim, + % 对齐方式 + align .choices:nn = + { t, m, b } + { \str_set:Nx \l__examzh_calculations_coffin_align_str { \l_keys_choice_tl } } + } +\keys_set:nn { exam-zh / calculations } + { + index = 0, + columns = 2, + fig-pos = left-top, + xshift = 2em, + hsep = 2em, + vsep = 0pt, + label-xshift = 0pt, + align = t, + top-sep = 1ex plus .5ex minus .5ex, + bottom-sep = 0pt, + } + +% item 的 index 指标(即第几个 item) +\int_new:N \l__examzh_calculations_item_index_int +% 将拼接后的 coffin 存到 seq 里 +\seq_new:N \l__examzh_calculations_store_seq +% 上面的 seq 的 item 数 +\int_new:N \l__examzh_calculations_store_seq_item_int +% 最终放在 tblr 里的内容 +\tl_new:N \l__examzh_calculations_tblr_content_tl + + + +% #1: 设置 calculations +% #2: 设置里面的 tblr +\NewDocumentEnvironment { calculations } { O{ } +O{ } } + { + \group_begin: + \RenewDocumentCommand \item { O{ } } + { \__examzh_calculations_item:n {##1} } + \int_set:Nn \l__examzh_calculations_item_index_int {0} + \seq_clear:N \l__examzh_calculations_store_seq + \tl_clear:N \l__examzh_calculations_tblr_content_tl + \keys_set:nn { exam-zh / calculations } {#1} + } + { + % 结束收集 + \unskip + \end{varwidth} + % \end{minipage} + \hcoffin_set_end: + % 拼接 label 和 figure + \__examzh_calculations_coffin_join: + % 输出 + \__examzh_calculations_coffin_typeset:n {#2} + % \par \int_use:N \l__examzh_calculations_item_index_int + \group_end: + } +% 拼接 label 和 figure +\cs_new:Npn \__examzh_calculations_coffin_join: + { + \int_step_inline:nn { \l__examzh_calculations_item_index_int } + { + \__examzh_calculations_coffin_join_position_set:n {##1} + \seq_gput_right:Nn \l__examzh_calculations_store_seq + { + \__examzh_calculations_coffin_align_set:n {##1} + \kern\l__examzh_calculations_hsep_skip + } + } + } +\cs_new:Npn \__examzh_calculations_coffin_align_set:n #1 + { + \str_case:Vn \l__examzh_calculations_coffin_align_str + { + {t} { \__examzh_calculations_coffin_align_set_t:n {#1} } + {m} { \__examzh_calculations_coffin_align_set_m:n {#1} } + {b} { \__examzh_calculations_coffin_align_set_b:n {#1} } + } + } +\cs_new:Npn \__examzh_calculations_coffin_align_set_t:n #1 + { + \coffin_typeset:cnnnn + { l__examzh_calculations_figure_ \int_to_roman:n { #1 } _coffin } + { l } { t } % align = t + { \l__examzh_calculations_xshift_dim } { \l__examzh_calculations_yshift_dim + 1em } + } +\cs_new:Npn \__examzh_calculations_coffin_align_set_m:n #1 + { + \coffin_typeset:cnnnn + { l__examzh_calculations_figure_ \int_to_roman:n { #1 } _coffin } + { l } { vc } % align = m + { \l__examzh_calculations_xshift_dim } { \l__examzh_calculations_yshift_dim } + } +\cs_new:Npn \__examzh_calculations_coffin_align_set_b:n #1 + { + \coffin_typeset:cnnnn + { l__examzh_calculations_figure_ \int_to_roman:n { #1 } _coffin } + { l } { b } % align = b + { \l__examzh_calculations_xshift_dim } { \l__examzh_calculations_yshift_dim } + } +\cs_new:Npn \__examzh_calculations_coffin_join_position_set:n #1 + { + \use:c { __examzh_calculations_coffin_join_position_set_ \l__examzh_calculations_figure_position_str :n } {#1} + } +\cs_new:cpn { __examzh_calculations_coffin_join_position_set_left-top :n } #1 + { + \coffin_join:cnncnnnn + { l__examzh_calculations_figure_ \int_to_roman:n {#1} _ coffin } + { l } { t } + { l__examzh_calculations_label_ \int_to_roman:n {#1} _ coffin } + { r } { b } + { \l__examzh_calculations_label_xshift_dim } + { \l__examzh_calculations_label_yshift_dim -10.6pt} + } +\cs_new:Npn \__examzh_calculations_coffin_join_position_set_top:n #1 + { + \coffin_join:cnncnnnn + { l__examzh_calculations_figure_ \int_to_roman:n {#1} _ coffin } + { hc } { b } + { l__examzh_calculations_label_ \int_to_roman:n {#1} _ coffin } + { hc } { t } + { \l__examzh_calculations_label_xshift_dim } + { \l__examzh_calculations_label_yshift_dim - 6pt } + } +\cs_set_eq:NN + \__examzh_calculations_coffin_join_position_set_above:n + \__examzh_calculations_coffin_join_position_set_top:n +\cs_new:Npn \__examzh_calculations_coffin_join_position_set_bottom:n #1 + { + \coffin_join:cnncnnnn + { l__examzh_calculations_figure_ \int_to_roman:n {#1} _ coffin } + { hc } { t } + { l__examzh_calculations_label_ \int_to_roman:n {#1} _ coffin } + { hc } { b } + { \l__examzh_calculations_label_xshift_dim } + { \l__examzh_calculations_label_yshift_dim + 6pt } + } +\cs_set_eq:NN + \__examzh_calculations_coffin_join_position_set_below:n + \__examzh_calculations_coffin_join_position_set_bottom:n +\cs_new:Npn \__examzh_calculations_coffin_join_position_set_left:n #1 + { + \coffin_join:cnncnnnn + { l__examzh_calculations_figure_ \int_to_roman:n {#1} _ coffin } + { l } { vc } + { l__examzh_calculations_label_ \int_to_roman:n {#1} _ coffin } + { r } { vc } + { \l__examzh_calculations_label_xshift_dim - 6pt } + { \l__examzh_calculations_label_yshift_dim } + } +\cs_new:Npn \__examzh_calculations_coffin_join_position_set_right:n #1 + { + \coffin_join:cnncnnnn + { l__examzh_calculations_figure_ \int_to_roman:n {#1} _ coffin } + { r } { vc } + { l__examzh_calculations_label_ \int_to_roman:n {#1} _ coffin } + { l } { vc } + { \l__examzh_calculations_label_xshift_dim + 2pt } + { \l__examzh_calculations_label_yshift_dim } + } +\cs_new:Npn \__examzh_calculations_coffin_typeset:n #1 + { + \__examzh_calculations_coffin_typeset_count: + \seq_map_indexed_inline:Nn \l__examzh_calculations_store_seq + % ##1: index + % ##2: content + { + \int_compare:nNnTF { \int_mod:nn {##1} { \l__examzh_calculations_column_int } } = {0} + { + \tl_gput_right:Nn \l__examzh_calculations_tblr_content_tl + { ##2 \\[\l__examzh_calculations_vsep_skip] } + } + { + \tl_gput_right:Nn \l__examzh_calculations_tblr_content_tl + { ##2 & } + } + } + % 如果 seq 的 item 比 column 多且不整除 column 的话,要补 & + \int_compare:nNnT { \l__examzh_calculations_store_seq_item_int } > { \l__examzh_calculations_column_int } + { + \int_compare:nNnF { \l__examzh_calculations_item_num_mod_column_left_int } = { 0 } + { + \tl_gput_right:Nx \l__examzh_calculations_tblr_content_tl + { + \prg_replicate:nn { \l__examzh_calculations_item_num_mod_column_left_int -1 } {&} + } + % \int_use:N \l__examzh_calculations_item_num_mod_column_left_int + } + } + \par + \vspace*{ \l__examzh_calculations_top_sep_skip } + \noindent + % \centering + % \SetTblrInner + % { + % rowsep = 4pt, + % % colsep = 0pt + % } + \begin{tblr} + [ expand = \l__examzh_calculations_tblr_content_tl ] + { + width = \linewidth, + columns = + { + l, + leftsep = 0em, + rightsep = 0pt, + }, + rows = + { + m, + ht=\baselineskip, + abovesep = 0pt, + belowsep = 0pt, + }, + stretch=0, + #1 + } + \l__examzh_calculations_tblr_content_tl + \end{tblr} + \vspace*{ \l__examzh_calculations_bottom_sep_skip } + \par + } +\int_new:N \l__examzh_calculations_item_num_mod_column_left_int +\cs_new:Npn \__examzh_calculations_coffin_typeset_count: + { + % 计算 seq 有多少项 + \int_set:Nn \l__examzh_calculations_store_seq_item_int + { \seq_count:N \l__examzh_calculations_store_seq } + % seq 项数小于 column 的话,column 设置为 seq 项数 + \int_compare:nNnTF { \l__examzh_calculations_store_seq_item_int } < { \l__examzh_calculations_column_int } + { \int_set_eq:NN \l__examzh_calculations_column_int \l__examzh_calculations_store_seq_item_int } + { + % 计算 \l__examzh_calculations_store_seq_item_int mod \l__examzh_calculations_column_int 的余数,用于补 & + \int_set:Nn \l__examzh_calculations_item_num_mod_column_left_int { \int_mod:nn { \l__examzh_calculations_store_seq_item_int } { \l__examzh_calculations_column_int } } + } + } + +\cs_new:Npn \__examzh_calculations_item:n #1 + { + % 增加指标(g 是关键) + \int_gincr:N \l__examzh_calculations_item_index_int + % 新建 coffin + \__examzh_calculations_item_new_coffin: + % 储存 label(一直出不来的原因是因为没改成 gset) + \hcoffin_gset:cn + { l__examzh_calculations_label_ \int_to_roman:n { \l__examzh_calculations_item_index_int } _coffin } + { + % 加上 index 键值设置的偏移量才是最终的 index + % (\int_eval:n { \l__examzh_calculations_item_index_int + \l__examzh_calculations_label_index_shift_int - 1} ) + % 如果 \item 的[] 中没内容,则需要把 label 升高 + % \tl_if_blank:nTF {#1} + % { + % \box_move_up:nn { 2.7pt } { \hbox{\__examzh_calculations_the_label:} } + % \space + % #1 + % } + % { + % \__examzh_calculations_the_label: #1 + % } + % \IfBooleanTF{#1}{#1 yes}{#1 no} + % \IfNoValueTF{#1} + % { + % \dim_set:Nn \l__examzh_calculations_label_yshift_dim { 4pt } + % }{#1 yes} + } + % 储存 figure + \int_compare:nNnF { \l__examzh_calculations_item_index_int } = {1} + { + \unskip + \end{varwidth} + % \end{minipage} + % 结束上一个 item 的收集 + \hcoffin_set_end: + } + % 收集 + \hcoffin_set:cw { l__examzh_calculations_figure_ \int_to_roman:n { \l__examzh_calculations_item_index_int } _coffin } + % \begin{varwidth}{\hsize} + % 根据 columns 个数设置宽度 + \__examzh_calculations_item_varwidth_width_set: + \begin{varwidth}{\l__examzh_calculations_item_varwidth_width_dim} + % \begin{minipage}{8cm} + \ignorespaces + \makebox[0em]{\rule{0pt}{\baselineskip}} + \__examzh_calculations_the_label: + } +\dim_new:N \l__examzh_calculations_item_varwidth_width_dim +\cs_new:Npn \__examzh_calculations_item_varwidth_width_set: + { + \int_case:nnF { \l__examzh_calculations_column_int } + { + {1} { \dim_set:Nn \l__examzh_calculations_item_varwidth_width_dim {0.8 \textwidth} } + {2} { \dim_set:Nn \l__examzh_calculations_item_varwidth_width_dim {0.3 \textwidth} } + {3} { \dim_set:Nn \l__examzh_calculations_item_varwidth_width_dim {0.3 \textwidth} } + {4} { \dim_set:Nn \l__examzh_calculations_item_varwidth_width_dim {0.2 \textwidth} } + } + { \dim_set:Nn \l__examzh_calculations_item_varwidth_width_dim { \hsize } } + } + +% 新建 coffin +\cs_new:Npn \__examzh_calculations_item_new_coffin: + { + % 放图片的 coffin + \coffin_if_exist:cF { l__examzh_calculations_figure_ \int_to_roman:n { \l__examzh_calculations_item_index_int } _coffin } + { \coffin_new:c { l__examzh_calculations_figure_ \int_to_roman:n { \l__examzh_calculations_item_index_int } _coffin } } + % 放 label 的 coffin + \coffin_if_exist:cF { l__examzh_calculations_label_ \int_to_roman:n { \l__examzh_calculations_item_index_int } _coffin } + { \coffin_new:c { l__examzh_calculations_label_ \int_to_roman:n { \l__examzh_calculations_item_index_int } _coffin } } + } + +\tl_new:N \l__examzh_calculations_counters_commands_set_tl + +\keys_define:nn { exam-zh / calculations } + { + label .tl_set:N = \l__examzh_calculations_label_tl + } +\keys_set:nn { exam-zh / calculations } + { + label = \arabic* + } + +\cs_new:Npn \__examzh_calculations_the_label: + { + \group_begin: + % 定义计数器相关的命令函数 + \l__examzh_calculations_counters_commands_set_tl + % 输出处理后的 label + \l__examzh_calculations_label_tl + \group_end: + } + +\NewDocumentCommand \AddCalculationsCounter { m m } + { + % 生成用户层命令 + \tl_put_right:Nn \l__examzh_calculations_counters_commands_set_tl + { \__examzh_process_counter:NNn #1 #2 { calculations } } + % 把核心函数存起来 + \cs_set_eq:cN { __examzh_calculations_save_ \cs_to_str:N #1 : } #2 + \cs_set_eq:cN { __examzh_calculations_save_ \cs_to_str:N #2 : } #2 + } + +\AddCalculationsCounter \arabic \@arabic +\AddCalculationsCounter \alph \@alph +\AddCalculationsCounter \Alph \@Alph +\AddCalculationsCounter \roman \@roman +\AddCalculationsCounter \Roman \@Roman + +\cs_new:Npn \__examzh_calculations_process_counter_aux:Nn #1#2 + { + \tl_if_eq:nnTF {#2} { * } + { + % \Alph* + \use:c { __examzh_calculations_save_ \cs_to_str:N #1 : } + { \int_eval:n { \l__examzh_calculations_item_index_int + \l__examzh_calculations_label_index_shift_int } } + } + { + % \Alph{...} + \use:c { __examzh_calculations_save_ \cs_to_str:N #1 : } + {#2} + } + }
\ No newline at end of file diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-question.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-question.sty index f1de989e6e..8fae81e43e 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh-question.sty +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-question.sty @@ -9,7 +9,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {exam-zh-question} {2023-06-28} {v0.1.27} +\ProvidesExplPackage {exam-zh-question} {2024-02-11} {v0.2.1} {exam-zh question module} @@ -205,7 +205,7 @@ index = 1, points = 0 , show-points = auto , - points-separate-par = true , + points-separate-par = false , show-answer = false , top-sep = .25em plus .25em minus .1em , bottom-sep = .25em plus .25em minus .1em , @@ -229,6 +229,20 @@ \group_end: } {} +% \NewDocumentEnvironment { question } { O { } } +% { +% % \bool_set_false:N \l__examzh_question_problem_style_bool +% \group_begin: +% \group_begin: +% \tcbverbatimwrite { \jobname-tempfile.exam } +% } +% { +% \endtcbverbatimwrite +% \group_end: +% \__examzh_question_begin:nn {#1} { \input{\jobname-tempfile.exam} } +% \__examzh_question_end:nn {#1} { \input{\jobname-tempfile.exam} } +% \group_end: +% } % 解答题 \NewDocumentEnvironment { problem } { O { } +b } @@ -1003,7 +1017,9 @@ } \keys_define:nn { exam-zh } { paren .meta:nn = { exam-zh / paren } {#1} } -\NewDocumentCommand \paren { O { } } + +% TODO:在 paren 里面增加键值控制 +\NewDocumentCommand \paren { s O { } } { % 如果开了 show answer 就默认 show paren \bool_if:NT \l__examzh_question_show_paren_answer_bool @@ -1026,11 +1042,25 @@ \hbox:n { ( - \hbox_to_wd:nn { 3em } - { - \bool_if:NT \l__examzh_question_show_paren_answer_bool - { \hfill \__examzh_paren_print_answer:n {#1} \hfill } - } + % \hbox_to_wd:nn { 2em } + % { + \bool_if:NTF \l__examzh_question_show_paren_answer_bool + % { \hfill \__examzh_paren_print_answer:n {#1} \hfill } + { + \IfBlankTF{#2} + { + % 显示答案,但是 \paren 里没有输入答案 + \kern 2em + } + { + \kern0.7em \__examzh_paren_print_answer:n {#2} \kern0.7em + } + } + { + % \paren* 表示不显示答案时是长宽度,\paren 表示不显示答案时是短宽度 + \IfBooleanTF{#1}{ \kern 3em }{ \kern 2em } + } + % } ) \kern -.4em } } @@ -1085,7 +1115,7 @@ { \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, + box-color .tl_set:N = \l__examzh_fillin_box_color_tl, text-color .tl_set:N = \l__examzh_fillin_text_color_tl, no-answer-type .choices:nn = { blacktriangle, counter, none, hidden } @@ -1104,7 +1134,7 @@ type = line, show-answer = false, width = 3em, - color = black, + box-color = black, text-color = black, no-answer-type = blacktriangle, no-answer-counter-index = 1, @@ -1514,7 +1544,7 @@ { rounded~rectangle~west~arc = convex, draw, rounded~rectangle, - color = \l__examzh_fillin_color_tl, text = \l__examzh_fillin_text_color_tl + color = \l__examzh_fillin_box_color_tl, text = \l__examzh_fillin_text_color_tl } } \cs_new:Npn \__examzh_fillin_circle_T: @@ -1541,7 +1571,7 @@ { \hspace* { .5em minus .5em } \begin{tikzpicture}[baseline = -3pt] - \node[draw, color = \l__examzh_fillin_color_tl, text = \l__examzh_fillin_text_color_tl] + \node[draw, color = \l__examzh_fillin_box_color_tl, text = \l__examzh_fillin_text_color_tl] { \box_use_drop:N \l_tmpa_box }; \end{tikzpicture} \hspace* { .5em minus .5em } @@ -1550,7 +1580,7 @@ { \hspace* { 0.5em plus .5em minus .5em } \begin{tikzpicture}[baseline = -3pt] - \node[draw, color = \l__examzh_fillin_color_tl, text = \l__examzh_fillin_text_color_tl] + \node[draw, color = \l__examzh_fillin_box_color_tl, text = \l__examzh_fillin_text_color_tl] { \phantom{a} }; \end{tikzpicture} \hspace* { 0.5em plus .5em minus .5em } @@ -1641,10 +1671,27 @@ } \str_new:N \l__examzh_solution_blank_type_str +\bool_new:N \g__examzh_solution_show_bool +\bool_new:N \g__examzh_solution_show_move_bool \keys_define:nn { exam-zh / solution } { - show-solution .bool_set:N = \l__examzh_solution_show_bool, - show-answer .bool_set:N = \l__examzh_solution_show_bool, + % show-solution .bool_set:N = \g__examzh_solution_show_bool, + show-solution .choice:, + show-solution / hide .code:n = + { + \bool_gset_false:N \g__examzh_solution_show_bool + }, + show-solution / show-stay .code:n = + { + \bool_gset_true:N \g__examzh_solution_show_bool + \bool_gset_false:N \g__examzh_solution_show_move_bool + }, + show-solution / show-move .code:n = + { + \bool_gset_true:N \g__examzh_solution_show_bool + \bool_gset_true:N \g__examzh_solution_show_move_bool + }, + % show-answer .bool_set:N = \g__examzh_solution_show_bool, show-qed .bool_set:N = \l__examzh_solution_show_qed_bool, qedsymbol .tl_set:N = \l__examzh_solution_qedsymbol_tl, label-content .tl_set:N = \l__examzh_solution_label_content_tl, @@ -1666,7 +1713,7 @@ } \keys_set:nn { exam-zh / solution } { - show-solution = false, + show-solution = hide, show-qed = true, qedsymbol = $\square$, label-content = {解答}, @@ -1685,18 +1732,45 @@ \keys_define:nn { exam-zh } { solution .meta:nn = { exam-zh / solution } {#1} } % 解答题环境 +\iow_new:N \g__write_soltion_to_auxfile +% 生成变体函数 +\cs_generate_variant:Nn \iow_open:Nn { Nx } +\int_new:N \g__examzh_solution_aux_index_int \NewDocumentEnvironment { solution } { O{ } +b } { % \addvspace { \l__examzh_solution_top_sep_skip } \keys_set:nn { exam-zh / solution } {#1} % 放在这是使得 \examsetup 设置 qedsymbol 可以放在正文区 \cs_set_eq:NN \qedsymbol \l__examzh_solution_qedsymbol_tl - \bool_if:NTF \l__examzh_solution_show_bool + \bool_if:NTF \g__examzh_solution_show_bool { - \vspace { \l__examzh_solution_top_sep_skip } - \__examzh_solution_print_answer:n {#2} - \par - \vspace { \l__examzh_solution_bottom_sep_skip } + \bool_if:NTF \g__examzh_solution_show_move_bool + { + % 这个方法成功 + \iow_open:Nn \g__write_soltion_to_auxfile {examzh \int_use:N \g__examzh_question_index_int .solution} + \iow_now:Nx \g__write_soltion_to_auxfile + { + \par \noindent + \int_eval:n { \g__examzh_question_index_int - 1 }. 【解析】 + \exp_not:n {#2} + \par \exp_not:n { \vspace*{1ex} } + } + \iow_close:N \g__write_soltion_to_auxfile + + % 下面的方法失败 + % \group_begin: + % \tl_set:Nn \tcb@verbatim@begin@hook + % { \iow_now:Nx \tcb@out { \int_use:N \g__examzh_question_index_int } } + % \tcbverbatimwrite {examzh \int_use:N \g__examzh_question_index_int .solution} #2 + % \endtcbverbatimwrite + % \group_end: + } + { + \vspace { \l__examzh_solution_top_sep_skip } + \__examzh_solution_print_answer:n {#2} + \par + \vspace { \l__examzh_solution_bottom_sep_skip } + } } { \str_case:VnF \l__examzh_solution_blank_type_str @@ -1712,6 +1786,31 @@ % \addvspace { \l__examzh_solution_bottom_sep_skip } } {} + +\AtEndDocument + { + \bool_if:NT \g__examzh_solution_show_move_bool + { + \newpage + \begin{center} + \zihao{-2} \heiti \makebox[5em][s]{参考答案} + \end{center} + \vspace*{3ex} + + \kaishu + \int_compare:nNnT { \g__examzh_question_index_int } > { 0 } + { + \int_step_inline:nn { \g__examzh_question_index_int } + { + \file_if_exist:nT { examzh #1 .solution } + { \file_input:n { examzh #1 .solution } } + } + } + } + } + + + \cs_new:Npn \__examzh_solution_simply_hide_solution:n #1 { \begin{tcolorbox} diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-symbols.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-symbols.sty index 3dc3c57c2a..cce55928f6 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh-symbols.sty +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-symbols.sty @@ -8,7 +8,7 @@ \RequirePackage{expl3} -\ProvidesExplPackage {exam-zh-symbols} {2023-06-28} {v0.1.27} +\ProvidesExplPackage {exam-zh-symbols} {2024-02-11} {v0.2.1} {exam-zh symbols module} \RequirePackage { tikz } diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh-textfigure.sty b/macros/xetex/latex/exam-zh/tex/exam-zh-textfigure.sty index bbc4bedac2..656617da98 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh-textfigure.sty +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-textfigure.sty @@ -7,7 +7,7 @@ \RequirePackage{expl3} -\ProvidesExplPackage {exam-zh-textfigure} {2023-06-28} {v0.1.27} +\ProvidesExplPackage {exam-zh-textfigure} {2024-02-11} {v0.2.1} {exam-zh text with figure module} @@ -345,6 +345,18 @@ { \str_set:NV \l__examzh_textfigure_current_figure_position_str \l_keys_choice_tl }, + pos .choices:nn = + { + left , right , top , bottom , + top-left , top-right , top-center , + top-flushright , bottom-flushright , + bottom-left , bottom-right , bottom-center , + right-top , right-bottom , right-center , + left-top , left-bottom , left-center + } + { + \str_set:NV \l__examzh_textfigure_current_figure_position_str \l_keys_choice_tl + }, % figure-yshift:调整图片的垂直额外偏移量 figure-yshift .dim_set:N = \l__examzh_textfigure_figure_yshift_dim, figure-vshift .dim_set:N = \l__examzh_textfigure_figure_yshift_dim, @@ -375,15 +387,15 @@ \keys_set:nn { exam-zh / textfigure } { - fig-pos = right, + fig-pos = bottom-right, yshift = .5\baselineskip, - text-width = \columnwidth, + text-width = \textwidth, figure-width = \columnwidth, - text-ratio = 0.95, + text-ratio = 1, top-sep = 0pt, bottom-sep = 1.5ex plus .5ex minus 0.5ex, top = 0, - parindent = 2em + parindent = 0em } diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh.cls b/macros/xetex/latex/exam-zh/tex/exam-zh.cls index e75c5f4d32..e4ba177bec 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh.cls +++ b/macros/xetex/latex/exam-zh/tex/exam-zh.cls @@ -6,7 +6,7 @@ \NeedsTeXFormat{LaTeX2e}[2017/04/15] \RequirePackage{expl3} -\ProvidesExplClass {exam-zh} {2023-06-28} {v0.1.27} {LaTeX template for Chinese exam} +\ProvidesExplClass {exam-zh} {2024-02-11} {v0.2.1} {LaTeX template for Chinese exam} % 检查 LaTeX2e kernel 版本 \msg_new:nnn { exam-zh } { latex-too-old } @@ -87,6 +87,7 @@ \RequirePackage { exam-zh-symbols } \RequirePackage { exam-zh-chinese-english } \RequirePackage { exam-zh-textfigure } +\RequirePackage { exam-zh-math } \AtEndPreamble { @@ -418,6 +419,8 @@ } \clearpage } + % 修复 section 的超链接跳转问题 + \int_gincr:N \c@chapter } % 纸张和页面布局 |