summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/bhcexam/BHCexam.cfg46
-rw-r--r--Master/texmf-dist/tex/latex/bhcexam/BHCexam.cls318
-rw-r--r--Master/texmf-dist/tex/xelatex/bhcexam/BHCexam.cls550
3 files changed, 550 insertions, 364 deletions
diff --git a/Master/texmf-dist/tex/latex/bhcexam/BHCexam.cfg b/Master/texmf-dist/tex/latex/bhcexam/BHCexam.cfg
deleted file mode 100644
index 7b9fc9689d6..00000000000
--- a/Master/texmf-dist/tex/latex/bhcexam/BHCexam.cfg
+++ /dev/null
@@ -1,46 +0,0 @@
-%%
-%% This is file `BHCexam.cfg',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% BHCexam.dtx (with options: `cfg')
-%%
-%% This is a generated file.
-%%
-%% Copyright (C) 2014 by Charles Bao <charley792@gmail.com>
-%%
-%% This file was generated from file(s) of the BHCexam package project.
-%% ----------------------------------------------------------------------
-%%
-%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.2
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.2 or later is part of all distributions of LaTeX
-%% version 1999/12/01 or later.
-%%
-%% This is the configuration file of the BHCexam package with LaTeX2e.
-%%
-\ProvidesFile{BHCexam.cfg}
- [2015/10/10 v0.4 BHCexam
- configuration file]
-
-
-
-\def\@biaoti{2011年全国普通高等学校招生统一考试(上海卷)}
-\def\@fubiaoti{数学(理科)}
-\def\@zongfen{150}
-\def\@shijian{120}
-\def\@tiankong@zongfen{56}
-\def\@tiankong@tishu{14}
-\def\@tiankong@fen{4}
-\def\@xuanze@zongfen{16}
-\def\@xuanze@tishu{4}
-\def\@xuanze@fen{4}
-\def\@jianda@zongfen{78}
-\def\@jianda@tishu{5}
-\endinput
-%%
-%% End of file `BHCexam.cfg'.
diff --git a/Master/texmf-dist/tex/latex/bhcexam/BHCexam.cls b/Master/texmf-dist/tex/latex/bhcexam/BHCexam.cls
deleted file mode 100644
index c1c426da49a..00000000000
--- a/Master/texmf-dist/tex/latex/bhcexam/BHCexam.cls
+++ /dev/null
@@ -1,318 +0,0 @@
-%%
-%% This is file `BHCexam.cls',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% BHCexam.dtx (with options: `cls')
-%%
-%% This is a generated file.
-%%
-%% Copyright (C) 2011 by Charles Bao <charley792@gmail.com>
-%%
-%% This file was generated from file(s) of the BHCexam package project.
-%% ----------------------------------------------------------------------
-%%
-%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.2
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.2 or later is part of all distributions of LaTeX
-%% version 1999/12/01 or later.
-%%
-%% This file may only be distributed together with a copy of original
-%% source files. You may however distribute original source files
-%% without such generated files. Copying of this file is authorized
-%% only if either:
-%% (1) you make absolutely no changes to your copy, including name; OR
-%% (2) if you do make changes, you first rename it to some other name.
-%%
-%% To produce the documentation run the original source files ending
-%% with `.dtx' through LaTeX.
-%%
-%% \CharacterTable
-%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-%% Digits \0\1\2\3\4\5\6\7\8\9
-%% Exclamation \! Double quote \" Hash (number) \#
-%% Dollar \$ Percent \% Ampersand \&
-%% Acute accent \' Left paren \( Right paren \)
-%% Asterisk \* Plus \+ Comma \,
-%% Minus \- Point \. Solidus \/
-%% Colon \: Semicolon \; Less than \<
-%% Equals \= Greater than \> Question mark \?
-%% Commercial at \@ Left bracket \[ Backslash \\
-%% Right bracket \] Circumflex \^ Underscore \_
-%% Grave accent \` Left brace \{ Vertical bar \|
-%% Right brace \} Tilde \~}
-%%
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesClass{BHCexam}
- [2015/10/10 v0.4 BHCexam
- document class]
-
-
-\newif\if@sixteenkpaper \@sixteenkpaperfalse
-\DeclareOption{16kpaper}{\@sixteenkpapertrue}
-\newif\if@marginline \@marginlinefalse
-\DeclareOption{marginline}{\@marginlinetrue}
-\newif\if@noindent \@noindentfalse
-\DeclareOption{noindent}{\@noindenttrue}
-\DeclareOption{answers}{\PassOptionsToClass{\CurrentOption}{exam}}
-
-\newif\if@printbox \@printboxfalse
-\DeclareOption{printbox}{\@printboxtrue}
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{exam}}
-\ProcessOptions
-\LoadClass[addpoints]{exam}
-\RequirePackage{ctex}
-\RequirePackage{ifpdf,ifxetex}
-\RequirePackage{amsmath,amssymb,amsthm,bm,bbding,pifont,dsfont}
-\RequirePackage{mathtools}
-\RequirePackage{paralist,cases,tabularx}
-\RequirePackage{pstricks,pst-plot,xcolor,graphicx}
-\if@marginline
-\marginparwidth = 2cm
-\if@sixteenkpaper
-\RequirePackage[papersize={184mm,260mm},hmargin={3cm,2cm},
-vmargin={2cm,2cm},marginparsep=0.5cm,hoffset=0cm,voffset=0cm,
-footnotesep=0.5cm,headsep=0.5cm,twoside]{geometry}
-\else
-\RequirePackage[paper=a4paper,hmargin={3cm,2cm},vmargin={2cm,2cm},
-marginparsep=0.5cm,hoffset=0cm,voffset=0cm,footnotesep=0.5cm,
-headsep=0.5cm,twoside]{geometry}
-\fi
-\else
-\if@sixteenkpaper
-\RequirePackage[papersize={184mm,260mm},hmargin={2cm,2cm},
-vmargin={2cm,2cm},marginparsep=0.5cm,hoffset=0cm,voffset=0cm,
-footnotesep=0.5cm,headsep=0.5cm]{geometry}
-\else
-\RequirePackage[papersize={210mm,297mm},hmargin={2cm,2cm},vmargin={2cm,2cm},
-marginparsep=0.5cm,hoffset=0cm,voffset=0cm,footnotesep=0.5cm,
-headsep=0.5cm]{geometry}
-\fi
-\fi
-\renewcommand{\baselinestretch}{1.5}
-\pagestyle{headandfoot}
-\header{}{}{}
-\footer{}{\small \quad 第~\thepage~页(共~\numpages~页)}{}
-\pointname{分}
-\pointformat{\kaishu (\thepoints)}
-\renewcommand{\questionshook}{
- \settowidth{\leftmargin}{22.\hskip\labelsep}
- \if@noindent \setlength\leftmargin{0pt} \fi
-}
-\renewcommand{\thepartno}{\arabic{partno}}
-\renewcommand{\partlabel}{(\thepartno)}
-\renewcommand{\partshook}{
- \settowidth{\leftmargin}{(3).\hskip\labelsep}
- \if@noindent \setlength\leftmargin{0pt} \fi
-}
-\newif\if@cancelspace \@cancelspacetrue
-\renewcommand{\solutiontitle}{\noindent 解:\noindent}
-\renewenvironment{solution}%
- {%
- \ifprintanswers
- \begingroup
- \Solution@Emphasis
- \begin{TheSolution}%
- \else
- \if@cancelspace
- %\unskip
- \else
- \par
- \penalty 0
- \vfill%
- \if@printbox \if@houpinfen \houpinfen \fi \fi
- \fi
- \setbox\z@\vbox\bgroup
- \fi
- }{%
- \ifprintanswers
- \end{TheSolution}%
- \endgroup
- \else
- \egroup
- \fi
- }%
-\if@marginline
-\newsavebox{\zdxl}
-\sbox{\zdxl}{
-\begin{minipage}{0.7\paperheight}
-\begin{center}
-\heiti 班级\underline{\hspace{15ex}} \quad
-姓名 \underline{\hspace{15ex}} \quad
-学号 \underline{\hspace{15ex}} \quad \\
-\vspace{3ex}
-\dotfill 装 \dotfill 订 \dotfill 线 \dotfill
-\end{center}
-\end{minipage}
-}
-\newsavebox{\zdxr}
-\sbox{\zdxr}{
-\begin{minipage}{0.7\paperheight}
-\begin{center}
-\heiti \hfill 请 \hfill 不 \hfill 要 \hfill 在 \hfill
- 装 \hfill 订 \hfill 线 \hfill 内 \hfill 答 \hfill 题 \hfill \\
-\vspace{3ex}
-\dotfill 装 \dotfill 订 \dotfill 线 \dotfill
-\end{center}
-\end{minipage}
-}
-\newcommand{\printmlol}{
-\marginpar{\rotatebox{90}{\usebox{\zdxl}}}
-}
-\newcommand{\printmlor}{
-\marginpar{\rotatebox{-90}{\usebox{\zdxr}}}
-}
-\reversemarginpar
-\fi
-\newcommand\biaoti[1]{\def\@biaoti{#1}}
-\newcommand\fubiaoti[1]{\def\@fubiaoti{#1}}
-\renewcommand\maketitle{
- \begin{center}{\heiti \Large{\@biaoti}}\end{center}
- \begin{center}{\heiti \Large{\@fubiaoti}}\end{center}
-}
-\newcommand\xinxi[2]{
- \def\@zongfen{#1}
- \def\@shijian{#2}
-}
-\newcommand\mininotice{
- \begin{center}{
- \kaishu (本试卷满分~\@zongfen~分, 考试时间~\@shijian~分钟)}
- \end{center}
-}
-\newcommand{\notice}{
- \heiti 注意事项: \songti
- \begin{enumerate}
- \item 答卷前, 考生务必将姓名、高考准考证号、校验码等填写清楚.
- \item 本试卷共~\numquestions{}~道试题, 满分~\@zongfen~分,考试时间~\@shijian~分钟.
- \end{enumerate}
-}
-\newlength\@boxwidth
-\setlength\@boxwidth{0ex}
-\if@printbox \setlength\@boxwidth{18ex} \fi
-\newcommand\pinfen{
- \heiti
- \begin{minipage}{\@boxwidth}
- \begin{tabular}{|c|c|}
- \hline
- 得分 & 评卷人\\
- \hline
- & \\
- \hline
- \end{tabular}
- \end{minipage}
-}
-\newcommand{\houpinfen}{
- \hfill
- \begin{tabular}{|l|l|}
- \hline
- 得分 & \hspace*{1.5cm}\\
- \hline
- \end{tabular}
- \bigskip
-}
-\newcounter{@dati}
-\newif\if@houpinfen \@houpinfenfalse
-\newcommand\settk[3]{
- \def\@tiankong@zongfen{#1}
- \def\@tiankong@tishu{#2}
- \def\@tiankong@fen{#3}
-}
-\newcommand\tiankong{
- \@houpinfenfalse
- \stepcounter{@dati}
- \fullwidth{
- \if@printbox \pinfen \fi
- \begin{minipage}{\textwidth-\@boxwidth}
- \heiti \chinese{@dati}. 填空题:本大题共~\@tiankong@tishu~题,满分~\@tiankong@zongfen~分. 请在横线上方填写最终的、最准确的、最完整的结果. 每题填写正确得~\@tiankong@fen~分,否则一律得0分.
- \end{minipage}
- }
-}
-\newcommand{\stk}[1]{
- \ifprintanswers
- \underline{~#1~}
- \else
- \underline{~\hspace{1cm}~}
- \fi}
-\newcommand{\mtk}[1]{
- \ifprintanswers
- \underline{~#1~}
- \else
- \underline{~\hspace{2cm}~}
- \fi}
-\newcommand{\ltk}[1]{
- \ifprintanswers
- \underline{~#1~}
- \else
- \underline{~\hspace{3cm}~}
- \fi}
-\newcommand\setxz[3]{
- \def\@xuanze@zongfen{#1}
- \def\@xuanze@tishu{#2}
- \def\@xuanze@fen{#3}
-}
-\newcommand\xuanze{
- \@houpinfenfalse
- \stepcounter{@dati}
- \fullwidth{
- \if@printbox \pinfen \fi
- \begin{minipage}{\textwidth-\@boxwidth}
- \heiti \chinese{@dati}. 选择题:本大题共~\@xuanze@tishu~题,满分~\@xuanze@zongfen~分. 请选择你认为最正确的答案(每小题有且只有一个)写在括号内. 每题填写正确得~\@xuanze@fen~分,否则得0分.
- \end{minipage}
- }
-}
-\newcommand{\onech}[4]{
-\renewcommand\arraystretch{1.4}
-\begin{tabularx}{\linewidth}{XXXX}
-\setlength\tabcolsep{0pt}
-(A) #1 & (B) #2 & (C) #3 & (D) #4 \\
-\end{tabularx}
-\unskip \unskip}
-\newcommand{\twoch}[4]{
-\renewcommand\arraystretch{1.4}
-\begin{tabularx}{\linewidth}{XX}
-\setlength\tabcolsep{0pt}
-(A) #1 & (B) #2 \\
-(C) #3 & (D) #4
-\end{tabularx}
-\unskip \unskip}
-\newcommand{\fourch}[4]{
-\renewcommand\arraystretch{1.4}
-\begin{tabularx}{\linewidth}{X}
-\setlength\tabcolsep{0pt}
-(A) #1 \\
-(B) #2 \\
-(C) #3 \\
-(D) #4 \\
-\end{tabularx}
-\unskip \unskip}
-\newcommand\setjd[2]{
- \def\@jianda@zongfen{#1}
- \def\@jianda@tishu{#2}
-}
-\newcommand\jianda{
- \@cancelspacefalse
- \@houpinfentrue
- \stepcounter{@dati}
- \fullwidth{
- \if@printbox \pinfen \fi
- \begin{minipage}{\textwidth-\@boxwidth}
- \heiti \chinese{@dati}. 简答题:本大题共~\@jianda@tishu~题,满分~\@jianda@zongfen~分. 请在题后空处写出必要的推理计算过程.
- \end{minipage}
- }
-}
-\delimitershortfall-1sp
-\newcommand\abs[1]{\left|#1\right|}
-\renewcommand{\geq}{\geqslant}
-\renewcommand{\ge}{\geqslant}
-\renewcommand{\leq}{\leqslant}
-\renewcommand{\le}{\leqslant}
-\AtEndOfPackage{\makeatletter\input{BHCexam.cfg}\makeatother}
-
-\endinput
-%%
-%% End of file `BHCexam.cls'.
diff --git a/Master/texmf-dist/tex/xelatex/bhcexam/BHCexam.cls b/Master/texmf-dist/tex/xelatex/bhcexam/BHCexam.cls
new file mode 100644
index 00000000000..1648653a505
--- /dev/null
+++ b/Master/texmf-dist/tex/xelatex/bhcexam/BHCexam.cls
@@ -0,0 +1,550 @@
+% BHCexam.cls
+%
+% An exam class designed for mathematics teacher in China.
+% Since 2016, it was used by mathcrowd.cn ( an opensource math exam database) as the default class to export exam papers.
+%
+
+%% BHCexam.cls
+%% Copyright (c) 2011-2022 BAO HONG CHANG
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "author-maintained".
+%
+% This work consists of the files BHCexam.cls.
+% Documation on https://docs.mathcrowd.cn/advances/bhcexam.html
+% Support on https://github.com/mathedu4all/bhcexam/issues
+%
+
+%%% BAO HONG CHANG
+%%% Mathcrowd Inc.
+%%% Shanghai
+%%% charles@mathcrowd.cn
+
+% The newest version of this documentclass should always be available
+% from my web page: https://github.com/mathedu4all/bhcexam
+
+\def\fileversion{1.7}
+\def\filedate{2022/07/29}
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{BHCexam}[\filedate\space Version \fileversion\space by
+ BAO HONG CHANG]
+
+ % *****************
+ % ** 宏包选项 **
+ % *****************
+
+
+ % 文档类支持以下宏包选项:
+
+ % answers 显示解析
+ % adobe 使用adobe字体
+ % ubuntu 使用ubuntu字体
+ % windows 使用windows字体
+ % fandol 使用fandol字体,随texlive默认安装
+ % mac 使用mac字体
+ % list 以列表项目格式显示试题
+ % twocolumn 使用A3纸张并分栏
+
+
+\newif\if@printanswers \@printanswersfalse
+\DeclareOption{answers}{\@printanswerstrue}
+
+\newcommand\@fontset{windows}
+\DeclareOption{adobe}{\renewcommand\@fontset{adobe}}
+\DeclareOption{ubuntu}{\renewcommand\@fontset{ubuntu}}
+\DeclareOption{mac}{\renewcommand\@fontset{mac}}
+\DeclareOption{windows}{\renewcommand\@fontset{windows}}
+\DeclareOption{fandol}{\renewcommand\@fontset{fandol}}
+
+\newif\if@twocolumn \@twocolumnfalse
+\DeclareOption{twocolumn}{\@twocolumntrue}
+
+\newif\if@list \@listfalse
+\DeclareOption{list}{\@listtrue}
+
+
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
+\ProcessOptions\relax
+\LoadClass{article}
+
+\RequirePackage[fontset = \@fontset, punct=kaiming]{ctex}
+\ctexset{linestretch = 4, autoindent = 0pt}
+
+
+% *****************************
+% ** 加载其他宏包 **
+% *****************************
+
+\RequirePackage{tabularx, ifthen} % 排选项用
+\RequirePackage{xcolor,graphicx,caption} % 彩色、图片、图释
+\RequirePackage{geometry,fancyhdr} % 纸张、边距、页眉、页脚
+\RequirePackage{etoolbox}
+\RequirePackage{amsmath,amsmath,amssymb} % ams数学相关
+\RequirePackage{unicode-math}
+\RequirePackage{pifont} % 带圈数字\ding
+\RequirePackage{bbding} % 图案
+\RequirePackage{romannum} % 罗马数字
+\RequirePackage{enumitem}
+
+
+
+% *****************
+% ** 页面设置 **
+% *****************
+
+
+\AtBeginDocument{
+ \pagenumbering{arabic} % 使用阿拉伯数字页码
+ \renewcommand{\parallel}{\mathrel{\mathpalette\new@parallel\relax}} % 重定义平行符号
+ \newcommand{\new@parallel}[2]{%
+ \begingroup
+ \sbox\z@{高度}% get the height of an uppercase letter
+ \resizebox{!}{\ht\z@}{\raisebox{\depth}{$\m@th#1/\mkern-10mu/$}}%
+ \endgroup
+ }
+}
+
+
+%
+% 双栏显示
+%
+\if@twocolumn
+\geometry{a3paper,landscape, twocolumn,columnsep=40mm,left=50mm,right=30mm,top=35mm,bottom=25mm,headheight=20mm}
+\else
+\geometry{a4paper,left=30mm,right=30mm,top=35mm,bottom=25mm, headheight=20mm}
+\fi
+
+%
+% 图释
+%
+\captionsetup[figure]{font=small,belowskip=0pt}
+
+
+
+% *****************
+% ** 试卷头 **
+% *****************
+
+
+
+\gdef\@subtitle{}
+\gdef\@notice{}
+\gdef\@author{}
+\gdef\@date{}
+
+
+
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\title}[1]{\gdef\@title{#1}}
+\newcommand{\subtitle}[1]{\gdef\@subtitle{#1}}
+\newcommand{\notice}[1]{\def\@notice{#1}}
+\renewcommand{\author}[1]{\gdef\@author{#1}}
+\renewcommand{\date}[1]{\gdef\@date{#1}}
+
+\renewcommand\maketitle{\begingroup
+ \renewcommand{\baselinestretch}{2}
+ \newpage
+ \begin{center}
+ \heiti \Large
+ \@title \par
+ \ifdefempty{\@subtitle}{}{
+ \@subtitle \par
+ }
+
+ \ifdefempty{\@author}{}{
+ \songti \normalsize
+ \@author \par
+ }
+
+ \ifdefempty{\@notice}{}{
+ \setlength{\fboxsep}{1em}
+ \vspace{0.5\baselineskip}
+ \fbox{
+ \parbox{0.5\linewidth}{
+ \kaishu \normalsize
+ \@notice \par
+ }
+ }
+ \vspace{0.5\baselineskip}
+ }
+
+
+ \end{center}
+ \renewcommand{\baselinestretch}{1}
+ \ifdefempty{\@date}{}{
+ \begin{flushright}
+ \songti \small
+ \@date \par
+ \end{flushright}
+ }
+ \songti \normalsize
+\endgroup}
+
+\renewcommand\arraystretch{1.5}
+\renewcommand{\baselinestretch}{1.5}
+
+% ***************************
+% ** 试题、解答环境定义 **
+% ***************************
+
+\newcounter{Group}
+\newcounter{Question}
+\newcounter{Example}
+\newcounter{Exercise}
+\newcounter{Method}[Question]
+
+\newif\if@showscore
+\@showscorefalse
+\newif\if@showskip
+\@showskipfalse
+\newif\if@showparen
+\@showparenfalse
+\newif\if@resetcounter
+\@resetcounterfalse
+\newlength{\myvertspace}
+
+
+% 定义题组环境
+\newenvironment{groups}{
+ \if@list
+ \list{\heiti\chinese{Group}.}{\usecounter{Group}}
+ \else
+ \par \begingroup \par
+ \fi
+}{
+ \if@list
+ \endlist
+ \else
+ \par \endgroup \par
+ \fi
+}
+
+% 定义新增题组命令
+\newcommand{\group}[2]{
+ \if@list
+ \item \heiti{#1} \quad \kaishu \small #2 \songti \normalsize \par
+ \else
+ \stepcounter{Group}
+ \par \heiti{\par \chinese{Group} 、#1} \quad \small{\kaishu #2} \songti \normalsize \par
+ \fi
+
+}
+
+% 定义试题环境
+\newenvironment{questions}[1][]{
+ \@tfor \@opt :=#1\do
+ {\if\@opt s\global\@showscoretrue\fi
+ \if\@opt t\global\@showskiptrue\fi
+ \if\@opt p\global\@showparentrue\fi
+ \if\@opt r\global\@resetcountertrue\fi}
+ \if@resetcounter
+ \setcounter{Question}{0}
+ \fi
+ \if@list
+ \list{\arabic{Question}.}{\setlength{\leftmargin}{0pt}}
+ \else
+ \par \begingroup \par
+ \fi
+}{
+ \if@list
+ \endlist
+ \else
+ \par \endgroup \par
+ \fi
+
+ \global\@showscorefalse
+ \global\@showskipfalse
+ \global\@showparenfalse
+}
+
+% 定义新增试题命令
+\newcommand{\question}[1][0]{
+ \stepcounter{Question}
+ \if@list
+ \item \if@showscore \kaishu ( #1 分) \songti \fi
+ \else
+ \vspace{2mm}
+
+ \arabic{Question}.
+ \if@showscore \kaishu ( #1 分) \songti \fi
+ \fi
+}
+
+% 定义新增例题命令
+\newcommand{\example}[1][0]{
+ \stepcounter{Example}
+ \if@list
+ \item[例题\arabic{Example}. ]
+ \if@showscore \kaishu ( #1 分) \songti \fi
+ \else
+ \vspace{2mm}
+ \par 例题\arabic{Example}.
+ \if@showscore \kaishu ( #1 分) \songti \fi
+ \fi
+}
+
+% 定义新增习题命令
+\newcommand{\exercise}[1][0]{
+ \stepcounter{Exercise}
+ \if@list
+ \item[习题\arabic{Exercise}. ]
+ \if@showscore \kaishu ( #1 分) \songti \fi
+ \else
+ \vspace{2mm}
+ \par 习题\arabic{Exercise}.
+ \if@showscore \kaishu ( #1 分) \songti \fi
+ \fi
+}
+
+% 定义小问环境
+\newlist{subquestions}{enumerate}{2}
+\setlist[subquestions,1]{label=(\arabic*)}
+\setlist[subquestions,2]{label=(\roman*)}
+
+% 定义新增小问命令
+\newcommand{\subquestion}{\item}
+
+\newenvironment{solution}[1]{
+ \setlength{\myvertspace}{#1}
+ \par \if@printanswers \par \color{red} \begingroup \else \if@showskip \vspace*{\myvertspace} \fi \setbox\z@\vbox\bgroup\fi \songti
+}{
+ \par \if@printanswers \endgroup \color{black} \else \egroup \fi \par
+}
+
+\newcommand{\hint}{
+ \par \fbox{\heiti{提示}} \par \songti
+}
+\newcommand{\method}{
+ \stepcounter{Method}
+ \vspace{2mm}
+ \par \fbox{\heiti{解法\chinese{Method}}} \par \songti
+}
+
+\newcommand{\methodonly}{
+ \par \fbox{\heiti{解答}} \par \songti
+}
+
+\newcommand{\score}[2]{
+ \par
+ \dotfill 本步骤 #1 分, 累计 #2 分
+ \par}
+
+\makeatletter
+\newcommand{\build}[2]{\leavevmode
+ \count@=\z@ \toks@={}%
+ \loop\ifnum\count@<\numexpr#1\relax
+ \toks@=\expandafter{\the\toks@#2}%
+ \advance\count@\@ne
+ \repeat
+ \the\toks@}
+\makeatletter
+
+\newlength{\keylength}
+\newcommand{\key}[1]{
+ \if@printanswers
+ \underline{~~#1~~}
+ \else
+ \settowidth{\keylength}{~~#1~~}
+ \build{13}{\hskip1sp\kern-1sp\hbox to 0.1\keylength{\hrulefill}}
+ \fi}
+
+\newlength{\choicelengtha}
+\newlength{\choicelengthb}
+\newlength{\choicelengthc}
+\newlength{\choicelengthd}
+\newlength{\choicelengthe}
+\newlength{\maxlength}
+
+% 三个选项
+\newcommand{\threechoices}[3]{
+ \if@showparen \dotfill (\qquad) \fi
+ \par
+ \settowidth{\choicelengtha}{A.~#1~~~}
+ \settowidth{\choicelengthb}{B.~#2~~~}
+ \settowidth{\choicelengthc}{C.~#3~~~}
+
+ \ifthenelse{\lengthtest{\choicelengtha>\choicelengthb}}{\setlength{\maxlength}{\choicelengtha}}{\setlength{\maxlength}{\choicelengthb}}
+ \ifthenelse{\lengthtest{\choicelengthc>\maxlength}}{\setlength{\maxlength}{\choicelengthc}}{}
+ \ifthenelse{\lengthtest{\maxlength>0.4\linewidth}}
+ {
+ \begin{tabularx}{\linewidth}{X}
+ \setlength\tabcolsep{0pt}
+ A.~#1~~~\\
+ B.~#2~~~\\
+ C.~#3~~~\\
+ \end{tabularx}
+ }%
+ {
+ \ifthenelse{\lengthtest{\maxlength>0.2\linewidth}}
+ {
+ \begin{tabularx}{\linewidth}{XX}
+ \setlength\tabcolsep{0pt}
+ A.~#1~~~ & B.~#2~~~\\
+ C.~#3~~~ & \\
+ \end{tabularx}
+ }%
+ {
+ \begin{tabularx}{\linewidth}{XXXX}
+ \setlength\tabcolsep{0pt}
+ A.~#1~~~ & B.~#2~~~ & C.~#3~~~ &\\
+ \end{tabularx}
+ }
+ }
+ \unskip \unskip
+}
+
+% 四个选项
+\newcommand{\fourchoices}[4]{
+ \if@showparen \dotfill (\qquad) \fi
+ \par
+ \settowidth{\choicelengtha}{A.~#1~~~}
+ \settowidth{\choicelengthb}{B.~#2~~~}
+ \settowidth{\choicelengthc}{C.~#3~~~}
+ \settowidth{\choicelengthd}{D.~#4~~~}
+ \ifthenelse{\lengthtest{\choicelengtha>\choicelengthb}}{\setlength{\maxlength}{\choicelengtha}}{\setlength{\maxlength}{\choicelengthb}}
+ \ifthenelse{\lengthtest{\choicelengthc>\maxlength}}{\setlength{\maxlength}{\choicelengthc}}{}
+ \ifthenelse{\lengthtest{\choicelengthd>\maxlength}}{\setlength{\maxlength}{\choicelengthd}}{}
+ \ifthenelse{\lengthtest{\maxlength>0.4\linewidth}}
+ {
+ \begin{tabularx}{\linewidth}{X}
+ \setlength\tabcolsep{0pt}
+ A.~#1~~~\\
+ B.~#2~~~\\
+ C.~#3~~~\\
+ D.~#4~~~\\
+ \end{tabularx}
+ }%
+ {
+ \ifthenelse{\lengthtest{\maxlength>0.2\linewidth}}
+ {
+ \begin{tabularx}{\linewidth}{XX}
+ \setlength\tabcolsep{0pt}
+ A.~#1~~~ & B.~#2~~~\\
+ C.~#3~~~ & D.~#4~~~\\
+ \end{tabularx}
+ }%
+ {
+ \begin{tabularx}{\linewidth}{XXXX}
+ \setlength\tabcolsep{0pt}
+ A.~#1~~~ & B.~#2~~~ & C.~#3~~~ & D.~#4~~~\\
+ \end{tabularx}
+ }%
+ }
+ \unskip \unskip
+}
+
+% 五个选项
+\newcommand{\fivechoices}[5]{
+ \if@showparen \hfill \dotfill (\quad) \fi
+ \par
+ \settowidth{\choicelengtha}{A.~#1~~~}
+ \settowidth{\choicelengthb}{B.~#2~~~}
+ \settowidth{\choicelengthc}{C.~#3~~~}
+ \settowidth{\choicelengthd}{D.~#4~~~}
+ \settowidth{\choicelengthe}{E.~#5~~~}
+ \ifthenelse{\lengthtest{\choicelengtha>\choicelengthb}}{\setlength{\maxlength}{\choicelengtha}}{\setlength{\maxlength}{\choicelengthb}}
+ \ifthenelse{\lengthtest{\choicelengthc>\maxlength}}{\setlength{\maxlength}{\choicelengthc}}{}
+ \ifthenelse{\lengthtest{\choicelengthd>\maxlength}}{\setlength{\maxlength}{\choicelengthd}}{}
+ \ifthenelse{\lengthtest{\choicelengthe>\maxlength}}{\setlength{\maxlength}{\choicelengthe}}{}
+ \ifthenelse{\lengthtest{\maxlength>0.4\linewidth}}{
+ \begin{tabularx}{\linewidth}{X}
+ \setlength\tabcolsep{0pt}
+ A.~#1~~~\\
+ B.~#2~~~\\
+ C.~#3~~~\\
+ D.~#4~~~\\
+ E.~#5~~~\\
+ \end{tabularx}
+ }%
+ {
+ \ifthenelse{\lengthtest{\maxlength>0.2\linewidth}}
+ {
+ \begin{tabularx}{\linewidth}{XX}
+ \setlength\tabcolsep{0pt}
+ A.~#1~~~ & B.~#2~~~\\
+ C.~#3~~~ & D.~#4~~~\\
+ E.~#5~~~ & \\
+ \end{tabularx}
+ }%
+ {
+ \begin{tabularx}{\linewidth}{XXXX}
+ \setlength\tabcolsep{0pt}
+ A.~#1~~~ & B.~#2~~~ & C.~#3~~~ & D.~#4~~~ \\
+ E.~#5~~~ & & & \\
+ \end{tabularx}
+ }
+ }%
+ \unskip \unskip
+}
+
+% 六个选项
+\newcommand{\sixchoices}[6]{
+ \if@showparen \hfill \dotfill (\quad) \fi
+ \par
+ \settowidth{\choicelengtha}{A.~#1~~~}
+ \settowidth{\choicelengthb}{B.~#2~~~}
+ \settowidth{\choicelengthc}{C.~#3~~~}
+ \settowidth{\choicelengthd}{D.~#4~~~}
+ \settowidth{\choicelengthe}{D.~#5~~~}
+ \ifthenelse{\lengthtest{\choicelengtha>\choicelengthb}}{\setlength{\maxlength}{\choicelengtha}}{\setlength{\maxlength}{\choicelengthb}}
+ \ifthenelse{\lengthtest{\choicelengthc>\maxlength}}{\setlength{\maxlength}{\choicelengthc}}{}
+ \ifthenelse{\lengthtest{\choicelengthd>\maxlength}}{\setlength{\maxlength}{\choicelengthd}}{} \ifthenelse{\lengthtest{\choicelengthe>\maxlength}}{\setlength{\maxlength}{\choicelengthe}}{}
+
+ \ifthenelse{\lengthtest{\maxlength>0.4\linewidth}}
+ {
+ \begin{tabularx}{\linewidth}{X}
+ \setlength\tabcolsep{0pt}
+ A.~#1~~~\\
+ B.~#2~~~\\
+ C.~#3~~~\\
+ D.~#4~~~\\
+ E.~#5~~~\\
+ F.~#6~~~\\
+ \end{tabularx}
+ }%
+ {
+ \ifthenelse{\lengthtest{\maxlength>0.2\linewidth}}
+ {
+ \begin{tabularx}{\linewidth}{XX}
+ \setlength\tabcolsep{0pt}
+ A.~#1~~~ & B.~#2~~~\\
+ C.~#3~~~ & D.~#4~~~\\
+ E.~#5~~~ & F.~#6~~~\\
+ \end{tabularx}
+ }%
+ {
+ \begin{tabularx}{\linewidth}{XXXX}
+ \setlength\tabcolsep{0pt}
+ A.~#1~~~ & B.~#2~~~ & C.~#3~~~ & D.~#4~~~ \\
+ E.~#2~~~ & F.~#6~~~ & & \\
+ \end{tabularx}
+ }%
+ }
+ \unskip \unskip
+}
+
+
+% ***************************
+% ** CUSTOMIZED COMMAND **
+% ***************************
+
+\newcommand\abs[1]{\left|#1\right|}
+\newcommand{\gt}{>}
+\newcommand{\lt}{<}
+\renewcommand{\geq}{\geqslant}
+\renewcommand{\ge}{\geqslant}
+\renewcommand{\leq}{\leqslant}
+\renewcommand{\le}{\leqslant}
+\renewenvironment{split}{\begin{aligned}}{\end{aligned}}
+
+
+
+\endinput