summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-03-14 20:22:32 +0000
committerKarl Berry <karl@freefriends.org>2024-03-14 20:22:32 +0000
commit2bb8d5e07c328b2737d7e4ba46365bffa060b64f (patch)
tree9afb49663c9072993cb477a649c66bfd7363e51f /Master/texmf-dist
parentf7004d19658397ec2ff9af87ee2f84509872a77e (diff)
jnuexam (14mar24)
git-svn-id: svn://tug.org/texlive/trunk@70636 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-a-answer.pdfbin109643 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-a-empty.pdfbin95848 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-b-answer.pdfbin109569 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-b-empty.pdfbin95796 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfc-a-answer.pdfbin0 -> 112749 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfc-a-answer.tex (renamed from Master/texmf-dist/doc/latex/jnuexam/exam-a-answer.tex)138
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfc-a-blank.pdfbin0 -> 98857 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfc-a-blank.tex (renamed from Master/texmf-dist/doc/latex/jnuexam/exam-b-empty.tex)2
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfc-b-answer.pdfbin0 -> 112707 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfc-b-answer.tex (renamed from Master/texmf-dist/doc/latex/jnuexam/exam-b-answer.tex)2
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfc-b-blank.pdfbin0 -> 98922 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfc-b-blank.tex (renamed from Master/texmf-dist/doc/latex/jnuexam/exam-a-empty.tex)2
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfe-a-answer.pdfbin0 -> 69901 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfe-a-answer.tex375
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfe-a-blank.pdfbin0 -> 66139 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfe-a-blank.tex6
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfe-b-answer.pdfbin0 -> 69943 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfe-b-answer.tex6
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfe-b-blank.pdfbin0 -> 66167 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/examfe-b-blank.tex6
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/jnuexam.pdfbin81144 -> 85122 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/jnuexam.tex154
-rw-r--r--Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls1610
23 files changed, 975 insertions, 1326 deletions
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-a-answer.pdf b/Master/texmf-dist/doc/latex/jnuexam/exam-a-answer.pdf
deleted file mode 100644
index 3088b9303a7..00000000000
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-a-answer.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-a-empty.pdf b/Master/texmf-dist/doc/latex/jnuexam/exam-a-empty.pdf
deleted file mode 100644
index 486e1bf782b..00000000000
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-a-empty.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-b-answer.pdf b/Master/texmf-dist/doc/latex/jnuexam/exam-b-answer.pdf
deleted file mode 100644
index 3da76b9f31e..00000000000
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-b-answer.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-b-empty.pdf b/Master/texmf-dist/doc/latex/jnuexam/exam-b-empty.pdf
deleted file mode 100644
index 047319bf581..00000000000
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-b-empty.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/examfc-a-answer.pdf b/Master/texmf-dist/doc/latex/jnuexam/examfc-a-answer.pdf
new file mode 100644
index 00000000000..f6f0a506494
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfc-a-answer.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-a-answer.tex b/Master/texmf-dist/doc/latex/jnuexam/examfc-a-answer.tex
index 28d7c755522..e68f2c3da9c 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-a-answer.tex
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfc-a-answer.tex
@@ -1,83 +1,85 @@
% -*- coding: utf-8 -*-
% !TEX program = xelatex
-\documentclass{jnuexam}
+\documentclass[chinese]{jnuexam} % 中文试卷
-%\answerfalse %不显示答案
+%\SetExamBoolFalse{answer} %不显示答案
-\setexam{
- binding = 2, % 装订线,1 仅空白试卷有,2 试卷和答案都有
- scratch = 1, % 草稿纸数量,仅空白试卷有,A3 大小,双面印刷
+\SetExamOption{
+ binding = 2, % 装订线,1 仅空白试卷有,2 试卷和答案都有
+ scratch = 1, % 草稿纸数量,仅空白试卷有,A3 大小,双面印刷
seed = 19061116, % 随机数种子,用于改变 B 卷小题的随机顺序
}
\begin{document}
-\renewcommand{\niandu}{2017--2018}
-\renewcommand{\xueqi}{2}
-\renewcommand{\kecheng}{大学数学}
-\renewcommand{\zhuanye}{理工四学分} % 可以为空白
-\renewcommand{\jiaoshi}{张三,李四,王五} % 教师姓名
-\renewcommand{\shijian}{2018~年~06~月~28~日}
-\renewcommand{\bixiu}{1} % 1 为必修,0 为选修
-\renewcommand{\bijuan}{1} % 1 为闭卷,0 为开卷
-\renewcommand{\shijuan}{A} % A 或 B 或 C 卷
-\renewcommand{\neizhao}{1} % 1 打勾,0 不勾
-\renewcommand{\waizhao}{0} % 1 打勾,0 不勾
+\examtitle{ % 生成试卷表头
+ niandu = 2017--2018,
+ xueqi = 2,
+ kecheng = 大学数学,
+ zhuanye = 理工四学分, % 可以为空白
+ jiaoshi = {张三,李四,王五}, % 教师姓名
+ shijian = 2018~年~06~月~28~日,
+ bixiu = 1, % 1 为必修,0 为选修
+ bijuan = 1, % 1 为闭卷,0 为开卷
+ shijuan = A, % A 或 B 或 C 卷
+ neizhao = 1, % 1 打勾,0 不勾
+ waizhao = 0, % 1 打勾,0 不勾
+}
-\makehead % 生成试卷表头
+\gradetable[total=4] % 生成评分表
-\makepart{填空题}{共~6~小题,每小题~3~分,共~18~分}
+\exampart{填空题}[共~6~小题,每小题~3~分,共~18~分]
-\answertable[3em]{6}{3} % 生成答题栏:行高3em,总共6题,每行3题
+\answertable[total=6,column=3,strut=3em] % 生成答题栏:行高3em,总共6题,每行3题
-\begin{problem}
-设常数$k>0$,函数$f(x)=\ln x-\dfrac{x}{\e}+k$在$(0,+\infty)$内零点的个数为 \fillout{$2$}.
-\end{problem}
+\begin{question}
+设常数$k>0$,函数$f(x)=\ln x-\frac{x}{\e}+k$在$(0,+\infty)$内零点的个数为 \fillout{$2$}.
+\end{question}
\vfill
-\begin{problem}
+\begin{question}
设$\va=(2,1,2)$,$\vb=(4,-1,10)$,$\vc=\vb-\lambda\va$,且$\va\bot\vc$,则$\lambda=$ \fillout{$3$}.
-\end{problem}
+\end{question}
\vfill
-\begin{problem}
+\begin{question}
已知二阶行列式 $\left|\begin{array}{cc}
1 & 2\\
- 3 & x
\end{array}\right|=0$,则 $x=$ \fillout{$-6$}.
-\end{problem}
+\end{question}
\vfill
-\begin{problem}
+\begin{question}
向量组 $\alpha_1=(1,1,0), \alpha_2=(0,1,1), \alpha_3=(1,0,1)$,
则将向量 $\beta=(4, 5, 3)$ 表示为 $\alpha_1, \alpha_2, \alpha_3$
的线性组合为 $\beta=$ \fillout{$3\alpha_1+2\alpha_2+\alpha_3$}.
-\end{problem}
+\end{question}
\vfill
-\begin{problem}
+\begin{question}
已知随机变量$\xi$的期望和方差各为$E\xi=3, D\xi=2$, 则$E\xi^2=$ \fillout{$11$}.
-\end{problem}
+\end{question}
\vfill
-\begin{problem}
+\begin{question}
已知$\xi$和$\eta$相互独立且$\xi\sim N(1,4), \eta\sim N(2,5)$,则$\xi-2\eta\sim$ \fillout{$N(-3,24)$}.
-\end{problem}
+\end{question}
\vfill
\newpage
-\makepart{单选题}{共~6~小题,每小题~3~分,共~18~分}
+\exampart{单选题}[共~6~小题,每小题~3~分,共~18~分]
-\answertable{6}{6} % 生成答题栏:默认行高,总共8题,每行8题
+\answertable[total=6,column=6] % 生成答题栏:默认行高,总共6题,每行6题
-\begin{problem}
+\begin{question}
在下列等式中,正确的结果是\pickout{C}
\begin{abcd}
\item $\int f'(x)\dx=f(x)$
@@ -85,11 +87,11 @@
\item $\frac{\d}{\dx}\big(\int f(x)\dx\big)=f(x)$
\item $\d\big(\int f(x)\dx\big)=f(x)$
\end{abcd}
-\end{problem}
+\end{question}
\bigskip
-\begin{problem}
+\begin{question}
假设$F(x)$是连续函数$f(x)$的一个原函数,则必有\pickout{A}
\begin{abcd}
\item $F(x)$是偶函数 $\Leftrightarrow$ $f(x)$是奇函数
@@ -97,11 +99,11 @@
\item $F(x)$是周期函数 $\Leftrightarrow$ $f(x)$是周期函数
\item $F(x)$是单调函数 $\Leftrightarrow$ $f(x)$是单调函数
\end{abcd}
-\end{problem}
+\end{question}
\bigskip
-\begin{problem}
+\begin{question}
设矩阵 $A = \left(\begin{array}{ccc}
1 & 1 & 0\\
1 & x & 0\\
@@ -114,11 +116,11 @@
\item $0$
\item $-1$
\end{abcd}
-\end{problem}
+\end{question}
\bigskip
-\begin{problem}
+\begin{question}
二次型 $f = 4 x_1^2 - 2 x_1 x_2 + 6 x_2^2$ 对应的矩阵等于 \pickout{C}
\begin{abcd}
\item $\left(\begin{array}{cc}
@@ -138,11 +140,11 @@
- 1 & 3
\end{array}\right)$
\end{abcd}
-\end{problem}
+\end{question}
\bigskip
-\begin{problem}
+\begin{question}
下列说法\CJKunderline{不正确}的是\pickout{B}
\begin{abcd}
\item 大数定律说明了大量相互独立且同分布的随机变量的均值的稳定性
@@ -150,11 +152,11 @@
\item 中心极限定理说明了大量相互独立且同分布的随机变量的和的稳定性
\item 中心极限定理说明大量相互独立且同分布的随机变量的和近似于正态分布
\end{abcd}
-\end{problem}
+\end{question}
\bigskip
-\begin{problem}
+\begin{question}
对总体$X$和样本$(X_1,\cdots,X_n)$的说法哪个是\CJKunderline{不正确}的\pickout{D}
\begin{abcd}
\item 总体是随机变量
@@ -162,17 +164,17 @@
\item $X_1, \cdots, X_n$相互独立
\item $X_1 = X_2 =\cdots = X_n$
\end{abcd}
-\end{problem}
+\end{question}
\bigskip
\newpage
-\makepart{计算题}{共~6~小题,每小题~8~分,共~48~分}
+\exampart{计算题}[共~6~小题,每小题~8~分,共~48~分]
-\begin{problem}
+\begin{question}
求不定积分$\displaystyle\int\e^{2x}\,(\tan x+1)^2\dx$。
-\end{problem}
+\end{question}
\smallskip
@@ -186,9 +188,9 @@
\vfill
-\begin{problem}
+\begin{question}
求过点$A(1,2,-1), B(2,3,0),C(3,3,2)$ 的三角形$\triangle ABC$ 的面积和它们确定的平面方程.
-\end{problem}
+\end{question}
\smallskip
@@ -199,8 +201,8 @@
1&1&1\\
2&1&3\\
\end{vmatrix}=(2,-1,-1)$, \points{4}
-三角形$\triangle ABC$ 的面积为$S_{\triangle ABC}=\dfrac{1}{2}\big|\overrightarrow{AB}\times
-\overrightarrow{AC}\big|=\dfrac{1}{2}\sqrt{6}.$ \points{6}
+三角形$\triangle ABC$ 的面积为$S_{\triangle ABC}=\frac{1}{2}\big|\overrightarrow{AB}\times
+\overrightarrow{AC}\big|=\frac{1}{2}\sqrt{6}.$ \points{6}
所求平面的方程为$2(x-2)-(y-3)-z=0$, 即$2x-y-z-1=0$ \points{8}
\end{solution}
@@ -208,14 +210,14 @@
\newpage
-\begin{problem}
+\begin{question}
计算四阶行列式 $A = \left|\begin{array}{cccc}
0 & 1 & 2 & 3\\
1 & 2 & 3 & 0\\
2 & 3 & 0 & 1\\
3 & 0 & 1 & 2
\end{array}\right|$ 的值.
-\end{problem}
+\end{question}
\smallskip
@@ -247,10 +249,10 @@ $A \? = \left|\begin{array}{cccc}
\vfill
-\begin{problem}
+\begin{question}
利用配方法,将二次型 $f = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12
x_2 x_3 + 9 x^2_3$ 化为标准形 $f = d_1 y^2_1 + d_2 y^2_2 + d_3 y^2_3$ .
-\end{problem}
+\end{question}
\smallskip
@@ -268,11 +270,11 @@ $f \? = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12 x_2 x_3 + 9 x^2_3$ \par
\newpage
-\begin{problem}
+\begin{question}
设每发炮弹命中飞机的概率是0.2且相互独立,现在发射100发炮弹.\par
(1) 用切贝谢夫不等式估计命中数目$\xi$在10发到30发之间的概率.\par
(2) 用中心极限定理估计命中数目$\xi$在10发到30发之间的概率.
-\end{problem}
+\end{question}
\smallskip
@@ -287,10 +289,10 @@ $E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$.
\vfill
-\begin{problem}
+\begin{question}
从正态总体$N(\mu,\sigma^2)$中抽出样本容量为16的样本,算得其平均数为3160,标准差为100.
试检验假设$H_0:\mu=3140$是否成立($\alpha = 0.01$).
-\end{problem}
+\end{question}
\smallskip
@@ -306,13 +308,13 @@ $E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$.
\newpage
-\makepart{证明题}{共~2~小题,每小题~8~分,共~16~分}
+\exampart{证明题}[共~2~小题,每小题~8~分,共~16~分]
-\renewcommand{\solutionname}{证} % 将“解”字改为“证”字
+\SetExamTranslation{solution-Solution=证} % 将“解”字改为“证”字
-\begin{problem}
+\begin{question}
设数列$\{x_n\}$满足$x_1=\sqrt2$,$x_{n+1}=\sqrt{2+x_n}$.证明数列收敛,并求出极限.
-\end{problem}
+\end{question}
\smallskip
@@ -330,9 +332,9 @@ $$A=\sqrt{2+A}.$$
\vfill
-\begin{problem}
+\begin{question}
设事件$A$和$B$相互独立,证明$A$和$\widebar{B}$相互独立.
-\end{problem}
+\end{question}
\smallskip
@@ -345,7 +347,7 @@ $$A=\sqrt{2+A}.$$
\vfill
-\makedata{一些可能用到的数据} %附录数据
+\examdata{一些可能用到的数据} %附录数据
\begin{tabularx}{\linewidth}{*{4}{>{$}X<{$}}}
\hline
diff --git a/Master/texmf-dist/doc/latex/jnuexam/examfc-a-blank.pdf b/Master/texmf-dist/doc/latex/jnuexam/examfc-a-blank.pdf
new file mode 100644
index 00000000000..09d8a14b153
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfc-a-blank.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-b-empty.tex b/Master/texmf-dist/doc/latex/jnuexam/examfc-a-blank.tex
index 953a4aab9ff..4d1ccf82c94 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-b-empty.tex
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfc-a-blank.tex
@@ -3,4 +3,4 @@
% 重新排版原有的 A4 试卷,不显示答案
\PassOptionsToClass{noanswer}{jnuexam}
-\input{exam-b-answer}
+\input{examfc-a-answer}
diff --git a/Master/texmf-dist/doc/latex/jnuexam/examfc-b-answer.pdf b/Master/texmf-dist/doc/latex/jnuexam/examfc-b-answer.pdf
new file mode 100644
index 00000000000..2356b53690f
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfc-b-answer.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-b-answer.tex b/Master/texmf-dist/doc/latex/jnuexam/examfc-b-answer.tex
index 6925ea8fff7..e850a68bb38 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-b-answer.tex
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfc-b-answer.tex
@@ -3,4 +3,4 @@
% 从 A 卷自动生成 B 卷,将题目乱序排列
\PassOptionsToClass{random}{jnuexam}
-\input{exam-a-answer}
+\input{examfc-a-answer}
diff --git a/Master/texmf-dist/doc/latex/jnuexam/examfc-b-blank.pdf b/Master/texmf-dist/doc/latex/jnuexam/examfc-b-blank.pdf
new file mode 100644
index 00000000000..d9160a13edc
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfc-b-blank.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-a-empty.tex b/Master/texmf-dist/doc/latex/jnuexam/examfc-b-blank.tex
index 23099457379..3a9dea5d814 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-a-empty.tex
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfc-b-blank.tex
@@ -3,4 +3,4 @@
% 重新排版原有的 A4 试卷,不显示答案
\PassOptionsToClass{noanswer}{jnuexam}
-\input{exam-a-answer}
+\input{examfc-b-answer}
diff --git a/Master/texmf-dist/doc/latex/jnuexam/examfe-a-answer.pdf b/Master/texmf-dist/doc/latex/jnuexam/examfe-a-answer.pdf
new file mode 100644
index 00000000000..6ac1d17806d
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfe-a-answer.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/examfe-a-answer.tex b/Master/texmf-dist/doc/latex/jnuexam/examfe-a-answer.tex
new file mode 100644
index 00000000000..ee35652a916
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfe-a-answer.tex
@@ -0,0 +1,375 @@
+% -*- coding: utf-8 -*-
+% !TEX program = xelatex
+\documentclass[english]{jnuexam} % 英文试卷
+
+%\SetExamBoolFalse{answer} % hide answers
+
+\SetExamOption{
+ binding = 1, % 装订线,1 仅空白试卷有,2 试卷和答案都有
+ scratch = 1, % 草稿纸数量,仅空白试卷有,A3 大小,双面印刷
+ seed = 19061116, % 随机数种子,用于改变 B 卷小题的随机顺序
+}
+
+\begin{document}
+
+% make exam title
+\examtitle{
+ AcademicYear = 2016--2017, % 教学年度
+ Semester = 2, % 第几学期
+ CourseTitle = Math 1906, % 课程名称
+ Instructor = {Jianrui Lyu}, % 教师姓名
+ Date = dd/mm/yyyy, % 考试时间
+ Compulsory = 1, % 是否必修:1 为必修,0 为选修
+ ClosedBook = 1, % 是否闭卷:1 为闭卷,0 为开卷
+ Paper = A, % 试卷版本:A 或 B 或 C 卷
+ Mainland = 0, % 内招适用:1 打勾,0 不勾
+ NonMainland = 1, % 外招适用:1 打勾,0 不勾
+}
+
+\gradetable[total=4]
+
+\exampart{Fill in the blanks.}[6 questions; 3 points for each; 18 points in total.]
+
+% make answer table: six in total, three for each row, strut height 3em
+\answertable[total=6,column=3,strut=3em]
+
+\begin{question}
+The first question $k>0$, text $f(x)=\ln x-\frac{x}{\e}+k$ text $(0,+\infty)$
+text text text text text text text text text text text text text text text text
+text text text text text text text text text text text text text \fillout{$2$}.
+\end{question}
+
+\bigskip
+
+\begin{question}
+The second question $\va=(2,1,2)$, $\vb=(4,-1,10)$, $\vc=\vb-\lambda\va$,
+text text text $\va\bot\vc$, text text text text text text text text text
+text text text text text $\lambda=$ \fillout{$3$}.
+\end{question}
+
+\bigskip
+
+\begin{question}
+The third question $\left|\begin{array}{cc}
+ 1 & 2\\
+ -3 & x
+\end{array}\right|=0$, text text text text text text text text
+text text text text text text text text text $x=$ \fillout{$-6$}.
+\end{question}
+
+\bigskip
+
+\begin{question}
+The fourth question $\alpha_1=(1,1,0), \alpha_2=(0,1,1), \alpha_3=(1,0,1)$,
+text $\beta=(4, 5, 3)$ text $\alpha_1, \alpha_2, \alpha_3$ text text text text
+text text text text text text text text text text text text text text text text
+text text text text text text $\beta=$ \fillout{$3\alpha_1+2\alpha_2+\alpha_3$}.
+\end{question}
+
+\bigskip
+
+\begin{question}%[points=3]
+The fifth question $\xi$ text text text $E\xi=3, D\xi=2$, text text text text text
+text text text text text text text text text text $E\xi^2=$ \fillout{$11$}.
+\end{question}
+
+\bigskip
+
+\begin{question}
+The sixth question $\xi$ text text text text $\eta$ text text text text $\xi\sim N(1,4),
+\eta\sim N(2,5)$, text text text text text text text text text text text text text text
+text text text text text text text text text text $\xi-2\eta\sim$ \fillout{$N(-3,24)$}.
+\end{question}
+
+\bigskip
+
+\newpage
+
+\exampart{Select one answer from four choices.}[6 questions; 3 points for each; 18 points in total.]
+
+% make answer table: six in total, six for each row, default strut height
+\answertable[total=6,column=6]
+
+\begin{question}
+The first question text, text text text text text text text text text text
+text text text text text text text text text text text text text \pickout{C}
+\begin{abcd}
+\item first $\int f'(x)\dx=f(x)$
+\item second $\int \d f(x)=f(x)$
+\item third $\frac{\d}{\dx}\big(\int f(x)\dx\big)=f(x)$
+\item fourth $\d\big(\int f(x)\dx\big)=f(x)$
+\end{abcd}
+\end{question}
+
+\bigskip
+
+\begin{question}
+The second question $F(x)$ text $f(x)$ text, text \pickout{A}
+\begin{abcd}
+\item first choice $F(x)$ text $\Leftrightarrow$ $f(x)$ text
+\item second choice $F(x)$ text text $\Leftrightarrow$ $f(x)$ text
+\item third choice $F(x)$ text $\Leftrightarrow$ $f(x)$ text text
+\item fourth choice $F(x)$ text text $\Leftrightarrow$ $f(x)$ text text
+\end{abcd}
+\end{question}
+
+\bigskip
+
+\begin{question}
+The third question $A = \left(\begin{array}{ccc}
+ 1 & 1 & 0\\
+ 1 & x & 0\\
+ 0 & 0 & 1
+\end{array}\right)$ text text $\lambda_1 = 1$ text $\lambda_2
+= 2$, text $x=$ \pickout{B}
+\begin{abcd}
+\item $2$
+\item $1$
+\item $0$
+\item $-1$
+\end{abcd}
+\end{question}
+
+\bigskip
+
+\begin{question}
+The fourth question $f = 4 x_1^2 - 2 x_1 x_2 + 6 x_2^2$ text text text text text text
+text text text text text text text text text text text text text text text \pickout{C}
+\begin{abcd}
+\item $\left(\begin{array}{cc}
+ 4 & - 2\\
+ - 2 & 6
+\end{array}\right)$
+\item $\left(\begin{array}{cc}
+ 2 & - 2\\
+ - 2 & 3
+\end{array}\right)$
+\item $\left(\begin{array}{cc}
+ 4 & - 1\\
+ - 1 & 6
+\end{array}\right)$
+\item $\left(\begin{array}{cc}
+ 2 & - 1\\
+ - 1 & 3
+\end{array}\right)$
+\end{abcd}
+\end{question}
+
+\bigskip
+
+\begin{question}
+The fifth question \underline{wrong} text \pickout{B}
+\begin{abcd}
+\item first choice text text text text text text text text text
+\item second choice text text text text text text text text text
+\item third choice text text text text text text text text text
+\item fourth choice text text text text text text text text text
+\end{abcd}
+\end{question}
+
+\bigskip
+
+\begin{question}
+The sixth question $X$ text $(X_1,\cdots,X_n)$ text \underline{wrong} text text
+text text text text text text text text text text text text text text \pickout{D}
+\begin{abcd}
+\item text text text
+\item text $n$ text
+\item $X_1, \cdots, X_n$ text
+\item $X_1 = X_2 =\cdots = X_n$
+\end{abcd}
+\end{question}
+
+\bigskip
+
+\newpage
+
+\exampart{Work out math questions.}[6 questions; 8 points for each; 48 points in total.]
+
+\begin{question}
+The first question $\int\e^{2x}\,(\tan x+1)^2\dx$.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+$I$ \? $=\int\e^{2x}\,\sec^2 x\dx+2\int\e^{2x}\,\tan x\dx$ \points{2}
+\+ $=\int\e^{2x}\,\d(\tan x)+ 2\int\e^{2x}\,\tan x\dx$ \points{4}
+\+ $=\e^{2x}\,\tan x - 2\int\e^{2x}\,\tan x\dx+ 2\int\e^{2x}\,\tan x\dx$ \points{6}
+\+ $=\e^{2x}\,\tan x + C$ \points{8}
+\end{solution}
+
+\vfill
+
+\begin{question}
+The second question $A(1,2,-1), B(2,3,0),C(3,3,2)$ text $\triangle ABC$ text text text text text text.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+Text $\overrightarrow{AB}=(1,1,1),\overrightarrow{AC}=(2,1,3)$, \points{2}
+text $\overrightarrow{AB}\times \overrightarrow{AC}=\begin{vmatrix}
+\vec{i}&\vec{j} &\vec{k}\\
+1&1&1\\
+2&1&3\\
+\end{vmatrix}=(2,-1,-1)$, \points{4}
+text $\triangle ABC$ text $S_{\triangle ABC}=\frac{1}{2}\big|\overrightarrow{AB}\times
+\overrightarrow{AC}\big|=\frac{1}{2}\sqrt{6}.$ \points{6}
+Text text $2(x-2)-(y-3)-z=0$, text $2x-y-z-1=0$. \points{8}
+\end{solution}
+
+\vfill
+
+\newpage
+
+\begin{question}
+The third question $A = \left|\begin{array}{cccc}
+ 0 & 1 & 2 & 3\\
+ 1 & 2 & 3 & 0\\
+ 2 & 3 & 0 & 1\\
+ 3 & 0 & 1 & 2
+\end{array}\right|$ text.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+$A \? = \left|\begin{array}{cccc}
+ 0 & 1 & 2 & 3\\
+ 1 & 2 & 3 & 0\\
+ 2 & 3 & 0 & 1\\
+ 3 & 0 & 1 & 2
+ \end{array}\right| = \left|\begin{array}{cccc}
+ 0 & 1 & 2 & 3\\
+ 1 & 2 & 3 & 0\\
+ 0 & - 1 & - 6 & 1\\
+ 0 & - 6 & - 8 & 2
+ \end{array}\right| = 1 \cdot (- 1)^{2 + 1} \left|\begin{array}{ccc}
+ 1 & 2 & 3\\
+ - 1 & - 6 & 1\\
+ - 6 & - 8 & 2
+ \end{array}\right|$ \points{4}
+\+ $= -\left|\begin{array}{ccc}
+ 1 & 2 & 3\\
+ 0 & - 4 & 4\\
+ 0 & 4 & 20
+ \end{array}\right| = - \left|\begin{array}{cc}
+ - 4 & 4\\
+ 4 & 20
+ \end{array}\right| = -(-4\cdot20-4\cdot4) = 96$ \points{8}
+\end{solution}
+
+\vfill
+
+\begin{question}
+The fourth question, tex text $f = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12
+x_2 x_3 + 9 x^2_3$ text text $f = d_1 y^2_1 + d_2 y^2_2 + d_3 y^2_3$.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+$f \? = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12 x_2 x_3 + 9 x^2_3$ \par
+ \+ $= x_1^2 + 2 x_1 (x_2 - 3 x_3) + (x_2 - 3 x_3)^2 + x_2^2 - 6 x_2 x_3 $ \par
+ \+ $= (x_1 + x_2 - 3 x_3)^2 + x_2^2 - 6 x_2 x_3$ \points{3}
+ \+ $= (x_1 + x_2 - 3 x_3)^2 + x_2^2 - 2 x_2 \cdot 3 x_3 + (3 x_3)^2 - 9x_3^2$ \par
+ \+ $= (x_1 + x_2 - 3 x_3)^2 + (x_2 - 3 x_3)^2 - 9 x_3^2$ \points{6}
+Text $y_1 = x_1 + x_2 - 3 x_3, y_2 = x_2 - 3 x_3, y_3 = x_3$, \newline
+text $f = y_1^2 + y_2^2 - 9y_3^2$ text.\points{8}
+\end{solution}
+
+\vfill
+
+\newpage
+
+\begin{question}
+The fifth question text text text $0.2$ text text, text text $100$ text text.\par
+(1) text text text text text text $\xi$ text $10$ text $30$ text.\par
+(2) text text text text text $\xi$ text $10$ text $30$ text.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+$E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$. \points{2}
+(1) $P (10 < \xi < 30) = P (|\xi - E\xi| < 10) \ge 1 - \frac{D\xi}{10^2}
+ = 1 - \frac{16}{100} = 0.84$. \points{4}
+(2) $P (10 < \xi < 30) \? \approx \Phi_0\left(\frac{30 - 20}{\sqrt{16}}\right)
+ - \Phi_0\left(\frac{10 - 20}{\sqrt{16}}\right)$ \points{6}
+ \+ $= 2 \Phi_0(2.5) - 1 = 2 \cdot 0.9938 - 1 =0.9876$ \points{8}
+\end{solution}
+
+\vfill
+
+\begin{question}
+The sixth question $N(\mu,\sigma^2)$ text text $16$ text, text text text $3160$, text text $100$.
+Text text $H_0:\mu=3140$ text text ($\alpha = 0.01$).
+\end{question}
+
+\smallskip
+
+\begin{solution}
+(1) Text text $H_0 : \mu = 3140$. \points{2}
+(2) Text text text $T = \frac{\widebar{X}-\mu}{S / \sqrt{n}} \sim t(n-1)$. \points{3}
+(3) Text text $t_{\alpha} = t_{\alpha} (n - 1) = t_{0.01} (15) =2.947$. \points{5}
+(4) Text text text $t = \frac{\widebar{x} - \mu_0}{s/\sqrt{n}} =\frac{3160-3140}{100/4} = 0.8$.\points{7}
+(5) Text $| t | < t_{\alpha}$, text text $H_0$, text text text. \points{8}
+\end{solution}
+
+\vfill
+
+\newpage
+
+\exampart{Work out math proofs.}[2 questions; 16 points in total.]
+
+\SetExamTranslation{solution-Solution=Proof} % rename "Solution" as "Proof"
+
+\begin{question}[points=9]
+The first question $\{x_n\}$ text $x_1=\sqrt2$, $x_{n+1}=\sqrt{2+x_n}$.
+Text text text, text text text.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+(1) Text, text $x_1<2$, text $x_k<2$ text
+$$x_{k+1}=\sqrt{2+x_k}<\sqrt{2+2}=2,$$
+Text text text text text $n$ text $x_n<2$, text text text.
+Text text
+$$\frac{x_{n+1}}{x_n}=\sqrt{\frac{2}{x_n^2}+\frac{1}{x_n}}>\sqrt{\frac{2}{2^2}+\frac{1}{2}}=1,$$
+Text text text text text. Text text text text text, Text text text text.\points{4}
+(2) Text text text text $A$, text text text text text text
+$$A=\sqrt{2+A}.$$
+Text text $A=2$, text text $\{x_n\}$ text text text $2$.\points{8}
+\end{solution}
+
+\vfill
+
+\begin{question}[points=7]
+The second question $A$ text $B$ text, text $A$ text $\widebar{B}$ text.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+\? $P (A \cdot \widebar{B}) = P (A - B) = P (A - A B)$ \points{2}
+\< $= P (A) - P (A B) = P (A) - P (A) P (B)$ \points{4}
+\< $= P (A) (1 - P (B)) = P (A) P (\widebar{B})$ \points{6}
+Text text text $A$ text text text $\widebar{B}$ text text text.\points{8}
+\end{solution}
+
+\vfill
+
+\examdata{Some data may be used in the exam} % appendix data
+
+\begin{tabularx}{\linewidth}{*{4}{>{$}X<{$}}}
+\hline
+\Phi_0(0.5)=0.6915 & \Phi_0(1)=0.8413 & \Phi_0(2)=0.9773 & \Phi_0(2.5)=0.9938 \\
+t_{0.01}(8)=3.355 & t_{0.01}(9)=3.250 & t_{0.01}(15)=2.947 & t_{0.01}(16)=2.921 \\
+\chi_{0.005}^2(8)=22.0 & \chi_{0.005}^2(9)=23.6 & \chi_{0.005}^2(15)=32.8 & \chi_{0.005}^2(16)=34.3 \\
+\chi_{0.995}^2(8)=1.34 & \chi_{0.995}^2(9)=1.73 & \chi_{0.995}^2(15)=4.60 & \chi_{0.995}^2(16)=5.14 \\
+\hline
+\end{tabularx}
+
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/jnuexam/examfe-a-blank.pdf b/Master/texmf-dist/doc/latex/jnuexam/examfe-a-blank.pdf
new file mode 100644
index 00000000000..4192ead99f0
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfe-a-blank.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/examfe-a-blank.tex b/Master/texmf-dist/doc/latex/jnuexam/examfe-a-blank.tex
new file mode 100644
index 00000000000..c017f4b5280
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfe-a-blank.tex
@@ -0,0 +1,6 @@
+% -*- coding: utf-8 -*-
+% !TEX program = xelatex
+
+% Typeset original exam, hiding answers
+\PassOptionsToClass{noanswer}{jnuexam}
+\input{examfe-a-answer}
diff --git a/Master/texmf-dist/doc/latex/jnuexam/examfe-b-answer.pdf b/Master/texmf-dist/doc/latex/jnuexam/examfe-b-answer.pdf
new file mode 100644
index 00000000000..bf5e9342eef
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfe-b-answer.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/examfe-b-answer.tex b/Master/texmf-dist/doc/latex/jnuexam/examfe-b-answer.tex
new file mode 100644
index 00000000000..b46878822f5
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfe-b-answer.tex
@@ -0,0 +1,6 @@
+% -*- coding: utf-8 -*-
+% !TEX program = xelatex
+
+% Generate version B from version A, shuffling questions
+\PassOptionsToClass{random}{jnuexam}
+\input{examfe-a-answer}
diff --git a/Master/texmf-dist/doc/latex/jnuexam/examfe-b-blank.pdf b/Master/texmf-dist/doc/latex/jnuexam/examfe-b-blank.pdf
new file mode 100644
index 00000000000..c37242241f3
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfe-b-blank.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/examfe-b-blank.tex b/Master/texmf-dist/doc/latex/jnuexam/examfe-b-blank.tex
new file mode 100644
index 00000000000..b09d13c45c0
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/jnuexam/examfe-b-blank.tex
@@ -0,0 +1,6 @@
+% -*- coding: utf-8 -*-
+% !TEX program = xelatex
+
+% Typeset original exam, hiding answers
+\PassOptionsToClass{noanswer}{jnuexam}
+\input{examfe-b-answer}
diff --git a/Master/texmf-dist/doc/latex/jnuexam/jnuexam.pdf b/Master/texmf-dist/doc/latex/jnuexam/jnuexam.pdf
index c5281ee42b2..0cc01cc3f1b 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/jnuexam.pdf
+++ b/Master/texmf-dist/doc/latex/jnuexam/jnuexam.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/jnuexam.tex b/Master/texmf-dist/doc/latex/jnuexam/jnuexam.tex
index 891c0663eeb..e19f1416b60 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/jnuexam.tex
+++ b/Master/texmf-dist/doc/latex/jnuexam/jnuexam.tex
@@ -106,12 +106,13 @@
\frametitle{试卷结构}
下面是 \verb!jnuexam! 试卷文档的基本结构:
\begin{code}
-\documentclass{jnuexam}
+\documentclass[chinese]{jnuexam}
% 导言区
\begin{document}
% 正文区
\end{document}
\end{code}
+试卷包含中文和英文两种模板,必须在文档开头指明。\par
导言区用于设定装订线和草稿纸等等选项。\par
正文区用于填写试卷表头和输入试卷内容。
\end{framex}
@@ -120,7 +121,7 @@
\frametitle{装订草稿}
在文档的导言区可以设定装订线和草稿纸。比如:
\begin{code}
-\setexam{
+\SetExamOption{
binding = 2, % 装订线
scratch = 1, % 草稿纸
}
@@ -137,17 +138,17 @@
\documentclass{jnuexam}
\begin{document}
......
-\makehead %生成试卷表头
+\examtitle{...} %生成试卷表头,见下页
......
-\makepart{填空题}{题数分值}
+\exampart{填空题}[题数分值]
......
-\makepart{单选题}{题数分值}
+\exampart{单选题}[题数分值]
......
-\makepart{计算题}{题数分值}
+\exampart{计算题}[题数分值]
......
-\makepart{证明题}{题数分值}
+\exampart{证明题}[题数分值]
......
-\makedata{可能用到的数据} %附录数据
+\examdata{可能用到的数据} %附录数据
......
\end{document}
\end{code}
@@ -156,34 +157,48 @@
\begin{framex}
\frametitle{试卷表头}
\begin{code}
-\renewcommand{\niandu}{2010--2011}
-\renewcommand{\xueqi}{2}
-\renewcommand{\kecheng}{大学数学}
-\renewcommand{\zhuanye}{理工4学分}
-\renewcommand{\jiaoshi}{某某某}
-\renewcommand{\shijian}{2011年07月08日}
-\renewcommand{\bixiu}{1} % 1为必修,0为选修
-\renewcommand{\bijuan}{1} % 1为闭卷,0为开卷
-\renewcommand{\shijuan}{A} % A/B/C卷
-\renewcommand{\neizhao}{1} % 1打勾,0不勾
-\renewcommand{\waizhao}{0} % 1打勾,0不勾
-\makehead %生成试卷表头
+\examtitle{
+ niandu = 2017--2018,
+ xueqi = 2,
+ kecheng = 大学数学,
+ zhuanye = 理工四学分, % 可以为空白
+ jiaoshi = {张三,李四}, % 教师姓名
+ shijian = 2018年6月28日,
+ bixiu = 1, % 1 为必修,0 为选修
+ bijuan = 1, % 1 为闭卷,0 为开卷
+ shijuan = A, % A 或 B 或 C 卷
+ neizhao = 1, % 1 打勾,0 不勾
+ waizhao = 0, % 1 打勾,0 不勾
+}
+\end{code}
+其中 \verb!zhuanye! 和 \verb!shijian! 选项的内容可以为空。
+\end{framex}
+
+\begin{framex}
+\frametitle{评分表格}
+在 \verb!\examtitle! 后面,可以用 \verb!\gradetable! 命令生成空白的评分表格。比如:
+\begin{code}
+\gradetable[total=6,strut=2em]
\end{code}
-其中 \verb!\zhuanye! 和 \verb!\shijian! 命令的内容可以为空。
+其中 \verb!\gradetable! 命令的各个参数含义如下:
+\begin{description}
+ \item[total] 表示试卷总共有多少部分,默认是 \verb!6!。
+ \item[strut] 表示空白单元格的支架高度,默认是 \verb!2.5em!。
+\end{description}
\end{framex}
\begin{framex}
\frametitle{判断题目}
\begin{code}
-\makepart{判断题}{题数分值}
+\exampart{判断题}[题数分值]
-\begin{problem}
+\begin{question}
第一道判断题描述。\tickout{t}
-\end{problem}
+\end{question}
-\begin{problem}
+\begin{question}
第二道判断题描述。\tickout{f}
-\end{problem}
+\end{question}
\end{code}
其中 \verb!\tickout{t}! 和 \verb!\tickout{f}!
分别表示打勾(\textcolor{blue}{$\checkmark$})和打叉(\textcolor{blue}{\large$\times$})。
@@ -196,15 +211,15 @@
\begin{framex}
\frametitle{填空题目}
\begin{code}
-\makepart{填空题}{题数分值}
+\exampart{填空题}[题数分值]
-\begin{problem}
+\begin{question}
第一道填空题描述\fillout{答案}。
-\end{problem}
+\end{question}
-\begin{problem}
+\begin{question}
第二道填空题描述\fillout{答案}。
-\end{problem}
+\end{question}
\end{code}
\verb!\fillout! 命令将用下划线填满整行。另有个 \verb!\fillin! 命令,只留下最小宽度的下划线。
\par
@@ -214,15 +229,15 @@
\begin{framex}
\frametitle{选择题目}
\begin{code}
-\makepart{单选题}{题数分值}
+\exampart{单选题}[题数分值]
-\begin{problem}
+\begin{question}
第一道单选题描述\pickout{答案}。
-\end{problem}
+\end{question}
-\begin{problem}
+\begin{question}
第二道单选题描述\pickout{答案}。
-\end{problem}
+\end{question}
\end{code}
\verb!\pickout! 命令将把选择圆括号放在本行最右边。另外有个 \verb!\pickin! 命令,将选择圆括号放在当前位置。
\par
@@ -248,31 +263,32 @@
\frametitle{答题表格}
在填空题和选择题前面,还可以用 \verb!\answertable! 命令生成空白答题栏。比如:
\begin{code}
-\answertable[3em]{6}{3}
+\answertable[total=6,column=3,strut=3em]
\end{code}
-其中 \verb!\answertable! 命令的三个参数含义如下:
-\begin{itemize}
- \item 第一个可选参数表示空白单元格的高度,默认是 \verb!1em!。
- \item 第二个必选参数表示总共有多少个题目。
- \item 第三个必选参数表示每行排版几个题目。
-\end{itemize}
+其中 \verb!\answertable! 命令的各个参数含义如下:
+\begin{description}
+ \item[total] 表示总共有多少个题目。
+ \item[column] 表示每行排版几个题目。
+ \item[strut] 表示空白单元格的高度,默认是 \verb!1em!。
+ \item[notice] 表示答题表格前面提示文本的内容。
+\end{description}
\end{framex}
\begin{framex}
\frametitle{计算题目}
\begin{code}
-\makepart{计算题}{题数分值}
+\exampart{计算题}[题数分值]
-\begin{problem}
+\begin{question}
第一道计算题描述。
-\end{problem}
+\end{question}
\begin{solution}
第一道计算题答案。
\end{solution}
-\begin{problem}
+\begin{question}
第二道计算题描述。
-\end{problem}
+\end{question}
\begin{solution}
第二道计算题答案。
\end{solution}
@@ -282,18 +298,18 @@
\begin{framex}
\frametitle{证明题目}
\begin{code}
-\makepart{证明题}{题数分值}
+\exampart{证明题}[题数分值]
-\begin{problem}
+\begin{question}
第一道证明题描述。
-\end{problem}
+\end{question}
\begin{solution}
第一道证明题答案。
\end{solution}
-\begin{problem}
+\begin{question}
第二道证明题描述。
-\end{problem}
+\end{question}
\begin{solution}
第二道证明题答案。
\end{solution}
@@ -302,10 +318,10 @@
\begin{framex}
\frametitle{解答名称}
-通过重新定义 \verb!\solutionname! 命令,可以改变 \verb!solution! 环境的名称。
-比如下面例子将“解答”二字改为“证明”:
+通过重定义关键词的翻译,可以改变 \verb!solution! 环境的显示名称。
+比如下面例子将“解”改为“证”:
\begin{code}
-\renewcommand{\solutionname}{证明}
+\SetExamTranslation{solution-Solution = 证}
\end{code}
\end{framex}
@@ -360,15 +376,15 @@ $2+2=4$ \points{8}
\frametitle{其它题型}
除了上述四种题型之外,其它题型可以用下面方式编写:
\begin{code}
-\makepart{某题型}{题数分值}
+\exampart{某题型}[题数分值]
-\begin{problem}
+\begin{question}
第一题描述。\answer{第一题答案}
-\end{problem}
+\end{question}
-\begin{problem}
+\begin{question}
第二题描述。\answer{第二题答案}
-\end{problem}
+\end{question}
\end{code}
其中题目答案必须放在 \verb!\answer! 命令里面;这样才能在生成空白试卷时隐藏它。
\end{framex}
@@ -377,17 +393,17 @@ $2+2=4$ \points{8}
\frametitle{附录数据}
在试卷最后,可以用下面命令增加附录数据部分:
\begin{code}
-\makedata{可能用到的数据} %附录数据
+\examdata{可能用到的数据} %附录数据
......
\end{code}
-附录数据必须放在 \verb!\makedata! 命令后面;否则在从A卷生成B卷时会出问题。
+附录数据必须放在 \verb!\examdata! 命令后面;否则在从A卷生成B卷时会出问题。
\end{framex}
\section{模板选项}
\begin{framex}
\frametitle{空白试卷}
-假设 \verb!exam-a-answer.tex! 是含答案的试卷。新建一个包含以下内容的 \verb!exam-a-empty.tex! 文档,
+假设 \verb!exam-a-answer.tex! 是含答案的试卷。新建一个包含以下内容的 \verb!exam-a-blank.tex! 文档,
编译后将得到不含答案的空白试卷。
\begin{code}
\PassOptionsToClass{noanswer}{jnuexam}
@@ -431,26 +447,26 @@ $2+2=4$ \points{8}
\begin{framex}
\frametitle{双栏试卷}
-假设 \verb!exam-a-empty.tex! 是原来试卷的 TeX 文件。新建一个包含以下内容的文档,
+假设 \verb!exam-a-blank.tex! 是原来试卷的 TeX 文件。新建一个包含以下内容的文档,
编译后将得到的 A3 纸张的试卷。
\begin{code}
\PassOptionsToClass{a3paper}{jnuexam}
-\input{exam-a-empty}
+\input{exam-a-blank}
\end{code}
也就是说,给 \verb!jnuexam! 文档类加上 \verb!a3paper! 选项后,编译时将会按照 A3 纸张排版出双栏试卷。
\end{framex}
\begin{framex}
\frametitle{双栏试卷}
-假设 \verb!exam-a-empty.pdf! 是原来试卷的 PDF 文件。新建一个包含以下内容的文档,
+假设 \verb!exam-a-blank.pdf! 是原来试卷的 PDF 文件。新建一个包含以下内容的文档,
编译后将得到的 A3 纸张的试卷。
\begin{code}
\documentclass[a3input]{jnuexam}
\begin{document}
-\includepdf[pages=-,nup=2x1]{exam-a-empty}
+\includepdf[pages=-,nup=2x1]{exam-a-blank}
\end{document}
\end{code}
-%\includepdf[pages=-,nup=2x1,offset=0 0,delta=0 0]{exam-a-empty}
+%\includepdf[pages=-,nup=2x1,offset=0 0,delta=0 0]{exam-a-blank}
这种用法直接读入 A4 试卷的 PDF 文件,生成双栏的 A3 试卷,适合没有 TeX 文件时使用。
\end{framex}
diff --git a/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls b/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls
index 6fa3b722ca6..f5df9204692 100644
--- a/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls
+++ b/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls
@@ -6,7 +6,7 @@
% ----------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jnuexam}[2024/02/02 v2.1.1 An exam class for Jinan University]
+\ProvidesClass{jnuexam}[2024-02-18 v2024E An exam class for Jinan University]
%% 旧版本的 LaTeX 不能识别 2022-11-01 这种日期格式
%\@ifl@t@r\fmtversion{2022-11-01}{}{
@@ -17,1308 +17,546 @@
}{Please update your TeX distribution first.}
}
-\newif\ifplain \plainfalse % 是否添加装订线和草稿纸
-\newif\iftwoinone \twoinonefalse % 是否使用 A3 纸张
-\newif\ifoneside \onesidefalse % 是否单面印刷试卷
-\newif\ifresetnumber \resetnumbertrue % 是否对各题型小题分别编号
-\newif\ifrandom \randomfalse % 是否乱序出题
-\newif\ifanswer \answertrue % 是否显示答案
-\newif\ifamsfonts \amsfontsfalse % 切换数学字体
-\newif\ifsourcehan \sourcehanfalse % 切换思源字体
-\newif\ifsolidot \solidotfalse % 是否替换空心句号为实心句号
-\newif\ifcellspace \cellspacefalse % 增加表格列间距
-\newif\ifmedmath \medmathfalse % 切换公式尺寸
-
-\DeclareOption{plain}{\plaintrue}
-\DeclareOption{a3paper}{\twoinonetrue}
-\DeclareOption{a3input}{\twoinonetrue\plaintrue}
-\DeclareOption{oneside}{\onesidetrue}
-\DeclareOption{random}{\randomtrue}
-\DeclareOption{noanswer}{\answerfalse}
-\DeclareOption{amsfonts}{\amsfontstrue}
-\DeclareOption{sourcehan}{\sourcehantrue}
-\DeclareOption{solidot}{\solidottrue}
-\DeclareOption{medmath}{\cellspacetrue\medmathtrue}
-
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}} %其它选项
-
-\ProcessOptions %不可省略
-
-% 四号 小四号 五号 小五号
-% 14bp 12bp 10.5bp 9bp
-% 实际上,在旧版本 ctex 中只能用 cs4size 和 c5size 选项
-% 而新版本 ctex 中,可以利用 zihao 选项指定各种中文字号
-\PassOptionsToPackage{CJKnumber}{xeCJK}
-\LoadClass[cs4size,UTF8,noindent]{ctexart}
-
-% 在旧版本 xeCJK 中,必须用 CJKnumber 选项载入 CJKnumb 包,后面才载入会报错
-% 但在新版本 xeCJK 中 CJKnumber 选项已经被废弃,需要在后面自行载入它
-% 在 xeCJK 中已经禁止载入 CJK,但是在新版本 ctex 宏包中却失效了
-% 我们假装 CJK 已经载入,再载入 CJKnumb,避免出现 \CJKglue 重复定义的问题
-% 注意用 PDFLaTeX 编译时需要用到 CJK,所以只在未定义时才作修改
-\ifdefined\CJKglue
- \@namedef{ver@CJK.sty}{}
- %\@namedef{opt@CJK.sty}{}
-\fi
-\RequirePackage{CJKnumb}
-
-% 新版本 xeCJK 已经废弃并禁用 CJKfntef,改用 xeCJKfntef 取代,我们需要载入后者
-% 注意要保证能在较旧的 TeX 系统中编译,我们只能用 \ifXeTeX 而不能用 \ifxetex
-% 因为旧版本 iftex 宏包只有 \ifXeTeX 命令,而 ifxetex 宏包才有 \ifxetex 命令
-% 在 2019 年 10 月,LaTeX 开发团队接管了 iftex 宏包,新版本同时提供这两个命令
-\RequirePackage{CJKfntef}
-\RequirePackage{iftex}
-\ifXeTeX\@ifpackagelater{xeCJK}{2020/02/10}{\RequirePackage{xeCJKfntef}}{}\fi
-
-\iftwoinone
- \RequirePackage[a3paper,landscape,twocolumn,columnsep=60mm,left=30mm,right=30mm,top=25mm,bottom=25mm]{geometry}
-\else
- \RequirePackage[a4paper,left=30mm,right=30mm,top=25mm,bottom=25mm]{geometry}
-\fi
-
-\RequirePackage{amsmath}
-\RequirePackage{array}
-\RequirePackage{calc}
-\RequirePackage{comment}
-\RequirePackage[inline]{enumitem}
-\RequirePackage{environ}
-\RequirePackage{etoolbox}
-\RequirePackage{fancyhdr}
-\RequirePackage{zref-user,zref-lastpage}
-\RequirePackage{tabularx}
-\RequirePackage{xcolor}
-\RequirePackage{xkeyval}
-
-\ifplain
- \allowdisplaybreaks[4]
-\fi
-
-\ifamsfonts
- \RequirePackage{amssymb}
-\else
- \RequirePackage[utopia]{mathdesign} % charter, utopia
- \renewcommand\bfdefault{bx}
- \let\oldoiint\oiint\renewcommand{\oiint}{\oldoiint\nolimits}
- \DeclareTextCommandDefault{\nobreakspace}{\leavevmode\nobreak\ }
-\fi
-
-\newcolumntype{Y}{>{\centering\arraybackslash}X}
-\newcolumntype{n}[1]{>{\centering\arraybackslash}m{#1}}
-
-\setlength{\parindent}{0em}
-\setlength{\lineskiplimit}{4pt}
-\setlength{\lineskip}{4pt}
-
%% ---------------------------------------------------------------------------
-%% 装订线命令 \addbindingline
-%% 草稿纸命令 \addscratchpaper
-%% 这两个命令需要编译两次才能得到正确结果
+%% 开始忽略代码中的空白符号
%% ---------------------------------------------------------------------------
-\newcommand{\setexam}[1]{\setkeys{jnuexam@setup}{#1}}
+\RequirePackage{functional}
+\IgnoreSpacesOn
-\ifplain\else
- \RequirePackage{tikz}
- \RequirePackage{everypage}
-\fi
-
-\newcommand{\bindinglineleft}{
- \path (current page.north west) +(25mm,-25mm) coordinate (a1);
- \path (current page.south west) +(25mm,25mm) coordinate (a2);
- \draw[dashed] (a1) -- node[left=1mm,text width=1em,inner sep=0pt]{\1{线}\0\1{订}\0\1{装}} (a2);
-}
+\InputIfFileExists{jnuexam.cfg}{}{}
-\newcommand{\bindinglineright}{
- \path (current page.north east) +(-25mm,-25mm) coordinate (b1);
- \path (current page.south east) +(-25mm,25mm) coordinate (b2);
- \draw[dashed] (b1) -- node[right=1mm,text width=1em,inner sep=0pt]{\2{装}\0\2{订}\0\2{线}} (b2);
+\DeclareKeys[jnuexam]{
+ english .code = \PassOptionsToClass{language=english}{randexam}
+ ,chinese .code = \PassOptionsToClass{language=chinese}{randexam}
}
-\newcommand{\bindinglineone}{%
-\def\0{\\[70mm]}\def\1{\rotatebox{90}}\def\2{\rotatebox{-90}}%
-\begin{tikzpicture}[remember picture,overlay,very thick]
- \ifnumodd{\value{page}}{\bindinglineleft}{\bindinglineright}
-\end{tikzpicture}}
-
-\newcommand{\bindinglinetwo}{%
-\def\0{\\[70mm]}\def\1{\rotatebox{90}}\def\2{\rotatebox{-90}}%
-\begin{tikzpicture}[remember picture,overlay,very thick]
- \bindinglineleft\bindinglineright
-\end{tikzpicture}}
-
-\iftwoinone
- \let\bindingline=\bindinglinetwo
-\else
- \let\bindingline=\bindinglineone
-\fi
+\DeclareUnknownKeyHandler{\PassOptionsToClass{\CurrentOption}{randexam}}
+\ProcessKeyOptions
-\def\zhuangdingxian{1}
-\define@key{jnuexam@setup}{binding}[2]{\def\zhuangdingxian{#1}}
-
-\newcommand{\addbindingline}{%
- \ifcase\zhuangdingxian % 0
- \or % 1
- \ifbool{answer}{}{\bindingline}%
- \or % 2
- \bindingline
- \fi
-}
+\LoadClass[freealign,moremath]{randexam}
-\ifplain\else
- \AddEverypageHook{\addbindingline}
-\fi
-
-\newcommand{\scratchpaperone}{%
-\begin{tikzpicture}[remember picture,overlay,font=\sffamily\fontsize{120pt}{120pt}\selectfont]
- \node[text=lightgray!40,text width=120pt] at (current page.center) {草\\ 稿\\ 纸};
-\end{tikzpicture}}
-
-\newcommand{\scratchpapertwo}{%
-\begin{tikzpicture}[remember picture,overlay,font=\sffamily\fontsize{180pt}{180pt}\selectfont]
- \node[text=lightgray!40] at (current page.center) {草\quad 稿\quad 纸};
-\end{tikzpicture}}
-
-\def\caogaozhi{0}
-\define@key{jnuexam@setup}{scratch}[1]{\def\caogaozhi{#1}}
-
-\newcounter{my@empty@page} % 空白页数
-\newcounter{my@scratch@page} % 草稿页数
-\newcounter{my@extra@page} % 空白页数+草稿页数
+%% ---------------------------------------------------------------------------
+%% 试卷中英文字符串翻译
+%% ---------------------------------------------------------------------------
-% 添加空白页,使得草稿纸前页数在单面印刷时为偶数,双面印刷时为4的倍数
-% 添加草稿纸,页数在单面印刷时等于设置值的两倍,双面印刷时等于设置值的4倍
-\newcommand{\doscratchpaperone}{%
- \clearpage\pagestyle{empty}\let\addbindingline=\relax
- \ifnumgreater{\caogaozhi}{0}{%
- \ifbool{oneside}{%
- \ifnumodd{\value{page}}%
- {\setcounter{my@empty@page}{0}}%
- {\setcounter{my@empty@page}{1}}%
- \setcounter{my@scratch@page}{\caogaozhi*2}%
- }{%
- \setcounter{my@empty@page}{(\value{page}+2)/4*4+1-\value{page}}%
- \setcounter{my@scratch@page}{\caogaozhi*4}%
- }%
- \my@add@extra@page
- }{}%
+\DeclareExamTranslation{chinese}{
+ gradetable-Part = 题\quad 号
+ ,gradetable-Score = 得\quad 分
}
-% 注意在 twocolumn 文档中,\newpage 到下一栏,\clearpage 到下一页
-% 另外注意第一行的 \clearpage 等不能移动到 \my@add@extra@page 命令里
-% 因为 \clearpage 后本页已经结束,page 表示的是下一页的页码
-\newcommand{\doscratchpapertwo}{%
- \clearpage\pagestyle{empty}\let\addbindingline=\relax
- \ifnumgreater{\caogaozhi}{0}{%
- \ifbool{oneside}{%
- \setcounter{my@empty@page}{0}%
- \setcounter{my@scratch@page}{\caogaozhi}%
- }{%
- \setcounter{my@empty@page}{(\value{page}/2)-(\value{page}/2)/2*2}%
- \setcounter{my@scratch@page}{\caogaozhi*2}%
- }%
- \my@add@extra@page
- }{}%
-}
-
-\newcommand{\my@add@extra@page}{%
- \setcounter{my@extra@page}{\value{my@empty@page}+\value{my@scratch@page}}%
- \whileboolexpr{
- test{\ifnumgreater{\value{my@empty@page}}{0}}
- }{%
- \addtocounter{my@empty@page}{-1}%
- \leavevmode\clearpage
- }%
- \whileboolexpr{
- test{\ifnumgreater{\value{my@scratch@page}}{0}}
- }{%
- \addtocounter{my@scratch@page}{-1}%
- \leavevmode\scratchpaper\clearpage
- }%
- \addtocounter{page}{-\value{my@extra@page}}%
+\DeclareExamTranslation{english}{
+ gradetable-Part = Section~No.
+ ,gradetable-Total = Total~Score
+ ,exampart-Score = Score
+ ,exampart-Evaluator = Evaluator
+ ,exampart-Part = Section
}
-\iftwoinone
- \let\scratchpaper=\scratchpapertwo
- \let\doscratchpaper=\doscratchpapertwo
-\else
- \let\scratchpaper=\scratchpaperone
- \let\doscratchpaper=\doscratchpaperone
-\fi
-
-% 在旧版本 ctex 宏包中不能用 \AtEndDocument 添加含中文的内容,即不能用 \appto 而要用 \preto
-\newcommand{\addscratchpaper}{%
- \preto{\@enddocumenthook}{\doscratchpaper}%
+\IfExamLanguageEqT{chinese}{
+ \SetExamValue{answertable}{
+ notice = {答题须知:本题答案必须写在如下表格中,否则不给分.}
+ }
+ \renewcommand{\questionpointstext}[1]{(#1~\pointorpoints{#1})}
}
-\ifplain\else\ifanswer\else
- \addscratchpaper
-\fi\fi
-
-\iftwoinone
- \RequirePackage{pdfpages}
- % 新版本 pdfpages 将 \includepdf 放在文档开头时会有命令未定义的错误
- % 见 https://tex.stackexchange.com/questions/352007/ieeetran-and-pdfpages
- % 另外从 LaTeX release 2018 开始 \@ifundefined 不再将未定义命令定义为 \relax
- % 见 https://www.latex-project.org/news/latex2e-news/ltnews28.pdf
- \@ifundefined{@setmarks}{\let\@setmarks\relax}{}
-\fi
-
%% ---------------------------------------------------------------------------
-%% 试卷表头命令 \makehead
+%% 中文期末试卷表头定制
%% ---------------------------------------------------------------------------
-\newcommand{\niandu}{2016-2017}
-\newcommand{\xueqi}{2}
-\newcommand{\kecheng}{数学课程}
-\newcommand{\zhuanye}{} % 专业学分
-\newcommand{\jiaoshi}{吕荐瑞}
-\newcommand{\shijian}{} % 考试日期
-\newcommand{\bixiu}{1} % 1 为必修,0 为选修
-\newcommand{\bijuan}{1} % 1 为闭卷,0 为开卷
-\newcommand{\shijuan}{A} % A 或 B 或 C 卷
-\newcommand{\neizhao}{1} % 1 打勾,0 不勾
-\newcommand{\waizhao}{1} % 1 打勾,0 不勾
+\NewDocumentCommand\examcheckquad{mm}{\ifnumequal{#1}{#2}{\,$\checkmark$\,}{\quad}}
-\newcommand{\underspace}[1]{\kern0pt\underline{\hspace{#1}}\kern0pt\relax}
-\newcommand{\underbox}[2]{\kern0pt\underline{\makebox[#1]{#2}}\kern0pt\relax}
-\newcommand{\underparbox}[2]{\kern0pt\underline{\parbox[b]{#1}{#2}}\kern0pt\relax}
-
-\newcommand{\ischeck}[1]{\ifnum#1>0\,$\checkmark$\,\else\quad\fi}
-\newcommand{\isquad}[1]{\ifnum#1=0\,$\checkmark$\,\else\quad\fi}
-
-\newcommand\my@temp@a{A}
-\newcommand\my@temp@c{C}
-\newcommand\my@empty{}
+\SetExamValue{examtitle}{
+ niandu = 2016--2017, % 教学年度
+ xueqi = 2, % 第几学期
+ kecheng = 数学课程, % 课程名称
+ zhuanye = , % 专业学分
+ jiaoshi = {吕荐瑞}, % 教师姓名
+ shijian = , % 考试时间
+ bixiu = 1, % 1 为必修,0 为选修
+ bijuan = 1, % 1 为闭卷,0 为开卷
+ shijuan = A, % A 或 B 或 C 卷
+ neizhao = 1, % 1 打勾,0 不勾
+ waizhao = 1, % 1 打勾,0 不勾
+}
-\newcommand{\head@table@a}{%
+\newcommand{\jdxm@fc@examtitle@table@a}{
\begin{tabular}{l}
- \underbox{11\ccwd}{\niandu}学年度第\underbox{5.5\ccwd}{\xueqi}学期 \\
- 课程名称:\underbox{17.5\ccwd}{\kecheng\ifx\zhuanye\my@empty\else\kern0pt(\zhuanye)\fi} \\
- 授课教师:\underparbox{17.5\ccwd}{\centering\rule{0pt}{3ex}\jiaoshi} \\
- 考试时间:\underbox{17.5\ccwd}{\shijian} \\
+ \underbox{11\ccwd}{\UseExamValue{examtitle}{niandu}}学年度第
+ \underbox{5.5\ccwd}{\UseExamValue{examtitle}{xueqi}}学期 \\
+ 课程名称:\underbox{17.5\ccwd}{
+ \UseExamValue{examtitle}{kecheng}
+ \tlIfEmptyF{\expWhole{\UseExamValue{examtitle}{zhuanye}}}{
+ \kern0pt(\UseExamValue{examtitle}{zhuanye})
+ }
+ } \\
+ 授课教师:\underparbox{17.5\ccwd}{
+ \centering\rule{0pt}{3ex}\UseExamValue{examtitle}{jiaoshi}
+ } \\
+ 考试时间:\underbox{17.5\ccwd}{\UseExamValue{examtitle}{shijian}} \\
\end{tabular}
}
-\newcommand{\head@table@b}{%
- \renewcommand{\arraystretch}{1}%
+\newcommand{\jdxm@fc@examtitle@table@b}{
+ \renewcommand{\arraystretch}{1}
\begin{tabular}{l}
- \textbf{课程类别} \\ 必修~[\ischeck{\bixiu}]\quad 选修~[\isquad{\bixiu}] \\
+ \textbf{课程类别} \\
+ 必修~[\examcheckquad{1}{\UseExamValue{examtitle}{bixiu}}]\quad
+ 选修~[\examcheckquad{0}{\UseExamValue{examtitle}{bixiu}}] \\
\hline
- \textbf{考试方式} \\ 开卷~[\isquad{\bijuan}]\quad 闭卷~[\ischeck{\bijuan}] \\
+ \textbf{考试方式} \\
+ 开卷~[\examcheckquad{0}{\UseExamValue{examtitle}{bijuan}}]\quad
+ 闭卷~[\examcheckquad{1}{\UseExamValue{examtitle}{bijuan}}] \\
\hline
- \textbf{试卷类别}~(\,A, B, C\,)\\\relax [\,\shijuan\,]\hfill 共~\zpageref{LastPage}~页
+ \textbf{试卷类别}~(\,A, B, C\,)\\
+ \relax [\,\UseExamValue{examtitle}{shijuan}\,]\hfill 共~\zpageref{LastPage}~页
\end{tabular}
}
-\newcommand{\head@table@c}{%
+\newcommand{\jdxm@fc@examtitle@table@c}{
\begin{tabular}{l}
- \underspace{10\ccwd}学院\underspace{8\ccwd}专业\underspace{7.5\ccwd}班\kern0pt(\kern0pt{}级\kern0pt) \\[1em]
+ \underspace{10\ccwd}学院\underspace{8\ccwd}专业\underspace{7.5\ccwd}班
+ \kern0pt(\kern0pt{}级\kern0pt) \\[1em]
姓名\underspace{8\ccwd}学号\underspace{10\ccwd}\hfill
- \bfseries 内招~[\ischeck{\neizhao}]~~外招~[\ischeck{\waizhao}] %\\[0.8em]
+ \bfseries 内招~[\examcheckquad{1}{\UseExamValue{examtitle}{neizhao}}]~~
+ 外招~[\examcheckquad{1}{\UseExamValue{examtitle}{waizhao}}] %\\[0.8em]
\end{tabular}
}
-\newcommand{\makehead}{
- \thispagestyle{plain}
- \centerline{%
- \LARGE\bfseries\ifanswer\color{red!80!black}\fi
- 暨\quad 南\quad 大\quad 学\quad 考\quad 试\quad 试\quad 卷\ifanswer\quad 答\quad 案\fi
- }%
- \vspace{2em}%
- \ifrandom
- \ifx\shijuan\my@temp@a\renewcommand{\shijuan}{B}\fi
- \ifx\shijuan\my@temp@c\renewcommand{\shijuan}{D}\fi
- \fi
+\DeclareExamTemplate{examtitle}{final-chinese}{
+ \centerline{
+ \LARGE\bfseries\IfExamBoolT{answer}{\color{red!80!black}}
+ 暨\quad 南\quad 大\quad 学\quad 考\quad 试\quad 试\quad 卷
+ \IfExamBoolT{answer}{\quad 答\quad 案}
+ }
+ \vspace{2em}
+ \IfExamBoolT{random}{
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{shijuan}}}{A}{
+ \SetExamValue{examtitle}{shijuan=B}
+ }
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{shijuan}}}{C}{
+ \SetExamValue{examtitle}{shijuan=D}
+ }
+ }
\noindent
\begin{tabularx}{\linewidth}{|@{}X@{}|}
- \hline\renewcommand{\arraystretch}{1.5}%
+ \hline\renewcommand{\arraystretch}{1.5}
{\begin{tabularx}{\linewidth}{@{}>{\bfseries}l@{}|@{}X@{}|@{}l@{}}
- \begin{tabular}{l}教\\ 师\\ 填\\ 写\end{tabular} & \head@table@a & \head@table@b
+ \begin{tabular}{l}教\\ 师\\ 填\\ 写\end{tabular}
+ & \jdxm@fc@examtitle@table@a & \jdxm@fc@examtitle@table@b
\end{tabularx}}\\
- \hline\renewcommand{\arraystretch}{0.9}%
+ \hline\renewcommand{\arraystretch}{0.9}
{\begin{tabularx}{\linewidth}{@{}>{\bfseries}l@{}|@{}X@{}}
- \begin{tabular}{l}考\\ 生\\ 填\\ 写\end{tabular} & \head@table@c
+ \begin{tabular}{l}考\\ 生\\ 填\\ 写\end{tabular}
+ & \jdxm@fc@examtitle@table@c
\end{tabularx}}\\
\hline
\end{tabularx}
- \par\vspace{1em}
- \noindent\begin{tabularx}{\linewidth}{|*{8}{Y|}}
- \hline
- \textbf{题\quad 号} & 一 & 二 & 三 & 四 & 五 & 六 & 总分\\
- \hline
- \textbf{得\quad 分}\rule[-0.75em]{0pt}{2.5em} & & & & & & & \\
- \hline
- \textbf{评阅人}\rule[-0.75em]{0pt}{2.5em} & & & & & & & \\
- \hline
- \end{tabularx}
}
%% ---------------------------------------------------------------------------
-%% 页眉页脚设定
+%% 英文期末试卷表头定制
%% ---------------------------------------------------------------------------
-\newcommand{\my@columnbox}[1]{\makebox[\columnwidth]{#1}}
-\newcommand{\my@headleft}{\hspace{-0.3em}《\kecheng》\kern-0.3em 试卷\,\shijuan}
-\newcommand{\my@headright}{姓名\hspace{6em}学号\hspace{6em}}
-\newcommand{\my@headtext}{\my@headleft\hfill \my@headright}
-\newcommand{\my@foottext}{第~\thepage~页\quad 共~\zpageref{LastPage}~页}
-
-% fancy page style
-\fancyhf{} % 清空页眉页脚
-\iftwoinone
- \renewcommand{\headrulewidth}{0pt}%
- \lhead{\small\underline{\my@columnbox{\my@headtext}\strut}}
- \rhead{\small\underline{\my@columnbox{\my@headtext}\strut}}
- \lfoot{\small\my@columnbox{\my@foottext}}
- \rfoot{\small\my@columnbox{\stepcounter{page}\my@foottext}}
-\else
- \lhead{\small\my@headleft}
- \rhead{\small\my@headright}
- \cfoot{\small\my@foottext}
-\fi
-
-% plain page style
-\fancypagestyle{plain}{
- \renewcommand{\headrulewidth}{0pt}%
- \fancyhf{}
- \iftwoinone
- \rhead{\small\underline{\my@columnbox{\my@headtext\strut}}}
- \lfoot{\small\my@columnbox{\my@foottext}}
- \rfoot{\small\my@columnbox{\stepcounter{page}\my@foottext}}
- \else
- \cfoot{\small\my@foottext}
- \fi
-}
-
-\ifplain
- \pagestyle{plain}
-\else
- \pagestyle{fancy}
-\fi
-
-%% ---------------------------------------------------------------------------
-%% 乱序排列选项 random
-%% 随机种子选项 seed
-%% ---------------------------------------------------------------------------
-
-%% 随机数种子不能超过 2147483647 = "7FFFFFFF
-\def\my@random@seed{19061116}
-\define@key{jnuexam@setup}{seed}[19061116]{\def\my@random@seed{#1}}
-
-\ifrandom
- \RequirePackage{pgf}
- \RequirePackage{pgffor}
- \newcommand*\exam@set@seed{%
- %% 当\pgfmathrandom的参数为3的倍数时,对相邻种子生成的多个随机数分布不均匀
- %\pgfmathsetseed{\numexpr\my@random@seed+\value{section}-1\relax}%
- %% 因此我们改用下面的方法,用随机数种子生成下一个随机数种子
- \pgfmathsetseed{\my@random@seed}%
- \pgfmathrandominteger\my@random@seed{1}{2147483647}%
- }
-\fi
-
-%% ---------------------------------------------------------------------------
-%% 题型命令 \makepart
-%% 附录命令 \makedata
-%% 题目环境 problem
-%% 解答环境 solution
-%% ---------------------------------------------------------------------------
-
-\newif\ifonlyoneproblem \onlyoneproblemfalse % 此部分仅有一道题时不显示题目编号
-\xdef\allproblems{}
-\xdef\lastproblem{}
-\newcounter{problem} % 当前题型的小题编号
-\newcounter{problemreal} % 实际显示的小题编号,在各题型小题统一编号时使用
-\newcounter{totalproblems} % 之前各题型小题总数,在各题型小题统一编号时使用
-\newcommand{\solutionname}{解}
-\newcounter{choice} % 后面选择题的 abcd 环境要用到
-\newcommand{\hangtext}{}
-\newlength{\hanglength}
-\colorlet{part number}{black}
-\colorlet{problem number}{blue!80!black}
-\colorlet{solution name}{blue!80!black}
-
-\newcounter{my@shuffle@temp@cnt}
-\newcounter{my@list@temp@cnt}
-
-\newcommand\my@list@print[1]{%
- \par\renewcommand*{\do}[1]{(##1)}%
- \dolistloop#1%
-}
-
-\newcommand\my@list@remove[2]{%
- %\my@list@print\my@shuffle@list
- \setcounter{my@list@temp@cnt}{0}%
- \global\let\my@tmpa@list=#1%
- \gdef#1{}%
- \par\renewcommand*{\do}[1]{%
- \stepcounter{my@list@temp@cnt}%
- \ifnumequal{\value{my@list@temp@cnt}}{#2}{%
- \def\my@list@item{##1}%
- %[##1]%
- }{
- \listxadd#1{##1}%
- }%
- }%
- \dolistloop\my@tmpa@list
-}
-
-\newcommand\my@shuffle@problems{%
- \exam@set@seed
- \ifnumgreater{\value{problem}}{2}{%
- \gdef\my@shuffle@list{}%
- \foreach \i in {1,...,\value{problem}} {\listxadd\my@shuffle@list{\i}}%
- %% 首尾两个小题的位置总要改变
- \pgfmathrandom{2,\value{problem}}%
- \my@list@remove\my@shuffle@list{\pgfmathresult}%
- \global\csletcs{my@problem@b@1}{my@problem@a@\my@list@item}%
- \ifnumequal{\my@list@item}{\value{problem}}{
- \pgfmathrandom{\numexpr\value{problem}-1\relax}%
- \my@list@remove\my@shuffle@list{\pgfmathresult}%
- \global\csletcs{my@problem@b@\the\value{problem}}{my@problem@a@\my@list@item}%
- }{%
- \pgfmathrandom{\numexpr\value{problem}-2\relax}%
- \my@list@remove\my@shuffle@list{\pgfmathresult}%
- \global\csletcs{my@problem@b@\the\value{problem}}{my@problem@a@\my@list@item}%
- }%
- %% 其他小题的位置没有任何限制
- \setcounter{my@shuffle@temp@cnt}{1}%
- \whileboolexpr{%
- test{\ifnumless{\value{my@shuffle@temp@cnt}}{\numexpr\value{problem}-1\relax}}%
- }{%
- \stepcounter{my@shuffle@temp@cnt}%
- \pgfmathrandom{\numexpr\value{problem}-\value{my@shuffle@temp@cnt}\relax}%
- \my@list@remove\my@shuffle@list{\pgfmathresult}%
- \global\csletcs{my@problem@b@\the\value{my@shuffle@temp@cnt}}{%
- my@problem@a@\my@list@item
- }%
- }%
- }{%
- \ifnumequal{\value{problem}}{2}{%
- \global\csletcs{my@problem@b@1}{my@problem@a@2}%
- \global\csletcs{my@problem@b@2}{my@problem@a@1}%
- }{}%
- }%
-}
-
-\newcommand{\printproblems}{%
- \ifrandom
- \my@appto@problems
- \my@shuffle@problems
- \setcounter{problem}{0}%
- \allproblems
- \fi
- \xdef\allproblems{}%
- \xdef\lastproblem{}%
-}
-
-\newcommand{\makepart}[2]{%
- \printproblems
- \setcounter{totalproblems}{\value{totalproblems}+\value{problem}}%
- \setcounter{problem}{0}%
- \stepcounter{section}%
- \vspace{1em}%
- \noindent\textbf{\textcolor{part number}{\Chinese{section}}、#1}(#2)%
- \par\nopagebreak
- \if\relax\detokenize{#1}\relax % #1 is empty
- \onlyoneproblemtrue
- \else
- \onlyoneproblemfalse
- \vspace{1em}%
- \fi
- %其中设定了\@nobreaktrue,保证在列表前也不分页,详情见 source2e
- \@afterheading
+\SetExamValue{examtitle}{
+ AcademicYear = 2016--2017, % 教学年度
+ Semester = 2, % 第几学期
+ CourseTitle = Math 1906, % 课程名称
+ MajorCredit = , % 专业学分,可以省略
+ Instructor = {Jianrui Lyu}, % 教师姓名
+ Date = , % 考试时间
+ Compulsory = 1, % 是否必修:1 为必修,0 为选修
+ ClosedBook = 1, % 是否闭卷:1 为闭卷,0 为开卷
+ Paper = A, % 试卷版本:A 或 B 或 C 卷
+ Mainland = 1, % 内招适用:1 打勾,0 不勾
+ NonMainland = 1, % 外招适用:1 打勾,0 不勾
+}
+
+\newcommand{\jdxm@fe@examtitle@table@a}{
+ \begin{tabular}{l}
+ \textbf{Academic~Year}:\underbox{5.5em}{\UseExamValue{examtitle}{AcademicYear}}
+ \enspace
+ \textbf{Semester}:~
+ 1\textsuperscript{st}~[\examcheckquad{\UseExamValue{examtitle}{Semester}}{1}]
+ \enspace
+ 2\textsuperscript{nd}~[\examcheckquad{\UseExamValue{examtitle}{Semester}}{2}]\\
+ \textbf{Course~Title}:\underbox{18.7em}{
+ \UseExamValue{examtitle}{CourseTitle}
+ \tlIfEmptyF{\expWhole{\UseExamValue{examtitle}{MajorCredit}}}{
+ \kern0pt(\UseExamValue{examtitle}{MajorCredit})
+ }
+ } \\
+ \textbf{Instructor's~Name}:\underparbox{16em}{
+ \centering\rule{0pt}{3ex}\UseExamValue{examtitle}{Instructor}
+ } \\
+ \textbf{Date~of~the~Examination}:\underbox{13em}{\UseExamValue{examtitle}{Date}} \\
+ \end{tabular}
}
-\newcommand{\makedata}[1]{%
- \printproblems\my@stop@random
- \centerline{\textbf{附录}\quad #1}\smallskip
+\newcommand{\jdxm@fe@examtitle@table@b}{
+ \fontsize{9pt}{11pt}\selectfont
+ \renewcommand{\arraystretch}{1.2}
+ \begin{tabular}{l}
+ \textbf{Course~Type} \\
+ Compulsory~[\examcheckquad{1}{\UseExamValue{examtitle}{Compulsory}}]\enspace
+ Elective~[\examcheckquad{0}{\UseExamValue{examtitle}{Compulsory}}] \\
+ \hline
+ \textbf{Form~of~the~Examination} \\
+ Open-book~[\examcheckquad{0}{\UseExamValue{examtitle}{ClosedBook}}]\enspace
+ Closed-book~[\examcheckquad{1}{\UseExamValue{examtitle}{ClosedBook}}] \\
+ \hline
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{Paper}}}{A}{
+ \textbf{Paper}~A~[\,$\checkmark$\,]\enspace
+ \textbf{Paper}~B~[\quad]
+ }
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{Paper}}}{B}{
+ \textbf{Paper}~A~[\quad]\enspace
+ \textbf{Paper}~B~[\,$\checkmark$\,]
+ }
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{Paper}}}{C}{
+ \textbf{Paper}~C~[\,$\checkmark$\,]\enspace
+ \textbf{Paper}~D~[\quad]
+ }
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{Paper}}}{D}{
+ \textbf{Paper}~C~[\quad]\enspace
+ \textbf{Paper}~D~[\,$\checkmark$\,]
+ }
+ \\
+ Total~Pages~\underbox{4em}{\zpageref{LastPage}}
+ \end{tabular}
}
-\preto{\@enddocumenthook}{\printproblems\my@stop@random}
-
-\newcommand\ignorepars{\@ifnextchar\par{\expandafter\ignorepars\@gobble}{}}
-
-% 局部定义,仅在当前题目内有效
-\define@key{jnuexam@problem}{points}[-1]{\def\my@problem@points{#1}}
-\define@key{jnuexam@problem}{level}[]{\def\my@problem@level{#1}}
-\define@key{jnuexam@problem}{year}[]{\def\my@problem@year{#1}}
-
-\newcommand{\problempointstext}[1]{(#1 分)}
-
-\newcommand\my@hook@exec@other@keys{}
-
-\newcommand{\execute@problem@keys}[1]{%
- \setkeys{jnuexam@problem}{#1}%
- \my@hook@exec@other@keys
- \ifdefvoid{\my@problem@points}{}{\problempointstext{\my@problem@points}}%
+\newcommand{\jdxm@fe@examtitle@table@c}{
+ \begin{tabular}{l}
+ \textbf{School/College}\underspace{11em}~\textbf{Major}\underspace{18.3em}\\
+ \textbf{Name}\underspace{15.4em}~\textbf{Student~No.}\underspace{15.6em}\\
+ \textbf{Mainland~Student}~[\examcheckquad{1}{\UseExamValue{examtitle}{Mainland}}]\hspace{4em}
+ \textbf{Non-mainland~Student}~[\examcheckquad{1}{\UseExamValue{examtitle}{NonMainland}}]
+ \end{tabular}
}
-\newenvironment{problemreal}[1][]{%
- \stepcounter{problem}\setcounter{choice}{0}%
- \ifresetnumber
- \ifonlyoneproblem
- \renewcommand{\hangtext}{\qquad}%
- \else
- \renewcommand{\hangtext}{\textbf{\textsf{\textcolor{problem number}{\arabic{problem}}.}}\;\,}%
- \fi
- \else
- \setcounter{problemreal}{\value{totalproblems}+\value{problem}}%
- \renewcommand{\hangtext}{\textbf{\textsf{\textcolor{problem number}{\arabic{problemreal}}.}}\;\,}%
- \fi
- \settowidth{\hanglength}{\hangtext}%
- \description[leftmargin=\hanglength,labelwidth=0pt,labelsep=0pt,topsep=0pt,parsep=0pt]
- \item[\hangtext]\execute@problem@keys{#1}%
-}{\enddescription}
-\newenvironment{solutionreal}{%
- \renewcommand{\hangtext}{\textbf{\textsf{\textcolor{solution name}{\solutionname}.}}\;\,}%
- \settowidth{\hanglength}{\hangtext}%
- \description[leftmargin=\hanglength,labelwidth=0pt,labelsep=0pt,topsep=0pt,parsep=0pt]
- \item[\hangtext]
-}{\enddescription}
-
-\let \oldnewpage = \newpage
-\let \oldvfill = \vfill
-\let \oldsmallskip = \smallskip
-\let \oldmedskip = \medskip
-\let \oldbigskip = \bigskip
-
-\ifrandom
- \newcommand\my@appto@problems{%
- \xappto\allproblems{\expandonce\lastproblem}%
- }%
- \NewEnviron{problem}{%
- \stepcounter{problem}%
- \my@appto@problems
- \csxdef{my@problem@a@\the\value{problem}}{%
- \unexpanded{\begin{problemreal}}%
- \unexpanded\expandafter{\BODY}%
- \unexpanded{\end{problemreal}}%
- }%
- \csxdef{my@problem@b@\the\value{problem}}{%
- \expandonce{\csname my@problem@a@\the\value{problem}\endcsname}%
- }%
- \xdef\lastproblem{%
- \expandonce{\csname my@problem@b@\the\value{problem}\endcsname}%
- }%
+\DeclareExamTemplate{examtitle}{final-english}{
+ \centerline{
+ \Large\bfseries\IfExamBoolT{answer}{\color{red!80!black}}
+ The~Examination~Paper~of~Jinan~University
+ \IfExamBoolT{answer}{~(Solutions)}
}
- \NewEnviron{solution}{%
- \csxappto{my@problem@a@\the\value{problem}}{%
- \unexpanded{\begin{solutionreal}}%
- \expandonce{\BODY}%
- \unexpanded{\end{solutionreal}}%
- }%
+ \vspace{2em}
+ \IfExamBoolT{random}{
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{Paper}}}{A}{
+ \SetExamValue{examtitle}{Paper=B}
+ }
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{Paper}}}{C}{
+ \SetExamValue{examtitle}{Paper=D}
+ }
}
- \renewcommand{\newpage}{\gappto\lastproblem{\oldnewpage}}
- \renewcommand{\vfill}{\csgappto{my@problem@a@\the\value{problem}}{\oldvfill}}
- \renewcommand{\smallskip}{\csgappto{my@problem@a@\the\value{problem}}{\oldsmallskip}}
- \renewcommand{\medskip}{\csgappto{my@problem@a@\the\value{problem}}{\oldmedskip}}
- \renewcommand{\bigskip}{\csgappto{my@problem@a@\the\value{problem}}{\oldbigskip}}
-\else
- \newenvironment{problem}[1][]{\problemreal[#1]}{\endproblemreal}
- %\newenvironment{solution}{\solutionreal}{\endsolutionreal}
- \NewEnviron{solution}{\begin{solutionreal}\BODY\end{solutionreal}}
-\fi
-
-\newcommand{\my@stop@random}{%
- \ifrandom
- \renewenvironment{problem}{\problemreal}{\endproblemreal}%
- \renewenvironment{solution}{\solutionreal}{\endsolutionreal}%
- \let \newpage = \oldnewpage
- \let \vfill = \oldvfill
- \let \smallskip = \oldsmallskip
- \let \medskip = \oldmedskip
- \let \bigskip = \oldbigskip
- \fi
-}
-
-\def\CommentCutFile{\jobname.cut}
-
-\AtBeginDocument{%
- \ifanswer\else
- \excludecomment{solution}
- \fi
-}
-
-%% ---------------------------------------------------------------------------
-%% 答题栏命令 \answertable
-%% ---------------------------------------------------------------------------
-
-\gdef\answer@lines@temp{}%
-\newcommand{\answer@lines@add}[1]{%
- \xdef\answer@lines@temp{\answer@lines@temp#1}%
-}
-
-\newrobustcmd{\answer@number@hided}[1]{小题} % 在 PDFLaTeX 中需要保护中文
-\newrobustcmd{\answer@cell@strut}[1]{\parbox[c][#1][c]{2em}{\hbox{答案}}}
-
-\newcounter{answer@col}
-\newcounter{answer@row}
-\newcounter{answer@total}
-
-\newcommand{\answer@lines}[3]{%
- % #1 答题栏各栏指定高度
- % #2 答题栏总共答案个数
- % #3 答题栏每行答案个数
- \setcounter{answer@row}{(#2-1)/#3+1}% 除法向下取整,改为向上取整
\begingroup
- \let\hline=\relax \let\\=\relax % 禁止展开
- \gdef\answer@lines@temp{}%
- \setcounter{answer@total}{1}%
- \whileboolexpr{
- test{\ifnumgreater{\value{answer@row}}{0}}
- }{%
- \addtocounter{answer@row}{-1}%
- \answer@lines@add{\answer@number@hided}%
- \setcounter{answer@col}{1}%
- \unlessboolexpr{%
- test{\ifnumgreater{\value{answer@col}}{#3}}%
- }{%
- \answer@lines@add{&}%
- \ifnumgreater{\value{answer@total}}{#2}{}{%
- \answer@lines@add{\arabic{answer@total}}%
- }%
- \stepcounter{answer@col}%
- \stepcounter{answer@total}%
- }%
- \answer@lines@add{\\ \hline \answer@cell@strut{#1}}%
- \setcounter{answer@col}{1}%
- \unlessboolexpr{
- test{\ifnumgreater{\value{answer@col}}{#3}}
- }{%
- \answer@lines@add{&}%
- \stepcounter{answer@col}%
- }%
- \answer@lines@add{\\ \hline}%
- }%
- \endgroup
- \answer@lines@temp
-}
-
-\newcommand{\answertable}[3][1em]{%
- 答题须知:本题答案必须写在如下表格中,否则不给分.\par
- \begin{tabularx}{\linewidth}{|c|*{#3}{Y|}}
+ \setlength\tabcolsep{4pt}
+ \fontsize{10pt}{12pt}\selectfont
+ \noindent
+ \begin{tabularx}{\linewidth}{|@{}X@{}|}
+ \hline\renewcommand{\arraystretch}{1.5}
+ {\begin{tabularx}{\linewidth}{@{}>{\bfseries}wc{5em}@{}|@{}X@{}|@{}l@{}}
+ \fontsize{9pt}{11pt}\selectfont\begin{tabular}{c}For\\Instructor\\Only\end{tabular}
+ & \jdxm@fe@examtitle@table@a & \jdxm@fe@examtitle@table@b
+ \end{tabularx}}\\
+ \hline\renewcommand{\arraystretch}{1.5}
+ {\begin{tabularx}{\linewidth}{@{}>{\bfseries}wc{5em}@{}|@{}X@{}}
+ \fontsize{9pt}{11pt}\selectfont\begin{tabular}{c}For\\Student\\Only\end{tabular}
+ & \jdxm@fe@examtitle@table@c
+ \end{tabularx}}\\
\hline
- \answer@lines{#1}{#2}{#3}
- \end{tabularx}%
- \par\vspace{0.8em}%
+ \end{tabularx}
+ \endgroup
}
%% ---------------------------------------------------------------------------
-%% 答案切换命令 \answer
-%% 判断命令 \tickin 和 \tickout
-%% 填空命令 \fillin 和 \fillout
-%% 选择命令 \pickin 和 \pickout
+%% 中英文期末试卷题型命令定制
%% ---------------------------------------------------------------------------
-\newcommand{\answer}[1]{\ifanswer#1\else\phantom{#1}\fi}
-
-\newcommand*{\cdotfill}{\leavevmode\xleaders\hbox to 0.5em{\hss$\cdot$\hss}\hfill\kern0pt\relax}
-
-\newcommand*{\tick@box}[1]{[\makebox[1.5em]{\color{blue}\answer{#1}}]}
-\newcommand*{\tick@text@t}{$\checkmark$}
-\newcommand*{\tick@text@f}{{\large$\times$}}
-\newcommand*{\tick@text@T}{\sffamily T}
-\newcommand*{\tick@text@F}{\sffamily F}
-\newcommand*{\tickin}[1]{\tick@box{\csname tick@text@#1\endcsname}}
-\newcommand*{\tickout}[1]{\unskip\nobreak\cdotfill\tick@box{\csname tick@text@#1\endcsname}}
-
-\newcommand*{\ulinefill}[1]{\xleaders\hbox{\underline{\vphantom{#1}\kern1pt}}\hfill\kern0pt}
-\newcommand*{\minwidthbox}[2]{\makebox[{\ifdim#1<\width\width\else#1\fi}]{#2}}
-
-\newcommand*{\fillout}[1]{\allowbreak\hbox{}\nobreak\ulinefill{#1}\underline{\color{blue}\answer{#1}}\ulinefill{#1}}
-\newcommand*{\fillin}[1]{\underline{\hspace{1em}\color{blue}\minwidthbox{2em}{\answer{#1}}\hspace{1em}}}
-
-\newcommand*\pickoutreal[1]{%
- \unskip\nobreak\cdotfill(\makebox[1.5em]{\color{blue}\answer{#1}})%
-}
-\newcommand*\pickinreal[1]{%
- \unskip\nobreak
- \hspace{0.3em}(\makebox[1.5em]{\color{blue}\answer{#1}})\hspace{0.3em}%
- \ignorespaces
+\DeclareExamTemplate{exampart}{final-chinese}{
+ \noindent
+ \textbf{
+ \textcolor{part~number}{\TheExamCounter{exampart}}、\UseExamValue{exampart}{type}
+ }
+ \IfExamValueEmptyF{exampart}{points}{
+ (\UseExamValue{exampart}{points})
+ }
}
-%% 选择题四个选项打乱顺序,用三种方法即可保证答案不同
-%% 1:ABCD -> CDAB; 2:ABCD -> BADC; 3: ABCD -> DCBA
-%% 即在两行排列时仅用到上下交换以及左右交换,这样可以保持两行长度不变
-
-\csdef{my@shuffle@1@A}{C} \csdef{my@shuffle@2@A}{B} \csdef{my@shuffle@3@A}{D}
-\csdef{my@shuffle@1@B}{D} \csdef{my@shuffle@2@B}{A} \csdef{my@shuffle@3@B}{C}
-\csdef{my@shuffle@1@C}{A} \csdef{my@shuffle@2@C}{D} \csdef{my@shuffle@3@C}{B}
-\csdef{my@shuffle@1@D}{B} \csdef{my@shuffle@2@D}{C} \csdef{my@shuffle@3@D}{A}
-
-\def\@my@choice@random{0}
-\newcommand\my@shuffle@abcd[1]{\csuse{my@shuffle@\@my@choice@random @#1}}
-
-\newcommand*\pickout[1]{%
- \ifbool{random}{%
- \exam@set@seed
- \pgfmathrandominteger\@my@choice@random{1}{3}%
- %\@my@choice@random
- \pickoutreal{\my@shuffle@abcd{#1}}%
- }{%
- \pickoutreal{#1}%
- }%
-}
-\newcommand*\pickoutfixed[1]{%
- \pickoutreal{#1}%
- \randomfalse
-}
-\newcommand*\pickin[1]{%
- \ifbool{random}{%
- \exam@set@seed
- \pgfmathrandominteger\@my@choice@random{1}{3}%
- %\@my@choice@random
- \pickinreal{\my@shuffle@abcd{#1}}%
- }{%
- \pickinreal{#1}%
- }%
-}
-\newcommand*\pickinfixed[1]{%
- \pickinreal{#1}%
- \randomfalse
+\DeclareExamTemplate{exampart}{final-english}{
+ \noindent
+ \begin{tblr}{width=\linewidth,colspec={llX},hlines,vlines,cell{1}{3}={r=2}{}}
+ \UseExamTranslation{exampart-Score} & \UseExamTranslation{exampart-Evaluator} &
+ \textbf{
+ \textcolor{part~number}{
+ \UseExamTranslation{exampart-Part}~\TheExamCounter{exampart}
+ }:~\UseExamValue{exampart}{type}
+ }~
+ \IfExamValueEmptyF{exampart}{points}{
+ (\UseExamValue{exampart}{points})
+ } \\
+ & &
+ \end{tblr}
}
%% ---------------------------------------------------------------------------
-%% 选择题四个选项排版环境,根据四个选项的长度自动排成一行、两行或四行
-%% 其中 abcd 环境各列平分整行宽度,而 abcd* 环境各列平分剩余空白
+%% 中英文期末试卷页眉页脚设定
%% ---------------------------------------------------------------------------
-\newlength{\my@item@len}
-\newlength{\my@label@len}
-
-\newcommand\my@item@temp{%
- \unskip\cr\stepcounter{choice}(\Alph{choice})\ %
-}
-\newcommand\my@item@box{%
- \hfill\egroup\hfill\hbox to \my@item@len\bgroup
- \stepcounter{choice}(\Alph{choice})\ \ignorespaces
-}
-\newcommand\my@item@par{%
- \stepcounter{choice}%
- \def\my@label@text{(\Alph{choice})\ }%
- \settowidth{\my@label@len}{\my@label@text}%
- \par \parshape 2 \hanglength \linewidth
- \dimexpr\hanglength + \my@label@len\relax
- \dimexpr\linewidth - \my@label@len\relax
- \my@label@text\ignorespaces
-}
-
-\NewEnviron{abcdreal}{
- \unskip
- \setlength{\parindent}{0pt}%
- \setlength{\parskip}{0pt}%
- \setcounter{choice}{0}%
- \let\item=\my@item@temp
- \settowidth{\my@item@len}{\vbox{\halign{##\hfil\cr\BODY\crcr}}}%
- \setcounter{choice}{0}%
- \ifdim\my@item@len>0.486\linewidth
- \setlength{\my@item@len}{\linewidth}%
- \let\item=\my@item@par
- \BODY\par
- \else
- \ifdim\my@item@len>.243\linewidth
- \setlength{\my@item@len}{0.5\linewidth}%
- \else
- \setlength{\my@item@len}{0.25\linewidth}%
- \fi
- \let\item=\my@item@box
- \par\bgroup\BODY\hfill\egroup\par
- \fi
-}
-
-\newcommand\my@item@one@line{%
- \unskip
- \ifnumequal{\value{choice}}{0}{}{\hfill}
- \stepcounter{choice}(\Alph{choice})\ %
-}
-\newcommand\my@item@two@line{%
- \unskip
- \ifnumodd{\value{choice}}{&}{\unskip\cr}%
- \stepcounter{choice}(\Alph{choice})\ %
-}
-
-\NewEnviron{abcd*real}{
- \unskip
- \setlength{\parindent}{0pt}%
- \setlength{\parskip}{0pt}%
- \setcounter{choice}{0}%
- \let\item=\my@item@one@line
- \settowidth{\my@item@len}{\BODY}%
- \ifdim\my@item@len<0.95\linewidth
- \setcounter{choice}{0}%
- \par\bgroup\BODY\hfill\hfill\par\egroup\par
- \else
- \setcounter{choice}{0}%
- \let\item=\my@item@two@line
- \settowidth{\my@item@len}{\vbox{\halign{##&##\hfil\cr\BODY\crcr}}}%
- \ifdim\my@item@len<0.975\linewidth
- \setcounter{choice}{0}%
- \par\bgroup\nointerlineskip
- \vbox{\halign to\linewidth{##\hfil\tabskip=0pt plus 1fil&##\hfil\cr\BODY\crcr}}%
- \egroup\par
- \else
- \setcounter{choice}{0}%
- \let\item=\my@item@par
- \par\bgroup\BODY\hfill\egroup\par
- \fi
- \fi
-}
-
-\ifbool{random}{%
- \csdef{my@swap@items@1}#1#2#3#4{\item#3\item#4\item#1\item#2}
- \csdef{my@swap@items@2}#1#2#3#4{\item#2\item#1\item#4\item#3}
- \csdef{my@swap@items@3}#1#2#3#4{\item#4\item#3\item#2\item#1}
- \long\def\my@swap@items#1\item#2\item#3\item#4\item#5\@my@stop@mark{%
- #1\csuse{my@swap@items@\@my@choice@random}{#2}{#3}{#4}{#5}%
+\IfExamLanguageEqTF{english}{
+ \DeclareExamTemplate{headleft}{fancy}{
+ \parbox{\columnwidth}{
+ \fontsize{10pt}{15pt}\selectfont
+ The~Examination~Paper~for~\ExamFillUlineText{\UseExamValue{examtitle}{CourseTitle}}~of~JNU\\
+ \strut Student~Name\hfill,~Student~No.\hfill\strut
+ }
}
-}{}
-
-\NewDocumentEnvironment{abcd}{+b}{%
- \ifbool{random}{%
- \begin{abcdreal}\my@swap@items#1\@my@stop@mark\end{abcdreal}%
- }{%
- \begin{abcdreal}#1\end{abcdreal}%
- }%
-}{}
-\NewDocumentEnvironment{abcd*}{+b}{%
- \ifbool{random}{%
- \begin{abcd*real}\my@swap@items#1\@my@stop@mark\end{abcd*real}%
- }{%
- \begin{abcd*real}#1\end{abcd*real}%
- }%
-}{}
-
-%% ---------------------------------------------------------------------------
-%% 设定有序列表使用悬挂缩进,并指定前两级有序列表的标签格式
-%% 标签宽度按最宽者自动设定,左边距自动计算,竖直空白全部去掉
-%% 最后的 itemjoin 设定行内有序列表 enumerate* 两项之间的空白
-%% ---------------------------------------------------------------------------
-
-\setlist[enumerate]{labelindent=0pt,labelsep=0.2em,itemindent=0pt,leftmargin=*,nosep,itemjoin=\quad}
-\setlist[enumerate,1]{label=(\arabic*)}
-\setlist[enumerate,2]{label=(\alph*),widest*=1}
+ \DeclareExamTemplate{headcenter}{fancy}{}
+ \DeclareExamTemplate{headright}{fancy}{}
+ \DeclareExamTemplate{footleft}{fancy}{}
+ \DeclareExamTemplate{footcenter}{fancy}{\thepage}
+ \DeclareExamTemplate{footright}{fancy}{}
+}{
+ \DeclareExamTemplate{headleft}{fancy}{
+ \hspace{-0.3em}《\UseExamValue{examtitle}{kecheng}》
+ \kern-0.3em 试卷\,\UseExamValue{examtitle}{shijuan}
+ }
+ \DeclareExamTemplate{headcenter}{fancy}{}
+ \DeclareExamTemplate{headright}{fancy}{
+ 姓名\hspace{6em}学号\hspace{6em}
+ }
+ \DeclareExamTemplate{footleft}{fancy}{}
+ \DeclareExamTemplate{footcenter}{fancy}{
+ 第~\thepage~页\quad 共~\zpageref{LastPage}~页
+ }
+ \DeclareExamTemplate{footright}{fancy}{}
+}
%% ---------------------------------------------------------------------------
-%% 自由对齐命令 \tabpoint, \tabto, \tableft
-%% 命令 \tabpoint 记录当前的水平位置,也可以简写为 \?
-%% 命令 \tabto 跳到之前记录的位置,也可以简写为 \+
-%% 命令 \tableft 跳到之前记录的位置的左侧,也可以简写为 \<
-%% 这些自由对齐命令需要编译两次才能生效
+%% 装订线命令 \addbindingline
+%% 草稿纸命令 \addscratchpaper
+%% 这两个命令需要编译两次才能得到正确结果
%% ---------------------------------------------------------------------------
-\usepackage{zref-savepos}
-
-\@ifundefined{zsaveposx}{\let\zsaveposx\zsavepos}{} % 旧版本无 \zsaveposx 命令
-
-\newcounter{saveposcnt}
-\newcounter{useposcnt}
-\renewcommand*{\thesaveposcnt}{savepos\number\value{saveposcnt}}
-\renewcommand*{\theuseposcnt}{usepos\number\value{useposcnt}}
-
-\def\my@alignment@offset{}
-
-\def\my@alignment@list{}
-\forcsvlist{\listadd\my@alignment@list}{=,<,>,\le,\ge,\leq,\geq,\approx}
-
-\newlength{\my@alignment@kern}
-
-\newcommand*{\my@alignment@check}[1]{%
- \ifx\my@let@token #1%
- \def\my@alignment@offset{5}%
- \expandafter\listbreak
- \fi
-}
-
-\newcommand{\my@alignment@next}{%
- \ifdefempty{\my@alignment@offset}{%
- \def\my@alignment@offset{0}%
- \forlistloop{\my@alignment@check}{\my@alignment@list}%
- }{}%
- \settowidth{\my@alignment@kern}{$\mkern\my@alignment@offset mu$}%
- \stepcounter{saveposcnt}%
- \rlap{\kern\my@alignment@kern\zsaveposx{\thesaveposcnt}}%
-}
-
-\newcommand*{\tabpoint}[1][]{%
- \leavevmode
- \def\my@alignment@offset{#1}%
- \futurelet\my@let@token\my@alignment@next
+\IfExamBoolF{plain}{
+ \RequirePackage{tikz}
+ \RequirePackage{everypage}
}
-\let \? = \tabpoint
-\newcommand*{\tabto}{%
- \stepcounter{useposcnt}%
- \zsaveposx{\theuseposcnt}%
- \noindent
- \hskip\zposx{\thesaveposcnt}sp\relax
- \hskip-\zposx{\theuseposcnt}sp\relax
- \ignorespaces
+\IfExamLanguageEqTF{english}{
+ \tlSet\l@jdxm@binding@text@a@tl{the}
+ \tlSet\l@jdxm@binding@text@b@tl{binding}
+ \tlSet\l@jdxm@binding@text@c@tl{line}
+}{
+ \tlSet\l@jdxm@binding@text@a@tl{装}
+ \tlSet\l@jdxm@binding@text@b@tl{订}
+ \tlSet\l@jdxm@binding@text@c@tl{线}
}
-\let \+ = \tabto
-\newcommand*{\tableft}{%
- \settowidth{\my@alignment@kern}{$=\mkern5mu$}%
- \stepcounter{useposcnt}%
- \zsaveposx{\theuseposcnt}%
- \noindent
- \hskip\zposx{\thesaveposcnt}sp\relax
- \hskip-\zposx{\theuseposcnt}sp\relax
- \hskip-\my@alignment@kern
- \ignorespaces
+\newcommand{\bindinglineleft}{
+ \path (current~page.north~west) +(25mm,-25mm) coordinate (a1);
+ \path (current~page.south~west) +(25mm,25mm) coordinate (a2);
+ \draw[dashed] (a1) -- node[left=1mm,text~width=1em,inner~sep=0pt]{
+ \1{\l@jdxm@binding@text@c@tl}\0
+ \1{\l@jdxm@binding@text@b@tl}\0
+ \1{\l@jdxm@binding@text@a@tl}
+ } (a2);
}
-\let \< = \tableft
-
-%% ---------------------------------------------------------------------------
-%% 评分命令 \points
-%% ---------------------------------------------------------------------------
-
-\PassOptionsToPackage{tbtags}{amsmath}
-\RequirePackage{amsmath}
-
-\newcommand{\mypoints}[1]{\textcolor{red}{#1\kern0.15em 分}}
-\newcommand{\pointstext}[1]{\mbox{}\nobreak\hfill$\cdots\cdots$\mypoints{#1}\par\noindent\ignorespaces}
-\newcommand{\pointseqno}[1]{\eqno{\cdots\cdots\text{\mypoints{#1}}}}
-\newcommand{\pointstag}[1]{\tag*{$\cdots\cdots$\mypoints{#1}}}
-
-\newrobustcmd{\points}[1]{%
- \ifbool{mmode}{%
- \ifdefstrequal{\tag}{\dft@tag}{\pointseqno{#1}}{\pointstag{#1}}%
- }{%
- \pointstext{#1}%
- }%
+\newcommand{\bindinglineright}{
+ \path (current~page.north~east) +(-25mm,-25mm) coordinate (b1);
+ \path (current~page.south~east) +(-25mm,25mm) coordinate (b2);
+ \draw[dashed] (b1) -- node[right=1mm,text~width=1em,inner~sep=0pt]{
+ \2{\l@jdxm@binding@text@a@tl}\0
+ \2{\l@jdxm@binding@text@b@tl}\0
+ \2{\l@jdxm@binding@text@c@tl}
+ } (b2);
}
-%% ---------------------------------------------------------------------------
-%% 载入个人定制文件 jnuexam.cfg
-%% 中文字体切换选项 sourcehan
-%% 实心句号替换选项 solidot
-%% ---------------------------------------------------------------------------
+\newcommand{\bindinglineone}{%
+\def\0{\\[70mm]}\def\1{\rotatebox{90}}\def\2{\rotatebox{-90}}
+\begin{tikzpicture}[remember~picture,overlay,very~thick]
+ \ifnumodd{\value{page}}{\bindinglineleft}{\bindinglineright}
+\end{tikzpicture}}
-\InputIfFileExists{jnuexam.cfg}{}{}
+\newcommand{\bindinglinetwo}{%
+\def\0{\\[70mm]}\def\1{\rotatebox{90}}\def\2{\rotatebox{-90}}
+\begin{tikzpicture}[remember~picture,overlay,very~thick]
+ \bindinglineleft\bindinglineright
+\end{tikzpicture}}
-\newcommand{\my@set@sourcehan}{
- \setCJKmainfont[BoldFont=Source Han Sans SC]{Source Han Serif SC}
- \setCJKsansfont{Source Han Sans SC}
- % 用中文字体名时 LuaTeX 找不到该字体,XeTeX 正常
- %\setCJKmainfont[BoldFont=思源黑体]{思源宋体}
- %\setCJKsansfont{思源黑体}
+\IfExamBoolTF{twoinone}{
+ \let\bindingline=\bindinglinetwo
+}{
+ \let\bindingline=\bindinglineone
}
-\AtBeginDocument{%
- \ifbool{sourcehan}{%
- % https://sourceforge.net/p/xetex/code/ci/master/tree/source/texk/web2c/xetexdir/NEWS
- \ifbool{XeTeX}{% TeXLive 2015
- \ifdimless{\the\XeTeXversion\XeTeXrevision pt}{0.99992pt}{}{\my@set@sourcehan}%
- }{}%
- \ifbool{LuaTeX}{\my@set@sourcehan}{}%
- }{}%
+%% 必须将 .store 放在 .initial:n 之前
+\DeclareKeys[randexam]{
+ binding .store = \zhuangdingxian,
+ binding .initial:n = 1,
+ binding .default:n = 2
}
-%% 这里不能用 \ifbool,因为涉及到 catcode 的改变
-\ifsolidot
- \ifXeTeX
- \catcode`。=\active\def。{.}%
- \else\ifLuaTeX
- \catcode`。=\active\def。{.}%
- \fi
+\newcommand{\addbindingline}{
+ \ifcase\zhuangdingxian % 0
+ \or % 1
+ \IfExamBoolF{answer}{\bindingline}%
+ \or % 2
+ \bindingline
\fi
-\fi
-
-%% ---------------------------------------------------------------------------
-%% 在 tabular 和 array 等表格环境中添加列间距
-%% 避免单元格里出现的分式太过接近上面和下面行
-%% ---------------------------------------------------------------------------
-
-\newcommand{\my@do@cellspace}{%
- \RequirePackage[math]{cellspace}%
- \setlength\cellspacetoplimit{2pt}%
- \setlength\cellspacebottomlimit{2pt}%
- \addparagraphcolumntypes{X}%
- \newcolumntype{0}[1]{>{\bcolumn ##1\@nil}##1<{\ecolumn}}%
- \newcolumntype{5}[1]{>{$}0{##1}<{$}}%
- % Fix cellspace bug before version 1.7
- % See https://tex.stackexchange.com/a/385581
- \@ifpackagelater{cellspace}{2017/08/12}{}{%
- \patchcmd{\@endpbox}{\color@endgroup}{\expandafter\color@endgroup}{}{}%
- }%
}
-\AtBeginDocument{%
- \ifcellspace \my@do@cellspace \fi
-}
-
-%% ---------------------------------------------------------------------------
-%% 统一行间公式和行内公式的巨算符和分式的尺寸
-%% 利用开头的 medmath 选项可以启用此部分设定
-%% ---------------------------------------------------------------------------
+\IfExamBoolF{plain}{\AddEverypageHook{\addbindingline}}
-\newcommand{\my@do@medmath}{%
- \RequirePackage[mediummath]{nccmath}%
- %% 补充 \oiint 命令的调整
- \ifdef{\oiint}{%
- \let\NCC@op@oiint=\oiint
- \DeclareRobustCommand{\oiintop}{\mathop{\medmath{\NCC@op@oiint}}}%
- \def\oiint{\DOTSI\NCC@op@prepare{\oiintop}}%
- }{}%
- %% 设定 nccmath 的积分号校正尺寸
- %% 后面已经改用相对尺寸,不再需要
- %\ifamsfonts
- % \medintcorr{0.5em}
- %\else
- % \medintcorr{0.3em}
- %\fi
- %% 使用 nccmath 宏包后,cases 环境包含定积分时将无法编译,这里重新定义此环境
- %% 注意相比 amsmath 的原始定义,我们这里将 \quad 从两列之间移动到第二列最前面
- %% 这是因为,我们常将 cases 用于只有一列的方程组,这样处理末尾不会有多余空白
- \ifbool{cellspace}{%
- \renewenvironment{cases}{%
- \left\{\linespread{1.0}\selectfont\def\arraystretch{1.2}%
- \begin{array}{@{}5l@{}>{\quad}5l@{}}%
- }{%
- \end{array}\right.%
- }%
- }{%
- \renewenvironment{cases}{%
- \left\{\linespread{1.0}\selectfont\def\arraystretch{1.2}%
- \begin{array}{@{}l@{}>{\quad}l@{}}%
- }{%
- \end{array}\right.%
- }%
+\IfExamLanguageEqTF{english}{
+ \tlSet\l@jdxm@scratch@font@one@tl{
+ \sffamily\fontsize{100pt}{100pt}\selectfont
}
- %% 当 minipage 或 \parbox 仅包含行间公式时,盒子的右边距丢失,这里修正它
- %% 其他类似问题的描述见 http://tex.stackexchange.com/q/22170
- \let\start@gather=\NCC@startgather
- \let\start@align=\NCC@startalign
- \let\start@multline=\NCC@startmultline
- \let\mathdisplay=\NCC@startdisplay
-}
-
-\newcommand{\my@do@medmath@fix}{%
- %% 修正在角标处的非积分巨算符尺寸
- %% 参考了 scalerel 宏包对数学样式的保存方法
- % 非角标巨算符保持为 \displaystyle 巨算符的 80% 大小
- % 一级角标巨算符修改为 \textstyle 巨算符的 80% 大小
- % 二级角标巨算符修改为 \scriptstyle 巨算符的 80% 大小
- \def\@my@style@D{\displaystyle}%
- \def\@my@style@T{\displaystyle}%
- \def\@my@style@S{\textstyle}%
- \def\@my@style@s{\scriptstyle}%
- \def\my@style@saved{\csname @my@style@\@my@style@switch\endcsname}%
- \newcommand{\my@style@this}[1]{%
- \mathchoice{\def\@my@style@switch{D}##1}{\def\@my@style@switch{T}##1}
- {\def\@my@style@switch{S}##1}{\def\@my@style@switch{s}##1}%
- }%
- \DeclareRobustCommand*\medmath[1]{\NCC@select@msize
- \mathord{\my@style@this{\raise\@tempdima\hbox{\NCC@prepare@msize$\my@style@saved ##1$}}}%
+ \tlSet\l@jdxm@scratch@font@two@tl{
+ \sffamily\fontsize{100pt}{100pt}\selectfont
}
- %% 修正在角标处的积分算符尺寸和上下限位置
- \newlength{\@my@em}%
- \setlength{\@my@em}{1em}%
- \ifamsfonts
- \medintcorr{0.5\@my@em}%
- \else
- \medintcorr{0.3\@my@em}%
- \fi
- \newcommand{\my@style@unit}[1]{%
- \mathchoice{\setlength{\@my@em}{1em}##1}{\setlength{\@my@em}{1em}##1}
- {\setlength{\@my@em}{0.5em}##1}{\setlength{\@my@em}{0.3em}##1}%
- }%
- \let\my@saved@op@printm=\NCC@op@printm
- \def\NCC@op@printm{\my@style@unit{\my@saved@op@printm}}%
- %% 修正在角标位置的分式和嵌套分式
- %% 总是使用当前样式尺寸来排版分式的分子和分母
- \newcommand{\my@larger@frac}[2]{%
- \mathchoice{\genfrac{}{}{}{0}{##1}{##2}}{\genfrac{}{}{}{0}{##1}{##2}}%
- {\genfrac{}{}{}{1}{##1}{##2}}{\genfrac{}{}{}{2}{##1}{##2}}%
- }%
- \DeclareRobustCommand{\frac}[2]{%
- \mathchoice{\mfrac{##1}{##2}}{\mfrac{##1}{##2}}%
- {\my@larger@frac{##1}{##2}}{\my@larger@frac{##1}{##2}}%
- }%
- \patchcmd{\NCC@prepare@msize}{%
- \def\frac{\protect\NCC@innerfrac{}}%
- }{%
- \let\frac=\my@larger@frac
- }{}{}%
+ \tlSet\l@jdxm@scratch@text@a@tl{THE}
+ \tlSet\l@jdxm@scratch@text@b@tl{SCRATCH}
+ \tlSet\l@jdxm@scratch@text@c@tl{PAPER}
+}{
+ \tlSet\l@jdxm@scratch@font@one@tl{
+ \sffamily\fontsize{120pt}{120pt}\selectfont
+ }
+ \tlSet\l@jdxm@scratch@font@two@tl{
+ \sffamily\fontsize{180pt}{180pt}\selectfont
+ }
+ \tlSet\l@jdxm@scratch@text@a@tl{草}
+ \tlSet\l@jdxm@scratch@text@b@tl{稿}
+ \tlSet\l@jdxm@scratch@text@c@tl{纸}
}
-\AtBeginDocument{%
- \ifmedmath
- \my@do@medmath \my@do@medmath@fix
- \fi
-}
+\newcommand{\scratchpaperone}{%
+\begin{tikzpicture}[remember~picture,overlay,font=\l@jdxm@scratch@font@one@tl]
+ \node[text=lightgray!40,text~width=1000pt,align=center] at (current~page.center) {
+ \l@jdxm@scratch@text@a@tl\\
+ \l@jdxm@scratch@text@b@tl\\
+ \l@jdxm@scratch@text@c@tl
+ };
+\end{tikzpicture}}
-%% ---------------------------------------------------------------------------
-%% 载入常用宏包,定义常用命令
-%% ---------------------------------------------------------------------------
+\newcommand{\scratchpapertwo}{%
+\begin{tikzpicture}[remember~picture,overlay,font=\l@jdxm@scratch@font@two@tl]
+ \node[text=lightgray!40] at (current~page.center) {
+ \l@jdxm@scratch@text@a@tl\quad
+ \l@jdxm@scratch@text@b@tl\quad
+ \l@jdxm@scratch@text@c@tl
+ };
+\end{tikzpicture}}
-\AtBeginDocument{
- \setlength{\abovedisplayskip}{4pt minus 2pt}
- \setlength{\belowdisplayskip}{4pt minus 2pt}
- \setlength{\abovedisplayshortskip}{2pt}
- \setlength{\belowdisplayshortskip}{2pt}
+%% 必须将 .store 放在 .initial:n 之前
+\DeclareKeys[randexam]{
+ scratch .store = \caogaozhi,
+ scratch .initial:n = 0,
+ scratch .default:n = 1
}
-\setlength\arraycolsep{4pt}
+\newcounter{my@empty@page} % 空白页数
+\newcounter{my@scratch@page} % 草稿页数
+\newcounter{my@extra@page} % 空白页数+草稿页数
-\ifbool{XeTeX}{
- % https://en.wikipedia.org/wiki/Number_Forms
- % Ⅰ、Ⅱ、Ⅲ、Ⅳ、Ⅴ、Ⅵ、Ⅶ、Ⅷ、Ⅸ、Ⅹ、Ⅺ、Ⅻ
- \xeCJKsetcharclass{"2150}{"218F}{1} % 斜线分数,全角罗马数字等
- % https://en.wikipedia.org/wiki/Enclosed_Alphanumerics
- \xeCJKsetcharclass{"2460}{"24FF}{1} % 带圈数字字母,括号数字字母,带点数字等
-}{}
+% 添加空白页,使得草稿纸前页数在单面印刷时为偶数,双面印刷时为4的倍数
+% 添加草稿纸,页数在单面印刷时等于设置值的两倍,双面印刷时等于设置值的4倍
+\newcommand{\doscratchpaperone}{
+ \clearpage\pagestyle{empty}\let\addbindingline=\relax
+ \ifnumgreater{\caogaozhi}{0}{
+ \IfExamBoolTF{oneside}{
+ \ifnumodd{\value{page}}
+ {\setcounter{my@empty@page}{0}}
+ {\setcounter{my@empty@page}{1}}
+ \setcounter{my@scratch@page}{\caogaozhi*2}
+ }{
+ \setcounter{my@empty@page}{(\value{page}+2)/4*4+1-\value{page}}
+ \setcounter{my@scratch@page}{\caogaozhi*4}
+ }
+ \my@add@extra@page
+ }{}
+}
-\RequirePackage{multirow}
-\RequirePackage{tabu}
+% 注意在 twocolumn 文档中,\newpage 到下一栏,\clearpage 到下一页
+% 另外注意第一行的 \clearpage 等不能移动到 \my@add@extra@page 命令里
+% 因为 \clearpage 后本页已经结束,page 表示的是下一页的页码
+\newcommand{\doscratchpapertwo}{
+ \clearpage\pagestyle{empty}\let\addbindingline=\relax
+ \ifnumgreater{\caogaozhi}{0}{
+ \IfExamBoolTF{oneside}{
+ \setcounter{my@empty@page}{0}
+ \setcounter{my@scratch@page}{\caogaozhi}
+ }{
+ \setcounter{my@empty@page}{(\value{page}/2)-(\value{page}/2)/2*2}
+ \setcounter{my@scratch@page}{\caogaozhi*2}
+ }
+ \my@add@extra@page
+ }{}
+}
-\RequirePackage{diagbox}
-%% 修正 \diagbox 在 array 环境中使用的问题
-\newrobustcmd{\diagboxtwo}[3][]{%
- \ifbool{mmode}{%
- \hbox{\let\tabcolsep=\arraycolsep\diagbox[#1]{$#2$}{$#3$}}%
- }{%
- \diagbox[#1]{#2}{#3}%
+\newcommand{\my@add@extra@page}{
+ \setcounter{my@extra@page}{\value{my@empty@page}+\value{my@scratch@page}}
+ \whileboolexpr{
+ test{\ifnumgreater{\value{my@empty@page}}{0}}
+ }{
+ \addtocounter{my@empty@page}{-1}
+ \leavevmode\clearpage
}
-}
-\newrobustcmd{\diagboxthree}[4][]{%
- \ifbool{mmode}{%
- \hbox{\let\tabcolsep=\arraycolsep\diagbox[#1]{$#2$}{$#3$}{$#4$}}%
- }{%
- \diagbox[#1]{#2}{#3}{#4}%
+ \whileboolexpr{
+ test{\ifnumgreater{\value{my@scratch@page}}{0}}
+ }{
+ \addtocounter{my@scratch@page}{-1}
+ \leavevmode\scratchpaper\clearpage
}
+ \addtocounter{page}{-\value{my@extra@page}}
}
-\RequirePackage{mathtools} % \mathllap 命令,pmatrix* 环境等
-\RequirePackage{extarrows}
-
-\RequirePackage{relsize}
-\newcommand{\Int}{\mathop{\mathlarger{\int}}}
-
-\AtBeginDocument{%
- \let\my@saved@lim=\lim \def\lim{\my@saved@lim\limits}%
- \let\my@saved@sum=\sum \def\sum{\my@saved@sum\limits}%
- \let\my@saved@prod=\prod \def\prod{\my@saved@prod\limits}%
+\IfExamBoolTF{twoinone}{
+ \let\scratchpaper=\scratchpapertwo
+ \let\doscratchpaper=\doscratchpapertwo
+}{
+ \let\scratchpaper=\scratchpaperone
+ \let\doscratchpaper=\doscratchpaperone
}
-\newcommand{\e}{\mathrm{e}}
-\newcommand{\R}{\mathbb{R}}
-
-\DeclareMathOperator{\arccot}{arccot}
-\DeclareMathOperator{\Corr}{\rho}
-\DeclareMathOperator{\Cov}{Cov}
-\DeclareMathOperator{\diag}{diag}
-\DeclareMathOperator{\grad}{grad}
-\DeclareMathOperator{\Prj}{Prj}
-\DeclareMathOperator{\tr}{tr}
-\DeclareMathOperator{\Var}{Var}
-
-\DeclareMathOperator{\diver}{div}
-\let\division=\div
-\let\div=\diver
-
-\newcommand{\diff}{\mathop{}\!\mathrm{d}}
-\newcommand{\dx}{\diff x}
-\newcommand{\dy}{\diff y}
-\def\dz{\diff z} % 不确定命令是否已经定义
-\newcommand{\du}{\diff u}
-\newcommand{\dv}{\diff v}
-\newcommand{\dr}{\diff r}
-\newcommand{\ds}{\diff s}
-\newcommand{\dt}{\diff t}
-\newcommand{\dS}{\diff S}
-% 有些宏包比如 hyperref 会修改 \d 的定义,所以放在 document 开始处
-% 利用 etoolbox 将 \d 定义为健壮命令,以避免在 align 等环境中错误地展开
-\AtBeginDocument{%
- \let\oldd=\d
- \renewrobustcmd{\d}{\ifbool{mmode}{\diff}{\oldd}}%
+% 在旧版本 ctex 宏包中不能用 \AtEndDocument 添加含中文的内容,即不能用 \appto 而要用 \preto
+\newcommand{\addscratchpaper}{
+ \preto{\@enddocumenthook}{\doscratchpaper}
}
-\let\pd=\partial
-\newcommand{\pdf}{\pd f}
-\newcommand{\pdg}{\pd g}
-\newcommand{\pdh}{\pd h}
-\newcommand{\pdl}{\pd l}
-\newcommand{\pdn}{\pd n}
-\newcommand{\pdu}{\pd u}
-\newcommand{\pdv}{\pd v}
-\newcommand{\pdx}{\pd x}
-\newcommand{\pdy}{\pd y}
-\newcommand{\pdz}{\pd z}
-\newcommand{\pdF}{\pd F}
-\newcommand{\pdL}{\pd L}
-\newcommand{\pdP}{\pd P}
-\newcommand{\pdQ}{\pd Q}
-\newcommand{\pdR}{\pd R}
+\IfExamBoolF{plain}{\IfExamBoolF{answer}{\addscratchpaper}}
-% from mathabx package
-\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
-\DeclareFontShape{U}{mathx}{m}{n}{<-> mathx10}{}
-\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
-\DeclareMathAccent{\widebar}{0}{mathx}{"73}
-
-\newcommand{\va}{\vec{a}}
-\newcommand{\vb}{\vec{b}}
-\newcommand{\vc}{\vec{c}}
-\newcommand{\vd}{\vec{d}}
-\newcommand{\ve}{\vec{e}}
-\newcommand{\vi}{\vec{i}}
-\newcommand{\vj}{\vec{j}}
-\newcommand{\vk}{\vec{k}}
-\newcommand{\vn}{\vec{n}}
-\newcommand{\vs}{\vec{s}}
-\newcommand{\vv}{\vec{v}}
-
-\let\ov=\overrightarrow
-
-\let\le=\leqslant
-\let\ge=\geqslant
+%% ---------------------------------------------------------------------------
+%% 试卷模板主题切换
+%% ---------------------------------------------------------------------------
-\let\lb=\{
-\let\rb=\}
+\DeclareExamTheme{final-chinese}{
+ \SetExamOption{chinese}
+ \SelectExamTranslation{chinese}
+ \SetExamValue{exampart}{number=\Chinese}
+ \SelectExamTemplate{examtitle}{final-chinese}
+ \SelectExamTemplate{exampart}{final-chinese}
+}
-\def\T{\mathrm{T}\kern-.5pt}
+\DeclareExamTheme{final-english}{
+ \geometry{top=30mm,headheight=34pt}
+ \SetExamBoolFalse{sourcehan}
+ \SelectExamTranslation{english}
+ \SetExamValue{exampart}{number=\Roman}
+ \SelectExamTemplate{examtitle}{final-english}
+ \SelectExamTemplate{exampart}{final-english}
+}
-% 分数线长一点的分数,\wfrac[2pt]{x}{y} 表示左右加 2pt
-% 和前面的 medmath 一样,将代码放在 \AtBeginDocument 里
-\AtBeginDocument{%
- \newrobustcmd{\wfrac}[3][2pt]{%
- \frac{\hspace{#1}#2\hspace{#1}}{\hspace{#1}#3\hspace{#1}}%
- }%
- \newrobustcmd{\wdfrac}[3][2pt]{%
- \dfrac{\hspace{#1}#2\hspace{#1}}{\hspace{#1}#3\hspace{#1}}%
- }%
- \newrobustcmd{\wtfrac}[3][2pt]{%
- \tfrac{\hspace{#1}#2\hspace{#1}}{\hspace{#1}#3\hspace{#1}}%
- }%
+\IfExamLanguageEqTF{english}{
+ \SelectExamTheme{final-english}
+}{
+ \SelectExamTheme{final-chinese}
}
-% 使用 stix font 中的 white arrows
-\ifxetex
- %\IfFileExists{STIX-Regular.otf}{% 在 TeXLive 中无效
- \IfFileExists{stix.sty}{%
- \newfontfamily{\mystix}{STIX} % stix v1.1
- }{%
- \newfontfamily{\mystix}{STIXGeneral} % stix v1.0
- }
- \newrobustcmd\leftwhitearrow{%
- \mathrel{\text{\normalfont\mystix\symbol{"21E6}}}%
- }
- \newrobustcmd\upwhitearrow{%
- \mathrel{\text{\normalfont\mystix\symbol{"21E7}}}%
- }
- \newrobustcmd\rightwhitearrow{%
- \mathrel{\text{\normalfont\mystix\symbol{"21E8}}}%
- }
- \newrobustcmd\downwhitearrow{%
- \mathrel{\text{\normalfont\mystix\symbol{"21E9}}}%
- }
-\else
- \let \leftwhitearrow = \Leftarrow
- \let \rightwhitearrow = \Rightarrow
- \let \upwhitearrow = \Uparrow
- \let \downwhitearrow = \Downarrow
-\fi
+%% ---------------------------------------------------------------------------
+%% 停止忽略代码中的空白符号
+%% ---------------------------------------------------------------------------
+\IgnoreSpacesOff