summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-03-11 21:14:05 +0000
committerKarl Berry <karl@freefriends.org>2023-03-11 21:14:05 +0000
commitb07ff8c82713eb8f4a519d581381555700235e46 (patch)
tree792d3a8ecff0f7f3617ce8a28382091e140006fa
parent3e43ac8f244fa3488d345bdebe8a5b5f7b583f97 (diff)
hfutexam (11mar23) (branch)
git-svn-id: svn://tug.org/texlive/branches/branch2022.final@66555 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/hfutexam/CHANGELOG.md9
-rw-r--r--Master/texmf-dist/doc/latex/hfutexam/hfutexam.pdfbin205310 -> 205967 bytes
-rw-r--r--Master/texmf-dist/doc/latex/hfutexam/hfutexam.tex50
-rw-r--r--Master/texmf-dist/doc/latex/hfutexam/hfutexam_cankaodaan.pdfbin92517 -> 94308 bytes
-rw-r--r--Master/texmf-dist/doc/latex/hfutexam/hfutexam_cankaodaan.tex4
-rw-r--r--Master/texmf-dist/doc/latex/hfutexam/hfutexam_datizhi.pdfbin70714 -> 71061 bytes
-rw-r--r--Master/texmf-dist/doc/latex/hfutexam/hfutexam_datizhi.tex51
-rw-r--r--Master/texmf-dist/doc/latex/hfutexam/hfutexam_shijuan.pdfbin95064 -> 95264 bytes
-rw-r--r--Master/texmf-dist/doc/latex/hfutexam/hfutexam_shijuan.tex25
-rw-r--r--Master/texmf-dist/doc/latex/hfutexam/hfutexam_simple.pdfbin110469 -> 112375 bytes
-rw-r--r--Master/texmf-dist/tex/latex/hfutexam/hfutexam.cls267
11 files changed, 192 insertions, 214 deletions
diff --git a/Master/texmf-dist/doc/latex/hfutexam/CHANGELOG.md b/Master/texmf-dist/doc/latex/hfutexam/CHANGELOG.md
index 6a7de473b76..1e2dd6ee648 100644
--- a/Master/texmf-dist/doc/latex/hfutexam/CHANGELOG.md
+++ b/Master/texmf-dist/doc/latex/hfutexam/CHANGELOG.md
@@ -1,5 +1,14 @@
# 更新日志
+## [1.7] - 2023/03/10
++ 精简了文档类的代码。
++ 将伪粗体权重统一设置为3以更接近Word的加粗效果。
++ 调整了标题文字的空格分布。
++ 为`\XiZhuRenQianMing`命令添加了可选参数,以调节该图像的宽度,默认为`5em`.
++ 加入了命令`\hfutstretch`,为标题中带下划线文字两侧空格长度与各分项之间空格长度的比例,默认为`1.5`.
++ 为简易模式的各个部分添加了书签。
++ 重新调整了标题的字体和位置。
+
## [1.6] - 2022/12/07
+ `\fillblank`的默认高度现在均为`0.5cm`.
diff --git a/Master/texmf-dist/doc/latex/hfutexam/hfutexam.pdf b/Master/texmf-dist/doc/latex/hfutexam/hfutexam.pdf
index a470ca1a02e..69731d6fbce 100644
--- a/Master/texmf-dist/doc/latex/hfutexam/hfutexam.pdf
+++ b/Master/texmf-dist/doc/latex/hfutexam/hfutexam.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/hfutexam/hfutexam.tex b/Master/texmf-dist/doc/latex/hfutexam/hfutexam.tex
index dc0f9769ab5..0579704f5a9 100644
--- a/Master/texmf-dist/doc/latex/hfutexam/hfutexam.tex
+++ b/Master/texmf-dist/doc/latex/hfutexam/hfutexam.tex
@@ -2,7 +2,7 @@
%% 示例所需的自定义命令
\newcommand{\diff}{\,\mathrm{d}}
-\usetikzlibrary{arrows.meta, overlay-beamer-styles}
+\usetikzlibrary{arrows.meta}
\newfontfamily\couriernew{Courier New}
\usepackage{enumitem}
\usepackage{tcolorbox}
@@ -12,11 +12,11 @@
\definecolor{lightgrey}{rgb}{0.9,0.9,0.9}
\definecolor{frenchplum}{RGB}{190,20,83}
\lstset{language=[LaTeX]TeX,
- basicstyle=\couriernew,
- texcsstyle=*\color{winered},
+ basicstyle=\couriernew\color{blue},
+ rulecolor=\color{black},
+ texcsstyle=*\color{red},
mathescape,
breaklines=true,
- keywordstyle=\color{winered},
commentstyle=\color{green!70!black},
stringstyle=\color{green!50!blue},
frame=single,
@@ -24,14 +24,14 @@
framerule=0.5pt,
columns=flexible,
backgroundcolor=\color{black!5},
- morekeywords={\diff, \maketitle, \titlesep, \BiaoTi, \XueNian, \XueQi, \KeChengDaiMa, \KeChengMingCheng, \XueFen, \KeChengXingZhi, \KaoShiXingShi, \ZhuanYeBanJi, \KaoShiRiQi, \MingTiJiaoShi, \XiZhuRenQianMing, \tigan, \scorebox, \score, \Score, \fillblank, \xx, \notice, \xuanzeti, \yihang, \erhang, \sihang, XeLaTeX},
- keywordstyle=\color{winered},
- morekeywords=[2]{hfutexam, shijuan, datizhi, cankaodaan, simple, nofangzheng, flalign, 5cm, enumerate, align},
- keywordstyle=[2]\color{blue},
+ morekeywords={\diff, \maketitle, \titlesep, \BiaoTi, \XueNian, \XueQi, \KeChengDaiMa, \KeChengMingCheng, \XueFen, \KeChengXingZhi, \KaoShiXingShi, \ZhuanYeBanJi, \KaoShiRiQi, \MingTiJiaoShi, \XiZhuRenQianMing, \tigan, \scorebox, \score, \Score, \fillblank, \xx, \notice, \xuanzeti, \yihang, \erhang, \sihang, XeLaTeX, \hfutstretch},
+ keywordstyle=\color{red},
+ % morekeywords=[2]{hfutexam, shijuan, datizhi, cankaodaan, simple, nofangzheng, flalign, 5cm, enumerate, align},
+ % keywordstyle=[2]\color{blue},
}
\tcbset{
colback=white,
- colframe=blue,
+ colframe=black,
boxrule=0.5pt,
arc=0pt,
}
@@ -56,7 +56,7 @@
\tigan{一、模板选项}
\indent
-本模板 (2022/12/07 v1.6) 旨在为将合肥工业大学试卷的 word 格式转为\LaTeX{}格式.
+本模板 (2023/03/10 v1.7) 旨在为将合肥工业大学试卷的 word 格式转为\LaTeX{}格式.
使用时, 只需在文档开头写上
\begin{lstlisting}
\documentclass[shijuan]{hfutexam}
@@ -67,10 +67,10 @@
\indent
可使用的选项为: \lstinline|shijuan| (试卷), \lstinline|datizhi| (答题纸), \lstinline|cankaodaan| (参考答案) 和 \lstinline|simple| (简易模式). 如果留空则为默认值 \lstinline|shijuan| (试卷).
\begin{enumerate}
-\item 试卷/答题纸/参考答案三个选项下页面会设置为 A3 大小, 三种情形的页眉页脚显示的内容以及标题的文字间隔有所不同.
+\item 试卷/答题纸/参考答案三个选项下页面会设置为 A3 大小的双栏模式, 相应的标题、页眉和页脚内容有所不同.
\item 简易模式选项下页面会设置为 A4 大小, 页眉页脚也较为简单. 此时需要使用命令 \lstinline|\maketitle| 来生成标题.
一般用于保存(多张)试卷的内容,或者便于打印使用.
-\item 标题默认使用方正字体, 因此请在使用前先安装字体: {\bfseries\titlesongti 方正小标宋}和{\bfseries\titlefangsong 方正仿宋}(右键选择为所有用户安装), 否则请使用选项 \lstinline|nofangzheng| (采用新宋体和仿宋代替).
+\item 标题默认使用方正字体, 因此请在使用前先安装字体: {\bfseries\hfutFontTitle 方正小标宋}和{\bfseries\hfutFontHead 方正仿宋}(右键选择为所有用户安装), 否则请使用选项 \lstinline|nofangzheng| (采用新宋体和仿宋代替).
\end{enumerate}
\tigan{二、试卷信息}
@@ -91,37 +91,38 @@
\ZhuanYeBanJi{少数民族预科班} % 专业班级, 一般不需要填写
\KaoShiRiQi{2022年6月18日8:00-10:00} % 考试日期
\MingTiJiaoShi{集体} % 命题教师
-\XiZhuRenQianMing{dengbing.png} % 系主任签名
+\XiZhuRenQianMing[5em]{dengbing.png} % 系主任签名的对应图片
\end{lstlisting}
-其中系主任签名处需要填写相应的图片名, 若不设置或设置为空则不显示.
+\indent 若不设置系主任签名或设置为空则不显示, 它的可选参数表示该图片的显示宽度, 默认为 \lstinline|5em|.
其它选项默认均为空, 可根据需要只填部分内容.
-\newpage
-\tigan{三、命令}
+\tigan{三、解答题}
\begin{enumerate}
-\item \lstinline|\tigan{三、命令}| 用于生成题干, 字体相对较大, 且为黑体. 小题建议使用~{\color{blue}\lstinline|enumerate|} 环境来生成.
+\item \lstinline|\hfutstretch{1.5}| 用于设置标题中\uline{带下划线文字两侧空格}与\uline{各分项之间空格}的宽度比, 默认为\lstinline|1.5|.
+\item \lstinline|\tigan{三、解答题}| 用于生成题干, 为14pt黑体. 小题用~{\color{blue}\lstinline|enumerate|} 环境来生成.
\item \hspace{-8mm}\scorebox\hspace{8mm}\lstinline|\scorebox| 用于生成打分框, 请放置在答题纸一行的开头使用.
\vspace{-2mm}
\item \lstinline|\notice| 用于生成答题纸提示信息, 请放置在答题纸的正文开始处.
\item 答题纸中可能需要设置一定高度的空白, 使用命令 \lstinline|\hspace{5cm}| 之类的命令即可. 也可以使用 \lstinline|\newpage| 换到新的一页(或分栏).
+\item 文档默认无缩进, 可在需要处使用命令 \lstinline|\indent| 生成.
\end{enumerate}
\tigan{填空题相关}
\begin{enumerate}[resume]
-\item \lstinline|\fillblank[长度][最低高度]{内容}| 用于生成填空题的空白, 内容可以为空. 其中长度默认值是~{\color{blue}{\lstinline|3.5cm|}}, 最低高度默认值是~{\color{blue}{\lstinline|0.5cm|}}.
+\item \lstinline|\fillblank[长度][最低高度]{内容}| 用于生成填空题的空白, 内容可以为空. 其中长度默认值是~{\color{blue}{\lstinline|35mm|}}, 最低高度默认值是~{\color{blue}{\lstinline|5mm|}}.
\end{enumerate}
\textit{\color{blue}{填空题示例:}}
\begin{lstlisting}
-\textbf{请将你的答案对应填在横线上:}\\[0.5cm]
+\textbf{请将你的答案对应填在横线上:}\\[5mm]
\textbf{1.} \fillblank{},
\textbf{2.} \fillblank[5cm]{},
\textbf{3.} \fillblank{}.
\end{lstlisting}
\begin{tcolorbox}
-\textbf{请将你的答案对应填在横线上:}\\[0.5cm]
+\textbf{请将你的答案对应填在横线上:}\\[5mm]
\textbf{1.} \fillblank{},
\textbf{2.} \fillblank[5cm]{},
\textbf{3.} \fillblank{}.
@@ -130,8 +131,8 @@
\tigan{选择题相关}
\begin{enumerate}[resume]
\item \lstinline|\xx{选项}{选项}{选项}{选项}| 用于生成选择题的选项, 直接在选择题题干后使用即可. 该命令会自动根据选项长度设置行数. 只支持四个选项, 选项会自动带上 ABCD.
-\item 如果想要手动改变每行显示的选项数, 可使用命令 \lstinline|\xx[每行显示的选项数]{选项}{选项}{选项}{选项}|, 每行只能显示 1, 2 或 4 个选项.
-\item \lstinline|\xuanzeti{题号}{答案}| 用于生成答题纸选择题的答题区域, 或参考答案选择题的答案区域.
+\item 该命令具有可选参数: \lstinline|\xx[每行显示的选项数]{选项}{选项}{选项}{选项}|, 每行只能显示 1, 2 或 4 个选项.
+\item \lstinline|\xuanzeti{题号}{答案}| 用于生成答题纸或参考答案中选择题的答题区域.
\end{enumerate}
\textit{\color{blue}{选择题示例:}}
@@ -175,7 +176,6 @@
\xuanzeti{1}{}\xuanzeti{2}{}\xuanzeti{3}{}\xuanzeti{4}{}
\end{tcolorbox}
-\newpage
\tigan{得分点相关}
\begin{enumerate}[resume]
\item \lstinline|\score{数值}| 用于在参考答案一行结尾处生成得分点的虚线.\score2
@@ -186,8 +186,8 @@
\begin{lstlisting}
\[\int e^x\diff x=e^x+C. \Score{(4分, 缺少常数得2分)}\]
\begin{align*}
-\int\sin x\diff x&=-\cos x+C, \Score{(4分, 缺少常数得2分)}\\
-\int_0^\pi(1+\sin x)\diff x&=\pi+2. \score5
+ \int\sin x\diff x&=-\cos x+C, \Score{(4分, 缺少常数得2分)}\\
+ \int_0^\pi(1+\sin x)\diff x&=\pi+2. \score5
\end{align*}
\end{lstlisting}
diff --git a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_cankaodaan.pdf b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_cankaodaan.pdf
index 330e2c8ed72..5be4a7f7c1d 100644
--- a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_cankaodaan.pdf
+++ b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_cankaodaan.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_cankaodaan.tex b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_cankaodaan.tex
index e9ca966fc35..c4e8f069b9d 100644
--- a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_cankaodaan.tex
+++ b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_cankaodaan.tex
@@ -1,4 +1,4 @@
-\documentclass[cankaodaan,blue]{hfutexam}
+\documentclass[cankaodaan]{hfutexam}
\usepackage{extarrows}
\newcommand{\diff}{\,\mathrm{d}}
@@ -14,7 +14,7 @@
\ZhuanYeBanJi{少数民族预科班}
\KaoShiRiQi{2022年6月18日8:00-10:00}
\MingTiJiaoShi{集体}
-%\XiZhuRenQianMing{dengbing.png}
+% \XiZhuRenQianMing{dengbing.png}
\tigan{一、填空题(每小题3分,共18分)}
diff --git a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_datizhi.pdf b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_datizhi.pdf
index c1fdcc715a3..28f58baf36c 100644
--- a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_datizhi.pdf
+++ b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_datizhi.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_datizhi.tex b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_datizhi.tex
index c0d3d1fa84a..31e1b3576fb 100644
--- a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_datizhi.tex
+++ b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_datizhi.tex
@@ -2,24 +2,24 @@
\newcommand{\diff}{\,\mathrm{d}}
\begin{document}
-\BiaoTi{合肥工业大学考试专用答卷纸(A)}
-\XueNian{2021}{2022}
-\XueQi{二}
-\KeChengDaiMa{034Y01}
-\KeChengMingCheng{数学(下)}
-\XueFen{5}
+\BiaoTi{合肥工业大学考试专用答题纸(A)}
+\XueQi{一}
+\XueNian{2022}{2023}
+\KeChengDaiMa{1400261B}
+\KeChengMingCheng{复变函数与积分变换}
+\XueFen{2.5}
\KeChengXingZhi{必修}
\KaoShiXingShi{闭卷}
-\ZhuanYeBanJi{少数民族预科班}
-\KaoShiRiQi{2022年6月18日8:00-10:00}
+\ZhuanYeBanJi{}
+\KaoShiRiQi{2022年11月26日19:00-21:00}
\MingTiJiaoShi{集体}
-%\XiZhuRenQianMing{dengbing.png}
-
+% 注意事项
\notice
-%\scorebox 为打分框, 必须放在行首
-\scorebox\tigan{一、填空题(每小题3分,共18分)}
+% \scorebox 为打分框, 必须放在行首
+\scorebox
+\tigan{一、填空题(每小题3分,共18分)}
\textbf{请将你的答案对应填在横线上:}\\[0.5cm]
\textbf{1.} \fillblank{},
@@ -29,7 +29,8 @@
\textbf{5.} \fillblank{},
\textbf{6.} \fillblank{}.
-\scorebox\tigan{二、选择题(每小题3分,共18分)}
+\scorebox
+\tigan{二、选择题(每小题3分,共18分)}
\textbf{请将你所选择的字母 A, B, C, D 之一对应填在下列表格里:}
@@ -43,29 +44,37 @@
\tigan{三、解答题(每小题8分,共64分)}
-\scorebox\textbf{1. (8分)【解】}
+\scorebox
+\textbf{1. (8分)【解】}
% \vspace 用于生成一定高度的空白, \newpage 直接换页
\vspace{3cm}
-\scorebox\textbf{2. (8分)【解】}
+\scorebox
+\textbf{2. (8分)【解】}
\newpage
-\scorebox\textbf{3. (8分)【解】}
+\scorebox
+\textbf{3. (8分)【解】}
\vspace{7cm}
-\scorebox\textbf{4. (8分)【解】}
+\scorebox
+\textbf{4. (8分)【解】}
\newpage
-\scorebox\textbf{5. (8分)【解】}
+\scorebox
+\textbf{5. (8分)【解】}
\vspace{7cm}
-\scorebox\textbf{6. (8分)【证明】}
+\scorebox
+\textbf{6. (8分)【证明】}
\newpage
-\scorebox\textbf{7. (8分)【证明】}
+\scorebox
+\textbf{7. (8分)【证明】}
\vspace{7cm}
-\scorebox\textbf{8. (8分)【解】}
+\scorebox
+\textbf{8. (8分)【解】}
\end{document}
diff --git a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_shijuan.pdf b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_shijuan.pdf
index b8e5045e710..35222d2cab5 100644
--- a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_shijuan.pdf
+++ b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_shijuan.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_shijuan.tex b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_shijuan.tex
index e4a5617329f..9be69f2a92a 100644
--- a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_shijuan.tex
+++ b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_shijuan.tex
@@ -1,6 +1,6 @@
\documentclass{hfutexam}
\newcommand{\diff}{\,\mathrm{d}}
-\usetikzlibrary{arrows.meta, overlay-beamer-styles}
+\usetikzlibrary{arrows.meta}
\begin{document}
\BiaoTi{合肥工业大学试卷(A)}
@@ -12,10 +12,9 @@
\KeChengXingZhi{必修}
\KaoShiXingShi{闭卷}
\ZhuanYeBanJi{少数民族预科班}
-\KaoShiRiQi{2022年6月18日8:00-10:00}
+\KaoShiRiQi{2022年2月29日8:00-10:00}
\MingTiJiaoShi{集体}
-\XiZhuRenQianMing{}
-% \XiZhuRenQianMing{dengbing.png}
+% \XiZhuRenQianMing[4em]{dengbing.png}
\tigan{一、填空题(每题3分,共18分)}
\begin{enumerate}
@@ -37,15 +36,15 @@
\item 设 $f(x)=\arctan\dfrac1{x(x-1)^2}$, 则 $x=0$ 是 $f(x)$ 的(~~~~).
\xx{可去间断点}{跳跃间断点}{第二类间断点}{连续点}
\item
-\begin{tikzpicture}[overlay,xshift=13cm,yshift=-3.5cm]
-\draw[-Stealth,thick](-3,0)--(3,0);
-\draw[-Stealth,thick](0,-1)--(0,3);
-\draw[very thick,smooth,domain=-55:55] plot ({\x/50-1.3}, {tan(\x)*tan(\x)});
-\draw[very thick,smooth,domain=0.15:2] plot ({\x}, {-ln(\x)});
-\draw
- (-0.3,-0.3) node {$O$}
- (2.8,-0.3) node {$x$}
- (-0.3,2.8) node {$y$};
+\begin{tikzpicture}[overlay,xshift=130mm,yshift=-35mm]
+ \draw[-Stealth,thick](-3,0)--(3,0);
+ \draw[-Stealth,thick](0,-1)--(0,3);
+ \draw[very thick,smooth,domain=-55:55] plot ({\x/50-1.3}, {tan(\x)*tan(\x)});
+ \draw[very thick,smooth,domain=0.15:2] plot ({\x}, {-ln(\x)});
+ \draw
+ (-0.3,-0.3) node {$O$}
+ (2.8,-0.3) node {$x$}
+ (-0.3,2.8) node {$y$};
\end{tikzpicture}
设 $f(x)$ 是定义在 $(-\infty,+\infty)$ 上的连续函数, 且 $f'(x)$ 的图像如下图所示, 则 $f(x)$ 有(~~~~).
% 手动设置为每行1个
diff --git a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_simple.pdf b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_simple.pdf
index b7008d98fe4..157e0a4c4ff 100644
--- a/Master/texmf-dist/doc/latex/hfutexam/hfutexam_simple.pdf
+++ b/Master/texmf-dist/doc/latex/hfutexam/hfutexam_simple.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/latex/hfutexam/hfutexam.cls b/Master/texmf-dist/tex/latex/hfutexam/hfutexam.cls
index 81315269173..a8eb76dae03 100644
--- a/Master/texmf-dist/tex/latex/hfutexam/hfutexam.cls
+++ b/Master/texmf-dist/tex/latex/hfutexam/hfutexam.cls
@@ -7,37 +7,26 @@
% 编译模式: XeLaTeX
% 你可以任意修改或再次分发该文件
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{hfutexam}[2022/12/07 v1.6 HFUTExam document class by Zhang Shenxing]
-% 文档选项 shijuan, datizhi, cankaodaan, simple
-\newif\ifHFUT@ShiJuan
-\newif\ifHFUT@DaTiZhi
-\newif\ifHFUT@CanKaoDaAn
-\newif\ifHFUT@Simple
-\newcommand{\setalltypefalse}{%
- \HFUT@ShiJuanfalse%
- \HFUT@DaTiZhifalse%
- \HFUT@CanKaoDaAnfalse%
- \HFUT@Simplefalse
-}
-\setalltypefalse\HFUT@ShiJuantrue
-\DeclareOption{datizhi}{\setalltypefalse\HFUT@DaTiZhitrue}
-\DeclareOption{cankaodaan}{\setalltypefalse\HFUT@CanKaoDaAntrue}
-\DeclareOption{simple}{\setalltypefalse\HFUT@Simpletrue}
-% 文档选项 nofangzheng
-\newif\ifHFUT@Fandol\HFUT@Fandoltrue
-\DeclareOption{nofangzheng}{\HFUT@Fandolfalse}
+\ProvidesClass{hfutexam}[2023/03/10 v1.7 HFUTExam document class by Zhang Shenxing]
+% 文档选项
+\newif\ifhfut@ShiJuan\hfut@ShiJuantrue
+\newif\ifhfut@DaTiZhi\hfut@DaTiZhifalse
+\newif\ifhfut@Simple\hfut@Simplefalse
+\newif\ifhfut@Fandol\hfut@Fandoltrue
+\DeclareOption{datizhi}{\hfut@ShiJuanfalse\hfut@DaTiZhitrue\hfut@Simplefalse}
+\DeclareOption{cankaodaan}{\hfut@ShiJuanfalse\hfut@DaTiZhitrue\hfut@Simplefalse}
+\DeclareOption{simple}{\hfut@ShiJuanfalse\hfut@DaTiZhifalse\hfut@Simpletrue }
+\DeclareOption{nofangzheng}{\hfut@Fandolfalse} % 默认使用方正字体
% 基于 ctexart 文档类
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}}
\ProcessOptions\relax
-\ifHFUT@Simple\else\PassOptionsToClass{twocolumn}{ctexart}\fi
+\ifhfut@Simple\else\PassOptionsToClass{twocolumn}{ctexart}\fi
\ProcessOptions\relax
\LoadClass[12pt,oneside]{ctexart}
% 页面设置
-\RequirePackage{amsmath,amssymb,amsthm}
-\RequirePackage{graphicx}
-\RequirePackage{enumitem}
-\RequirePackage{geometry}
-\ifHFUT@Simple
+\RequirePackage{amsmath,amssymb,amsthm, graphicx, enumitem, fancyhdr, lastpage, etoolbox, geometry, tikz, zref-savepos}
+\RequirePackage[normalem]{ulem}
+\ifhfut@Simple
\geometry{a4paper,scale=0.8}
\else
\geometry{
@@ -46,24 +35,33 @@
left=3.17cm,
right=3.17cm,
voffset=2.2cm,
- headheight=77pt,
+ headheight=78pt,
headsep=12pt,
footskip=1cm
}
+ \setlength\columnsep{0.8cm} % 分栏间距
+ \columnseprule=0.5pt % 分栏线宽度
\fi
% 试卷信息
-\newcommand{\BiaoTi}[1]{\gdef\HFUT@BiaoTi{#1}}
-\newcommand{\XueNian}[2]{\gdef\HFUT@XueNians{#1}\gdef\HFUT@XueNiane{#2}}
-\newcommand{\XueQi}[1]{\gdef\HFUT@XueQi{#1}}
-\newcommand{\KeChengDaiMa}[1]{\gdef\HFUT@KeChengDaiMa{#1}}
-\newcommand{\KeChengMingCheng}[1]{\gdef\HFUT@KeChengMingCheng{#1}}
-\newcommand{\XueFen}[1]{\gdef\HFUT@XueFen{#1}}
-\newcommand{\KeChengXingZhi}[1]{\gdef\HFUT@KeChengXingZhi{#1}}
-\newcommand{\KaoShiXingShi}[1]{\gdef\HFUT@KaoShiXingShi{#1}}
-\newcommand{\ZhuanYeBanJi}[1]{\gdef\HFUT@ZhuanYeBanJi{#1}}
-\newcommand{\KaoShiRiQi}[1]{\gdef\HFUT@KaoShiRiQi{#1}}
-\newcommand{\MingTiJiaoShi}[1]{\gdef\HFUT@MingTiJiaoShi{#1}}
-\newcommand{\XiZhuRenQianMing}[1]{\gdef\HFUT@XiZhuRenQianMing{#1}}
+\newcommand{\hfutstretch}{1.5} % 下划线内两侧空格长度除以条目之间空格长度
+\newcommand{\hfutul}[1]{\uline{\hspace{\stretch{\hfutstretch}}#1\hspace{\stretch{\hfutstretch}}}}
+\newcommand{\hfutrule}[1]{\rule{#1}{0mm}}
+\newcommand{\hfutboxyes}{{\raisebox{-0.5mm}{\LARGE$\checkmark\hspace{-18pt}\square$}}}
+\newcommand{\hfutboxno}{{\raisebox{-0.5mm}{\LARGE$\square$}}}
+\newcommand{\XueNian}[2]{\gdef\hfut@XueNian{{\hfutFontTimes #1}~{\hfutFontTimes #2}}}
+\newcommand{\BiaoTi}[1]{\gdef\hfut@BiaoTi{#1}}
+\newcommand{\XueQi}[1]{\gdef\hfut@XueQi{#1}}
+\newcommand{\XueFen}[1]{\gdef\hfut@XueFen{#1}}
+\newcommand{\KeChengXingZhi}[1]{\gdef\hfut@KeChengXingZhi{#1}}
+\newcommand{\KaoShiXingShi}[1]{\gdef\hfut@KaoShiXingShi{#1}}
+\newcommand{\KeChengDaiMa}[1]{\gdef\hfut@KeChengDaiMa{#1}}
+\newcommand{\KeChengMingCheng}[1]{\gdef\hfut@KeChengMingCheng{#1}}
+\newcommand{\ZhuanYeBanJi}[1]{\gdef\hfut@ZhuanYeBanJi{#1}}
+\newcommand{\KaoShiRiQi}[1]{\gdef\hfut@KaoShiRiQi{#1}}
+\newcommand{\MingTiJiaoShi}[1]{\gdef\hfut@MingTiJiaoShi{#1}}
+\newcommand{\XiZhuRenQianMing}[2][5em]{\gdef\hfut@XiZhuRenQianMing{%
+ \tikz[overlay]\node at (1.5,0.22) {\ifx#2\@empty\else\includegraphics[width=#1]{#2}\fi};%
+ \uline{\hspace{0.5em}\hfutrule{#1}\hspace{0.5em}}}}
\BiaoTi{}
\XueNian{}{}
\XueQi{}
@@ -77,144 +75,110 @@
\MingTiJiaoShi{}
\XiZhuRenQianMing{}
% 粗字体设定
-\newfontfamily\timesnewroman[AutoFakeBold={1.5}]{Times New Roman} % 粗罗马
-\ifHFUT@Fandol
- \setCJKfamilyfont{titlesongti}[AutoFakeBold={1.5}]{FZXiaoBiaoSong-B05S} % 粗方正小标宋
- \newfontfamily\entitlesongti[AutoFakeBold={1.5}]{FZXiaoBiaoSong-B05S}
- \setCJKfamilyfont{titlefangsong}[AutoFakeBold={1.5}]{FZFangSong-Z02S} % 粗方正仿宋
- \newfontfamily\entitlefangsong[AutoFakeBold={1.5}]{FZFangSong-Z02S}
+\newfontfamily\hfutFontTimes[AutoFakeBold={3}]{Times New Roman} % 粗罗马
+\ifhfut@Fandol
+ \setCJKfamilyfont{hfutFontTitle}[AutoFakeBold={3}]{FZXiaoBiaoSong-B05S} % 粗方正小标宋
+ \newfontfamily\hfutFontTitleEn[AutoFakeBold={3}]{FZXiaoBiaoSong-B05S}
+ \setCJKfamilyfont{hfutFontHead}[AutoFakeBold={3}]{FZFangSong-Z02S} % 粗方正仿宋
+ \newfontfamily\hfutFontHeadEn[AutoFakeBold={3}]{FZFangSong-Z02S}
\else
- \setCJKfamilyfont{titlesongti}[AutoFakeBold={4}]{NSimSun} % 粗新宋体
- \newfontfamily\entitlesongti[AutoFakeBold={4}]{NSimSun}
- \setCJKfamilyfont{titlefangsong}[AutoFakeBold={1.5}]{FangSong} % 粗仿宋
- \newfontfamily\entitlefangsong[AutoFakeBold={1.5}]{FangSong}
+ \setCJKfamilyfont{hfutFontTitle}[AutoFakeBold={3}]{NSimSun} % 粗新宋体
+ \newfontfamily\hfutFontTitleEn[AutoFakeBold={3}]{NSimSun}
+ \setCJKfamilyfont{hfutFontHead}[AutoFakeBold={3}]{FangSong} % 粗仿宋
+ \newfontfamily\hfutFontHeadEn[AutoFakeBold={3}]{FangSong}
\fi
-\newcommand{\titlesongti}{\entitlesongti\CJKfamily{titlesongti}}
-\newcommand{\titlefangsong}{\entitlefangsong\CJKfamily{titlefangsong}}
-\setCJKfamilyfont{xinsongti}[AutoFakeBold={1.5}]{NSimSun} % 粗新宋体
-\newfontfamily\enxinsongti[AutoFakeBold={1.5}]{NSimSun}
-\newcommand{\xinsongti}{\enxinsongti\CJKfamily{xinsongti}}
-\setCJKfamilyfont{cusongti}[AutoFakeBold={1.5}]{SimSun} % 粗宋体
-\newcommand{\cusongti}{\CJKfamily{cusongti}}
+\newcommand{\hfutFontTitle}{\CJKfamily{hfutFontTitle}\hfutFontTitleEn}
+\newcommand{\hfutFontHead}{\hfutFontHeadEn\CJKfamily{hfutFontHead}}
% 重新设定字体大小
-\renewcommand{\LARGE}{\fontsize{21}{21}}
-\renewcommand{\large}{\fontsize{14}{14}}
-\renewcommand{\normalsize}{\fontsize{12}{12}}
-\renewcommand{\small}{\fontsize{10.5}{10.5}}
+\renewcommand{\LARGE}{\fontsize{21pt}{25.2pt}}
+\renewcommand{\large}{\fontsize{14pt}{21pt}}
+\renewcommand{\small}{\fontsize{10.5pt}{12.6pt}}
% 缩进
\setlength{\parindent}{0em}
\renewcommand{\indent}{\hspace*{2em}}
-% 分栏
-\setlength\columnsep{0.8cm} % 分栏间距
-\columnseprule=0.5pt % 分栏线宽度
% 页眉页脚
-\RequirePackage{fancyhdr}
-\RequirePackage{lastpage}
-\RequirePackage{etoolbox}
-\renewcommand\headrulewidth{0.5pt} % 页眉线宽度
-\renewcommand\footrulewidth{0.5pt} % 页脚线宽度
\pagestyle{fancy}
\fancyhf{}
-\newcommand{\boxyes}{{\raisebox{-0.5mm}{\LARGE$\checkmark\hspace{-1.2em}\square$}}}
-\newcommand{\boxno}{{\raisebox{-0.5mm}{\LARGE$\square$}}}
-\newcommand{\filltitle}[2]{\uline{\makebox[#1]{#2}}}
-\newlength{\ltitle}
-\settowidth{\ltitle}{\HFUT@BiaoTi}
-\ifHFUT@ShiJuan%试卷页眉页脚
- \fancyhead[C]{%
- \hfill\bfseries\LARGE\titlesongti\ifdimcomp\ltitle>{0.5\linewidth}{\HFUT@BiaoTi}{\makebox[0.5\linewidth][s]{\HFUT@BiaoTi}}\hfill%
- \large\cusongti 共\filltitle{1.5em}{\timesnewroman\pageref{LastPage}}页第\filltitle{1.5em}{\timesnewroman\thepage}页\\\vspace{5pt}%
- \timesnewroman\HFUT@XueNians\titlefangsong~\timesnewroman\HFUT@XueNiane\titlefangsong 学年第\filltitle{2em}{\HFUT@XueQi}学期\hfill%
- 课程代码\filltitle{5em}{\HFUT@KeChengDaiMa}\hfill%
- 课程名称\filltitle{12em}{\HFUT@KeChengMingCheng}\hfill%
- 学分\filltitle{2.5em}{\HFUT@XueFen}\hfill%
- 课程性质: 必修\ifdefstring{\HFUT@KeChengXingZhi}{必修}{\boxyes}{\boxno}%
- 选修\ifdefstring{\HFUT@KeChengXingZhi}{选修}{\boxyes}{\boxno}%
- 限修\ifdefstring{\HFUT@KeChengXingZhi}{限修}{\boxyes}{\boxno}\hfill%
- 考试形式: 开卷\ifdefstring{\HFUT@KaoShiXingShi}{开卷}{\boxyes}{\boxno}%
- 闭卷\ifdefstring{\HFUT@KaoShiXingShi}{闭卷}{\boxyes}{\boxno}\\\vspace{2pt}%
- 专业班级(教学班)\filltitle{11em}{\HFUT@ZhuanYeBanJi}\hfill%
- 考试日期\filltitle{16em}{\HFUT@KaoShiRiQi}\hfill%
- 命题教师\fillblank[5.5em][0.6cm]{\HFUT@MingTiJiaoShi}\hfill%
- 系(所或教研室)主任审批签名%
- \begin{tikzpicture}[overlay,xshift=3.25em,yshift=0.15cm]%
- \node at (0,0) {\ifx\HFUT@XiZhuRenQianMing\@empty\else\includegraphics[height=0.9cm]{\HFUT@XiZhuRenQianMing}\fi};%
- \end{tikzpicture}%
- \filltitle{6.5em}{}\vspace{4pt}%
+\newcommand{\hfutpage}{{\hfutFontTimes\thepage}}
+\newcommand{\hfutlastpage}{{\hfutFontTimes\pageref*{LastPage}}}
+\ifhfut@ShiJuan % 试卷页眉页脚
+ \renewcommand\headrulewidth{0.5pt}
+ \renewcommand\footrulewidth{0.5pt}
+ \setCJKfamilyfont{hfutFontSimSun}[AutoFakeBold={3}]{SimSun} % 粗宋体
+ \fancyhead[C]{\bfseries\large\hfutFontHead\hfutrule{6em}
+ \hfill\makebox[280mm][s]{\LARGE\hfutFontTitle~\hfut@BiaoTi~}
+ \hfill{\CJKfamily{hfutFontSimSun} 共\uline{\makebox[1.5em]{\hfutlastpage}}页第\uline{\makebox[1.5em]{\hfutpage}}页}
+
+ \vspace{6pt}%
+ \hfut@XueNian{}学年第\uline{\hfill\hfut@XueQi\hfill}学期
+ \hfill 课程代码\hfutul{\hfut@KeChengDaiMa}
+ \hfill 课程名称\hfutul{\hfut@KeChengMingCheng}
+ \hfill 学分\uline{\hfill\hfut@XueFen\hfill}
+ \hfill 课程性质: %
+ 必修\ifdefstring{\hfut@KeChengXingZhi}{必修}{\hfutboxyes}{\hfutboxno}%
+ 选修\ifdefstring{\hfut@KeChengXingZhi}{选修}{\hfutboxyes}{\hfutboxno}%
+ 限修\ifdefstring{\hfut@KeChengXingZhi}{限修}{\hfutboxyes}{\hfutboxno}
+ \hfill 考试形式: %
+ 开卷\ifdefstring{\hfut@KaoShiXingShi}{开卷}{\hfutboxyes}{\hfutboxno}%
+ 闭卷\ifdefstring{\hfut@KaoShiXingShi}{闭卷}{\hfutboxyes}{\hfutboxno}
+
+ \vspace{6pt}%
+ 专业班级(教学班)\hfutul{\hfut@ZhuanYeBanJi}
+ \hfill 考试日期\hfutul{\hfut@KaoShiRiQi}
+ \hfill 命题教师\hfutul{\hfut@MingTiJiaoShi}
+ \hfill 系(所或教研室)主任审批签名\hfut@XiZhuRenQianMing%
}
\fancyfoot[C]{\small\vspace{0.5\baselineskip}命题教师注意事项:
1. 主考教师必须于考试一周前将“试卷A”、“试卷B”经教研室主任审批签字后送教务科印刷。\hspace{1em}%
2. 请命题教师用黑色水笔工整地书写题目或用A4纸横式打印贴在试卷版芯中。
}
\fi
-\ifHFUT@DaTiZhi%答题纸页眉页脚
- \fancyhead[C]{%
- \bfseries\LARGE\xinsongti\scalebox{2.0}[1.0]{%
- \ifdimcomp\ltitle>{0.35\linewidth}{\HFUT@BiaoTi}{\makebox[0.35\linewidth][s]{\HFUT@BiaoTi}}%
- }\\\vspace{8pt}%
- \large\timesnewroman\HFUT@XueNians\titlefangsong~\timesnewroman\HFUT@XueNiane\titlefangsong 学年第\filltitle{2em}{\HFUT@XueQi}学期\hfill%
- 课程代码\filltitle{6.5em}{\HFUT@KeChengDaiMa}\hfill%
- 课程名称\filltitle{13em}{\HFUT@KeChengMingCheng}\hfill%
- 命题教师\filltitle{7em}{\HFUT@MingTiJiaoShi}\hfill%
- 系主任审批%
- \begin{tikzpicture}[overlay,xshift=3.5em,yshift=0.2cm]%
- \node at (0,0) {\ifx\HFUT@XiZhuRenQianMing\@empty\else\includegraphics[height=0.9cm]{\HFUT@XiZhuRenQianMing}\fi};%
- \end{tikzpicture}%
- \filltitle{7em}{}\\\vspace{2pt}%
- 教学班级\filltitle{10.5em}{}\hfill%
- 学生姓名\fillblank[8em][0.6cm]{}\hfill%
- 学号\filltitle{8em}{}\hfill%
- 考试日期\filltitle{16em}{\HFUT@KaoShiRiQi}\hfill%
- 成绩\filltitle{6.3em}{}\vspace{4pt}%
- }
- \fancyfoot[C]{\small\vspace{0.5\baselineskip}
- 第 \timesnewroman\thepage 页~共 \timesnewroman\pageref{LastPage} 页
+\ifhfut@DaTiZhi % 答题纸页眉页脚
+ \renewcommand\headrulewidth{0.5pt}
+ \renewcommand\footrulewidth{0.5pt}
+ \fancyhead[C]{\bfseries\large\hfutFontHead
+ \makebox[\linewidth][s]{\LARGE\hfutFontTitle~\hfut@BiaoTi~}
+
+ \vspace{6pt}%
+ \hfut@XueNian{}学年第\uline{\hfill\hfut@XueQi\hfill}学期
+ \hfill 课程代码\hfutul{\hfut@KeChengDaiMa}
+ \hfill 课程名称\hfutul{\hfut@KeChengMingCheng}
+ \hfill 命题教师\hfutul{\hfut@MingTiJiaoShi}
+ \hfill 系(所或教研室)主任审批签名\hfut@XiZhuRenQianMing%
+
+ \vspace{6pt}%
+ 教学班级\hfutul{\hfutrule{10em}}
+ \hfill 学生姓名\hfutul{\hfutrule{10em}}
+ \hfill 学号\hfutul{\hfutrule{8em}}
+ \hfill 考试日期\hfutul{\hfut@KaoShiRiQi}
+ \hfill 成绩\hfutul{\hfutrule{6em}}%
}
+ \fancyfoot[C]{\small\vspace{0.5\baselineskip}第~\hfutpage~页~~共~\hfutlastpage~页}
\fi
-\ifHFUT@CanKaoDaAn%参考答案页眉页脚
- \fancyhead[C]{%
- \bfseries\LARGE\titlesongti\ifdimcomp\ltitle>{0.6\linewidth}{\HFUT@BiaoTi}{\makebox[0.6\linewidth][s]{\HFUT@BiaoTi}}\\\vspace{5pt}%
- \large\timesnewroman\HFUT@XueNians\titlefangsong~\timesnewroman\HFUT@XueNiane\titlefangsong 学年第\filltitle{2em}{\HFUT@XueQi}学期\hfill%
- 课程代码\filltitle{6.5em}{\HFUT@KeChengDaiMa}\hfill%
- 课程名称\filltitle{13em}{\HFUT@KeChengMingCheng}\hfill%
- 命题教师\filltitle{7em}{\HFUT@MingTiJiaoShi}\hfill%
- 系主任审批%
- \begin{tikzpicture}[overlay,xshift=3.5em,yshift=0.2cm]%
- \node at (0,0) {\ifx\HFUT@XiZhuRenQianMing\@empty\else\includegraphics[height=0.9cm]{\HFUT@XiZhuRenQianMing}\fi};%
- \end{tikzpicture}%
- \filltitle{7em}{}\\\vspace{2pt}%
- 教学班级\filltitle{10.5em}{}\hfill%
- 学生姓名\fillblank[8em][0.6cm]{}\hfill%
- 学号\filltitle{8em}{}\hfill%
- 考试日期\filltitle{16em}{\HFUT@KaoShiRiQi}\hfill%
- 成绩\filltitle{6.3em}{}\vspace{4pt}%
- }
- \fancyfoot[C]{\small\vspace{0.5\baselineskip}
- 第 \timesnewroman\thepage 页~共 \timesnewroman\pageref{LastPage} 页
- }
-\fi
-\ifHFUT@Simple%简单模式页眉页脚
+\ifhfut@Simple % 简单模式页眉页脚
+ \RequirePackage{hyperref}
\renewcommand\headrulewidth{0pt}
\renewcommand\footrulewidth{0pt}
\renewcommand{\maketitle}{%
- \begin{center}
- \bfseries\LARGE\titlesongti%
- \ifdimcomp\ltitle>{0.9\linewidth}{\HFUT@BiaoTi}{\makebox[0.9\linewidth][s]{\HFUT@BiaoTi}}\\%
- \makebox[0.75\linewidth]{\large\timesnewroman\HFUT@XueNians\titlefangsong~\timesnewroman\HFUT@XueNiane\titlefangsong 学年%
- 第{\HFUT@XueQi}学期\hfill\HFUT@KeChengMingCheng(\HFUT@KeChengDaiMa)}
+ \pdfbookmark{\hfut@BiaoTi}{hfutBiaoTi\thepage}
+ \begin{center}\bfseries
+ \makebox[\linewidth][s]{\LARGE\hfutFontTitle~\hfut@BiaoTi~}
+
+ \vspace{6pt}%
+ \makebox[\linewidth]{\large\hfutFontHead~
+ \hfill \hfut@XueNian{}学年第\hfut@XueQi{}学期
+ \hspace{\stretch{3}} \hfut@KeChengMingCheng(\hfut@KeChengDaiMa)
+ \hfill~
+ }
\end{center}
}
- \fancyfoot[C]{\small\vspace{0.5\baselineskip}
- 第 \timesnewroman\thepage 页~共 \timesnewroman\pageref{LastPage} 页
- }
+ \fancyfoot[C]{\small{}第~\hfutpage~页~~共~\hfutlastpage~页}
\fi
% 题号加粗
\renewcommand{\labelenumi}{{\bfseries \theenumi.}}
% 题干
\newcommand\tigan[1]{\noindent{\large\textbf{#1}}}
% 打分栏
-\RequirePackage{tikz}
-\usetikzlibrary{overlay-beamer-styles}
\newcommand\scorebox{%
\vspace{0.5\baselineskip}\noindent%
\begin{tikzpicture}[overlay,xshift=13.8cm,yshift=-1.6cm]%
@@ -240,8 +204,7 @@
\newlength{\lquar}
\newlength{\lhalf}
\newlength{\lfull}
-\RequirePackage[normalem]{ulem}
-\NewDocumentCommand\fillblank{O{3.5cm} O{0.5cm} m}{%
+\NewDocumentCommand\fillblank{O{35mm} O{5mm} m}{%
\settodepth{\ltemp}{#3}%
\uline{\makebox[#1]{\rule{0pt}{#2}\raisebox{\ltemp}{#3}}}%
}
@@ -298,9 +261,7 @@
\draw (0.9,0.5) node {#2} (0.9,1.5) node {\textbf{#1}};%
\end{tikzpicture}%
}
-% 得分点命令
-% https://ask.latexstudio.net/ask/question/7557.html
-\RequirePackage{zref-savepos}
+% 得分点命令 https://ask.latexstudio.net/ask/question/7557.html
\makeatletter
\ExplSyntaxOn
\zref@require@unique