| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 2019-2022 by Miracle0565 |
| 4 |
% Copyright (C) 2022-2023 by The-CCSN |
| 5 |
% |
| 6 |
% https://github.com/the-ccsn/BUCTthesis |
| 7 |
% ------------------------------------------------------- |
| 8 |
% |
| 9 |
% This file may be distributed and/or modified under |
| 10 |
% the conditions of the LaTeX Project Public License, |
| 11 |
% either version 1.3c of this license or (at your option) |
| 12 |
% any later version. The latest version of this license |
| 13 |
% is in: |
| 14 |
% |
| 15 |
% http://www.latex-project.org/lppl.txt |
| 16 |
% |
| 17 |
% and version 1.3c or later is part of all distributions |
| 18 |
% of LaTeX version 1999/12/01 or later. |
| 19 |
% |
| 20 |
% \fi |
| 21 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 22 |
% \iffalse |
| 23 |
%<*driver> |
| 24 |
\ProvidesFile{buctthesis.dtx}[2023/05/20 v2.0 BUCT Thesis Template] |
| 25 |
\documentclass{ltxdoc} |
| 26 |
\usepackage{manual} |
| 27 |
\begin{document} |
| 28 |
\DocInput{\jobname.dtx} |
| 29 |
\PrintIndex |
| 30 |
\PrintChanges |
| 31 |
\end{document} |
| 32 |
%</driver> |
| 33 |
% \fi |
| 34 |
% |
| 35 |
% \DoNotIndex{\newcommand,\newenvironment,\renewcommand,\renewenvironment} |
| 36 |
% \DoNotIndex{\providecommand,\NewDocumentCommand} |
| 37 |
% \DoNotIndex{\begin,\end,\begingroup,\endgroup} |
| 38 |
% \DoNotIndex{\Huge,\huge,\LARGE,\Large,\large,\normalsize} |
| 39 |
% \DoNotIndex{\small,\footnotesize,\scriptsize,\tiny,\zihao} |
| 40 |
% \DoNotIndex{\addtocounter,\label,\let,\linewidth,\newcounter} |
| 41 |
% \DoNotIndex{\noindent,\normalfont,\par,\parskip,\phantomsection} |
| 42 |
% \DoNotIndex{\providecommand,\ProvidesPackage,\refstepcounter} |
| 43 |
% \DoNotIndex{\setcounter,\setlength,\string,\strut} |
| 44 |
% \DoNotIndex{\textbackslash,\texttt,\ttfamily,\usepackage} |
| 45 |
% \DoNotIndex{\par,\\} |
| 46 |
% \DoNotIndex{\if,\ifx,\ifdim,\ifnum,\ifcase,\else,\or,\fi} |
| 47 |
% \DoNotIndex{\let,\def,\xdef,\edef,\newcommand,\renewcommand} |
| 48 |
% \DoNotIndex{\expandafter,\csname,\endcsname,\relax,\protect} |
| 49 |
% \DoNotIndex{\normalfont,\bfseries,\slshape,\sffamily,\interlinepenalty} |
| 50 |
% \DoNotIndex{\textbf,\textit,\textsf,\textsc} |
| 51 |
% \DoNotIndex{\hfil,\par,\hskip,\vskip,\vspace,\quad} |
| 52 |
% \DoNotIndex{\centering,\raggedright,\ref} |
| 53 |
% \DoNotIndex{\c@secnumdepth,\@startsection,\@setfontsize} |
| 54 |
% \DoNotIndex{\ ,\@plus,\@minus,\p@,\z@,\@m,\@M,\@ne,\m@ne} |
| 55 |
% \DoNotIndex{\@@par,\DeclareOperation,\RequirePackage,\LoadClass} |
| 56 |
% \DoNotIndex{\AtBeginDocument,\AtEndDocument} |
| 57 |
% |
| 58 |
% |
| 59 |
% \GetFileInfo{buctthesis.dtx} |
| 60 |
% |
| 61 |
% \title{\textsf{BUCTthesis}:北京化工大学学位论文模板} |
| 62 |
% \author{长城学生网络 \\ \texttt{https://github.com/the-ccsn}} |
| 63 |
% \date{\fileversion (\filedate)} |
| 64 |
% |
| 65 |
% \newgeometry{hcentering} |
| 66 |
% \maketitle |
| 67 |
% \tableofcontents\restoregeometry\clearpage |
| 68 |
% |
| 69 |
% \section{欢迎!} |
| 70 |
% BUCTthesis是北京化工大学本科与硕士、博士研究生毕业论文的 \LaTeX\ 写作模板,版本号~\fileversion。 |
| 71 |
% 本文是模板的使用指南,旨在帮助北化毕业生掌握此模板的使用方法,从而写出符合北化 |
| 72 |
% \href{https://jiaowuchu.buct.edu.cn/2018/1009/c515a22046/page.htm}{《本科生毕业设计(论文)撰写规范》}(以下称《本科生规范》) |
| 73 |
% 和 \href{https://xxgk.buct.edu.cn/2017/1107/c2835a39437/page.htm}{《北京化工大学研究生学位论文撰写规范(修订)》}(以下称《研究生规范》) |
| 74 |
% 要求的毕业论文。 |
| 75 |
% |
| 76 |
% \subsection{模板内容} |
| 77 |
% 本模板为中文论文模板,暂不支持英语专业的论文写作。以下是完整论文的书序,其中划线部分为模板未完成的部分。 |
| 78 |
% \begin{description} |
| 79 |
% \item[本科] 开题报告 \footnote{目前处于实验性质,参见根目录下的 \file{buct-proposal} 文件夹。}、\CJKsout{中期进展情况检查表} \footnote{由学校提供 Word,可转换为 PDF 文件插入。}、论文封面、诚信声明、任务书、摘要、目录、前言、正文、结论、参考文献、符号说明、致谢和附录; |
| 80 |
% \item[研究生] 论文封面、版权页(独创性声明和授权书)、\CJKsout{学位论文数据集} \footnotemark[2]、中英文摘要、中英文目录、符号和缩略词说明、正文、参考文献、附录、致谢、作者攻读学位期间发表的学术论文及科研成果目录、作者和导师简介和\CJKsout{答辩委员会决议} \footnote{使用扫描件插入。}。 |
| 81 |
% \end{description} |
| 82 |
% |
| 83 |
% \subsection{免责声明} |
| 84 |
% 请您注意,至本文档编译时,北京化工大学教务处仅提供《本科生规范》和《研究生规范》而未对本模板做任何测试或授权。 |
| 85 |
% 模板作者自当尽力,但限于软件等各种因素,由本模板生成的文档可能仍与要求有所出入, |
| 86 |
% 故不保证审查老师对格式不提意见。在开始使用之前,您需要同意: |
| 87 |
% 任何由于使用本模板而引起的论文格式审查问题均与本模板作者无关。 |
| 88 |
% |
| 89 |
% \subsection{开源说明} |
| 90 |
% 本模板开源于 \href{https://github.com/the-ccsn/BUCTthesis}{GitHub},代码部分遵循 |
| 91 |
% \href{https://www.latex-project.org/lppl.txt}{\LaTeX\ Project Public License 1.3c} 及以上协议。 |
| 92 |
% 模板文件夹中有关学校校徽和校名的插图,其版权归北京化工大学所有。 |
| 93 |
% |
| 94 |
% 由于模板建设尚在起步阶段,欢迎任何有兴趣的同学加入模板的开发工作。 |
| 95 |
% |
| 96 |
% \subsection{关于本文} |
| 97 |
% 本文档将对使用这份模板作一简单介绍。在第~\ref{sec:start}~节将概述使用模板前的准备,以及介绍编译方法; |
| 98 |
% 在第~\ref{sec:usage}~节将介绍本模板中新定义及实用的命令与环境; |
| 99 |
% 最后在第~\ref{sec:implementation}~节将简述模板文档类代码,面向对 BUCTthesis 开发感兴趣的用户。 |
| 100 |
% |
| 101 |
% 本文档中的宏包、命令等内容以不同字体或形式展现,以作区分: |
| 102 |
% 无衬线字体表示宏包、文档类等存在于计算机上的文件, |
| 103 |
% 如 \file{buctthesis.cls} 文件、\pkg{amsmath}宏包、\cls{ctexbook} 文档类; |
| 104 |
% 等宽字体表示命令与环境,如 \cs{buctsetup} 命令、\env{abstract} 环境。 |
| 105 |
% 对于命令中的参数将置于尖括号(尖括号无需输入)中,如 \cs{include}\marg{file}; |
| 106 |
% 对于命令行指令,将置于\ {\color{violet!65}\rule[.25ex]{1em}{1ex}} 颜色框内,且需要逐行输入; |
| 107 |
% 而对于 \LaTeX\ 代码,将置于\ {\color{cyan}\rule[.25ex]{1em}{1ex}} 颜色框内, |
| 108 |
% 需要保存为特定文件后进行编译。 |
| 109 |
% |
| 110 |
% \section{开始使用}\label{sec:start} |
| 111 |
% \subsection{准备工作} |
| 112 |
% 开始之前,您需要选择一个合适的 \TeX\ 发行版,以及需要一些必要的 \TeX\ 技能。 |
| 113 |
% \begin{enumerate} |
| 114 |
% \item \TeX\ 发行版: |
| 115 |
% \begin{description} |
| 116 |
% \item[本地编译] 建议完整安装 \TeX\ Live 2022 或更新版本。模板\emph{不支持} \CTeX\ 套装。安装 \TeX 发行版的详细步骤可参考\href{https://github.com/OsbertWang/install-latex-guide-zh-cn}{《一份简短的关于 \LaTeX 安装的介绍》}。此外,该文档简要地介绍了几款常见的文本编辑器,可根据喜好自行选择。 |
| 117 |
% \item[在线编译] 推荐 \href{https://www.overleaf.com/}{Overleaf},它提供了 Ubuntu 系统下的 \TeX\ Live,目前为 2022 版。免费版本足以应对模板的正常编译,至于完整的文档历史和协作编辑等功能则需付费订阅。 |
| 118 |
% \end{description} |
| 119 |
% \item \TeX\ 技能:本文档不是一份 \LaTeX\ 零基础教程,使用本模板需要对 \LaTeX\ 和参考文献管理工具 \BibTeX 有一定的熟练度。若您是新手,我们建议您先阅读一些入门文档,如\href{http://mirror.ctan.org/info/lshort/chinese/lshort-zh-cn.pdf}{《一份不太简短的 \LaTeXe 介绍》}。 |
| 120 |
% \end{enumerate} |
| 121 |
% |
| 122 |
% \subsection{模板组成} |
| 123 |
% 在表 \ref{tab:mainfile} 中罗列了本模板所包含的主要文件。 |
| 124 |
% \begin{table}[ht] |
| 125 |
% \centering |
| 126 |
% \caption{模板的组成}\label{tab:mainfile} |
| 127 |
% \begin{tabular}{ll} |
| 128 |
% \toprule |
| 129 |
% 文件(夹)名 & 简述\\ |
| 130 |
% \midrule |
| 131 |
% \file{buctthesis.ins} & \textsc{DocStrip} 驱动文件\\ |
| 132 |
% \file{buctthesis.dtx} & \textsc{DocStrip} 源文件\\\cmidrule(lr){1-2} |
| 133 |
% \file{chapter/} & 论文各部分的源文件路径\\ |
| 134 |
% \file{code/} & 源代码的路径\\ |
| 135 |
% \file{cover/} & 论文封面的路径\\ |
| 136 |
% \file{figure/} & 插图的路径\\\cmidrule(lr){1-2} |
| 137 |
% \file{main.tex} & 主文件\\ |
| 138 |
% \file{main.pdf} & 示例文档\\ |
| 139 |
% \file{buctthesis.cls} & 模板的文档类文件\\ |
| 140 |
% \file{thesisbib.bib} & \BibTeX{}参考文献数据库\\ |
| 141 |
% \file{mycfg.sty} & 自定义配置文件\\ |
| 142 |
% \file{README.md} & 项目自述文件\\ |
| 143 |
% \file{\bfseries buctthesis.pdf} & 写作指南,即本文\\ |
| 144 |
% \bottomrule |
| 145 |
% \end{tabular} |
| 146 |
% \end{table} |
| 147 |
% |
| 148 |
% \begin{enumerate} |
| 149 |
% \item 主文件 \file{main.tex}:定义论文相关信息,并对分散于 \file{chapter/} 文件夹下的各部分内容进行“整合”。这里的“各部分内容”包括诚信声明或版权页、摘要、正文等。 |
| 150 |
% \item 文档类文件 \file{buctthesis.cls}:格式控制。可由 \file{buctthesis.ins} 和 \file{buctthesis.dtx} 生成: |
| 151 |
% \begin{shell} |
| 152 |
% xelatex buctthesis.ins |
| 153 |
% \end{shell} |
| 154 |
% \item \file{buctthesis.pdf}:写作指南,即本文。可由 \file{buctthesis.dtx} 生成: |
| 155 |
% \begin{shell} |
| 156 |
% xelatex buctthesis.ins |
| 157 |
% xelatex buctthesis.dtx |
| 158 |
% makeindex -s gind.ist -o buctthesis.ind buctthesis.idx |
| 159 |
% xelatex buctthesis.dtx |
| 160 |
% xelatex buctthesis.dtx |
| 161 |
% \end{shell} |
| 162 |
% \end{enumerate} |
| 163 |
% |
| 164 |
% \subsection{编译论文} |
| 165 |
% 模板基于 \cls{ctexbook} 文档类构建,但\emph{仅} 支持 \XeTeX\ 引擎。 |
| 166 |
% 目前参考文献生成基于 \BibTeX,因此完整的编译流程如下: |
| 167 |
% (输入以下命令时可略去文件扩展名) |
| 168 |
% \begin{shell} |
| 169 |
% xelatex main.tex |
| 170 |
% bibtex main.tex |
| 171 |
% xelatex main.tex |
| 172 |
% xelatex main.tex |
| 173 |
% \end{shell} |
| 174 |
% |
| 175 |
% 或者使用更方便的 latexmk 工具:不加参数则默认对 \file{main.tex} 进行编译。 |
| 176 |
% 相比上一种,使用 latexmk 更加自动化,能持续编译直到解决所有的交叉引用: |
| 177 |
% \begin{shell} |
| 178 |
% latexmk |
| 179 |
% \end{shell} |
| 180 |
% |
| 181 |
% 示例文件会随模板一同发布。建议在写作开始前对示例文件执行一次全编译,以检查编程环境是否合适。 |
| 182 |
% |
| 183 |
% \subsection{提问} |
| 184 |
% 对于模板的任何问题或新功能需求请提交至 \href{https://github.com/the-ccsn/BUCTthesis/issues}{GitHub Issues}。 |
| 185 |
% 以下步骤可能对排除与精简问题有所帮助: |
| 186 |
% \begin{enumerate} |
| 187 |
% \item 将 \file{buctthesis.cls} 和 \file{main.tex} 文件复制到一空白文件夹; |
| 188 |
% \item 简化 \file{main.tex} 中能复现问题的代码至如下所示: |
| 189 |
% \begin{latex} |
| 190 |
% \documentclass[ type = bachelor ]{buctthesis} % 请注意指定文档类型 |
| 191 |
% \begin{document} |
| 192 |
% sOmetHInG GoEs wRoNg. |
| 193 |
% \end{document} |
| 194 |
% \end{latex} |
| 195 |
% \item 如果有必要的话可以将 \file{.log} 文件通过 \href{https://pastebin.com/}{Pastebin} 一并提交。 |
| 196 |
% \end{enumerate} |
| 197 |
% |
| 198 |
% \section{使用说明}\label{sec:usage} |
| 199 |
% 本节将简单介绍模板中的命令和环境。除了以下介绍,推荐对照示例文件及源代码看一看。 |
| 200 |
% |
| 201 |
% \subsection{论文选项}\label{subsec:options} |
| 202 |
% \subsubsection{文档类选项} |
| 203 |
% 主文件 \file{main.tex} 以 |
| 204 |
% \begin{latex} |
| 205 |
% \documentclass [ |
| 206 |
% type = doctor, % bachelor | master | doctor |
| 207 |
% fontset = windows, % fandol | windows | ... |
| 208 |
% submit, |
| 209 |
% openany, % openany | openright(default) |
| 210 |
% ]{buctthesis} |
| 211 |
% \end{latex} |
| 212 |
% 命令载入文档类,从而控制全文格式。 |
| 213 |
% |
| 214 |
% 以下逐一简述各个选项: |
| 215 |
% |
| 216 |
% \DescribeOpt{type} |
| 217 |
% \emph{必须指定一种类型}:本科 \opt{bachelor},硕士 \opt{master},以及博士 \opt{doctor}。 |
| 218 |
% 如: |
| 219 |
% \begin{latex} |
| 220 |
% % 博士论文 |
| 221 |
% \documentclass[type = doctor]{buctthesis} |
| 222 |
% % 或: |
| 223 |
% % 本科论文 |
| 224 |
% \documentclass[type = bachelor]{buctthesis} |
| 225 |
% \end{latex} |
| 226 |
% |
| 227 |
% \DescribeOpt{fontset} |
| 228 |
% 该选项会传递至 \pkg{ctex} 宏集,从而指定全文的字体。模板的设置如表~\ref{tab:fontset}~所示。 |
| 229 |
% |
| 230 |
% 其中选项 \opt{fandol} 或使用 \opt{\meta{others}} 选项 \footnote{参见\pkg{ctex}宏集第 4.3 小节。}是为了一些不方便安装字体的系统或平台(如 Overleaf)所采取的\emph{临时解决方案}。 |
| 231 |
% 这些字体与中易系列字体有少许差别,且偶尔有缺字现象。 |
| 232 |
% 因此,强烈建议在最后提交论文前,在合适的环境下使用 \opt{fontset = windows} 进行编译。 |
| 233 |
% |
| 234 |
% \begin{table}[ht] |
| 235 |
% \centering |
| 236 |
% \caption{模板的字体配置}\label{tab:fontset} |
| 237 |
% \begin{tabular}{llll} |
| 238 |
% \toprule |
| 239 |
% \opt{fontset =} & \opt{windows} & \opt{fandol} & \opt{\meta{others}}\\ |
| 240 |
% \midrule |
| 241 |
% 中文 & 中易字库 (宋、黑开启伪粗体) & Fandol 字库 & / \\ |
| 242 |
% 西文 & Times New Roman & Times New Roman & Times New Roman \\ |
| 243 |
% \bottomrule |
| 244 |
% \end{tabular} |
| 245 |
% \end{table} |
| 246 |
% |
| 247 |
% \emph{此外,论文封面使用的字体比较特殊,因此需要做另外设置。参见~\ref{subsec:cover}~中对封面相关字体的说明。} |
| 248 |
% |
| 249 |
% \DescribeOpt{submit} |
| 250 |
% 是否为提交版本。如果启用则会将文章超链接和代码块的文字颜色全部设置为黑色,适合论文最终提交与付梓。 |
| 251 |
% 需要提醒的是,它不能转换插图的颜色。 |
| 252 |
% |
| 253 |
% \DescribeOpt{openright} |
| 254 |
% \DescribeOpt{openany} |
| 255 |
% 对于书籍而言,一般章标题都只出现在右边的页面(奇数页),之前不足的页面用空白补足。 |
| 256 |
% 这也是打开模板 \opt{openright} 选项的结果:将会在适当处插入一完全空白页。 |
| 257 |
% 而 \opt{openany} 则允许在任意页开启新的一章。 |
| 258 |
% |
| 259 |
% 其它选项:多余的选项将传递给 \pkg{ctexbook} 文档类,如 \opt{draft} 将关闭插图和部分宏包的渲染,从而加快编译速度。 |
| 260 |
% |
| 261 |
% \subsubsection{论文信息}\label{subsec:buctsetup} |
| 262 |
% \DescribeMacro{\buctsetup} |
| 263 |
% \DescribeOpt{ChineseTitle} |
| 264 |
% \DescribeOpt{ChineseTitleLineA} |
| 265 |
% \DescribeOpt{ChineseTitleLineB} |
| 266 |
% \DescribeOpt{EnglishTitle} |
| 267 |
% \DescribeOpt{author} |
| 268 |
% \DescribeOpt{class} |
| 269 |
% \DescribeOpt{studentid} |
| 270 |
% \DescribeOpt{school} |
| 271 |
% \DescribeOpt{major} |
| 272 |
% \DescribeOpt{supervisor} |
| 273 |
% \DescribeOpt{msupervisor} |
| 274 |
% \DescribeOpt{ChineseKeywords} |
| 275 |
% \DescribeOpt{EnglishKeywords} |
| 276 |
% \begin{syntax}{buctsetup} |
| 277 |
% \marg{键值列表} |
| 278 |
% \end{syntax} |
| 279 |
% |
| 280 |
% 接下来需要定义论文相关信息,使用 \cs{buctsetup} 命令以 \meta{key}$=$\meta{value} |
| 281 |
% 的形式进行定义,包括论文的中英文标题、作者个人信息等。 |
| 282 |
% \begin{latex} |
| 283 |
% \buctsetup{ |
| 284 |
% % 论文的中文标题 |
| 285 |
% ChineseTitle = {基于 \LaTeX\ 的北京化工大学本硕博毕业论文写作模板}, |
| 286 |
% % 封面上的标题。总字数不要超过 36 个汉字长度。 |
| 287 |
% % 本科:可以一行或分两行写,如无第二行将 ChineseTitleLineB 留空或注释掉; |
| 288 |
% % 硕博:封面的标题有两行,每一行控制在 18 个汉字长度以内。 |
| 289 |
% % 封面标题首行 |
| 290 |
% ChineseTitleLineA = {基于 \LaTeX\ 的北京化工大学本硕博}, |
| 291 |
% % 封面标题次行 |
| 292 |
% ChineseTitleLineB = {毕业论文写作模板}, |
| 293 |
% % 论文的英文标题,一般需要大写 |
| 294 |
% EnglishTitle = {BUCTthesis: A \LaTeX\ WRITING TEMPLATE FOR BUCT}, |
| 295 |
% % 作者的中文姓名 |
| 296 |
% author = {张三}, |
| 297 |
% % 班级(仅本科) |
| 298 |
% class = {某某1024}, |
| 299 |
% % 学号 |
| 300 |
% studentid = {2018020999}, |
| 301 |
% % 学院(仅本科) |
| 302 |
% school = {材料科学与工程学院}, |
| 303 |
% % 专业名称 |
| 304 |
% major = {高分子材料与工程}, |
| 305 |
% % 导师的姓名与职称 |
| 306 |
% supervisor = {李四教授}, |
| 307 |
% % 专业负责人姓名(仅本科) |
| 308 |
% msupervisor = {王五}, |
| 309 |
% % 中文、英文关键词,各关键词间以西文逗号“,”分隔 |
| 310 |
% ChineseKeywords = {论文,\LaTeX{},模板}, |
| 311 |
% EnglishKeywords = {thesis,\LaTeX{},template}, |
| 312 |
% % 日期,请注意务必使用形如“YYYY-MM-DD”的格式 |
| 313 |
% date = {2021-12-23}, |
| 314 |
% } |
| 315 |
% \end{latex} |
| 316 |
% |
| 317 |
% \emph{无论是文档类选项还是 \cs{buctsetup} 命令,各选项之间不要留有空行,并以西文逗号“,”分隔。} |
| 318 |
% |
| 319 |
% 此外,\cs{buctsetup}\marg{键值列表} 与下列命令等价: |
| 320 |
% \begin{latex} |
| 321 |
% % 于导言区 |
| 322 |
% \ChineseTitle{基于 \LaTeX\ 的北京化工大学本硕博毕业论文写作模板} |
| 323 |
% \EnglishTitle{BUCTthesis: A \LaTeX\ WRITING TEMPLATE FOR BUCT} |
| 324 |
% % ...(下同) |
| 325 |
% \end{latex} |
| 326 |
% |
| 327 |
% \subsection{封面}\label{subsec:cover} |
| 328 |
% \DescribeMacro{\makecover} |
| 329 |
% \begin{syntax}{makecover} |
| 330 |
% \oarg{文件路径} |
| 331 |
% \end{syntax} |
| 332 |
% |
| 333 |
% \emph{注意:从2.0版本起,模板将封面集成至论文中而不再单独使用一个文档类文件。} |
| 334 |
% |
| 335 |
% BUCTthesis 对学校印刷的纸质封面进行了仿制, |
| 336 |
% 直接使用而不带任何参数的 \cs{makecover} 会根据所选 \opt{type} 生成对应的封面,封面上的各项信息从前述的 \cs{buctsetup} 处定义。 |
| 337 |
% 需要注意的是,这里的“仿制”仅是实现封面的效果,学校印制的封面需要手写内容,故不能在纸本上替代学校统一印制的封面; |
| 338 |
% 若无特殊说明,可以在提交电子版时使用此封面。但,仍请以教务处最新通告为准。 |
| 339 |
% |
| 340 |
% 此外,学校封面使用的方正系列字体未预装于一些操作系统上, |
| 341 |
% 可访问\href{https://www.foundertype.com}{方正字库官网}下载和安装,具体步骤从略。 |
| 342 |
% |
| 343 |
% 封面所使用的中文字体清单如下: |
| 344 |
% \begin{enumerate} |
| 345 |
% \item SimSun,中易宋体 |
| 346 |
% \item SimHei,中易黑体 |
| 347 |
% \item KaiTi,中易楷体 |
| 348 |
% \item STXingkai,华文行楷 |
| 349 |
% \item FZXiaoBiaoSong-B05S,方正小标宋简体 |
| 350 |
% \item FZDaBiaoSong-B06S,方正大标宋简体(仅硕博封面需要) |
| 351 |
% \end{enumerate} |
| 352 |
% |
| 353 |
% 当且仅当存在上述字体文件时模板才会输出电子版的封面。 |
| 354 |
% 当然,考虑到有时需要插入扫描页,所以该命令可跟一个可选参数,如: |
| 355 |
% \begin{latex} |
| 356 |
% \makecover[figure/mycover.pdf] |
| 357 |
% \end{latex} |
| 358 |
% 即可插入位于 \file{figure/mycover.pdf} 的图片来代替。 |
| 359 |
% |
| 360 |
% \subsection{前置部分}\label{subsec:frontmatter} |
| 361 |
% |
| 362 |
% 在封面之后、“目录”之前的几个部分,包括“诚信声明”\footnote{根据《现代汉语词典》对“申明”与“声明”二词的释义,% |
| 363 |
% 《本科生规范》中的“诚信申明”应作“诚信声明”;模板以后者作为标题。}(仅本科)、 |
| 364 |
% 版权页(仅硕博)、“任务书”(仅本科)、“摘要”和“Abstract”, |
| 365 |
% 分别对应于 \file{chapter/frontmatter.tex} 中的不同命令或环境。 |
| 366 |
% |
| 367 |
% \subsubsection{诚信声明与版权页} |
| 368 |
% \DescribeMacro{\makedeclare} |
| 369 |
% \begin{syntax}{makedeclare} |
| 370 |
% \oarg{文件路径} |
| 371 |
% \end{syntax} |
| 372 |
% |
| 373 |
% 直接使用而不带任何参数的 \cs{makedeclare} 会根据所选 \opt{type} 生成对应内容。 |
| 374 |
% |
| 375 |
% 和 \cs{makecover} 一样,该命令也可跟一个可选参数来插入扫描页,如: |
| 376 |
% \begin{latex} |
| 377 |
% \makedeclare[figure/declare.png] |
| 378 |
% \end{latex} |
| 379 |
% 即可插入位于 \file{figure/declare.png} 的图片来代替。 |
| 380 |
% |
| 381 |
% \subsubsection{摘要和关键词}\label{subsubsec:abstract} |
| 382 |
% \DescribeEnv{cabstract} |
| 383 |
% \DescribeEnv{eabstract} |
| 384 |
% 中、英文摘要分别使用 \env{cabstract} 和 \env{eabstract} 环境。 |
| 385 |
% \begin{latex} |
| 386 |
% \begin{cabstract} |
| 387 |
% 中文摘要。 |
| 388 |
% \end{cabstract} |
| 389 |
% \begin{eabstract} |
| 390 |
% Abstract in English. |
| 391 |
% \end{eabstract} |
| 392 |
% \end{latex} |
| 393 |
% |
| 394 |
% 关键词会根据在 \cs{buctsetup} 中的定义自动生成,参见~\ref{subsec:buctsetup}。 |
| 395 |
% |
| 396 |
% \subsubsection{任务书}\label{subsubsec:taskbook} |
| 397 |
% \DescribeEnv{taskbook} |
| 398 |
% \DescribeMacro{\taskinfo} |
| 399 |
% \DescribeMacro{\taskinfo*} |
| 400 |
% \DescribeEnv{bibenumerate} |
| 401 |
% 该环境仅适用于本科论文中。 |
| 402 |
% |
| 403 |
% “本科生毕业设计(论文)任务书”部分使用 \env{taskbook} 环境。 |
| 404 |
% 此环境后可跟一个 \texttt{*}(注意不是 \env{taskbook*}), |
| 405 |
% 它会使得生成的任务书页不带任何页眉和页脚,以适合某些特殊情况下使用。 |
| 406 |
% \begin{latex} |
| 407 |
% \begin{taskbook} |
| 408 |
% ……“任务书”内容(带页眉页脚) |
| 409 |
% \end{taskbook} |
| 410 |
% % 或者: |
| 411 |
% \begin{taskbook}* |
| 412 |
% ……“任务书”内容(不带页眉页脚) |
| 413 |
% \end{taskbook} |
| 414 |
% \end{latex} |
| 415 |
% |
| 416 |
% \cs{buctsetup} 中定义的信息会作用于“任务书”的开头部分,该部分以 \cs{taskinfo} 命令来插入。 |
| 417 |
% 这个命令同样有一个带星号的版本即 \cs{taskinfo*}, |
| 418 |
% 二者的区别在于后者比前者少了一次换行,是《本科生规范》中示例的实现,但不适合文字较多时使用。 |
| 419 |
% |
| 420 |
% 除此之外,可以选择使用 \env{bibenumerate} 环境来排版有序文献列表, |
| 421 |
% 序号已经设置为带方括号的数字。 |
| 422 |
% |
| 423 |
% \emph{以上各部分在源文件中含有部分代码,稍作改动即可。} |
| 424 |
% |
| 425 |
% \subsubsection{目录}\label{subsubsec:content} |
| 426 |
% \DescribeMacro{\tableofcontents} |
| 427 |
% \DescribeMacro{\tableofcontentsEN} |
| 428 |
% \DescribeMacro{\listofdesignfigures} |
| 429 |
% 三个命令分别生成中文目录、英文目录(仅硕博)、设计图纸目录(仅本科部分专业)。 |
| 430 |
% \begin{latex} |
| 431 |
% \tableofcontents |
| 432 |
% \tableofcontentsEN |
| 433 |
% \listofdesignfigures |
| 434 |
% \end{latex} |
| 435 |
% |
| 436 |
% 三者是互相独立的。 |
| 437 |
% 为生成英文目录,需要在正文中以 \cs{echapter} 等命令指定各级标题的对应英文,参见~\ref{subsubsec:bitoc}; |
| 438 |
% 为生成设计图纸目录,需要在正文中以 \env{dfigure} 环境指定插图为“设计图纸”并计数编号,参见~\ref{subsubsec:dfigure}。 |
| 439 |
% |
| 440 |
% \subsubsection{符号说明表}\label{subsubsec:deno} |
| 441 |
% \DescribeEnv{denotation} |
| 442 |
% 符号说明表的源文件位于 \file{chapter/denotation.tex}, |
| 443 |
% 使用 \env{denotation} 环境。 |
| 444 |
% 《本科生规范》和《研究生规范》中都未详细规定符号说明表的格式, |
| 445 |
% 模板设计了一个无框线、可跨页的长表格,直接在环境里填入内容即可。 |
| 446 |
% 环境接受一个可选参数 \meta{width} ,代表“说明”一列的宽度,用于在必要时调整。 |
| 447 |
% \begin{latex} |
| 448 |
% \begin{denotation}[12cm] % 设置第二列的列宽为 12 cm,默认 10 cm |
| 449 |
% 符号1 & 说明1 \\ |
| 450 |
% 符号2 & 说明2 \\ |
| 451 |
% \end{denotation} |
| 452 |
% \end{latex} |
| 453 |
% |
| 454 |
% \emph{注意:“符号说明表”在本科论文中置于“参考文献”之后,与研究生论文有所差异。} |
| 455 |
% |
| 456 |
% \subsubsection{前言}\label{subsubsec:foreword} |
| 457 |
% 该环境仅适用于本科论文中。 |
| 458 |
% |
| 459 |
% 该部分的源代码位于 \file{chapter/foreword.tex}, |
| 460 |
% 使用 \env{foreword} 环境,在相应位置输入文本即可。注意不能在此环境中使用 |
| 461 |
% \cs{section}等与“章”计数器有关的命令,结论、翻译、致谢部分同理。 |
| 462 |
% |
| 463 |
% \subsection{正文部分}\label{subsec:mainmatter} |
| 464 |
% |
| 465 |
% \subsubsection{纲举目张} |
| 466 |
% \DescribeMacro{\include} |
| 467 |
% \DescribeMacro{\input} |
| 468 |
% \begin{syntax}{include} |
| 469 |
% \marg{文件} |
| 470 |
% \end{syntax} |
| 471 |
% \qquad |
| 472 |
% \begin{syntax}{input} |
| 473 |
% \marg{文件} |
| 474 |
% \end{syntax} |
| 475 |
% |
| 476 |
% 正文部分各个章节的源文件存放于 \file{chapter/} 文件夹, |
| 477 |
% 只要在 \file{main.tex} 正文部分以上述命令插入各章节即可成文。 |
| 478 |
% 插入 \meta{文件} 可以不带扩展名,默认为 \file{.tex}。 |
| 479 |
% |
| 480 |
% 使用 \cs{include} 命令会在读入文件前另起一页,而 \cs{input} |
| 481 |
% 纯粹插入文件里的内容。 |
| 482 |
% 当随着写作章节增多,每次编译时间也会越来越长。 |
| 483 |
% 此时可以选择性地注释部分章节,从而快速编译查错。 |
| 484 |
% |
| 485 |
% \subsubsection{双语目录}\label{subsubsec:bitoc} |
| 486 |
% \DescribeMacro{\echapter} |
| 487 |
% \DescribeMacro{\esection} |
| 488 |
% \DescribeMacro{\esubsection} |
| 489 |
% \DescribeMacro{\esubsubsection} |
| 490 |
% \begin{syntax}{echapter} |
| 491 |
% \marg{英文目录标题} |
| 492 |
% \end{syntax} |
| 493 |
% |
| 494 |
% 这些命令仅适用于硕博论文中,支持章、节、小节和小小节标题,且语法相同。 |
| 495 |
% |
| 496 |
% 硕博论文要求中英双语目录,且英语目录要与中文对应。 |
| 497 |
% 我们只需在正文章节标题命令后加上对应标签即可。 |
| 498 |
% 如: |
| 499 |
% \begin{latex} |
| 500 |
% \chapter{绪论}\echapter{Introduciton} |
| 501 |
% \section{基本概念}\esection{Basic Conceptions} |
| 502 |
% \section{本章小结}\esection{Chapter Summary} |
| 503 |
% \chapter{实验}\echapter{The Experiments} |
| 504 |
% \end{latex} |
| 505 |
% |
| 506 |
% 可能写两遍 chapter 或 section 显得过于繁琐,我们也有更简单的 \cs{bichapter} 与 \cs{bisection} 等命令。以 \cs{bichapter} 为例,语法格式为: |
| 507 |
% |
| 508 |
% \DescribeMacro{\bichapter} |
| 509 |
% \DescribeMacro{\bisection} |
| 510 |
% \DescribeMacro{\bisubsection} |
| 511 |
% \DescribeMacro{\bisubsubsection} |
| 512 |
% \begin{syntax}{bichapter} |
| 513 |
% \oarg{中文目录标题}\marg{中文正文标题}\marg{英文目录标题} |
| 514 |
% \end{syntax} |
| 515 |
% |
| 516 |
% 可见与 \cs{chapter} 相比,它多了一个必选参数用于接受 \meta{英文目录的标题}。 |
| 517 |
% 于是,上面这个例子可以这样简化: |
| 518 |
% \begin{latex} |
| 519 |
% \bichapter{绪论}{Intorduciton} |
| 520 |
% \bisection{基本概念}{Basic Conceptions} |
| 521 |
% \bisection{本章小结}{Chapter Summary} |
| 522 |
% \bichapter{实验}{The Experiments} |
| 523 |
% \end{latex} |
| 524 |
% |
| 525 |
% 但这也有少许弊端:一些编辑器会检测代码中诸如 \cs{section} 等章节结构命令, |
| 526 |
% 以此在编辑窗口中显示论文的结构树;但是,如果使用了 \cs{bisection} 等命令之后, |
| 527 |
% 就可能无法正常显示了。 |
| 528 |
% |
| 529 |
% \DescribeMacro{\tableofcontentsEN} |
| 530 |
% 然后,使用 \cs{tableofcontentsEN} 生成英文目录项。 |
| 531 |
% 类似中文目录,英文目录需要经过两次编译才能正确生成。 |
| 532 |
% |
| 533 |
% \subsubsection{双语图表注}\label{subsubsec:bicaption} |
| 534 |
% \DescribeMacro{\bicaption} |
| 535 |
% \begin{syntax}{bicaption} |
| 536 |
% \marg{中文长图表注}\marg{英文长图表注} |
| 537 |
% \end{syntax} |
| 538 |
% |
| 539 |
% 该命令仅适用于硕博论文中。 |
| 540 |
% |
| 541 |
% 具体的用法很简单:在 \env{figure} 环境中使用 \cs{bicaption} 代替 \cs{caption},如: |
| 542 |
% \begin{latex} |
| 543 |
% \begin{figure} |
| 544 |
% \centering |
| 545 |
% \includegraphics[<options>]{My-Fig} |
| 546 |
% \bicaption{中文标题}{English Title} |
| 547 |
% \label{fig:my-fig} |
| 548 |
% \end{figure} |
| 549 |
% \end{latex} |
| 550 |
% |
| 551 |
% \subsubsection{设计图纸}\label{subsubsec:dfigure} |
| 552 |
% 这些命令和环境仅适用于本科论文中。 |
| 553 |
% |
| 554 |
% 关于一般的插图请看示例文件,这里介绍关于“设计图纸”及编目的方法。 |
| 555 |
% |
| 556 |
% 由于《本科生规范》未对所谓“设计图纸”详细说明,因此模板设计了两种编目方式: |
| 557 |
% 一是加入主目录,另一种是单独生成目录。 |
| 558 |
% |
| 559 |
% \DescribeEnv{dfigure} |
| 560 |
% 设计图纸的计数器是独立于一般插图的。 |
| 561 |
% 因此,无论编目方式如何, |
| 562 |
% 都需要使用 \env{dfigure} 而非 \env{figure} 环境,来为一张插图指定为“设计图纸”。 |
| 563 |
% |
| 564 |
% \DescribeMacro{\dcaption} |
| 565 |
% 如果需要编入主目录,需要使用 \cs{dcaption} 代替 \cs{caption},如: |
| 566 |
% \begin{latex} |
| 567 |
% \begin{dfigure} |
| 568 |
% \centering |
| 569 |
% \includegraphics[<options>]{My-Fig} |
| 570 |
% \dcaption{设计图纸示例} |
| 571 |
% \end{dfigure} |
| 572 |
% \end{latex} |
| 573 |
% 也就是说,\cs{dcaption} 命令用于添加编号与标题的同时将它编入主目录。 |
| 574 |
% |
| 575 |
% \DescribeMacro{\listofdesignfigures} |
| 576 |
% 而独立目录也很简单:只需要 \env{dfigure} 指定为“设计图纸”, |
| 577 |
% 并在主目录(\cs{tableofcontents})后跟一个 \cs{listofdesignfigures} 即可。参见~\ref{subsubsec:content}。 |
| 578 |
% |
| 579 |
% \subsubsection{结论} |
| 580 |
% \DescribeEnv{conclusion} |
| 581 |
% 该环境仅适用于本科论文中。 |
| 582 |
% |
| 583 |
% 结论部分的源文件位于 \file{chapter/conclusion.tex}。该环境与前言相似,没有章的编号。 |
| 584 |
% 但如果希望把“结论”编入章节,如“第五章\hspace{\ccwd}结论”, |
| 585 |
% 那么就不必使用 \env{conclusion} 环境,像其他章节一样使用 \cs{chapter} 就可以了。 |
| 586 |
% \begin{latex} |
| 587 |
% \begin{conclusion} |
| 588 |
% 本文的结论有什么? |
| 589 |
% \end{conclusion} |
| 590 |
% \end{latex} |
| 591 |
% |
| 592 |
% \subsubsection{参考文献}\label{subsubsec:bib} |
| 593 |
% \DescribeMacro{\cite} |
| 594 |
% \DescribeMacro{\inlinecite} |
| 595 |
% \DescribeMacro{\nocite} |
| 596 |
% \begin{syntax}{cite} |
| 597 |
% \marg{CiteKey} |
| 598 |
% \end{syntax} |
| 599 |
% \qquad |
| 600 |
% \begin{syntax}{inlinecite} |
| 601 |
% \marg{CiteKey} |
| 602 |
% \end{syntax} |
| 603 |
% |
| 604 |
% 模板使用 \BibTeX 来实现参考文献的引用。 |
| 605 |
% 一般情况下,使用 \cs{cite} 实现上标、方括号按“顺序编码制”引用参考文献; |
| 606 |
% 而 \cs{inlinecite} 可实现行间引用,适合某些特殊情况使用; |
| 607 |
% 此外,\cs{nocite}\marg{CiteKey} 则指明不在正文中引用但仍需要列出的参考文献,一般不使用。 |
| 608 |
% 在同一处引用多个文献时,应将各篇文献的引用标签一同写在参数里, |
| 609 |
% 并以西文逗号“,”分隔每个 \meta{CiteKey},如: |
| 610 |
% \begin{latex} |
| 611 |
% ……多喝热水。\cite{bib1, bib2} |
| 612 |
% \end{latex} |
| 613 |
% |
| 614 |
% 至于参考文献列表,主文件中以下列命令来生成符合格式要求的参考文献章节: |
| 615 |
% \begin{latex} |
| 616 |
% \bibliographystyle{gbt7714-numerical} |
| 617 |
% \bibliography{thesisbib.bib} |
| 618 |
% \end{latex} |
| 619 |
% |
| 620 |
% 为罗列各条参考文献, |
| 621 |
% 需要在 \file{thesisbib.bib} 文件中增删需引用的文献数据。 |
| 622 |
% 在文章中相应位置引用文献后,需执行一次全编译以确保正确显示。 |
| 623 |
% |
| 624 |
% \emph{注意:至少需要引用一篇文献,否则执行完全编译可能会引起编译错误。} |
| 625 |
% |
| 626 |
% |
| 627 |
% \subsection{后置部分}\label{subsec:backmatter} |
| 628 |
% \subsubsection{翻译} |
| 629 |
% \DescribeEnv{translation} |
| 630 |
% 该环境仅适用于本科论文中。 |
| 631 |
% |
| 632 |
% 文献翻译的源文件位于 \file{chapter/translation.tex}, |
| 633 |
% 使用 \env{translation} 环境,原文和翻译都要有。 |
| 634 |
% |
| 635 |
% \emph{注意:部分学院要求该部分作为单独的一份文件,此时可直接删除该文件并删除主文件的插入代码。} |
| 636 |
% \begin{latex} |
| 637 |
% \begin{translation} |
| 638 |
% English. |
| 639 |
% |
| 640 |
% 汉语。 |
| 641 |
% \end{translation} |
| 642 |
% \end{latex} |
| 643 |
% |
| 644 |
% \subsubsection{附录}\label{subsubsec:app} |
| 645 |
% \DescribeMacro{\appendix} |
| 646 |
% \cs{appendix} 命令作为附录部分的开始。 |
| 647 |
% 与正文类似,只需往 \file{chapter/app1.tex} 等加入内容即可。 |
| 648 |
% \begin{latex} |
| 649 |
% \appendix |
| 650 |
% \chapter{...} |
| 651 |
% ... |
| 652 |
% \end{latex} |
| 653 |
% |
| 654 |
% \subsubsection{致谢} |
| 655 |
% \DescribeEnv{acknowledgement} |
| 656 |
% 致谢部分的源文件位于 \file{chapter/acknowledgement.tex}, |
| 657 |
% 使用 \env{acknowledgement} 环境, |
| 658 |
% 往里面写入感谢的话就可以啦。 |
| 659 |
% \begin{latex} |
| 660 |
% \begin{acknowledgement} |
| 661 |
% 谢谢你! |
| 662 |
% \end{acknowledgement} |
| 663 |
% \end{latex} |
| 664 |
% |
| 665 |
% \emph{注意:“致谢”在本科论文中置于“附录”之前,与研究生论文有所差异。} |
| 666 |
% |
| 667 |
% \subsubsection{成果与简介} |
| 668 |
% \DescribeEnv{achievements} |
| 669 |
% \DescribeEnv{resume} |
| 670 |
% 这些环境仅适用于研究生论文中。 |
| 671 |
% |
| 672 |
% 该部分包括“作者攻读学位期间发表的学术论文及科研成果目录”与“作者和导师简介”, |
| 673 |
% 源文件位于 \file{chapter/resume.tex}。示例文档中已有现成例子,推荐直接修改。 |
| 674 |
% |
| 675 |
% \DescribeEnv{bibenumerate} |
| 676 |
% 其中可以使用 \env{bibenumerate} 环境来生成带有方括号的列表,适合罗列文献。 |
| 677 |
% |
| 678 |
% \begin{latex} |
| 679 |
% \begin{achievements} |
| 680 |
% \section*{发表及已接受的论文:} |
| 681 |
% \section*{成果及专利:} |
| 682 |
% \end{achievements} |
| 683 |
% \begin{resume} |
| 684 |
% \section*{作者简介:} |
| 685 |
% \section*{导师简介:} |
| 686 |
% \end{resume} |
| 687 |
% \end{latex} |
| 688 |
% |
| 689 |
% |
| 690 |
% |
| 691 |
% \StopEventually{\PrintChanges\PrintIndex} |
| 692 |
% |
| 693 |
% \clearpage |
| 694 |
% \section{实现细节}\label{sec:implementation} |
| 695 |
% \subsection{文档类信息与选项} |
| 696 |
% \begin{macrocode} |
| 697 |
%<*class> |
| 698 |
\NeedsTeXFormat{LaTeX2e}[1999/12/01] |
| 699 |
\ProvidesClass{buctthesis}[2023/05/20 v2.0 BUCT Thesis Template] |
| 700 |
% \end{macrocode} |
| 701 |
% |
| 702 |
% 装载 \pkg{ifxetex} 宏包,并通过 \cs{RequireXeTeX} 命令检查编译命令。 |
| 703 |
% 若未使用 \XeTeX\ 或 \XeLaTeX\ 将强制中止编译并发出警告。 |
| 704 |
% \begin{macrocode} |
| 705 |
\RequirePackage{ifxetex} |
| 706 |
\RequireXeTeX |
| 707 |
% \end{macrocode} |
| 708 |
% |
| 709 |
% 定义选项和族。 |
| 710 |
% \begin{macrocode} |
| 711 |
\RequirePackage{kvoptions} |
| 712 |
\SetupKeyvalOptions{ |
| 713 |
family = buct, |
| 714 |
prefix = buct@, |
| 715 |
setkeys = \kvsetkeys, |
| 716 |
} |
| 717 |
% \end{macrocode} |
| 718 |
% |
| 719 |
% 定义载入文档类时的选项: |
| 720 |
% |
| 721 |
% 模板类型:本科、硕士、博士; |
| 722 |
% \begin{macrocode} |
| 723 |
\newif\ifbuct@bachelor\buct@bachelorfalse |
| 724 |
\newif\ifbuct@master\buct@masterfalse |
| 725 |
\newif\ifbuct@doctor\buct@doctorfalse |
| 726 |
\define@key{buct}{type}{\expandafter\csname buct@#1true\endcsname} |
| 727 |
% \end{macrocode} |
| 728 |
% |
| 729 |
% 是否为最终提交版本,默认否; |
| 730 |
% \begin{macrocode} |
| 731 |
\DeclareBoolOption[false]{submit} |
| 732 |
% \end{macrocode} |
| 733 |
% |
| 734 |
% 每章从任意页或奇数页开始,默认 openright,即每章只从奇数页开始; |
| 735 |
% \begin{macrocode} |
| 736 |
\DeclareBoolOption[false]{openany} |
| 737 |
\DeclareComplementaryOption{openright}{openany} |
| 738 |
% \end{macrocode} |
| 739 |
% |
| 740 |
% 是否开启模板调试器,默认否。 |
| 741 |
% \begin{macrocode} |
| 742 |
\DeclareBoolOption[false]{debugger} |
| 743 |
% \end{macrocode} |
| 744 |
% |
| 745 |
% 将文档类多余的选项传递给 \pkg{ctexbook} 文档类,并加载相应选项的文档类。 |
| 746 |
% \begin{macrocode} |
| 747 |
\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}} |
| 748 |
\ProcessKeyvalOptions* |
| 749 |
% \end{macrocode} |
| 750 |
% |
| 751 |
% 由于 \cls{ctexbook} 将会调用 \pkg{xeCJK} 宏包来配置字体,这里使用 \opt{quiet} |
| 752 |
% 选项关闭因自定义字体(后述)而产生的警告。 |
| 753 |
% 最后根据用户选项,加载相应选项的 \cls{ctexbook} 文档类。 |
| 754 |
% \begin{macrocode} |
| 755 |
\PassOptionsToPackage{quiet}{xeCJK} |
| 756 |
\ifbuct@openany\LoadClass[zihao=-4,UTF8,oneside]{ctexbook} |
| 757 |
\else\LoadClass[zihao=-4,UTF8,openright]{ctexbook}\fi |
| 758 |
% \end{macrocode} |
| 759 |
% |
| 760 |
% 必须指定本、硕、博中的一种类型。 |
| 761 |
% \begin{macrocode} |
| 762 |
\ifbuct@bachelor\relax\else |
| 763 |
\ifbuct@master\relax\else |
| 764 |
\ifbuct@doctor\relax\else |
| 765 |
\ClassError{buctthesis}{% |
| 766 |
Specified thesis type is obligatory: \MessageBreak% |
| 767 |
type = [ bachelor | master | doctor ]% |
| 768 |
}{} |
| 769 |
\fi\fi\fi |
| 770 |
% \end{macrocode} |
| 771 |
% |
| 772 |
% \begin{macro}{\buct@def@key} |
| 773 |
% 定义用于定义论文相关信息的内部命令。例如: |
| 774 |
% \begin{latex} |
| 775 |
% \buct@def@key{ChineseTitle} |
| 776 |
% \end{latex} |
| 777 |
% 相当于: |
| 778 |
% \begin{latex} |
| 779 |
% \newcommand{\ChineseTitle}[1]{\newcommand{\buct@ChineseTitle}{#1}} |
| 780 |
% \define@key{buct}{ChineseTitle}{\ChineseTitle{#1}} |
| 781 |
% \end{latex} |
| 782 |
% |
| 783 |
% 这个命令我们让它能接受两个参数,其中第一个必选参数为选项的键名称,后一个可选参数则是选项的默认值。 |
| 784 |
% \begin{macrocode} |
| 785 |
\NewDocumentCommand{\buct@def@key}{ m o }{ |
| 786 |
\@namedef{#1}##1{\@namedef{buct@#1}{##1}} |
| 787 |
\define@key{buct}{#1}[#2]{\@nameuse{#1}{##1}} |
| 788 |
} |
| 789 |
% \end{macrocode} |
| 790 |
% \end{macro} |
| 791 |
% |
| 792 |
% \begin{macro}{\buctsetup} |
| 793 |
% 定义 \cs{buctsetup} 命令作为接口,方便在主文件中设置。 |
| 794 |
% \begin{macrocode} |
| 795 |
\newcommand{\buctsetup}[1]{\kvsetkeys{buct}{#1}} |
| 796 |
\buct@def@key{ChineseTitle} |
| 797 |
\buct@def@key{EnglishTitle} |
| 798 |
\buct@def@key{ChineseTitleLineA} |
| 799 |
\buct@def@key{ChineseTitleLineB} |
| 800 |
\buct@def@key{ChineseTitle} |
| 801 |
\buct@def@key{author} |
| 802 |
\buct@def@key{studentid} |
| 803 |
\buct@def@key{supervisor} |
| 804 |
\buct@def@key{major} |
| 805 |
\buct@def@key{date}[\the\year-\two@digits{\month}-\two@digits{\day}] |
| 806 |
\ifbuct@bachelor |
| 807 |
\buct@def@key{school} |
| 808 |
\buct@def@key{class} |
| 809 |
\buct@def@key{msupervisor} |
| 810 |
\fi |
| 811 |
% \end{macrocode} |
| 812 |
% \end{macro} |
| 813 |
% |
| 814 |
% \begin{macro}{\buct@def@sep@key} |
| 815 |
% 对于 \opt{ChineseKeywords} 等键接受的是以西文逗号“,”分隔的值,上面的定义就不合适了。 |
| 816 |
% 所以要对值做分隔。相比 \cs{buct@def@key} 这里的后一个参数为必选项,即为在论文中的分隔符。 |
| 817 |
% 此处的宏展开可参考\href{https://www.zhihu.com/question/26916597}{这篇讨论}。 |
| 818 |
% \begin{macrocode} |
| 819 |
\newcommand{\buct@def@sep@key}[2]{% |
| 820 |
\@namedef{#1}##1{% |
| 821 |
\@namedef{buct@#1}{}% |
| 822 |
\@for\reserved@a:=##1\do{ |
| 823 |
\expandafter\ifx\csname buct@#1\endcsname\@empty\else |
| 824 |
\expandafter\g@addto@macro\csname buct@#1\endcsname{#2}\fi |
| 825 |
\expandafter\expandafter\expandafter\g@addto@macro% |
| 826 |
\expandafter\csname buct@#1\expandafter\endcsname% |
| 827 |
\expandafter{\reserved@a} |
| 828 |
} |
| 829 |
} |
| 830 |
\define@key{buct}{#1}{\@nameuse{#1}{##1}}% |
| 831 |
} |
| 832 |
\buct@def@sep@key{ChineseKeywords}{\buct@ChineseKeywords@sep} |
| 833 |
\buct@def@sep@key{EnglishKeywords}{\buct@EnglishKeywords@sep} |
| 834 |
% \end{macrocode} |
| 835 |
% \end{macro} |
| 836 |
% \subsection{载入宏包} |
| 837 |
% |
| 838 |
% 用于调整纸张与页面,这两个宏包提供了方便的命令来设置页面边距和页眉页脚。 |
| 839 |
% \begin{macrocode} |
| 840 |
\RequirePackage{geometry,fancyhdr} |
| 841 |
% \end{macrocode} |
| 842 |
% |
| 843 |
% 自定义目录格式。 |
| 844 |
% \begin{macrocode} |
| 845 |
\RequirePackage{titletoc} |
| 846 |
% \end{macrocode} |
| 847 |
% |
| 848 |
% \AmS{}系列宏包,包括: |
| 849 |
% \begin{enumerate} |
| 850 |
% \item \pkg{amsmath},提供了各种数学方面的增强型命令,以改进包含数学公式的文档结构; |
| 851 |
% \item \pkg{amsthm},提供了定理类环境样式规范; |
| 852 |
% \item \pkg{amssymb},提供各种数学符号。 |
| 853 |
% \end{enumerate} |
| 854 |
% 除此之外,载入 \pkg{unicode-math} 宏包以配置数学字体。 |
| 855 |
% \begin{macrocode} |
| 856 |
\RequirePackage{amsmath,amsthm,amssymb,unicode-math} |
| 857 |
% \end{macrocode} |
| 858 |
% |
| 859 |
% 这两个宏包最重要的用途是排版本科的第五级标题。前者用于提供带圈序号,而后者提供了方便的格式控制。 |
| 860 |
% \begin{macrocode} |
| 861 |
\RequirePackage{pifont,enumitem} |
| 862 |
% \end{macrocode} |
| 863 |
% |
| 864 |
% 一个适合排版含数值和单位的物理量的宏包,它也能提供在表格中按小数点竖直对齐的方法。 |
| 865 |
% \begin{macrocode} |
| 866 |
\RequirePackage{siunitx} |
| 867 |
% \end{macrocode} |
| 868 |
% |
| 869 |
% 关于化学式排版的宏包有很多,但这里载入 \pkg{mhchem}。 |
| 870 |
% 它容易上手,偏向于无机和分析化学(方程)式的排版。 |
| 871 |
% 至于有机化学的结构式等,使用图片插入可能是一个更好的选择;若时间充裕可学习如 \pkg{chemfig} 等宏包。 |
| 872 |
% \begin{macrocode} |
| 873 |
\RequirePackage[version = 4]{mhchem} |
| 874 |
% \end{macrocode} |
| 875 |
% |
| 876 |
% 浮动体系列宏包,控制表格、插图等浮动体及标签格式。 |
| 877 |
% \begin{macrocode} |
| 878 |
\RequirePackage{float} |
| 879 |
\RequirePackage{longtable,threeparttable,tabularx,multirow,booktabs} |
| 880 |
\RequirePackage{graphicx} |
| 881 |
\RequirePackage[labelformat = simple]{subcaption} |
| 882 |
\RequirePackage[format=hang]{caption} |
| 883 |
\RequirePackage{bicaption} |
| 884 |
% \end{macrocode} |
| 885 |
% |
| 886 |
% 一个用于绘图的宏包,模板里用于绘制脚注外的圆圈。 |
| 887 |
% \begin{macrocode} |
| 888 |
\RequirePackage{tikz} |
| 889 |
% \end{macrocode} |
| 890 |
% |
| 891 |
% 绘制封面的一些宏包。\pkg{calc} 能够方便地计算文本长度; |
| 892 |
% \pkg{textpos} 配合 \pkg{tikz},这样就能在页面的任何地方作画了。 |
| 893 |
% 另外, 在 ctex 宏集 2.5 版本之后需要手动载入\pkg{xeCJKfntef} 。 |
| 894 |
% \begin{macrocode} |
| 895 |
\RequirePackage{calc} |
| 896 |
\RequirePackage[absolute,overlay]{textpos} |
| 897 |
\RequirePackage{xeCJKfntef} |
| 898 |
% \end{macrocode} |
| 899 |
% |
| 900 |
% 代码块环境。 |
| 901 |
% \begin{macrocode} |
| 902 |
\RequirePackage{listings} |
| 903 |
% \end{macrocode} |
| 904 |
% |
| 905 |
% 该宏包提供了符合要求的“参考文献”章节中文献的编排格式。 |
| 906 |
% 这里的选项会传递至 \pkg{natbib},从而在正文中能实现数字、上标、方括号的引用模式。 |
| 907 |
% \begin{macrocode} |
| 908 |
\RequirePackage[sort&compress]{gbt7714} |
| 909 |
% \end{macrocode} |
| 910 |
% |
| 911 |
% 为了方便查看,模板将以彩色标明超链接和代码块中的关键字。 |
| 912 |
% \begin{macrocode} |
| 913 |
\RequirePackage{xcolor} |
| 914 |
% \end{macrocode} |
| 915 |
% |
| 916 |
% 用于插入PDF文件的宏包。可以插入封面、声明页(因为二者需要签字)等扫描或不方便排版的PDF文件。 |
| 917 |
% \begin{macrocode} |
| 918 |
\RequirePackage{pdfpages} |
| 919 |
% \end{macrocode} |
| 920 |
% |
| 921 |
% \pkg{footmisc} 宏包的选项将脚注的位置固定在页面底端,且跨页重置计数。 |
| 922 |
% \begin{macrocode} |
| 923 |
\RequirePackage[bottom,perpage]{footmisc} |
| 924 |
% \end{macrocode} |
| 925 |
% |
| 926 |
% 命令补丁,用于便捷地修改一些复杂命令,而无需重新定义之。 |
| 927 |
% \begin{macrocode} |
| 928 |
\RequirePackage{xpatch} |
| 929 |
% \end{macrocode} |
| 930 |
% |
| 931 |
% 判断语句。 |
| 932 |
% \begin{macrocode} |
| 933 |
\RequirePackage{xifthen} |
| 934 |
% \end{macrocode} |
| 935 |
% |
| 936 |
% 在页面画上标尺、边框线,和标注行号。仅当开启调试时。 |
| 937 |
% \begin{macrocode} |
| 938 |
\ifbuct@debugger |
| 939 |
\RequirePackage[color=blue,type=upperleft,showframe,hshift=2.7cm,vshift=3.5cm]{fgruler} |
| 940 |
\RequirePackage[pagewise]{lineno} |
| 941 |
\fi |
| 942 |
% \end{macrocode} |
| 943 |
% |
| 944 |
% 实现交叉引用与超链接。 |
| 945 |
% \begin{macrocode} |
| 946 |
\RequirePackage{hyperref} |
| 947 |
% \end{macrocode} |
| 948 |
% |
| 949 |
% \subsection{字体配置} |
| 950 |
% \begin{macro}{\buct@fontsetval} |
| 951 |
% 首先来设置中文的字体。在 \pkg{ctex} 宏集中的 \cs{g\_\_ctex\_fontset\_tl} 存储着选项 \opt{fontset} 的值。 |
| 952 |
% 模板尽可能避免使用 \LaTeX 3 语法,所以先用一个 \cs{buct@fontsetval} 来保存它。 |
| 953 |
% \begin{macrocode} |
| 954 |
\newcommand\buct@fontsetval{\csname g__ctex_fontset_tl\endcsname} |
| 955 |
% \end{macrocode} |
| 956 |
% \end{macro} |
| 957 |
% |
| 958 |
% 根据\cs{buct@fontsetval} 的值,分别设置不同的字体。 |
| 959 |
% |
| 960 |
% 在 Windows 系统下,需要对中易宋体、中易黑体开启“伪粗”和“伪斜”,并设置相关系数。 |
| 961 |
% \begin{macrocode} |
| 962 |
\ifthenelse{\equal{\buct@fontsetval}{windows}}{ |
| 963 |
\xeCJKsetup{EmboldenFactor=2.2,SlantFactor=0.2} |
| 964 |
\setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant] |
| 965 |
\setCJKsansfont{SimHei}[AutoFakeBold] |
| 966 |
} |
| 967 |
% \end{macrocode} |
| 968 |
% 而在非 Windows 系统下,则由 \pkg{ctex} 宏集自动检测环境并保留其默认设置, |
| 969 |
% 同时警告所使用的字体与《规范》(即默认设置)存在不同。 |
| 970 |
% \begin{macrocode} |
| 971 |
{ |
| 972 |
\ClassWarning{buctthesis}{% |
| 973 |
The fonts differ to the default.\MessageBreak% |
| 974 |
Use fontset = windows to correct.% |
| 975 |
} |
| 976 |
} |
| 977 |
% \end{macrocode} |
| 978 |
% |
| 979 |
% \begin{macro}{\bfsong} |
| 980 |
% 因设置中易宋体开启“伪粗体”,使用 \cs{bfseries} 将产生加粗的效果, |
| 981 |
% 这与一般的 \LaTeX\ 常识是相悖的。 |
| 982 |
% 因此模板提供了更明确的命令 \cs{bfsong}。 |
| 983 |
% \begin{macrocode} |
| 984 |
\newcommand{\bfsong}{\bfseries} |
| 985 |
% \end{macrocode} |
| 986 |
% \end{macro} |
| 987 |
% \begin{macro}{\bfhei} |
| 988 |
% |
| 989 |
% 对于黑体同理。 |
| 990 |
% 此外要注意:模板将 \opt{fontset = windows} 预设的无衬线字体(微软雅黑)改为了中易黑体。 |
| 991 |
% \begin{macrocode} |
| 992 |
\newcommand{\bfhei}{\sffamily\bfseries} |
| 993 |
% \end{macrocode} |
| 994 |
% \end{macro} |
| 995 |
% |
| 996 |
% 其次,对于西文,全部统一设置为 Times New Roman,以尽可能避免格式审查问题。 |
| 997 |
% \begin{macrocode} |
| 998 |
\setmainfont{Times New Roman} |
| 999 |
\setsansfont{Times New Roman} |
| 1000 |
\setmonofont{Times New Roman} |
| 1001 |
% \end{macrocode} |
| 1002 |
% |
| 1003 |
% 设置数学公式中的字体。 |
| 1004 |
% \begin{macrocode} |
| 1005 |
\IfFontExistsTF{LibertinusMath-Regular.otf}{% |
| 1006 |
\setmathfont{latinmodern-math.otf} |
| 1007 |
\setmathfont[% |
| 1008 |
range = {% |
| 1009 |
up/{latin,Latin,num}, |
| 1010 |
it/{latin,Latin,greek}, |
| 1011 |
bfit/{latin,Latin}, |
| 1012 |
} |
| 1013 |
]{LibertinusMath-Regular.otf} |
| 1014 |
}{} |
| 1015 |
% \end{macrocode} |
| 1016 |
% |
| 1017 |
% 指定 Unicode 中带圈数字 \symbol{"2460}--\symbol{"2469} 使用中文字体。 |
| 1018 |
% \begin{macrocode} |
| 1019 |
\xeCJKDeclareCharClass{CJK}{"2460->"2469} |
| 1020 |
% \end{macrocode} |
| 1021 |
% |
| 1022 |
% 完成配置后,定义文中各元素的字体样式。 |
| 1023 |
% |
| 1024 |
% 页眉与页脚。 |
| 1025 |
% \begin{macrocode} |
| 1026 |
\newcommand{\buct@headfont}{\zihao{-5}\songti} |
| 1027 |
\newcommand{\buct@footfont}{\zihao{-5}\songti} |
| 1028 |
% \end{macrocode} |
| 1029 |
% |
| 1030 |
% 诚信声明(本科)或论文原创性声明和授权声明(硕博)。 |
| 1031 |
% \begin{macrocode} |
| 1032 |
\ifbuct@bachelor |
| 1033 |
\newcommand{\buct@dcl@titlefont}{\zihao{3}\songti} |
| 1034 |
\newcommand{\buct@dcl@ideclarefont}{\zihao{4}\songti} |
| 1035 |
\else |
| 1036 |
\newcommand{\buct@dcl@titlefont}{\zihao{4}\bfseries} |
| 1037 |
\newcommand{\buct@dcl@textfont}{\zihao{4}\mdseries} |
| 1038 |
\newcommand{\buct@auth@titlefont}{\zihao{4}\bfseries} |
| 1039 |
\newcommand{\buct@auth@textfont}{\zihao{4}\mdseries} |
| 1040 |
\fi |
| 1041 |
% \end{macrocode} |
| 1042 |
% |
| 1043 |
% 中英文摘要。 |
| 1044 |
% 这里的 \cs{CJKfamily+} 命令来自于 \pkg{xeCJK} 宏包,用于切换字体族: |
| 1045 |
% 当参数为空时,则使用当前的 CJK 字体族,且对所有字符类生效。 |
| 1046 |
% \begin{macrocode} |
| 1047 |
\ifbuct@bachelor |
| 1048 |
\newcommand{\buct@abs@titfont}{\zihao{3}\bfsong} |
| 1049 |
\newcommand{\buct@abs@infofont}{\zihao{5}\mdseries} |
| 1050 |
\newcommand{\buct@abs@absfont}{\zihao{4}\songti} |
| 1051 |
\newcommand{\buct@keywordsfont}{\zihao{4}\heiti\CJKfamily+{}} |
| 1052 |
\newcommand{\buct@abs@titfonten}{\zihao{3}\bfseries} |
| 1053 |
\newcommand{\buct@abs@absfonten}{\zihao{4}\songti} |
| 1054 |
\newcommand{\buct@keywordsfonten}{\zihao{4}\heiti\CJKfamily+{}} |
| 1055 |
\else |
| 1056 |
\newcommand{\buct@abs@titfont}{\zihao{3}\heiti} |
| 1057 |
\newcommand{\buct@abs@absfont}{\zihao{-3}\heiti} |
| 1058 |
\newcommand{\buct@abs@textfont}{\zihao{4}\songti} |
| 1059 |
\newcommand{\buct@keywords@titfont}{\zihao{4}\heiti} |
| 1060 |
\newcommand{\buct@keywords@font}{\zihao{4}\songti} |
| 1061 |
\newcommand{\buct@abs@titfonten}{\zihao{3}\bfseries} |
| 1062 |
\newcommand{\buct@abs@absfonten}{\zihao{-3}\bfseries} |
| 1063 |
\newcommand{\buct@keywords@titfonten}{\zihao{4}\bfseries} |
| 1064 |
\newcommand{\buct@keywords@fonten}{\zihao{4}\mdseries} |
| 1065 |
\fi |
| 1066 |
% \end{macrocode} |
| 1067 |
% |
| 1068 |
% 中英文目录、设计图纸目录标题和目录中的各级标题。 |
| 1069 |
% \begin{macrocode} |
| 1070 |
\ifbuct@bachelor |
| 1071 |
\newcommand{\buct@toc@tocfont}{\zihao{4}\mdseries\heiti} |
| 1072 |
\else |
| 1073 |
\newcommand{\buct@toc@tocfont}{\zihao{3}\heiti} |
| 1074 |
\fi |
| 1075 |
\newcommand{\buct@toc@chapfont}{\zihao{4}\heiti} |
| 1076 |
\newcommand{\buct@toc@secfont}{\zihao{4}\songti} |
| 1077 |
\newcommand{\buct@toc@ssecfont}{\zihao{4}\songti} |
| 1078 |
\newcommand{\buct@toc@sssecfont}{\zihao{-4}\songti} |
| 1079 |
\newcommand{\buct@toc@dsgfigfont}{\buct@toc@ssecfont} |
| 1080 |
\newcommand{\buct@toce@chapfont}{\zihao{4}\bfseries} |
| 1081 |
% \end{macrocode} |
| 1082 |
% |
| 1083 |
% 正文的各级标题。 |
| 1084 |
% \begin{macrocode} |
| 1085 |
\ifbuct@bachelor |
| 1086 |
\newcommand{\buct@chapfont}{\zihao{-3}\bfsong\centering} |
| 1087 |
\newcommand{\buct@secfont}{\zihao{-3}\bfsong\centering} |
| 1088 |
\newcommand{\buct@ssecfont}{\zihao{-4}\bfsong\raggedright} |
| 1089 |
\newcommand{\buct@sssecfont}{\zihao{-4}\songti} |
| 1090 |
\else |
| 1091 |
\newcommand{\buct@chapfont}{\zihao{3}\heiti\centering} |
| 1092 |
\newcommand{\buct@secfont}{\zihao{4}\heiti\raggedright} |
| 1093 |
\newcommand{\buct@ssecfont}{\zihao{-4}\heiti\raggedright} |
| 1094 |
\newcommand{\buct@sssecfont}{\buct@ssecfont} |
| 1095 |
\fi |
| 1096 |
% \end{macrocode} |
| 1097 |
% |
| 1098 |
% 浮动体(包括插图和表格)内容、编号和标题。 |
| 1099 |
% \begin{macrocode} |
| 1100 |
\newcommand{\buct@floatfont}{\zihao{5}} |
| 1101 |
\newcommand{\buct@float@captionfont}{\zihao{5}\mdseries} |
| 1102 |
\newcommand{\buct@float@labelfont}{\zihao{5}\mdseries} |
| 1103 |
% \end{macrocode} |
| 1104 |
% |
| 1105 |
% 代码块。根据是否开启 \opt{submit} 选项,设置关键字、注释的颜色。 |
| 1106 |
% 如果未开启,关键字将会使用深蓝色,注释会使用深灰色。 |
| 1107 |
% \begin{macrocode} |
| 1108 |
\newcommand{\buct@codefont}{\ttfamily\songti\zihao{5}} |
| 1109 |
\newcommand{\buct@codecomfont}{% |
| 1110 |
\ttfamily\slshape |
| 1111 |
\ifbuct@submit\relax\else\color{gray!80!black}\fi} |
| 1112 |
\newcommand{\buct@codekeyfont}{% |
| 1113 |
\ttfamily\bfseries |
| 1114 |
\ifbuct@submit\relax\else\color{blue!80!black}\fi} |
| 1115 |
% \end{macrocode} |
| 1116 |
% |
| 1117 |
% |
| 1118 |
% \subsection{常量设置} |
| 1119 |
% \begin{macrocode} |
| 1120 |
\ifbuct@bachelor |
| 1121 |
\newcommand\buct@headtext{北京化工大学毕业设计(论文)} |
| 1122 |
\newcommand\buct@foottext{\thepage} |
| 1123 |
\newcommand\buct@dcl@title{诚信声明} |
| 1124 |
\newcommand\buct@dcl@ideclare{本人声明:} |
| 1125 |
\newcommand\buct@dcl@text{ |
| 1126 |
所呈交的学位论文是本人在导师的指导下独立进行研究工作所取得的成果。 |
| 1127 |
据我所知,除文中已经注明引用的内容外,本论文不包含任何其他个人或集体 |
| 1128 |
已经发表或撰写过的研究成果,也不包含为获得北京化工大学或其它教育机构 |
| 1129 |
的学位或证书而使用过的材料。对论文所涉及的研究工作做出贡献的其他个人 |
| 1130 |
和集体,均已在文中以明确方式标明或致谢。本人完全意识到本声明的法律 |
| 1131 |
结果由本人承担。 |
| 1132 |
} |
| 1133 |
\newcommand\buct@dcl@sign{本人签名:\hspace{14em}年\hspace{2.5em}月\hspace{2.5em}日} |
| 1134 |
\newcommand\buct@task@title{本科生毕业设计(论文)任务书} |
| 1135 |
\newcommand\buct@task@pdf{任务书} |
| 1136 |
\newcommand\buct@task@ChineseTitle{设计(论文)题目:} |
| 1137 |
\newcommand\buct@task@school{学院:} |
| 1138 |
\newcommand\buct@task@major{专业:} |
| 1139 |
\newcommand\buct@task@class{班级:} |
| 1140 |
\newcommand\buct@task@student{学生:} |
| 1141 |
\newcommand\buct@task@supervisor{指导教师(含职称):} |
| 1142 |
\newcommand\buct@task@msupervisor{专业负责人:} |
| 1143 |
\newcommand\buct@task@itema{1.设计(论文)的主要任务及目标} |
| 1144 |
\newcommand\buct@task@itemb{2.设计(论文)的基本要求和内容} |
| 1145 |
\newcommand\buct@task@itemc{3.主要参考文献} |
| 1146 |
\newcommand\buct@task@itemd{4.进度安排} |
| 1147 |
\newcommand\buct@cabstract@title{摘要} |
| 1148 |
\newcommand\buct@eabstract@title{ABSTRACT} |
| 1149 |
\newcommand\buct@ChineseKeywords@title{关键词:} |
| 1150 |
\newcommand\buct@EnglishKeywords@title{Keywords:~} |
| 1151 |
\newcommand\buct@ChineseKeywords@sep{\quad} |
| 1152 |
\newcommand\buct@EnglishKeywords@sep{; } |
| 1153 |
\newcommand\buct@supervisor@title{指导教师:} |
| 1154 |
\newcommand\buct@content@title{目\hspace{\ccwd}录} |
| 1155 |
\newcommand\buct@dfigurename{设计图纸} |
| 1156 |
\newcommand\buct@dfigure@content@title{设计图纸目录} |
| 1157 |
\newcommand\buct@foreword@title{前言} |
| 1158 |
\newcommand\buct@concl@title{结论} |
| 1159 |
\newcommand\buct@trans@title{翻译} |
| 1160 |
\newcommand\buct@ack@title{致谢} |
| 1161 |
\newcommand\buct@deno@title{符号说明} |
| 1162 |
\renewcommand\lstlistingname{代码} |
| 1163 |
\else |
| 1164 |
\newcommand\buct@headtext{\leftmark} |
| 1165 |
\newcommand\buct@foottext{\thepage} |
| 1166 |
\newcommand\buct@dcl@title{北京化工大学学位论文原创性声明} |
| 1167 |
\newcommand\buct@dcl@text{ |
| 1168 |
本人郑重声明:所呈交的学位论文,是本人在导师的指导下,独立 |
| 1169 |
进行研究工作所取得的成果。除文中已经注明引用的内容外,本论 |
| 1170 |
文不含任何其他个人或集体已经发表或撰写过的作品成果。对本文 |
| 1171 |
的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。 |
| 1172 |
本人完全意识到本声明的法律结果由本人承担。 |
| 1173 |
} |
| 1174 |
\newcommand\buct@auth@title{关于论文使用授权的说明} |
| 1175 |
\newcommand\buct@auth@text{ |
| 1176 |
学位论文作者完全了解北京化工大学有关保留和使用学位论文的规定, |
| 1177 |
即:研究生在校攻读学位期间论文工作的知识产权单位属北京化工大学。 |
| 1178 |
学校有权保留并向国家有关部门或机构送交论文的复印件和磁盘,允许 |
| 1179 |
学位论文被查阅和借阅;学校可以公布学位论文的全部或部分内容, |
| 1180 |
可以允许采用影印、缩印或其它复制手段保存、汇编学位论文。 |
| 1181 |
|
| 1182 |
$\Box$ 论文暂不公开(或保密)注释:本学位论文属于暂不公开 |
| 1183 |
(或保密)范围,在\rule{1.5em}{.4pt}年解密后适用本授权书。 |
| 1184 |
|
| 1185 |
$\Box$ 非暂不公开(或保密)论文注释:本学位论文不属于暂不公开 |
| 1186 |
(或保密)范围,适用本授权书。 |
| 1187 |
} |
| 1188 |
\newcommand\buct@dcl@pdf{版权页} |
| 1189 |
\newcommand\buct@sign@author{作者签名:\rule{7em}{.4pt}\qquad{日期:}\rule{7em}{.4pt}} |
| 1190 |
\newcommand\buct@sign@supervisor{导师签名:\rule{7em}{.4pt}\qquad{日期:}\rule{7em}{.4pt}} |
| 1191 |
\newcommand\buct@cabstract@title{摘\hspace{\ccwd}要} |
| 1192 |
\newcommand\buct@eabstract@title{ABSTRACT} |
| 1193 |
\newcommand\buct@ChineseKeywords@title{关键词:} |
| 1194 |
\newcommand\buct@EnglishKeywords@title{KEY WORDS:~} |
| 1195 |
\newcommand\buct@ChineseKeywords@sep{,} |
| 1196 |
\newcommand\buct@EnglishKeywords@sep{,~} |
| 1197 |
\newcommand\buct@content@title{目\hspace{\ccwd}录} |
| 1198 |
\newcommand\buct@econtent@chapter{Chapter~} |
| 1199 |
\newcommand\buct@econtentsname{Contents} |
| 1200 |
\newcommand\buct@deno@title{符号和缩略词说明} |
| 1201 |
\newcommand\buct@ack@title{致谢} |
| 1202 |
\newcommand\buct@eack@title{Acknowledgement} |
| 1203 |
\newcommand\buct@achi@title{研究成果及发表的学术论文} |
| 1204 |
\newcommand\buct@eachi@title{Research Results and Published Academic Papaers} |
| 1205 |
\newcommand\buct@resu@title{作者及导师简介} |
| 1206 |
\newcommand\buct@eresu@title{About the Author} |
| 1207 |
\newcommand\equationname{式} |
| 1208 |
\newcommand\buct@bitable@name{Table} |
| 1209 |
\newcommand\buct@bifigure@name{Figure} |
| 1210 |
\newcommand\buct@ebib@title{Bibliography} |
| 1211 |
\renewcommand\lstlistingname{代码} |
| 1212 |
\fi |
| 1213 |
% \end{macrocode} |
| 1214 |
% |
| 1215 |
% \subsection{页面设置} |
| 1216 |
% \subsubsection{纸张与边距} |
| 1217 |
% 使用 \pkg{geometry} 宏包设置各边距为:(单双页打印、本硕博相同) |
| 1218 |
% 上 \SI{3.5}{cm}、下 \SI{2.6}{cm}、左右 \SI{2.7}{cm},页眉 \SI{2.4}{cm}、页脚 \SI{2}{cm}。 |
| 1219 |
% \begin{macrocode} |
| 1220 |
\geometry{% |
| 1221 |
a4paper,nomarginpar, |
| 1222 |
top = 3.5cm, bottom = 2.6cm, left = 2.7cm, right = 2.7cm, |
| 1223 |
headheight = 1.1cm, footskip = 0.6cm, |
| 1224 |
} |
| 1225 |
% \end{macrocode} |
| 1226 |
% |
| 1227 |
% \subsubsection{页眉和页脚} |
| 1228 |
% 使用 \pkg{fancyhdr} 宏包设置页眉页脚的文字和线宽。 |
| 1229 |
% \begin{macrocode} |
| 1230 |
\fancypagestyle{plain}{% |
| 1231 |
\fancyhf{} |
| 1232 |
\fancyhead[C]{\buct@headfont\buct@headtext} |
| 1233 |
\fancyfoot[C]{\buct@footfont\buct@foottext} |
| 1234 |
\renewcommand\headrulewidth{0.6pt} |
| 1235 |
\renewcommand\footrulewidth{0pt} |
| 1236 |
} |
| 1237 |
\pagestyle{plain} |
| 1238 |
% \end{macrocode} |
| 1239 |
% |
| 1240 |
% \begin{macro}{\frontmatter} |
| 1241 |
% 修改命令 \cs{frontmatter} ,仅将页码从小写罗马字母改为大写,用于“第一章”之前的部分。 |
| 1242 |
% \begin{macrocode} |
| 1243 |
\xpatchcmd{\frontmatter} |
| 1244 |
{\pagenumbering{roman}} |
| 1245 |
{\pagenumbering{Roman}} |
| 1246 |
{}{} |
| 1247 |
% \end{macrocode} |
| 1248 |
% \end{macro} |
| 1249 |
% |
| 1250 |
% \begin{macro}{\cleardoublepage} |
| 1251 |
% 修改命令 \cs{cleardoublepage},使之能在插入一张完全空白页的同时 |
| 1252 |
% 保持页码的连续,适合章页右开的情况。 |
| 1253 |
% \begin{macrocode} |
| 1254 |
\xpatchcmd{\cleardoublepage} |
| 1255 |
{\newpage} |
| 1256 |
{\thispagestyle{empty}\newpage} |
| 1257 |
{}{} |
| 1258 |
% \end{macrocode} |
| 1259 |
% \end{macro} |
| 1260 |
% |
| 1261 |
%% \subsection{封面} |
| 1262 |
% 由于学校会统一印制封面,这里仅提供本科和硕博的一个参考实现。 |
| 1263 |
% 并且由于学校所给的参考封面每年都有细微的变动,由本模板所生成的封面上文字间距不能保证与参考一致。 |
| 1264 |
% 还请留心。 |
| 1265 |
% |
| 1266 |
% 标尺,用于调试。手动取消注释来开启。 |
| 1267 |
% \begin{macrocode} |
| 1268 |
% \usepackage[unit=cm,type=upperleft,hshift=0cm,vshift=0cm]{fgruler} |
| 1269 |
% \end{macrocode} |
| 1270 |
% |
| 1271 |
% \begin{macro}{\buct@title@ul} |
| 1272 |
% 定义下划线命令,这里利用了 \pkg{calc} 宏包的 \cs{widthof} 命令, |
| 1273 |
% 取 \cs{buct@ChineseTitleLineA} (即首行标题)的长度,用以固定下划线的长度。 |
| 1274 |
% 文本末尾加一个 \cs{enspace} 会让横线右端稍长于最后一个文字,显得更美观一些。 |
| 1275 |
% \begin{macrocode} |
| 1276 |
\newcommand\buct@title@ul[1]{% |
| 1277 |
\CJKunderline{\makebox[\widthof{\buct@ChineseTitleLineA\enspace}][l]{#1}} |
| 1278 |
} |
| 1279 |
% \end{macrocode} |
| 1280 |
% \end{macro} |
| 1281 |
% |
| 1282 |
% \begin{macro}{\buct@major@ul} |
| 1283 |
% 但是对于本科封面而言,“专业”“学生”“指导教师”与“题目”之间有一大段空白, |
| 1284 |
% 可以看做相互独立的表格。因此,这里我们让横线的宽度取所填入专业文本的宽度。 |
| 1285 |
% 使用 \cs{quad} 会让横线右端长于最后一个文字更多一点,更贴合封面的参考样例。 |
| 1286 |
% \begin{macrocode} |
| 1287 |
\newcommand\buct@major@ul[1]{% |
| 1288 |
\CJKunderline{\makebox[\widthof{\buct@major\quad}][c]{#1}} |
| 1289 |
} |
| 1290 |
% \end{macrocode} |
| 1291 |
% \end{macro} |
| 1292 |
% |
| 1293 |
% \begin{macro}{\buct@format@date} |
| 1294 |
% 日期格式处理,将输入的 \cs{buct@date} 拆分。 |
| 1295 |
% \begin{macrocode} |
| 1296 |
\newcommand\buct@format@date[1]{% |
| 1297 |
\edef\buct@@date{\buct@date}% |
| 1298 |
\def\buct@@process@date##1-##2-##3\@nil{% |
| 1299 |
#1{##1}{##2}{##3}% |
| 1300 |
}% |
| 1301 |
\expandafter\buct@@process@date\buct@@date\@nil |
| 1302 |
} |
| 1303 |
% \end{macrocode} |
| 1304 |
% \end{macro} |
| 1305 |
% |
| 1306 |
% \cs{@zhdate} 命令接受三个数字。 |
| 1307 |
% 本科的日期要求比较简单,直接输出对应的数字即可。 |
| 1308 |
% 但是样例所给的数字前后有一些空白,我们用 \cs{makebox} 来定格它。 |
| 1309 |
% \begin{macrocode} |
| 1310 |
\newcommand\@zhdate[3]{% |
| 1311 |
\bfseries\zhkai |
| 1312 |
\ifbuct@bachelor |
| 1313 |
\zihao{4} |
| 1314 |
#1年\makebox[1.5em]{#2}月\makebox[1.5em]{#3}日 |
| 1315 |
% \end{macrocode} |
| 1316 |
% |
| 1317 |
% 如果是硕博,则将“年”转换为中文数字串,“月”和“日”转换为中文数字;其中“年”中的 0 映射为“〇”而非“零”。 |
| 1318 |
% \begin{macrocode} |
| 1319 |
\else |
| 1320 |
\Large\ziju{.1}% |
| 1321 |
日\hspace{1.5\ccwd}期:\zhdigits{#1}年\zhnumber{#2}月\zhnumber{#3}日% |
| 1322 |
\fi |
| 1323 |
} |
| 1324 |
% \end{macrocode} |
| 1325 |
% |
| 1326 |
% \begin{macro}{\buct@makecover} |
| 1327 |
% 接下来是重头戏:定义 \cs{buct@makecover} 命令来生成封面。 |
| 1328 |
% \begin{macrocode} |
| 1329 |
\newcommand{\buct@makecover}{% |
| 1330 |
% \end{macrocode} |
| 1331 |
% |
| 1332 |
% 首先是页边距和页眉页脚。 |
| 1333 |
% 经过测量,各边距值比正文部分都要小;本科暂与硕博设置一致。 |
| 1334 |
% \begin{macrocode} |
| 1335 |
\newgeometry{ |
| 1336 |
top = 2.1cm, bottom = 2.2cm, |
| 1337 |
left = 2cm, right = 2cm, |
| 1338 |
headheight = 0cm, footskip = 0cm |
| 1339 |
} |
| 1340 |
% \end{macrocode} |
| 1341 |
% 清空页眉、页脚。 |
| 1342 |
% \begin{macrocode} |
| 1343 |
\thispagestyle{empty} |
| 1344 |
% \end{macrocode} |
| 1345 |
% |
| 1346 |
% 其次是字体。关于字体的检查和定义放在了文档命令 \cs{makecover} 的定义中。(见本节末尾) |
| 1347 |
% 在这里,我们只开启伪粗体,并且应设置得比正文更粗一些。 |
| 1348 |
% \begin{macrocode} |
| 1349 |
\xeCJKsetup{EmboldenFactor=2.3} |
| 1350 |
% \end{macrocode} |
| 1351 |
% |
| 1352 |
% 封面右上角的“单位代码”和“学号”,先分别设置格式。 |
| 1353 |
% \begin{macrocode} |
| 1354 |
\begin{table}[h] |
| 1355 |
\raggedleft |
| 1356 |
\ifbuct@bachelor |
| 1357 |
\songti\zihao{5} |
| 1358 |
\else |
| 1359 |
\renewcommand{\arraystretch}{1.3}\large |
| 1360 |
\fi |
| 1361 |
% \end{macrocode} |
| 1362 |
% |
| 1363 |
% 用一个无线表格来排版文字。需要注意二者都要以中文字体来书写数字。 |
| 1364 |
% 注意本科封面的表格右端并不是严格顶头,所以这里空开两个字符的宽度。 |
| 1365 |
% \begin{macrocode} |
| 1366 |
\begin{tabular}{l@{}l} |
| 1367 |
\ifbuct@bachelor% |
| 1368 |
班\hspace{2\ccwd}级&:\CJKfamily+{zhsong}\buct@class\hspace*{2\ccwd}\\ |
| 1369 |
学\hspace{2\ccwd}号&:\CJKfamily+{zhsong}\buct@studentid\hspace*{2\ccwd}\\ |
| 1370 |
\else% |
| 1371 |
\xbsong 单位代码 & :\CJKfamily+{zhsong}\mbox{10010}\\ |
| 1372 |
\xbsong 学\hspace{2\ccwd}号 & :\CJKfamily+{zhsong}\mbox{\buct@studentid}\\ |
| 1373 |
\fi |
| 1374 |
\end{tabular} |
| 1375 |
\end{table} |
| 1376 |
\ifbuct@bachelor\vspace{3bp}\else\vspace{26bp}\fi |
| 1377 |
% \end{macrocode} |
| 1378 |
% |
| 1379 |
% 校徽与校名。前者是插图,后者是文字。 |
| 1380 |
% 需要注意,本科和硕博封面的“北京化工大学”几个字的字距是有差别的。 |
| 1381 |
% 由于并未设置居中,所以本科还需要手动空一点距离让文本近似居于页面中央。 |
| 1382 |
% \begin{macrocode} |
| 1383 |
\begin{minipage}[c][][c]{2.35cm} |
| 1384 |
\includegraphics[width = 2.35cm]{figure/BUCT-badge.pdf} |
| 1385 |
\end{minipage} |
| 1386 |
\qquad |
| 1387 |
\begin{minipage}[c][2.35cm][c]{9cm} |
| 1388 |
\xingkai |
| 1389 |
\ifbuct@bachelor |
| 1390 |
\ziju{0.1}\hspace*{0.8\ccwd}\zihao{-0} |
| 1391 |
\else |
| 1392 |
\ziju{-0.02}\zihao{0} |
| 1393 |
\fi |
| 1394 |
{北京化工大学} |
| 1395 |
\end{minipage} |
| 1396 |
\ifbuct@bachelor\vspace{12bp}\else\vspace{18bp}\fi |
| 1397 |
% \end{macrocode} |
| 1398 |
% |
| 1399 |
% 标题。本科的标题中的“(论文)”使用了半角括号,字体使用 Times New Roman Bold。 |
| 1400 |
% 但按照排版规范,模板使用全角标点和对应的中文字体。 |
| 1401 |
% 对于这项更改,我们使用 \pkg{xeCJK} 里的命令来吃掉一点括号的空白。 |
| 1402 |
% |
| 1403 |
% 注:\cs{punctstyle\{banjiao\}} 和 \cs{xeCJKsetup\{PunctStyle = banjiao\}} 和 \cs{ctexset\{punct = banjiao\}}是一样的。 |
| 1404 |
% \begin{macrocode} |
| 1405 |
\begin{center} |
| 1406 |
\ifbuct@bachelor |
| 1407 |
\ziju{0.15}\xbsong\zihao{-0}\CJKfamily+{}{% |
| 1408 |
\punctstyle{banjiao}毕业设计(论文)% (论文) |
| 1409 |
} |
| 1410 |
\else% |
| 1411 |
%\ziju{-0.05} |
| 1412 |
\dbsong\fontsize{38bp}{60bp}\selectfont |
| 1413 |
\ifbuct@master{硕}\else{博}\fi{}士研究生学位论文 |
| 1414 |
\fi |
| 1415 |
\end{center} |
| 1416 |
% \end{macrocode} |
| 1417 |
% |
| 1418 |
% 对于论文标题之下的部分,我们将本科和硕博分开设置。 |
| 1419 |
% |
| 1420 |
% 本科封面有两条横贯页面的横线,位于纸张顶部向下 \SI{10}{\centi\metre} 左右, |
| 1421 |
% 我们用 \pkg{textpos} 的 \env{textblock} 环境定位,用 \pkg{tikz} 将它们画出来。 |
| 1422 |
% 两条线的间距取 \SI{0.2}{\centi\metre}。 |
| 1423 |
% \begin{macrocode} |
| 1424 |
\ifbuct@bachelor |
| 1425 |
\setlength{\TPHorizModule}{1cm} |
| 1426 |
\setlength{\TPVertModule}{1cm} |
| 1427 |
\begin{textblock}{0}(0,10) |
| 1428 |
\noindent% |
| 1429 |
\tikz[line width=1.2pt] \draw (0,0) -- (21,0) (0,0.2) -- (21,0.2); |
| 1430 |
\end{textblock} |
| 1431 |
\vspace{72bp} |
| 1432 |
% \end{macrocode} |
| 1433 |
% |
| 1434 |
% 接下来书写题目。先使用 \pkg{xeCJK} 的功能来禁用下划线的断点,并调整其粗细。 |
| 1435 |
% \begin{macrocode} |
| 1436 |
\begin{center} |
| 1437 |
\xeCJKsetup{ |
| 1438 |
underline = { |
| 1439 |
skip = false, |
| 1440 |
thickness = 1.4pt, |
| 1441 |
} |
| 1442 |
} |
| 1443 |
% \end{macrocode} |
| 1444 |
% |
| 1445 |
% 然后是“题目”及其内容。 |
| 1446 |
% 题目需要手动断行,且长度控制在 \SI{36}{em} 以内。 |
| 1447 |
% 因表格本身的横线与文字间距较大,这里采用下划线的方式来划线。 |
| 1448 |
% 注意这里我们要判断题目是否有第二行(即 \cs{buct@ChineseTitleLineB} 是否有值) |
| 1449 |
% 来输出一行还是两行题目。 |
| 1450 |
% \begin{macrocode} |
| 1451 |
\renewcommand{\arraystretch}{2} |
| 1452 |
\begin{tabular}{% |
| 1453 |
>{\zihao{-2}\xbsong}l |
| 1454 |
>{\zihao{3}\bfseries}l |
| 1455 |
} |
| 1456 |
题\hspace{\ccwd}目 & \buct@title@ul{\buct@ChineseTitleLineA}\\ |
| 1457 |
\ifthenelse{\equal{\buct@ChineseTitleLineB}{}}{\relax}{ |
| 1458 |
& \buct@title@ul{\buct@ChineseTitleLineB}\\ |
| 1459 |
} |
| 1460 |
\end{tabular} |
| 1461 |
\vskip144bp\zihao{3} |
| 1462 |
% \end{macrocode} |
| 1463 |
% |
| 1464 |
% 使用一个表格来排版论文的信息,如前定义 \cs{buct@major@ul} 所述,这里横线的宽度取“专业”内容的宽度。 |
| 1465 |
% \begin{macrocode} |
| 1466 |
\begin{tabular}{ |
| 1467 |
>{\begin{CJKfilltwosides}[b]{4\ccwd}\xbsong}r% |
| 1468 |
<{\end{CJKfilltwosides}}% |
| 1469 |
@{}>{\enspace\zihao{4}\bfseries}l% |
| 1470 |
<{\vspace{.2em}}% |
| 1471 |
} |
| 1472 |
专业 & \buct@major@ul{\buct@major}\\ |
| 1473 |
学生 & \buct@major@ul{\buct@author}\\ |
| 1474 |
指导教师 & \buct@major@ul{\buct@supervisor}\\ |
| 1475 |
\end{tabular} |
| 1476 |
\end{center} |
| 1477 |
% \end{macrocode} |
| 1478 |
% |
| 1479 |
% 在页面底部书写日期。 |
| 1480 |
% \begin{macrocode} |
| 1481 |
\vfill{% |
| 1482 |
\begin{center}% |
| 1483 |
\buct@format@date{\@zhdate}% |
| 1484 |
\end{center}% |
| 1485 |
} |
| 1486 |
% \end{macrocode} |
| 1487 |
% |
| 1488 |
% 硕博论文的处理方式与本科相似。 |
| 1489 |
% \begin{macrocode} |
| 1490 |
\else |
| 1491 |
\vspace{76bp} |
| 1492 |
\begin{center} |
| 1493 |
\xeCJKsetup{ |
| 1494 |
underline = { |
| 1495 |
skip = false, |
| 1496 |
thickness = 1.2pt, |
| 1497 |
} |
| 1498 |
} |
| 1499 |
\renewcommand{\arraystretch}{2.7} |
| 1500 |
\begin{tabular}{ |
| 1501 |
>{\fontsize{20}{36}\selectfont\begin{CJKfilltwosides}[b]{4\ccwd}\sffamily\bfseries}r% |
| 1502 |
<{\end{CJKfilltwosides}}% |
| 1503 |
@{}>{\enspace\zihao{3}\bfseries}l% |
| 1504 |
<{\vspace{.2em}}% |
| 1505 |
} |
| 1506 |
题目 & \buct@title@ul{\buct@ChineseTitleLineA}\\ |
| 1507 |
\ifthenelse{\equal{\buct@ChineseTitleLineB}{}}{\relax}{ |
| 1508 |
& \buct@title@ul{\buct@ChineseTitleLineB}\\ |
| 1509 |
} |
| 1510 |
专业 & \buct@title@ul{\zihao{4}\buct@major}\\ |
| 1511 |
研究生 & \buct@title@ul{\zihao{4}\buct@author}\\ |
| 1512 |
指导教师 & \buct@title@ul{\zihao{4}\buct@supervisor}\\ |
| 1513 |
\end{tabular} |
| 1514 |
\end{center} |
| 1515 |
\vfill{% |
| 1516 |
\begin{center}% |
| 1517 |
\buct@format@date{\@zhdate}% |
| 1518 |
\end{center}% |
| 1519 |
} |
| 1520 |
\fi |
| 1521 |
} |
| 1522 |
% \end{macrocode} |
| 1523 |
% \end{macro} |
| 1524 |
% |
| 1525 |
% \begin{macro}{\makecover} |
| 1526 |
% 这里定义文档命令 \cs{makecover},接受一个可选参数用于插入扫描页,否则调用 \cs{buct@makecover} 生成封面。 |
| 1527 |
% \begin{macrocode} |
| 1528 |
\NewDocumentCommand{\makecover}{ o }{% |
| 1529 |
\hypertarget{cover}{} |
| 1530 |
\pdfbookmark{封面}{cover} |
| 1531 |
\IfNoValueTF{#1}{ |
| 1532 |
% \end{macrocode} |
| 1533 |
% 在不插入扫描页的情况下调用时,需要先检查字体存在情况。 |
| 1534 |
% 因为只有硕博论文封面才会用到方正大标宋,为简单起见,这里只检查方正小标宋。 |
| 1535 |
% 如果存在方正小标宋,则默认也存在方正大标宋、华文行楷和中易楷体,并定义上述所有字体。 |
| 1536 |
% 至于西文字体则不做设置,也就是说沿用模板默认的 Times New Roman。 |
| 1537 |
% 事实上该字体只会作用于本科封面的数字日期,除此之外的数字(如学号)使用中文字体。 |
| 1538 |
% \begin{macrocode} |
| 1539 |
\IfFontExistsTF{FZXiaoBiaoSong-B05S}{% |
| 1540 |
\newCJKfontfamily[xbsong] \xbsong {FZXiaoBiaoSong-B05S} |
| 1541 |
\newCJKfontfamily[dbsong] \dbsong {FZDaBiaoSong-B06S} |
| 1542 |
\newCJKfontfamily[xingkai]\xingkai{STXingkai} |
| 1543 |
\newCJKfontfamily[zhkai] \zhkai {KaiTi} [AutoFakeBold] |
| 1544 |
% \end{macrocode} |
| 1545 |
% 只有当存在方正小标宋时,令 \cs{makecover} 调用 \cs{buct@makecover},否则输出空白页。 |
| 1546 |
% \begin{macrocode} |
| 1547 |
\buct@makecover |
| 1548 |
}{ |
| 1549 |
\cleardoublepage |
| 1550 |
} |
| 1551 |
|
| 1552 |
}{% |
| 1553 |
% \end{macrocode} |
| 1554 |
% 在选择插入扫描页的情况下(命令后跟了一个可选参数)则无需检查和设置字体,直接插入 PDF 文件即可。 |
| 1555 |
% \begin{macrocode} |
| 1556 |
\includepdf[pages=-]{#1} |
| 1557 |
} |
| 1558 |
% \end{macrocode} |
| 1559 |
% 输出封面完成后,页边距从封面中恢复。 |
| 1560 |
% \begin{macrocode} |
| 1561 |
\restoregeometry |
| 1562 |
} |
| 1563 |
% \end{macrocode} |
| 1564 |
% \end{macro} |
| 1565 |
% |
| 1566 |
% |
| 1567 |
% \subsection{前置部分} |
| 1568 |
% \begin{macro}{\buct@pdfmark} |
| 1569 |
% 为了方便查看,模板将前置部分编入PDF书签,实现跳转。 |
| 1570 |
% 这里定义了一个命令用于简化代码。 |
| 1571 |
% \begin{macrocode} |
| 1572 |
\newcommand{\buct@pdfmark}[2]{% |
| 1573 |
\hypertarget{#2}{} |
| 1574 |
\pdfbookmark{#1}{#2} |
| 1575 |
} |
| 1576 |
% \end{macrocode} |
| 1577 |
% \end{macro} |
| 1578 |
% |
| 1579 |
% \subsubsection{声明页} |
| 1580 |
% \begin{macro}{\buct@makedeclare} |
| 1581 |
% 本科为“诚信声明”,硕博为“原创性声明”与“使用授权说明”。这里定义不使用扫描页的命令。 |
| 1582 |
% \begin{macrocode} |
| 1583 |
\newcommand{\buct@makedeclare}{ |
| 1584 |
\ifbuct@bachelor |
| 1585 |
\centerline{\buct@dcl@titlefont\buct@dcl@title}\par\vspace{1em} |
| 1586 |
\leftline{\buct@dcl@ideclarefont\buct@dcl@ideclare}% |
| 1587 |
\buct@dcl@text |
| 1588 |
\par\vspace{2em}\hfill{\buct@dcl@sign} |
| 1589 |
\else{ |
| 1590 |
\thispagestyle{empty} |
| 1591 |
\linespread{1.5534} |
| 1592 |
\setlength{\parskip}{15pt} |
| 1593 |
\centerline{\buct@dcl@titlefont\buct@dcl@title} |
| 1594 |
\par\indent\buct@dcl@textfont\buct@dcl@text |
| 1595 |
\par\indent\buct@sign@author\\[30pt] |
| 1596 |
\centerline{\buct@auth@titlefont\buct@auth@title} |
| 1597 |
\par\indent\buct@auth@textfont\buct@auth@text |
| 1598 |
\par\indent\buct@sign@author |
| 1599 |
\par\indent\buct@sign@supervisor |
| 1600 |
}\fi |
| 1601 |
\clearpage\normalsize |
| 1602 |
} |
| 1603 |
% \end{macrocode} |
| 1604 |
% \end{macro} |
| 1605 |
% |
| 1606 |
% \begin{macro}{\makedeclare} |
| 1607 |
% 定义一个带可选参数的命令 \cs{makedeclare},可选参数为扫面页的相对路径; |
| 1608 |
% 若不加参数则使用 \cs{buct@makedeclare} 来插入文本。 |
| 1609 |
% 这里的 \opt{pages=-} 表示插入所有页面。 |
| 1610 |
% \begin{macrocode} |
| 1611 |
\NewDocumentCommand{\makedeclare}{ o }{% |
| 1612 |
\buct@pdfmark{\ifbuct@bachelor\buct@dcl@title\else\buct@dcl@pdf\fi}{declare} |
| 1613 |
\IfNoValueTF{#1}{\buct@makedeclare}{% |
| 1614 |
\includepdf[pages=-]{#1} |
| 1615 |
} |
| 1616 |
} |
| 1617 |
% \end{macrocode} |
| 1618 |
% \end{macro} |
| 1619 |
% |
| 1620 |
% \subsubsection{任务书} |
| 1621 |
% \begin{environment}{taskbook} |
| 1622 |
% 环境 \env{taskbook} 用于插入任务书部分,该部分排在诚信声明之后。 |
| 1623 |
% 如果环境后带星号,则生成的任务书清空页眉和页脚。 |
| 1624 |
% |
| 1625 |
% 留意 \pkg{xparse} 宏包的 \cs{NewDocumentEnvironment} 还没法一次性定义带或不带星号的环境 |
| 1626 |
% ——比如 \env{tabular} 和 \env{tabular*}。 |
| 1627 |
% \begin{macrocode} |
| 1628 |
\ifbuct@bachelor |
| 1629 |
\NewDocumentEnvironment{taskbook}{ s }{% |
| 1630 |
\cleardoublepage% |
| 1631 |
\buct@pdfmark{\buct@task@pdf}{taskbook}% |
| 1632 |
\section*{\buct@task@title}% |
| 1633 |
\IfBooleanTF{#1}{\pagestyle{empty}}{}% |
| 1634 |
}{\clearpage} |
| 1635 |
% \end{macrocode} |
| 1636 |
% \end{environment} |
| 1637 |
% |
| 1638 |
% \begin{macro}{\buct@ul} |
| 1639 |
% “任务书”开头部分的下划线。 |
| 1640 |
% \begin{macrocode} |
| 1641 |
\NewDocumentCommand{\buct@ul}{ o m }{\underline{\makebox[#1][c]{#2}}} |
| 1642 |
% \end{macrocode} |
| 1643 |
% \end{macro} |
| 1644 |
% |
| 1645 |
% 排版“任务书”时,提供如下的命令和环境: |
| 1646 |
% \begin{macro}{\taskinfo*} |
| 1647 |
% 命令 \cs{taskinfo} 或 \cs{taskinfo*}: |
| 1648 |
% 后者是学校样例的实现,但是由于换行、空位少造成书写不便,且不甚美观; |
| 1649 |
% 而前者比后者多了一次换行且设置了文本和横线的对齐,适合文字较多时使用。 |
| 1650 |
% \begin{macrocode} |
| 1651 |
\NewDocumentCommand\taskinfo{ s }{% |
| 1652 |
\noindent% |
| 1653 |
\begin{minipage}{\textwidth}% |
| 1654 |
\punctstyle{plain}\linespread{1.94}% |
| 1655 |
\buct@task@ChineseTitle\buct@ul[27em]{\buct@ChineseTitle}\\[3pt] |
| 1656 |
\IfBooleanTF{#1}{% less lines break |
| 1657 |
\buct@task@school\buct@ul[10em]{\buct@school}\quad |
| 1658 |
\buct@task@major\buct@ul[10em]{\buct@major}\quad |
| 1659 |
\buct@task@class\buct@ul[5em]{\buct@class}\\[3pt] |
| 1660 |
\buct@task@student\buct@ul[5em]{\buct@author}\quad |
| 1661 |
\buct@task@supervisor\buct@ul[6em]{\buct@supervisor}\quad |
| 1662 |
\buct@task@msupervisor\buct@ul[4em]{\buct@msupervisor}% |
| 1663 |
}{% more lines break |
| 1664 |
% \end{macrocode} |
| 1665 |
% \end{macro} |
| 1666 |
% \begin{macro}{\taskinfo} |
| 1667 |
% 多了一次换行,相比之下会更加整齐一些。 |
| 1668 |
% \begin{macrocode} |
| 1669 |
\buct@task@school\buct@ul[15em]{\buct@school}\qquad |
| 1670 |
\buct@task@major\buct@ul[13em]{\buct@major}\\[3pt] |
| 1671 |
\buct@task@class\buct@ul[15em]{\buct@class}\qquad |
| 1672 |
\buct@task@student\buct@ul[13em]{\buct@author}\\[3pt] |
| 1673 |
\buct@task@supervisor\buct@ul[8em]{\buct@supervisor}\qquad |
| 1674 |
\buct@task@msupervisor\buct@ul[10em]{\buct@msupervisor}% |
| 1675 |
} |
| 1676 |
\end{minipage}\vspace{1.5em} |
| 1677 |
} |
| 1678 |
% \end{macrocode} |
| 1679 |
% \end{macro} |
| 1680 |
% |
| 1681 |
% 命令 \cs{taskitem} :用于排版任务书中“设计(论文)的主要任务及目标”等四项标题。 |
| 1682 |
% 该命令只能使用四次,超过则会报错且给予修正提示。 |
| 1683 |
% \begin{macrocode} |
| 1684 |
\newcounter{taskitemcnt} |
| 1685 |
\newcommand{\buct@taskitem}{% |
| 1686 |
\stepcounter{taskitemcnt}% |
| 1687 |
\ifcase\value{taskitemcnt}\relax\or% |
| 1688 |
{\buct@task@itema}\or% |
| 1689 |
{\buct@task@itemb}\or% |
| 1690 |
{\buct@task@itemc}\or% |
| 1691 |
{\buct@task@itemd}\else% |
| 1692 |
\ClassError{buctthesis}{Too many \protect\taskitem\space used}% |
| 1693 |
{Keep \protect\taskitem\space no more than 4 times.}\fi |
| 1694 |
} |
| 1695 |
% \end{macrocode} |
| 1696 |
% \begin{macro}{\taskitem} |
| 1697 |
% 这里相比学校的样例,段前增加了一点空白。 |
| 1698 |
% \begin{macrocode} |
| 1699 |
\newcommand{\taskitem}{\vspace{6pt}\noindent\buct@taskitem\par} |
| 1700 |
\fi |
| 1701 |
% \end{macrocode} |
| 1702 |
% \end{macro} |
| 1703 |
% |
| 1704 |
% |
| 1705 |
% \begin{environment}{bibenumerate} |
| 1706 |
% 定义 \env{bibenumerate} 环境:可以生成带有方括号、阿拉伯数字的列表。 |
| 1707 |
% 该命令可用于本科的“任务书”中罗列主要参考文献, |
| 1708 |
% 亦可用于硕博“研究成果及发表的学术论文”中罗列发表的论文与专利。 |
| 1709 |
% \begin{macrocode} |
| 1710 |
\newenvironment{bibenumerate}{% |
| 1711 |
\begin{enumerate}[label={[\arabic*]},leftmargin=3em] |
| 1712 |
}{\end{enumerate}} |
| 1713 |
% \end{macrocode} |
| 1714 |
% \end{environment} |
| 1715 |
% |
| 1716 |
% \subsubsection{摘要} |
| 1717 |
% \begin{environment}{cabstract} |
| 1718 |
% 中文摘要,使用 \env{cabstract} 环境。 |
| 1719 |
% \begin{macrocode} |
| 1720 |
\ifbuct@bachelor |
| 1721 |
\newenvironment{cabstract}{% |
| 1722 |
\cleardoublepage |
| 1723 |
\buct@pdfmark{\buct@cabstract@title}{cabstract} |
| 1724 |
\begin{center} |
| 1725 |
\buct@abs@titfont\buct@ChineseTitle |
| 1726 |
\vskip22pt |
| 1727 |
\buct@abs@infofont\buct@author\quad% |
| 1728 |
\buct@class\quad\buct@studentid\quad% |
| 1729 |
\buct@supervisor@title\buct@supervisor% |
| 1730 |
\vskip22pt |
| 1731 |
\buct@abs@absfont\buct@cabstract@title |
| 1732 |
\end{center}\par\vspace{18pt} |
| 1733 |
}{\vskip1em\noindent\buct@keywordsfont\buct@ChineseKeywords@title\buct@ChineseKeywords} |
| 1734 |
\else |
| 1735 |
\newenvironment{cabstract}{% |
| 1736 |
\cleardoublepage |
| 1737 |
\buct@pdfmark{\buct@cabstract@title}{cabstract}\markboth{\buct@cabstract@title}{\buct@cabstract@title} |
| 1738 |
\begin{center} |
| 1739 |
\buct@abs@titfont\buct@ChineseTitle |
| 1740 |
\vskip24pt |
| 1741 |
\buct@abs@absfont\buct@cabstract@title |
| 1742 |
\end{center}\par\vspace{12pt} |
| 1743 |
\buct@abs@textfont |
| 1744 |
}{\vskip24pt% |
| 1745 |
\noindent\buct@keywords@titfont\buct@ChineseKeywords@title\buct@keywords@font\buct@ChineseKeywords} |
| 1746 |
\fi |
| 1747 |
% \end{macrocode} |
| 1748 |
% \end{environment} |
| 1749 |
% |
| 1750 |
% \begin{environment}{eabstract} |
| 1751 |
% 英文摘要,使用 \env{eabstract} 环境。 |
| 1752 |
% \begin{macrocode} |
| 1753 |
\ifbuct@bachelor |
| 1754 |
\newenvironment{eabstract}{% |
| 1755 |
\cleardoublepage% |
| 1756 |
\buct@pdfmark{\buct@eabstract@title}{abstracten} |
| 1757 |
\begin{center} |
| 1758 |
\buct@abs@titfonten\buct@EnglishTitle\vskip22pt |
| 1759 |
\buct@abs@absfonten\buct@eabstract@title |
| 1760 |
\end{center} |
| 1761 |
\par\vspace{22pt} |
| 1762 |
}{\vskip1em\noindent\buct@keywordsfonten \buct@EnglishKeywords@title\buct@EnglishKeywords} |
| 1763 |
\else |
| 1764 |
\newenvironment{eabstract}{% |
| 1765 |
\cleardoublepage% |
| 1766 |
\buct@pdfmark{\buct@eabstract@title}{eabstract}\markboth{\buct@eabstract@title}{\buct@eabstract@title} |
| 1767 |
\begin{center} |
| 1768 |
\setlength{\leftskip}{3em plus 1em minus .5em} |
| 1769 |
\setlength{\rightskip}{3em plus 1em minus .5em} |
| 1770 |
\buct@abs@titfonten\buct@EnglishTitle\vskip76pt |
| 1771 |
\buct@abs@absfonten\buct@eabstract@title |
| 1772 |
\end{center}\par\vspace{40pt} |
| 1773 |
\buct@abs@textfont |
| 1774 |
}{\vskip48pt% |
| 1775 |
\noindent\buct@keywords@titfonten\buct@EnglishKeywords@title\buct@keywords@fonten\buct@EnglishKeywords} |
| 1776 |
\fi |
| 1777 |
% \end{macrocode} |
| 1778 |
% \end{environment} |
| 1779 |
% |
| 1780 |
% \subsubsection{目录} |
| 1781 |
% 正文中三级小节(subsubsubsection)不予编号; |
| 1782 |
% 本科:编目层次至小节(subsection),硕博:编目层次至小小节(subsubsection)。 |
| 1783 |
% \begin{macrocode} |
| 1784 |
\setcounter{secnumdepth}{3} |
| 1785 |
\ifbuct@bachelor |
| 1786 |
\setcounter{tocdepth}{2} |
| 1787 |
\else |
| 1788 |
\setcounter{tocdepth}{3} |
| 1789 |
\fi |
| 1790 |
% \end{macrocode} |
| 1791 |
% |
| 1792 |
% \begin{macro}{\tableofcontents} |
| 1793 |
% 重定义中文目录标题样式。该部分编入书签,同时在目录中不出现“目录”项。 |
| 1794 |
% \begin{macrocode} |
| 1795 |
\renewcommand\tableofcontents{% |
| 1796 |
\cleardoublepage |
| 1797 |
\pdfbookmark{\contentsname}{toc}% |
| 1798 |
\chapter*{\buct@toc@tocfont\buct@content@title}% |
| 1799 |
\ifbuct@bachelor\relax\else\markboth{\buct@content@title}{\buct@content@title}\fi |
| 1800 |
\@starttoc{toc} |
| 1801 |
} |
| 1802 |
% \end{macrocode} |
| 1803 |
% \end{macro} |
| 1804 |
% |
| 1805 |
% |
| 1806 |
% \begin{macro}{\tableofcontentsEN} |
| 1807 |
% 定义英文目录,条目格式与中文目录相同。 |
| 1808 |
% \begin{macrocode} |
| 1809 |
\ifbuct@bachelor\relax\else |
| 1810 |
\newcommand\tableofcontentsEN{% |
| 1811 |
\cleardoublepage |
| 1812 |
\pdfbookmark{\buct@econtentsname}{toce}% |
| 1813 |
\chapter*{% |
| 1814 |
\em\buct@econtentsname% |
| 1815 |
\ifbuct@bachelor\relax\else\markboth{\buct@econtentsname}{\buct@econtentsname}\fi% |
| 1816 |
}% |
| 1817 |
\@starttoc{toce} |
| 1818 |
} |
| 1819 |
% \end{macrocode} |
| 1820 |
% \end{macro} |
| 1821 |
% \begin{macro}{\buct@addengcontents} |
| 1822 |
% 加入英文目录项。本命令依次接受 3 个参数:目录层级、标题文本、所使用的字体和(或)前缀字符。 |
| 1823 |
% \begin{macrocode} |
| 1824 |
\newcommand\buct@addengcontents[3]{% |
| 1825 |
\addcontentsline{toce}{#1}{\protect\numberline{#3\@nameuse{the#1}}#2} |
| 1826 |
} |
| 1827 |
% \end{macrocode} |
| 1828 |
% \end{macro} |
| 1829 |
% |
| 1830 |
% \begin{macro}{\echapter} |
| 1831 |
% \begin{macro}{\esection} |
| 1832 |
% \begin{macro}{\esubsection} |
| 1833 |
% \begin{macro}{\esubsubsection} |
| 1834 |
% 定义将不同层次标题加入英文目录中的命令。 |
| 1835 |
% \begin{macrocode} |
| 1836 |
\newcommand\echapter[1]{\buct@addengcontents{chapter}{#1}{\buct@toce@chapfont{}\buct@econtent@chapter}} |
| 1837 |
\newcommand\esection[1]{\buct@addengcontents{section}{#1}{}} |
| 1838 |
\newcommand\esubsection[1]{\buct@addengcontents{subsection}{#1}{}} |
| 1839 |
\newcommand\esubsubsection[1]{\buct@addengcontents{subsubsection}{#1}{}} |
| 1840 |
% \end{macrocode} |
| 1841 |
% \end{macro} |
| 1842 |
% \end{macro} |
| 1843 |
% \end{macro} |
| 1844 |
% \end{macro} |
| 1845 |
% |
| 1846 |
% \begin{macro}{\bichapter} |
| 1847 |
% \begin{macro}{\bisection} |
| 1848 |
% \begin{macro}{\bisubsection} |
| 1849 |
% \begin{macro}{\bisubsubsection} |
| 1850 |
% 类似 \cs{bicaption} 可接受两个参数来生成双语图标注一样,定义 \cs{bichapter} 命令从而更加方便一些。 |
| 1851 |
% \emph{以下定义的命令在使用时不可带星号。} |
| 1852 |
% \begin{macrocode} |
| 1853 |
\NewDocumentCommand{\bichapter}{ o m m }{\chapter[#1]{#2}\echapter{#3}} |
| 1854 |
\NewDocumentCommand{\bisection}{ o m m }{\section[#1]{#2}\esection{#3}} |
| 1855 |
\NewDocumentCommand{\bisubsection}{ o m m }{\subsection[#1]{#2}\esubsection{#3}} |
| 1856 |
\NewDocumentCommand{\bisubsubsection}{ o m m }{\subsubsection[#1]{#2}\esubsubsection{#3}} |
| 1857 |
\fi |
| 1858 |
% \end{macrocode} |
| 1859 |
% \end{macro} |
| 1860 |
% \end{macro} |
| 1861 |
% \end{macro} |
| 1862 |
% \end{macro} |
| 1863 |
% |
| 1864 |
% 使用 \pkg{titletoc} 宏包的 \cs{titlecontents} 命令来设置目录项格式。 |
| 1865 |
% 对于硕博论文而言,以下设置会同时影响中文和英文目录。 |
| 1866 |
% \cs{titlecontents} 的语法为: |
| 1867 |
% |
| 1868 |
% \begin{syntax}{titlecontents} |
| 1869 |
% \marg{标题层级}\oarg{左侧间距} |
| 1870 |
% |
| 1871 |
% \marg{上间距} |
| 1872 |
% \marg{标题格式}\marg{引导线与页码}\oarg{下间距} |
| 1873 |
% \end{syntax} |
| 1874 |
% |
| 1875 |
% \begin{macrocode} |
| 1876 |
\ifbuct@bachelor |
| 1877 |
\titlecontents{chapter}[0em] |
| 1878 |
{\buct@toc@chapfont\vspace{3pt}} |
| 1879 |
{\thecontentslabel\quad}{} |
| 1880 |
{\titlerule*[.4em]{$\cdot$}\bfseries\contentspage} |
| 1881 |
\titlecontents{section}[2.5em] |
| 1882 |
{\buct@toc@secfont\vspace{-3pt}} |
| 1883 |
{\thecontentslabel\quad}{} |
| 1884 |
{\titlerule*[.5em]{$\cdot$}\contentspage} |
| 1885 |
\titlecontents{subsection}[4em] |
| 1886 |
{\buct@toc@ssecfont\vspace{-3pt}} |
| 1887 |
{\thecontentslabel\quad}{} |
| 1888 |
{\titlerule*[1em]{$\cdot$}\contentspage} |
| 1889 |
\else |
| 1890 |
\titlecontents{chapter}[0em] |
| 1891 |
{\buct@toc@chapfont\vspace{3pt}} |
| 1892 |
{\thecontentslabel\quad}{} |
| 1893 |
{\titlerule*[.25em]{$\cdot$}\bfseries\contentspage} |
| 1894 |
\titlecontents{section}[2.25em] |
| 1895 |
{\buct@toc@secfont\vspace{-3pt}} |
| 1896 |
{\thecontentslabel\quad}{} |
| 1897 |
{\titlerule*[.5em]{$\cdot$}\contentspage} |
| 1898 |
\titlecontents{subsection}[5em] |
| 1899 |
{\buct@toc@ssecfont\vspace{-3pt}} |
| 1900 |
{\thecontentslabel\quad}{} |
| 1901 |
{\titlerule*[1em]{$\cdot$}\contentspage} |
| 1902 |
\titlecontents{subsubsection}[8.5em] |
| 1903 |
{\buct@toc@sssecfont\vspace{-3pt}} |
| 1904 |
{\thecontentslabel\quad}{} |
| 1905 |
{\titlerule*[1em]{$\cdot$}\contentspage} |
| 1906 |
\fi |
| 1907 |
% \end{macrocode} |
| 1908 |
% |
| 1909 |
% 通过重定义 \pkg{natbib} 宏包的 \cs{bibsection},实现参考文献的编目。 |
| 1910 |
% \begin{macrocode} |
| 1911 |
\renewcommand{\bibsection}{ |
| 1912 |
\chapter*{\bibname} |
| 1913 |
\addcontentsline{toc}{chapter}{\bibname} |
| 1914 |
\ifbuct@bachelor\relax\else |
| 1915 |
\addcontentsline{toce}{chapter}{\buct@toce@chapfont\buct@ebib@title} |
| 1916 |
\markboth{\bibname}{\bibname} |
| 1917 |
\fi |
| 1918 |
} |
| 1919 |
% \end{macrocode} |
| 1920 |
% |
| 1921 |
% 对于本科的设计图纸的两种编目方式:一是加入主目录,另一种是单独生成目录。 |
| 1922 |
% |
| 1923 |
% \begin{macro}{\dcaption} |
| 1924 |
% 定义命令 \cs{dcaption},在 \cs{caption} 的基础上将设计图纸加入主目录。 |
| 1925 |
% 模板设置“设计图纸”的目录级别和小节相同,但却没有小节的编号。 |
| 1926 |
% 为保证在目录中的文字对齐,所以增加其缩进。 |
| 1927 |
% \begin{macrocode} |
| 1928 |
\ifbuct@bachelor |
| 1929 |
\newcommand{\dcaption}[1]{% |
| 1930 |
\caption{#1}\addcontentsline{toc}{subsection}{% |
| 1931 |
\hspace{2.5em}\buct@dfigurename~\thefigure\hspace{1em}{#1}% |
| 1932 |
} |
| 1933 |
} |
| 1934 |
% \end{macrocode} |
| 1935 |
% \end{macro} |
| 1936 |
% |
| 1937 |
% \begin{macro}{\buct@listof} |
| 1938 |
% 另外新定义“设计图纸目录”。如果需要单独编目,可使用 \cs{listofdesignfigures} 命令生成。 |
| 1939 |
% 这里按照 \pkg{float}宏包的 \cs{listof} 命令来定义我们的 \cs{buct@listof} 命令。 |
| 1940 |
% \begin{macrocode} |
| 1941 |
\newcommand{\buct@listof}[2]{% |
| 1942 |
\xpatchcmd{\@dottedtocline}{\hbox{.}}{\hbox{$\cdot$}}{}{} |
| 1943 |
\renewcommand{\@dotsep}{1.7}% |
| 1944 |
\@ifundefined{ext@#1}{\float@error{#1}}{% |
| 1945 |
\@namedef{l@#1}{\@dottedtocline{1}{0em}{2em}} |
| 1946 |
\float@listhead{\buct@toc@tocfont{}#2}% |
| 1947 |
\begingroup\setlength{\parskip}{\z@}% |
| 1948 |
\buct@toc@dsgfigfont\@starttoc{\@nameuse{ext@#1}}% |
| 1949 |
\endgroup% |
| 1950 |
} |
| 1951 |
} |
| 1952 |
% \end{macrocode} |
| 1953 |
% \end{macro} |
| 1954 |
% \begin{macro}{\listofdesignfigures} |
| 1955 |
% “设计图纸目录”跟主目录相似。 |
| 1956 |
% \begin{macrocode} |
| 1957 |
\newcommand{\listofdesignfigures}{% |
| 1958 |
\cleardoublepage% |
| 1959 |
\buct@pdfmark{\buct@dfigure@content@title}{dfigure}% |
| 1960 |
\buct@listof{dfigure}{\buct@dfigure@content@title} |
| 1961 |
} |
| 1962 |
\fi |
| 1963 |
% \end{macrocode} |
| 1964 |
% \end{macro} |
| 1965 |
% |
| 1966 |
% \subsubsection{前言} |
| 1967 |
% \begin{environment}{foreword} |
| 1968 |
% 仅本科。定义环境 \env{foreword} 插入前言部分。 |
| 1969 |
% \begin{macrocode} |
| 1970 |
\newenvironment{foreword}{% |
| 1971 |
\cleardoublepage |
| 1972 |
\buct@pdfmark{\buct@foreword@title}{foreword} |
| 1973 |
\chapter*{\buct@foreword@title} |
| 1974 |
}{} |
| 1975 |
% \end{macrocode} |
| 1976 |
% \end{environment} |
| 1977 |
% |
| 1978 |
% \subsection{主文档部分} |
| 1979 |
% \subsubsection{行距设置} |
| 1980 |
% 计算公式: |
| 1981 |
% \[ |
| 1982 |
% 1.2 \times \meta{LineSpread} \times \meta{FontSize} = \meta{BaselineSkip} |
| 1983 |
% \] |
| 1984 |
% 其中,正文的 \meta{FontSize} 为小四号,而 \meta{BaselineSkip} 取 |
| 1985 |
% 本科行距 22 磅、硕博 20 磅,故可求得 \meta{LineSpread}。 |
| 1986 |
% \begin{macrocode} |
| 1987 |
\ifbuct@bachelor |
| 1988 |
\linespread{1.5221} |
| 1989 |
\else |
| 1990 |
\linespread{1.3837} |
| 1991 |
\fi |
| 1992 |
% \end{macrocode} |
| 1993 |
% |
| 1994 |
% \subsubsection{标题格式} |
| 1995 |
% \begin{macrocode} |
| 1996 |
\ifbuct@bachelor |
| 1997 |
\ctexset{% |
| 1998 |
chapter = {% |
| 1999 |
name = {第,章}, |
| 2000 |
number = \arabic{chapter}, |
| 2001 |
format = \buct@chapfont, |
| 2002 |
beforeskip = 12 pt, |
| 2003 |
afterskip = 32 pt, |
| 2004 |
fixskip = true, |
| 2005 |
aftername = \qquad, |
| 2006 |
}, |
| 2007 |
section = {% |
| 2008 |
name = {第,节}, |
| 2009 |
format = \buct@secfont, |
| 2010 |
aftername = \quad, |
| 2011 |
beforeskip = 29 pt, |
| 2012 |
afterskip = 32 pt, |
| 2013 |
fixskip = true, |
| 2014 |
}, |
| 2015 |
subsection = {% |
| 2016 |
format = \buct@ssecfont, |
| 2017 |
aftername = \quad, |
| 2018 |
beforeskip = 3 pt, |
| 2019 |
afterskip = 3 pt, |
| 2020 |
}, |
| 2021 |
subsubsection = {% |
| 2022 |
name = {(,)}, |
| 2023 |
format = \buct@sssecfont, |
| 2024 |
number = \arabic{subsubsection}, |
| 2025 |
beforeskip = 3 pt, |
| 2026 |
afterskip = 3 pt, |
| 2027 |
aftername = \hspace{0.5em}, |
| 2028 |
indent = 0.5em, |
| 2029 |
}, |
| 2030 |
} |
| 2031 |
\else |
| 2032 |
\ctexset{% |
| 2033 |
chapter = {% |
| 2034 |
name = {第,章}, |
| 2035 |
number = \chinese{chapter}, |
| 2036 |
format = \buct@chapfont, |
| 2037 |
beforeskip = 12 pt, |
| 2038 |
afterskip = 46 pt, |
| 2039 |
fixskip = true, |
| 2040 |
aftername = \qquad, |
| 2041 |
}, |
| 2042 |
section = {% |
| 2043 |
format = \buct@secfont, |
| 2044 |
aftername = \quad, |
| 2045 |
beforeskip = 26 pt, |
| 2046 |
afterskip = 28 pt, |
| 2047 |
fixskip = true, |
| 2048 |
}, |
| 2049 |
subsection = {% |
| 2050 |
format = \buct@ssecfont, |
| 2051 |
beforeskip = 3 pt, |
| 2052 |
afterskip = 3 pt, |
| 2053 |
}, |
| 2054 |
subsubsection = {% |
| 2055 |
format = \buct@sssecfont, |
| 2056 |
beforeskip = 3 pt, |
| 2057 |
afterskip = 3 pt, |
| 2058 |
}, |
| 2059 |
} |
| 2060 |
\fi |
| 2061 |
% \end{macrocode} |
| 2062 |
% |
| 2063 |
% \subsubsection{列表环境} |
| 2064 |
% \begin{environment}{enumerate} |
| 2065 |
% \begin{environment}{itemize} |
| 2066 |
% \begin{environment}{description} |
| 2067 |
% 使用 \pkg{enumitem} 宏包分别设置编号列表、无编号列表、描述列表环境的间距。 |
| 2068 |
% 这里将三种列表默认增加的垂直间距全部清除,即各行间距与正文行间距相同,以符合中文习惯。 |
| 2069 |
% |
| 2070 |
% 如果一级列表环境作为标题(对应《本科生规范》中的五级标题,即带圈序号), |
| 2071 |
% 则不设置加粗、不增加段间距。由于列表间的垂直间距减小了,所以 |
| 2072 |
% 相应地稍微调小列表序号和文字之间的距离,使得文字更紧凑。 |
| 2073 |
% |
| 2074 |
% 另外,一级编号列表环境的序号改为 \pkg{pifont} 宏包提供的带圈数字, |
| 2075 |
% 二级及之后的列表、无编号列表保持默认设置。 |
| 2076 |
% \begin{macrocode} |
| 2077 |
\setlist{% |
| 2078 |
leftmargin = 2em, |
| 2079 |
nosep, |
| 2080 |
} |
| 2081 |
\setlist[enumerate,1]{% |
| 2082 |
label = \lower 0.1em\hbox{\large{\ding{\numexpr191+\value{enumi}}}}, |
| 2083 |
labelsep = 2pt, |
| 2084 |
} |
| 2085 |
\setlist[enumerate,2]{% |
| 2086 |
labelsep = 6pt, |
| 2087 |
} |
| 2088 |
\setlist[description]{% |
| 2089 |
labelsep = 1em, |
| 2090 |
} |
| 2091 |
% \end{macrocode} |
| 2092 |
% \end{environment} |
| 2093 |
% \end{environment} |
| 2094 |
% \end{environment} |
| 2095 |
% |
| 2096 |
% \subsubsection{数学类} |
| 2097 |
% 使用 \pkg{unicode-math} 宏包配置数学标准字形、粗体字形,并设置偏微分算子为直立体。 |
| 2098 |
% \begin{macrocode} |
| 2099 |
\unimathsetup{ |
| 2100 |
math-style = ISO, |
| 2101 |
bold-style = ISO, |
| 2102 |
partial = upright, |
| 2103 |
} |
| 2104 |
% \end{macrocode} |
| 2105 |
% |
| 2106 |
% 修改 \cs{mathbb},使得字母显示正确。 |
| 2107 |
% \begin{macrocode} |
| 2108 |
\let\mathbb\relax |
| 2109 |
\DeclareMathAlphabet{\mathbb}{U}{msb}{m}{n}% |
| 2110 |
% \end{macrocode} |
| 2111 |
% |
| 2112 |
% 使用 \pkg{amsthm} 宏包来进行定理类环境的格式控制,并预设如下定理类环境。编号跨章重置计数。 |
| 2113 |
% \begin{macrocode} |
| 2114 |
\newtheoremstyle{buctthm}% name |
| 2115 |
{3pt}% Space above |
| 2116 |
{3pt}% Space below |
| 2117 |
{}% Body font |
| 2118 |
{}% Indent amount |
| 2119 |
{\bfseries}% Theorem head font |
| 2120 |
{:}% Punctuation after theorem head |
| 2121 |
{.5em}% Space after theorem head |
| 2122 |
{}% Theorem head spec |
| 2123 |
\theoremstyle{buctthm} |
| 2124 |
\newtheorem{axiom}{公理}[chapter] |
| 2125 |
\newtheorem{theorem}{定理}[chapter] |
| 2126 |
\newtheorem{corollary}{推论}[chapter] |
| 2127 |
\newtheorem{remark}{注解}[chapter] |
| 2128 |
\newtheorem{assumption}{假设}[chapter] |
| 2129 |
\newtheorem{definition}{定义}[chapter] |
| 2130 |
\newtheorem{property}{性质}[chapter] |
| 2131 |
\newtheorem{proposition}{命题}[chapter] |
| 2132 |
\newtheorem{lemma}{引理}[chapter] |
| 2133 |
% \end{macrocode} |
| 2134 |
% |
| 2135 |
% \begin{environment}{proof} |
| 2136 |
% 按照 \pkg{amsthm} 宏包说明重定义 \env{proof}: |
| 2137 |
% \begin{macrocode} |
| 2138 |
\renewenvironment{proof}[1][\proofname]{\par |
| 2139 |
\pushQED{\qed}% |
| 2140 |
\normalfont\topsep6\p@\@plus6\p@\relax |
| 2141 |
\trivlist |
| 2142 |
\item\relax |
| 2143 |
{#1\@addpunct{.}}\hspace\labelsep\ignorespaces |
| 2144 |
}{\popQED\endtrivlist\@endpefalse} |
| 2145 |
% \end{macrocode} |
| 2146 |
% \end{environment} |
| 2147 |
% |
| 2148 |
% \subsubsection{部分宏包汉化设置} |
| 2149 |
% 对 \pkg{siunitx} 宏包汉化处理,并将连接符改为“$\sim$”,符合中文习惯。 |
| 2150 |
% \begin{macrocode} |
| 2151 |
\sisetup{% |
| 2152 |
list-final-separator = { 和 }, |
| 2153 |
list-pair-separator = { 和 }, |
| 2154 |
range-phrase = {\,$\sim$\,}, |
| 2155 |
} |
| 2156 |
% \end{macrocode} |
| 2157 |
% |
| 2158 |
% \subsubsection{浮动体} |
| 2159 |
% \begin{environment}{dfigure} |
| 2160 |
% 本科: |
| 2161 |
% 使用 \pkg{float} 宏包新定义浮动体环境 \env{dfigure},用于排版设计图纸。 |
| 2162 |
% 设计图纸与普通插图的区别在于: |
| 2163 |
% \begin{itemize} |
| 2164 |
% \item 标签不同,如:“设计图纸 1-1” 与 “图 1-1”; |
| 2165 |
% \item 编号相互独立; |
| 2166 |
% \item 仅设计图纸编入目录,且此目录独立于主目录。 |
| 2167 |
% \end{itemize} |
| 2168 |
% |
| 2169 |
% \begin{macrocode} |
| 2170 |
\ifbuct@bachelor |
| 2171 |
\newfloat{dfigure}{htbp}{lodf}[chapter] |
| 2172 |
\floatname{dfigure}{\buct@dfigurename} |
| 2173 |
% \end{macrocode} |
| 2174 |
% \end{environment} |
| 2175 |
% |
| 2176 |
% 硕博: |
| 2177 |
% 使用 \pkg{bicaption} 宏包设置双语标题,其中第二语言为英语。 |
| 2178 |
% |
| 2179 |
% \begin{macrocode} |
| 2180 |
\else |
| 2181 |
\DeclareCaptionOption{english}[]{ |
| 2182 |
\renewcommand\figurename{\buct@bifigure@name} |
| 2183 |
\renewcommand\tablename{\buct@bitable@name} |
| 2184 |
} |
| 2185 |
\captionsetup[bi-second]{english} |
| 2186 |
\fi |
| 2187 |
% \end{macrocode} |
| 2188 |
% |
| 2189 |
% 《研究生规范》中规定表格单元格里的字号为五号,而未规定行距,这里保留前设的伸缩因子。 |
| 2190 |
% 其中 \cs{AtBeginEnvironment} 是 \pkg{etoolbox} 宏包中的命令,可给环境打补丁。 |
| 2191 |
% |
| 2192 |
% \begin{macrocode} |
| 2193 |
\ifbuct@bachelor\relax\else |
| 2194 |
\AtBeginEnvironment{tabular}{\buct@floatfont} |
| 2195 |
\AtBeginEnvironment{tabularx}{\buct@floatfont} |
| 2196 |
\fi |
| 2197 |
% \end{macrocode} |
| 2198 |
% |
| 2199 |
% 对于 \pkg{longtable} 宏包的设置则稍有不同: |
| 2200 |
% 在“符号说明表”中我们嵌套了 \env{longtable} 环境,但其中的字号仍应为小四号。 |
| 2201 |
% 因此这里需要保留原先的定义。 |
| 2202 |
% \begin{macrocode} |
| 2203 |
\let\oldlongtable\longtable |
| 2204 |
\let\endoldlongtable\endlongtable |
| 2205 |
\def\longtable{\zihao{5}\oldlongtable} |
| 2206 |
\AtEndEnvironment{longtable}{\normalsize} |
| 2207 |
% \end{macrocode} |
| 2208 |
% |
| 2209 |
% 设置插图的文件路径。 |
| 2210 |
% \begin{macrocode} |
| 2211 |
\graphicspath{{figure/}} |
| 2212 |
% \end{macrocode} |
| 2213 |
% |
| 2214 |
% 使用 \pkg{caption} 宏包重定义图、表等浮动体的标签样式。 |
| 2215 |
% |
| 2216 |
% \begin{macrocode} |
| 2217 |
\renewcommand{\captionfont}{\buct@float@captionfont} |
| 2218 |
\renewcommand{\captionlabelfont}{\buct@float@labelfont} |
| 2219 |
\DeclareCaptionLabelSeparator{capspace}{\quad} |
| 2220 |
\captionsetup{labelsep=capspace} |
| 2221 |
\captionsetup[table]{% |
| 2222 |
position = top, |
| 2223 |
aboveskip = 0.5em, |
| 2224 |
belowskip = 0.5em, |
| 2225 |
} |
| 2226 |
\captionsetup[figure]{% |
| 2227 |
position = bottom, |
| 2228 |
aboveskip = 0.5em, |
| 2229 |
belowskip = -0.5em, |
| 2230 |
} |
| 2231 |
\captionsetup[dfigure]{% |
| 2232 |
position = bottom, |
| 2233 |
aboveskip = 1em, |
| 2234 |
belowskip = 1em, |
| 2235 |
} |
| 2236 |
% \end{macrocode} |
| 2237 |
% |
| 2238 |
% 更改图、表、公式和代码的编号格式。其中重定义 \cs{thelstlisting} 须在 \cs{AtBeginDocument} 中。 |
| 2239 |
% \begin{macrocode} |
| 2240 |
\AtBeginDocument{% |
| 2241 |
\renewcommand{\thesubtable}{(\alph{subtable})} |
| 2242 |
\renewcommand{\thetable}{\thechapter-\arabic{table}} |
| 2243 |
\renewcommand{\thesubfigure}{(\alph{subfigure})} |
| 2244 |
\renewcommand{\thefigure}{\thechapter-\arabic{figure}} |
| 2245 |
\ifbuct@bachelor |
| 2246 |
\renewcommand{\thedfigure}{\thechapter-\arabic{dfigure}} |
| 2247 |
\renewcommand{\theequation}{\thechapter-\arabic{equation}} |
| 2248 |
\else |
| 2249 |
\renewcommand{\eqref}[1]{\equationname~\textup{(\ref{#1})}} |
| 2250 |
\renewcommand{\theequation}{\thechapter-\arabic{equation}} |
| 2251 |
\fi |
| 2252 |
\renewcommand{\thelstlisting}{\thechapter-\arabic{lstlisting}} |
| 2253 |
} |
| 2254 |
% \end{macrocode} |
| 2255 |
% |
| 2256 |
% \subsubsection{文献引用} |
| 2257 |
% \begin{macro}{\inlinecite} |
| 2258 |
% 这里定义的 \cs{inlinecite} 适用于行间引用,依赖于 \pkg{natbib} 宏包里的命令。 |
| 2259 |
% \begin{macrocode} |
| 2260 |
\DeclareRobustCommand\inlinecite{\@inlinecite} |
| 2261 |
\def\@inlinecite#1{\begingroup\let\@cite\NAT@citenum\citep{#1}\endgroup} |
| 2262 |
% \end{macrocode} |
| 2263 |
% \end{macro} |
| 2264 |
% |
| 2265 |
% \subsubsection{数学公式} |
| 2266 |
% 硕博公式需要加入点线连接公式与编号。这里通过重定义 \file{source2e} |
| 2267 |
% 中的 \env{equation} 环境,故仅在 \env{equation} 环境中生效。 |
| 2268 |
% \begin{macrocode} |
| 2269 |
\ifbuct@bachelor\relax\else |
| 2270 |
\xpatchcmd{\dotfill}{.44em}{.3em}{}{} |
| 2271 |
\renewenvironment{equation}{ |
| 2272 |
\@beginparpenalty\predisplaypenalty |
| 2273 |
\@endparpenalty\postdisplaypenalty |
| 2274 |
\refstepcounter{equation}% |
| 2275 |
\trivlist \item[]\leavevmode |
| 2276 |
\hb@xt@\linewidth\bgroup $\m@th% $ |
| 2277 |
\displaystyle\hfill} |
| 2278 |
{$\;\dotfill % $ |
| 2279 |
\displaywidth\linewidth\hbox{\@eqnnum}% |
| 2280 |
\egroup |
| 2281 |
\endtrivlist} |
| 2282 |
\fi |
| 2283 |
% \end{macrocode} |
| 2284 |
% |
| 2285 |
% \subsubsection{代码块} |
| 2286 |
% \begin{macrocode} |
| 2287 |
\lstset{% |
| 2288 |
aboveskip = 0.5em, |
| 2289 |
belowskip = 0.5em, |
| 2290 |
tabsize = 4, |
| 2291 |
basicstyle = \buct@codefont, |
| 2292 |
frame = single, |
| 2293 |
basewidth = {.5em,.4em}, |
| 2294 |
xleftmargin = 1.5em, |
| 2295 |
xrightmargin = 1.5em, |
| 2296 |
commentstyle = \buct@codecomfont, |
| 2297 |
keywordstyle = \buct@codekeyfont, |
| 2298 |
backgroundcolor = \color{lightgray!10}, |
| 2299 |
showtabs = false, |
| 2300 |
showspaces = false, |
| 2301 |
showstringspaces = false, |
| 2302 |
captionpos = t, |
| 2303 |
breaklines = true, |
| 2304 |
numbers = left, |
| 2305 |
numberstyle = \tiny, |
| 2306 |
numbersep = 6 pt, |
| 2307 |
stepnumber = 1, |
| 2308 |
extendedchars = false, |
| 2309 |
escapechar = {@*}, |
| 2310 |
} |
| 2311 |
% \end{macrocode} |
| 2312 |
% |
| 2313 |
% \subsection{后置部分} |
| 2314 |
% 与前言不同的是,这几部分模板默认编入目录。 |
| 2315 |
% |
| 2316 |
% \begin{environment}{conclusion} |
| 2317 |
% 结论,仅本科。 |
| 2318 |
% \begin{macrocode} |
| 2319 |
\ifbuct@bachelor |
| 2320 |
\newenvironment{conclusion}{% |
| 2321 |
\chapter*{\buct@concl@title} |
| 2322 |
\addcontentsline{toc}{chapter}{\buct@concl@title} |
| 2323 |
}{} |
| 2324 |
% \end{macrocode} |
| 2325 |
% \end{environment} |
| 2326 |
% |
| 2327 |
% \begin{environment}{translation} |
| 2328 |
% 翻译,仅本科。 |
| 2329 |
% \begin{macrocode} |
| 2330 |
\newenvironment{translation}{% |
| 2331 |
\chapter*{\buct@trans@title} |
| 2332 |
\addcontentsline{toc}{chapter}{\buct@trans@title} |
| 2333 |
}{} |
| 2334 |
% \end{macrocode} |
| 2335 |
% \end{environment} |
| 2336 |
% |
| 2337 |
% \begin{macro}{\appendix} |
| 2338 |
% 英文目录中,修改“附录”的英文前缀字符,仅硕博。 |
| 2339 |
% \begin{macrocode} |
| 2340 |
\else |
| 2341 |
\g@addto@macro\appendix{\def\buct@econtent@chapter{Appendix~}} |
| 2342 |
% \end{macrocode} |
| 2343 |
% \end{macro} |
| 2344 |
% |
| 2345 |
% \begin{environment}{achievements} |
| 2346 |
% 研究成果及发表的学术论文,仅硕博。 |
| 2347 |
% \begin{macrocode} |
| 2348 |
\newenvironment{achievements}{% |
| 2349 |
\cleardoublepage |
| 2350 |
\chapter*{\buct@achi@title} |
| 2351 |
\markboth{\buct@achi@title}{\buct@achi@title} |
| 2352 |
\addcontentsline{toc}{chapter}{\buct@achi@title} |
| 2353 |
\addcontentsline{toce}{chapter}{\buct@toce@chapfont\buct@eachi@title} |
| 2354 |
}{} |
| 2355 |
% \end{macrocode} |
| 2356 |
% \end{environment} |
| 2357 |
% |
| 2358 |
% \begin{environment}{resume} |
| 2359 |
% 作者及导师简介,仅硕博。 |
| 2360 |
% \begin{macrocode} |
| 2361 |
\newenvironment{resume}{% |
| 2362 |
\cleardoublepage |
| 2363 |
\chapter*{\buct@resu@title} |
| 2364 |
\markboth{\buct@resu@title}{\buct@resu@title} |
| 2365 |
\addcontentsline{toc}{chapter}{\buct@resu@title} |
| 2366 |
\addcontentsline{toce}{chapter}{\buct@toce@chapfont\buct@eresu@title} |
| 2367 |
}{} |
| 2368 |
\fi |
| 2369 |
% \end{macrocode} |
| 2370 |
% \end{environment} |
| 2371 |
% |
| 2372 |
% \begin{environment}{acknowledgement} |
| 2373 |
% 致谢。 |
| 2374 |
% \begin{macrocode} |
| 2375 |
\newenvironment{acknowledgement}{% |
| 2376 |
\chapter*{\buct@ack@title} |
| 2377 |
\ifbuct@bachelor\relax\else |
| 2378 |
\markboth{\buct@ack@title}{\buct@ack@title} |
| 2379 |
\addcontentsline{toce}{chapter}{\buct@toce@chapfont\buct@eack@title} |
| 2380 |
\fi |
| 2381 |
\addcontentsline{toc}{chapter}{\buct@ack@title} |
| 2382 |
}{} |
| 2383 |
% \end{macrocode} |
| 2384 |
% \end{environment} |
| 2385 |
% |
| 2386 |
% \subsubsection{符号说明表} |
| 2387 |
% \begin{environment}{denotation} |
| 2388 |
% 关于章节编目同前。这里使用一个可跨页的无线长表格。 |
| 2389 |
% 为了防止符号较长,这里定义的环境需要一个可选参数用于在必要时控制第二列列宽。 |
| 2390 |
% \begin{macrocode} |
| 2391 |
\NewDocumentEnvironment{denotation}{ O{10cm} +b }{% |
| 2392 |
\cleardoublepage |
| 2393 |
\chapter*{\buct@deno@title}% |
| 2394 |
\ifbuct@bachelor |
| 2395 |
\addcontentsline{toc}{chapter}{\buct@deno@title} |
| 2396 |
\else |
| 2397 |
\buct@pdfmark{\buct@deno@title}{denotation} |
| 2398 |
\markboth{\buct@deno@title}{\buct@deno@title} |
| 2399 |
\fi |
| 2400 |
\vspace{-1em}% |
| 2401 |
\begin{oldlongtable}[c]{l@{\extracolsep{3em}}p{#1}} |
| 2402 |
#2 |
| 2403 |
}{\end{oldlongtable}} |
| 2404 |
% \end{macrocode} |
| 2405 |
% \end{environment} |
| 2406 |
% |
| 2407 |
% \subsubsection{参考文献} |
| 2408 |
% 一方面,主文件中调用了符合要求的参考文献格式控制文件,使参考文献章节的格式规范化; |
| 2409 |
% 另一方面,调用 \pkg{gbt7714}(和 \pkg{natbib} )宏包时已经填入相关选项, |
| 2410 |
% 在文章中引用文献的格式也符合了要求。这里将本科模板罗列的各条参考文献之间距离稍微调小一些,而将硕博模板字号设为 5 号,行距 20 磅。 |
| 2411 |
% \begin{macrocode} |
| 2412 |
\ifbuct@bachelor |
| 2413 |
\setlength{\bibsep}{3pt} |
| 2414 |
\else |
| 2415 |
\setlength{\bibsep}{0pt} |
| 2416 |
\renewcommand\bibfont{\linespread{1.5814}\zihao{5}} |
| 2417 |
\fi |
| 2418 |
% \end{macrocode} |
| 2419 |
% |
| 2420 |
% \subsection{其他设置} |
| 2421 |
% \subsubsection{强调} |
| 2422 |
% \begin{macro}{\emph} |
| 2423 |
% 中西文统一使用粗体。 |
| 2424 |
% \begin{macrocode} |
| 2425 |
\renewcommand{\emph}[1]{\textbf{#1}} |
| 2426 |
% \end{macrocode} |
| 2427 |
% \end{macro} |
| 2428 |
% \begin{macro}{\em} |
| 2429 |
% \begin{macrocode} |
| 2430 |
\renewcommand{\em}{\bfsong} |
| 2431 |
% \end{macrocode} |
| 2432 |
% \end{macro} |
| 2433 |
% \subsubsection{脚注} |
| 2434 |
% \begin{macro}{\footnote} |
| 2435 |
% 使用带圈圈的脚注。尽管 \LaTeX\ 自带了 \cs{textcircled} 命令,但是效果并不如意。 |
| 2436 |
% 为了和一级列表环境的序号区分,这里使用 \pkg{tikz} 宏包来绘制一个围着阿拉伯数字脚注的圈。 |
| 2437 |
% 为了突出标号以便更加明确、清楚地显示,对编号设置了悬挂缩进。 |
| 2438 |
% \begin{macrocode} |
| 2439 |
\newcommand{\buct@ftntcircled}[1]{% |
| 2440 |
\lower 0.15em\hbox{% |
| 2441 |
\tikz\draw (0pt, 0pt) circle (0.4 em) node {#1};% |
| 2442 |
}% |
| 2443 |
} |
| 2444 |
\renewcommand\thefootnote{\protect\buct@ftntcircled{\tiny\arabic{footnote}}} |
| 2445 |
\renewcommand{\@makefntext}[1]{% |
| 2446 |
\setlength{\leftskip}{1.5\ccwd}% |
| 2447 |
\noindent\llap{\lower 1pt \hbox{\@thefnmark}\,}#1% |
| 2448 |
} |
| 2449 |
% \end{macrocode} |
| 2450 |
% \end{macro} |
| 2451 |
% |
| 2452 |
% \subsubsection{超链接} |
| 2453 |
% 实现PDF书签和交叉引用的跳转。 |
| 2454 |
% \begin{macrocode} |
| 2455 |
\urlstyle{same} |
| 2456 |
\hypersetup{% |
| 2457 |
colorlinks = true, |
| 2458 |
bookmarksnumbered = true, |
| 2459 |
pdfhighlight = /N, |
| 2460 |
breaklinks = true, |
| 2461 |
citecolor = cyan, |
| 2462 |
} |
| 2463 |
% \end{macrocode} |
| 2464 |
% |
| 2465 |
% 根据模板文档类是否打开 \opt{submit} 选项,设置是否关闭超链接颜色。 |
| 2466 |
% \begin{macrocode} |
| 2467 |
\ifbuct@submit |
| 2468 |
\hypersetup{hidelinks} |
| 2469 |
\fi |
| 2470 |
% \end{macrocode} |
| 2471 |
% |
| 2472 |
% 根据模板文档类是否打开 \opt{debugger} 选项,设置是否标注行号。 |
| 2473 |
% \begin{macrocode} |
| 2474 |
\ifbuct@debugger |
| 2475 |
\AtBeginDocument{\linenumbers} |
| 2476 |
\fi |
| 2477 |
%</class> |
| 2478 |
% \end{macrocode} |
| 2479 |
% |
| 2480 |
% |
| 2481 |
% \iffalse |
| 2482 |
% \begin{macrocode} |
| 2483 |
%<*manual> |
| 2484 |
\ProvidesPackage{manual}[2023/05/20 document style for BUCTthesis] |
| 2485 |
\RequirePackage{hypdoc} |
| 2486 |
\PassOptionsToPackage{AutoFakeSlant}{xeCJK} |
| 2487 |
\RequirePackage[UTF8, heading, fontset = none, linespread = 1.2,]{ctex} |
| 2488 |
\RequirePackage[toc]{multitoc} |
| 2489 |
\RequirePackage{ |
| 2490 |
xeCJKfntef, |
| 2491 |
listings, |
| 2492 |
float, |
| 2493 |
tabularx, |
| 2494 |
booktabs, |
| 2495 |
siunitx, |
| 2496 |
unicode-math, |
| 2497 |
xcolor, |
| 2498 |
caption, |
| 2499 |
enumitem, |
| 2500 |
metalogo, |
| 2501 |
} |
| 2502 |
\RequirePackage[bottom,perpage]{footmisc} |
| 2503 |
\RequirePackage[ |
| 2504 |
a4paper, |
| 2505 |
hmargin={40mm,20mm},vmargin={25mm,15mm},footskip=7mm, |
| 2506 |
]{geometry} |
| 2507 |
|
| 2508 |
\ctexset{ |
| 2509 |
fontset, |
| 2510 |
abstractname = 简介, |
| 2511 |
indexname = 代码索引, |
| 2512 |
section = { |
| 2513 |
format = \Large\bfseries\raggedright, |
| 2514 |
name = {第,节}, |
| 2515 |
}, |
| 2516 |
} |
| 2517 |
\xeCJKDeclareCharClass{CJK}{"2460->"2469} |
| 2518 |
\setcounter{secnumdepth}{4} |
| 2519 |
\setcounter{tocdepth}{3} |
| 2520 |
\setmainfont{TeX Gyre Pagella} |
| 2521 |
\setmonofont[ |
| 2522 |
HyphenChar = None , |
| 2523 |
UprightFont=* Light, BoldFont=* Bold, |
| 2524 |
SlantedFont=* Light Oblique]{CMU Typewriter Text} |
| 2525 |
\captionsetup{strut=off, labelsep=quad, labelfont+=bf} |
| 2526 |
\lstdefinestyle{base}{ |
| 2527 |
aboveskip = 0 pt, |
| 2528 |
belowskip = 0 pt, |
| 2529 |
tabsize = 2, |
| 2530 |
basicstyle = \ttfamily\small, |
| 2531 |
columns = flexible, |
| 2532 |
frame = single, |
| 2533 |
framerule = 1 pt, |
| 2534 |
xleftmargin = 1 em, |
| 2535 |
aboveskip = 6 pt, |
| 2536 |
belowskip = 6 pt, |
| 2537 |
commentstyle = \slshape\color{gray}, |
| 2538 |
keywordstyle = \color{blue}, |
| 2539 |
backgroundcolor = \color{lightgray!10}, |
| 2540 |
showtabs = false, |
| 2541 |
showspaces = false, |
| 2542 |
showstringspaces = true, |
| 2543 |
captionpos = t, |
| 2544 |
breaklines = true, |
| 2545 |
numbers = none, |
| 2546 |
extendedchars = false, |
| 2547 |
escapechar = {@*}, |
| 2548 |
gobble = 4, |
| 2549 |
} |
| 2550 |
\lstdefinestyle{latex}{% |
| 2551 |
style=base, |
| 2552 |
rulecolor=\color{cyan}, |
| 2553 |
language=[LaTeX]TeX, |
| 2554 |
} |
| 2555 |
\lstdefinestyle{shell}{% |
| 2556 |
style=base, |
| 2557 |
rulecolor=\color{violet!65}, |
| 2558 |
language=bash, |
| 2559 |
} |
| 2560 |
\lstnewenvironment{latex}{\lstset{style=latex}}{} |
| 2561 |
\lstnewenvironment{shell}{\lstset{style=shell}}{} |
| 2562 |
\let\oldCodelineNo\theCodelineNo |
| 2563 |
\def\theCodelineNo{\textcolor{gray}{\oldCodelineNo}} |
| 2564 |
\setlist{ |
| 2565 |
leftmargin = 0em, |
| 2566 |
nosep |
| 2567 |
} |
| 2568 |
\setlist[description]{% |
| 2569 |
itemindent = 2.5em, |
| 2570 |
} |
| 2571 |
\setlist[enumerate]{% |
| 2572 |
itemindent = 2em, |
| 2573 |
} |
| 2574 |
\newcommand\Arg[1]{ \texttt{\char`\{} \meta{#1} \texttt{\char`\}} } |
| 2575 |
\providecommand\marg[1]{ \Arg{#1} } |
| 2576 |
\providecommand\oarg[1]{ \texttt[ \meta{#1} \texttt] } |
| 2577 |
\providecommand\parg[1]{ \texttt( \meta{#1} \texttt) } |
| 2578 |
\DeclareRobustCommand{\opt}{\texttt} |
| 2579 |
\DeclareRobustCommand{\env}{\texttt} |
| 2580 |
\DeclareRobustCommand{\pkg}{\textsf} |
| 2581 |
\DeclareRobustCommand{\cls}{\textsf} |
| 2582 |
\DeclareRobustCommand{\file}{\textsf} |
| 2583 |
\NewDocElement[macrolike = false , |
| 2584 |
idxtype = opt. , |
| 2585 |
idxgroup = options , |
| 2586 |
printtype = \textit{opt.} |
| 2587 |
]{Opt}{option} |
| 2588 |
\NewDocumentEnvironment{syntax}{ m }{% |
| 2589 |
\linespread{1}\xeCJKsetup{PunctStyle=plain}\xeCJKsetup{CJKecglue}% |
| 2590 |
\cs{#1}\ignorespaces% |
| 2591 |
}{\vspace{0.5em}} |
| 2592 |
\def\glossaryname{版本历史} |
| 2593 |
\GlossaryPrologue{\section{\glossaryname}} |
| 2594 |
\IndexPrologue{% |
| 2595 |
\clearpage\section{\indexname} |
| 2596 |
\textit{意大利体的数字表示描述对应索引项的页码; |
| 2597 |
带下划线的数字表示定义对应索引项的代码行号; |
| 2598 |
罗马字体的数字表示使用对应索引项的代码行号。} |
| 2599 |
} |
| 2600 |
\def\IndexLayout{% |
| 2601 |
\newgeometry{hmargin=15mm,vmargin={25mm,15mm},footskip=7mm}% |
| 2602 |
\setlength\IndexMin{.5\textheight}% |
| 2603 |
\ctexset{section/numbering=false}% |
| 2604 |
} |
| 2605 |
\hypersetup{ |
| 2606 |
pdftitle = {BUCTthesis:北京化工大学学位论文模板}, |
| 2607 |
pdfauthor = {The-CCSN}, |
| 2608 |
} |
| 2609 |
\CodelineIndex |
| 2610 |
\EnableCrossrefs |
| 2611 |
\RecordChanges |
| 2612 |
\endinput |
| 2613 |
%</manual> |
| 2614 |
% \end{macrocode} |
| 2615 |
% \fi |
| 2616 |
% |
| 2617 |
% |
| 2618 |
% \Finale |
| 2619 |
\endinput |