diff options
Diffstat (limited to 'macros/xetex/latex/exam-zh')
16 files changed, 176 insertions, 93 deletions
diff --git a/macros/xetex/latex/exam-zh/CHANGELOG.md b/macros/xetex/latex/exam-zh/CHANGELOG.md index f52160370d..f785a3fc42 100644 --- a/macros/xetex/latex/exam-zh/CHANGELOG.md +++ b/macros/xetex/latex/exam-zh/CHANGELOG.md @@ -5,6 +5,16 @@ 格式参照 [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 并且此项目遵守 [Semantic Versioning](https://semver.org/spec/v2.0.0.html)。 +## [0.1.18] - 2022-08-15 + +### Added + +- 增加新的字体 + +### Changed + +- 修改示例文件的部分代码 + ## [0.1.17] - 2022-08-12 ### Added diff --git a/macros/xetex/latex/exam-zh/doc/body/installation.tex b/macros/xetex/latex/exam-zh/doc/body/installation.tex index 445330d0c5..04c414caac 100644 --- a/macros/xetex/latex/exam-zh/doc/body/installation.tex +++ b/macros/xetex/latex/exam-zh/doc/body/installation.tex @@ -1,10 +1,24 @@ % !TeX root = ../exam-zh-doc.tex -\section{安装} +\section{安装与更新} -\subsection{获取 \cls{exam-zh}} -目前模块还处于开发阶段,用户目前以「下载发行版」的方式获取最新版本的 \cls{exam-zh}: +\subsection{标准安装} + +目前 \cls{exam-zh} 已经上传 CTAN,您可以使用宏包管理器安装 \cls{exam-zh}。 +例如在 \TeXLive{} 中,执行(可能需要管理员权限) +\begin{shellcode}[morekeywords={tlmgr,install}] + tlmgr install exam-zh +\end{shellcode} +即可完成安装。 + +在 \TeXLive{} 和 \MiKTeX{} 中,您还可以通过图形界面进行安装, +此处不再赘述。 + + +\subsection{手动安装} + +您也可以通过访问 gitee 项目主页的方式获取最新版本的 \cls{exam-zh}(通常情况下,gitee 的版本会大于等于CTAN 的版本(因为 CTAN 从上传到审核到用户可以下载需要一天左右))。主要以「下载发行版」的方式获取最新版本的 \cls{exam-zh}: \begin{enumerate} \item 进入项目主页(\href{https://gitee.com/zepinglee/exam-zh}{gitee 项目主页} (界面见图~\ref{figure:gitee项目主页} ) @@ -35,58 +49,6 @@ \label{figure:gitee发行版} \end{figure} -% % \subsubsection{标准安装} - -% % 如果没有特殊理由,始终建议您使用宏包管理器安装 \cls{exam-zh}。 -% % 例如在 \TeXLive{} 中,执行(可能需要管理员权限) -% % \begin{shellexample}[morekeywords={tlmgr,install}] -% % tlmgr install exam-zh -% % \end{shellexample} -% % 即可完成安装。 - -% % 在 \TeXLive{} 和 \MiKTeX{} 中,您还可以通过图形界面进行安装, -% % 此处不再赘述。 - -% % \subsubsection{手动安装} - -% % 如果您需要从 CTAN 上自行下载并手动安装,较好的方法是使用 TDS -% % 安装包: -% % \begin{itemize} -% % \item 从 CTAN 上下载 \cls{exam-zh} 的 -% % \href{http://mirror.ctan.org/install/macros/latex/contrib/exam-zh.tds.zip}{TDS 安装包}; -% % \item 按目录结构将 \file{exam-zh.tds.zip} 中的文件复制到 \TeX{} -% % 发行版的本地 TDS 根目录; -% % \item 执行 \bashcmd{mktexlsr} 刷新文件名数据库以完成安装。 -% % \end{itemize} -% % % -% % 您也可以从源代码直接生成模板(不推荐): -% % \begin{itemize} -% % \item 打开 \href{https://gitee.com/stone-zeng/exam-zh}{项目主页}, -% % 点击“Code”按钮,并选择“Download ZIP”,下载 \file{exam-zh-main.zip}; -% % 如果您的电脑中安装有 git 程序,也可通过以下命令直接克隆代码仓库: -% % \begin{shellexample}[gobble=6,alsoletter={.},morekeywords={git,clone}] -% % git clone https://gitee.com/stone-zeng/exam-zh.git -% % \end{shellexample} -% % \item 解压并进入到 \file{source} 文件夹,执行以下命令以生成 -% % 模板的各组件: -% % \begin{shellexample}[gobble=6,morekeywords={xetex}] -% % xetex exam-zh.dtx -% % \end{shellexample} -% % \item 将生成的文档类(\file{.cls})、宏包(\file{.sty})以及 -% % 参数配置文件(\file{.def})复制到 \TeX{} 发行版本地 TDS 树 -% % 的 \path{texmf-local/tex/latex/exam-zh/} 目录下,并执行 -% % \bashcmd{mktexlsr} 刷新文件名数据库,方可完成安装。 -% % \item 使用 \cls{exam-zh} 撰写论文时,您还需要从代码仓库下的 -% % \file{testfiles/support} 目录中复制 \file{fudan-name.pdf} -% % 文件至工作目录,以确保封面中的校名图片可以正确显示。 -% % \end{itemize} - -% % \subsubsection{扁平化安装} - -% % 如果您不希望安装本模板,但需要立刻使用,也可以使用模板提供的安装脚本。 -% % 从 gitee 上获取代码仓库后,执行 \file{install-win.bat}(Windows 系统) -% % 或 \file{install-linux.sh}(Linux 系统),所有需要的文件便会在 -% % \file{thesis} 文件夹中生成。 \subsection{模板组成} diff --git a/macros/xetex/latex/exam-zh/doc/body/usage.tex b/macros/xetex/latex/exam-zh/doc/body/usage.tex index 95bc41224a..56e0f25739 100644 --- a/macros/xetex/latex/exam-zh/doc/body/usage.tex +++ b/macros/xetex/latex/exam-zh/doc/body/usage.tex @@ -1416,16 +1416,16 @@ \subsubsection{字体} -\begin{function}{font} +\begin{function}[updated = 2022-08-15]{font} \begin{ccnusyntax}[emph={[1]font}] font = (*(newcm)|lm|times|termes|stix|xits|libertinus|none*) \end{ccnusyntax} 设置西文字体。具体配置见表~\ref{tab:font}。 \end{function} -\begin{function}{math-font} +\begin{function}[updated = 2022-08-15]{math-font} \begin{ccnusyntax}[emph={[1]math-font}] - math-font = (*(newcm)|lm|termes|stix|xits|libertinus|cambria|none*) + math-font = (*(newcm)|lm|stix|xits|libertinus|cambria|garamond|pala|asana|none*) \end{ccnusyntax} 设置数学字体。具体配置见表~\ref{tab:math-font}。 \end{function} @@ -1448,6 +1448,8 @@ |stix| & STIXTwoText\tnote{a} & texgyreheros & texgyrecursor \\ |xits| & XITS\tnote{b} & texgyreheros & texgyrecursor \\ |libertinus| & LibertinusSerif\tnote{c} & LibertinusSans\tnote{d} & lmmonolt10 \\ + |garamond| & EB Garamond & Biolinum & tgcursor\\ + |pala| & tgpagella & tgheros & tgcursor\\ \bottomrule \end{tabular} \begin{tablenotes} @@ -1475,6 +1477,9 @@ |xits| & XITSMath-Regular\tnote{b} & & & \\ |libertinus| & LibertinusMath-Regular\tnote{c} & & & \\ |cambria| & Cambria Math & & & \\ + |pala| & tgpagella-math & & & \\ + |garamond| & Garamond-Math & & & \\ + |asana| & Asana Math & & & \\ \bottomrule \end{tabular} \begin{tablenotes} 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 987f7b8889..d6aa6a6a0b 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 @@ -32,7 +32,7 @@ \title{\textcolor{MaterialIndigo800}{% \textbf{exam-zh: 高考试卷 \LaTeX \xpinyin[font=\sffamily,format=\color{MaterialIndigo800}]{模}{mu2}板}}} \author{李泽平,夏康玮,郭李军} -\date{2022/08/12\quad v0.1.17% +\date{2022/08/15\quad v0.1.18% \thanks{% \url{https://gitee.com/zepinglee/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 d748b9e7ec..f4ee4463f3 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/examples/example-multiple.pdf b/macros/xetex/latex/exam-zh/examples/example-multiple.pdf Binary files differindex c60c53e81e..7e2e1ca87e 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-multiple.tex b/macros/xetex/latex/exam-zh/examples/example-multiple.tex index 7f8b695026..0a134480a6 100644 --- a/macros/xetex/latex/exam-zh/examples/example-multiple.tex +++ b/macros/xetex/latex/exam-zh/examples/example-multiple.tex @@ -12,7 +12,6 @@ show-columnline = false }, style/fullwidth-stop = catcode, - fillin/no-answer-type = none, sealline = { show = true, scope = mod-2, 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 e5ed1a8d33..d70946bd46 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 04206986cd..89c04bf74d 100644 --- a/macros/xetex/latex/exam-zh/examples/example-single.tex +++ b/macros/xetex/latex/exam-zh/examples/example-single.tex @@ -4,9 +4,9 @@ \examsetup{ page/size=a4paper, paren/show-paren=true, - paren/show-answer=true, - fillin/show-answer=true, - solution/show-solution=true, + paren/show-answer=false, + fillin/show-answer=false, + solution/show-solution=false, } \ExamPrintAnswerSet{ @@ -28,11 +28,11 @@ \begin{document} -\information{ - 姓名\underline{\hspace{6em}}, - 座位号\underline{\hspace{15em}} -} -\warning{(在此卷上答题无效)} +% \information{ +% 姓名\underline{\hspace{6em}}, +% 座位号\underline{\hspace{15em}} +% } +% \warning{(在此卷上答题无效)} \secret diff --git a/macros/xetex/latex/exam-zh/examples/example-single_student_version.pdf b/macros/xetex/latex/exam-zh/examples/example-single_student_version.pdf Binary files differdeleted file mode 100644 index ffcc32d9f5..0000000000 --- a/macros/xetex/latex/exam-zh/examples/example-single_student_version.pdf +++ /dev/null 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 3d95350b1e..b2d1d39baf 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} {2022-08-12} {v0.1.17} +\ProvidesExplPackage {exam-zh-chinese-english} {2022-08-15} {v0.1.18} {exam-zh chinese and english module} \PassOptionsToPackage { tcolorbox } { most } @@ -667,4 +667,6 @@ } { \end{tcolorbox} - }
\ No newline at end of file + } + +\endinput
\ No newline at end of file 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 3a7d9f7d2c..ef7c39ba88 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} {2022-08-12} {v0.1.17} +\ProvidesExplPackage {exam-zh-choices} {2022-08-15} {v0.1.18} {exam-zh choices module} \dim_new:N \l__examzh_choices_column_sep_dim @@ -552,4 +552,6 @@ % - 表格形式 % 答案确定 -% 通过 \item 是否带 * 判断,有的话则标记为正确答案
\ No newline at end of file +% 通过 \item 是否带 * 判断,有的话则标记为正确答案 + +\endinput
\ No newline at end of file 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 d342229cc1..cda4062101 100644 --- a/macros/xetex/latex/exam-zh/tex/exam-zh-font.sty +++ b/macros/xetex/latex/exam-zh/tex/exam-zh-font.sty @@ -1,5 +1,5 @@ % -% Copyright (c) 2022 Zeping Lee +% Copyright (c) 2022 Zeping Lee and AlphaZTX % Released under the LaTeX Project Public License v1.3c License. % Repository: https://gitee.com/zepinglee/exam-zh % @@ -9,7 +9,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} -\ProvidesExplPackage {exam-zh-font} {2022-08-12} {v0.1.17} +\ProvidesExplPackage {exam-zh-font} {2022-08-15} {v0.1.18} {exam-zh font module} \RequirePackage { unicode-math } @@ -23,14 +23,15 @@ { font .choices:nn = { - newcm , + garamond , + libertinus , lm , - times , + newcm , + pala , + stix , termes , - stix, + times , xits , - libertinus , - % newtx , none } { @@ -39,14 +40,16 @@ } , math-font .choices:nn = { - newcm , + asana , + cambria , + garamond , + libertinus , lm , + newcm , + pala , + stix , termes , - stix, xits , - libertinus , - cambria , - % newtx , none } { @@ -139,6 +142,52 @@ \examzh_font_set_tex_gyre_sans_mono: } + +% Garamond (实际上是 EB Garamond) +\cs_new:Npn \examzh_font_set_font_garamond: + { + \setmainfont { EBGaramond } + [ + Extension = .otf , + UprightFont = *-Regular , + BoldFont = *-Bold , + ItalicFont = *-Italic , + BoldItalicFont = *-BoldItalic , + ] + \setsansfont { LinBiolinum } + [ + Extension = .otf , + UprightFont = *_R , + BoldFont = *_RB , + ItalicFont = *_RI , + BoldItalicFont = *_RBO , + ] + \setmonofont { texgyrecursor } + [ + Extension = .otf , + UprightFont = *-regular , + BoldFont = *-bold , + ItalicFont = *-italic , + BoldItalicFont = *-bolditalic , + ] + } + + +% Palatino (TeX Gyre Pagella) +\cs_new:Npn \examzh_font_set_font_pala: + { + \setmainfont { texgyrepagella } + [ + Extension = .otf , + UprightFont = *-regular , + BoldFont = *-bold , + ItalicFont = *-italic , + BoldItalicFont = *-bolditalic , + ] + \examzh_font_set_tex_gyre_sans_mono: + } + +% TeX Gyre Heros / Cursor \cs_new:Npn \examzh_font_set_tex_gyre_sans_mono: { \setsansfont { texgyreheros } @@ -553,8 +602,46 @@ Extension = .otf, range = { \complement } , ] + \message + { + Please~note~that~the~Cambria~font~family~cannot~be~used~on~commercial~purpose~unless~you~are~using~Windows~7/8/10/11~PROFESSIONAL. + } } +% 新增的 asana, garamond, pala +\cs_new:Npn \examzh_font_set_math_font_asana: + { + \setmathfont { Asana-Math.otf } + \examzh_font_set_stix_names: + \setmathfont { \g__examzh_font_font_name_stix_math_tl } + [ + Extension = .otf, + range = { \complement } , + ] + } + +\cs_new:Npn \examzh_font_set_math_font_garamond: + { + \setmathfont { Garamond-Math.otf } + \examzh_font_set_stix_names: + \setmathfont { \g__examzh_font_font_name_stix_math_tl } + [ + Extension = .otf, + range = { \complement } , + ] + } + +\cs_new:Npn \examzh_font_set_math_font_pala: + { + \setmathfont { texgyrepagella-math.otf } + \examzh_font_set_stix_names: + \setmathfont { \g__examzh_font_font_name_stix_math_tl } + [ + Extension = .otf, + range = { \complement } , + ] + } + \AtEndPreamble @@ -571,11 +658,23 @@ % 兼容旧的粗体命令:\pkg{bm} 的 \cs{bm} 和 \pkg{amsmath} 的 \cs{boldsymbol}。 \AtEndOfPackageFile* { unicode-math } { - \NewDocumentCommand \bm { m } { { \symbfit { ##1 } } } - \RenewDocumentCommand \boldsymbol { m } { { \symbfit { ##1 } } } + \NewDocumentCommand \bm { m } + { + \tl_if_head_eq_catcode:nNTF { ##1 } A + { \symbfit{#1} } + { + #1 + \PackageWarning { exam-zh-font } + { + Do~not~use~\string\bm \space ~with~`unicode-math',~normal~font~instead. + } + } + } + \RenewDocumentCommand \boldsymbol { } { \bm } % 兼容 \pkg{amsfonts} 和 \pkg{amssymb} 中的一些命令。 \NewDocumentCommand \square { } { \mdlgwhtsquare } \NewDocumentCommand \blacksquare { } { \mdlgblksquare } - \AtBeginDocument - { \RenewDocumentCommand \checkmark { } { \ensuremath{ ✓ } } } + \AtBeginDocument { \RenewDocumentCommand \checkmark { } { \ensuremath{ ✓ } } } } + +\endinput
\ 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 d1a07de8ad..7cf7524e08 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} {2022-08-12} {v0.1.17} +\ProvidesExplPackage {exam-zh-question} {2022-08-15} {v0.1.18} {exam-zh question module} @@ -1451,4 +1451,6 @@ } } \tag * { \zsaveposx { \thezref@unique R } #1 } - }
\ No newline at end of file + } + +\endinput
\ No newline at end of file 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 c5c2d35245..2b0490284d 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} {2022-08-12} {v0.1.17} +\ProvidesExplPackage {exam-zh-symbols} {2022-08-15} {v0.1.18} {exam-zh symbols module} \RequirePackage { tikz } @@ -1205,4 +1205,6 @@ \fontsize{\ssf@size}{\ssf@size}\selectfont #1 } } - }
\ No newline at end of file + } + +\endinput
\ No newline at end of file diff --git a/macros/xetex/latex/exam-zh/tex/exam-zh.cls b/macros/xetex/latex/exam-zh/tex/exam-zh.cls index 3449ff42de..817ee767e5 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} {2022-08-12} {v0.1.17} {LaTeX template for Chinese exam} +\ProvidesExplClass {exam-zh} {2022-08-15} {v0.1.18} {LaTeX template for Chinese exam} % 检查 LaTeX2e kernel 版本 \msg_new:nnn { exam-zh } { latex-too-old } |