Files
mcm-26-b/docs/paper/mcm26b-paper.cls
T
2026-09-11 02:33:19 +08:00

108 lines
3.6 KiB
OpenEdge ABL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
% ============================================================
% 2026 年高教社杯全国大学生数学建模竞赛论文模板(B 题)
% ============================================================
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{mcm26b-paper}[2026/09/11 MCM 2026 paper class]
% 电子版为默认模式;纸质版通过 class option `paper' 开启。
\newif\ifpaper
\paperfalse
\DeclareOption{paper}{\papertrue}
\DeclareOption{electronic}{\paperfalse}
% 将其余选项(如 zihao=-4、a4paper)交给 ctexart。
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}}
\ProcessOptions\relax
\LoadClass{ctexart}
% ---------- 页面与基础宏包 ----------
\RequirePackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry}
\RequirePackage{amsmath,amssymb,bm}
\RequirePackage{graphicx}
\RequirePackage{booktabs,array,multirow,longtable}
\RequirePackage[font=small,labelsep=quad]{caption}
\RequirePackage{xcolor}
\RequirePackage{listings}
\RequirePackage{enumitem}
\RequirePackage[hidelinks]{hyperref}
% ---------- 字体设置(使用模板目录 fonts/ 下的字体) ----------
% 中文正文:宋体(Songti SC);标题/强调:黑体(Heiti SC)
% 西文与数字:Times New Roman
% 若未携带 fonts/ 目录,可将下面设置替换为系统字体,例如:
% \setCJKmainfont{SimSun} \setCJKsansfont{SimHei}
\setmainfont{Times New Roman}[
Path = fonts/, Extension = .ttf,
BoldFont = {Times New Roman Bold},
ItalicFont = {Times New Roman Italic},
BoldItalicFont = {Times New Roman Bold Italic},
]
\setCJKmainfont{SongtiSC}[
Path = fonts/, Extension = .ttf,
UprightFont = SongtiSC-Regular,
BoldFont = SongtiSC-Bold,
ItalicFont = SongtiSC-Regular,
BoldItalicFont = SongtiSC-Bold,
]
\setCJKsansfont{HeitiSC}[
Path = fonts/, Extension = .ttf,
UprightFont = HeitiSC-Light,
BoldFont = HeitiSC-Medium,
]
\setCJKmonofont{SongtiSC}[Path = fonts/, Extension = .ttf, UprightFont = SongtiSC-Regular]
\setCJKfamilyfont{zhsong}{SongtiSC}[Path = fonts/, Extension = .ttf, UprightFont = SongtiSC-Regular, BoldFont = SongtiSC-Bold]
\setCJKfamilyfont{zhei}{HeitiSC}[Path = fonts/, Extension = .ttf, UprightFont = HeitiSC-Light, BoldFont = HeitiSC-Medium]
\setCJKfamilyfont{zhkai}{SongtiSC}[Path = fonts/, Extension = .ttf, UprightFont = SongtiSC-Regular]
% ---------- 标题层级:一级四号黑体居中,二级小四黑体左对齐 ----------
\ctexset{
section = {
format = {\centering\heiti\zihao{4}},
aftername = {\quad},
beforeskip = {1.2ex plus 0.3ex},
afterskip = {1.0ex plus 0.2ex},
},
subsection = {
format = {\heiti\zihao{-4}},
aftername = {\quad},
beforeskip = {1.0ex plus 0.2ex},
afterskip = {0.8ex plus 0.2ex},
},
subsubsection = {
format = {\heiti\zihao{-4}},
aftername = {\quad},
},
}
\linespread{1.4}
\setlength{\parskip}{0.3ex}
\setlength{\emergencystretch}{3em}
% 规范:页码位于页脚中部,阿拉伯数字从摘要页 1 开始连续编号。
\pagestyle{plain}
% ---------- 草稿批注宏(定稿前必须全部删除或落实) ----------
\newcommand{\todonote}[1]{\textcolor{red}{【#1】}}
% ---------- 代码排版设置(附录) ----------
\lstset{
language=Python,
basicstyle=\ttfamily\zihao{-5},
keywordstyle=\bfseries,
commentstyle=\color{black!60},
stringstyle=\color{black!60},
columns=fullflexible,
keepspaces=true,
breaklines=true,
breakatwhitespace=false,
showstringspaces=false,
numbers=left,
numberstyle=\tiny\color{black!50},
frame=single,
framerule=0.3pt,
rulecolor=\color{black!40},
tabsize=4,
}
% ---------- 常用数学简写 ----------
\newcommand{\R}{\mathbb{R}}
\newcommand{\diff}{\,\mathrm{d}}