texlive[52696] Master/texmf-dist: jnuexam (8nov19)

commits+karl at tug.org commits+karl at tug.org
Fri Nov 8 22:40:59 CET 2019


Revision: 52696
          http://tug.org/svn/texlive?view=revision&revision=52696
Author:   karl
Date:     2019-11-08 22:40:58 +0100 (Fri, 08 Nov 2019)
Log Message:
-----------
jnuexam (8nov19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3input.pdf
    trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3split.pdf
    trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a-empty.pdf
    trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a.pdf
    trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a.tex
    trunk/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3input.pdf
    trunk/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3split.pdf
    trunk/Master/texmf-dist/doc/latex/jnuexam/exam-b-empty.pdf
    trunk/Master/texmf-dist/doc/latex/jnuexam/exam-b.pdf
    trunk/Master/texmf-dist/doc/latex/jnuexam/jnuexam.pdf
    trunk/Master/texmf-dist/doc/latex/jnuexam/jnuexam.tex
    trunk/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls

Modified: trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3input.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3split.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a-empty.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a.tex	2019-11-08 21:40:42 UTC (rev 52695)
+++ trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a.tex	2019-11-08 21:40:58 UTC (rev 52696)
@@ -39,10 +39,10 @@
 \vfill
 
 \begin{problem}
-已知二阶行列式 $\text{$\left|\begin{array}{cc}
+已知二阶行列式 $\left|\begin{array}{cc}
   1 & 2\\
   - 3 & x
-\end{array}\right|$=0}$,则 $x=$ \fillout{$-6$}.
+\end{array}\right|=0$,则 $x=$ \fillout{$-6$}.
 \end{problem}
 
 \vfill
@@ -178,10 +178,10 @@
 
 \begin{solution}
 \everymath{\displaystyle}%
-原式$=\int\e^{2x}\,\sec^2 x\dx+2\int\e^{2x}\,\tan x\dx$ \score{2}
-\hspace{5em}${}=\int\e^{2x}\,\d(\tan x)+ 2\int\e^{2x}\,\tan x\dx$ \score{4}
-\hspace{5em}${}=\e^{2x}\,\tan x - 2\int\e^{2x}\,\tan x\dx+ 2\int\e^{2x}\,\tan x\dx$ \score{6}
-\hspace{5em}${}=\e^{2x}\,\tan x + C$ \score{8}
+原式 \? $=\int\e^{2x}\,\sec^2 x\dx+2\int\e^{2x}\,\tan x\dx$ \score{2}
+\+ $=\int\e^{2x}\,\d(\tan x)+ 2\int\e^{2x}\,\tan x\dx$ \score{4}
+\+ $=\e^{2x}\,\tan x - 2\int\e^{2x}\,\tan x\dx+ 2\int\e^{2x}\,\tan x\dx$ \score{6}
+\+ $=\e^{2x}\,\tan x + C$ \score{8}
 \end{solution}
 
 \vfill
@@ -220,7 +220,7 @@
 \bigskip
 
 \begin{solution}
-$A = \left|\begin{array}{cccc}
+$A \? = \left|\begin{array}{cccc}
     0 & 1 & 2 & 3\\
     1 & 2 & 3 & 0\\
     2 & 3 & 0 & 1\\
@@ -235,7 +235,7 @@
     - 1 & - 6 & 1\\
     - 6 & - 8 & 2
   \end{array}\right|$ \score{4}
-\qquad $= -\left|\begin{array}{ccc}
+\+ $= -\left|\begin{array}{ccc}
     1 & 2 & 3\\
     0 & - 4 & 4\\
     0 & 4 & 20
@@ -255,11 +255,11 @@
 \bigskip
 
 \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
-\qquad$= 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
-\qquad$= (x_1 + x_2 - 3 x_3)^2 + x_2^2 - 6 x_2 x_3$ \score{3}
-\qquad$= (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
-\qquad$= (x_1 + x_2 - 3 x_3)^2 + (x_2 - 3 x_3)^2 - 9 x_3^2$ \score{6}
+$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$ \score{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$ \score{6}
 令$y_1 = x_1 + x_2 - 3 x_3, y_2 = x_2 - 3 x_3, y_3 = x_3$, \newline
 则$f = y_1^2 + y_2^2 - 9y_3^2$为标准形.\score{8}
 \end{solution}
@@ -270,8 +270,8 @@
 
 \begin{problem}
 设每发炮弹命中飞机的概率是0.2且相互独立,现在发射100发炮弹.\par
-\step 用切贝谢夫不等式估计命中数目$\xi$在10发到30发之间的概率.\par
-\step 用中心极限定理估计命中数目$\xi$在10发到30发之间的概率.
+(1) 用切贝谢夫不等式估计命中数目$\xi$在10发到30发之间的概率.\par
+(2) 用中心极限定理估计命中数目$\xi$在10发到30发之间的概率.
 \end{problem}
 
 \bigskip
@@ -278,11 +278,11 @@
 
 \begin{solution}
 $E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$. \score{2}
-\step $P (10 < \xi < 30) = P (| \xi - E \xi | < 10) \ge 1 - \frac{D\xi}{10^2}
+(1) $P (10 < \xi < 30) = P (|\xi - E\xi| < 10) \ge 1 - \frac{D\xi}{10^2}
      = 1 - \frac{16}{100} = 0.84$. \score{4}
-\step $P (10 < \xi < 30) \approx \Phi_0 \left( \frac{30 - 20}{\sqrt{16}}\right)
-     - \Phi_0 \left( \frac{10 - 20}{\sqrt{16}} \right)$ \score{6}
-\qquad $= 2 \Phi_0 (2.5) - 1 = 2 \cdot 0.9938 - 1 =0.9876$ \score{8}
+(2) $P (10 < \xi < 30) \? \approx \Phi_0\left(\frac{30 - 20}{\sqrt{16}}\right)
+         - \Phi_0\left(\frac{10 - 20}{\sqrt{16}}\right)$ \score{6}
+      \+ $= 2 \Phi_0(2.5) - 1 = 2 \cdot 0.9938 - 1 =0.9876$ \score{8}
 \end{solution}
 
 \vfill
@@ -295,11 +295,11 @@
 \bigskip
 
 \begin{solution}
-\step 待检假设 $H_0 : \mu = 3140$. \score{1}
-\step 选取统计量 $T = \frac{\bar{X}-\mu}{S / \sqrt{n}} \sim t(n-1)$. \score{3}
-\step 查表得到 $t_{\alpha} = t_{\alpha} (n - 1) = t_{0.01} (15) =2.947$. \score{5}
-\step 计算统计值 $t = \frac{\bar{x} - \mu_0}{s/\sqrt{n}} =\frac{3160-3140}{100/4} = 0.8$.\score{7}
-\step 由于 $| t | < t_{\alpha}$, 故接受 $H_0$, 即假设成立. \score{8}
+(1) 待检假设 $H_0 : \mu = 3140$. \score{1}
+(2) 选取统计量 $T = \frac{\widebar{X}-\mu}{S / \sqrt{n}} \sim t(n-1)$. \score{3}
+(3) 查表得到 $t_{\alpha} = t_{\alpha} (n - 1) = t_{0.01} (15) =2.947$. \score{5}
+(4) 计算统计值 $t = \frac{\widebar{x} - \mu_0}{s/\sqrt{n}} =\frac{3160-3140}{100/4} = 0.8$.\score{7}
+(5) 由于 $| t | < t_{\alpha}$, 故接受 $H_0$, 即假设成立. \score{8}
 \end{solution}
 
 \vfill
@@ -308,6 +308,8 @@
 
 \makepart{证明题}{共~2~小题,每小题~8~分,共~16~分}
 
+\renewcommand{\solutionname}{证} % 将“解”字改为“证”字
+
 \begin{problem}
 设数列$\{x_n\}$满足$x_1=\sqrt2$,$x_{n+1}=\sqrt{2+x_n}$.证明数列收敛,并求出极限.
 \end{problem}
@@ -315,13 +317,13 @@
 \bigskip
 
 \begin{solution}
-\step 事实上,由于$x_1<2$,且$x_k<2$时
+(1) 事实上,由于$x_1<2$,且$x_k<2$时
 $$x_{k+1}=\sqrt{2+x_k}<\sqrt{2+2}=2,$$
 由数学归纳法知对所有$n$都有$x_n<2$,即数列有上界.
 又由于
 $$\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,$$
 所以数列单调增加.由极限存在准则II,数列必定收敛.\score{4}
-\step 设数列的极限为$A$,对递推公式两边同时取极限得到
+(2) 设数列的极限为$A$,对递推公式两边同时取极限得到
 $$A=\sqrt{2+A}.$$
 解得$A=2$,即数列$\{x_n\}$的极限为$2$.\score{8}
 \end{solution}
@@ -329,16 +331,16 @@
 \vfill
 
 \begin{problem}
-设事件$A$和$B$相互独立,证明$A$和$\bar{B}$相互独立.
+设事件$A$和$B$相互独立,证明$A$和$\widebar{B}$相互独立.
 \end{problem}
 
 \bigskip
 
 \begin{solution}
-$P (A \cdot \bar{B}) = P (A - B) = P (A - A B)$ \score{2}
-\qquad $= P (A) - P (A B) = P (A) - P (A) P (B)$ \score{4}
-\qquad $= P (A) (1 - P (B)) = P (A) P (\bar{B})$ \score{6}
-所以$A$和$\bar{B}$相互独立.\score{8}
+\? $P (A \cdot \widebar{B}) = P (A - B) = P (A - A B)$ \score{2}
+\< $= P (A) - P (A B) = P (A) - P (A) P (B)$ \score{4}
+\< $= P (A) (1 - P (B)) = P (A) P (\widebar{B})$ \score{6}
+所以$A$和$\widebar{B}$相互独立.\score{8}
 \end{solution}
 
 \vfill
@@ -345,7 +347,7 @@
 
 \makedata{一些可能用到的数据} %附录数据
 
-\begin{tabu}{*{4}{X[l,$]}}
+\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 \\
@@ -352,6 +354,6 @@
 \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{tabu}
+\end{tabularx}
 
 \end{document}

Modified: trunk/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3input.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3split.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/jnuexam/exam-b-empty.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/jnuexam/exam-b.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/jnuexam/jnuexam.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/jnuexam/jnuexam.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jnuexam/jnuexam.tex	2019-11-08 21:40:42 UTC (rev 52695)
+++ trunk/Master/texmf-dist/doc/latex/jnuexam/jnuexam.tex	2019-11-08 21:40:58 UTC (rev 52696)
@@ -5,9 +5,7 @@
 
 \usepackage[UTF8,noindent]{ctex}
 \usepackage{arev}
-\usepackage{ragged2e}
-\usepackage{listings}
-\usepackage{tabu}
+\usefonttheme{professionalfonts}
 
 \makeatletter
 
@@ -28,32 +26,24 @@
 
 \setlength{\parskip}{7pt plus 1pt minus 1pt}
 
-\justifying
-\let\oldraggedright\raggedright
-\let\raggedright\justifying
-
-\lstset{
-  basicstyle=\ttfamily\color{blue!50!red}
-}
-
-\lstnewenvironment{code}{}{}
-
 \setbeamersize{text margin left=8mm,text margin right=8mm}
 
-\newenvironment{framex}{\begin{frame}[fragile=singleslide,environment=framex]}{\end{frame}}
+\setbeamercolor{normal text}{bg=gray!20}
 
 \setbeamertemplate{frametitle}{\strut\insertframetitle\strut\par}
 \setbeamertemplate{navigation symbols}{}
 
+\newcommand{\cdotfill}{\leavevmode\xleaders\hbox to 0.5em{\hss$\cdot$\hss}\hfill\kern0pt\relax}
+
+\usepackage{tabularx}
+
 \newcommand{\ulinefill}[1]{\xleaders\hbox{\underline{\vphantom{#1}\kern1pt}}\hfill\kern0pt}
 \newcommand{\fillbox}[1]{\ulinefill{#1}\underline{#1}\ulinefill{#1}}
 
-\setbeamercolor{normal text}{bg=gray!20}
-
 \setbeamertemplate{title page}{%
   \renewcommand{\arraystretch}{2}%
   \usebeamerfont{title}
-  \begin{tabu}{|X|}
+  \begin{tabularx}{\linewidth}{|X|}
     \hline
     模板名称:\fillbox{\usebeamercolor[fg]{title}\inserttitle} \\
     模板作者:\fillbox{\insertauthor} \\
@@ -60,9 +50,23 @@
     所在单位:\fillbox{\insertinstitute} \\
     更新日期:\fillbox{\the\year}年\fillbox{\the\month}月\fillbox{\the\day}日\\
     \hline
-  \end{tabu}%
+  \end{tabularx}%
 }
 
+\usepackage{ragged2e}
+
+\justifying
+\let\oldraggedright\raggedright
+\let\raggedright\justifying
+
+\usepackage{fancyvrb}
+
+\newenvironment{framex}{\begin{frame}[fragile=singleslide,environment=framex]}{\end{frame}}
+
+\DefineVerbatimEnvironment{code}{Verbatim}{%
+  formatcom=\color{blue!50!red}%
+}
+
 \begin{document}
 
 \title{暨南大学试卷 LaTeX 模板}
@@ -136,6 +140,22 @@
 \end{framex}
 
 \begin{framex}
+\frametitle{判断题目}
+\begin{code}
+\makepart{判断题}{题数分值}
+
+\begin{problem}
+第一道判断题描述。\true
+\end{problem}
+
+\begin{problem}
+第二道判断题描述。\false
+\end{problem}
+\end{code}
+其中 \verb!\true! 和 \verb!\false! 命令分别表示正确和错误。
+\end{framex}
+
+\begin{framex}
 \frametitle{填空题目}
 \begin{code}
 \makepart{填空题}{题数分值}
@@ -243,6 +263,15 @@
 \end{framex}
 
 \begin{framex}
+\frametitle{解答名称}
+通过重新定义 \verb!\solutionname! 命令,可以改变 \verb!solution! 环境的名称。
+比如下面例子将“解答”二字改为“证明”:
+\begin{code}
+\renewcommand{\solutionname}{证明}
+\end{code}
+\end{framex}
+
+\begin{framex}
 \frametitle{评分命令}
 计算题和证明题等主观题的排版方法是完全一样的。在编写这些主观题的解答时,
 可以用 \verb!\score! 命令给出各步骤得分。比如:
@@ -256,6 +285,40 @@
 \end{framex}
 
 \begin{framex}
+\frametitle{对齐命令}
+此文档类提供几个对齐命令,用于在不同行之间对齐。比如
+\vskip1em\hrule
+我们有$(a+b)^2 = (a+b)(a+b)$ \par
+\leavevmode\phantom{我们有$(a+b)^2$}${}= a^2 + 2ab + b^2$ \cdotfill 2分
+\vskip0.6em\hrule\vskip1em
+\begin{code}
+我们有$(a+b)^2 \? = (a+b)(a+b)$ \\
+               \+$= a^2+2ab+b^2$ \score{2}
+\end{code}
+第一个公式内部的 \verb!\?! 保存当前水平位置,
+而第二个公式前面的 \verb!\+! 表示跳到之前保存的位置。
+\par
+这两个对齐命令 \verb!\?! 和 \verb!\+! 需要编译两次才能生效。
+\end{framex}
+
+\begin{framex}
+\frametitle{对齐命令}
+此文档类提供几个对齐命令,用于在不同行的对齐。比如
+\vskip1em\hrule
+我们有$(a+b)^2 = (a+b)(a+b)$ \par
+\leavevmode\phantom{我们\,}${}= a^2 + 2ab + b^2$ \cdotfill 2分
+\vskip0.6em\hrule\vskip1em
+\begin{code}
+我们有 \? $(a+b)^2 = (a+b)(a+b)$ \\
+      \< $= a^2+2ab+b^2$ \score{2}
+\end{code}
+第一行公式前面的 \verb!\?! 保存当前水平位置,
+而第二行公式前面的 \verb!\<! 表示跳到之前保存位置的左侧(左移一个等号的宽度)。
+\par
+这两个对齐命令 \verb!\?! 和 \verb!\<! 需要编译两次才能生效。
+\end{framex}
+
+\begin{framex}
 \frametitle{其它题型}
 除了上述四种题型之外,其它题型可以用下面方式编写:
 \begin{code}
@@ -308,7 +371,7 @@
 \frametitle{竖直空白}
 在试卷的各个小题后面,可以留下一些竖直空白。本文档类支持下列这些竖直空白命令:\par
 \renewcommand{\arraystretch}{1.3}%
-\begin{tabu}{XX}
+\begin{tabularx}{\linewidth}{l<{\qquad}X}
   \hline
   \texttt{\string\smallskip} & 竖直小空白 \\
   \hline
@@ -318,7 +381,7 @@
   \hline
   \texttt{\string\vfill} & 竖直填充 \\
   \hline
-\end{tabu}
+\end{tabularx}\par
 当然,竖直空白命令可以连续使用多个,以得到所需的空白。
 \end{framex}
 
@@ -329,7 +392,7 @@
 分别只对 A 卷和 B 卷有效。
 \par
 \renewcommand{\arraystretch}{1.3}%
-\begin{tabu}{XX[2]}
+\begin{tabularx}{\linewidth}{l<{\qquad}X}
   \hline
   \texttt{\string\newpage} & 分页,对A卷和B卷均有效 \\
   \hline
@@ -337,7 +400,7 @@
   \hline
   \texttt{\string\newpageb} & 分页,仅对B卷有效 \\
   \hline
-\end{tabu}
+\end{tabularx}\par
 在试卷中\alert{不要}使用其他分页命令,比如 \verb!\clearpage! 等。
 \end{framex}
 

Modified: trunk/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls	2019-11-08 21:40:42 UTC (rev 52695)
+++ trunk/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls	2019-11-08 21:40:58 UTC (rev 52696)
@@ -6,18 +6,22 @@
 % ----------------------------------------------------------------------------
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jnuexam}[2018/11/21 v0.5 An exam class for Jinan University]
+\ProvidesClass{jnuexam}[2019/11/08 v0.7 An exam class for Jinan University]
 
 \newif\ifsidebyside \sidebysidefalse % 是否 A3 纸张
 \newif\ifreverse    \reversefalse    % 是否逆序出题
 \newif\ifanswer     \answertrue      % 是否显示答案
+\newif\ifamsfonts   \amsfontsfalse   % 切换数学字体
 \newif\ifsourcehan  \sourcehanfalse  % 切换思源字体
+\newif\ifdisplay    \displayfalse    % 切换展示公式
 \newif\ifcollection \collectionfalse % 用于试卷题库
 
 \DeclareOption{a3paper}{\sidebysidetrue}
 \DeclareOption{reverse}{\reversetrue}
 \DeclareOption{noanswer}{\answerfalse}
+\DeclareOption{amsfonts}{\amsfontstrue}
 \DeclareOption{sourcehan}{\sourcehantrue}
+\DeclareOption{display}{\displaytrue}
 \DeclareOption{collection}{\collectiontrue}
 
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}} %其它选项
@@ -28,6 +32,15 @@
 % 14bp    12bp      10.5bp    9bp
 \LoadClass[cs4size,UTF8,noindent]{ctexart}
 
+\ifamsfonts
+  \RequirePackage{amssymb}
+\else
+  \RequirePackage[utopia]{mathdesign} % charter, utopia
+  \renewcommand\bfdefault{bx}
+  \let\oldoiint\oiint\renewcommand{\oiint}{\oldoiint\nolimits}
+  \DeclareTextCommandDefault{\nobreakspace}{\leavevmode\nobreak\ }
+\fi
+
 \ifsidebyside
   \RequirePackage[a3paper,landscape,twocolumn,columnsep=40mm,left=50mm,right=30mm,top=25mm,bottom=25mm]{geometry}
 \else
@@ -34,8 +47,7 @@
   \RequirePackage[a4paper,left=30mm,right=30mm,top=25mm,bottom=25mm]{geometry}
 \fi
 
-\RequirePackage{tabu}
-\RequirePackage{amssymb}
+\RequirePackage{tabularx}
 \RequirePackage{lastpage}
 \RequirePackage{fancyhdr}
 \RequirePackage{xcolor}
@@ -44,9 +56,12 @@
 \RequirePackage{etoolbox}
 \RequirePackage{calc}
 
+\newcolumntype{Y}{>{\centering\arraybackslash}X}
+\newcolumntype{n}[1]{>{\centering\arraybackslash}m{#1}}
+
 \setlength{\parindent}{0em}
-\setlength{\lineskiplimit}{3pt}
-\setlength{\lineskip}{3pt}
+\setlength{\lineskiplimit}{4pt}
+\setlength{\lineskip}{4pt}
 
 %% ---------------------------------------------------------------------------
 %% 密封线命令 \mifengxian
@@ -116,10 +131,10 @@
 
 \newcommand{\head at table@a}{%
   \begin{tabular}{l}
-    \underbox{11em}{\niandu}学年度第\underbox{5.5em}{\xueqi}学期 \\
-    课程名称:\underbox{17.5em}{\kecheng\ifx\zhuanye\my at empty\else\kern0pt(\zhuanye)\fi} \\
-    授课教师:\underparbox{17.5em}{\centering\rule{0pt}{3ex}\jiaoshi} \\
-    考试时间:\underbox{17.5em}{\shijian} \\
+    \underbox{11\ccwd}{\niandu}学年度第\underbox{5.5\ccwd}{\xueqi}学期 \\
+    课程名称:\underbox{17.5\ccwd}{\kecheng\ifx\zhuanye\my at empty\else\kern0pt(\zhuanye)\fi} \\
+    授课教师:\underparbox{17.5\ccwd}{\centering\rule{0pt}{3ex}\jiaoshi} \\
+    考试时间:\underbox{17.5\ccwd}{\shijian} \\
   \end{tabular}
 }
 
@@ -136,9 +151,9 @@
 
 \newcommand{\head at table@c}{%
   \begin{tabular}{l}
-    \underspace{10em}学院\underspace{8em}专业\underspace{7.5em}班\kern0pt(\kern0pt{}级\kern0pt) \\[1em]
-    姓名\underspace{8em}学号\underspace{10em}\hfill
-    \bfseries 内招~[\ischeck{\neizhao}] 外招~[\ischeck{\waizhao}] %\\[0.8em]
+    \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]
   \end{tabular}
 }
 
@@ -151,25 +166,25 @@
     \ifx\shijuan\my at temp@c\renewcommand{\shijuan}{D}\fi
   \fi
   \noindent
-  \begin{tabu}{|@{}X@{}|}
+  \begin{tabularx}{\linewidth}{|@{}X@{}|}
     \hline\renewcommand{\arraystretch}{1.5}%
-    \begin{tabu}{@{}>{\bfseries}l@{}|@{}X@{}|@{}l@{}}
+    {\begin{tabularx}{\linewidth}{@{}>{\bfseries}l@{}|@{}X@{}|@{}l@{}}
       \begin{tabular}{l}教\\ 师\\ 填\\ 写\end{tabular} & \head at table@a & \head at table@b
-    \end{tabu}\\
+    \end{tabularx}}\\
     \hline\renewcommand{\arraystretch}{0.9}%
-    \begin{tabu}{@{}>{\bfseries}l@{}|@{}X@{}}
+    {\begin{tabularx}{\linewidth}{@{}>{\bfseries}l@{}|@{}X@{}}
       \begin{tabular}{l}考\\ 生\\ 填\\ 写\end{tabular} & \head at table@c
-    \end{tabu}\\
+    \end{tabularx}}\\
     \hline
-  \end{tabu}
-  \vspace{1em}
-  \noindent\begin{tabu}{|*{8}{X[c]|}}
+  \end{tabularx}
+  \par\vspace{1em}
+  \noindent\begin{tabularx}{\linewidth}{|*{8}{Y|}}
     \hline
-    \bfseries{题 号} & 一 & 二 & 三 & 四 & 五 & 六 & 总 分\\
+    \textbf{题号} & 一 & 二 & 三 & 四 & 五 & 六 & 总分\\
     \hline
-    \bfseries{得 分} &  &  &  &  &  &  & \\
+    \parbox[c][2em][c]{2.2em}{\bfseries 得分} &  &  &  &  &  &  & \\
     \hline
-  \end{tabu}
+  \end{tabularx}
 }
 
 %% ---------------------------------------------------------------------------
@@ -218,6 +233,7 @@
 \xdef\allproblems{}
 \xdef\lastproblem{}
 \newcounter{problem}
+\newcommand{\solutionname}{解}
 \newcounter{choice} % 后面选择题的 abcd 环境要用到
 \newcounter{step}   % 后面解答题的 \step 命令要用到
 
@@ -228,14 +244,14 @@
     \setcounter{problem}{0}%
     \stepcounter{section}%
     \vspace{1em}%
-    \noindent\begin{tabu}{|X[c]|X[c]|X[6]}
+    \noindent\begin{tabularx}{\linewidth}{|n{1.7cm}|n{1.7cm}|X}
       \cline{1-2}
       得分 & 评阅人 & \textbf{\Chinese{section}、#1}\\
       \cline{1-2}
       &  & (#2) \\
       \cline{1-2}
-    \end{tabu}
-    \vspace{1em}
+    \end{tabularx}
+    \par\vspace{1em}
 }
 
 \newcommand{\makedata}[1]{%
@@ -249,11 +265,11 @@
 
 \newenvironment{problemreal}{%
   \stepcounter{problem}\setcounter{choice}{0}\setcounter{step}{0}%
-  \textsf{\color{blue}\arabic{problem}}.\;\,\ignorespaces
+  \textbf{\textsf{{\color{blue}\arabic{problem}}.}}\;\,\ignorespaces
 }{\par}
 \newenvironment{solutionreal}{%
   \setcounter{step}{0}%
-  \textsf{\color{blue}解答}\quad\ignorepars
+  \textbf{\textsf{{\color{blue}\solutionname}.}}\;\,\ignorepars
 }{\par}
 
 \let \oldnewpage   = \newpage
@@ -373,15 +389,16 @@
 
 \newcommand{\answertable}[3][1em]{%
   答题须知:本题答案必须写在如下表格中,否则不给分.\par
-  \begin{tabu}{|c|*{#3}{X[c]|}}
+  \begin{tabularx}{\linewidth}{|c|*{#3}{Y|}}
     \hline
     \answer at lines{#1}{#2}{#3}
-  \end{tabu}%
+  \end{tabularx}%
   \par\vspace{0.8em}%
 }
 
 %% ---------------------------------------------------------------------------
 %% 答案切换命令 \answer
+%% 判断命令 \true 和 \false
 %% 填空命令 \fillin 和 \fillout
 %% 选择命令 \pickin 和 \pickout
 %% 四个选项排版环境 abcd,根据四个选项的长度自动排成一行、两行或四行
@@ -389,11 +406,14 @@
 
 \newcommand{\answer}[1]{\ifanswer#1\else\phantom{#1}\fi}
 
+\newcommand{\cdotfill}{\leavevmode\xleaders\hbox to 0.5em{\hss$\cdot$\hss}\hfill\kern0pt\relax}
+\newcommand{\true}{\unskip\nobreak\cdotfill(\makebox[1.5em]{\color{blue}\answer{$\checkmark$}})}
+\newcommand{\false}{\unskip\nobreak\cdotfill(\makebox[1.5em]{\color{blue}\answer{\sffamily x}})}
+
 \newcommand{\ulinefill}[1]{\xleaders\hbox{\underline{\vphantom{#1}\kern1pt}}\hfill\kern0pt}
 \newcommand{\fillout}[1]{\allowbreak\hbox{}\nobreak\ulinefill{#1}\underline{\color{blue}\answer{#1}}\ulinefill{#1}}
 \newcommand{\fillin}[1]{\underline{\hspace{1em}\color{blue}\answer{#1}\hspace{1em}}}
 
-\newcommand{\cdotfill}{\leavevmode\xleaders\hbox to 0.5em{\hss$\cdot$\hss}\hfill\kern0pt\relax}
 \newcommand{\pickout}[1]{\unskip\nobreak\cdotfill(\makebox[1.5em]{\color{blue}\answer{#1}})}
 \newcommand{\pickin}[1]{\unskip\nobreak\hspace{0.3em}(\makebox[1.5em]{\color{blue}\answer{#1}})\hspace{0.3em}\ignorespaces}
 
@@ -431,11 +451,6 @@
   \fi
 }
 
-%\newcommand{\my at item}{\ifnum\value{choice}=0\par\fi\stepcounter{choice}}
-%\newcommand{\fullitem}[1]{\my at item\parbox{\linewidth}{(\Alph{choice})\ #1\rule[-0.5em]{0pt}{0.5em}}\hfill\ignorespaces}
-%\newcommand{\halfitem}[2][0.5]{\my at item\makebox[#1\linewidth][l]{(\Alph{choice})\ #2}\hfill\ignorespaces}
-%\newcommand{\quaritem}[2][0.25]{\my at item\makebox[#1\linewidth][l]{(\Alph{choice})\ #2}\hfill\ignorespaces}
-
 %% ---------------------------------------------------------------------------
 %% 解答题步骤命令 \step
 %% ---------------------------------------------------------------------------
@@ -442,10 +457,80 @@
 
 \newcommand{\step}{%
   \stepcounter{step}%
-  \makebox[2em][l]{\ttfamily(\arabic{step})}%
+  \textsf{(\arabic{step})}\;\,%
 }
 
 %% ---------------------------------------------------------------------------
+%% 自由对齐命令 \tabpoint, \tabto, \tableft
+%% 命令 \tabpoint 记录当前的水平位置,也可以简写为 \?
+%% 命令 \tabto 跳到之前记录的位置,也可以简写为 \+
+%% 命令 \tableft 跳到之前记录的位置的左侧,也可以简写为 \<
+%% 这些自由对齐命令需要编译两次才能生效
+%% ---------------------------------------------------------------------------
+
+\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 at alignment@offset{}
+
+\def\my at alignment@list{}
+\forcsvlist{\listadd\my at alignment@list}{=,<,>,\le,\ge,\leq,\geq,\approx}
+
+\newlength{\my at alignment@kern}
+
+\newcommand*{\my at alignment@check}[1]{%
+  \ifx\my at let@token #1%
+    \def\my at alignment@offset{5}%
+    \listbreak
+  \fi
+}
+
+\newcommand{\my at alignment@next}{%
+  \ifdefempty{\my at alignment@offset}{%
+    \def\my at alignment@offset{0}%
+    \forlistloop{\my at alignment@check}{\my at alignment@list}%
+  }{}%
+  \settowidth{\my at alignment@kern}{$\mkern\my at alignment@offset mu$}%
+  \stepcounter{saveposcnt}%
+  \rlap{\kern\my at alignment@kern\zsaveposx{\thesaveposcnt}}%
+}
+
+\newcommand*{\tabpoint}[1][]{%
+  \leavevmode
+  \def\my at alignment@offset{#1}%
+  \futurelet\my at let@token\my at alignment@next
+}
+\let \? = \tabpoint
+
+\newcommand*{\tabto}{%
+  \stepcounter{useposcnt}%
+  \zsaveposx{\theuseposcnt}%
+  \noindent
+  \hskip\zposx{\thesaveposcnt}sp\relax
+  \hskip-\zposx{\theuseposcnt}sp\relax
+  \ignorespaces
+}
+\let \+ = \tabto
+
+\newcommand*{\tableft}{%
+  \settowidth{\my at alignment@kern}{$=\mkern5mu$}%
+  \stepcounter{useposcnt}%
+  \zsaveposx{\theuseposcnt}%
+  \noindent
+  \hskip\zposx{\thesaveposcnt}sp\relax
+  \hskip-\zposx{\theuseposcnt}sp\relax
+  \hskip-\my at alignment@kern
+  \ignorespaces
+}
+\let \< = \tableft
+
+%% ---------------------------------------------------------------------------
 %% 评分命令 \score
 %% ---------------------------------------------------------------------------
 
@@ -467,6 +552,14 @@
 }
 
 %% ---------------------------------------------------------------------------
+%% 文档选项 display 将全部公式都设为展示公式
+%% 命令 \display 将当前环境的公式都设为展示公式
+%% ---------------------------------------------------------------------------
+
+\newcommand{\display}{\everymath\expandafter{\the\everymath\displaystyle}}
+\ifbool{display}{\display}{}
+
+%% ---------------------------------------------------------------------------
 %% 载入个人定制文件 jnuexam.cfg
 %% 中文字体切换选项 sourcehan
 %% ---------------------------------------------------------------------------
@@ -526,6 +619,7 @@
 \RequirePackage{CJKfntef}
 \RequirePackage{multirow}
 \RequirePackage{diagbox}
+\RequirePackage{tabu}
 
 \RequirePackage{relsize}
 \newcommand{\Int}{\mathop{\mathlarger{\int}}}
@@ -557,9 +651,15 @@
   \renewrobustcmd{\d}{\ifbool{mmode}{\diff}{\oldd}}%
 }
 
-\newcommand{\va}{\vec{a\vphantom{b}}}
+% 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\vphantom{b}}}
+\newcommand{\vc}{\vec{c}}
 \newcommand{\vd}{\vec{d}}
 \newcommand{\ve}{\vec{e}}
 \newcommand{\vi}{\vec{i}}



More information about the tex-live-commits mailing list