Debian Codegraph @

texmf-dist/source/latex/mcmthesis/mcmthesis.dtx

raw
1 % \iffalse meta-comment
2 % This is file `mcmthesis.dtx'.
3 %
4 % Copyright (C) 2010 -- 2015 by latexstudio
5 % 2014 -- 2019 by Liam Huang
6 % 2019 -- present by latexstudio.net
7 % -----------------------------------
8 % This work may be distributed and/or modified under the
9 % conditions of the LaTeX Project Public License, either version 1.3
10 % of this license or (at your option) any later version.
11 % The latest version of this license is in
12 % http://www.latex-project.org/lppl.txt
13 % and version 1.3 or later is part of all distributions of LaTeX
14 % version 2005/12/01 or later.
15 %
16 % This work has the LPPL maintenance status `maintained'.
17 %
18 % The Current Maintainer of this work is LaTeXStudio.
19 %
20 %<*internal>
21 \begingroup
22 \def\LaTeXeName{LaTeX2e}
23 \expandafter\endgroup\ifx\LaTeXeName\fmtname\else
24 \csname fi\endcsname
25 %</internal>
26 %<*install>
27 \input docstrip.tex
28 \keepsilent
29 \askforoverwritefalse
30 \preamble
31
32 -----------------------------------
33 This is a generated file.
34
35 Copyright (C) 2010 -- 2015 by latexstudio
36 2014 -- 2019 by Liam Huang
37 2019 -- present by latexstudio.net
38
39 This work may be distributed and/or modified under the
40 conditions of the LaTeX Project Public License, either version 1.3
41 of this license or (at your option) any later version.
42 The latest version of this license is in
43 http://www.latex-project.org/lppl.txt
44 and version 1.3 or later is part of all distributions of LaTeX
45 version 2005/12/01 or later.
46
47 The Current Maintainer of this work is latexstudio.net.
48
49 \endpreamble
50 \postamble
51
52 This work consists of these files \jobname.dtx,
53 figures/ and
54 code/,
55 and the derived files \jobname.cls,
56 \jobname-demo.tex,
57 README,
58 LICENSE,
59 \jobname.pdf and
60 \jobname-demo.pdf.
61 \endpostamble
62
63 \generate{%
64 \usedir{tex/latex/\jobname}%
65 \file{\jobname.cls}{\from{\jobname.dtx}{class}}%
66 \usedir{doc/latex/\jobname}%
67 \file{\jobname-demo.tex}{\from{\jobname.dtx}{demo}}%
68 \nopreamble\nopostamble
69 \file{README.tex}{\from{\jobname.dtx}{readme}}%
70 \file{LICENSE.tex}{\from{\jobname.dtx}{license}}%
71 }
72 \obeyspaces
73 \Msg{*************************************************************}
74 \Msg{* *}
75 \Msg{* To finish the installation you have to *}
76 \Msg{* *}
77 \Msg{* produce the user manual run the file \jobname.dtx *}
78 \Msg{* through XeLaTeX, *}
79 \Msg{* *}
80 \Msg{* produce the demo file run the file \jobname-demo.tex *}
81 \Msg{* through XeLaTeX, *}
82 \Msg{* *}
83 \Msg{* move the following file into a directory searched *}
84 \Msg{* by TeX: *}
85 \Msg{* *}
86 \Msg{* \jobname.cls to TEXMF/tex/latex/mcmthesis/, *}
87 \Msg{* \jobname.dtx to TEXMF/source/latex/mcmthesis/, *}
88 \Msg{* other files to TEXMF/doc/latex/mcmthesis/, *}
89 \Msg{* *}
90 \Msg{* and then run texhash. *}
91 \Msg{* *}
92 \Msg{* Happy TeXing! *}
93 \Msg{*************************************************************}
94 \endbatchfile
95 %</install>
96 %<*internal>
97 \fi
98 %</internal>
99 %<*driver>
100 \ProvidesFile{mcmthesis.dtx}
101 [2024/01/22 v6.3.3 The Thesis Template Designed For MCM/ICM]
102 \documentclass{ltxdoc}
103 \EnableCrossrefs
104 \CodelineIndex
105 \RecordChanges
106 \usepackage[UTF8, fontset=fandol,fntef]{ctexcap}
107 \usepackage{hologo}
108 \usepackage{xcolor}
109 \usepackage{longtable}
110 \usepackage{booktabs}
111 \usepackage{graphicx}
112 \usepackage{listings}
113 \usepackage{multirow}
114 \usepackage{amsmath}
115 \definecolor{grey}{rgb}{0.8,0.8,0.8}
116 \definecolor{darkgreen}{rgb}{0,0.3,0}
117 \definecolor{darkblue}{rgb}{0,0,0.3}
118 \lstset{
119 language=[LaTeX]TeX,
120 % style
121 frame=lines,%
122 basicstyle={\footnotesize\ttfamily},%
123 keywordstyle=\color{darkblue}\bfseries,%
124 identifierstyle=,%
125 commentstyle=\color{darkgreen},%\itshape,%
126 stringstyle=\color{black},%
127 }
128 \AtBeginDocument{\hypersetup{colorlinks=true}}
129 \newcommand{\pkg}[1]{\textsf{#1}}
130 \newcommand{\env}[1]{\textsf{#1}}
131 \newcommand{\cntr}[1]{\textsf{#1}}
132 \newcommand{\XeLaTeX}{\hologo{XeLaTeX}}
133 \newcommand{\mem}[1]{\textcolor{blue}{\kaishu #1}}
134 \newcommand{\file}[1]{\textsf{#1}}
135 \newcommand{\path}[1]{\textsf{#1}}
136 \newcommand{\mopt}{\textsf}
137 \usepackage{hyperref}
138 \begin{document}
139 \DocInput{\jobname.dtx}
140 \end{document}
141 %</driver>
142 % \fi
143 %
144 % \CheckSum{673}
145 %
146 % \CharacterTable
147 % {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
148 % 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
149 % Digits \0\1\2\3\4\5\6\7\8\9
150 % Exclamation \! Double quote \" Hash (number) \#
151 % Dollar \$ Percent \% Ampersand \&
152 % Acute accent \' Left paren \( Right paren \)
153 % Asterisk \* Plus \+ Comma \,
154 % Minus \- Point \. Solidus \/
155 % Colon \: Semicolon \; Less than \<
156 % Equals \= Greater than \> Question mark \?
157 % Commercial at \@ Left bracket \[ Backslash \\
158 % Right bracket \] Circumflex \^ Underscore \_
159 % Grave accent \` Left brace \{ Vertical bar \|
160 % Right brace \} Tilde \~}
161 %
162 % \changes{v6.3.3}{2024/01/22}{修改几个样式错误,增加了生成式 AI 引用样式。}
163 %
164 % \GetFileInfo{\jobname.dtx}
165 %
166 % \DoNotIndex{\test}
167 %
168 % \title{\hypertarget{Chinese}{%
169 % \textsf{\jobname} 文档类 \fileversion
170 % \thanks{这份文档是 \textsf{\jobname}~\fileversion
171 % 的说明文档,更新日期 \filedate。}}%
172 % \makebox[0pt][l]{\hspace{1.5cm}\hyperlink{English}%
173 % {\large$ \to $ English Version}}
174 % }
175 % \author{\LaTeX Studio \\ \texttt{[email protected]}\and 黄晨成 \\ \texttt{liamhuang0205+\[email protected]}}
176 % \date{\filedate}
177 %
178 % \maketitle
179 %
180 % \begin{abstract}
181 % 这份模板是美国大学生数学建模竞赛(MCM/ICM)的论文模板。模板遵循赛事官方的要求,设置了
182 % 页眉页脚、字体和摘要页等内容。本文档对模板的使用做出了说明。
183 % \end{abstract}
184 %
185 % \section{模板介绍}
186 %
187 % 这份模板最早由 latexstudio 设计,并在往年参赛者的建议下不断改进。2014 年年初,黄晨成接手模板,
188 % 用 key-value 语法重构了文档选项,并修复了一些 bug。2015 年年初,黄晨成将模板使用
189 % \pkg{DocStrip} 的语法重构,并上传至 CTAN。
190 %
191 %
192 %
193 % 欢迎大家关注我们的微信公众号,更多更好的 \LaTeX{} 资料资讯:
194 %
195 % \centerline{\includegraphics[width=3.5cm]{./figures/qrcodewechat}}
196 % \section{手工安装说明}
197 %
198 % \subsection{下载}
199 %
200 % 你可以到项目主页下载最新版。如下是几个更新地址:
201 %
202 % \begin{description}
203 % \item [CTAN] \url{http://www.ctan.org/pkg/mcmthesis}
204 % \item [GitHub] \url{https://github.com/latexstudio-org/mcmthesis}
205 % \item [\LaTeX Studio] \url{https://www.latexstudio.net}
206 % \end{description}
207 %
208 % 此外,文档类也已上传至 CTAN,你可以在 \TeX{} Live 等发行版的宏包管理器中下载。
209 %
210 % \subsection{安装}
211 %
212 % 我们以 \path{SOURCE} 代表你下载的源文件目录,在终端下执行以下命令。
213 % \iffalse
214 %<*internal>
215 % \fi
216 \begin{lstlisting}[language=bash]
217 cd SOURCE
218 xetex mcmthesis.dtx
219 xelatex mcmthesis.dtx
220 xelatex mcmthesis.dtx
221 xelatex mcmthesis-demo.tex
222 xelatex mcmthesis-demo.tex
223 \end{lstlisting}
224 % \iffalse
225 %</internal>
226 % \fi
227 %
228 % 你可以将生成的 \file{mcmthesis.cls} 拷贝至 \path{TEXMF/tex/latex/mcmthesis/}
229 % 目录,将 \file{mcmthesis.dtx} 拷贝至
230 % \path{TEXMF/source/latex/mcmthesis/},将 \file{mcmthesis.pdf}、
231 % \file{mcmthesis-demo.tex}、\file{mcmthesis-demo.pdf}、\file{figures/}
232 % 和 \file{code/} 拷贝至 \path{TEXMF/doc/latex/mcmthesis/},然后在终端
233 % 执行 \verb|texhash|;也可以将 \file{mcmthesis.cls} 放在当前目录直接使用。
234 %
235 % 生成的 \file{mcmthesis-demo.tex} 是一个示例文件,你可以参照这个文件来构建你的论文;
236 % 也可以直接修改这个文件。
237 %
238 % \section{使用说明}
239 % \subsection{依赖}
240 % \pkg{mcmthesis} 依赖于以下宏包,这些宏包在常见的 \TeX{} 发行版中都已包含,
241 % 在安装使用之前,请确认你的 \TeX{} 发行版中正确安装了这些宏包。
242 % \begin{longtable}{cccc}
243 % \toprule
244 % \pkg{xkeyval} & \pkg{etoolbox} & \pkg{fancyhdr} & \pkg{fancybox} \\
245 % \pkg{ifthen} & \pkg{lastpage} & \pkg{listings} & \pkg{appendix} \\
246 % \pkg{amsmath} & \pkg{amssymb} & \pkg{amsfonts} & \pkg{amsbsy} \\
247 % \pkg{bm} & \pkg{mathrsfs} & \pkg{latexsym} & \pkg{paralist} \\
248 % \pkg{longtable} & \pkg{multirow} & \pkg{hhline} & \pkg{tabularx} \\
249 % \pkg{ctex} & \pkg{xeCJK} & \pkg{CJK} & \pkg{xCJK2uni}\\
250 % \pkg{tabu} & \pkg{environ} & \pkg{longtable} & \pkg{hologo}\\
251 % \pkg{array} & \pkg{flafter} & \pkg{pifont} & \pkg{calc} \\
252 % \pkg{colortbl} & \pkg{booktabs} & \pkg{geometry} & \pkg{fontenc}\\
253 % \pkg{berasans} & \pkg{hyperref} & \pkg{ifpdf} & \pkg{ifxetex}\\
254 % \pkg{graphicx} & \pkg{epstopdf} & \pkg{bmpsize} & \pkg{xcolor}\\
255 % \pkg{longtable} & \pkg{tabu} & \pkg{hologo} & \pkg{palatino}\\
256 % \bottomrule
257 % \end{longtable}
258 % 如果你尚未安装这些宏包,可以启动你的 \TeX{} 发行版的宏包管理器
259 % 来安装;或者到 \url{http://www.ctan.org} 上搜索下载并安装。
260 %
261 % \subsection{选项}
262 % \pkg{mcmthesis} 定义了一些选项,用来控制模板的行为。
263 % 你可以在载入文档类的时候指定这些选项的值,例如
264 % \iffalse
265 %<*internal>
266 % \fi
267 \begin{lstlisting}[language={[LaTeX]TeX}]
268 \documentclass[tcn = 12345, problem = B, titlepage = false]{mcmthesis}
269 \end{lstlisting}
270 % \iffalse
271 %</internal>
272 % \fi
273 %\DescribeMacro{\mcmsetup}你也可以使用 \cs{mcmsetup}^^A
274 % \marg{key-value 列表} 来指定这些值,例如
275 % \iffalse
276 %<*internal>
277 % \fi
278 \begin{lstlisting}[language={[LaTeX]TeX}]
279 \documentclass{mcmthesis}
280 %\documentclass[CTeX = true]{mcmthesis} % 当使用 CTeX 套装时使用该行设置
281 \mcmsetup{tcn = 12345, problem = B, titlepage = false}
282 \end{lstlisting}
283 % \iffalse
284 %</internal>
285 % \fi
286 % 两种做法效果等同。
287 %
288 % 当前,\pkg{mcmthesis} 有八个选项:
289 % \begin{description}
290 % \item [CTeX] 兼容选项,默认关闭。当使用 2.9.2.164 版本的 CTeX 套装时请打开。
291 % \item [tstyle] 可以根据自己需要修改队号和题号的字体和颜色。
292 % \item [tcn] 队伍控制号码,接受一个字符串作为值;输入的值将显示在摘要页上和
293 % 每一页的页眉上;默认为 \texttt{0000}。
294 % \item [problem] 选题,接受一个字符串作为值;输入的值将显示在摘要页上;
295 % 默认为 \texttt{A}。
296 % \item [sheet] 布尔值;为真时将输出摘要页,否则不输出;默认为 \texttt{true}。
297 % \item [titleinsheet] 布尔值;为真时将在摘要页输出标题,否则不输出;
298 % 默认为 \texttt{false}。
299 % \item [keywordsinsheet] 布尔值;为真时将在摘要页输出关键字,否则不输出;
300 % 默认为 \texttt{false}。
301 % \item [titlepage] 布尔值;为真时将输出标题页,否则不输出;默认为 \texttt{true}。
302 % \item [abstract] 布尔值;为真时将在标题页输出摘要和关键词,否则不输出;默认值为
303 % \texttt{true}。
304 % \end{description}
305 %
306 % 注意,\texttt{titleinsheet} 和 \texttt{keywordsinsheet} 的效果受 \texttt{sheet}
307 % 的影响。若 \texttt{sheet = false},则不论前二者的真假,均不会在摘要页上输出标题和/或
308 % 关键字。另一方面,若 \texttt{sheet = true},则摘要部分总是会出现在摘要页。
309 % \texttt{abstract} 与 \texttt{titlepage} 选项的关系于前述类似。
310 %
311 % \subsection{题号}
312 %
313 % \DescribeMacro{\problem}除了使用 \cs{mcmsetup} 来指定题号,你还可以使用
314 % \cs{problem}\marg{题号} 命令来选择题号。后一种方式是为了兼容而提供的,不推荐
315 % 使用。
316 %
317 % \subsection{环境}
318 %
319 % \DescribeEnv{abstract}\DescribeEnv{keywords}
320 % \pkg{mcmthesis} 重新定义了 \env{abstract} 环境,并且
321 % 定义了 \env{keywords} 环境。需要注意的是,他们的行为和
322 % \LaTeX{} 标准的 \cs{title} 命令类似——在使用的时候,只是记录内容,而并不输出内容;
323 % 内容的实际输出要等到 \cs{maketitle} 命令。
324 %
325 % \DescribeEnv{memo}
326 % \pkg{mcmthesis} 定义有 \env{memo} 环境。它接受一个可选参数,作为其标题。
327 % 设计该环境的初衷是我们发现近年的 MCM 竞赛常常要求学生生成一封信件或者备忘录,作为论文的一部分。
328 %
329 % \DescribeMacro{memoto}\DescribeMacro{memofrom}\DescribeMacro{memosubject}
330 % \DescribeMacro{memodate}\DescribeMacro{memologo}
331 % \env{memo} 环境有一些辅助命令:
332 % \begin{description}
333 % \item[\cs{memoto}] 表示这份备忘录是留给谁的。
334 % \item[\cs{memofrom}] 表示这份备忘录是谁留下的。
335 % \item[\cs{memosubject}] 表示这份备忘录的主题。
336 % \item[\cs{memodate}] 表示留下这份备忘录的日期。
337 % \item[\cs{memologo}] 其中包含的内容将在输出备忘录的 LOGO 时被调用。
338 % \end{description}
339 %
340 % \subsection{摘要页头部设置}
341 % \DescribeMacro{\headset}MCM/ICM 的主办方经常变动摘要页头部的年份及赛事名称说明的格式,可谓岁岁年年各不同。因此,模板很难保证这部分的格式与当年的要求完全一致,故而给出一个易于修改的接口。例如:
342 % \iffalse
343 %<*internal>
344 % \fi
345 \begin{lstlisting}[language={[LaTeX]TeX}]
346 \renewcommand{\headset}{{\Large\the\year}\\MCM/ICM\\Summary Sheet}
347 \end{lstlisting}
348 % \iffalse
349 %</internal>
350 % \fi
351 % 将会输出:
352 % \begin{trivlist}\item
353 % \newcommand{\headset}{{\Large\the\year}\\MCM/ICM\\Summary Sheet}
354 % \begin{center}
355 % \textbf{\headset}
356 % \end{center}
357 % \end{trivlist}
358 %
359 % \subsection{编译方式}
360 %
361 % 模板支持多种编译方式:
362 % \begin{itemize}
363 % \item \XeLaTeX (若含中文);
364 % \item pdf\LaTeX \textbf{这是推荐的方式};
365 % \item \LaTeX{} + DVIPDFMx。
366 % \end{itemize}
367 %
368 % \subsection{中文支持}
369 %
370 % 由于 MCM/ICM 要求以英文写作,所以模板没有内建的中文支持。如果你在文章中需要使用个别中文
371 % 字符,可以自行使用合适中文支持方式。例如,使用 CTeX 宏集:
372 %
373 % \iffalse
374 %<*internal>
375 % \fi
376 \begin{lstlisting}[language={[LaTeX]TeX}]
377 \usepackage[UTF8, nocap]{ctex}
378 \end{lstlisting}
379 % \iffalse
380 %</internal>
381 % \fi
382 %
383 % \section{版本历史}
384 % \begin{description}
385 % \item [5.1.0a] 首次上传到 CTAN。
386 % \item [5.1.0b] 修复 \textsf{CheckSum} 和一些拼写错误。
387 % \item [5.1.0c] 新增 \mopt{titleinsheet} 等选项。
388 % \item [5.1.0d] 修改 \mopt{problem} 的定义方式,定义
389 % \cs{mcmsetup}\marg{key-val 列表} 以修改选项,
390 % 调高了摘要页表格的位置,修复摘要页和标题页页码的问题,
391 % 修复标题、摘要和关键字过长时分行、分页的问题。
392 % \item [5.1.0e] 重新定义摘要页顶部的表格,以符合赛事主办方 COMAP 的最新版的
393 % 摘要页。
394 % \item [5.1.0f] 取消 TCN 和选题的红色标记。
395 % \item [6.0] 微调输出格式,新增选项 CTeX 以兼容 2.9.2.164 版本的 CTeX 套装。
396 % \item [6.1] 修复问题。
397 % \item [6.2] 可定制的 headset。
398 % \item [6.2.1] 将默认字号由 |11pt| 修改为 |12pt|。
399 % \item [6.3] 修改summary的版面样式。
400 % \item [6.3.1] 将默认的版面尺寸由 |a4paper| 修改为 |letterpaper|。
401 % \item [6.3.2] 修复了一些版式异常和兼容性问题。
402 % \item [6.3.3] 修改几个样式错误,增加了生成式 AI 引用样式。
403 % \end{description}
404 %
405 % \title{\hypertarget{English}{%
406 % The \textsf{\jobname} class \fileversion\thanks{This Document
407 % corresponds to \textsf{\jobname}~\fileversion, dated \filedate.}}%
408 % \makebox[0pt][l]{\hspace{1.5cm}\hyperlink{Chinese}{\large$ \to $ 中文版}}
409 % }
410 % \author{\LaTeX{}Studio\\ \texttt{\texttt{[email protected]}}\and Liam Huang \\ \texttt{liamhuang0205+\[email protected]}}
411 % \date{\filedate}
412 %
413 % \maketitle
414 %
415 % \renewcommand{\abstractname}{Abstract}
416 % \begin{abstract}
417 % This template is designed for MCM/ICM. The template configured fonts,
418 % header and footer and summary sheet style, accroding to the requirements
419 % of COMAP. This document describes the template.
420 % \end{abstract}
421 %
422 % \section{Introduction}
423 %
424 % This template was designed by latexstudio first, and was improved by him
425 % following the suggestions from contest takers. In the beginning of the year
426 % 2014, Liam Huang redesigned it, by using key-value syntax, and fixed known
427 % bugs. Liam reimplemented it at the begining of the year 2015,
428 % by \pkg{DocStrip}, and uploaded it to CTAN.
429 %
430 % \section{Installation Guide}
431 %
432 % \subsection{Download}
433 %
434 % You could find the latest version of this template at the project
435 % homepage. We will
436 % not maintain any other mirror.
437 %
438 % \begin{description}
439 % \item [CTAN] \url{http://www.ctan.org/pkg/mcmthesis}
440 % \item [GitHub] \url{https://github.com/latexstudio-org/mcmthesis}
441 % \item [\LaTeX Studio] \url{https://www.latexstudio.net}
442 % \end{description}
443 %
444 % Moreover, this template had been uploaded to CTAN, so that it could
445 % be managed by the package manager of your distribution, such as \TeX\ Live.
446 %
447 % \subsection{Installation}
448 %
449 % We denote \path{SOURCE} as the folder, who contains the file you've
450 % just downloaded. Execute these command in the terminal.
451 % \iffalse
452 %<*internal>
453 % \fi
454 \begin{lstlisting}[language=bash]
455 cd SOURCE
456 xetex mcmthesis.dtx
457 xelatex mcmthesis.dtx
458 xelatex mcmthesis.dtx
459 xelatex mcmthesis-demo.tex
460 xelatex mcmthesis-demo.tex
461 \end{lstlisting}
462 % \iffalse
463 %</internal>
464 % \fi
465 %
466 % To finish the installation, you could copy \file{mcmthesis.cls} to
467 % \path{TEXMF/tex/latex/mcmthesis/}, copy \file{mcmthesis.dtx}
468 % to \path{TEXMF/source/latex/mcmthesis/},
469 % copy \file{mcmthesis.pdf}, \file{mcmthesis-demo.tex},
470 % \file{mcmthesis-demo.pdf}, \file{figures/} and \file{code/} to
471 % \path{TEXMF/doc/latex/mcmthesis/}, and then run \verb|texhash| in your
472 % terminal; you could also put \file{mcmthesis.cls} in the same folder of
473 % the master file.
474 %
475 % \file{mcmthesis-demo.tex} is a generated demo file, you could write the
476 % manuscript of you paper by mimicing this file; you may also modify this
477 % file to build your paper.
478 %
479 % \section{Usage}
480 % \subsection{Dependence}
481 % The \pkg{mcmthesis} class depends on the following pakcages.
482 % These packages has been installed in common \TeX{} distribution.
483 % Before installation, please make sure that you have installed these
484 % packages correctly.
485 % \begin{longtable}{cccc}
486 % \toprule
487 % \pkg{xkeyval} & \pkg{etoolbox} & \pkg{fancyhdr} & \pkg{fancybox} \\
488 % \pkg{ifthen} & \pkg{lastpage} & \pkg{listings} & \pkg{appendix} \\
489 % \pkg{amsmath} & \pkg{amssymb} & \pkg{amsfonts} & \pkg{amsbsy} \\
490 % \pkg{bm} & \pkg{mathrsfs} & \pkg{latexsym} & \pkg{paralist} \\
491 % \pkg{longtable} & \pkg{multirow} & \pkg{hhline} & \pkg{tabularx} \\
492 % \pkg{ctex} & \pkg{xeCJK} & \pkg{CJK} & \pkg{xCJK2uni}\\
493 % \pkg{tabu} & \pkg{environ} & \pkg{longtable} & \pkg{hologo}\\
494 % \pkg{array} & \pkg{flafter} & \pkg{pifont} & \pkg{calc} \\
495 % \pkg{colortbl} & \pkg{booktabs} & \pkg{geometry} & \pkg{fontenc}\\
496 % \pkg{berasans} & \pkg{hyperref} & \pkg{ifpdf} & \pkg{ifxetex}\\
497 % \pkg{graphicx} & \pkg{epstopdf} & \pkg{bmpsize} & \pkg{xcolor}\\
498 % \pkg{longtable} & \pkg{tabu} & \pkg{hologo} & \pkg{palatino}\\
499 % \bottomrule
500 % \end{longtable}
501 % If you haven't install these packages, you could execute the package
502 % manager of your distribution and install them; you could also download
503 % them from \url{http://www.ctan.org}.
504 %
505 % \subsection{Options}
506 % \pkg{mcmthesis} defined serval options to control the behaviour of
507 % the template. You could specify these options while loading the class.
508 % \iffalse
509 %<*internal>
510 % \fi
511 \begin{lstlisting}[language={[LaTeX]TeX}]
512 \documentclass[tcn = 12345, problem = B, titlepage = false]{mcmthesis}
513 \end{lstlisting}
514 % \iffalse
515 %</internal>
516 % \fi
517 %\DescribeMacro{\mcmsetup}You may also use the command \cs{mcmsetup}^^A
518 % \marg{key-value list} to specify them.
519 % \iffalse
520 %<*internal>
521 % \fi
522 \begin{lstlisting}[language={[LaTeX]TeX}]
523 \documentclass{mcmthesis}
524 \mcmsetup{tcn = 12345, problem = B, titlepage = false}
525 \end{lstlisting}
526 % \iffalse
527 %</internal>
528 % \fi
529 % The two methods share the same effect.
530 %
531 % \pkg{mcmthesis} has seven options.
532 % \begin{description}
533 % \item [tstyle] change the text color of the team control number and problem no.
534 % \item [tcn] The team control number, recieves a string as value;
535 % this value will be displayed on summary sheet and every page's header.
536 % The default value is \texttt{0000}.
537 % \item [problem] The question, recieves a string as value;
538 % this value will be displayed on summary sheet.
539 % The default value is \texttt{A}.
540 % \item [sheet] Bool, true to print the summary sheet, default
541 % is \texttt{true}.
542 % \item [titleinsheet] Bool, true to print the title in the summary sheet,
543 % default is \texttt{false}.
544 % \item [keywordsinsheet] Bool, true to print keywords in the summary sheet,
545 % default is \texttt{false}.
546 % \item [titlepage] Bool, true to print the titlepage,
547 % default is \texttt{true}.
548 % \item [abstract] Bool, true to print the abstract on the titlepage,
549 % default is \texttt{true}.
550 % \end{description}
551 %
552 % Note that the effect of \texttt{titleinsheet} and \texttt{keywordsinsheet}
553 % are under the control of the option \texttt{sheet}, that is, if
554 % \texttt{sheet} is set to \texttt{false}, title and/or keywords will not be
555 % printed on the summary sheet, whatever the value of these two options are.
556 % On the other hand, the abstract will always be printed on the summary sheet,
557 % if the \texttt{sheet} is set to \texttt{true}. The relationship between
558 % \texttt{abstract} and \texttt{titlepage} is similar to that just mentioned.
559 %
560 % \subsection{Question}
561 %
562 % \DescribeMacro{\problem}Besides using \cs{mcmsetup} to choose question,
563 % you could also use \cs{problem}\marg{Question} to do this.
564 % However, the later one is here just because of backward compatibility,
565 % and is not recommended any longer.
566 %
567 % \subsection{Environment}
568 %
569 % \DescribeEnv{abstract}\DescribeEnv{keywords}
570 % \pkg{mcmthesis} redefined the \env{abstract} environment, and defined a
571 % new environment named \env{keywords}. Note that these two environments
572 % behave like the standard \cs{title} --- they will not print any contents
573 % to the PDF file when they are used but just record them; the output task
574 % belongs to \cs{maketitle}.
575 %
576 % \DescribeEnv{memo}
577 % \pkg{mcmthesis} defines the \env{memo} environment, which accepts one optional
578 % argument as the title. This work is inspired by the fact that in recent years,
579 % MCM requires students to provide a letter or memorandum as a part of the thesis.
580 %
581 % \DescribeMacro{memoto}\DescribeMacro{memofrom}\DescribeMacro{memosubject}
582 % \DescribeMacro{memodate}\DescribeMacro{memologo}
583 % The \env{memo} environment is defined with some helper macros listed below:
584 % \begin{description}
585 % \item[\cs{memoto}] describes the person you want to leave the memorandum to.
586 % \item[\cs{memofrom}] describes who is the author of the memorandum.
587 % \item[\cs{memosubject}] describes the subject of the memorandum.
588 % \item[\cs{memodate}] describes the date of the memorandum.
589 % \item[\cs{memologo}] the command that will be executed to print a logo for the memorandum.
590 % \end{description}
591 %
592 % \subsection{The headset of the Summary Sheet}
593 % \DescribeMacro{\headset}Due to the frequent change of the headset's style of the Summary Sheet from the host of MCM/ICM, it's difficult for me to keep in with. Hence, a easy-to-modified interfaced is designed. Let's see an succinct example:
594 % \iffalse
595 %<*internal>
596 % \fi
597 \begin{lstlisting}[language={[LaTeX]TeX}]
598 \renewcommand{\headset}{{\Large\the\year}\\MCM/ICM\\Summary Sheet}
599 \end{lstlisting}
600 % \iffalse
601 %</internal>
602 % \fi
603 % while the output is:
604 % \begin{trivlist}\item
605 % \newcommand{\headset}{{\Large\the\year}\\MCM/ICM\\Summary Sheet}
606 % \begin{center}
607 % \textbf{\headset}
608 % \end{center}
609 % \end{trivlist}
610 %
611 % \subsection{Compilation Workflow}
612 %
613 % The template supports various kinds of compilation workflow:
614 % \begin{itemize}
615 % \item \XeLaTeX (If with chinese and so on);
616 % \item pdf\LaTeX\ (\textbf{recommend});
617 % \item \LaTeX{} + DVIPDFMx。
618 % \end{itemize}
619 %
620 %
621 % \section{History}
622 % \begin{description}
623 % \item [5.1.0a] First release to CTAN.
624 % \item [5.1.0b] Fix the bug of \textsf{CheckSum} and typos.
625 % \item [5.1.0c] Import options, such as \mopt{titleinsheet}.
626 % \item [5.1.0d] Change the way to define \mopt{problem}, create
627 % \cs{mcmsetup}\marg{key-val list} to modify the option, slightly lift
628 % the table on the summary sheet, fix the
629 % bug of page number and fix the bug of title, abstract and keywords.
630 % \item [5.1.0e] Redefine the table at the top of the summary sheet to
631 % match the latest summary sheet from COMAP, the maker of the contest.
632 % \item [5.1.0f] Cancle the red emphasizing of tcn and problem mark in the
633 % table at the topo of the summary sheet.
634 % \item [6.0] Change the output style slightly.
635 % \item [6.1] Bugfix.
636 % \item [6.2] Making headset of the Summary Sheet modifible.
637 % \item [6.2.1] Change default fontsize, from |11pt| to |12pt|.
638 % \item [6.3] Change summary sheet layout and demo code.
639 % \item [6.3.1] Change the default papersize, frome |a4paper| to |letterpaper|.
640 % \item [6.3.2] fixed some bugs and ctex compatibility.
641 % \item [6.3.3] Fixed several styling errors and added the reference style for the generative AI.
642 % \end{description}
643 %
644 % \StopEventually{}
645 % \section{The Implementation}
646 % \subsection{Basic Information}
647 % \begin{macrocode}
648 %<*class>
649 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
650 \ProvidesClass{mcmthesis}
651 [2024/01/22 v6.3.3 The Thesis Template Designed For MCM/ICM]
652 \typeout{The Thesis Template Designed For MCM/ICM}
653 \def\MCMversion{v6.3.3}
654 % \end{macrocode}
655 % \subsection{Options}
656 %
657 % Loading \pkg{xkeyval} and \pkg{etoolbox} to handle key-value options.
658 % \begin{macrocode}
659 \RequirePackage{xkeyval}
660 \RequirePackage{etoolbox}
661 % \end{macrocode}
662 %
663 % Declaring options.
664 % \begin{macrocode}
665 \define@boolkey{MCM}[MCM@opt@]{CTeX}[false]{}
666 \define@boolkey{MCM}[MCM@opt@]{titlepage}[true]{}
667 \define@boolkey{MCM}[MCM@opt@]{abstract}[true]{}
668 \define@boolkey{MCM}[MCM@opt@]{sheet}[true]{}
669 \define@boolkey{MCM}[MCM@opt@]{titleinsheet}[false]{}
670 \define@boolkey{MCM}[MCM@opt@]{keywordsinsheet}[false]{}
671 \define@cmdkeys{MCM}[MCM@opt@]{tcn,problem,tstyle}
672 \define@key{MCM}{tcn}[0000]{\gdef\MCM@opt@tcn{#1}}
673 \define@key{MCM}{problem}[A]{\gdef\MCM@opt@problem{#1}}
674 \define@key{MCM}{tstyle}[A]{\gdef\MCM@opt@tstyle{#1}}
675 \setkeys{MCM}{tcn=0000,problem=B,tstyle=\color{red}\bfseries}
676
677 \define@key{mcmthesis.cls}{tcn}[0000]{\gdef\MCM@opt@tcn{#1}}
678 \define@key{mcmthesis.cls}{problem}[A]{\gdef\MCM@opt@problem{#1}}
679 \define@key{mcmthesis.cls}{tstyle}[A]{\gdef\MCM@opt@tstyle{#1}}
680 \define@boolkey{mcmthesis.cls}[MCM@opt@]{CTeX}{}
681 \define@boolkey{mcmthesis.cls}[MCM@opt@]{titlepage}{}
682 \define@boolkey{mcmthesis.cls}[MCM@opt@]{abstract}{}
683 \define@boolkey{mcmthesis.cls}[MCM@opt@]{sheet}{}
684 \define@boolkey{mcmthesis.cls}[MCM@opt@]{titleinsheet}{}
685 \define@boolkey{mcmthesis.cls}[MCM@opt@]{keywordsinsheet}{}
686 \MCM@opt@sheettrue
687 \MCM@opt@titlepagetrue
688 \MCM@opt@titleinsheetfalse
689 \MCM@opt@keywordsinsheetfalse
690 \MCM@opt@abstracttrue
691 % \end{macrocode}
692 %
693 % \begin{macro}{\mcmsetup}
694 %
695 % \begin{macrocode}
696 \newcommand{\mcmsetup}[1]{\setkeys{MCM}{#1}}
697 % \end{macrocode}
698 % \end{macro}
699 %
700 % Processing options.
701 % \begin{macrocode}
702 \ProcessOptionsX\relax
703 % \end{macrocode}
704 %
705 % Loading document class.
706 % \begin{macrocode}
707 \LoadClass[letterpaper, 12pt]{article}
708 % \end{macrocode}
709 %
710 % User interface.
711 % \begin{macrocode}
712 \newcommand{\team}{Team \#\ \MCM@opt@tcn}
713 % \end{macrocode}
714 % \subsection{Loading Packages}
715 % \begin{macrocode}
716 \RequirePackage{fancyhdr, fancybox}
717 \RequirePackage{ifthen}
718 % \RequirePackage{lastpage}
719 \RequirePackage{listings}
720 \RequirePackage[toc, page, title, titletoc, header]{appendix}
721 \RequirePackage{paralist}
722 \RequirePackage{amsthm, amsfonts}
723 \RequirePackage{amsmath, bm}
724 \RequirePackage{amssymb, mathrsfs}
725 \RequirePackage{latexsym}
726 \RequirePackage{longtable, multirow, hhline, tabularx, array}
727 \RequirePackage{flafter}
728 \RequirePackage{pifont, calc}
729 \RequirePackage{colortbl, booktabs}
730 \RequirePackage{geometry}
731 \RequirePackage[T1]{fontenc}
732 \RequirePackage[scaled]{berasans}
733 \RequirePackage{hyperref}
734 \RequirePackage{ifpdf, ifxetex}
735 \ifMCM@opt@CTeX
736 \else
737 \RequirePackage{environ}
738 \fi
739 % \end{macrocode}
740 %
741 % Loading \pkg{graphicx} and its relations after checking drivers.
742 % \begin{macrocode}
743 \ifpdf
744 \RequirePackage{graphicx}
745 \RequirePackage{epstopdf}
746 \else
747 \ifxetex
748 \RequirePackage{graphicx}
749 \else
750 \RequirePackage[dvipdfmx]{graphicx}
751 \RequirePackage{bmpsize}
752 \fi
753 \fi
754 \RequirePackage[svgnames]{xcolor}
755 % \end{macrocode}
756 % \subsection{\pkg{hyperref} Settings}
757 % \begin{macrocode}
758 \ifpdf
759 \hypersetup{hidelinks}
760 \else
761 \ifxetex
762 \hypersetup{hidelinks}
763 \else
764 \hypersetup{dvipdfm, hidelinks}
765 \fi
766 \fi
767 % \end{macrocode}
768 % \subsection{Page Layout}
769 % Setting paper size and margin sep.
770 % \begin{macrocode}
771 \geometry{letterpaper, margin = 1in}
772 % \end{macrocode}
773 %
774 % Making the footer and header.
775 % \begin{macrocode}
776 \fancypagestyle{main}{
777 \fancyhf{}
778 \lhead{\small\sffamily \team}
779 \rhead{\small\sffamily Page \thepage\ of \pageref{LastPage}}
780 }
781 \pagestyle{main}
782
783 \fancypagestyle{aimain}{
784 \fancyhf{}
785 \lhead{\small\sffamily \team}
786 \rhead{\small\sffamily Page \thepage }
787 }
788 % \end{macrocode}
789 %
790 % Setting \cs{parskip}.
791 % \begin{macrocode}
792 \setlength\parskip{.5\baselineskip}
793 % \end{macrocode}
794 % \subsection{Redefining TOC}
795 % \begin{macrocode}
796 \renewcommand\tableofcontents{%
797 \centerline{\normalfont\Large\bfseries\sffamily\contentsname
798 \@mkboth{%
799 \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
800 \vskip 5ex%
801 \@starttoc{toc}%
802 }
803 % \end{macrocode}
804 % \subsection{Mastering Floats, Figures and Tables}
805 % Setting counters. Here \cntr{totalnumber} is the maximum number of
806 % floats on a text page, \cntr{topnumber} is the maximum number of
807 % floats at top of a text page and \cntr{bottomnumber} is the maximum
808 % number of floats at bottom of a text page. Obviously, we have
809 % $ \text{\cntr{totalnumber}} = \text{\cntr{topnumber}} +
810 % \text{\cntr{bottomnumber}} $.
811 % \begin{macrocode}
812 \setcounter{totalnumber}{4}
813 \setcounter{topnumber}{2}
814 \setcounter{bottomnumber}{2}
815 % \end{macrocode}
816 %
817 % Setting float fractions.
818 % \begin{macrocode}
819 \renewcommand{\textfraction}{0.15}
820 \renewcommand{\topfraction}{0.85}
821 \renewcommand{\bottomfraction}{0.65}
822 \renewcommand{\floatpagefraction}{0.60}
823 % \end{macrocode}
824 %
825 % Setting caption names.
826 % \begin{macrocode}
827 \renewcommand{\figurename}{Figure}
828 \renewcommand{\tablename}{Table}
829 % \end{macrocode}
830 %
831 % Setting graphic paths.
832 % \begin{macrocode}
833 \graphicspath{{./}{./img/}{./fig/}{./image/}{./figure/}{./picture/}
834 {./imgs/}{./figs/}{./images/}{./figures/}{./pictures/}}
835 % \end{macrocode}
836 % \subsection{Designing Sheets and their Relations}
837 % Redefining \cs{maketitle}, which will check if the control
838 % sheet and titlepage should be printed.
839 % \begin{macrocode}
840 \def\maketitle{%
841 %\let\saved@thepage\thepage
842 %\let\thepage\relax
843 \ifMCM@opt@sheet
844 \makesheet
845 \fi
846 \newpage
847 \setcounter{page}{1}
848 \pagestyle{fancy}
849 \ifMCM@opt@titlepage
850 \MCM@maketitle
851 \fi
852 \newpage
853 }
854 % \end{macrocode}
855 %
856 % Making the \env{abstract} environment.
857 % \begin{macrocode}
858 \def\abstractname{Summary}
859 \ifMCM@opt@CTeX
860 \newbox\@abstract%
861 \setbox\@abstract\hbox{}%
862 \long\def\abstract{\bgroup\global\setbox\@abstract\vbox\bgroup\hsize\textwidth\leftskip1cm\rightskip1cm}%
863 \def\endabstract{\egroup\egroup}%
864 \def\make@abstract{%
865 \begin{center}%
866 \textbf{\abstractname}%
867 \end{center}%
868 \usebox\@abstract\par
869 }
870 \else
871 \RenewEnviron{abstract}{\xdef\@abstract{\expandonce\BODY}}
872 \def\make@abstract{%
873 \begin{center}%
874 \textbf{\abstractname}%
875 \end{center}%
876 \@abstract\par
877 }
878 \fi
879 \newenvironment{letter}[1]{%
880 \par%
881 \bgroup\parindent0pt%
882 \begin{minipage}{5cm}
883 \flushleft #1%
884 \end{minipage}}
885 {\egroup\smallskip}
886
887 % \end{macrocode}
888 %
889 % Making the \env{keywords} environment.
890 % \begin{macrocode}
891 \def\keywordsname{Keywords}
892 \ifMCM@opt@CTeX
893 \newbox\@keywords
894 \setbox\@keywords\hbox{}
895 \def\keywords{\global\setbox\@keywords\vbox\bgroup\noindent\leftskip0cm}
896 \def\endkeywords{\egroup}%
897 \def\make@keywords{%
898 \par\hskip.4cm\textbf{\keywordsname}: \usebox\@keywords\hfill\par
899 }
900 \else
901 \NewEnviron{keywords}{\xdef\@keywords{\expandonce\BODY}}
902 \def\make@keywords{%
903 \par\noindent\textbf{\keywordsname}:
904 \@keywords\par
905 }
906 \fi
907 % \end{macrocode}
908 %
909 % \begin{macro}{\headset}
910 %
911 % \begin{macrocode}
912 \newcommand{\headset}{{\the\year}\\MCM/ICM\\Summary Sheet}
913 % \end{macrocode}
914 % \end{macro}
915 %
916 % Defining the \cs{makesheet}.
917 % \begin{macrocode}
918 \newcommand{\problem}[1]{\mcmsetup{problem = #1}}
919 \def\makesheet{%
920 \thispagestyle{empty}%
921 \null%
922 \vspace*{-5pc}%
923 \begin{center}
924 \begingroup
925 \setlength{\parindent}{0pt}
926 \begin{minipage}[t]{0.33\linewidth}
927 \centering%
928 \textbf{Problem Chosen}\\[0.7pc]
929 {\Large \MCM@opt@tstyle {\MCM@opt@problem}}\\[2.8pc]
930 \end{minipage}%
931 \begin{minipage}[t]{0.33\linewidth}
932 \centering%
933 \textbf{\headset}%
934 \end{minipage}%
935 \begin{minipage}[t]{0.33\linewidth}
936 \centering%
937 \textbf{Team Control Number}\\[0.7pc]
938 {\Large\MCM@opt@tstyle{\MCM@opt@tcn}}\\[2.8pc]
939 \end{minipage}\par
940 \rule{\linewidth}{1.5pt}
941 \endgroup
942 \vskip 5pt%
943 \ifMCM@opt@titleinsheet
944 \normalfont \LARGE \@title \par
945 \fi
946 \end{center}
947 \ifMCM@opt@keywordsinsheet
948 \make@abstract
949 \make@keywords
950 \else
951 \make@abstract
952 \fi}
953 % \end{macrocode}
954 %
955 % Defining the \cs{MCM@maketitle}
956 % \begin{macrocode}
957 \newcommand{\MCM@maketitle}{%
958 %\let\thepage\saved@thepage
959 %\setcounter{page}{1}
960 \begin{center}%
961 \let \footnote \thanks%
962 \pagestyle{fancy}%
963 {\LARGE \@title \par}%
964 \vskip 1.5em%
965 {\large
966 \lineskip .5em%
967 \begin{tabular}[t]{c}%
968 \@author
969 \end{tabular}\par}%
970 \vskip 1em%
971 {\large \@date}%
972 \end{center}%
973 \par
974 \vskip 1.5em%
975 \ifMCM@opt@abstract%
976 \make@abstract
977 \make@keywords
978 \fi%
979 }
980 % \end{macrocode}
981 %
982 % \changes{6.3.3}{2024/01/22}{新增生成式AI引用样式}
983 % \subsection{the memo environment}
984 % Defining macros to store information here.
985 % \begin{macrocode}
986 \def\MCM@memoto{\relax}
987 \newcommand{\memoto}[1]{\gdef\MCM@memoto{#1}}
988 \def\MCM@memofrom{\relax}
989 \newcommand{\memofrom}[1]{\gdef\MCM@memofrom{#1}}
990 \def\MCM@memosubject{\relax}
991 \newcommand{\memosubject}[1]{\gdef\MCM@memosubject{#1}}
992 \def\MCM@memodate{\relax}
993 \newcommand{\memodate}[1]{\gdef\MCM@memodate{#1}}
994 \def\MCM@memologo{\relax}
995 \newcommand{\memologo}[1]{\gdef\MCM@memologo{\protect #1}}
996 \def\@letterheadaddress{\relax}
997 \newcommand{\lhaddress}[1]{\gdef\@letterheadaddress{#1}}
998 % \end{macrocode}
999 %
1000 % Now, we could define the |memo| environment.
1001 % \begin{macrocode}
1002 \newenvironment{memo}[1][Memorandum]{%
1003 \pagestyle{fancy}%
1004 \ifthenelse{\equal{\MCM@memologo}{\relax}}{%
1005 % without logo specified.
1006 }{%
1007 % with logo specified
1008 \begin{minipage}[t]{\columnwidth}%
1009 \begin{flushright}
1010 \vspace{-0.2in}
1011 \MCM@memologo
1012 \vspace{0.5in}
1013 \par\end{flushright}%
1014 \end{minipage}%
1015 }
1016 \begin{center}
1017 \LARGE\bfseries\scshape
1018 #1
1019 \end{center}
1020 \begin{description}
1021 \ifthenelse{\equal{\MCM@memoto}{\relax}}{}{\item [{To:}] \MCM@memoto}
1022 \ifthenelse{\equal{\MCM@memofrom}{\relax}}{}{\item [{From:}] \MCM@memofrom}
1023 \ifthenelse{\equal{\MCM@memosubject}{\relax}}{}{\item [{Subject:}] \MCM@memosubject}
1024 \ifthenelse{\equal{\MCM@memodate}{\relax}}{}{\item [{Date:}] \MCM@memodate}
1025 \end{description}
1026 \par\noindent
1027 \rule[0.5ex]{\linewidth}{0.1pt}\par
1028 \bigskip{}
1029 }{%
1030 \clearpage
1031 \pagestyle{fancy}%
1032 }
1033 % \end{macrocode}
1034 % \subsection{Mathematics}
1035 % Theorems.
1036 % \begin{macrocode}
1037 \newtheorem{Theorem}{Theorem}[section]
1038 \newtheorem{Lemma}[Theorem]{Lemma}
1039 \newtheorem{Corollary}[Theorem]{Corollary}
1040 \newtheorem{Proposition}[Theorem]{Proposition}
1041 \newtheorem{Definition}[Theorem]{Definition}
1042 \newtheorem{Example}[Theorem]{Example}
1043 % \end{macrocode}
1044 %
1045 % define the section fonts and spaces.
1046 % \begin{macrocode}
1047 \renewcommand\section{\@startsection{section}{1}{\z@}%
1048 {-1sp\@plus -.2ex \@minus -.2ex}%
1049 {1pt \@plus .2ex}%
1050 {\rmfamily\Large\bfseries}}
1051 \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
1052 {-1sp\@plus -.2ex \@minus -.2ex}%
1053 {1pt \@plus .2ex}%
1054 {\rmfamily\large\bfseries}}
1055 \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
1056 {-.5ex\@plus -1ex \@minus -.2ex}%
1057 {.25ex \@plus .2ex}%
1058 {\rmfamily\normalsize\bfseries}}
1059 \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
1060 {1ex \@plus1ex \@minus.2ex}%
1061 {-1em}%
1062 {\rmfamily\normalsize}}
1063 % \end{macrocode}
1064
1065 % Other definitions.
1066 % \begin{macrocode}
1067 \providecommand{\dif}{\mathop{}\!\mathrm{d}}
1068 \providecommand{\me}{\mathrm{e}}
1069 \providecommand{\mi}{\mathrm{i}}
1070 % \end{macrocode}
1071 % \subsection{Listing Settings}
1072 % \begin{macrocode}
1073
1074
1075 \definecolor{grey}{rgb}{0.8,0.8,0.8}
1076 \definecolor{darkgreen}{rgb}{0,0.3,0}
1077 \definecolor{darkblue}{rgb}{0,0,0.3}
1078 \def\lstbasicfont{\fontfamily{pcr}\selectfont\footnotesize}
1079 \lstset{%
1080 % indexing
1081 % numbers=left,
1082 % numberstyle=\small,%
1083 % character display
1084 showstringspaces=false,
1085 showspaces=false,%
1086 tabsize=4,%
1087 % style
1088 frame=lines,%
1089 basicstyle={\footnotesize\lstbasicfont},%
1090 keywordstyle=\color{darkblue}\bfseries,%
1091 identifierstyle=,%
1092 commentstyle=\color{darkgreen},%\itshape,%
1093 stringstyle=\color{black},%
1094 breaklines=true,%
1095 postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space}
1096 }
1097 \lstloadlanguages{C,C++,Java,Matlab,python,Mathematica}
1098
1099 % \end{macrocode}
1100 % \subsection{Report on Use of AI Settings}
1101 % \begin{macrocode}
1102
1103 \def\AIcite{\@newl@bel b}
1104 \let\citation\@gobble
1105 \DeclareRobustCommand\AIcite{%
1106 \@ifnextchar [{\@tempswatrue\@AIcitex}{\@tempswafalse\@AIcitex[]}}
1107 \def\@AIcitex[#1]#2{\leavevmode
1108 \let\@AIcitea\@empty
1109 \@AIcite{\@for\@AIciteb:=#2\do
1110 {\@AIcitea\def\@AIcitea{,\penalty\@m\ }%
1111 \edef\@AIciteb{\expandafter\@firstofone\@AIciteb\@empty}%
1112 \if@filesw\immediate\write\@auxout{\string\citation{\@AIciteb}}\fi
1113 \@ifundefined{b@\@AIciteb}{\hbox{\reset@font\bfseries ?}%
1114 \G@refundefinedtrue
1115 \@latex@warning
1116 {Citation `\@AIciteb' on page \thepage \space undefined}}%
1117 {\@AIcite@ofmt{\csname b@\@AIciteb\endcsname}}}}{#1}}
1118 \def\@AIcite#1#2{[AI: {#1\if@tempswa , #2\fi}]}
1119 \let\@AIcite@ofmt\hbox
1120
1121 \def\reportname{Report on Use of AI}
1122
1123 \providecommand\@AIlabel[1]{#1.~}
1124
1125 \newenvironment{ReportAiUse}[1]
1126 {\centerline{\underline{\large\sffamily\bfseries\reportname}}%
1127 \vspace*{-.2em}
1128 \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
1129 \list{\@AIlabel{\@arabic\c@enumiv}}%
1130 {\settowidth\labelwidth{\@AIlabel{#1}}%
1131 \leftmargin\labelwidth
1132 \advance\leftmargin\labelsep
1133 \@openbib@code
1134 \usecounter{enumiv}%
1135 \let\p@enumiv\@empty
1136 \renewcommand\theenumiv{\@arabic\c@enumiv}}%
1137 \sloppy
1138 \clubpenalty4000
1139 \@clubpenalty \clubpenalty
1140 \widowpenalty4000%
1141 \sfcode`\.\@m}
1142 {\def\@noitemerr
1143 {\@latex@warning{Empty `thebibliography' environment}}%
1144 \endlist}
1145 \def\AImatter{\label{LastPage}\clearpage\pagestyle{aimain}}
1146 % \end{macrocode}
1147 % \begin{macrocode}
1148 %</class>
1149 %<class>\endinput
1150 % \end{macrocode}
1151 % \iffalse
1152 %<*demo>
1153 %!TEX program = pdflatex|xelatex
1154 %% !Mode:: "TeX:UTF-8"
1155 \documentclass{mcmthesis}
1156 %\documentclass[CTeX = true]{mcmthesis} % 当使用 CTeX 套装时请注释上一行使用该行的设置
1157 \mcmsetup{tstyle=\color{red}\bfseries,%修改题号,队号的颜色和加粗显示,黑色可以修改为 black
1158 tcn = 0000, problem = A, %修改队号,参赛题号
1159 sheet = true, titleinsheet = true, keywordsinsheet = true,
1160 titlepage = false, abstract = true}
1161
1162 %四款字体可以选择
1163 %\usepackage{times}
1164 %\usepackage{newtxtext}
1165 %\usepackage{palatino}
1166 \usepackage{txfonts}
1167
1168 \usepackage{indentfirst} %首行缩进,注释掉,首行就不再缩进。
1169 \usepackage{lipsum}
1170 \title{The \LaTeX{} Template for MCM Version \MCMversion}
1171 \author{\small \href{https://www.latexstudio.net/}
1172 {\includegraphics[width=7cm]{mcmthesis-logo}}}
1173 \date{\today}
1174 \begin{document}
1175 \begin{abstract}
1176 \par Use this template to begin typing the first page (summary page) of your electronic report. This template uses a 12-point Times New Roman font. Submit your paper as an Adobe PDF electronic file (e.g. 1111111.pdf), typed in English, with a readable font of at least 12-point type.
1177
1178 Do not include the name of your school, advisor, or team members on this or any page.
1179
1180 Papers must be within the 25 page limit.
1181
1182 Be sure to change the control number and problem choice above.
1183 You may delete these instructions as you begin to type your report here.
1184
1185 Follow us @COMAPMath on Twitter or COMAPCHINAOFFICIAL on Weibo for the most up to date contest information.
1186
1187 \begin{keywords}
1188 keyword1; keyword2
1189 \end{keywords}
1190 \end{abstract}
1191 \maketitle
1192 %% Generate the Table of Contents, if it's needed.
1193 \tableofcontents
1194 \newpage
1195 %%
1196 %% Generate the Memorandum, if it's needed.
1197 %% \memoto{\LaTeX{}studio}
1198 %% \memofrom{Liam Huang}
1199 %% \memosubject{Happy \TeX{}ing!}
1200 %% \memodate{\today}
1201 %% \memologo{\LARGE I'm pretending to be a LOGO!}
1202 %% \begin{memo}[Memorandum]
1203 %% \lipsum[1-3]
1204 %% \end{memo}
1205 %%
1206 \section{Introduction}
1207 \subsection{What's this all about? What's \LaTeX?}
1208 \LaTeX\ is a document preparation system which uses the \TeX\
1209 typesetting program. It enables you to produce
1210 publication-quality documents with great accuracy and
1211 consistency. \LaTeX\ works on any computer and produces
1212 industry-standard PDF. It is available both in free (open-source)
1213 and commercial implementations. \LaTeX\ can be used for any kind
1214 of document, but it is especially suited to those with complex
1215 structures, repetitive formatting, or notations like
1216 mathematics. Install the software from
1217 \url{www.tug.org/texlive/}.
1218 \subsection{Creating and typesetting your document}
1219
1220 Follow our WeChat official account for more LaTeX materials and information.
1221
1222 \centerline{\includegraphics[width=5cm]{qrcodewechat}}
1223
1224 \subsection{Syntax (how to type \LaTeX\ commands --- these
1225 are the rules)}
1226
1227 \lipsum[3]
1228 \begin{itemize}
1229 \item the angular velocity of the bat,
1230 \item the velocity of the ball, and
1231 \item the position of impact along the bat.
1232 \end{itemize}
1233 \lipsum[4]
1234 \emph{center of percussion} [Brody 1986], \lipsum[5]
1235
1236 \begin{Theorem} \label{thm:latex}
1237 \LaTeX
1238 \end{Theorem}
1239 \begin{Lemma} \label{thm:tex}
1240 \TeX .
1241 \end{Lemma}
1242 \begin{proof}
1243 The proof of theorem.
1244 \end{proof}
1245
1246 \subsection{Other Assumptions}
1247 \lipsum[6]
1248 \begin{itemize}
1249 \item
1250 \item
1251 \item
1252 \item
1253 \end{itemize}
1254
1255 \lipsum[7]
1256
1257 \section{Analysis of the Problem}
1258 \begin{figure}[h]
1259 \small
1260 \centering
1261 \includegraphics[width=8cm]{example-image-a}
1262 \caption{The name of figure} \label{fig:aa}
1263 \end{figure}
1264
1265 \lipsum[8] \eqref{aa}
1266 \begin{equation}
1267 a^2 \label{aa}
1268 \end{equation}
1269
1270 \[
1271 \begin{pmatrix}{*{20}c}
1272 {a_{11} } & {a_{12} } & {a_{13} } \\
1273 {a_{21} } & {a_{22} } & {a_{23} } \\
1274 {a_{31} } & {a_{32} } & {a_{33} } \\
1275 \end{pmatrix}
1276 = \frac{{Opposite}}{{Hypotenuse}}\cos ^{ - 1} \theta \arcsin \theta
1277 \]
1278 \lipsum[9]
1279
1280 \[
1281 p_{j}=\begin{cases} 0,&\text{if $j$ is odd}\\
1282 r!\,(-1)^{j/2},&\text{if $j$ is even}
1283 \end{cases}
1284 \]
1285
1286 \lipsum[10]
1287
1288 \[
1289 \arcsin \theta =
1290 \mathop{{\int\!\!\!\!\!\int\!\!\!\!\!\int}} \limits_\varphi
1291 {\mathop {\lim }\limits_{x \to \infty } \frac{{n!}}{{r!\left( {n - r}
1292 \right)!}}} \eqno (1)
1293 \]
1294
1295 \section{Calculating and Simplifying the Model }
1296 \lipsum[11]
1297
1298 \section{The Model Results}
1299 \lipsum[6]
1300
1301 \section{Validating the Model}
1302 \lipsum[9]
1303
1304 \section{Conclusions}
1305 \lipsum[6]
1306
1307 \section{A Summary}
1308 \lipsum[6]
1309
1310 \section{Evaluate of the Mode}
1311
1312 \section{Strengths and weaknesses}
1313 \lipsum[12]
1314
1315 \subsection{Strengths}
1316 \begin{itemize}
1317 \item \textbf{Applies widely}\\
1318 This system can be used for many types of airplanes, and it also
1319 solves the interference during the procedure of the boarding
1320 airplane,as described above we can get to the optimization
1321 boarding time.We also know that all the service is automate.
1322 \item \textbf{Improve the quality of the airport service}\\
1323 Balancing the cost of the cost and the benefit, it will bring in
1324 more convenient for airport and passengers.It also saves many
1325 human resources for the airline.
1326 \end{itemize}
1327
1328 \subsection{How to cite?}
1329 bibliography cite use \cite{1,2,3}
1330
1331 AI cite use \AIcite{AI1,AI2,AI3}
1332
1333 \begin{thebibliography}{99}
1334 \bibitem{1} D.~E. KNUTH The \TeX{}book the American
1335 Mathematical Society and Addison-Wesley
1336 Publishing Company , 1984-1986.
1337 \bibitem{2}Lamport, Leslie, \LaTeX{}: `` A Document Preparation System '',
1338 Addison-Wesley Publishing Company, 1986.
1339 \bibitem{3}\url{https://www.latexstudio.net/}
1340 \end{thebibliography}
1341
1342 \begin{appendices}
1343
1344 \section{First appendix}
1345
1346 In addition, your report must include a letter to the Chief Financial Officer (CFO) of the Goodgrant Foundation, Mr. Alpha Chiang, that describes the optimal investment strategy, your modeling approach and major results, and a brief discussion of your proposed concept of a return-on-investment (ROI). This letter should be no more than two pages in length.
1347
1348
1349 \begin{letter}{Dear, Mr. Alpha Chiang}
1350
1351 \lipsum[1-2]
1352
1353
1354 \vspace{\parskip}
1355
1356 Sincerely yours,
1357
1358 Your friends
1359
1360 \end{letter}
1361 Here are simulation programmes we used in our model as follow.\\
1362
1363 \textbf{\textcolor[rgb]{0.98,0.00,0.00}{Input matlab source:}}
1364 \lstinputlisting[language=Matlab]{./code/mcmthesis-matlab1.m}
1365
1366 \section{Second appendix}
1367
1368 some more text \textcolor[rgb]{0.98,0.00,0.00}{\textbf{Input C++ source:}}
1369 \lstinputlisting[language=C++]{./code/mcmthesis-sudoku.cpp}
1370
1371 \end{appendices}
1372
1373 %\label{LastPage} % put the label at end of paper
1374
1375 \AImatter
1376
1377 \begin{ReportAiUse}{9}
1378 \bibitem{AI1}
1379 Bing AI\\
1380 Query1: write a sort algorithm\\
1381 Output: Sure, I can help you with that. Here is a simple implementation of the selection sort algorithm in Python:
1382 % Python
1383 \begin{lstlisting}[language=python]
1384 def selection_sort(arr):
1385 for i in range(len(arr)):
1386 min_idx = i
1387 for j in range(i + 1, len(arr)):
1388 if arr[min_idx] > arr[j]:
1389 min_idx = j
1390 arr[i], arr[min_idx] = arr[min_idx], arr[i]
1391 return arr
1392 \end{lstlisting}
1393 % AI-generated code. Review and use carefully. More info on FAQ.
1394 This algorithm sorts an array by repeatedly finding the minimum element from the unsorted part of the array and putting it at the beginning. \href{https://www.geeksforgeeks.org/sorting-algorithms/}{The time complexity of this algorithm is O($n^2$)}.
1395
1396 There are many other sorting algorithms available such as bubble sort, insertion sort, merge sort, quick sort, heap sort, and more. Each of these algorithms has its own advantages and disadvantages. You can learn more about them on GeeksforGeeks and Programiz.
1397
1398 I hope this helps!
1399
1400 \bibitem{AI2}
1401 OpenAl Enie (Nov 5, 2023 version, Ernie 4.0)\\
1402 Query1: <insert the exact wording of any subsequent input into the Al tool>\\
1403 Output: <insert the complete output from the second query>
1404
1405 \bibitem{AI3}
1406 Github CoPilot (Feb 3, 2024 version)\\
1407 Query1: <insert the exact wording you input into the Al tool>\\
1408 Output: <insert the complete output fron the Al tool>
1409
1410 \bibitem{AI4}
1411 Google Bard (Feb 2,2024 version)\\
1412 Query: <insert the exact wording of your query>\\
1413 Output: <irsert the complete output from the Al tool>
1414
1415 \bibitem{AI5}
1416 Bing AI\\
1417 Query: write a FFT algorithm\\
1418 Output: Sure, here is a Python implementation of the Fast Fourier Transform (FFT) algorithm:
1419 \begin{lstlisting}[language=python]
1420 import numpy as np
1421
1422 def fft(x):
1423 n = len(x)
1424 if n == 1:
1425 return x
1426 even = fft(x[0::2])
1427 odd = fft(x[1::2])
1428 T = [np.exp(-2j * np.pi * k / n) * odd[k] for k in range(n // 2)]
1429 return [even[k] + T[k] for k in range(n // 2)] + [even[k] - T[k] for k in range(n // 2)]
1430 \end{lstlisting}
1431 % AI-generated code. Review and use carefully. More info on FAQ.
1432 The FFT is a widely used algorithm for computing the \textbf{Discrete Fourier Transform (DFT)} of a sequence. It reduces the number of computations needed from O(n$^2$) to O(n log n) 12. The basic idea of the FFT is to apply divide and conquer. We divide the coefficient vector of the polynomial into two vectors, recursively compute the DFT for each of them, and combine the results to compute the DFT of the complete polynomial 3.
1433
1434 I hope this helps!
1435
1436 \end{ReportAiUse}
1437
1438 \end{document}
1439 %</demo>
1440 %<*readme>
1441 # The `mcmthesis` Class
1442
1443 This class is designed for the MCM/ICM.
1444
1445 This work is released under the [LaTeX Project Public
1446 License](http://www.latex-project.org/lppl.txt), v1.3c or later.
1447
1448 ## Installation
1449
1450 ```plain
1451 This work consists of the file mcmthesis.dtx,
1452 figures/, and
1453 code/,
1454 and the derived files mcmthesis.cls,
1455 mcmthesis-demo.tex,
1456 README,
1457 LICENSE,
1458 mcmthesis.pdf and
1459 mcmthesis-demo.pdf.
1460
1461 To install this class, you should
1462 compile mcmthesis.dtx with xetex mcmthesis.dtx,
1463 compile mcmthesis.dtx with xelatex mcmthesis.dtx twice,
1464 compile mcmthesis-demo.tex with xelatex mcmthesis-demo.tex twice,
1465 rename README.tex and LICENSE.tex respectively to README and LICENSE,
1466 move mcmthesis.cls to TEXMF/tex/latex/mcmthesis/,
1467 move mcmthesis.dtx to TEXMF/source/latex/mcmthesis/,
1468 move other files to TEXMF/doc/latex/mcmthesis/ and then
1469 run texhash.
1470 ```
1471
1472 ## Authors
1473
1474 * [latexstudio][latexstudio]: [email protected]
1475 * [Liam Huang][liam-ctan]: [email protected]
1476
1477 ## Project Page
1478
1479 If you are interested in the process of development you may observe
1480
1481 <https://github.com/latexstudio-org/mcmthesis>
1482
1483 [latexstudio]: http://www.latexstudio.net/
1484 [liam-ctan]: http://www.ctan.org/author/huang-l
1485 %</readme>
1486 %<*license>
1487 Released under the [LaTeX Project Public License]
1488 (http://www.latex-project.org/lppl.txt), v1.3c or later.
1489
1490 The package has status 'maintained': the current maintainer is
1491 [latexstudio]([email protected]).
1492 %</license>
1493 % \fi
1494 % \Finale
1495 \endinput
1496 %%
1497 %% This work consists of the file mcmthesis.dtx,
1498 %% figures/, and code/,
1499 %% and the derived files mcmthesis.cls,
1500 %% mcmthesis-demo.tex,
1501 %% README,
1502 %% LICENSE,
1503 %% mcmthesis.pdf and
1504 %% mcmthesis-demo.pdf.
1505 %%
1506 %% End of file `mcmthesis.dtx'.