summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-11-21 21:59:30 +0000
committerKarl Berry <karl@freefriends.org>2018-11-21 21:59:30 +0000
commit228e5563a08cef3526d4f4a9b744ce328d243797 (patch)
treed59ba53751f7b2d4c569fa2cc30d8868e7cdda38 /Master/texmf-dist
parent9e976587f069902490e28823c0fb71edfb087d0f (diff)
jnuexam (21nov18)
git-svn-id: svn://tug.org/texlive/trunk@49212 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-a-a3input.pdfbin99233 -> 111416 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-a-a3split.pdfbin93229 -> 103007 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-a-empty.pdfbin85514 -> 100412 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-a.pdfbin104049 -> 118234 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-a.tex376
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-b-a3input.pdfbin99282 -> 111285 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-b-a3split.pdfbin93290 -> 102968 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-b-empty.pdfbin85581 -> 100270 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/exam-b.pdfbin104102 -> 118116 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/jnuexam.pdfbin58421 -> 65809 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jnuexam/jnuexam.tex125
-rw-r--r--Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls376
12 files changed, 561 insertions, 316 deletions
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3input.pdf b/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3input.pdf
index 07ffbc87672..5c185d3fc7d 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3input.pdf
+++ b/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3input.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3split.pdf b/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3split.pdf
index fa25ce6e1b1..f17c0ce2e38 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3split.pdf
+++ b/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3split.pdf
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
index e7d5030af6f..846854d86dc 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-a-empty.pdf
+++ b/Master/texmf-dist/doc/latex/jnuexam/exam-a-empty.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-a.pdf b/Master/texmf-dist/doc/latex/jnuexam/exam-a.pdf
index 257501b8496..c57592e6754 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-a.pdf
+++ b/Master/texmf-dist/doc/latex/jnuexam/exam-a.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-a.tex b/Master/texmf-dist/doc/latex/jnuexam/exam-a.tex
index 98ff78f9e60..44bc600fae0 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-a.tex
+++ b/Master/texmf-dist/doc/latex/jnuexam/exam-a.tex
@@ -4,15 +4,12 @@
%\answerfalse %不显示答案
-\setlength\arraycolsep{4pt}
-\newcommand{\cov}{\operatorname{cov}}
-
\begin{document}
\renewcommand{\niandu}{2017--2018}
\renewcommand{\xueqi}{2}
\renewcommand{\kecheng}{大学数学}
-\renewcommand{\zhuanye}{理工~4~学分} % 可以为空白
+\renewcommand{\zhuanye}{理工四学分} % 可以为空白
\renewcommand{\jiaoshi}{张三,李四,王五} % 教师姓名
\renewcommand{\shijian}{2018~年~06~月~28~日}
\renewcommand{\bixiu}{1} % 1 为必修,0 为选修
@@ -23,184 +20,193 @@
\makehead % 生成试卷表头
-\makepart{填空题}{共~8~小题,每小题~2~分,共~16~分}
-
-\newpageb % B卷分页点
-
-\begin{problem}
-已知二阶行列式 $\text{$\left|\begin{array}{cc}
- 1 & 2\\
- - 3 & x
-\end{array}\right|$=0}$,则 $x=$ \fillout{$-6$}。
-\end{problem}
-
-\vfill
+\makepart{填空题}{共~6~小题,每小题~3~分,共~18~分}
-\begin{problem}
-五阶行列式的一共有 \fillout{$120$} 项。
-\end{problem}
+\answertable[3em]{6}{3} % 生成答题栏:行高3em,总共6题,每行3题
-\vfill
+\newpageb % B卷分页点
\begin{problem}
-向量组 $\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$}。
+设常数$k>0$,函数$f(x)=\ln x-\dfrac{x}{\e}+k$在$(0,+\infty)$内零点的个数为 \fillout{$2$}.
\end{problem}
\vfill
\begin{problem}
-已知$P(A)=0.3$, $P(B|A)=0.4$, $P(B|\bar{A})=0.5$, 则$P(B)=$ \fillout{$0.47$}。
+设$\va=(2,1,2)$,$\vb=(4,-1,10)$,$\vc=\vb-\lambda\va$,且$\va\bot\vc$,则$\lambda=$ \fillout{$3$}.
\end{problem}
\vfill
\begin{problem}
-已知连续型$\xi$的密度函数为$\varphi(x)=\left\{
-\begin{array}{ll}
- k \cos x, & - \frac{\pi}{2} < x < \frac{\pi}{2}\\
- 0, & \text{其它}
-\end{array}\right.$,
-则$k=$ \fillout{$\frac{1}{2}$}。
+已知二阶行列式 $\text{$\left|\begin{array}{cc}
+ 1 & 2\\
+ - 3 & x
+\end{array}\right|$=0}$,则 $x=$ \fillout{$-6$}.
\end{problem}
\vfill
\begin{problem}
-已知随机变量$\xi$的期望和方差各为$E\xi=3, D\xi=2$, 则$E\xi^2=$ \fillout{$11$}。
+向量组 $\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}
\vfill
\begin{problem}
-电子管寿命$\xi$满足平均寿命为$1000$小时的指数分布,则它的寿命小于$2000$小时概率为 \fillout{$1-e^{-2}$}。
+已知随机变量$\xi$的期望和方差各为$E\xi=3, D\xi=2$, 则$E\xi^2=$ \fillout{$11$}.
\end{problem}
\vfill
\begin{problem}
-已知$\xi$和$\eta$相互独立且$\xi\sim N(1,4), \eta\sim N(2,5)$,则$\xi-2\eta\sim$ \fillout{$N(-3,24)$}。
+已知$\xi$和$\eta$相互独立且$\xi\sim N(1,4), \eta\sim N(2,5)$,则$\xi-2\eta\sim$ \fillout{$N(-3,24)$}.
\end{problem}
\vfill
\newpagea % A卷分页点
-\makepart{单选题}{共~8~小题,每小题~2~分,共~16~分}
+\makepart{单选题}{共~6~小题,每小题~3~分,共~18~分}
+
+\answertable{6}{6} % 生成答题栏:默认行高,总共8题,每行8题
\newpageb % B卷分页点
\begin{problem}
-下列各排列哪个是偶排列 \pickout{D}
-\quaritem{$3712456$}
-\quaritem{$36715284$}
-\quaritem{$654321$}
-\quaritem{$41253$}
+在下列等式中,正确的结果是\pickout{C}
+\begin{abcd}
+\item $\int f'(x)\dx=f(x)$
+\item $\int \d f(x)=f(x)$
+\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}
-\vfill
+\bigskip
\begin{problem}
-若三阶行列式 $\left|\begin{array}{ccc}
- a_1 & a_2 & a_3\\
- 2 b_1 - a_1 & 2 b_2 - a_2 & 2 b_3 - a_3\\
- c_1 & c_2 & c_3
-\end{array}\right| = 2$,则 $\left|\begin{array}{ccc}
- a_1 & a_2 & a_3\\
- b_1 & b_2 & b_3\\
- c_1 & c_2 & c_3
-\end{array}\right|=$ \pickout{A}
-\quaritem{$1$}
-\quaritem{$-1$}
-\quaritem{$2$}
-\quaritem{$-2$}
+假设$F(x)$是连续函数$f(x)$的一个原函数,则必有\pickout{A}
+\begin{abcd}
+\item $F(x)$是偶函数 $\Leftrightarrow$ $f(x)$是奇函数
+\item $F(x)$是奇函数 $\Leftrightarrow$ $f(x)$是偶函数
+\item $F(x)$是周期函数 $\Leftrightarrow$ $f(x)$是周期函数
+\item $F(x)$是单调函数 $\Leftrightarrow$ $f(x)$是单调函数
+\end{abcd}
\end{problem}
-\vfill
+\bigskip
\begin{problem}
-已知矩阵 $A = \left(\begin{array}{ccc}
+设矩阵 $A = \left(\begin{array}{ccc}
1 & 1 & 0\\
1 & x & 0\\
0 & 0 & 1
\end{array}\right)$ 其中两个特征值为 $\lambda_1 = 1$ 和 $\lambda_2
= 2$,则 $x=$ \pickout{B}
-\quaritem{$2$}
-\quaritem{$1$}
-\quaritem{$0$}
-\quaritem{$-1$}
+\begin{abcd}
+\item $2$
+\item $1$
+\item $0$
+\item $-1$
+\end{abcd}
\end{problem}
-\vfill
+\bigskip
\begin{problem}
二次型 $f = 4 x_1^2 - 2 x_1 x_2 + 6 x_2^2$ 对应的矩阵等于 \pickout{C}
-\quaritem{$\left(\begin{array}{cc}
+\begin{abcd}
+\item $\left(\begin{array}{cc}
4 & - 2\\
- 2 & 6
-\end{array}\right)$}
-\quaritem{$\left(\begin{array}{cc}
+\end{array}\right)$
+\item $\left(\begin{array}{cc}
2 & - 2\\
- 2 & 3
-\end{array}\right)$}
-\quaritem{$\left(\begin{array}{cc}
+\end{array}\right)$
+\item $\left(\begin{array}{cc}
4 & - 1\\
- 1 & 6
-\end{array}\right)$}
-\quaritem{$\left(\begin{array}{cc}
+\end{array}\right)$
+\item $\left(\begin{array}{cc}
2 & - 1\\
- 1 & 3
-\end{array}\right)$}
+\end{array}\right)$
+\end{abcd}
\end{problem}
-\vfill
+\bigskip
\begin{problem}
-对任何一个本校男学生,以$A$表示他是大一学生,$B$表示他是大二学生,则事件$A$和$B$是\pickout{B}
-\halfitem{对立事件}
-\halfitem{互斥事件}
-\halfitem{既是对立事件又是互斥事件}
-\halfitem{不是对立事件也不是互斥事件}
+下列说法\CJKunderline{不正确}的是\pickout{B}
+\begin{abcd}
+\item 大数定律说明了大量相互独立且同分布的随机变量的均值的稳定性
+\item 大数定律说明大量相互独立且同分布的随机变量的均值近似于正态分布
+\item 中心极限定理说明了大量相互独立且同分布的随机变量的和的稳定性
+\item 中心极限定理说明大量相互独立且同分布的随机变量的和近似于正态分布
+\end{abcd}
\end{problem}
-\vfill
+\bigskip
\begin{problem}
-下列说法\CJKunderline{不正确}的是\pickout{B}
-\fullitem{大数定律说明了大量相互独立且同分布的随机变量的均值的稳定性}
-\fullitem{大数定律说明大量相互独立且同分布的随机变量的均值近似于正态分布}
-\fullitem{中心极限定理说明了大量相互独立且同分布的随机变量的和的稳定性}
-\fullitem{中心极限定理说明大量相互独立且同分布的随机变量的和近似于正态分布}
+对总体$X$和样本$(X_1,\cdots,X_n)$的说法哪个是\CJKunderline{不正确}的\pickout{D}
+\begin{abcd}
+\item 总体是随机变量
+\item 样本是$n$元随机变量
+\item $X_1, \cdots, X_n$相互独立
+\item $X_1 = X_2 =\cdots = X_n$
+\end{abcd}
\end{problem}
-\vfill
+\bigskip
+
+\newpagea % A卷分页点
+
+\makepart{计算题}{共~6~小题,每小题~8~分,共~48~分}
+
+\newpageb % B卷分页点
\begin{problem}
-在数理统计中,对总体$X$和样本$(X_1,\cdots,X_n)$的说法哪个是\CJKunderline{不正确}的\pickout{D}
-\halfitem{总体是随机变量}
-\halfitem{样本是$n$元随机变量}
-\halfitem{$X_1, \cdots, X_n$相互独立}
-\halfitem{$X_1 = X_2 =\cdots = X_n$}
+求不定积分$\displaystyle\int\e^{2x}\,(\tan x+1)^2\dx$。
\end{problem}
+\bigskip
+
+\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}
+\end{solution}
+
\vfill
\begin{problem}
-样本平均数$\bar{X}$\CJKunderline{未必是}总体期望值$\mu$的\pickout{A}
-\quaritem{最大似然估计}
-\quaritem{有效估计}
-\quaritem{一致估计}
-\quaritem{无偏估计}
+求过点$A(1,2,-1), B(2,3,0),C(3,3,2)$ 的三角形$\triangle ABC$ 的面积和它们确定的平面方程.
\end{problem}
-\vfill
+\bigskip
-\newpagea % A卷分页点
+\begin{solution}
+由题设$\overrightarrow{AB}=(1,1,1),\overrightarrow{AC}=(2,1,3)$, \score{2}
+故$\overrightarrow{AB}\times \overrightarrow{AC}=\begin{vmatrix}
+\vec{i}&\vec{j} &\vec{k}\\
+1&1&1\\
+2&1&3\\
+\end{vmatrix}=(2,-1,-1)$, \score{4}
+三角形$\triangle ABC$ 的面积为$S_{\triangle ABC}=\dfrac{1}{2}\big|\overrightarrow{AB}\times
+\overrightarrow{AC}\big|=\dfrac{1}{2}\sqrt{6}.$ \score{6}
+所求平面的方程为$2(x-2)-(y-3)-z=0$, 即$2x-y-z-1=0$ \score{8}
+\end{solution}
-\makepart{计算题}{共~6~小题,每小题~8~分,共~48~分}
+\vfill
-\newpageb % B卷分页点
+\newpage % A,B卷共同分页点
\begin{problem}
计算四阶行列式 $A = \left|\begin{array}{cccc}
@@ -208,7 +214,7 @@
1 & 2 & 3 & 0\\
2 & 3 & 0 & 1\\
3 & 0 & 1 & 2
-\end{array}\right|$ 的值。
+\end{array}\right|$ 的值.
\end{problem}
\bigskip
@@ -228,205 +234,115 @@ $A = \left|\begin{array}{cccc}
1 & 2 & 3\\
- 1 & - 6 & 1\\
- 6 & - 8 & 2
- \end{array}\right|$ \dotfill 4分\par
-\qquad\qquad $= -\left|\begin{array}{ccc}
+ \end{array}\right|$ \score{4}
+\qquad $= -\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$ \dotfill 8分
+ \end{array}\right| = -(-4\cdot20-4\cdot4) = 96$ \score{8}
\end{solution}
\vfill
\begin{problem}
用配方法将二次型 $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$ 。
+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}
\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\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\qquad$= (x_1 + x_2 - 3 x_3)^2 + x_2^2 - 6 x_2 x_3$ \dotfill 3分 \par
-\qquad\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\qquad$= (x_1 + x_2 - 3 x_3)^2 + (x_2 - 3 x_3)^2 - 9 x_3^2$ \dotfill 6分\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}
令$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$为标准形。\dotfill 8分
+则$f = y_1^2 + y_2^2 - 9y_3^2$为标准形.\score{8}
\end{solution}
\vfill
-\newpage
+\newpage % A,B卷共同分页点
\begin{problem}
-设二元随机变量$(\xi, \eta)$的联合分布表为
-\begin{tabular}{|l|l|l|l|}
- \hline
- $\xi \backslash \eta$ & -1 & 0 & 1\\
- \hline
- 0 & 0 & 1/3 & 0\\
- \hline
- 1 & 1/3 & 0 & 1/3\\
- \hline
-\end{tabular}。\par
-(1) 求关于$\xi$和$\eta$的边缘分布。\par
-(2) 判断$\xi$和$\eta$的独立性。\par
-(3) 判断$\xi$和$\eta$的相关性。
+设每发炮弹命中飞机的概率是0.2且相互独立,现在发射100发炮弹.\par
+\step 用切贝谢夫不等式估计命中数目$\xi$在10发到30发之间的概率.\par
+\step 用中心极限定理估计命中数目$\xi$在10发到30发之间的概率.
\end{problem}
\bigskip
\begin{solution}
-(1) 边缘分布为 \begin{tabular}{|l|l|l|}
- \hline
- $\xi$ & 0 & 1\\
- \hline
- $P$ & 1/3 & 2/3\\
- \hline
-\end{tabular}, \ \begin{tabular}{|l|l|l|l|}
- \hline
- $\eta$ & -1 & 0 & 1\\
- \hline
- $P$ & 1/3 & 1/3 & 1/3\\
- \hline
-\end{tabular}. \dotfill 2分 \par
-(2) 由$P(\xi = 0, \eta = 0) = \frac{1}{3} \neq \frac{1}{9} = P(\xi = 0) P(\eta = 0)$,
-知$\xi$和$\eta$不独立. \dotfill 4分 \par
-(3) 由联合分布表求得$\xi \eta$的分布为 \begin{tabular}{|l|l|l|l|}
- \hline
- $\xi \eta$ & -1 & 0 & 1\\
- \hline
- $P$ & 1/3 & 1/3 & 1/3\\
- \hline
-\end{tabular}.\dotfill 6分\par
-因此有 $\cov(\xi, \eta) = E(\xi\eta) - E\xi E\eta = 0 -\frac{2}{3} \cdot 0 = 0$,
-因此$\xi$和$\eta$不相关. \dotfill 8分
+$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 - \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}
\end{solution}
\vfill
\begin{problem}
-设随机变量$\xi \sim N (1, 4)$,求$P (- 1 < \xi < 5)$。
+从正态总体$N(\mu,\sigma^2)$中抽出样本容量为16的样本,算得其平均数为3160,标准差为100.
+试检验假设$H_0:\mu=3140$是否成立($\alpha = 0.01$).
\end{problem}
\bigskip
\begin{solution}
-$P(-1<\xi<5) = \Phi_0\left(\frac{5-1}{2}\right) - \Phi_0\left(\frac{-1-1}{2}\right)$ \dotfill 2分 \par
-\qquad $= \Phi_0 (2) - \Phi_0 (- 1)$ \dotfill 4分 \par
-\qquad $= \Phi_0 (2) + \Phi_0 (1) - 1$ \dotfill 6分 \par
-\qquad $= 0.9773 + 0.8413 - 1 = 0.8186$ \dotfill 8分
+\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}
\end{solution}
\vfill
-\newpage % A,B卷共同分页点
+\newpagea % A卷分页点
+
+\makepart{证明题}{共~2~小题,每小题~8~分,共~16~分}
\begin{problem}
-设每发炮弹命中飞机的概率是0.2且相互独立,现在发射100发炮弹。\par
-(1) 用切贝谢夫不等式估计命中数目$\xi$在10发到30发之间的概率。\par
-(2) 用中心极限定理估计命中数目$\xi$在10发到30发之间的概率。
+设数列$\{x_n\}$满足$x_1=\sqrt2$,$x_{n+1}=\sqrt{2+x_n}$.证明数列收敛,并求出极限.
\end{problem}
\bigskip
\begin{solution}
-$E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$. \dotfill 2分 \par
-(1) $P (10 < \xi < 30) = P (| \xi - E \xi | < 10) \geq 1 - \frac{D\xi}{10^2}
- = 1 - \frac{16}{100} = 0.84$. \dotfill 4分 \par
-(2) $P (10 < \xi < 30) \approx \Phi_0 \left( \frac{30 - 20}{\sqrt{16}}\right)
- - \Phi_0 \left( \frac{10 - 20}{\sqrt{16}} \right)$ \dotfill 6分\par
-\qquad $= 2 \Phi_0 (2.5) - 1 = 2 \cdot 0.9938 - 1 =0.9876$ \dotfill 8分
+\step 事实上,由于$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$,对递推公式两边同时取极限得到
+$$A=\sqrt{2+A}.$$
+解得$A=2$,即数列$\{x_n\}$的极限为$2$.\score{8}
\end{solution}
\vfill
\begin{problem}
-从正态总体$N(\mu,\sigma^2)$中抽出样本容量为16的样本,算得其平均数为3160,标准差为100。
-试检验假设$H_0:\mu=3140$是否成立($\alpha = 0.01$)。
+设事件$A$和$B$相互独立,证明$A$和$\bar{B}$相互独立.
\end{problem}
\bigskip
\begin{solution}
-(1) 待检假设 $H_0 : \mu = 3140$. \dotfill 1分\par
-(2) 选取统计量 $T = \frac{\bar{X}-\mu}{S / \sqrt{n}} \sim t(n-1)$. \dotfill 3分 \par
-(3) 查表得到 $t_{\alpha} = t_{\alpha} (n - 1) = t_{0.01} (15) =2.947$. \dotfill 5分 \par
-(4) 计算统计值 $t = \frac{\bar{x} - \mu_0}{s/\sqrt{n}} =\frac{3160-3140}{100/4} = 0.8$.\dotfill 7分 \par
-(5) 由于 $| t | < t_{\alpha}$, 故接受 $H_0$, 即假设成立. \dotfill 8分
+$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}
\end{solution}
\vfill
-\newpagea % A卷分页点
-
-\makepart{证明题}{共~2~小题,每小题~10~分,共~20~分}
-
-\begin{problem}
-不使用矩阵可相似对角化的判别定理,直接用矩阵的运算和性质证明下面的矩阵$A
-=\left(\begin{array}{cc}
- 1 & 1\\
- 0 & 1
-\end{array}\right)$不能相似对角化,即不存在可逆矩阵$P$和对角阵$\Lambda$使得$P^{-1}AP=\Lambda$。
-\end{problem}
-
-\bigskip
-
-\begin{proof}
-假设有$P = \left(\begin{array}{cc}
- a & b\\
- c & d
-\end{array}\right)$使得$P^{-1}AP = \Lambda$,即$AP=P\Lambda$。\dotfill 2分\par
-则有 $$\left(\begin{array}{cc}
- a + c & b + d\\
- c & d
-\end{array}\right) = \left(\begin{array}{cc}
- 1 & 1\\
- 0 & 1
-\end{array}\right) \left(\begin{array}{cc}
- a & b\\
- c & d
-\end{array}\right) = \left(\begin{array}{cc}
- a & b\\
- c & d
-\end{array}\right) \left(\begin{array}{cc}
- \lambda_1 & \\
- & \lambda_2
-\end{array}\right) = \left(\begin{array}{cc}
- a \lambda_1 & b \lambda_2\\
- c \lambda_1 & d \lambda_2
-\end{array}\right)$$ 因此有 $\left\{ \begin{array}{llll}
- a + c & = & a \lambda_1 & (1)\\
- b + d & = & b \lambda_2 & (2)\\
- c & = & c \lambda_1 & (3)\\
- d & = & d \lambda_2 & (4)
-\end{array} \right.$ \dotfill 6分\par
-由第1个和第3个方程消去$\lambda_1$,可以得到 $c^2 = 0$ 即 $c=0$;
-由第2个和第4个方程消去$\lambda_2$,可以得到 $d^2 = 0$ 即 $d=0$。
-因此矩阵$P$不可逆,矛盾。\dotfill 10分
-\end{proof}
-
-\vfill
-
-\begin{problem}
-设事件$A$和$B$相互独立,证明$A$和$\bar{B}$相互独立。
-\end{problem}
-
-\bigskip
-
-\begin{proof}
-$P (A \cdot \bar{B}) = P (A - B) = P (A - A B)$ \dotfill 3分 \par
-\qquad $= P (A) - P (A B) = P (A) - P (A) P (B)$ \dotfill 6分 \par
-\qquad $= P (A) (1 - P (B)) = P (A) P (\bar{B})$ \dotfill 9分 \par
-所以$A$和$\bar{B}$相互独立。\dotfill 10分
-\end{proof}
-
-\vfill
-
\makedata{一些可能用到的数据} %附录数据
\begin{tabu}{*{4}{X[l,$]}}
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3input.pdf b/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3input.pdf
index 802078ba532..9b0fd8d18df 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3input.pdf
+++ b/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3input.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3split.pdf b/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3split.pdf
index a5b6210be3f..c224b9ab33d 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3split.pdf
+++ b/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3split.pdf
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
index de89c6040b2..1b27aa32c81 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-b-empty.pdf
+++ b/Master/texmf-dist/doc/latex/jnuexam/exam-b-empty.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/exam-b.pdf b/Master/texmf-dist/doc/latex/jnuexam/exam-b.pdf
index 9d135f741c8..8a378a7e3d8 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/exam-b.pdf
+++ b/Master/texmf-dist/doc/latex/jnuexam/exam-b.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jnuexam/jnuexam.pdf b/Master/texmf-dist/doc/latex/jnuexam/jnuexam.pdf
index b227653ac19..79517e4623c 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 35bdcafe375..f41fb784f6c 100644
--- a/Master/texmf-dist/doc/latex/jnuexam/jnuexam.tex
+++ b/Master/texmf-dist/doc/latex/jnuexam/jnuexam.tex
@@ -9,8 +9,23 @@
\usepackage{listings}
\usepackage{tabu}
-\setCJKsansfont{SimHei}
-\setCJKmonofont{SimHei}
+\makeatletter
+
+\providecommand{\beamer@endinputifotherversion}[1]{}
+
+\ifxetex
+ \setCJKsansfont{SimHei} % fix for ctex 2.0
+ \setCJKmonofont{SimHei}
+ \renewcommand\CJKfamilydefault{\CJKsfdefault}%
+\else
+ \@ifpackagelater{ctex}{2014/03/01}{}{\AtBeginDocument{\heiti}} %无效?
+\fi
+
+\makeatother
+
+\renewcommand{\baselinestretch}{1} % ctex 2.4.1 开始为 1,之前为 1.3
+\renewcommand{\arraystretch}{1.3}
+
\setlength{\parskip}{7pt plus 1pt minus 1pt}
\justifying
@@ -21,6 +36,8 @@
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}}
@@ -63,7 +80,7 @@
这个模板将格式和内容分开,而且可以从一份 \verb!tex! 文件编译出四份试卷(A卷 / B卷 / A卷答案 / B卷答案),使用方便。
\par
这个模板的最新版本可以在下面地址下载:\newline
- \url{https://lvjr.bitbucket.io/jnuexam.html}
+ \href{https://lvjr.bitbucket.io/jnuexam.html?\the\year}{https://lvjr.bitbucket.io/jnuexam.html}
\end{framex}
\begin{framex}
@@ -79,7 +96,7 @@
\begin{framex}
\frametitle{试卷结构}
-\begin{lstlisting}
+\begin{code}
\documentclass{jnuexam}
\begin{document}
......
@@ -96,12 +113,12 @@
\makedata{可能用到的数据} %附录数据
......
\end{document}
-\end{lstlisting}
+\end{code}
\end{framex}
\begin{framex}
\frametitle{试卷表头}
-\begin{lstlisting}
+\begin{code}
\renewcommand{\niandu}{2010--2011}
\renewcommand{\xueqi}{2}
\renewcommand{\kecheng}{大学数学}
@@ -114,13 +131,13 @@
\renewcommand{\neizhao}{1} % 1打勾,0不勾
\renewcommand{\waizhao}{0} % 1打勾,0不勾
\makehead %生成试卷表头
-\end{lstlisting}
+\end{code}
其中 \verb!\zhuanye! 和 \verb!\shijian! 命令的内容可以为空。
\end{framex}
\begin{framex}
\frametitle{填空题目}
-\begin{lstlisting}
+\begin{code}
\makepart{填空题}{题数分值}
\begin{problem}
@@ -130,7 +147,7 @@
\begin{problem}
第二道填空题描述\fillout{答案}。
\end{problem}
-\end{lstlisting}
+\end{code}
\verb!\fillout! 命令将用下划线填满整行。另有个 \verb!\fillin! 命令,只留下最小宽度的下划线。
\par
答案必须放在 \verb!\fillout! 或 \verb!\fillin! 命令里面;这样才能在生成空白试卷时隐藏它。
@@ -138,7 +155,7 @@
\begin{framex}
\frametitle{选择题目}
-\begin{lstlisting}
+\begin{code}
\makepart{单选题}{题数分值}
\begin{problem}
@@ -148,15 +165,44 @@
\begin{problem}
第二道单选题描述\pickout{答案}。
\end{problem}
-\end{lstlisting}
+\end{code}
\verb!\pickout! 命令将把选择圆括号放在本行最右边。另外有个 \verb!\pickin! 命令,将选择圆括号放在当前位置。
\par
答案必须放在 \verb!\pickout! 或 \verb!\pickin! 命令里面;这样才能在生成空白试卷时隐藏它。
\end{framex}
\begin{framex}
+\frametitle{选项排版}
+选择题的四个选项可以用 \verb!abcd! 环境来排版。比如:
+\begin{code}
+\begin{abcd}
+ \item 第一个选项
+ \item 第二个选项
+ \item 第三个选项
+ \item 第四个选项
+\end{abcd}
+\end{code}
+此时 \verb!abcd! 环境将根据各选项长度自动将四个选项分为一行、两行或四行排版,非常方便。
+\end{framex}
+
+
+\begin{framex}
+\frametitle{答题表格}
+在填空题和选择题前面,还可以用 \verb!\answertable! 命令生成空白答题栏。比如:
+\begin{code}
+\answertable[3em]{6}{3}
+\end{code}
+其中 \verb!\answertable! 命令的三个参数含义如下:
+\begin{itemize}
+ \item 第一个可选参数表示空白单元格的高度,默认是 \verb!1em!。
+ \item 第二个必选参数表示总共有多少个题目。
+ \item 第三个必选参数表示每行排版几个题目。
+\end{itemize}
+\end{framex}
+
+\begin{framex}
\frametitle{计算题目}
-\begin{lstlisting}
+\begin{code}
\makepart{计算题}{题数分值}
\begin{problem}
@@ -172,34 +218,47 @@
\begin{solution}
第二道计算题答案。
\end{solution}
-\end{lstlisting}
+\end{code}
\end{framex}
\begin{framex}
\frametitle{证明题目}
-\begin{lstlisting}
+\begin{code}
\makepart{证明题}{题数分值}
\begin{problem}
第一道证明题描述。
\end{problem}
-\begin{proof}
+\begin{solution}
第一道证明题答案。
-\end{proof}
+\end{solution}
\begin{problem}
第二道证明题描述。
\end{problem}
-\begin{proof}
+\begin{solution}
第二道证明题答案。
-\end{proof}
-\end{lstlisting}
+\end{solution}
+\end{code}
+\end{framex}
+
+\begin{framex}
+\frametitle{评分命令}
+计算题和证明题等主观题的排版方法是完全一样的。在编写这些主观题的解答时,
+可以用 \verb!\score! 命令给出各步骤得分。比如:
+\begin{code}
+\begin{solution}
+$1+1=2$ \score{4}
+$2+2=4$ \score{8}
+\end{solution}
+\end{code}
+评分命令 \verb!\score! 也可在 \verb!align*! 等数学环境中使用,此时评分显示在公式编号位置。
\end{framex}
\begin{framex}
\frametitle{其它题型}
除了上述四种题型之外,其它题型可以用下面方式编写:
-\begin{lstlisting}
+\begin{code}
\makepart{某题型}{题数分值}
\begin{problem}
@@ -209,17 +268,17 @@
\begin{problem}
第二题描述。\answer{第二题答案}
\end{problem}
-\end{lstlisting}
+\end{code}
其中题目答案必须放在 \verb!\answer! 命令里面;这样才能在生成空白试卷时隐藏它。
\end{framex}
\begin{framex}
\frametitle{附录数据}
在试卷最后,可以用下面命令增加附录数据部分:
-\begin{lstlisting}
+\begin{code}
\makedata{可能用到的数据} %附录数据
......
-\end{lstlisting}
+\end{code}
附录数据必须放在 \verb!\makedata! 命令后面;否则在从A卷生成B卷时会出问题。
\end{framex}
@@ -227,10 +286,10 @@
\frametitle{空白试卷}
假设 \verb!exam-a.tex! 是含答案的试卷。新建一个包含以下内容的 \verb!exam-a-empty.tex! 文档,
编译后将得到不含答案的空白试卷。
-\begin{lstlisting}
+\begin{code}
\PassOptionsToClass{noanswer}{jnuexam}
\input{exam-a}
-\end{lstlisting}
+\end{code}
也就是说,给 \verb!jnuexam! 文档类加上 \verb!noanswer! 选项后,编译时将会自动隐藏试卷答案。
\end{framex}
@@ -238,10 +297,10 @@
\frametitle{逆序出题}
假设 \verb!exam-a.tex! 是含答案的A卷。新建一个包含以下内容的 \verb!exam-b.tex! 文档,
编译后将得到逆序出题的B卷。
-\begin{lstlisting}
+\begin{code}
\PassOptionsToClass{reverse}{jnuexam}
\input{exam-a}
-\end{lstlisting}
+\end{code}
也就是说,给 \verb!jnuexam! 文档类加上 \verb!reverse! 选项后,编译时将会逆序排列各题型的小题。
\end{framex}
@@ -285,7 +344,7 @@
\begin{framex}
\frametitle{分页例子}
关于分页命令的使用,可以看下面的典型例子:
-\begin{lstlisting}
+\begin{code}
\makepart{某题型}{题型分值}
\newpageb
\begin{problem}第一题\end{problem}\vfill
@@ -294,15 +353,15 @@
\begin{problem}第三题\end{problem}\vfill
\begin{problem}第四题\end{problem}\vfill
\newpagea
-\end{lstlisting}
+\end{code}
这样编译得到的A卷就是这样的顺序:
-\begin{lstlisting}
+\begin{code}
第一题 第二题 分页 第三题 第四题 分页
-\end{lstlisting}
+\end{code}
而编译得到的B卷就是这样的顺序:
-\begin{lstlisting}
+\begin{code}
第四题 第三题 分页 第二题 第一题 分页
-\end{lstlisting}
+\end{code}
\end{framex}
\end{document}
diff --git a/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls b/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls
index 0b2b11fc4f4..e839799d0e8 100644
--- a/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls
+++ b/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls
@@ -6,15 +6,19 @@
% ----------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jnuexam}[2018/07/07 v0.3 An exam class for Jinan University]
+\ProvidesClass{jnuexam}[2018/11/21 v0.5 An exam class for Jinan University]
\newif\ifsidebyside \sidebysidefalse % 是否 A3 纸张
\newif\ifreverse \reversefalse % 是否逆序出题
\newif\ifanswer \answertrue % 是否显示答案
+\newif\ifsourcehan \sourcehanfalse % 切换思源字体
+\newif\ifcollection \collectionfalse % 用于试卷题库
\DeclareOption{a3paper}{\sidebysidetrue}
\DeclareOption{reverse}{\reversetrue}
\DeclareOption{noanswer}{\answerfalse}
+\DeclareOption{sourcehan}{\sourcehantrue}
+\DeclareOption{collection}{\collectiontrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}} %其它选项
@@ -30,6 +34,26 @@
\RequirePackage[a4paper,left=30mm,right=30mm,top=25mm,bottom=25mm]{geometry}
\fi
+\RequirePackage{tabu}
+\RequirePackage{amssymb}
+\RequirePackage{lastpage}
+\RequirePackage{fancyhdr}
+\RequirePackage{xcolor}
+\RequirePackage{comment}
+\RequirePackage{environ}
+\RequirePackage{etoolbox}
+\RequirePackage{calc}
+
+\setlength{\parindent}{0em}
+\setlength{\lineskiplimit}{3pt}
+\setlength{\lineskip}{3pt}
+
+%% ---------------------------------------------------------------------------
+%% 密封线命令 \mifengxian
+%% 草稿纸命令 \caogaozhi
+%% 这两个命令仅在 A3 纸张中用到,且需要编译两次才能得到正确结果
+%% ---------------------------------------------------------------------------
+
\newcommand{\mifengxian}{%
\def\1{\\[50mm]}\def\2{\\[15mm]}%
\begin{tikzpicture}[remember picture,overlay,very thick,font=\large]
@@ -47,18 +71,6 @@
\node[text=lightgray!40] at (current page.center) {草\quad 稿\quad 纸};
\end{tikzpicture}}
-\RequirePackage{amsmath}
-\RequirePackage{tabu}
-\RequirePackage{multirow}
-\RequirePackage{pifont}
-\RequirePackage{lastpage}
-\RequirePackage{fancyhdr}
-\RequirePackage{xcolor}
-\RequirePackage{comment}
-\RequirePackage{environ}
-\RequirePackage{etoolbox}
-\RequirePackage{CJKfntef}
-
\ifsidebyside
\RequirePackage{tikz}
\RequirePackage{everypage}
@@ -75,9 +87,9 @@
\@ifundefined{@setmarks}{\let\@setmarks\relax}{}
\fi
-\setlength{\parindent}{0em}
-\setlength{\lineskiplimit}{3pt}
-\setlength{\lineskip}{3pt}
+%% ---------------------------------------------------------------------------
+%% 试卷表头命令 \makehead
+%% ---------------------------------------------------------------------------
\newcommand{\niandu}{2016-2017}
\newcommand{\xueqi}{2}
@@ -91,12 +103,12 @@
\newcommand{\neizhao}{1} % 1 打勾,0 不勾
\newcommand{\waizhao}{1} % 1 打勾,0 不勾
-\newcommand{\underspace}[1]{\underline{\hspace{#1}}}
-\newcommand{\underbox}[2]{\underline{\makebox[#1]{#2}}}
-\newcommand{\underparbox}[2]{\underline{\parbox[b]{#1}{#2}}}
+\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\,\ding{51}\,\else\quad\fi}
-\newcommand{\isquad}[1]{\ifnum#1=0\,\ding{51}\,\else\quad\fi}
+\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}
@@ -104,7 +116,7 @@
\newcommand{\head@table@a}{%
\begin{tabular}{l}
- \underbox{10em}{\niandu} 学年度第 \underbox{5.5em}{\xueqi} 学期 \\
+ \underbox{11em}{\niandu}学年度第\underbox{5.5em}{\xueqi}学期 \\
课程名称:\underbox{17.5em}{\kecheng\ifx\zhuanye\my@empty\else\kern0pt(\zhuanye)\fi} \\
授课教师:\underparbox{17.5em}{\centering\rule{0pt}{3ex}\jiaoshi} \\
考试时间:\underbox{17.5em}{\shijian} \\
@@ -124,8 +136,8 @@
\newcommand{\head@table@c}{%
\begin{tabular}{l}
- \underspace{10em} 学院 \underspace{8em} 专业 \underspace{5.5em}~班~(级) \\[1em]
- 姓名\underspace{8em} 学号 \underspace{10em}\hfill
+ \underspace{10em}学院\underspace{8em}专业\underspace{7.5em}班\kern0pt(\kern0pt{}级\kern0pt) \\[1em]
+ 姓名\underspace{8em}学号\underspace{10em}\hfill
\bfseries 内招~[\ischeck{\neizhao}] 外招~[\ischeck{\waizhao}] %\\[0.8em]
\end{tabular}
}
@@ -160,6 +172,10 @@
\end{tabu}
}
+%% ---------------------------------------------------------------------------
+%% 页眉页脚设定
+%% ---------------------------------------------------------------------------
+
\newcommand{\my@columnbox}[1]{\makebox[\columnwidth]{#1}}
\newcommand{\my@headleft}{暨南大学\kern-0.3em《\kecheng》\kern-0.3em 试卷\,\shijuan}
\newcommand{\my@headright}{姓名\hspace{6em}学号\hspace{6em}}
@@ -191,10 +207,19 @@
\cfoot{\small\my@foottext}
\fi
+%% ---------------------------------------------------------------------------
+%% 题型命令 \makepart
+%% 附录命令 \makedata
+%% 题目环境 problem
+%% 解答环境 solution
+%% 逆序选项 reverse
+%% ---------------------------------------------------------------------------
+
\xdef\allproblems{}
\xdef\lastproblem{}
\newcounter{problem}
-\newcounter{choice}
+\newcounter{choice} % 后面选择题的 abcd 环境要用到
+\newcounter{step} % 后面解答题的 \step 命令要用到
\newcommand{\printproblems}{\ifreverse\lastproblem\allproblems\fi\xdef\allproblems{}\xdef\lastproblem{}}
@@ -220,28 +245,16 @@
\preto{\@enddocumenthook}{\printproblems\my@stop@reverse}
-\newcommand{\answer}[1]{\ifanswer#1\else\phantom{#1}\fi}
-
-\newcommand{\ulinefill}[1]{\xleaders\hbox{\underline{\vphantom{#1}\kern1pt}}\hfill\kern0pt}
-\newcommand{\fillout}[1]{\ulinefill{#1}\underline{\color{blue}\answer{#1}}\ulinefill{#1}}
-\newcommand{\fillin}[1]{\underline{\hspace{1em}\color{blue}\answer{#1}\hspace{1em}}}
-
-\newcommand{\pickout}[1]{\hfill(\makebox[1.5em]{\color{blue}\answer{#1}})}
-\newcommand{\pickin}[1]{(\makebox[1.5em]{\color{blue}\answer{#1}})}
-
-\newcommand{\my@item}{\ifnum\value{choice}=0\par\fi\stepcounter{choice}}
-\newcommand{\fullitem}[1]{\my@item\parbox{\linewidth}{(\Alph{choice})\ #1\rule[-0.5em]{0pt}{0.5em}}\hfill\ignorespaces}
-\newcommand{\halfitem}[1]{\my@item\makebox[0.5\linewidth][l]{(\Alph{choice})\ #1}\hfill\ignorespaces}
-\newcommand{\quaritem}[1]{\my@item\makebox[0.25\linewidth][l]{(\Alph{choice})\ #1}\hfill\ignorespaces}
-
\newcommand\ignorepars{\@ifnextchar\par{\expandafter\ignorepars\@gobble}{}}
\newenvironment{problemreal}{%
- \stepcounter{problem}\setcounter{choice}{0}%
+ \stepcounter{problem}\setcounter{choice}{0}\setcounter{step}{0}%
\textsf{\color{blue}\arabic{problem}}.\;\,\ignorespaces
}{\par}
-\newenvironment{solutionreal}{\textsf{\color{blue}解答}\quad\ignorepars}{\par}
-\newenvironment{proofreal}{\textsf{\color{blue}证明}\quad\ignorepars}{\par}
+\newenvironment{solutionreal}{%
+ \setcounter{step}{0}%
+ \textsf{\color{blue}解答}\quad\ignorepars
+}{\par}
\let \oldnewpage = \newpage
\let \oldvfill = \vfill
@@ -269,14 +282,6 @@
\unexpanded{\end{solutionreal}}%
}%
}
- \NewEnviron{proof}{%
- \xdef\lastproblem{%
- \unexpanded\expandafter{\lastproblem}%
- \unexpanded{\begin{proofreal}}%
- \unexpanded\expandafter{\BODY}%
- \unexpanded{\end{proofreal}}%
- }%
- }
\renewcommand{\newpage}{\xdef\lastproblem{\noexpand\oldnewpage\unexpanded\expandafter{\lastproblem}}}
\renewcommand{\vfill}{\xdef\lastproblem{\unexpanded\expandafter{\lastproblem\oldvfill}}}
\renewcommand{\smallskip}{\xdef\lastproblem{\unexpanded\expandafter{\lastproblem\oldsmallskip}}}
@@ -287,7 +292,6 @@
\else
\newenvironment{problem}{\problemreal}{\endproblemreal}
\newenvironment{solution}{\solutionreal}{\endsolutionreal}
- \newenvironment{proof}{\proofreal}{\endproofreal}
\let \newpagea = \newpage
\let \newpageb = \relax
\fi
@@ -296,7 +300,6 @@
\ifreverse
\renewenvironment{problem}{\problemreal}{\endproblemreal}%
\renewenvironment{solution}{\solutionreal}{\endsolutionreal}%
- \renewenvironment{proof}{\proofreal}{\endproofreal}%
\let \newpage = \oldnewpage
\let \vfill = \oldvfill
\let \smallskip = \oldsmallskip
@@ -310,6 +313,273 @@
\AtBeginDocument{%
\ifanswer\else
\excludecomment{solution}
- \excludecomment{proof}
\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{tabu}{|c|*{#3}{X[c]|}}
+ \hline
+ \answer@lines{#1}{#2}{#3}
+ \end{tabu}%
+ \par\vspace{0.8em}%
+}
+
+%% ---------------------------------------------------------------------------
+%% 答案切换命令 \answer
+%% 填空命令 \fillin 和 \fillout
+%% 选择命令 \pickin 和 \pickout
+%% 四个选项排版环境 abcd,根据四个选项的长度自动排成一行、两行或四行
+%% ---------------------------------------------------------------------------
+
+\newcommand{\answer}[1]{\ifanswer#1\else\phantom{#1}\fi}
+
+\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}
+
+\newlength{\my@item@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{%
+ \par\stepcounter{choice}(\Alph{choice})\ \ignorespaces
+}
+\NewEnviron{abcd}{
+ \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}{\ifnum\value{choice}=0\par\fi\stepcounter{choice}}
+%\newcommand{\fullitem}[1]{\my@item\parbox{\linewidth}{(\Alph{choice})\ #1\rule[-0.5em]{0pt}{0.5em}}\hfill\ignorespaces}
+%\newcommand{\halfitem}[2][0.5]{\my@item\makebox[#1\linewidth][l]{(\Alph{choice})\ #2}\hfill\ignorespaces}
+%\newcommand{\quaritem}[2][0.25]{\my@item\makebox[#1\linewidth][l]{(\Alph{choice})\ #2}\hfill\ignorespaces}
+
+%% ---------------------------------------------------------------------------
+%% 解答题步骤命令 \step
+%% ---------------------------------------------------------------------------
+
+\newcommand{\step}{%
+ \stepcounter{step}%
+ \makebox[2em][l]{\ttfamily(\arabic{step})}%
+}
+
+%% ---------------------------------------------------------------------------
+%% 评分命令 \score
+%% ---------------------------------------------------------------------------
+
+\PassOptionsToPackage{tbtags}{amsmath}
+\RequirePackage{amsmath}
+
+\newcommand{\myscore}[1]{\textcolor{blue}{#1\kern0.2em 分}}
+
+\newcommand{\scoretext}[1]{\cdotfill\myscore{#1}\par\noindent\ignorespaces}
+\newcommand{\scoreeqno}[1]{\eqno{\cdots\cdots\text{\myscore{#1}}}}
+\newcommand{\scoretag}[1]{\tag*{$\cdots\cdots$\myscore{#1}}}
+
+\newrobustcmd{\score}[1]{%
+ \ifbool{mmode}{%
+ \ifdefstrequal{\tag}{\dft@tag}{\scoreeqno{#1}}{\scoretag{#1}}%
+ }{%
+ \scoretext{#1}%
+ }%
+}
+
+%% ---------------------------------------------------------------------------
+%% 载入个人定制文件 jnuexam.cfg
+%% 中文字体切换选项 sourcehan
+%% ---------------------------------------------------------------------------
+
+\InputIfFileExists{jnuexam.cfg}{}{}
+
+\newcommand{\my@set@sourcehan}{
+ \setCJKmainfont[BoldFont=Source Han Sans SC]{Source Han Serif SC}
+ \setCJKsansfont{Source Han Sans SC}
+ % 用中文字体名时 LuaTeX 找不到该字体,XeTeX 正常
+ %\setCJKmainfont[BoldFont=思源黑体]{思源宋体}
+ %\setCJKsansfont{思源黑体}
+}
+
+\ifbool{sourcehan}{
+ \RequirePackage{iftex}
+ % 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}{}
+}{}
+
+%% ---------------------------------------------------------------------------
+%% 试卷题库选项 collection
+%% ---------------------------------------------------------------------------
+
+\ifcollection
+ \RequirePackage{hyperref}
+ \hypersetup{
+ pdfstartview={FitH},
+ bookmarksnumbered=true,
+ unicode=true,
+ hidelinks=true
+ %colorlinks=true,
+ %linkcolor=black
+ }
+ \appto{\endproblem}{\medskip}
+ \appto{\endsolution}{\medskip}
+ \preto{\problem}{\ifnum\value{problem}=9 \setcounter{problem}{-1}\fi}
+ \pagestyle{plain}
+\fi
+
+%% ---------------------------------------------------------------------------
+%% 载入常用宏包,定义常用命令
+%% ---------------------------------------------------------------------------
+
+\AtBeginDocument{
+ \setlength{\abovedisplayskip}{4pt minus 2pt}
+ \setlength{\belowdisplayskip}{4pt minus 2pt}
+ \setlength{\abovedisplayshortskip}{2pt}
+ \setlength{\belowdisplayshortskip}{2pt}
+}
+
+\setlength\arraycolsep{4pt}
+
+\RequirePackage{CJKfntef}
+\RequirePackage{multirow}
+\RequirePackage{diagbox}
+
+\RequirePackage{relsize}
+\newcommand{\Int}{\mathop{\mathlarger{\int}}}
+
+\newcommand{\e}{\mathrm{e}}
+\newcommand{\limit}{\lim\limits}
+\newcommand{\R}{\mathbb{R}}
+
+\DeclareMathOperator{\Corr}{\rho}
+\DeclareMathOperator{\Cov}{Cov}
+\DeclareMathOperator{\grad}{grad}
+\DeclareMathOperator{\Prj}{Prj}
+\DeclareMathOperator{\Var}{Var}
+
+\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}}%
+}
+
+\newcommand{\va}{\vec{a\vphantom{b}}}
+\newcommand{\vb}{\vec{b}}
+\newcommand{\vc}{\vec{c\vphantom{b}}}
+\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=\}
+
+\def\T{\mathrm{T}\kern-.5pt}
+
+\newrobustcmd{\wfrac}[3][2pt]{%
+ {\begingroup\hspace{#1}#2\hspace{#1}\endgroup\over\hspace{#1}#3\hspace{#1}}%
+}
+