summaryrefslogtreecommitdiff
path: root/macros/xetex/latex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/xetex/latex')
-rw-r--r--macros/xetex/latex/exam-zh/CHANGELOG.md27
-rw-r--r--macros/xetex/latex/exam-zh/README.md8
-rw-r--r--macros/xetex/latex/exam-zh/doc/back/development.tex2
-rw-r--r--macros/xetex/latex/exam-zh/doc/back/package.tex10
-rw-r--r--macros/xetex/latex/exam-zh/doc/body/installation.tex5
-rw-r--r--macros/xetex/latex/exam-zh/doc/body/usage.tex321
-rw-r--r--macros/xetex/latex/exam-zh/doc/exam-zh-doc-setup.tex14
-rw-r--r--macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdfbin1107168 -> 1148091 bytes
-rw-r--r--macros/xetex/latex/exam-zh/examples/example-multiple.pdfbin168499 -> 174288 bytes
-rw-r--r--macros/xetex/latex/exam-zh/examples/example-multiple.tex20
-rw-r--r--macros/xetex/latex/exam-zh/examples/example-single.pdfbin143461 -> 149087 bytes
-rw-r--r--macros/xetex/latex/exam-zh/examples/example-single.tex20
-rw-r--r--macros/xetex/latex/exam-zh/tex/exam-zh-chinese-english.sty4
-rw-r--r--macros/xetex/latex/exam-zh/tex/exam-zh-choices.sty123
-rw-r--r--macros/xetex/latex/exam-zh/tex/exam-zh-font.sty12
-rw-r--r--macros/xetex/latex/exam-zh/tex/exam-zh-question.sty114
-rw-r--r--macros/xetex/latex/exam-zh/tex/exam-zh-symbols.sty4
-rw-r--r--macros/xetex/latex/exam-zh/tex/exam-zh-textfigure.sty651
-rw-r--r--macros/xetex/latex/exam-zh/tex/exam-zh.cls28
-rw-r--r--macros/xetex/latex/xgreek/README38
-rw-r--r--macros/xetex/latex/xgreek/xgreek.dtx74
-rw-r--r--macros/xetex/latex/xgreek/xgreek.ins6
-rw-r--r--macros/xetex/latex/xgreek/xgreek.pdfbin68386 -> 72111 bytes
23 files changed, 1353 insertions, 128 deletions
diff --git a/macros/xetex/latex/exam-zh/CHANGELOG.md b/macros/xetex/latex/exam-zh/CHANGELOG.md
index f785a3fc42..b4197df61e 100644
--- a/macros/xetex/latex/exam-zh/CHANGELOG.md
+++ b/macros/xetex/latex/exam-zh/CHANGELOG.md
@@ -5,6 +5,33 @@
格式参照 [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
并且此项目遵守 [Semantic Versioning](https://semver.org/spec/v2.0.0.html)。
+## [0.1.19] - 2022-08-27
+
+### Added
+
+- 增加 `choices` 的 `top-sep`, `bottom-sep`, `linesep` 键值
+- 增加对 `minipage` 的最小行距的控制
+- 增加 `\fillin` 的 `depth` 键值控制下划线的深度
+- 增加图文排版模块 `exam-zh-textfigure.sty`
+- 增加示例文件的图文排版
+
+### Changed
+
+- 修改列表环境 `enumerate` 参数
+- `show-columnline` 默认值改为 `false`
+
+### Fixed
+
+- 修复不同字体可能导致的 `bigstar` 缺失问题
+- 修复 `\ExamPrintAnswer` 的未设置编译报错问题
+
+## [0.1.19] - 2022-08-17
+
+### Added
+
+- 增加 `solution/show-solution` 的等效键值:`solution/show-answer`
+
+
## [0.1.18] - 2022-08-15
### Added
diff --git a/macros/xetex/latex/exam-zh/README.md b/macros/xetex/latex/exam-zh/README.md
index d3bd71fab2..786d845d0c 100644
--- a/macros/xetex/latex/exam-zh/README.md
+++ b/macros/xetex/latex/exam-zh/README.md
@@ -13,14 +13,14 @@ In exam-zh, you can
- ... (for more that you can do with it, please read the manual(in Chinese): `exam-zh-doc.pdf`
-Repository: https://gitee.com/zepinglee/exam-zh
+Repository: https://gitee.com/xkwxdyy/exam-zh
Author: Zeping Lee
Maintainer: Kangwei Xia, Lijun Guo
-Issues and pull requests are welcome: [issues]( https://gitee.com/zepinglee/exam-zh/issues) and [pulls](https://gitee.com/zepinglee/exam-zh/pulls)
+Issues and pull requests are welcome: [issues]( https://gitee.com/xkwxdyy/exam-zh/issues) and [pulls](https://gitee.com/xkwxdyy/exam-zh/pulls)
# exam-zh:中国试卷 LaTeX 模板
-- 项目主页:<https://gitee.com/zepinglee/exam-zh>
+- 项目主页:<https://gitee.com/xkwxdyy/exam-zh>
- 作者:Zeping Lee
- 维护者:Kangwei Xia, Lijun Guo
- 授权:[LaTeX Project Public License 1.3c](https://www.latex-project.org/lppl.txt)
@@ -33,7 +33,7 @@ Issues and pull requests are welcome: [issues]( https://gitee.com/zepinglee/exam
3. 通过用户接口可以方便更改密封线样式;
4. 在 Windows, macOS 和 Linux 跨平台编译。
-使用前请仔细阅读 [发行版](https://gitee.com/zepinglee/exam-zh/releases) 的用户手册 `exam-zh-doc.pdf`。
+使用前请仔细阅读 [发行版](https://gitee.com/xkwxdyy/exam-zh/releases) 的用户手册 `exam-zh-doc.pdf`。
## 示例(simple example)
diff --git a/macros/xetex/latex/exam-zh/doc/back/development.tex b/macros/xetex/latex/exam-zh/doc/back/development.tex
index a2ae5b6737..23d9108039 100644
--- a/macros/xetex/latex/exam-zh/doc/back/development.tex
+++ b/macros/xetex/latex/exam-zh/doc/back/development.tex
@@ -3,7 +3,7 @@
\section{参与开发}
\begin{itemize}
- \item 如果您有任何改进意见或者功能需求,欢迎前往 \href{https://gitee.com/zepinglee/exam-zh/issues}{gitee 仓库 issues} 提交 issue
+ \item 如果您有任何改进意见或者功能需求,欢迎前往 \href{https://gitee.com/xkwxdyy/exam-zh/issues}{gitee 仓库 issues} 提交 issue
\item 欢迎 \cmd{fork} 本项目,提 \cmd{pr} 的形式参与开发
\item 建议阅读 \href{https://zhuanlan.zhihu.com/typography-and-latex/}{muzimuzhi} 写的 \href{https://gitee.com/ustctug/ustcthesis/wiki/%E5%8F%82%E4%B8%8E%E5%BC%80%E5%8F%91}{参与开发}
\item 参考阅读
diff --git a/macros/xetex/latex/exam-zh/doc/back/package.tex b/macros/xetex/latex/exam-zh/doc/back/package.tex
index 6a67ac1504..d12f085d58 100644
--- a/macros/xetex/latex/exam-zh/doc/back/package.tex
+++ b/macros/xetex/latex/exam-zh/doc/back/package.tex
@@ -22,4 +22,14 @@
\item \pkg{ulem}:下划线
\item \pkg{tcolorbox}:彩框
\item \pkg{varwidth}:“弹性”的 \env{minipage}
+\end{itemize}
+
+
+\file{exam-zh-textfigure.sty} 的宏包依赖:
+
+\begin{itemize}
+ \item \pkg{wrapstuff}:图文混排
+ \item \pkg{tabularray}:表格
+ \item \pkg{varwidth}:“弹性”的 \env{minipage}
+ \item \pkg{graphicx}:插图
\end{itemize} \ No newline at end of file
diff --git a/macros/xetex/latex/exam-zh/doc/body/installation.tex b/macros/xetex/latex/exam-zh/doc/body/installation.tex
index 04c414caac..a632fa8059 100644
--- a/macros/xetex/latex/exam-zh/doc/body/installation.tex
+++ b/macros/xetex/latex/exam-zh/doc/body/installation.tex
@@ -21,10 +21,10 @@
您也可以通过访问 gitee 项目主页的方式获取最新版本的 \cls{exam-zh}(通常情况下,gitee 的版本会大于等于CTAN 的版本(因为 CTAN 从上传到审核到用户可以下载需要一天左右))。主要以「下载发行版」的方式获取最新版本的 \cls{exam-zh}:
\begin{enumerate}
- \item 进入项目主页(\href{https://gitee.com/zepinglee/exam-zh}{gitee 项目主页} (界面见图~\ref{figure:gitee项目主页} )
+ \item 进入项目主页(\href{https://gitee.com/xkwxdyy/exam-zh}{gitee 项目主页} (界面见图~\ref{figure:gitee项目主页} )
\item 在右侧一列有“发行版”(gitee),并且有一个标签图标并有“vx.x.x - 20xx-xx-xx”字样,表示最新的发行版版本和发布时间,点击即可查看相关信息(如果想查看历史所有发行版信息,可以点击“发行版”右侧的“全部”(gitee))。
- 发行版中一般由以下信息构成(\href{https://gitee.com/zepinglee/exam-zh/releases}{gitee 发行版} 界面见图~\ref{figure:gitee发行版})
+ 发行版中一般由以下信息构成(\href{https://gitee.com/xkwxdyy/exam-zh/releases}{gitee 发行版} 界面见图~\ref{figure:gitee发行版})
\begin{itemize}
\item 更新文件的特别说明。如果没有,则表明此次更新只需要更新 \file{exam-zh.cls} 文件至最新\footnote{“更新 \meta{文件} 至最新”目前表示在发行版中下载最新版本的模板,并用其中所需要更新的 \meta{文件} 去替换本地的旧 \meta{文件}} 即可
\item 更新日志。 主要为此次发行版与上次发行版的不同,一般为“Added”、“Changed”、“Fixed”等信息
@@ -76,6 +76,7 @@
\file{exam-zh-font.sty} & 模版的字体模块宏包\\
\file{exam-zh-symbols.sty} & 模版的符号模块宏包\\
\file{exam-zh-chinese-english.sty} & 模版的语文英语模块宏包\\
+ \file{exam-zh-textfigure.sty} & 模版的图文排版模块宏包\\
\file{README.md} & 简要自述 \\
\file{CHANGELOG.md} & 模板更新日志 \\
\file{LICENSE} & 模版发布许可证
diff --git a/macros/xetex/latex/exam-zh/doc/body/usage.tex b/macros/xetex/latex/exam-zh/doc/body/usage.tex
index 56e0f25739..71e57ad21f 100644
--- a/macros/xetex/latex/exam-zh/doc/body/usage.tex
+++ b/macros/xetex/latex/exam-zh/doc/body/usage.tex
@@ -684,7 +684,7 @@
\end{function}
\begin{function}{\chapter}
- 用于排一份的试卷标题。并可以用 \opt{page/show-chapter} 键值控制显示与否。
+ 用于排一份的试卷标题。并可以用 \opt{page/show-chapter} 键值控制显示与否。新的 \tn{chapter} 下 \env{question} 环境计数器会重置。
\end{function}
其余的见~\ref{subsubsec:抬头} 节。
@@ -886,6 +886,113 @@
+\subsubsection{图文排版}
+
+图文排版模块为 \file{exam-zh-textfigure.sty},基于 xkwxdyy 的 \href{https://gitee.com/xkwxdyy/text-figure}{text-figure} 宏包优化而来,\pkg{text-figure} 宏包不再维护。
+
+试卷中的图文排版主要有三种类型:
+\begin{enumerate}
+ \item 多张图片并排,文字处于上方和下方;
+ \item 文字和图片左右或上下排版
+ \item 文字绕排(主要基于李清的 \pkg{wrapstuff} 宏包(\file{exam-zh-textfigure.sty} 中已加载))
+\end{enumerate}
+
+其中,文字绕排一般用于语文英语等文字较多的情形。
+
+\begin{function}[added = 2022-08-28]{multifigures 环境}
+ \begin{ccnusyntax}[emph={[2]multifigures}]
+ \begin{multifigures}(*\oarg{键值列表}*)
+ \item[标签1] (*\meta{内容1}*)
+ \item[标签2] (*\meta{内容2}*)
+ ...
+ \end{multifigures}
+ \end{ccnusyntax}
+ 多张图片(无超链接引用)排版环境。\meta{键值列表} 见~\ref{subsubsec:参数-图文排版}。
+\end{function}
+
+\begin{latexexample}{\env{multifigures} 环境示例1}
+ \begin{multifigures}
+ \item[题 9 图:勾股数] \includegraphics[width=3cm]{example-image.png}
+ \item[题 11 图:圆锥曲线] \includegraphics[width=3cm]{example-image.png}
+ \end{multifigures}
+\end{latexexample}
+
+\begin{latexexample}{\env{multifigures} 环境示例2}
+ \begin{multifigures}[columns=2]
+ \item[题 9 图] \includegraphics[width=3cm]{example-image.png}
+ \item[题 10 图] \includegraphics[width=3cm]{example-image.png}
+ \item[题 11 图] \includegraphics[width=3cm]{example-image.png}
+ \item[题 12 图] \includegraphics[width=3cm]{example-image.png}
+ \end{multifigures}
+\end{latexexample}
+
+
+\begin{function}[added = 2022-08-28]{\textfigure}
+ \begin{ccnusyntax}[emph={[2]textfigure}]
+ \textfigure(*\oarg{参数列表}\marg{文本}\marg{图片}*)
+ \end{ccnusyntax}
+ 图文排版命令。\meta{键值列表} 见~\ref{subsubsec:参数-图文排版}。
+\end{function}
+
+\begin{latexexample}{\tn{textfigure} 命令示例1}
+ \textfigure{
+ 江州司马平安否? 惠远东林住得无? \par
+ 湓浦曾闻似衣带,庐峰见说胜香炉。\par
+ 题诗岁晏离鸿断,望阙天遥病鹤孤。\par
+ 莫谩拘牵雨花社,青云依旧是前途。
+ }{
+ \includegraphics[width=3cm]{example-image.png}
+ }
+\end{latexexample}
+
+\begin{latexexample}{\tn{textfigure} 命令示例2}
+ \textfigure[text-width=\columnwidth,fig-pos=bottom-flushright]{
+ 如图,在三棱锥 $A$-$BCD$ 中,$\text{平面} ABD \perp \text{平面} BCD$,
+ $AB = AD$,$O$ 为 $BD$ 的重点。
+ \begin{enumerate}
+ \item 证明:$OA \perp CD$;
+ \item 若 $\triangle OCD$ 是变长为 $1$ 的等边三角形,点 $E$ 在棱 $AD$ 上,
+ $DE = 2 EA$,且二面角 $E$-$BC$-$D$ 的大小为 $45^{\circ}$,
+ 求三棱锥 $A$-$BCD$ 的体积。
+ \end{enumerate}
+ }{
+ \includegraphics[width=3cm]{example-image.png}
+ }
+\end{latexexample}
+
+
+\begin{latexexample}{\tn{textfigure} 命令示例3}
+ \textfigure{
+ \begin{question}
+ 双曲线 $C: \frac{x^{2}}{4}-\frac{y^{2}}{2}=1$ 的右焦点为 $F$, 为点 $P$ 在 $C$ 的一条渐近线上, $O$ 为坐标原点, 若 $|P O|=|P F|$, 则 $\triangle P F O$ 的面积为 \paren
+ \begin{choices}
+ \item $\frac{3 \sqrt{2}}{4}$
+ \item $\frac{3 \sqrt{2}}{2}$
+ \item $2 \sqrt{2}$
+ \item $3 \sqrt{2}$
+ \end{choices}
+ \end{question}
+
+ \begin{question}
+ 设 $f(x)$ 是定义域为 $\mathbf{R}$ 的偶函数, 且在 $(0,+\infty)$ 单调递减, 则
+ \begin{choices}
+ \item $f\left(\log _{3} \frac{1}{4}\right)>f\left(2^{-\frac{3}{2}}\right)>f\left(2^{-\frac{2}{3}}\right)$
+ \item $f\left(\log _{3} \frac{1}{4}\right)>f\left(2^{-\frac{2}{3}}\right)>f\left(2^{-\frac{3}{2}}\right)$
+ \item $f\left(2^{-\frac{3}{2}}\right)>f\left(2^{-\frac{2}{3}}\right)>f\left(\log _{3} \frac{1}{4}\right)$
+ \item $f\left(2^{-\frac{2}{3}}\right)>f\left(2^{-\frac{3}{2}}\right)>f\left(\log _{3} \frac{1}{4}\right)$
+ \end{choices}
+ \end{question}
+ }{
+ \includegraphics[width = 2cm, height = 5cm]{example-image.png} \\ (第 9 题)
+ }
+\end{latexexample}
+
+
+\begin{function}{wrapstuff 环境}
+ \file{exam-zh-textfigure.sty} 模块默认加载 \pkg{wrapstuff} 宏包。具体 \env{wrapstuff} 环境使用请阅读手册。
+\end{function}
+
+
\subsection{参数设置}
\begin{function}{\examsetup}
@@ -1826,6 +1933,27 @@
选项的最大列数。排版选项时会优先尝试该列数,如果无法排下内容,依次将列数除以 2 并取整再进行尝试,直到可以排下全部选项。默认为 |4| 。
\end{function}
+\begin{function}[added = 2022-08-28]{choices/top-sep}
+ \begin{ccnusyntax}[emph={[1]top-sep}]
+ top-sep = (*\meta{dimension}*)
+ \end{ccnusyntax}
+ \env{choices} 环境上方弹性间距。默认为 |0pt|。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{choices/bottom-sep}
+ \begin{ccnusyntax}[emph={[1]bottom-sep}]
+ bottom-sep = (*\meta{dimension}*)
+ \end{ccnusyntax}
+ \env{choices} 环境下方弹性间距。默认为 |0pt|。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{choices/linesep}
+ \begin{ccnusyntax}[emph={[1]linesep}]
+ linesep = (*\meta{dimension}*)
+ \end{ccnusyntax}
+ \env{choices} 环境的行数多于 1 时的行额外弹性间距。默认为 |0pt plus .5ex|。
+\end{function}
+
\begin{function}{paren}
@@ -1912,6 +2040,7 @@
\end{function}
+
\subsubsection{填空题} \label{subsubsec:参数-填空题}
@@ -2045,11 +2174,12 @@
\end{function}
-\begin{function}[added = 2022-07-01]{solution/show-solution}
- \begin{ccnusyntax}[emph={[1]show-solution}]
+\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*)
\end{ccnusyntax}
- 是否显示解答环境 \env{solution} 的内容。
+ 是否显示解答环境 \env{solution} 的内容。\opt{show-solution} 和 \opt{show-answer} 两者等效。
\end{function}
\begin{function}[added = 2022-07-20]{solution/parbreak}
@@ -2181,19 +2311,6 @@
\env{solution} 环境内容的颜色。默认为 |black|。
\end{function}
-\begin{function}[added = 2022-07-19]{solution/top-sep}
- \begin{ccnusyntax}[emph={[1]top-sep}]
- top-sep = (*\meta{dimension}*)
- \end{ccnusyntax}
- \env{solution} 环境上方间距。默认为 |.5em plus .5em minus .2em|。
-\end{function}
-
-\begin{function}[added = 2022-07-19]{solution/bottom-sep}
- \begin{ccnusyntax}[emph={[1]bottom-sep}]
- bottom-sep = (*\meta{dimension}*)
- \end{ccnusyntax}
- \env{solution} 环境下方间距。默认为 |.5em plus .5em minus .2em|。
-\end{function}
\begin{function}[added = 2022-07-19]{solution/blank-type}
\begin{ccnusyntax}[emph={[1]blank-type}]
@@ -2635,4 +2752,174 @@
zhu-circlednumber-base = (*<tikz|(font)>*)
\end{ccnusyntax}
在 \kvopt{poem/type}{chinese} 键值下,\tn{zhu} 的带圈数字的源。\opt{tikz} 表示此时带圈数字基于 \TikZ,\opt{font} 表示此时带圈数字基于字体。
+\end{function}
+
+
+\subsubsection{图文排版} \label{subsubsec:参数-图文排版}
+
+
+\begin{function}[updated = 2022-08-28]{multifigures}
+ \begin{ccnusyntax}[emph={[1]multifigures}]
+ multifigures = (*\marg{键值列表}*)
+ multifigures/(*\meta{key}*) = (*\meta{value}*)
+ \end{ccnusyntax}
+ 该选项包含多个子项目。用于设置 \env{multifigures} 环境。可以在 \tn{examsetup} 中使用,也可以在 \env{multifigures} 环境的可选参数中使用。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{multifigures/columns}
+ \begin{ccnusyntax}[emph={[1]columns}]
+ columns = (*\meta{integer}*)
+ \end{ccnusyntax}
+ 每行多少项。默认为 |3|。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{multifigures/fig-pos}
+ \begin{ccnusyntax}[emph={[1]fig-pos}]
+ fig-pos = (*<top|(above)|bottom|below|left|right>*)
+ \end{ccnusyntax}
+ 图片相对于标签的位置。\opt{top} 和 \opt{above} 同义、\opt{bottom} 和 \opt{below} 同义。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{multifigures/top-sep}
+ \begin{ccnusyntax}[emph={[1]top-sep}]
+ top-sep = (*\meta{dimension}*)
+ \end{ccnusyntax}
+ \env{multifigures} 环境上方额外弹性间距。默认为 |1ex plus .5ex minus .5ex|。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{multifigures/bottom-sep}
+ \begin{ccnusyntax}[emph={[1]bottom-sep}]
+ bottom-sep = (*\meta{dimension}*)
+ \end{ccnusyntax}
+ \env{multifigures} 环境下方额外弹性间距。默认为 |0pt|。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{multifigures/align}
+ \begin{ccnusyntax}[emph={[1]align}]
+ align = (*<t|m|(b)>*)
+ \end{ccnusyntax}
+ 图片和标签的整体对齐方式。\opt{t} 表示顶部对齐、\opt{m} 表示居中对齐、\opt{b} 表示底部对齐。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{multifigures/xshift,multifigures/hshift,multifigures/yshift,multifigures/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 = 2022-08-28]{multifigures/label-xshift,multifigures/label-hshift,multifigures/label-yshift,multifigures/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}
+
+
+
+
+\begin{function}[updated = 2022-08-28]{textfigure}
+ \begin{ccnusyntax}[emph={[1]textfigure}]
+ textfigure = (*\marg{键值列表}*)
+ textfigure/(*\meta{key}*) = (*\meta{value}*)
+ \end{ccnusyntax}
+ 该选项包含多个子项目。用于设置 \tn{textfigure} 命令。可以在 \tn{examsetup} 中使用,也可以在 \tn{textfigure} 命令的可选参数中使用。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{textfigure/fig-pos}
+ \begin{ccnusyntax}[emph={[1]fig-pos}]
+ fig-pos = (*\meta{postion}*)
+ \end{ccnusyntax}
+ 图片相对于文本的方位。方位可选参数见下列表,默认为 \opt{right}
+\end{function}
+\begin{itemize}
+ \item \opt{top}:图片在文本上方
+ \item \opt{bottom}:图片在文本下方
+ \item \opt{left}:图片在文本左边,垂直中心对齐
+ \item \opt{right}:图片在文本右边,垂直中心对齐
+ \item \opt{top-left}:图片在文本的左上方
+ \item \opt{top-center}:图片在文本的上方,位于整行的水平中心
+ \item \opt{top-right}:图片在文本的右上方
+ \item \opt{top-flushright}:图片在文本的右上方,位于水平末端
+ \item \opt{bottom-left}:图片在文本的左下方
+ \item \opt{bottom-center}:图片在文本的下方,位于整行的水平中心
+ \item \opt{bottom-right}:图片在文本的右下方
+ \item \opt{bottom-flushright}:图片在文本的右下方,位于水平末端
+ \item \opt{left-top}:图片在文本左边,顶部对齐
+ \item \opt{left-center}:等价于 \opt{left}
+ \item \opt{left-bottom}:图片在文本左边,底部对齐
+ \item \opt{right-top}:图片在文本右边边,顶部对齐
+ \item \opt{right-center}:等价于 \opt{right}
+ \item \opt{right-bottom}:图片在文本右边,底部对齐
+\end{itemize}
+
+
+\begin{function}[added = 2022-08-28]{textfigure/xshift,textfigure/hshift,textfigure/yshift,textfigure/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} 同义,表示垂直。\opt{yshift} 的默认值为 |.5\baselineskip|。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{textfigure/figure-xshift,textfigure/figure-hshift,textfigure/figure-yshift,textfigure/figure-vshift}
+ \begin{ccnusyntax}[emph={[1]xshift,hshift,yshift,vshift}]
+ figure-xshift = (*\meta{dimension}*)
+ figure-hshift = (*\meta{dimension}*)
+ figure-yshift = (*\meta{dimension}*)
+ figure-vshift = (*\meta{dimension}*)
+ \end{ccnusyntax}
+ 图片相对于文本的水平和垂直的偏移量。\opt{figure-xshift} 和 \opt{figure-hshift} 同义,表示水平;\opt{figure-yshift} 和 \opt{figure-vshift} 同义,表示垂直。
+\end{function}
+
+
+\begin{function}[added = 2022-08-28]{textfigure/top-sep}
+ \begin{ccnusyntax}[emph={[1]top-sep}]
+ top-sep = (*\meta{dimension}*)
+ \end{ccnusyntax}
+ \tn{textfigure} 命令上方弹性间距。默认为 |0pt|。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{textfigure/bottom-sep}
+ \begin{ccnusyntax}[emph={[1]bottom-sep}]
+ bottom-sep = (*\meta{dimension}*)
+ \end{ccnusyntax}
+ \tn{textfigure} 命令下方弹性间距。默认为 |1.5ex plus .5ex minus 0.5ex|。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{textfigure/text-width}
+ \begin{ccnusyntax}[emph={[1]text-width}]
+ text-width = (*\meta{dimension}*)
+ \end{ccnusyntax}
+ 文本部分的 \env{varwidth} 宽度。默认为 |\columnwidth|。但有时需要手动输入 \kvopt{text-width}{\textbackslash columnwidth} 才会变成整行,比如解答题。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{textfigure/figure-width}
+ \begin{ccnusyntax}[emph={[1]figure-width}]
+ figure-width = (*\meta{dimension}*)
+ \end{ccnusyntax}
+ 图片部分的 \env{varwidth} 宽度。默认为 |\columnwidth|。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{textfigure/ratio,textfigure/text-ratio}
+ \begin{ccnusyntax}[emph={[1]ratio,text-ratio}]
+ ratio = (*\meta{比例}*)
+ text-ratio = (*\meta{比例}*)
+ \end{ccnusyntax}
+ 图片部分占比。默认为 |0.95|。有时 |1| 的效果并不是整行,这主要和使用了 \env{varwidth} 环境有关,此时建议改 \opt{text-width}。
+\end{function}
+
+\begin{function}[added = 2022-08-28]{textfigure/top}
+ \begin{ccnusyntax}[emph={[1]top}]
+ top = (*\meta{integer}*)
+ \end{ccnusyntax}
+ \kvopt{fig-pos}{left-top} 时,图片顶部从文本的第几行开始排,效果和 \pkg{wrapstuff} 宏包的 \opt{top} 键值效果类似。
\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 d6aa6a6a0b..e0a12cc402 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
@@ -6,6 +6,7 @@
\usepackage{../exam-zh-question}
\usepackage{../exam-zh-symbols}
\usepackage{../exam-zh-chinese-english}
+\usepackage{../exam-zh-textfigure}
\ExplSyntaxOn
\NewDocumentCommand \examsetup { m }
@@ -32,9 +33,9 @@
\title{\textcolor{MaterialIndigo800}{%
\textbf{exam-zh: 高考试卷 \LaTeX \xpinyin[font=\sffamily,format=\color{MaterialIndigo800}]{模}{mu2}板}}}
\author{李泽平,夏康玮,郭李军}
-\date{2022/08/15\quad v0.1.18%
+\date{2022/08/28\quad v0.1.19%
\thanks{%
- \url{https://gitee.com/zepinglee/exam-zh}
+ \url{https://gitee.com/xkwxdyy/exam-zh}
}
}
@@ -61,4 +62,11 @@
\rule[-0.7em]{0pt}{2em} \\\hline
\end{tabular}
}
-\ExplSyntaxOff \ No newline at end of file
+\ExplSyntaxOff
+
+\AddToHook{env/latexexample/after}
+ {%
+ \examsetup{
+ question/index=1
+ }
+ } \ No newline at end of file
diff --git a/macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdf b/macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdf
index f4ee4463f3..b3732b8ebc 100644
--- a/macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdf
+++ b/macros/xetex/latex/exam-zh/doc/exam-zh-doc.pdf
Binary files differ
diff --git a/macros/xetex/latex/exam-zh/examples/example-multiple.pdf b/macros/xetex/latex/exam-zh/examples/example-multiple.pdf
index 7e2e1ca87e..917fbee430 100644
--- a/macros/xetex/latex/exam-zh/examples/example-multiple.pdf
+++ b/macros/xetex/latex/exam-zh/examples/example-multiple.pdf
Binary files differ
diff --git a/macros/xetex/latex/exam-zh/examples/example-multiple.tex b/macros/xetex/latex/exam-zh/examples/example-multiple.tex
index 0a134480a6..94c5471205 100644
--- a/macros/xetex/latex/exam-zh/examples/example-multiple.tex
+++ b/macros/xetex/latex/exam-zh/examples/example-multiple.tex
@@ -316,14 +316,18 @@
% 20.
\begin{problem}[points = 12]
- 如图,在三棱锥 $A$-$BCD$ 中,$\text{平面} ABD \perp \text{平面} BCD$,
- $AB = AD$,$O$ 为 $BD$ 的重点。
- \begin{enumerate}
- \item 证明:$OA \perp CD$;
- \item 若 $\triangle OCD$ 是变长为 $1$ 的等边三角形,点 $E$ 在棱 $AD$ 上,
- $DE = 2 EA$,且二面角 $E$-$BC$-$D$ 的大小为 \ang{45},
- 求三棱锥 $A$-$BCD$ 的体积。
- \end{enumerate}
+ \textfigure[text-width=\columnwidth, fig-pos=bottom-flushright]{
+ 如图,在三棱锥 $A$-$BCD$ 中,$\text{平面} ABD \perp \text{平面} BCD$,
+ $AB = AD$,$O$ 为 $BD$ 的重点。
+ \begin{enumerate}
+ \item 证明:$OA \perp CD$;
+ \item 若 $\triangle OCD$ 是变长为 $1$ 的等边三角形,点 $E$ 在棱 $AD$ 上,
+ $DE = 2 EA$,且二面角 $E$-$BC$-$D$ 的大小为 \ang{45},
+ 求三棱锥 $A$-$BCD$ 的体积。
+ \end{enumerate}
+ }{
+ \includegraphics[width=5cm]{example-image.png}
+ }
\end{problem}
% 21.
diff --git a/macros/xetex/latex/exam-zh/examples/example-single.pdf b/macros/xetex/latex/exam-zh/examples/example-single.pdf
index d70946bd46..358ed54196 100644
--- a/macros/xetex/latex/exam-zh/examples/example-single.pdf
+++ b/macros/xetex/latex/exam-zh/examples/example-single.pdf
Binary files differ
diff --git a/macros/xetex/latex/exam-zh/examples/example-single.tex b/macros/xetex/latex/exam-zh/examples/example-single.tex
index 89c04bf74d..d70cb9ae92 100644
--- a/macros/xetex/latex/exam-zh/examples/example-single.tex
+++ b/macros/xetex/latex/exam-zh/examples/example-single.tex
@@ -294,14 +294,18 @@
% 20.
\begin{problem}[points = 12]
- 如图,在三棱锥 $A$-$BCD$ 中,$\text{平面} ABD \perp \text{平面} BCD$,
- $AB = AD$,$O$ 为 $BD$ 的重点。
- \begin{enumerate}
- \item 证明:$OA \perp CD$;
- \item 若 $\triangle OCD$ 是变长为 $1$ 的等边三角形,点 $E$ 在棱 $AD$ 上,
- $DE = 2 EA$,且二面角 $E$-$BC$-$D$ 的大小为 \ang{45},
- 求三棱锥 $A$-$BCD$ 的体积。
- \end{enumerate}
+ \textfigure{
+ 如图,在三棱锥 $A$-$BCD$ 中,$\text{平面} ABD \perp \text{平面} BCD$,
+ $AB = AD$,$O$ 为 $BD$ 的重点。
+ \begin{enumerate}
+ \item 证明:$OA \perp CD$;
+ \item 若 $\triangle OCD$ 是变长为 $1$ 的等边三角形,点 $E$ 在棱 $AD$ 上,
+ $DE = 2 EA$,且二面角 $E$-$BC$-$D$ 的大小为 \ang{45},
+ 求三棱锥 $A$-$BCD$ 的体积。
+ \end{enumerate}
+ }{
+ \includegraphics[width=3cm]{example-image.png}
+ }
\end{problem}
% 21.
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 b2d1d39baf..eefffdac7d 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
@@ -1,14 +1,14 @@
%
% Copyright (c) 2022 Kangwei Xia, Lijun Guo
% Released under the LaTeX Project Public License v1.3c License.
-% Repository: https://gitee.com/zepinglee/exam-zh
+% Repository: https://gitee.com/xkwxdyy/exam-zh
%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\ProvidesExplPackage {exam-zh-chinese-english} {2022-08-15} {v0.1.18}
+\ProvidesExplPackage {exam-zh-chinese-english} {2022-08-28} {v0.1.19}
{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 ef7c39ba88..05f66871c3 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-15} {v0.1.18}
+\ProvidesExplPackage {exam-zh-choices} {2022-08-28} {v0.1.19}
{exam-zh choices module}
\dim_new:N \l__examzh_choices_column_sep_dim
@@ -36,7 +36,13 @@
label-sep .dim_set:N = \l__examzh_choices_label_sep_dim ,
label-width .dim_set:N = \l__examzh_choices_label_width_dim ,
max-columns .int_set:N = \l__examzh_choices_max_columns_int ,
- index .int_set:N = \l__examzh_choices_item_index_int
+ index .int_set:N = \l__examzh_choices_item_index_int,
+ % 环境上方的额外距离
+ top-sep .skip_set:N = \l__examzh_choices_top_sep_skip,
+ % 环境下方的额外距离
+ bottom-sep .skip_set:N = \l__examzh_choices_bottom_sep_skip,
+ % 若不是单行排版,则可以控制行之间的额外间距
+ linesep .skip_set:N = \l__examzh_choices_line_sep_skip
}
\keys_set:nn { exam-zh / choices }
@@ -45,11 +51,14 @@
columns = 0 ,
label = \Alph*. ,
label-pos = auto ,
- label-align = right ,
+ label-align = left ,
label-sep = .5em ,
label-width = 0pt ,
max-columns = 4 ,
index = 1,
+ top-sep = 0pt,
+ bottom-sep = 0pt,
+ linesep = 0pt plus .5ex
}
\NewDocumentCommand \setchoices { m }
@@ -83,17 +92,19 @@
\NewDocumentEnvironment { choices } { O { } +b }
{
+ \keys_set:nn { exam-zh / choices } {#1}
\par \nopagebreak
% 严格禁止孤行和寡行
\int_set:Nn \clubpenalty { 10000 }
\int_set:Nn \widowpenalty { 10000 }
% 尽量避免在选项中间换行
\int_set:Nn \interlinepenalty { 301 }
+ \vspace* { \l__examzh_choices_top_sep_skip }
\noindent
- \dim_set_eq:NN \l__examzh_choices_total_width_dim \linewidth
+ % \dim_set_eq:NN \l__examzh_choices_total_width_dim \linewidth
+ \dim_set:Nn \l__examzh_choices_total_width_dim { \linewidth - \leftskip - \rightskip }
\int_zero:N \l__examzh_choices_columns_int
\dim_zero:N \l__examzh_choices_label_width_dim
- \keys_set:nn { exam-zh / choices } {#1}
}
{
% 用 \item 分割选项
@@ -119,6 +130,7 @@
\__examzh_print_choices:N \l__examzh_choices_seq
% 输出正确选项
\__examzh_print_correctchoice:
+ \vspace* { \l__examzh_choices_bottom_sep_skip }
}
% 用来存正确选项的序号(entry)
@@ -368,7 +380,9 @@
{ \l__examzh_choices_current_col_int } > { \l__examzh_choices_columns_int }
{
% \par \noindent
- \newline
+ \\[ \l__examzh_choices_line_sep_skip ]
+ % \newline
+ % \skip_vertical:N \l__examzh_choices_line_sep_skip
\int_set:Nn \l__examzh_choices_current_col_int {1}
}
% TODO 为什么 > 1 才加呢? 这样的话第 1 列和第 2 列之间就没有这个间距?
@@ -386,52 +400,116 @@
\coffin_new:N \l__examzh_choices_item_coffin
\coffin_new:N \l__examzh_choices_label_coffin
-
+% \box_new:N \l__examzh_choices_item_box
+% \box_new:N \l__examzh_choices_label_box
\cs_new:Npn \__examzh_print_single_choice:nn #1#2
{
% 选项标签
\__examzh_choices_make_label_coffin:n {#1}
+ % \__examzh_choices_make_label_box:n {#1}
% 选项内容
\__examzh_choices_make_item_coffin:n {#2}
+ % \__examzh_choices_make_item_box:n {#2}
% 合并选项的标签和内容
\str_case:Vn \l__examzh_choices_label_pos_tl
{
{ top-left }
{
\coffin_join:NnnNnnnn
- \l__examzh_choices_item_coffin {l} {H}
\l__examzh_choices_label_coffin {r} {H}
- { - \l__examzh_choices_label_sep_dim }
+ \l__examzh_choices_item_coffin {l} {H}
+ { \l__examzh_choices_label_sep_dim }
{ 0pt }
+ % \hbox_set:Nn \l__examzh_choices_item_box
+ % {
+ % \box_use_drop:N \l__examzh_choices_label_box
+ % \kern \l__examzh_choices_label_sep_dim
+ % \box_use_drop:N \l__examzh_choices_item_box
+ % }
}
{ left }
{
\coffin_join:NnnNnnnn
- \l__examzh_choices_item_coffin {l} {vc}
\l__examzh_choices_label_coffin {r} {vc}
- { - \l__examzh_choices_label_sep_dim }
+ \l__examzh_choices_item_coffin {l} {vc}
+ { \l__examzh_choices_label_sep_dim }
{ 0pt }
+ % \hbox_set:Nn \l__examzh_choices_item_box
+ % {
+ % \box_move_down:nn
+ % {
+ % (
+ % \box_ht:N \l__examzh_choices_label_box -
+ % \box_dp:N \l__examzh_choices_label_box -
+ % \box_ht:N \l__examzh_choices_item_box +
+ % \box_dp:N \l__examzh_choices_item_box
+ % ) / 2
+ % }
+ % { \box_use_drop:N \l__examzh_choices_label_box }
+ % \kern \l__examzh_choices_label_sep_dim
+ % \box_use_drop:N \l__examzh_choices_item_box
+ % }
}
{ bottom }
{
\coffin_join:NnnNnnnn
- \l__examzh_choices_item_coffin {hc} {b}
\l__examzh_choices_label_coffin {hc} {t}
+ \l__examzh_choices_item_coffin {hc} {b}
{ 0pt }
% { - \l__examzh_choices_label_sep_dim }
{ 0pt }
+ % \hbox_set:Nn \l__examzh_choices_item_box
+ % {
+ % % \vbox_top:n
+ % % {
+ % % \box_use:N \l__examzh_choices_item_box
+ % % \nointerlineskip
+ % % % \kern \l__examzh_choices_label_sep_dim
+ % % \box_move_left:nn
+ % % {
+ % % (
+ % % \box_wd:N \l__examzh_choices_label_box -
+ % % \box_wd:N \l__examzh_choices_item_box
+ % % ) / 2
+ % % }
+ % % { \box_use_drop:N \l__examzh_choices_label_box }
+ % % \box_clear:N \l__examzh_choices_item_box
+ % % }
+ % \hbox_set:Nn \l__examzh_choices_item_box
+ % {
+ % \box_use:N \l__examzh_choices_item_box
+ % \kern \dim_eval:n
+ % {
+ % ( - \box_wd:N \l__examzh_choices_label_box
+ % - \box_wd:N \l__examzh_choices_item_box ) / 2
+ % }
+ % \box_move_down:nn
+ % {
+ % \box_ht:N \l__examzh_choices_label_box +
+ % \box_dp:N \l__examzh_choices_item_box
+ % % + \l__examzh_choices_label_sep_dim
+ % }
+ % { \box_use_drop:N \l__examzh_choices_label_box }
+ % \box_clear:N \l__examzh_choices_item_box
+ % }
+ % }
}
}
% 输出合并后
- \coffin_typeset:Nnnnn \l__examzh_choices_item_coffin {l} {H} {0pt} {0pt}
+ % \coffin_typeset:Nnnnn \l__examzh_choices_item_coffin {l} {H} {0pt} {0pt}
+ \coffin_typeset:Nnnnn \l__examzh_choices_label_coffin {l} {H} {0pt} {0pt}
\coffin_clear:N \l__examzh_choices_item_coffin
\coffin_clear:N \l__examzh_choices_label_coffin
+ % \box_use_drop:N \l__examzh_choices_item_box
}
% 将标签内容存入 coffin
\cs_new:Npn \__examzh_choices_make_label_coffin:n #1
+% 将标签内容存入 box
+% \cs_new:Npn \__examzh_choices_make_label_box:n #1
{
\hcoffin_set:Nn \l__examzh_choices_label_coffin
+ % \hbox_set:Nn \l__examzh_choices_label_box
{
\hbox_to_wd:nn { \l__examzh_choices_label_width_dim }
{ \__examzh_choices_make_label:n {#1} \strut }
@@ -452,10 +530,13 @@
% 将选项内容存入 coffin
\cs_new:Npn \__examzh_choices_make_item_coffin:n #1
+% 将选项内容存入 box
+% \cs_new:Npn \__examzh_choices_make_item_box:n #1
{
\hcoffin_set:Nn \l__examzh_choices_item_coffin
+ % \hbox_set:Nn \l__examzh_choices_item_box
{
- % 优先尝试使用 hbox,这是因为在 \vcoffin_set 外部能保留原来的 \linewidth 和
+ % 优先尝试使用 hbox,这是因为在 \vbox_set 外部能保留原来的 \linewidth 和
% \textwidth,方便用户在 \includegraphics 中使用
\hbox_set:Nn \l_tmpa_box {#1}
% 若盒子的自然高度大于 2 行,且深度为 0pt,设置为插图模式
@@ -468,9 +549,17 @@
{ \bool_set_true:N \l__examzh_choices_figure_mode_bool }
\vcoffin_set:Nnn \l_tmpa_coffin
{ \l__examzh_choices_item_width_dim }
+ % \vbox_set:Nn \l_tmpa_box
{
+ % \dim_set_eq:NN \parskip \c_zero_dim
+ % \dim_set_eq:NN \parindent \listparindent
+ \dim_set_eq:NN \hsize \l__examzh_choices_item_width_dim
+ \dim_set_eq:NN \linewidth \hsize
+ \dim_set_eq:NN \columnwidth \hsize
\dim_set_eq:NN \parskip \c_zero_dim
\dim_set_eq:NN \parindent \listparindent
+ \dim_set:Nn \leftskip { 0pt }
+ \dim_set:Nn \rightskip { 0pt }
\noindent
% \strut
% 若标签在底部,将图片居中对齐。
@@ -485,9 +574,15 @@
}
\dim_set:Nn \l_tmpa_dim { \coffin_ht:N \l_tmpa_coffin }
\bool_if:NT \l__examzh_choices_figure_mode_bool
+ % \dim_set:Nn \l_tmpa_dim { \box_ht:N \l_tmpa_box }
+ % \bool_if:NTF \l__examzh_choices_figure_mode_bool
+ % {
+ % \box_move_up:nn { \l_tmpa_dim - 0.7 \baselineskip } { \box_use_drop:N \l_tmpa_box }
+ % }
{
\coffin_set_horizontal_pole:Nnn \l_tmpa_coffin {T}
{ \l_tmpa_dim - 0.7 \baselineskip }
+ % \vbox_top:n { \vbox_unpack_drop:N \l_tmpa_box }
}
\coffin_typeset:Nnnnn \l_tmpa_coffin {l} {T} {0pt} {0pt}
\coffin_clear:N \l_tmpa_coffin
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 cda4062101..76f943de1d 100644
--- a/macros/xetex/latex/exam-zh/tex/exam-zh-font.sty
+++ b/macros/xetex/latex/exam-zh/tex/exam-zh-font.sty
@@ -1,7 +1,7 @@
%
% Copyright (c) 2022 Zeping Lee and AlphaZTX
% Released under the LaTeX Project Public License v1.3c License.
-% Repository: https://gitee.com/zepinglee/exam-zh
+% Repository: https://gitee.com/xkwxdyy/exam-zh
%
\NeedsTeXFormat{LaTeX2e}
@@ -9,7 +9,7 @@
\RequirePackage{expl3}
\RequirePackage{xparse}
-\ProvidesExplPackage {exam-zh-font} {2022-08-15} {v0.1.18}
+\ProvidesExplPackage {exam-zh-font} {2022-08-28} {v0.1.19}
{exam-zh font module}
\RequirePackage { unicode-math }
@@ -456,7 +456,7 @@
\setmathfont { \g__examzh_font_font_name_stix_math_tl }
[
Extension = .otf,
- range = { \complement } ,
+ range = { \complement, \bigstar } ,
]
\setmathrm { NewCM10 }
[
@@ -495,7 +495,7 @@
\setmathfont { \g__examzh_font_font_name_stix_math_tl }
[
Extension = .otf,
- range = { \complement } ,
+ range = { \complement, \bigstar } ,
]
\setmathrm { lmroman10 }
[
@@ -600,7 +600,7 @@
\setmathfont { \g__examzh_font_font_name_stix_math_tl }
[
Extension = .otf,
- range = { \complement } ,
+ range = { \complement, \bigstar } ,
]
\message
{
@@ -638,7 +638,7 @@
\setmathfont { \g__examzh_font_font_name_stix_math_tl }
[
Extension = .otf,
- range = { \complement } ,
+ range = { \complement, \bigstar } ,
]
}
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 7cf7524e08..9afcba5f7b 100644
--- a/macros/xetex/latex/exam-zh/tex/exam-zh-question.sty
+++ b/macros/xetex/latex/exam-zh/tex/exam-zh-question.sty
@@ -1,7 +1,7 @@
%
% Copyright (c) 2022 Zeping Lee
% Released under the LaTeX Project Public License v1.3c License.
-% Repository: https://gitee.com/zepinglee/exam-zh
+% Repository: https://gitee.com/xkwxdyy/exam-zh
%
\NeedsTeXFormat{LaTeX2e}
@@ -9,7 +9,7 @@
\RequirePackage{expl3}
\RequirePackage{xparse}
-\ProvidesExplPackage {exam-zh-question} {2022-08-15} {v0.1.18}
+\ProvidesExplPackage {exam-zh-question} {2022-08-28} {v0.1.19}
{exam-zh question module}
@@ -755,6 +755,7 @@
{ \bool_set_true:N \l__examzh_fillin_paren_banjiao_bool },
paren-type / quanjiao .code:n =
{ \bool_set_false:N \l__examzh_fillin_paren_banjiao_bool },
+ depth .dim_set:N = \l__examzh_fillin_line_depth_dim
}
\keys_set:nn { exam-zh / fillin }
{
@@ -767,7 +768,8 @@
no-answer-counter-index = 1,
no-answer-counter-label = \arabic*,
paren-type = banjiao,
- width-type = fill,
+ width-type = normal,
+ depth = 0.4em
}
\keys_define:nn { exam-zh }
@@ -801,7 +803,9 @@
}
{
% 不显示答案
- \__examzh_fillin_no_answer_typeset:
+ \IfBooleanTF {#1}
+ { \__examzh_fillin_no_answer_breakble_typeset: }
+ { \__examzh_fillin_no_answer_unbreakble_typeset: }
}
}
{
@@ -821,7 +825,9 @@
}
{
% 不显示答案
- \__examzh_fillin_no_answer_typeset:
+ \IfBooleanTF {#1}
+ { \__examzh_fillin_no_answer_breakble_typeset: }
+ { \__examzh_fillin_no_answer_unbreakble_typeset: }
}
}
\group_end:
@@ -832,13 +838,26 @@
There~is~no~such~noanswertype~named~#1!\\
Please~read~the~manual~carefully!
}
-\cs_new:Npn \__examzh_fillin_no_answer_typeset:
+\cs_new:Npn \__examzh_fillin_no_answer_unbreakble_typeset:
+ {
+ \str_case:VnF \l__examzh_fillin_no_answer_type_str
+ {
+ { blacktriangle } { \__examzh_fillin_no_answer_typeset_blacktriangle: }
+ { counter } { \__examzh_fillin_no_answer_typeset_counter: }
+ { none } { \__examzh_fillin_output_unbreakable_F: }
+ }
+ {
+ \msg_error:nnx { exam-zh / fillin } { no-such-noanswertype }
+ { \l__examzh_fillin_no_answer_type_str }
+ }
+ }
+\cs_new:Npn \__examzh_fillin_no_answer_breakble_typeset:
{
\str_case:VnF \l__examzh_fillin_no_answer_type_str
{
{ blacktriangle } { \__examzh_fillin_no_answer_typeset_blacktriangle: }
{ counter } { \__examzh_fillin_no_answer_typeset_counter: }
- { none } { \__examzh_fillin_no_answer_typeset_none: }
+ { none } { \__examzh_fillin_output_breakable_F: }
}
{
\msg_error:nnx { exam-zh / fillin } { no-such-noanswertype }
@@ -856,10 +875,6 @@
{ \__examzh_fillin_the_label: }
% { \int_eval:n { \g__examzh_fillin_no_answer_counter_int - 1 } }
}
-\cs_new:Npn \__examzh_fillin_no_answer_typeset_none:
- {
- \__examzh_fillin_output_F:
- }
\cs_new:Npn \__examzh_fillin_without_judge:n #1
{
% \ULdepth 是 \uline 的下划线的深度
@@ -887,7 +902,7 @@
\__examzh_fillin_output_T:
}
{
- \__examzh_fillin_output_F:
+ \__examzh_fillin_output_unbreakable_F:
}
}
\cs_new:Npn \__examzh_fillin_breakline:n #1
@@ -900,7 +915,7 @@
\__examzh_fillin_output_breakline_T:
}
{
- \__examzh_fillin_output_F:
+ \__examzh_fillin_output_breakable_F:
}
}
\msg_new:nnn { exam-zh } { no-fillin-type }
@@ -940,14 +955,29 @@
{
The~type~:~#1~ cannot~be~used~in~breakable~fillin~cmd.
}
-\cs_new:Npn \__examzh_fillin_output_F:
+\cs_new:Npn \__examzh_fillin_output_breakable_F:
+ {
+ \str_case:VnF \l__examzh_fillin_type_str
+ {
+ { line } { \__examzh_fillin_uline_breakable_F: }
+ { paren } { \__examzh_fillin_paren_breakable_F: }
+ { circle } { \__examzh_fillin_circle_F: }
+ { blank } { \__examzh_fillin_blank_breakable_F: }
+ { rectangle } { \__examzh_fillin_rectangle_F: }
+ }
+ {
+ \msg_error:nnx { exam-zh } { no-fillin-type }
+ { \l__examzh_fillin_type_str }
+ }
+ }
+\cs_new:Npn \__examzh_fillin_output_unbreakable_F:
{
\str_case:VnF \l__examzh_fillin_type_str
{
- { line } { \__examzh_fillin_uline_F: }
- { paren } { \__examzh_fillin_paren_F: }
+ { line } { \__examzh_fillin_uline_unbreakable_F: }
+ { paren } { \__examzh_fillin_paren_unbreakable_F: }
{ circle } { \__examzh_fillin_circle_F: }
- { blank } { \__examzh_fillin_blank_F: }
+ { blank } { \__examzh_fillin_blank_unbreakable_F: }
{ rectangle } { \__examzh_fillin_rectangle_F: }
}
{
@@ -957,7 +987,9 @@
}
\cs_new:Npn \__examzh_fillin_uline_T:
{
- \uline
+ % \uline
+ \CJKunderline*
+ [ depth = \l__examzh_fillin_line_depth_dim ]
{
\hspace* { 0.5em plus .5em minus .5em }
\dim_compare:nNnTF { \l__examzh_question_answer_depth_dim } > { 0.2em }
@@ -970,11 +1002,18 @@
\hspace* { 0.5em plus .5em minus .5em }
}
}
-\cs_new:Npn \__examzh_fillin_uline_F:
+\cs_new:Npn \__examzh_fillin_uline_breakable_F:
{
% \uline { \hspace* { \l__examzh_fillin_F_width_dim } }
\__examzh_fillin_breakable_hspace:NN \CJKunderline \allowbreak
}
+\cs_new:Npn \__examzh_fillin_uline_unbreakable_F:
+ {
+ \unskip
+ \hspace* { 0.5em plus .5em minus .5em }
+ \uline { \hspace* { \l__examzh_fillin_F_width_dim } }
+ \ignorespaces
+ }
% \cs_new:Nn \__examzh_fillin_uline:
% {
% \bgroup
@@ -1006,6 +1045,7 @@
\cs_new:Npn \__examzh_fillin_uline_breakline_T:
{
\CJKunderline*
+ [ depth = \l__examzh_fillin_line_depth_dim ]
% \uline
% \__examzh_fillin_uline:
{
@@ -1018,6 +1058,7 @@
}
\cs_new:Npn \__examzh_fillin_paren_T:
{
+ \unskip
\bool_if:NTF \l__examzh_fillin_paren_banjiao_bool
{
(
@@ -1037,9 +1078,11 @@
\hspace* { 0.5em plus .5em minus .5em }
}
+ \ignorespaces
}
\cs_new:Npn \__examzh_fillin_paren_breakline_T:
{
+ \unskip
\bool_if:NTF \l__examzh_fillin_paren_banjiao_bool
{
(
@@ -1059,6 +1102,7 @@
\hspace* { 0.5em plus .5em minus .5em }
}
+ \ignorespaces
}
\box_new:N \c__examzh_banjiao_right_brace_box
\box_new:N \c__examzh_quanjiao_right_brace_box
@@ -1068,8 +1112,10 @@
{ \box_wd:N \c__examzh_banjiao_right_brace_box }
\dim_const:Nn \c__examzh_quanjiao_right_brace_width_dim % (
{ \box_wd:N \c__examzh_quanjiao_right_brace_box }
-\cs_new:Npn \__examzh_fillin_paren_F:
+\cs_new:Npn \__examzh_fillin_paren_breakable_F:
{
+ \unskip
+ \hspace* { 0.5em plus .5em minus .5em }
\bool_if:NTF \l__examzh_fillin_paren_banjiao_bool
{
( \__examzh_fillin_breakable_hspace:NN \use:n \nobreak \kern-\c__examzh_banjiao_right_brace_width_dim ) \allowbreak
@@ -1077,28 +1123,49 @@
{
( \__examzh_fillin_breakable_hspace:NN \use:n \nobreak \kern-\c__examzh_quanjiao_right_brace_width_dim )\allowbreak
}
+ \ignorespaces
+ }
+\cs_new:Npn \__examzh_fillin_paren_unbreakable_F:
+ {
+ \unskip
+ \hspace* { 0.5em plus .5em minus .5em }
+ \bool_if:NTF \l__examzh_fillin_paren_banjiao_bool
+ {
+ ( \hspace* { \l__examzh_fillin_F_width_dim } )
+ }
+ {
+ ( \hspace* { \l__examzh_fillin_F_width_dim } )
+ }
+ \ignorespaces
}
\cs_new:Npn \__examzh_fillin_blank_T:
{
+ \unskip
\hspace* { 0.5em plus .5em minus .5em }
\group_begin:
\box_use_drop:N \l_tmpa_box
\group_end:
- \hspace* { 0.5em plus .5em minus .5em }
+ \ignorespaces
}
\cs_new:Npn \__examzh_fillin_blank_breakline_T:
{
+ \unskip
\hspace* { 0.5em plus .5em minus .5em }
\group_begin:
\l_tmpa_tl
\group_end:
- \hspace* { 0.5em plus .5em minus .5em }
+ \ignorespaces
}
-\cs_new:Npn \__examzh_fillin_blank_F:
+\cs_new:Npn \__examzh_fillin_blank_breakble_F:
{
% \hspace* { \l__examzh_fillin_F_width_dim }
\__examzh_fillin_breakable_hspace:NN \use:n \allowbreak
}
+\cs_new:Npn \__examzh_fillin_blank_unbreakble_F:
+ {
+ \hspace* { \l__examzh_fillin_F_width_dim }
+ % \__examzh_fillin_breakable_hspace:NN \use:n \allowbreak
+ }
\tikzset
{
fillin-circle/.style =
@@ -1235,6 +1302,7 @@
\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-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,
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 2b0490284d..37115aa5a8 100644
--- a/macros/xetex/latex/exam-zh/tex/exam-zh-symbols.sty
+++ b/macros/xetex/latex/exam-zh/tex/exam-zh-symbols.sty
@@ -1,14 +1,14 @@
%
% Copyright (c) 2022 Kangwei Xia
% Released under the LaTeX Project Public License v1.3c License.
-% Repository: https://gitee.com/zepinglee/exam-zh
+% Repository: https://gitee.com/xkwxdyy/exam-zh
%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\ProvidesExplPackage {exam-zh-symbols} {2022-08-15} {v0.1.18}
+\ProvidesExplPackage {exam-zh-symbols} {2022-08-28} {v0.1.19}
{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
new file mode 100644
index 0000000000..77a98eb0ba
--- /dev/null
+++ b/macros/xetex/latex/exam-zh/tex/exam-zh-textfigure.sty
@@ -0,0 +1,651 @@
+%
+% 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-textfigure} {2022-08-28} {v0.1.19}
+ {exam-zh text with figure module}
+
+\RequirePackage { wrapstuff }
+\RequirePackage { tabularray }
+\RequirePackage { varwidth }
+\RequirePackage { graphicx }
+\RequirePackage { filehook }
+
+\AtEndOfPackageFile* { exam-zh-choices }
+ {
+ \AddToHook { env / choices / before }
+ { \wrapstuffclear }
+ }
+
+%% multifigures 环境,排版多张图片 %%
+
+% \begin{multifigures}
+% \item[题 9 图:勾股数] \includegraphics[width=3cm]{example-image.png}
+% \item[题 11 图:圆锥曲线] \includegraphics[width=3cm]{example-image.png}
+% \end{multifigures}
+
+% 图片相对于 label 的方位
+\str_new:N \l__examzh_multifigures_figure_position_str
+% coffin type 的对齐方式
+\str_new:N \l__examzh_multifigures_coffin_align_str
+
+
+\keys_define:nn { exam-zh / multifigures }
+ {
+ % 每行多少个(等价于有多少列)
+ columns .int_set:N = \l__examzh_multifigures_column_int,
+ % 图片相对于文字的位置(上下左右)
+ fig-pos .choices:nn =
+ { top, above, bottom, below, left, right }
+ { \str_set:Nx \l__examzh_multifigures_figure_position_str { \l_keys_choice_tl } },
+ % 环境上方的额外距离
+ top-sep .skip_set:N = \l__examzh_multifigures_top_sep_skip,
+ % 环境下方的额外距离
+ bottom-sep .skip_set:N = \l__examzh_multifigures_bottom_sep_skip,
+ % 整体的偏移量
+ xshift .dim_set:N = \l__examzh_multifigures_xshift_dim,
+ hshift .dim_set:N = \l__examzh_multifigures_xshift_dim,
+ yshift .dim_set:N = \l__examzh_multifigures_yshift_dim,
+ vshift .dim_set:N = \l__examzh_multifigures_yshift_dim,
+ % label 的偏移量
+ label-xshift .dim_set:N = \l__examzh_multifigures_label_xshift_dim,
+ label-hshift .dim_set:N = \l__examzh_multifigures_label_xshift_dim,
+ label-yshift .dim_set:N = \l__examzh_multifigures_label_yshift_dim,
+ label-vshift .dim_set:N = \l__examzh_multifigures_label_yshift_dim,
+ % 对齐方式
+ align .choices:nn =
+ { t, m, b }
+ { \str_set:Nx \l__examzh_multifigures_coffin_align_str { \l_keys_choice_tl } }
+ }
+\keys_set:nn { exam-zh / multifigures }
+ {
+ columns = 3,
+ fig-pos = above,
+ label-xshift = 0pt,
+ label-yshift = 0pt,
+ align = b,
+ top-sep = 1ex plus .5ex minus .5ex,
+ bottom-sep = 0pt,
+ }
+
+% item 的 index 指标(即第几个 item)
+\int_new:N \l__examzh_multifigures_item_index_int
+% 将拼接后的 coffin 存到 seq 里
+\seq_new:N \l__examzh_multifigures_store_seq
+% 上面的 seq 的 item 数
+\int_new:N \l__examzh_multifigures_store_seq_item_int
+% 最终放在 tblr 里的内容
+\tl_new:N \l__examzh_multifigures_tblr_content_tl
+
+\NewDocumentEnvironment { multifigures } { O{ } +O{ } }
+ {
+ \group_begin:
+ \RenewDocumentCommand \item { O{ } }
+ { \__examzh_multifigures_item:n {##1} }
+ \int_set:Nn \l__examzh_multifigures_item_index_int {0}
+ \seq_clear:N \l__examzh_multifigures_store_seq
+ \tl_clear:N \l__examzh_multifigures_tblr_content_tl
+ \keys_set:nn { exam-zh / multifigures } {#1}
+ }
+ {
+ % 结束收集
+ \unskip
+ \end{varwidth}
+ \hcoffin_set_end:
+ % 拼接 label 和 figure
+ \__examzh_multifigures_coffin_join:
+ % 输出
+ \__examzh_multifigures_coffin_typeset:n {#2}
+ % \par \int_use:N \l__examzh_multifigures_item_index_int
+ \group_end:
+ }
+% 拼接 label 和 figure
+\cs_new:Npn \__examzh_multifigures_coffin_join:
+ {
+ \int_step_inline:nn { \l__examzh_multifigures_item_index_int }
+ {
+ \__examzh_multifigures_coffin_join_position_set:n {##1}
+ \seq_gput_right:Nn \l__examzh_multifigures_store_seq
+ {
+ \__examzh_multifigures_coffin_align_set:n {##1}
+ }
+ }
+ }
+\cs_new:Npn \__examzh_multifigures_coffin_align_set:n #1
+ {
+ \str_case:Vn \l__examzh_multifigures_coffin_align_str
+ {
+ {t} { \__examzh_multifigures_coffin_align_set_t:n {#1} }
+ {m} { \__examzh_multifigures_coffin_align_set_m:n {#1} }
+ {b} { \__examzh_multifigures_coffin_align_set_b:n {#1} }
+ }
+ }
+\cs_new:Npn \__examzh_multifigures_coffin_align_set_t:n #1
+ {
+ \coffin_typeset:cnnnn
+ { l__examzh_multifigures_figure_ \int_to_roman:n { #1 } _coffin }
+ { l } { t } % align = t
+ { \l__examzh_multifigures_xshift_dim } { \l__examzh_multifigures_yshift_dim + 1em }
+ }
+\cs_new:Npn \__examzh_multifigures_coffin_align_set_m:n #1
+ {
+ \coffin_typeset:cnnnn
+ { l__examzh_multifigures_figure_ \int_to_roman:n { #1 } _coffin }
+ { l } { vc } % align = m
+ { \l__examzh_multifigures_xshift_dim } { \l__examzh_multifigures_yshift_dim }
+ }
+\cs_new:Npn \__examzh_multifigures_coffin_align_set_b:n #1
+ {
+ \coffin_typeset:cnnnn
+ { l__examzh_multifigures_figure_ \int_to_roman:n { #1 } _coffin }
+ { l } { b } % align = b
+ { \l__examzh_multifigures_xshift_dim } { \l__examzh_multifigures_yshift_dim }
+ }
+\cs_new:Npn \__examzh_multifigures_coffin_join_position_set:n #1
+ {
+ \use:c { __examzh_multifigures_coffin_join_position_set_ \l__examzh_multifigures_figure_position_str :n } {#1}
+ }
+\cs_new:Npn \__examzh_multifigures_coffin_join_position_set_top:n #1
+ {
+ \coffin_join:cnncnnnn
+ { l__examzh_multifigures_figure_ \int_to_roman:n {#1} _ coffin }
+ { hc } { b }
+ { l__examzh_multifigures_label_ \int_to_roman:n {#1} _ coffin }
+ { hc } { t }
+ { \l__examzh_multifigures_label_xshift_dim }
+ { \l__examzh_multifigures_label_yshift_dim - 6pt }
+ }
+\cs_set_eq:NN
+ \__examzh_multifigures_coffin_join_position_set_above:n
+ \__examzh_multifigures_coffin_join_position_set_top:n
+\cs_new:Npn \__examzh_multifigures_coffin_join_position_set_bottom:n #1
+ {
+ \coffin_join:cnncnnnn
+ { l__examzh_multifigures_figure_ \int_to_roman:n {#1} _ coffin }
+ { hc } { t }
+ { l__examzh_multifigures_label_ \int_to_roman:n {#1} _ coffin }
+ { hc } { b }
+ { \l__examzh_multifigures_label_xshift_dim }
+ { \l__examzh_multifigures_label_yshift_dim + 6pt }
+ }
+\cs_set_eq:NN
+ \__examzh_multifigures_coffin_join_position_set_below:n
+ \__examzh_multifigures_coffin_join_position_set_bottom:n
+\cs_new:Npn \__examzh_multifigures_coffin_join_position_set_left:n #1
+ {
+ \coffin_join:cnncnnnn
+ { l__examzh_multifigures_figure_ \int_to_roman:n {#1} _ coffin }
+ { l } { vc }
+ { l__examzh_multifigures_label_ \int_to_roman:n {#1} _ coffin }
+ { r } { vc }
+ { \l__examzh_multifigures_label_xshift_dim - 6pt }
+ { \l__examzh_multifigures_label_yshift_dim }
+ }
+\cs_new:Npn \__examzh_multifigures_coffin_join_position_set_right:n #1
+ {
+ \coffin_join:cnncnnnn
+ { l__examzh_multifigures_figure_ \int_to_roman:n {#1} _ coffin }
+ { r } { vc }
+ { l__examzh_multifigures_label_ \int_to_roman:n {#1} _ coffin }
+ { l } { vc }
+ { \l__examzh_multifigures_label_xshift_dim + 2pt }
+ { \l__examzh_multifigures_label_yshift_dim }
+ }
+\cs_new:Npn \__examzh_multifigures_coffin_typeset:n #1
+ {
+ \__examzh_multifigures_coffin_typeset_count:
+ \seq_map_indexed_inline:Nn \l__examzh_multifigures_store_seq
+ % ##1: index
+ % ##2: content
+ {
+ \int_compare:nNnTF { \int_mod:nn {##1} { \l__examzh_multifigures_column_int } } = {0}
+ {
+ \tl_gput_right:Nn \l__examzh_multifigures_tblr_content_tl { ##2 \\ }
+ }
+ {
+ \tl_gput_right:Nn \l__examzh_multifigures_tblr_content_tl { ##2 & }
+ }
+ }
+ % 如果 seq 的 item 比 column 多且不整除 column 的话,要补 &
+ \int_compare:nNnT { \l__examzh_multifigures_store_seq_item_int } > { \l__examzh_multifigures_column_int }
+ {
+ \int_compare:nNnF { \l__examzh_multifigures_item_num_mod_column_left_int } = { 0 }
+ {
+ \tl_gput_right:Nx \l__examzh_multifigures_tblr_content_tl
+ {
+ \prg_replicate:nn { \l__examzh_multifigures_item_num_mod_column_left_int -1 } {&}
+ }
+ % \int_use:N \l__examzh_multifigures_item_num_mod_column_left_int
+ }
+ }
+ \par
+ \vspace*{ \l__examzh_multifigures_top_sep_skip }
+ \noindent \centering
+ % \SetTblrInner
+ % {
+ % rowsep = 4pt,
+ % % colsep = 0pt
+ % }
+ \begin{tblr}
+ [ expand = \l__examzh_multifigures_tblr_content_tl ]
+ {
+ width = \textwidth,
+ cells = {c},
+ column{1} = {leftsep = 0pt},
+ column{Z} = {rightsep = 0pt},
+ rows =
+ {
+ abovesep = 0pt,
+ belowsep = 0pt,
+ },
+ % vlines,hlines,
+ #1
+ }
+ \l__examzh_multifigures_tblr_content_tl
+ \end{tblr}
+ \vspace*{ \l__examzh_multifigures_bottom_sep_skip }
+ \par
+ }
+\int_new:N \l__examzh_multifigures_item_num_mod_column_left_int
+\cs_new:Npn \__examzh_multifigures_coffin_typeset_count:
+ {
+ % 计算 seq 有多少项
+ \int_set:Nn \l__examzh_multifigures_store_seq_item_int
+ { \seq_count:N \l__examzh_multifigures_store_seq }
+ % seq 项数小于 column 的话,column 设置为 seq 项数
+ \int_compare:nNnTF { \l__examzh_multifigures_store_seq_item_int } < { \l__examzh_multifigures_column_int }
+ { \int_set_eq:NN \l__examzh_multifigures_column_int \l__examzh_multifigures_store_seq_item_int }
+ {
+ % 计算 \l__examzh_multifigures_store_seq_item_int mod \l__examzh_multifigures_column_int 的余数,用于补 &
+ \int_set:Nn \l__examzh_multifigures_item_num_mod_column_left_int { \int_mod:nn { \l__examzh_multifigures_store_seq_item_int } { \l__examzh_multifigures_column_int } }
+ }
+ }
+\cs_new:Npn \__examzh_multifigures_item:n #1
+ {
+ % 增加指标(g 是关键)
+ \int_gincr:N \l__examzh_multifigures_item_index_int
+ % 新建 coffin
+ \__examzh_multifigures_item_new_coffin:
+ % 储存 label(一直出不来的原因是因为没改成 gset)
+ \hcoffin_gset:cn { l__examzh_multifigures_label_ \int_to_roman:n { \l__examzh_multifigures_item_index_int } _coffin } {#1}
+ % 储存 figure
+ \int_compare:nNnF { \l__examzh_multifigures_item_index_int } = {1}
+ {
+ \unskip
+ \end{varwidth}
+ % 结束上一个 item 的收集
+ \hcoffin_set_end:
+ }
+ % 收集
+ \hcoffin_set:cw { l__examzh_multifigures_figure_ \int_to_roman:n { \l__examzh_multifigures_item_index_int } _coffin }
+ \begin{varwidth}{\hsize}
+ \ignorespaces
+ }
+
+% 新建 coffin
+\cs_new:Npn \__examzh_multifigures_item_new_coffin:
+ {
+ % 放图片的 coffin
+ \coffin_if_exist:cF { l__examzh_multifigures_figure_ \int_to_roman:n { \l__examzh_multifigures_item_index_int } _coffin }
+ { \coffin_new:c { l__examzh_multifigures_figure_ \int_to_roman:n { \l__examzh_multifigures_item_index_int } _coffin } }
+ % 放 label 的 coffin
+ \coffin_if_exist:cF { l__examzh_multifigures_label_ \int_to_roman:n { \l__examzh_multifigures_item_index_int } _coffin }
+ { \coffin_new:c { l__examzh_multifigures_label_ \int_to_roman:n { \l__examzh_multifigures_item_index_int } _coffin } }
+ }
+
+
+
+%% \textfigure
+
+
+\coffin_new:N \l__examzh_textfigure_text_coffin % 用于存文本
+\coffin_new:N \l__examzh_textfigure_figure_coffin % 用于存图片
+
+\str_new:N \l__examzh_textfigure_current_figure_position_str % 用来存当前的 anchor值
+
+\fp_new:N \l__examzh_textfigure_text_ratio_fp % 文本的比例
+
+\dim_new:N \l__examzh_textfigure_text_width_dim % 文本的宽度
+\dim_new:N \l__examzh_textfigure_text_coffin_width_dim % 文本c offin 的宽度
+\dim_new:N \l__examzh_textfigure_figure_width_dim % 图片的 varwidth 环境的宽度
+
+% 用于 top-center, top-right, bottom-center, bottom-right 的水平偏移量储存
+\dim_new:N \l__examzh_textfigure_figure_coffin_horizontal_transform_dim
+\dim_new:N \l__examzh_textfigure_tmpa_dim % 临时变量
+
+\skip_new:N \l__examzh_textfigure_tmpa_skip % 临时变量
+
+
+\keys_define:nn { exam-zh }
+ {
+ textfigure .meta:nn = { exam-zh / textfigure } {#1}
+ }
+
+\keys_define:nn { exam-zh / textfigure }
+ {
+ % fig-pos为图片位于文本的方位
+ fig-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,
+ % figure-xshift:调整图片的水平额外偏移量
+ figure-xshift .dim_set:N = \l__examzh_textfigure_figure_xshift_dim,
+ figure-hshift .dim_set:N = \l__examzh_textfigure_figure_xshift_dim,
+ % yshift:调整整体的垂直额外偏移量
+ yshift .dim_set:N = \l__examzh_textfigure_yshift_dim,
+ vshift .dim_set:N = \l__examzh_textfigure_yshift_dim,
+ % xshift:调整整体的水平额外偏移量
+ xshift .dim_set:N = \l__examzh_textfigure_xshift_dim,
+ hshift .dim_set:N = \l__examzh_textfigure_xshift_dim,
+ % text-width:手动设置文本的 varwidth 环境的宽度
+ text-width .dim_set:N = \l__examzh_textfigure_text_width_dim,
+ % figure-width:手动设置 figure 的 varwidth 环境的宽度
+ figure-width .dim_set:N = \l__examzh_textfigure_figure_width_dim,
+ % ratio / text-ratio:文本 coffin 占行宽的比例,范围0-1
+ ratio .fp_set:N = \l__examzh_textfigure_text_ratio_fp,
+ text-ratio .fp_set:N = \l__examzh_textfigure_text_ratio_fp,
+ % 环境上方的额外距离
+ top-sep .skip_set:N = \l__examzh_textfigure_top_sep_skip,
+ % 环境下方的额外距离
+ bottom-sep .skip_set:N = \l__examzh_textfigure_bottom_sep_skip,
+ % 类似于 wrapstuff 的 top
+ top .int_set:N = \l__examzh_textfigure_top_int
+ }
+
+\keys_set:nn { exam-zh / textfigure }
+ {
+ fig-pos = right,
+ yshift = .5\baselineskip,
+ text-width = \columnwidth,
+ figure-width = \columnwidth,
+ text-ratio = 0.95,
+ top-sep = 0pt,
+ bottom-sep = 1.5ex plus .5ex minus 0.5ex,
+ top = 0
+ }
+
+
+% 【已解决】判断anchor是不是west或者east,是的话就自动调整调整一下text-ratio
+% - 问题在于要知道key-val设置了什么anchor才能判断
+% - 但是这个key-val设置和手动设置ratio是同一接口
+% - 理想是:
+% - 先用户设置anchor
+% - 然后自动判断是否是west或者east,并自动调整ratio
+% 【思考】其实也就是说anchor的时候要判断是否是east和west来设置ratio(关键)
+% - 然后用户手动的话以手动的为准
+% 【解决关键】既然不可能中途处理,那只能在 key-val 设置的时候就要处理掉这个自动的ratio,所以重新设计了anchor键值代码
+
+\NewDocumentCommand{ \textfigure }{ O{} +m +m }
+ {
+ \group_begin:
+ \keys_set:nn { exam-zh / textfigure } {#1}
+ \par
+ \vspace*{ \l__examzh_textfigure_top_sep_skip }
+ \noindent
+ \__examzh_textfigure_output:nn {#2} {#3}
+ \vspace*{ \l__examzh_textfigure_bottom_sep_skip }
+ \group_end:
+ }
+
+
+% 最终的拼接命令
+\cs_new:Npn \__examzh_textfigure_output:nn #1#2
+ {
+ \__examzh_textfigure_text_width_dim_set:
+ % issue:https://gitee.com/xkwxdyy/text-figure/issues/I4RVQX
+ % 关键点在于要离开垂直模式
+ % https://ask.latexstudio.net/ask/question/7238.html
+ \mode_leave_vertical:
+ % 将内容存到 coffin 中
+ \__examzh_textfigure_coffin_store:nn {#1}{#2}
+ % coffin 的拼接
+ \__examzh_textfigure_coffin_join:
+ % coffin 的 typeset
+ \__examzh_textfigure_coffin_typeset:
+ }
+\cs_new:Npn \__examzh_textfigure_text_width_dim_set:
+ {
+ % \str_case:VnT \l__examzh_textfigure_current_figure_position_str
+ % {
+ % {bottom-flushright} {}
+ % {bottom-left} {}
+ % {bottom-right} {}
+ % {bottom-center} {}
+ % }
+ % { \fp_set:Nn \l__examzh_textfigure_text_ratio_fp {1} }
+ % \fp_compare:nNnF { \l__examzh_textfigure_text_ratio_fp } = { 1 }
+ % {
+ % \str_case:VnT \l__examzh_textfigure_current_figure_position_str
+ % {
+ % {left} {}
+ % {right} {}
+ % {left-center} {}
+ % {right-center} {}
+ % {right-top} {}
+ % {right-bottom} {}
+ % {left-top} {}
+ % {left-bottom} {}
+ % }
+ % { \fp_set:Nn \l__examzh_textfigure_text_ratio_fp {0.7} }
+ % }
+ \dim_set_eq:NN \l__examzh_textfigure_tmpa_dim \l__examzh_textfigure_text_width_dim
+ \dim_set:Nn \l__examzh_textfigure_text_width_dim
+ {
+ \l__examzh_textfigure_tmpa_dim * \dim_ratio:nn { \fp_use:N \l__examzh_textfigure_text_ratio_fp pt } { 1 pt }
+ }
+ }
+\cs_new:Npn \__examzh_textfigure_coffin_store:nn #1#2
+ {
+ \hcoffin_set:Nn \l__examzh_textfigure_text_coffin
+ {
+ \begin{varwidth}{ \l__examzh_textfigure_text_width_dim }
+ \dim_set:Nn \parindent {2em}
+ \ignorespaces
+ #1
+ \unskip
+ \end{varwidth}
+ }
+ \hcoffin_set:Nn \l__examzh_textfigure_figure_coffin
+ {
+ \begin{varwidth}{ \l__examzh_textfigure_figure_width_dim }
+ \centering
+ \ignorespaces
+ #2
+ \unskip
+ \end{varwidth}
+ }
+ }
+\cs_new:Npn \__examzh_textfigure_coffin_join:
+ {
+ \use:c { __examzh_textfigure_fig_pos_set_ \l__examzh_textfigure_current_figure_position_str :NN }
+ \l__examzh_textfigure_text_coffin
+ \l__examzh_textfigure_figure_coffin
+ }
+\cs_new:Npn \__examzh_textfigure_coffin_typeset:
+ {
+ \coffin_typeset:Nnnnn \l__examzh_textfigure_text_coffin
+ { l } { t }
+ { \l__examzh_textfigure_xshift_dim }
+ { \l__examzh_textfigure_yshift_dim }
+ }
+
+% top表示位于文本正上方
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_top:NN } #1#2
+ {
+ \coffin_join:NnnNnnnn
+ #1 { t } { hc }
+ #2 { b } { hc }
+ { \l__examzh_textfigure_figure_xshift_dim }
+ { 1em + \l__examzh_textfigure_figure_yshift_dim }
+ }
+% top-center表示位于文本上方,但是处于水平的中线处
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_top-center:NN } #1#2
+ {
+ \dim_set:Nn \l__examzh_textfigure_tmpa_dim
+ { \coffin_wd:N #1 }
+ \dim_set:Nn \l__examzh_textfigure_figure_coffin_horizontal_transform_dim
+ {
+ \linewidth * \dim_ratio:nn { 1 pt } { 2 pt }
+ -
+ \l__examzh_textfigure_tmpa_dim * \dim_ratio:nn { 1 pt } { 2 pt }
+ }
+ \coffin_join:NnnNnnnn
+ #1 { t } { hc }
+ #2 { b } { hc }
+ { \l__examzh_textfigure_figure_coffin_horizontal_transform_dim + \l__examzh_textfigure_figure_xshift_dim }
+ { 1em + \l__examzh_textfigure_figure_yshift_dim }
+ }
+% bottom-center表示位于文本下方,但是处于水平的中线处
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_bottom-center:NN } #1#2
+ {
+ \dim_set:Nn \l__examzh_textfigure_tmpa_dim
+ { \coffin_wd:N #1 }
+ \dim_set:Nn \l__examzh_textfigure_figure_coffin_horizontal_transform_dim
+ {
+ \linewidth * \dim_ratio:nn { 1 pt } { 2 pt }
+ -
+ \l__examzh_textfigure_tmpa_dim * \dim_ratio:nn { 1 pt } { 2 pt }
+ }
+ \coffin_join:NnnNnnnn
+ #1 { b } { hc }
+ #2 { t } { hc }
+ { \l__examzh_textfigure_figure_coffin_horizontal_transform_dim + \l__examzh_textfigure_figure_xshift_dim }
+ { -1em + \l__examzh_textfigure_figure_yshift_dim }
+ }
+% bottom 表示位于文本正下方
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_bottom:NN } #1#2
+ {
+ \coffin_join:NnnNnnnn
+ #1 { b } { hc }
+ #2 { t } { hc }
+ { \l__examzh_textfigure_figure_xshift_dim }
+ { -1em + \l__examzh_textfigure_figure_yshift_dim }
+ }
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_left:NN } #1#2
+ {
+ \coffin_join:NnnNnnnn
+ #1 { vc } { l }
+ #2 { vc } { r }
+ { -1em + \l__examzh_textfigure_figure_xshift_dim }
+ { \l__examzh_textfigure_figure_yshift_dim }
+ }
+\cs_set_eq:cc { __examzh_textfigure_fig_pos_set_left-center:NN } { __examzh_textfigure_fig_pos_set_left:NN }
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_left-top:NN } #1#2
+ {
+ \dim_set:Nn \l__examzh_textfigure_tmpa_dim
+ { \baselineskip * \dim_ratio:nn { \int_use:N \l__examzh_textfigure_top_int pt } { 1pt } }
+ \coffin_join:NnnNnnnn
+ #1 { t } { l }
+ #2 { t } { r }
+ { -1em + \l__examzh_textfigure_figure_xshift_dim }
+ { - \l__examzh_textfigure_tmpa_dim + \l__examzh_textfigure_figure_yshift_dim }
+ }
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_left-bottom:NN } #1#2
+ {
+ \coffin_join:NnnNnnnn
+ #1 { b } { l }
+ #2 { b } { r }
+ { -1em + \l__examzh_textfigure_figure_xshift_dim }
+ { 0pt + \l__examzh_textfigure_figure_yshift_dim }
+ }
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_right-top:NN } #1#2
+ {
+ \dim_set:Nn \l__examzh_textfigure_tmpa_dim
+ { \baselineskip * \dim_ratio:nn { \int_use:N \l__examzh_textfigure_top_int pt } { 1pt } }
+ \coffin_join:NnnNnnnn
+ #1 { t } { r }
+ #2 { t } { l }
+ { 1em + \l__examzh_textfigure_figure_xshift_dim }
+ { - \l__examzh_textfigure_tmpa_dim + \l__examzh_textfigure_figure_yshift_dim }
+ }
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_right-center:NN } #1#2
+ {
+ \coffin_join:NnnNnnnn
+ #1 { vc } { r }
+ #2 { vc } { l }
+ { 1em + \l__examzh_textfigure_figure_xshift_dim }
+ { 0pt + \l__examzh_textfigure_figure_yshift_dim }
+ }
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_right-bottom:NN } #1#2
+ {
+ \coffin_join:NnnNnnnn
+ #1 { b } { r }
+ #2 { b } { l }
+ { 1em + \l__examzh_textfigure_figure_xshift_dim }
+ { 0pt + \l__examzh_textfigure_figure_yshift_dim }
+ }
+\cs_set_eq:cc { __examzh_textfigure_fig_pos_set_right:NN } { __examzh_textfigure_fig_pos_set_right-center:NN }
+% top-flushright:文本上方,水平方向是在行尾
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_top-flushright:NN } #1#2
+ {
+ \dim_set:Nn \l__examzh_textfigure_tmpa_dim
+ { \coffin_wd:N #1 }
+ \dim_set:Nn \l__examzh_textfigure_figure_coffin_horizontal_transform_dim
+ { \linewidth - \l__examzh_textfigure_tmpa_dim }
+ \coffin_join:NnnNnnnn
+ #1 { t } { r }
+ #2 { b } { r }
+ { \l__examzh_textfigure_figure_coffin_horizontal_transform_dim + \l__examzh_textfigure_figure_xshift_dim }
+ { 1em + \l__examzh_textfigure_figure_yshift_dim }
+ }
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_top-right:NN } #1#2
+ {
+ \coffin_join:NnnNnnnn
+ #1 { t } { r }
+ #2 { b } { r }
+ { \l__examzh_textfigure_figure_xshift_dim }
+ { 1em + \l__examzh_textfigure_figure_yshift_dim }
+ }
+% bottom-flushright:文本下方,水平方向在行尾
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_bottom-flushright:NN } #1#2
+ {
+ \dim_set:Nn \l__examzh_textfigure_tmpa_dim
+ { \coffin_wd:N #1 }
+ \dim_set:Nn \l__examzh_textfigure_figure_coffin_horizontal_transform_dim
+ { \linewidth - \l__examzh_textfigure_tmpa_dim }
+ \coffin_join:NnnNnnnn
+ #1 { b } { r }
+ #2 { t } { r }
+ { \l__examzh_textfigure_figure_coffin_horizontal_transform_dim + \l__examzh_textfigure_figure_xshift_dim }
+ { -1em + \l__examzh_textfigure_figure_yshift_dim }
+ }
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_bottom-right:NN } #1#2
+ {
+ \coffin_join:NnnNnnnn
+ #1 { b } { r }
+ #2 { t } { r }
+ { \l__examzh_textfigure_figure_xshift_dim }
+ { -1em + \l__examzh_textfigure_figure_yshift_dim }
+ }
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_top-left:NN } #1#2
+ {
+ \coffin_join:NnnNnnnn
+ #1 { t } { l }
+ #2 { b } { l }
+ { 0pt + \l__examzh_textfigure_figure_xshift_dim }
+ { 1em + \l__examzh_textfigure_figure_yshift_dim }
+ }
+\cs_new_protected:cpn { __examzh_textfigure_fig_pos_set_bottom-left:NN } #1#2
+ {
+ \coffin_join:NnnNnnnn
+ #1 { b } { l }
+ #2 { t } { l }
+ { 0pt + \l__examzh_textfigure_figure_xshift_dim }
+ { -1em + \l__examzh_textfigure_figure_yshift_dim }
+ } \ 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 817ee767e5..3f98de7858 100644
--- a/macros/xetex/latex/exam-zh/tex/exam-zh.cls
+++ b/macros/xetex/latex/exam-zh/tex/exam-zh.cls
@@ -1,12 +1,12 @@
%
% Copyright (c) 2022 Zeping Lee
% Released under the LaTeX Project Public License v1.3c License.
-% Repository: https://gitee.com/zepinglee/exam-zh
+% Repository: https://gitee.com/xkwxdyy/exam-zh
%
\NeedsTeXFormat{LaTeX2e}[2017/04/15]
\RequirePackage{expl3}
-\ProvidesExplClass {exam-zh} {2022-08-15} {v0.1.18} {LaTeX template for Chinese exam}
+\ProvidesExplClass {exam-zh} {2022-08-28} {v0.1.19} {LaTeX template for Chinese exam}
% 检查 LaTeX2e kernel 版本
\msg_new:nnn { exam-zh } { latex-too-old }
@@ -86,6 +86,7 @@
\RequirePackage { exam-zh-choices }
\RequirePackage { exam-zh-symbols }
\RequirePackage { exam-zh-chinese-english }
+\RequirePackage { exam-zh-textfigure }
\AtEndPreamble
{
@@ -182,8 +183,9 @@
\NewDocumentCommand { \ExamPrintAnswer } { }
{
- \clist_use:Nn \g__examzh_print_answer_cmd_set_clist {}
- \clist_if_empty:NF \g__examzh_print_answer_keys_set_clist
+ \clist_if_exist:NT \g__examzh_print_answer_cmd_set_clist
+ { \clist_use:Nn \g__examzh_print_answer_cmd_set_clist {} }
+ \clist_if_exist:NT \g__examzh_print_answer_keys_set_clist
{
\keys_set:nx { exam-zh }
{ \g__examzh_print_answer_keys_set_clist }
@@ -499,6 +501,11 @@
\dim_set:Nn \lineskiplimit { .5em }
\skip_set:Nn \lineskip { .5em }
+% 增加对 minipage 的处理
+% https://tex.stackexchange.com/a/358080/246645
+\dim_set:Nn \normallineskiplimit { .5em }
+\skip_set:Nn \normallineskip { .5em }
+
% 设置 enumitem 列表格式
@@ -534,9 +541,14 @@
\setlist[enumerate, 2]
{
- left = 2em,
- labelsep = 0pt,
- label = { ( \arabic * ) }
+ % labelindent = *,
+ leftmargin = 0pt,
+ widest = 0,
+ itemindent = 4em,
+ labelsep = 0pt,
+ % labelwidth = 2em,
+ listparindent = \parindent,
+ label = {( \arabic * )},
}
% 多种方法: method环境
@@ -1193,7 +1205,7 @@
}
\keys_set:nn { exam-zh / page }
{
- show-columnline = true,
+ show-columnline = false,
columnline-width = 0.4pt
}
diff --git a/macros/xetex/latex/xgreek/README b/macros/xetex/latex/xgreek/README
index 762a9207ae..d715f36f29 100644
--- a/macros/xetex/latex/xgreek/README
+++ b/macros/xetex/latex/xgreek/README
@@ -1,29 +1,39 @@
-Version 3.0.1 of package xgreek
+Version 3.1.0
+
+Introduces the option "listings" that loads the listings package,
+adjusts the catcodes of the Greek letters and allows one to properly
+use Greek letters in code listings (remember: all modern programming
+languages are UTF-8 aware!). It should be obvious, but here is how
+one can load the package with this oprion enabled:
+
+\usepackage[listings]{xgreek}
+
+Version 3.0.1
This version provides a fix to a typo found by a user.
-Version 3.0 of package xgreek
+Version 3.0
Include support for LuaLaTeX. Now one can use the package
with either XeLaTeX or LuaLaTeX.
-Version 2.7 of package xgreek
+Version 2.7
The package option "stigma" did not set the proper character.
-Also, all polytonic names use now characters from the
+Also, all polytonic names consist now of characters from the
Extended Greek Unicode block.
-Version 2.61 of package xgreek
+Version 2.61
In the previous version the uppercase of 'GREEK SMALL LETTER RHO WITH DASIA' (U+1FE5)
was set to be 'GREEK CAPITAL LETTER RHO WITH DASIA' (U+1FEC) while the correct is
-'GREEK CAPITAL LETTER RHO' (U+03A1). This version fixes the problem. Thanks to
+'GREEK CAPITAL LETTER RHO' (U+03A1). This version fixes this problem. Thanks to
Claudio Beccari and Günter Milde for finding this bug.
-Version 2.6 of package xgreek
+Version 2.6
In this version the definition of \anwtonos and \katwtonos have been
changed and now the commands expand to the correspong symbol and not
@@ -31,7 +41,7 @@ to some \char"03XX\relax sequence. It seems the previous definitions
did not work with some packages.
-Version 2.5 of package xgreek
+Version 2.5
By default the package enables the indentation even for first paragraph
after any header. This is the default in Greek typography. However, some
@@ -42,29 +52,29 @@ chapter headers to get printed without the NUMERAL SIGN. This feature
can be turned on with the new option nonumeralsign. Fianlly, command
\anoteleia can be used to get an ANO TELEIA character.
-Version 2.4 of package xgreek
+Version 2.4
Two erroneous entries in \@ncientn@mes have been deleted.
-Version 2.3 of package xgreek
+Version 2.3
In this version the \stigma command expands to the letters sigma tau.
If one wants this command to expand to the stigma symbol, she has to
use the stigma package option.
-Version 2.2 of package xgreek
+Version 2.2
Removed the first entry of \refname in \@ncientn@mes.
-Version 2.1 of package xgreek
+Version 2.1
I have introduced some new \lccode-\uccode pairs that
reflect current changes in Unicode 5.2 while I have corrected the
values for an existing pair.
-Version 2.0 of package xgreek
+Version 2.0
Package xgreek has been designed so to allow people to typeset
Greek language documents using XeLaTeX. And it is released in
@@ -88,4 +98,4 @@ greek loadhyph-el-polyton.tex
Apostolos Syropoulos
Xanthi, Greece
-2018/02/16
+2022/08/28
diff --git a/macros/xetex/latex/xgreek/xgreek.dtx b/macros/xetex/latex/xgreek/xgreek.dtx
index 14a9a59496..864345aa82 100644
--- a/macros/xetex/latex/xgreek/xgreek.dtx
+++ b/macros/xetex/latex/xgreek/xgreek.dtx
@@ -16,7 +16,7 @@
%%
%\iffalse
%
-% (c) Copyright 2007-2018 Apostolos Syropoulos
+% (c) Copyright 2007-2022 Apostolos Syropoulos
% This program can be redistributed and/or modified under the
% terms of the LaTeX Project Public License Distributed from
% http://www.latex-project.org/lppl.txt; either
@@ -29,12 +29,12 @@
% Apostolos Syropoulos (asyropoulos@yahoo.com)
%
%\fi
-% \CheckSum{1913}
-% \iffalse This is a Metacomment
+% \CheckSum{1929}
+% \iffalse This is a Metacommentxel
%
%<xgreek, >\ProvidesFile{xgreek.sty}
%
-%<xgreek, > [2018/02/16 v3.0.1 Package `xgreek.sty']
+%<xgreek, > [2022/08/28 v3.1.0 Package `xgreek.sty']
%
% \begin{macrocode}
%<*driver>
@@ -57,7 +57,7 @@
%\author{Apostolos Syropoulos\\
% Xanthi, Greece\\
% \texttt{asyropoulos@yahoo.com}}
-% \date{2009/11/23\\ Last Updated 2018/02/16}
+% \date{2009/11/23\\ Last Updated 2022/08/22}
%\maketitle
% \begin{abstract}
% The \textsf{xgreek} package provides rudimentary support for Greek language
@@ -87,7 +87,7 @@
% I first need to set up the correct |\uccode|s and |\lccode|s.
% \begin{macrocode}
%<*xgreek>
-\message{Package `xgreek' version 3.0.1 by Apostolos Syropoulos}
+\message{Package 'xgreek' version 3.1.0 by Apostolos Syropoulos}
\global\lccode"0370="0371 \global\uccode"0370="0370
\global\lccode"0371="0371 \global\uccode"0371="0370
\global\lccode"0372="0373 \global\uccode"0372="0372
@@ -576,12 +576,57 @@
\let\numer@lsign\relax
}
% \end{macrocode}
-%
-% By default the |monogreek| option is activated.
+% Package \textsf{listings} does not work properly with UTF-8 encoded files. So this
+% option should be used whenever one wants to use this package and see Greek text come out
+% correctly.
+% \begin{macrocode}
+\newif\if@mylistings
+\@mylistingsfalse
+\DeclareOption{listings}{%
+ \@mylistingstrue
+}
+% \end{macrocode}
+% By default the |monogreek| option is activated.
% \begin{macrocode}
\ExecuteOptions{monogreek}
\ProcessOptions
% \end{macrocode}
+% If the user has enabled the |listings| option, then it loads the package \textsf{listings}
+% and makes a few changes to it. In particular, it redefines the command |\lst@DefEC| and the new
+% comamnd makes all characters in the range 128--255 plus the Greek letters to be treated as letters.
+% \begin{macrocode}
+\if@mylistings
+\RequirePackage{listings}
+\lstset{inputencoding=utf8}
+\lst@InputCatcodes
+\gdef\lst@DefEC{%
+ \lst@CCECUse \lst@ProcessLetter
+ ^^80^^81^^82^^83^^84^^85^^86^^87^^88^^89^^8a^^8b^^8c^^8d^^8e^^8f%
+ ^^90^^91^^92^^93^^94^^95^^96^^97^^98^^99^^9a^^9b^^9c^^9d^^9e^^9f%
+ ^^a0^^a1^^a2^^a3^^a4^^a5^^a6^^a7^^a8^^a9^^aa^^ab^^ac^^ad^^ae^^af%
+ ^^b0^^b1^^b2^^b3^^b4^^b5^^b6^^b7^^b8^^b9^^ba^^bb^^bc^^bd^^be^^bf%
+ ^^c0^^c1^^c2^^c3^^c4^^c5^^c6^^c7^^c8^^c9^^ca^^cb^^cc^^cd^^ce^^cf%
+ ^^d0^^d1^^d2^^d3^^d4^^d5^^d6^^d7^^d8^^d9^^da^^db^^dc^^dd^^de^^df%
+ ^^e0^^e1^^e2^^e3^^e4^^e5^^e6^^e7^^e8^^e9^^ea^^eb^^ec^^ed^^ee^^ef%
+ ^^f0^^f1^^f2^^f3^^f4^^f5^^f6^^f7^^f8^^f9^^fa^^fb^^fc^^fd^^fe^^ff%
+ ^^^^0396^^^^0388^^^^0389^^^^038a^^^^038c% <--- Begin of Greek Letters
+ ^^^^038e^^^^038f^^^^0390^^^^0391^^^^0392%
+ ^^^^0393^^^^0394^^^^0395^^^^0396^^^^0397%
+ ^^^^0398^^^^0399^^^^039a^^^^039b^^^^039c%
+ ^^^^039d^^^^039e^^^^039f^^^^03a0^^^^03a1%
+ ^^^^03a3^^^^03a4^^^^03a5^^^^03a6^^^^03a7%
+ ^^^^03a8^^^^03a9^^^^03aa^^^^03ab^^^^03ac%
+ ^^^^03ad^^^^03ae^^^^03af^^^^03b0^^^^03b1%
+ ^^^^03b2^^^^03b3^^^^03b4^^^^03b5^^^^03b6%
+ ^^^^03b7^^^^03b8^^^^03b9^^^^03ba^^^^03bb%
+ ^^^^03bc^^^^03bd^^^^03be^^^^03bf^^^^03c0%
+ ^^^^03c1^^^^03c2^^^^03c3^^^^03c4^^^^03c5%
+ ^^^^03c6^^^^03c7^^^^03c8^^^^03c9^^^^03ca%
+ ^^^^03cb^^^^03cc^^^^03cd^^^^03ce% <--- End of Greek Letters
+ ^^00}%
+\lst@RestoreCatcodes
+\fi
+% \end{macrocode}
% Now I am going to define the macros that typeset alphabetic Greek numerals. The code
% is borrowed from the greek option for the babel package.
% \begin{macro}{\gr@ill@value}
@@ -620,8 +665,8 @@
% \end{macro}
%
% \begin{macro}{\@greeknumeral}
-% This command is used to typeset Greek numerals. The command uses
-% |\numer@lsign| to typeset the NUMERAL SIGN. Obviously, when the
+% This command is used to get Greek numerals. The command uses
+% |\numer@lsign| to get the NUMERAL SIGN. Obviously, when the
% user has specified the \texttt{no\-numeral\-sign} option, then numeral
% comes out without the trailing NUMERAL SIGN. However, when a user
% wants to typeset a Greek numeral, the numeral must come out correctly,
@@ -806,11 +851,13 @@
\ifnum\@attic@num<\@ne%
\space%
\PackageWarning{xgreek}{%
- Illegal value (\the\@attic@num) for acrophonic Attic numeral}%
+ Illegal value (\the\@attic@num) for acrophonic
+ Attic numeral}%
\else\ifnum\@attic@num>249999%
\space%
\PackageWarning{xgreek}{%
- Value too large (\the\@attic@num) for acrophonic Attic numeral}%
+ Value too large (\the\@attic@num) for acrophonic
+ Attic numeral}%
\else
% \end{macrocode}
% Having done all the necessary checks, it is possible to proceed with the actual
@@ -939,7 +986,8 @@
\ifx\directlua\undefined%
\def\setlanguage#1{%
\expandafter\ifx\csname l@#1\endcsname\relax%
- \typeout{^^J Error: No hyphenation pattern for language #1 loaded,}%
+ \typeout{^^J Error: No hyphenation pattern for}%
+ \typeout{ language #1 are loaded,}%
\typeout{ default hyphenation patterns are used.^^J}%
\language=0%
\else\language=\csname l@#1\endcsname\fi}
diff --git a/macros/xetex/latex/xgreek/xgreek.ins b/macros/xetex/latex/xgreek/xgreek.ins
index 61032e4b68..b744ebff6c 100644
--- a/macros/xetex/latex/xgreek/xgreek.ins
+++ b/macros/xetex/latex/xgreek/xgreek.ins
@@ -1,9 +1,9 @@
-%% Copyright 2007—2018 Apostolos Syropoulos
+%% Copyright 2007—2022 Apostolos Syropoulos
%%
%% This file is part of the `xgreek' package.
%% You are not allowed to modify its contents.
%%
-\def\filedate{2017/02/16}
+\def\filedate{2022/08/28}
\def\batchfile{xgreek.ins}
\input docstrip.tex
@@ -24,7 +24,7 @@
\preamble
- (c) Copyright 2007—2018 Apostolos Syropoulos
+ (c) Copyright 2007—2022 Apostolos Syropoulos
This program can be redistributed and/or modified under the
terms of the LaTeX Project Public License Distributed from
http://www.latex-project.org/lppl.txt; either
diff --git a/macros/xetex/latex/xgreek/xgreek.pdf b/macros/xetex/latex/xgreek/xgreek.pdf
index b13ca29503..734a291e46 100644
--- a/macros/xetex/latex/xgreek/xgreek.pdf
+++ b/macros/xetex/latex/xgreek/xgreek.pdf
Binary files differ