texlive[56867] Master/texmf-dist: jnuexam (6nov20)
commits+karl at tug.org
commits+karl at tug.org
Fri Nov 6 22:52:25 CET 2020
Revision: 56867
http://tug.org/svn/texlive?view=revision&revision=56867
Author: karl
Date: 2020-11-06 22:52:25 +0100 (Fri, 06 Nov 2020)
Log Message:
-----------
jnuexam (6nov20)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3input.pdf
trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3input.tex
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-b-a3input.pdf
trunk/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3input.tex
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/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-a3input.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3input.tex 2020-11-06 03:11:34 UTC (rev 56866)
+++ trunk/Master/texmf-dist/doc/latex/jnuexam/exam-a-a3input.tex 2020-11-06 21:52:25 UTC (rev 56867)
@@ -2,8 +2,8 @@
% !TEX program = xelatex
% 直接包含 A4 试卷的 PDF 文件,生成双栏的 A3 试卷
-\documentclass[a3paper]{jnuexam}
+\documentclass[a3input]{jnuexam}
\begin{document}
-\includepdf[pages=-,nup=2x1,offset=1cm 0,delta=-2cm 0]{exam-a-empty}
-%\includepdf[pages=-,nup=2x1,offset=1cm 0,delta=-2cm 0,frame]{exam-a}
+\includepdf[pages=-,nup=2x1,offset=0 0,delta=0 0]{exam-a-empty}
+%\includepdf[pages=-,nup=2x1,offset=0 0,delta=0 0,frame]{exam-a}
\end{document}
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-b-a3input.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3input.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3input.tex 2020-11-06 03:11:34 UTC (rev 56866)
+++ trunk/Master/texmf-dist/doc/latex/jnuexam/exam-b-a3input.tex 2020-11-06 21:52:25 UTC (rev 56867)
@@ -2,8 +2,8 @@
% !TEX program = xelatex
% 直接包含 A4 试卷的 PDF 文件,生成双栏的 A3 试卷
-\documentclass[a3paper]{jnuexam}
+\documentclass[a3input]{jnuexam}
\begin{document}
-\includepdf[pages=-,nup=2x1,offset=1cm 0,delta=-2cm 0]{exam-b-empty}
-%\includepdf[pages=-,nup=2x1,offset=1cm 0,delta=-2cm 0,frame]{exam-b}
+\includepdf[pages=-,nup=2x1,offset=0 0,delta=0 0]{exam-b-empty}
+%\includepdf[pages=-,nup=2x1,offset=0 0,delta=0 0,frame]{exam-b}
\end{document}
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/tex/latex/jnuexam/jnuexam.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls 2020-11-06 03:11:34 UTC (rev 56866)
+++ trunk/Master/texmf-dist/tex/latex/jnuexam/jnuexam.cls 2020-11-06 21:52:25 UTC (rev 56867)
@@ -6,8 +6,9 @@
% ----------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jnuexam}[2019/11/08 v0.7 An exam class for Jinan University]
+\ProvidesClass{jnuexam}[2020/11/06 v1.0 An exam class for Jinan University]
+\newif\ifmifengxian \mifengxiantrue % 是否加密封线
\newif\ifsidebyside \sidebysidefalse % 是否 A3 纸张
\newif\ifreverse \reversefalse % 是否逆序出题
\newif\ifanswer \answertrue % 是否显示答案
@@ -17,12 +18,13 @@
\newif\ifcollection \collectionfalse % 用于试卷题库
\DeclareOption{a3paper}{\sidebysidetrue}
+\DeclareOption{a3input}{\sidebysidetrue\mifengxianfalse}
\DeclareOption{reverse}{\reversetrue}
\DeclareOption{noanswer}{\answerfalse}
\DeclareOption{amsfonts}{\amsfontstrue}
\DeclareOption{sourcehan}{\sourcehantrue}
\DeclareOption{display}{\displaytrue}
-\DeclareOption{collection}{\collectiontrue}
+\DeclareOption{collection}{\collectiontrue\mifengxianfalse}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}} %其它选项
@@ -42,7 +44,7 @@
\fi
\ifsidebyside
- \RequirePackage[a3paper,landscape,twocolumn,columnsep=40mm,left=50mm,right=30mm,top=25mm,bottom=25mm]{geometry}
+ \RequirePackage[a3paper,landscape,twocolumn,columnsep=60mm,left=30mm,right=30mm,top=25mm,bottom=25mm]{geometry}
\else
\RequirePackage[a4paper,left=30mm,right=30mm,top=25mm,bottom=25mm]{geometry}
\fi
@@ -55,6 +57,7 @@
\RequirePackage{environ}
\RequirePackage{etoolbox}
\RequirePackage{calc}
+\RequirePackage{iftex}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\newcolumntype{n}[1]{>{\centering\arraybackslash}m{#1}}
@@ -69,31 +72,50 @@
%% 这两个命令仅在 A3 纸张中用到,且需要编译两次才能得到正确结果
%% ---------------------------------------------------------------------------
-\newcommand{\mifengxian}{%
-\def\1{\\[50mm]}\def\2{\\[15mm]}%
-\begin{tikzpicture}[remember picture,overlay,very thick,font=\large]
- \path (current page.south west) +(2cm,1cm) coordinate (a1);
- \path (current page.north west) +(2cm,-1cm) coordinate (a2);
- \path (current page.south west) +(3cm,1cm) coordinate (b1);
- \path (current page.north west) +(3cm,-1cm) coordinate (b2);
- \draw[dashed] (a1) -- node[left=1mm,text width=1em]{装\1订\1线}
- node[right=1mm,text width=1em]{学\2生\2答\2卷\2不\2要\2超\2过\2此\2线} (a2);
- \draw (b1) -- (b2);
+\newcommand{\mifengxianleft}{
+ \path (current page.north west) +(25mm,-25mm) coordinate (a1);
+ \path (current page.south west) +(25mm,25mm) coordinate (a2);
+ \draw[dashed] (a1) -- node[left=1mm,text width=1em,inner sep=0pt]{\1{线}\0\1{订}\0\1{装}} (a2);
+}
+
+\newcommand{\mifengxianright}{
+ \path (current page.north east) +(-25mm,-25mm) coordinate (b1);
+ \path (current page.south east) +(-25mm,25mm) coordinate (b2);
+ \draw[dashed] (b1) -- node[right=1mm,text width=1em,inner sep=0pt]{\2{装}\0\2{订}\0\2{线}} (b2);
+}
+
+\newcommand{\mifengxianone}{%
+\def\0{\\[70mm]}\def\1{\rotatebox{90}}\def\2{\rotatebox{-90}}%
+\begin{tikzpicture}[remember picture,overlay,very thick]
+ \ifnumodd{\value{page}}{\mifengxianleft}{\mifengxianright}
\end{tikzpicture}}
+\newcommand{\mifengxiantwo}{%
+\def\0{\\[70mm]}\def\1{\rotatebox{90}}\def\2{\rotatebox{-90}}%
+\begin{tikzpicture}[remember picture,overlay,very thick]
+ \mifengxianleft\mifengxianright
+\end{tikzpicture}}
+
\newcommand{\caogaozhi}{%
\begin{tikzpicture}[remember picture,overlay,font=\sffamily\fontsize{180pt}{180pt}\selectfont]
\node[text=lightgray!40] at (current page.center) {草\quad 稿\quad 纸};
\end{tikzpicture}}
-\ifsidebyside
+\ifmifengxian
\RequirePackage{tikz}
\RequirePackage{everypage}
- \AddEverypageHook{\mifengxian}
- % 在 twocolumn 文档中,\newpage 可能是到下一栏,\clearpage 才能保证到下一页
- \preto{\@enddocumenthook}{\clearpage\pagestyle{empty}\caogaozhi\clearpage\caogaozhi\addtocounter{page}{-2}}
- % 在旧版本 ctex 宏包中不能用 \AtEndDocument 添加含中文的内容,即不能用 \appto 而要用 \preto
- %\AtEndDocument{\clearpage\pagestyle{empty}\caogaozhi\clearpage\caogaozhi\addtocounter{page}{-2}}
+ \ifsidebyside
+ \AddEverypageHook{\mifengxiantwo}
+ % 在 twocolumn 文档中,\newpage 可能是到下一栏,\clearpage 才能保证到下一页
+ \preto{\@enddocumenthook}{\clearpage\pagestyle{empty}\caogaozhi\clearpage\caogaozhi\addtocounter{page}{-2}}
+ % 在旧版本 ctex 宏包中不能用 \AtEndDocument 添加含中文的内容,即不能用 \appto 而要用 \preto
+ %\AtEndDocument{\clearpage\pagestyle{empty}\caogaozhi\clearpage\caogaozhi\addtocounter{page}{-2}}
+ \else
+ \AddEverypageHook{\mifengxianone}
+ \fi
+\fi
+
+\ifsidebyside
\RequirePackage{pdfpages}
% 新版本 pdfpages 将 \includepdf 放在文档开头时会有命令未定义的错误
% 见 https://tex.stackexchange.com/questions/352007/ieeetran-and-pdfpages
@@ -180,10 +202,12 @@
\par\vspace{1em}
\noindent\begin{tabularx}{\linewidth}{|*{8}{Y|}}
\hline
- \textbf{题号} & 一 & 二 & 三 & 四 & 五 & 六 & 总分\\
+ \textbf{题\quad 号} & 一 & 二 & 三 & 四 & 五 & 六 & 总分\\
\hline
- \parbox[c][2em][c]{2.2em}{\bfseries 得分} & & & & & & & \\
+ \textbf{得\quad 分} & & & & & & & \\
\hline
+ \textbf{评阅人} & & & & & & & \\
+ \hline
\end{tabularx}
}
@@ -192,7 +216,7 @@
%% ---------------------------------------------------------------------------
\newcommand{\my at columnbox}[1]{\makebox[\columnwidth]{#1}}
-\newcommand{\my at headleft}{暨南大学\kern-0.3em《\kecheng》\kern-0.3em 试卷\,\shijuan}
+\newcommand{\my at headleft}{\hspace{-0.3em}《\kecheng》\kern-0.3em 试卷\,\shijuan}
\newcommand{\my at headright}{姓名\hspace{6em}学号\hspace{6em}}
\newcommand{\my at headtext}{\my at headleft\hfill \my at headright}
\newcommand{\my at foottext}{第~\thepage~页\quad 共~\pageref{LastPage}~页}
@@ -240,18 +264,12 @@
\newcommand{\printproblems}{\ifreverse\lastproblem\allproblems\fi\xdef\allproblems{}\xdef\lastproblem{}}
\newcommand{\makepart}[2]{%
- \printproblems
- \setcounter{problem}{0}%
- \stepcounter{section}%
- \vspace{1em}%
- \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{tabularx}
- \par\vspace{1em}
+ \printproblems
+ \setcounter{problem}{0}%
+ \stepcounter{section}%
+ \vspace{1em}%
+ \noindent\textbf{\Chinese{section}、#1}(#2)%
+ \par\vspace{1em}%
}
\newcommand{\makedata}[1]{%
@@ -401,7 +419,6 @@
%% 判断命令 \true 和 \false
%% 填空命令 \fillin 和 \fillout
%% 选择命令 \pickin 和 \pickout
-%% 四个选项排版环境 abcd,根据四个选项的长度自动排成一行、两行或四行
%% ---------------------------------------------------------------------------
\newcommand{\answer}[1]{\ifanswer#1\else\phantom{#1}\fi}
@@ -417,7 +434,13 @@
\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}
+%% ---------------------------------------------------------------------------
+%% 选择题四个选项排版环境,根据四个选项的长度自动排成一行、两行或四行
+%% 其中 abcd 环境各列平分整行宽度,而 abcd* 环境各列平分剩余空白
+%% ---------------------------------------------------------------------------
+
\newlength{\my at item@len}
+
\newcommand\my at item@temp{%
\unskip\cr\stepcounter{choice}(\Alph{choice})\ %
}
@@ -428,6 +451,7 @@
\newcommand\my at item@par{%
\par\stepcounter{choice}(\Alph{choice})\ \ignorespaces
}
+
\NewEnviron{abcd}{
\unskip
\setlength{\parindent}{0pt}%
@@ -451,6 +475,44 @@
\fi
}
+\newcommand\my at item@one at line{%
+ \unskip
+ \ifnumequal{\value{choice}}{0}{}{\hfill}
+ \stepcounter{choice}(\Alph{choice})\ %
+}
+\newcommand\my at item@two at line{%
+ \unskip
+ \ifnumodd{\value{choice}}{&}{\unskip\cr}%
+ \stepcounter{choice}(\Alph{choice})\ %
+}
+
+\NewEnviron{abcd*}{
+ \unskip
+ \setlength{\parindent}{0pt}%
+ \setlength{\parskip}{0pt}%
+ \setcounter{choice}{0}%
+ \let\item=\my at item@one at line
+ \settowidth{\my at item@len}{\BODY}%
+ \ifdim\my at item@len<0.95\linewidth
+ \setcounter{choice}{0}%
+ \par\bgroup\BODY\hfill\hfill\par\egroup\par
+ \else
+ \setcounter{choice}{0}%
+ \let\item=\my at item@two at line
+ \settowidth{\my at item@len}{\vbox{\halign{##&##\hfil\cr\BODY\crcr}}}%
+ \ifdim\my at item@len<0.975\linewidth
+ \setcounter{choice}{0}%
+ \par\bgroup\nointerlineskip
+ \vbox{\halign to\linewidth{##\hfil\tabskip=0pt plus 1fil&##\hfil\cr\BODY\crcr}}%
+ \egroup\par
+ \else
+ \setcounter{choice}{0}%
+ \let\item=\my at item@par
+ \par\bgroup\BODY\hfill\egroup\par
+ \fi
+ \fi
+}
+
%% ---------------------------------------------------------------------------
%% 解答题步骤命令 \step
%% ---------------------------------------------------------------------------
@@ -537,9 +599,9 @@
\PassOptionsToPackage{tbtags}{amsmath}
\RequirePackage{amsmath}
-\newcommand{\myscore}[1]{\textcolor{blue}{#1\kern0.2em 分}}
+\newcommand{\myscore}[1]{\textcolor{red}{#1\kern0.15em 分}}
-\newcommand{\scoretext}[1]{\cdotfill\myscore{#1}\par\noindent\ignorespaces}
+\newcommand{\scoretext}[1]{\mbox{}\nobreak\hfill$\cdots\cdots$\myscore{#1}\par\noindent\ignorespaces}
\newcommand{\scoreeqno}[1]{\eqno{\cdots\cdots\text{\myscore{#1}}}}
\newcommand{\scoretag}[1]{\tag*{$\cdots\cdots$\myscore{#1}}}
@@ -557,7 +619,18 @@
%% ---------------------------------------------------------------------------
\newcommand{\display}{\everymath\expandafter{\the\everymath\displaystyle}}
-\ifbool{display}{\display}{}
+\ifbool{display}{
+ \RequirePackage[math]{cellspace}
+ \setlength\cellspacetoplimit{2pt}
+ \setlength\cellspacebottomlimit{2pt}
+ \addparagraphcolumntypes{X}
+ % Fix cellspace bug before version 1.7
+ % See https://tex.stackexchange.com/a/385581
+ \@ifpackagelater{cellspace}{2017/08/12}{}{
+ \patchcmd{\@endpbox}{\color at endgroup}{\expandafter\color at endgroup}{}{}
+ }
+ \display
+}{}
%% ---------------------------------------------------------------------------
%% 载入个人定制文件 jnuexam.cfg
@@ -575,7 +648,6 @@
}
\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 at set@sourcehan}
@@ -601,6 +673,23 @@
\appto{\endsolution}{\medskip}
\preto{\problem}{\ifnum\value{problem}=9 \setcounter{problem}{-1}\fi}
\pagestyle{plain}
+ \let\chapter=\part
+ \@addtoreset{section}{part}
+ \RequirePackage{xkeyval}
+ \define at key{jnuexam}{level}[]{\def\my at collection@level{#1}}
+ \define at key{jnuexam}{year}[]{\def\my at collection@year{#1}}
+ \define at key{jnuexam}{name}[]{\def\my at collection@name{#1}}
+ \newcommand{\info}[1]{%
+ \setkeys{jnuexam}{level,year,name,#1}% 重置之前的数据
+ \my at collection@info at do
+ }
+ \newcommand{\my at collection@info at do}{%
+ \bigskip\hrule\nopagebreak\vspace{0.4em}\nopagebreak
+ \ifdefempty{\my at collection@level}{}{Level = \my at collection@level\quad}%
+ \ifdefempty{\my at collection@year}{}{Year = \my at collection@year\quad}%
+ \ifdefempty{\my at collection@name}{}{Name = \my at collection@name\quad}%
+ \nopagebreak\vspace{0.4em}\nopagebreak\hrule\medskip
+ }
\fi
%% ---------------------------------------------------------------------------
@@ -616,11 +705,21 @@
\setlength\arraycolsep{4pt}
+\ifbool{XeTeX}{
+ % https://en.wikipedia.org/wiki/Number_Forms
+ % Ⅰ、Ⅱ、Ⅲ、Ⅳ、Ⅴ、Ⅵ、Ⅶ、Ⅷ、Ⅸ、Ⅹ、Ⅺ、Ⅻ
+ \xeCJKsetcharclass{"2150}{"218F}{1} % 斜线分数,全角罗马数字等
+ % https://en.wikipedia.org/wiki/Enclosed_Alphanumerics
+ \xeCJKsetcharclass{"2460}{"24FF}{1} % 带圈数字字母,括号数字字母,带点数字等
+}{}
+
\RequirePackage{CJKfntef}
\RequirePackage{multirow}
\RequirePackage{diagbox}
\RequirePackage{tabu}
+\RequirePackage{extarrows}
+
\RequirePackage{relsize}
\newcommand{\Int}{\mathop{\mathlarger{\int}}}
More information about the tex-live-commits
mailing list.