diff --git a/README-bithesis.md b/README-bithesis.md index 9407b05b..c76d91bf 100644 --- a/README-bithesis.md +++ b/README-bithesis.md @@ -10,11 +10,12 @@ The current maintainer of this project is [Feng Kaiyu](https://github.com/fky201 [![Latexmk](https://badgen.net/badge/compiler/latexmk/blue)](https://mg.readthedocs.io/latexmk.html) [![License](https://badgen.net/github/license/BITNP/BIThesis?color=008080&labelColor=2b2b2b)](./LICENSE) -BIThesis is an unofficial LaTeX template set for your **undergraduate, master or doctoral thesis** as well as other academic writing here at BIT. +BIThesis is an unofficial LaTeX template set for your +**undergraduate, master or doctoral thesis** as well as other academic writing here at BIT. This project is supported by the _[Dept. of Undergraduate Academic Affairs, BIT](https://jwc.bit.edu.cn/)_ and the _[School of Computer Science and Technology, BIT](https://cs.bit.edu.cn/)_. See [Acknowledgements - Official Sponsors](https://bithesis.bitnp.net/Guide/5-Acknowledgements/Acknowledgements.html#%E5%AE%98%E6%96%B9%E8%B5%9E%E5%8A%A9-official-sponsors). -At present, `bithesis` only supports XETEX and LuaTEX engines. `bithesis` only allows `UTF-8` encoding. +At present, `bithesis` only supports XeTeX and LuaTeX engines. `bithesis` only allows `UTF-8` encoding. ## How Do I Use `bithesis`? diff --git a/README.md b/README.md index 5adad8b0..9c80654d 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ BIThesis 是针对北京理工大学本科生毕业毕业论文、研究生学 ## 开发者指南 -> 以下内容供宏集的开发者使用,如果你是普通用户的话,请参考我们的[在线文档](https://bithesis.bitnp.net) 。 +**以下内容供宏集的开发者使用,如果你是普通用户的话,请参考我们的[在线文档](https://bithesis.bitnp.net) 。** ### 生成 `.cls` 文件 diff --git a/bithesis.dtx b/bithesis.dtx index 34aa0232..485796f5 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -31,7 +31,7 @@ % %<*driver> \ProvidesFile{bithesis.dtx}[2022/05/09 2.1.1 BIT Thesis Templates] -\documentclass[a4paper,full]{l3doc} +\documentclass[letterpaper]{l3doc} \usepackage{dtx-style} \EnableCrossrefs @@ -165,7 +165,6 @@ % % 如果你想深入了解 \BIThesisLaTeX 提供的接口的各种选项,那么请继续阅读。 % -% \section{使用说明} % \subsection{\BIThesis 宏包的组成} % 为了适应用户的不同需求,并符合 CTeX 宏集的设计习惯,我们将 \BIThesisMacroPackage 的主要功能设计安排在两个中文文档类当中,具体的组成见 \ref{tab:classes}。 % \begin{table}[H] @@ -180,6 +179,8 @@ % & \cls{bitbeamer.cls} & 对应 ctexbeamer.cls ,提供了北理工的 Beamer 模板样式。 \\ \cmidrule(l){2-3} % \end{tabular} % \end{table} +% +% \section{安装} % \subsection{\BIThesis 宏包的安装和更新} % 最常见的 \TeX 发行版(\hologo{TeX} Live 和 \hologo{MiKTeX})已收录\BIThesisMacroPackage 及其依赖的宏包和宏集。 % @@ -187,10 +188,18 @@ % \begin{shell}[morekeywords={tlmgr,install}] % tlmgr install fduthesis % \end{shell} -% \subsection{使用 \BIThesis 文档类} -% 推荐使用\BIThesisRelease (开箱即用)。\BIThesisRelease 提供了多种最常用的模板,你可以在\href{https://github.com/BITNP/BIThesis/releases}{主项目的 Releases}中找到它们。 +% +% 更新可以通过图形界面进行,或者通过命令行: +% \begin{shell}[morekeywords={tlmgr,install}] +% tlmgr update fduthesis +% \end{shell} +% +% \section{\cls{bithesis} 使用与配置} +% +% 推荐使用\BIThesisRelease (开箱即用)。 % -% \subsection{\cls{bithesis} 使用与配置} +% \BIThesisRelease 提供了多种最常用的模板,你可以在 +% \href{https://github.com/BITNP/BIThesis/releases}{主项目的 Releases}中找到它们。 % % 使用此文档类的模板有: % \begin{itemize} @@ -200,7 +209,7 @@ % \item \BIThesisTemplates{GT} % \end{itemize} % -% \subsubsection{最小用例} +% \subsection{最小用例} % % \begin{latex} % \documentclass[type=bachelor]{bithesis} @@ -213,14 +222,18 @@ % \begin{document} % \end{document} % \end{latex} -% \subsubsection{模板选项} -% % 所谓“模板选项”,指需要在引入文档类的时候指定的选项: +% +% \subsection{模板选项} +% +% 所谓“模板选项”,指需要在引入文档类的时候指定的选项: +% % \begin{latex}[deletetexcs={\documentclass},morekeywords={\documentclass}] % \documentclass(*\oarg{模板选项}*){bithesis} % \end{latex} +% % \begin{function}{type} % \begin{bitsyntax}[emph={[1]type}] -% type = (*<(bachelor)|bachelor_translation|bachelor_english|master|docter>*) +% type = (*<(bachelor)|\mbox{bachelor_translation}|\mbox{bachelor_english}|master|docter>*) % \end{bitsyntax} % 选择论文类型,它们分别对应: % \begin{itemize} @@ -236,7 +249,8 @@ % \begin{bitsyntax}[emph={[1]blindPeerReview}] % blindPeerReview = (*<(false)|true>*) % \end{bitsyntax} -% 此选项用于输出符合盲审要求的论文。所有可能暴露个人信息的页面都将隐藏,比如封面、信息页、原创性声明、个人简介、致谢等等。 +% 此选项用于输出符合盲审要求的论文。所有可能暴露个人信息的页面都将隐藏, +% 比如封面、信息页、原创性声明、个人简介、致谢等等。 % \end{function} % % \begin{function}{twoside} @@ -245,7 +259,7 @@ % \end{bitsyntax} % \end{function} % -% \subsubsection{参数设置} +% \subsection{参数设置} % % \begin{function}{\BITSetup} % \begin{bitsyntax}[emph={[1]BITSetup}] @@ -264,6 +278,7 @@ % 表中,“=”左右的空格不影响设置;但需注意,参数列表中不可以出现空行。 % 与模板选项相同,布尔型的参数可以省略 〈选项〉 = true 中的“= true”。 % 另有一些选项包含子选项,如 cover 和 info 等。它们可以按如下两种等价方式来设定: +% % \begin{latex} % \BITSetup{ % cover = { @@ -275,6 +290,7 @@ % } % } % \end{latex} +% % 或者 % % \begin{latex}[morekeywords={\BITSetup},emph={[1]cover,date,info,title,author}] @@ -285,36 +301,41 @@ % } % \end{latex} % -% \textbf{请注意:以下选项根据模板的不同,可能会有不同的默认值。有些模板可能不会使用某些选项。使用与否以及使用方式是根据学校的论文撰写要求实现的。} +% \textbf{请注意:以下选项根据模板的不同,可能会有不同的默认值。 +% 有些模板可能不会使用某些选项。使用与否以及使用方式是根据学校的论文撰写要求实现的。} % -% \paragraph{封面选项} +% \subsubsection{封面选项} % % \begin{function}{cover} % \begin{bitsyntax}[emph={[1]cover}] % cover = (*\marg{键值列表}*) % cover/(*\meta{key}*) = (*\meta{value}*) % \end{bitsyntax} +% % 该选项包含许多子项目,用于设置论文格式。具体内容见下。 % \end{function} % % \begin{function}{cover/date} % \begin{bitsyntax}[emph={[1]date}] -% cover/date = (*\marg{任意字符串}*) +% date = (*\marg{任意字符串}*) % \end{bitsyntax} +% % 覆盖封面的日期。 % \end{function} % % \begin{function}{cover/headerImage} % \begin{bitsyntax}[emph={[1]headerImage}] -% cover/headerImage = (*\marg{图片路径}*) +% headerImage = (*\marg{图片路径}*) % \end{bitsyntax} +% % 设置封面顶部的“北京理工大学”字样图片。 % \end{function} % % \begin{function}{cover/xiheiFont} % \begin{bitsyntax}[emph={[1]xiheiFont}] -% cover/xiheiFont = (*\marg{字体路径}*) +% xiheiFont = (*\marg{字体路径}*) % \end{bitsyntax} +% % 配置此选项以在部分模板封面中使用“华文细黑”,保证与 Word 模板中的字体一致。 % % 在 Windows 和 MacOS 中,该字体已经安装;在 Linux 中一般需要用户自行安装。 @@ -322,22 +343,445 @@ % % \begin{function}{cover/dilimiter} % \begin{bitsyntax}[emph={[1]dilimiter}] -% cover/dilimiter = (*\marg{任意字符串}*) +% dilimiter = (*\marg{任意字符串}*) % \end{bitsyntax} +% % \textit{此选项一般不需要用户自行修改。} +% % 设置封面信息中标签和值的分隔符。一般为全角或者半角的冒号。 % \end{function} % % \begin{function}{cover/autoWidth} % \begin{bitsyntax}[emph={[1]autoWidth}] -% cover/autoWidth = (*<(true)|false>*) +% autoWidth = (*<(true)|false>*) % \end{bitsyntax} +% % \textit{此选项一般不需要用户自行修改。} +% % 自动计算封面中下划线的长度。 +% +% 如果关闭了该选项,则建议配合\kvopt{cover/labelMaxWidth}{\meta{长度}}\\ +% 和\kvopt{cover/valueMaxWidth}{\meta{长度}}使用来控制下划线的长度。 +% \end{function} +% +% \begin{function}{cover/labelMaxWidth} +% \begin{bitsyntax}[emph={[1]labelMaxWidth}] +% labelMaxWidth = (*\marg{任意长度}*) +% \end{bitsyntax} +% +% 此选项仅当\kvopt{cover/autoWidth}{false}时生效。 +% +% 设置封面信息中标签的占位长度。 +% \end{function} +% +% \begin{function}{cover/valueMaxWidth} +% \begin{bitsyntax}[emph={[1]valueMaxWidth}] +% valueMaxWidth = (**) +% \end{bitsyntax} +% +% \textit{此选项一般不需要用户自行修改。} +% +% 设置封面信息中值的占位长度。\textbf{同时也会影响下划线的长度。} +% \end{function} +% +% \begin{function}{cover/labelAlign} +% \begin{bitsyntax}[emph={[1]labelAlign}] +% labelAlign = (*\marg{任意长度}*) +% \end{bitsyntax} +% +% \textit{此选项一般不需要用户自行修改。} +% +% 设置封面信息中值的对其方式(居中,左对齐、右对齐)。 +% \end{function} +% +% \begin{function}{cover/valueAlign} +% \begin{bitsyntax}[emph={[1]valueAlign}] +% valueAlign = (*\marg{任意长度}*) +% \end{bitsyntax} +% +% 此选项仅当\kvopt{cover/autoWidth}{false}时生效。 +% +% 设置封面信息中标签的对其方式(居中,左对齐、右对齐)。 +% \end{function} +% +% \begin{function}{cover/underlineThickness} +% \begin{bitsyntax}[emph={[1]underlineThickness}] +% underlineThickness = (*\marg{任意长度}*) +% \end{bitsyntax} +% +% 设置封面信息中下划线的厚度。 +% \end{function} +% +% \begin{function}{cover/underlineOffset} +% \begin{bitsyntax}[emph={[1]underlineOffset}] +% underlineOffset = (*(-10pt)|\marg{任意长度}*) +% \end{bitsyntax} +% +% 设置封面信息中下划线的偏移量。 +% \end{function} +% +% \subsubsection{论文基本信息} +% +% \begin{function}{info} +% \begin{bitsyntax}[emph={[1]info}] +% info = (*\marg{键值列表}*) +% info/(*\meta{key}*) = (*\meta{value}*) +% \end{bitsyntax} +% +% 该选项包含许多子项目,用于录入论文信息。具体内容见下。 +% 一般以「En」结尾的项目表示对应的英文字段。 +% \end{function} +% +% \begin{function}{info/title,info/titleEn} +% \begin{bitsyntax}[emph={[1]title,titleEn}] +% title = (*\marg{字符串}*) +% titleEn = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 论文标题。 +% \end{function} +% +% \begin{function}{info/school,info/schoolEn} +% \begin{bitsyntax}[emph={[1]school,schoolEn}] +% school = (*\marg{字符串}*) +% schoolEn = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 学院名称。 +% \end{function} +% +% \begin{function}{info/major,info/majorEn} +% \begin{bitsyntax}[emph={[1]majorEn}] +% major = (*\marg{字符串}*) +% majorEn = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 专业名称。 +% \end{function} +% +% \begin{function}{info/author,info/authorEn} +% \begin{bitsyntax}[emph={[1]author,authorEn}] +% author = (*\marg{字符串}*) +% authorEn = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 作者姓名。 +% \end{function} +% +% \begin{function}{info/studentId} +% \begin{bitsyntax}[emph={[1]studentId}] +% studentId = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 学号。 +% \end{function} +% +% \begin{function}{info/supervisor,info/supervisorEn} +% \begin{bitsyntax}[emph={[1]supervisor,supervisorEn}] +% supervisor = (*\marg{字符串}*) +% supervisorEn = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 指导教师。 +% \end{function} +% +% \begin{function}{info/externalSupervisor} +% \begin{bitsyntax}[emph={[1]externalSupervisor}] +% externalSupervisor = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 校外指导教师。 +% \end{function} +% +% \begin{function}{info/keywords,info/keywordsEn} +% \begin{bitsyntax}[emph={[1]keywords,keywordsEn}] +% keywords = (*\marg{字符串;以全角分号分割}*) +% keywordsEn = (*\marg{字符串;以分号分割}*) +% \end{bitsyntax} +% +% 摘要关键词。 +% \end{function} +% +% \begin{function}{info/translationTitle} +% \begin{bitsyntax}[emph={[1]translationTitle}] +% translationTitle = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 文献翻译中,翻译后的论文名称。 +% \end{function} +% +% \begin{function}{info/translationOriginTitleEn} +% \begin{bitsyntax}[emph={[1]translationOriginTitleEn}] +% translationOriginTitleEn = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 文献翻译中,翻译前的论文名称。 +% \end{function} +% +% \begin{function}{info/classification} +% \begin{bitsyntax}[emph={[1]classification}] +% classification = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 中国分类号。 +% \end{function} +% +% \begin{function}{info/UDC} +% \begin{bitsyntax}[emph={[1]UDC}] +% UDC = (*\marg{字符串}*) +% \end{bitsyntax} +% +% UDC分类号。 +% \end{function} +% +% \begin{function}{info/chairman,info/chairmanEn} +% \begin{bitsyntax}[emph={[1]chairman,chairmanEn}] +% chairman = (*\marg{字符串}*) +% chairmanEn = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 答辩委员会主席。 +% \end{function} +% +% \begin{function}{info/degree,info/degreeEn} +% \begin{bitsyntax}[emph={[1]degree,degreeEn}] +% degree = (*\marg{字符串}*) +% degreeEn = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 申请学位。 +% \end{function} +% +% \begin{function}{info/institute,info/instituteEn} +% \begin{bitsyntax}[emph={[1]institute,instituteEn}] +% institute = (*(北京理工大学)|\marg{字符串}*) +% instituteEn = (*(Beijing~Institute~of~Technology)|\marg{字符串}*) +% \end{bitsyntax} +% +% 学位授予单位。 +% \end{function} +% +% \begin{function}{info/defenseDate,info/defenseDateEn} +% \begin{bitsyntax}[emph={[1]defenseDate,defenseDateEn}] +% defenseDate = (*\marg{字符串}*) +% defenseDateEn = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 答辩日期。 +% \end{function} +% +% \begin{function}{info/classifiedLevel} +% \begin{bitsyntax}[emph={[1]classifiedLevel}] +% classifiedLevel = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 密级。 +% \end{function} +% +% \subsubsection{样式信息} +% +% \begin{function}{style} +% \begin{bitsyntax}[emph={[1]style}] +% style = (*\marg{键值列表}*) +% style/(*\meta{key}*) = (*\meta{value}*) +% \end{bitsyntax} +% +% 该选项包含许多子项目,用于调整样式。具体内容见下。 +% \end{function} +% +% \begin{function}{style/head} +% \begin{bitsyntax}[emph={[1]head}] +% head = (*\marg{字符串}*) +% \end{bitsyntax} +% +% \textit{此选项一般不需要用户自行修改。} +% +% 页眉文字。 +% \end{function} +% +% \subsubsection{样式信息} +% +% \begin{function}{misc} +% \begin{bitsyntax}[emph={[1]misc}] +% misc = (*\marg{键值列表}*) +% misc/(*\meta{key}*) = (*\meta{value}*) +% \end{bitsyntax} +% +% 该选项包含许多子项目,用于调整其他选项。具体内容见下。 +% \end{function} +% +% \begin{function}{misc/arialFont} +% \begin{bitsyntax}[emph={[1]arialFont}] +% arialFont = (*\marg{字符串}*) +% \end{bitsyntax} +% +% \textit{此选项一般不需要用户自行修改。} +% +% 本科生毕业设计模板(全英文专业)需要设置 Arial 字体。 +% (Windows 和 MacOS 自带,Linux 需要用户自行安装) +% \end{function} +% +% \section{正文编写} +% +% 请注意,请在\env{document} 之内使用以下命令 。 +% +% \subsection{封面及基本信息} +% +% \begin{function}{\MakeCover} +% +%%%% TODO: +% \textit{封面内容会根据模板参数中\meta{type}的值而变化。} +% +% 绘制封面。 +% \end{function} +% +% \begin{function}{\MakePaperBack} +% +% 绘制书脊。 +% \end{function} +% +% \begin{function}{\MakeTitle} +% +% 绘制中英文信息页。 +% \end{function} +% +% \begin{function}{\MakeOriginality} +% +% 绘制中英文信息页。 +% \end{function} +% +% \subsection{前置部分} +% +% \begin{function}{\frontmatter} +% +% 声明前置部分开始。 +% +% 此时页码会使用罗马数字进行计数。 +% \end{function} +% +% \begin{function}{abstract} +% \begin{bitsyntax}[emph={[1]abstract}] +% \begin{abstract} +% \meta{中文摘要} +% \end{abstract} +% \end{bitsyntax} +% \end{function} +% +% \begin{function}{abstractEn} +% \begin{bitsyntax}[emph={[1]abstractEn}] +% \begin{abstractEn} +% \meta{英文摘要} +% \end{abstractEn} +% \end{bitsyntax} +% +% 摘要。 +% +% 摘要的最后会显示关键词,关键词通过 \cs{BITSetup} 录入。 +% \end{function} +% +% \begin{function}{\MakeTOC,\listoffigures,\listoftables} +% +% 绘制目录、插图目录与表格目录。 +% \end{function} +% +% \subsection{正文部分} +% +% \begin{function}{\mainmatter} +% +% 声明正文部分开始。 +% +% 此时页码会使用阿拉伯数字进行计数。 +% \end{function} +% +% \subsection{后置部分} +% +% \begin{function}{\mainmatter} +% +% 声明后置部分开始。 +% +% \end{function} +% +% \begin{function}{conclusion} +% \begin{bitsyntax}[emph={[1]conclusion}] +% \begin{conclusion} +% \meta{结论} +% \end{conclusion} +% \end{bitsyntax} +% \end{function} +% +% \begin{function}{bibprint} +% \begin{bitsyntax}[emph={[1]bibprint}] +% \begin{bibprint} +% \printbibliography[heading=none] +% \end{bibprint} +% \end{bitsyntax} +% +% 打印参考文献。 +% +% 在使用\BIThesisTemplates{GT}时需要注意,由于研究生学位论文也要求使用国标形式输出「攻读学位期间发表论文与研究成果清单」,因此 bithesis 同样使用 bibtex 管理其文献。而由于 biblatex 的排序是全局的,因此需要使用 \meta{category} 功能来分割出两个不同的类别。 +% +% 因此,请使用下列语句输出参考文献: +% \begin{latex} +% \begin{bibprint} +% \printbibliography[heading=none,notcategory=mypub,resetnumbers=true] +% \end{bibprint} +% \end{latex} +% \end{function} +% +% \begin{function}{appendices} +% \begin{bitsyntax}[emph={[1]appendices}] +% \begin{appendices} +% \section{附录A 题目} +% \meta{附录A 内容} +% \section{附录B 题目} +% \meta{附录B 内容} +% \end{appendices} +% \end{bitsyntax} +% +% 附录。 +% \end{function} +% +% \begin{function}{publications} +% \begin{bitsyntax}[emph={[1]publications}] +% \begin{publications} +% \nocite{\meta{引用内容的key}} +% \addtocategory{mypub}{\meta{引用内容的key}} +% \printbibliography[heading=none,category=mypub,resetnumbers=true] +% \end{publications} +% \end{bitsyntax} +% +% 攻读学位期间发表论文与研究成果清单。 +% \end{function} +% +% \begin{function}{acknowledgements} +% \begin{bitsyntax}[emph={[1]acknowledgements}] +% \begin{acknowledgements} +% \meta{致谢内容} +% \end{acknowledgements} +% \end{bitsyntax} +% +% 致谢。 +% \end{function} +% +% \begin{function}{resume} +% \begin{bitsyntax}[emph={[1]resume}] +% \begin{resume} +% \meta{个人简介内容} +% \end{resume} +% \end{bitsyntax} +% +% 个人简介。 % \end{function} % % \section{致谢} +% \begin{itemize} +% \item 感谢贡献者对 BIThesis 的无私奉献。 +% \item 感谢学校及相关老师对 BIThesis 的支持。 +% \item 感谢清华大学和复旦大学的学位论文模板项目,他们为后来者提供了前进的方向。 +% \end{itemize} +% % \section{软件许可证} +% % \begin{itemize} % \item 北京理工大学校徽校名图片的版权归北京理工大学所有。 % \item \BIThesisLaTeX 宏包以及相关文档类使用 \LPPL 授权。 @@ -354,20 +798,6 @@ %<@@=bithesis> % \end{macrocode} % -% \begin{macro}{\YOURMACRO} -% Put explanation of |\YOURMACRO|’s implementation here. -% \begin{macrocode} -\newcommand{\YOURMACRO}{} -% \end{macrocode} -% \end{macro} -% -% \begin{environment}{YOURENV} -% Put explanation of |YOURENV|’s implementation here. -% \begin{macrocode} -\newenvironment{YOURENV}{}{} -% \end{macrocode} -% \end{environment} -% % \begin{macrocode} % % \end{macrocode} @@ -642,7 +1072,7 @@ instituteEn .tl_set:N = \l_@@_value_institute_en_tl, instituteEn .initial:n = {\c_@@_label_university_en_tl}, defenseDateEn .tl_set:N = \l_@@_value_defense_date_en_tl, - classified_level .tl_set:N = \l_@@_value_classified_level_tl, + classifiedLevel .tl_set:N = \l_@@_value_classified_level_tl, } \keys_define:nn { bithesis / misc } @@ -1750,7 +2180,7 @@ \newpage } - \NewDocumentEnvironment {abstract*} {o} + \NewDocumentEnvironment {abstractEn} {o} { \IfValueT {#1} { \keys_set:nn { bit / abstract_en } {#1} @@ -2013,23 +2443,22 @@ \LoadClass[zihao=-4]{ctexart} \RequirePackage[a4paper,left=3cm,right=2.4cm,top=2.6cm,bottom=2.38cm,includeheadfoot]{geometry} -\RequirePackage{fancyhdr}% -\RequirePackage{setspace}% -\RequirePackage{caption}% -\RequirePackage{booktabs}% +\RequirePackage{fancyhdr} +\RequirePackage{setspace} +\RequirePackage{caption} +\RequirePackage{booktabs} +\RequirePackage{pdfpages} -% TODO: to be deleted -% \RequirePackage{fontspec}% -\keys_define:nn { bitproposal } +\keys_define:nn { bitreport } { - option .meta:nn = {bitproposal / option } {#1}, - cover .meta:nn = { bitproposal / cover } {#1}, - info .meta:nn = { bitproposal / info } {#1}, - misc .meta:nn = { bitproposal / misc } {#1} + option .meta:nn = {bitreport / option } {#1}, + cover .meta:nn = { bitreport / cover } {#1}, + info .meta:nn = { bitreport / info } {#1}, + misc .meta:nn = { bitreport / misc } {#1} } -\keys_define:nn { bitproposal / cover } +\keys_define:nn { bitreport / cover } { imagePath .tl_set:N = \l_bit_coverimagepath_tl, date .tl_set:N = \l_@@_cover_date_tl, @@ -2049,7 +2478,7 @@ underlineOffset .initial:n = { -10pt }, } -\keys_define:nn { bitproposal / info } +\keys_define:nn { bitreport / info } { title .tl_set:N = \l_@@_value_title_tl, school .tl_set:N = \l_@@_value_school_tl, @@ -2061,7 +2490,7 @@ studentId .tl_set:N = \l_@@_value_student_id_tl, } -\keys_define:nn { bitproposal / option } +\keys_define:nn { bitreport / option } { type .choice:, type .value_required:n = true, @@ -2074,12 +2503,12 @@ } -\keys_define:nn { bitproposal / misc } +\keys_define:nn { bitreport / misc } { reviewTable .tl_set:N = \l_bit_reviewtable_tl, } -\ProcessKeysOptions { bitproposal / option } +\ProcessKeysOptions { bitreport / option } \cs_generate_variant:Nn \tl_if_empty:nTF {e} \cs_generate_variant:Nn \seq_set_split:Nnn {Nne} @@ -2164,7 +2593,7 @@ } \DeclareDocumentCommand \BITSetup { m } - { \keys_set:nn { bitproposal } { #1 }} + { \keys_set:nn { bitreport } { #1 }} \DeclareDocumentCommand \MakeCover {} { \group_begin: @@ -2312,7 +2741,7 @@ % 正文 22 磅的行距,段前段后间距为 0 % \setlength{\parskip}{0em} -% \renewcommand{\baselinestretch}{1.53} +\cs_set:Npn \baselinestretch {1.53} % 正文首行悬挂 1.02cm % \setlength{\parindent}{1.02cm} % \end{macrocode} @@ -3187,8 +3616,7 @@ footskip=0.7cm% 页脚 1.8cm % showspaces=false, % flexiblecolumns=true, % breaklines=true, % 对过长的代码自动换行 - breakautoindent=true,% - breakindent=4em, % + postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space}, aboveskip=1em, % 代码块边框 %% added by http://bbs.ctex.org/viewthread.php?tid=53451 fontadjust, @@ -3669,7 +4097,7 @@ footskip=0.7cm% 页脚 1.8cm % \RequirePackage[UTF8,scheme=chinese,heading,sub3section]{ctex} \RequirePackage[ top=2.5cm, bottom=2.5cm, - left=4cm, right=2cm, + left=5cm, right=2cm, headsep=3mm]{geometry} \RequirePackage{graphicx} \RequirePackage{multirow} @@ -3718,6 +4146,7 @@ footskip=0.7cm% 页脚 1.8cm % \newcommand{\LPPL}{{\href{https://www.latex-project.org/lppl/lppl-1-3c.txt}{\LaTeX{} Project Public License (1.3.c)}}} \newcommand{\versionold}{v2.0 BirthdayCake} \newcommand{\version}{v3 Summer Time} + \ExplSyntaxOn \AtBeginEnvironment { bitsyntax } { @@ -3743,12 +4172,18 @@ footskip=0.7cm% 页脚 1.8cm % } } +% 允许换行的细间距。 +\def\breakablethinspace{\hskip 0.16667em\relax} + + +\DeclareDocumentCommand\kvopt{mm} + {\texttt{#1\breakablethinspace=\breakablethinspace#2}} + \ExplSyntaxOff \ctexset{ today=big, abstractname=简介, - section / numbering = false, } \ctexset{section={ diff --git a/contributing-zh.md b/contributing-zh.md index bbc6163d..52a09bae 100644 --- a/contributing-zh.md +++ b/contributing-zh.md @@ -47,7 +47,7 @@ 5. 创建一个 PR,并添加相应的说明。 6. 在 PR 被合并之前请保持关注,以便进行修改。 -寻找更细致的流程请参考 +更细致的流程请参考 _[Github Help](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests)_。 [QQ chat group invitation]: https://jq.qq.com/?_wv=1027&k=KYDrmS5z diff --git a/templates/graduate-thesis/bithesis.cls b/templates/graduate-thesis/bithesis.cls new file mode 100644 index 00000000..e2155b36 --- /dev/null +++ b/templates/graduate-thesis/bithesis.cls @@ -0,0 +1,1589 @@ +%% +%% This is file `bithesis.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% bithesis.dtx (with options: `cls,thesis') +%% +%% Copyright (C) 2022 +%% Association of Bit Network Pioneer and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2020/11/27 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Feng Kaiyu. +%% ------------------------------------------------------------------------------ +%% +\RequirePackage{expl3,l3keys2e} +\ProvidesExplClass{bithesis} +{2022-06-10}{3.0.0}{BIT Thesis Templates} +%%%% TODO: + + +\int_new:N \g__bithesis_thesis_type_int +\int_new:N \g__bithesis_head_zihao_int +\bool_new:N \g__bithesis_twoside_bool +\bool_new:N \g__bithesis_thesis_type_english_bool +\bool_new:N \g__bithesis_blind_mode_bool +\tl_new:N \g__bithesis_label_devide_char_tl + +\seq_new:N \l__bithesis_right_seq +\seq_new:N \l__bithesis_left_seq + + +\cs_generate_variant:Nn \tl_if_empty:nTF {e} +\cs_generate_variant:Nn \seq_set_split:Nnn {Nne} + +\cs_new:Npn \__bithesis_same_page: { + \let\clearpage\relax + \let\cleardoublepage\relax +} + +\cs_new:Npn \__bithesis_if_graduate:TF #1#2 { + \int_compare:nNnTF {3} < {\g__bithesis_thesis_type_int} + {#1} + {#2} + } + +\cs_new:Npn \__bithesis_if_thesis_int_type:nTF #1#2#3 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {#1} {#2} {#3}} +\cs_new:Npn \__bithesis_if_thesis_int_type:nT #1#2 {\__bithesis_if_thesis_int_type:nTF {#1} {#2} {}} + +\cs_new:Npn \__bithesis_if_thesis_english:TF #1#2 {\bool_if:nTF {\g__bithesis_thesis_type_english_bool} {#1} {#2}} +\cs_new:Npn \__bithesis_if_thesis_english:T #1 {\__bithesis_if_thesis_english:TF {#1}{}} + +\cs_new:Npn \__bithesis_if_bachelor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} < {4} {#1} {#2}} +\cs_new:Npn \__bithesis_if_bachelor_thesis:T #1 {\__bithesis_if_bachelor_thesis:TF {#1} {}} +\cs_new:Npn \__bithesis_if_master_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {4} {#1} {#2}} +\cs_new:Npn \__bithesis_if_doctor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {5} {#1} {#2}} + +\clist_const:Nn \c__bithesis_thesis_type_clist + { bachelor, bachelor_translation, bachelor_english, master, docter} + +\cs_new_protected:Npn \__bithesis_define_label:nn #1#2 + { \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} } + +\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnn #1#2#3 + { + \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} + } + +\cs_new_protected:Npn \__bithesis_define_label:nnn #1#2#3 + { + \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} + \tl_const:cn { c__bithesis_label_ #1 _en_tl } {#3} + } + +\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnnn #1#2#3#4 + { + \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} + \tl_const:cn { c__bithesis_ #1 _label_ #2 _en_tl } {#4} + } + +\clist_map_inline:nn + { + {code} {代码}, + {udc} {UDC分类号:}, + {classification} {中国分类号:}, + {classified_level} {密级}, + {type} {种类}, + } + {\__bithesis_define_label:nn #1} + +\clist_map_inline:nn + { + {title} {本科生毕业设计(论文)}, + {originality} {原创性声明}, + {originality_clause} {本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,本文不包含任何其他个人或集体已经发表或撰写过的研究成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par~特此申明。}, + {authorization} {关于使用授权的声明}, + {authorization_clause} {本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,其中包括:\circled{1}~学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;\circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);\circled{3}~学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}~学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);\circled{5}~学校可以公布本毕业设计(论文)的全部或部分内容。}, + {originality_author_signature} {本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, + {originality_supervisor_signature} {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, + } {\__bithesis_define_label_by_thesis_type:nnn {bachelor} #1} + +\clist_map_inline:nn + { + {title} {}, + {originality} {原创性声明~Statement~of~Originality}, + {originality_clause} { + 本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,本文不包含任何其他个人或集体已经发表或撰写过的研究成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。特此申明。\par + \arialfamily I,\dunderline[-1pt]{1pt}{\makebox[18mm]{}},~solemnly~ + declare:~the~submitted~graduation~design~(thesis),~is~the~research~achievement~completed~independently~by~myself~ + under~the~guidance~of~the~supervisor.~This~article~does~not~contain~ + any~research~published~or~written~by~any~other~individual~or~group,~ + except~as~already~referenced~in~this~paper.~Individuals~and~groups~ + that~have~made~important~contributions~to~the~study~of~this~paper~ + are~clearly~indicated~and~cited~in~the~paper.\par + }, + {authorization} {关于使用授权的声明~State~of~Use~Authorization}, + {authorization_clause} { + 本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,其中包括:\circled{1}学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;\circled{2}学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);\circled{3}学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);\circled{5}学校可以公布本毕业设计(论文)的全部或部分内容。\par + I~fully~understand~the~regulations~on~the~storage,~use~of~graduation~design~(thesis)~in~Beijing~Institute~of~Technology.~Beijing~Institute~of~Technology~has~the~right~to~(1)~keep,~and~to~the~relevant~departments~to~send~the~original~or~copy~of~this~graduation~design~(thesis);~(2)~copy~and~preserve~this~graduation~design~(thesis)~by~photocopying,~miniature~or~other~means~of~reproduction;~(3)~allow~this~graduation~design~(thesis)~to~be~read~or~borrowed;~(4)~for~the~purpose~of~academic~exchange,~copy,~give~and~exchange~this~graduation~design~(thesis);~(5)~publish~all~or~part~of~the~contents~of~this~graduation~design~(thesis).~ + }, + } {\__bithesis_define_label_by_thesis_type:nnn {bachelor_english} #1} + +\cs_new:Npn \smallgap: { + \hspace{0.45ex} +} + +\cs_new:Npn \label_space: { + \__bithesis_if_bachelor_thesis:T { + \quad + } +} + +\clist_map_inline:nn + { + {originality} {研究成果声明}, + {originality_clause} {本人郑重声明:所提交的学位论文是我本人在指导教师的指导下进行的研究工作获得的研究成果。尽我所知,文中除特别标注和致谢的地方外,学位论文中不包含其他人已经发表或撰写过的研究成果,也不包含为获得北京理工大学或其它教育机构的学位或证书所使用过的材料。与我一同工作的合作者对此研究工作所做的任何贡献均已在学位论文中作了明确的说明并表示了谢意。\par~特此申明。}, + {authorization} {关于学位论文使用权的说明}, + {authorization_clause} {本人完全了解北京理工大学有关保管、使用学位论文的规定,其中包括:\circled{1}~学校有权保管、并向有关部门送交学位论文的原件与复印件;\circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存学位论文;\circled{3}~学校可允许学位论文被查阅或借阅;\circled{4}~学校可以学术交流为目的,复制赠送和交换学位论文;\circled{5}~学校可以公布学位论文的全部或部分内容(保密学位论文在解密后遵守此规定)。}, + {originality_author_signature} {签\qquad 名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, + {originality_supervisor_signature} {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, + } {\__bithesis_define_label_by_thesis_type:nnn {graduate} #1} + +\clist_map_inline:nn + { + {author} {作\quad 者\quad 姓\quad 名} {Candiate~Name}, + {school} {学\quad 院\quad 名\quad 称} {School~or~Department}, + {supervisor} {指\quad 导\quad 教\quad 师} {Faculty~Mentor}, + {chairman} {答辩委员会主席} {Chair,~Thesis~Committee}, + {degree} {申\smallgap: 请\smallgap: 学\smallgap: 位\smallgap: 级\smallgap: 别} {Degree~Applied}, + {major} {学\quad 科\quad 专\quad 业} {Major}, + {institute} {学\smallgap: 位\smallgap: 授\smallgap: 予\smallgap: 单\smallgap: 位} {Degree~by}, + {defense_date} {论\smallgap: 文\smallgap: 答\smallgap: 辩\smallgap: 日\smallgap: 期} {The~Date~of~Defence}, + } {\__bithesis_define_label_by_thesis_type:nnnn {graduate} #1} + +\clist_map_inline:nn + { + {school} {学\qquad 院} {School}, + {major} {专\qquad 业} {Degree}, + {author} {学生姓名} {Author}, + {student_id} {学\qquad 号} {Student~ID}, + {supervisor} {指导教师} {Supervisor}, + {co_supervisor} {校外指导教师} {Co-Supervisor}, + {keywords} {关键词:} {Key~Words:~}, + {toc} {目\label_space: 录} {Table~of~Contents}, + {abstract} {摘\label_space: 要} {Abstract}, + {conclusion} {结\label_space: 论} {Conclusions}, + {appendix} {附\label_space: 录} {Appendices}, + {ack} {致\label_space: 谢} {Acknowledgement}, + {figure} {插\quad 图} {Illustrations}, + {table} {表\quad 格} {Tables}, + {appendix_prefix} {附录} {Appendix}, + {reference} {参考文献} {References}, + {university} {北京理工大学} {Beijing~Institute~of~Technology}, + {publications} {攻读学位期间发表论文与研究成果清单} {Publications~During~Studies}, + % TODO: Not so sure about the translation. + {resume} {作者简介} {}, + {symbols} {主要符号对照表} {}, + } + {\__bithesis_define_label:nnn #1} + +\clist_const:Nn \c__bithesis_bachelor_thesis_header_clist + {北京理工大学本科生毕业设计(论文), 北京理工大学本科生毕业设计(论文)外文翻译, Beijing~Institute~of~Technology~Bachelor's~Thesis } +\clist_const:Nn \c__bithesis_bachelor_thesis_cover_title_clist + { + 本科生毕业设计(论文), + 本科生毕业设计(论文)外文翻译, + Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis, + } + +\keys_define:nn { bithesis } +{ + info .meta:nn = { bithesis / info } {#1}, + misc .meta:nn = { bithesis / misc } {#1}, + cover .meta:nn = { bithesis / cover } {#1}, + style .meta:nn = { bithesis / style } {#1}, + option .meta:nn = { bithesis / option } {#1}, +} + +\keys_define:nn { bithesis / option } +{ + type .choice:, + type .value_required:n = true, + type .choices:Vn = + \c__bithesis_thesis_type_clist + { + \int_set_eq:NN \g__bithesis_thesis_type_int \l_keys_choice_int + \int_case:nn {\l_keys_choice_int} { + % 本科全英文也是英文模板。 + {3} {\bool_set_true:N \g__bithesis_thesis_type_english_bool} + } + }, + type .initial:n = bachelor, + twoside .bool_gset:N = \g__bithesis_twoside_bool, + blindPeerReview .bool_gset:N = \g__bithesis_blind_mode_bool, +} + +\keys_define:nn { bithesis / cover } + { + date .tl_set:N = \l__bithesis_cover_date_tl, + headerImage .tl_set:N = \l_bit_coverheaderimage_tl, + xiheiFont .tl_set:N = \l__bithesis_cover_xihei_font_path_tl, + xiheiFont .default:n = {STXihei}, + %% cover entry + dilimiter .tl_set:N = \l__bithesis_cover_dilimiter_tl, + labelAlign .tl_set:N = \l__bithesis_cover_label_align_tl, + labelAlign .initial:n = {r}, + valueAlign .tl_set:N = \l__bithesis_cover_value_align_tl, + valueAlign .initial:n = {c}, + labelMaxWidth .dim_set:N = \l__bithesis_cover_label_max_width_dim, + valueMaxWidth .dim_set:N = \l__bithesis_cover_value_max_width_dim, + autoWidth .bool_set:N = \l__bithesis_cover_auto_width_bool, + autoWidth .initial:n = {true}, + underlineThickness .dim_set:N = \l__bithesis_cover_underline_thickness_dim, + underlineThickness .initial:n = {1pt}, + underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, + underlineOffset .initial:n = { -10pt }, + } + +\keys_define:nn { bithesis / info } + { + title .tl_set:N = \l__bithesis_value_title_tl, + titleEn .tl_set:N = \l__bithesis_value_title_en_tl, + school .tl_set:N = \l__bithesis_value_school_tl, + major .tl_set:N = \l__bithesis_value_major_tl, + author .tl_set:N = \l__bithesis_value_author_tl, + studentId .tl_set:N = \l__bithesis_value_student_id_tl, + supervisor .tl_set:N = \l__bithesis_value_supervisor_tl, + externalSupervisor .tl_set:N = \l__bithesis_value_external_supervisor_tl, + keywords .tl_set:N = \l__bithesis_value_keywords_tl, + keywordsEn .tl_set:N = \l__bithesis_value_keywords_en_tl, + translationTitle .tl_set:N = \l__bithesis_value_trans_title_tl, + translationOriginTitle .tl_set:N = \l__bithesis_value_trans_origin_title_tl, + % 中国分类号,研究生学位论文使用 + classification .tl_set:N = \l__bithesis_value_classification_tl, + % UDC 分类号,研究生学位论文使用 + UDC .tl_set:N = \l__bithesis_value_udc_tl, + chairman .tl_set:N = \l__bithesis_value_chairman_tl, + degree .tl_set:N = \l__bithesis_value_degree_tl, + degreeEn .tl_set:N = \l__bithesis_value_degree_en_tl, + institute .tl_set:N = \l__bithesis_value_institute_tl, + institute .initial:n = {\c__bithesis_label_university_tl}, + defenseDate .tl_set:N = \l__bithesis_value_defense_date_tl, + authorEn .tl_set:N = \l__bithesis_value_author_en_tl, + schoolEn .tl_set:N = \l__bithesis_value_school_en_tl, + supervisorEn .tl_set:N = \l__bithesis_value_supervisor_en_tl, + chairmanEn .tl_set:N = \l__bithesis_value_chairman_en_tl, + majorEn .tl_set:N = \l__bithesis_value_major_en_tl, + instituteEn .tl_set:N = \l__bithesis_value_institute_en_tl, + instituteEn .initial:n = {\c__bithesis_label_university_en_tl}, + defenseDateEn .tl_set:N = \l__bithesis_value_defense_date_en_tl, + classifiedLevel .tl_set:N = \l__bithesis_value_classified_level_tl, + } + +\keys_define:nn { bithesis / misc } + { + arialFont .tl_set:N = \l__bithesis_misc_arial_font_path_tl, + } + +\keys_define:nn { bithesis / style } +{ + head .tl_set:N = \l__bithesis_style_head_tl, + head .initial:n = { + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} {北京理工大学本科生毕业设计(论文)} + {2} {北京理工大学本科生毕业设计(论文)外文翻译} + {3} {Beijing~Institute~of~Technology~Bachelor's~Thesis} + {4} {北京理工大学硕士学位论文} + {5} {北京理工大学博士学位论文} + } + } +} + +\ProcessKeysOptions { bithesis / option } + +\__bithesis_if_thesis_english:T { + \PassOptionsToClass{scheme=plain}{ctexbook} +} + +\bool_if:NTF \g__bithesis_twoside_bool {} { + \PassOptionsToClass{oneside,openany}{ctexbook} +} + +\DeclareOption*{ + \PassOptionsToClass{\CurrentOption}{ctexbook} +} +\ProcessOptions\relax +\LoadClass[zihao=-4,]{ctexbook} + +\RequirePackage{geometry} +\RequirePackage{xeCJK} +\RequirePackage{titletoc} +\RequirePackage{setspace} +\RequirePackage{graphicx} +\RequirePackage{fancyhdr} +\RequirePackage{pdfpages} +\RequirePackage{setspace} +\RequirePackage{booktabs} +\RequirePackage{multirow} +\RequirePackage{tikz} +\RequirePackage{etoolbox} +\RequirePackage{hyperref} +\RequirePackage{xcolor} +\RequirePackage{caption} +\RequirePackage{array} +\RequirePackage{amsmath} +\RequirePackage{amssymb} +\RequirePackage{pdfpages} +\RequirePackage{listings} +\RequirePackage{enumitem} +\RequirePackage{environ} + +\__bithesis_if_graduate:TF { + \int_set:Nn \g__bithesis_head_zihao_int {5} + \geometry{ + a4paper, + left=2.7cm, + bottom=2.5cm + 7bp, + top=3.5cm + 7bp, + right=2.7cm, + headsep = 3.5cm + 7bp - 2.5cm - 15bp, + headheight = 15 bp, + footskip = 2.5cm + 7bp - 1.8cm, + } +} { + \int_set:Nn \g__bithesis_head_zihao_int {4} + \geometry{ + a4paper, + left=3cm, + bottom=2.6cm + 7bp, + top=3.5cm + 7bp, + right=2.6cm, + headsep = 3.5cm + 7bp - 2.4cm - 20bp, + headheight = 20 bp, + footskip = 2.6cm + 7bp - 2cm, + } +} + +\setlength{\intextsep}{2\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} + +\setromanfont{Times~New~Roman} + +\ctex_at_end_preamble:n { + \__bithesis_if_thesis_english:TF { + \__bithesis_if_thesis_int_type:nT {3} { + % font Arial needed + \newfontfamily\arialfamily{Arial} + } + + } { + \tl_if_blank:VTF \l__bithesis_cover_xihei_font_path_tl {} + { + \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]{\l__bithesis_cover_xihei_font_path_tl} + } + } + + \__bithesis_if_thesis_int_type:nT {3} { + \RequirePackage[en-US]{datetime2} + \RequirePackage{indentfirst} + \DTMlangsetup[en-US]{dayyearsep={\space}} + } + + % Define biblatex category if it was imported. + \cs_if_exist:NT \DeclareBibliographyCategory { + \DeclareBibliographyCategory{mypub} + } +} + +\cs_new:Npn \xihei:n #1 { + \xeCJK_family_if_exist:nTF {xihei} { + \CJKfamily{xihei} #1 + }{ + \heiti #1 + } +} + +\cs_new:Npn \l__bithesis_title_font_cs:n #1 { + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \arialfamily #1 + } { + \heiti #1 + } +} + +\cs_new:Npn \l__bithesis_unnumchapter_style_cs:n #1 { + % 本科全英文、研究生学位论文需要加粗 + \int_compare:nNnTF {\g__bithesis_thesis_type_int} > {2} + { + \bfseries #1 + } { + \mdseries #1 + } +} + +\cs_set:Npn \arabicHeiti #1 {#1} + +\fancypagestyle{BIThesis}{ + \fancyhf{} + % 定义页眉、页码 + \fancyhead[C]{\zihao{\int_use:N \g__bithesis_head_zihao_int}\ziju{0.08}\songti{\tl_use:N \l__bithesis_style_head_tl}} + \fancyfoot[C]{\songti\zihao{5} \thepage} + % 页眉分割线稍微粗一些 + \RenewDocumentCommand \headrulewidth {} {0.6pt} +} + +\ctexset{chapter={ + number = {\arabicHeiti{ \arabic{chapter} }}, + format = { \l__bithesis_title_font_cs:n \bfseries \centering \zihao{3}}, + nameformat = {}, + titleformat = {}, + aftername = \hspace{9bp}, + pagestyle = BIThesis, + beforeskip = 8bp, + afterskip = 32bp, + fixskip = true, + } +} + +\ctexset{section={ + number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}}}, + format = {\l__bithesis_title_font_cs:n \raggedright \bfseries \zihao{4}}, + nameformat = {}, + titleformat = {}, + aftername = \hspace{8bp}, + beforeskip = 20bp plus 1ex minus .2ex, + afterskip = 18bp plus .2ex, + fixskip = true, + } +} + +\ctexset{subsection={ + number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}}}, + format = {\l__bithesis_title_font_cs:n \bfseries \raggedright \zihao{-4}}, + nameformat = {}, + titleformat = {}, + aftername = \hspace{7bp}, + beforeskip = 17bp plus 1ex minus .2ex, + afterskip = 14bp plus .2ex, + fixskip = true, + } +} + +\ctexset{ + secnumdepth = 3, + subsubsection={ + numbering = true, + number = {\arabicHeiti{\arabic{chapter}.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}.\hspace{1bp}\arabic{subsubsection}}}, + format={\l__bithesis_title_font_cs:n \bfseries \raggedright \zihao{-4}}, + nameformat = {}, + titleformat = {}, + beforeskip=28bp plus 1ex minus .2ex, + afterskip=24bp plus .2ex, + fixskip=true, + } +} + +\addtocontents{toc}{\protect\hypersetup{hidelinks}} + + +\__bithesis_if_graduate:TF { + % 各章标题,宋体四号 + \titlecontents{chapter}[0pt]{\songti \zihao{4}} + {\thecontentslabel\hspace{\ccwd}}{} + {\hspace{.5em}\titlerule*{.}\contentspage} +} { + \titlecontents{chapter}[0pt]{\songti \zihao{-4}} + {\thecontentslabel\hspace{\ccwd}}{} + {\hspace{.5em}\titlerule*{.}\contentspage} +} +\titlecontents{section}[1\ccwd]{\songti \zihao{-4}} +{\thecontentslabel\hspace{\ccwd}}{} +{\hspace{.5em}\titlerule*{.}\contentspage} +\titlecontents{subsection}[2\ccwd]{\songti \zihao{-4}} +{\thecontentslabel\hspace{\ccwd}}{} +{\hspace{.5em}\titlerule*{.}\contentspage} + +\bool_new:N \l__bithesis_add_to_toc_bool +\bool_set_true:N \l__bithesis_add_to_toc_bool + +\keys_define:nn { bit } + { + abstract .meta:nn = { bit / abstract } {#1}, + abstract_en .meta:nn = { bit / abstract_en } {#1}, + } + +\keys_define:nn { bit / abstract } + { + addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, + } + +\keys_define:nn { bit / abstract_en } + { + addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, + } + +\keys_define:nn { bit / symbols } + { + addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, + } + +\RenewDocumentCommand \frontmatter {} { + + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \pagenumbering{roman} + } { + \pagenumbering{Roman} + } + \ctexset{ + chapter = { + numbering = false, + } + } + \pagestyle{BIThesis} +} + +\RenewDocumentCommand \mainmatter {} { + \cleardoublepage + + \ctexset{ + chapter = { + numbering = true, + } + } + \pagenumbering{arabic} + \pagestyle{BIThesis} + % 正文 22 磅的行距 + \setlength{\parskip}{0em} + \setstretch{1.53} + % 修复脚注出现跨页的问题 + \interfootnotelinepenalty=10000 +} + +\RenewDocumentCommand \backmatter {} { + \setcounter{section}{0} + \setcounter{subsection}{0} + \setcounter{subsubsection}{0} + \ctexset{ + chapter = { + numbering = false, + beforeskip = 18bp, + format = {\l__bithesis_title_font_cs:n \l__bithesis_unnumchapter_style_cs:n \centering \zihao{3}}, + afterskip = 26bp, + } + } +} + +\setlength{\abovecaptionskip}{11pt} +\setlength{\belowcaptionskip}{9pt} + +\__bithesis_if_graduate:TF { + \tl_set:Nn \g__bithesis_label_devide_char_tl {.} +} { + \tl_set:Nn \g__bithesis_label_devide_char_tl {-} +} + +\cs_set:Npn \thefigure {\thechapter\g__bithesis_label_devide_char_tl\arabic{figure}} +\captionsetup[figure]{font=small,labelsep=space} + +\cs_set:Npn \thetable {\thechapter\g__bithesis_label_devide_char_tl\arabic{table}} +\captionsetup[table]{font=small,labelsep=space,skip=2pt} + +\cs_set:Npn \theequation {\thechapter\g__bithesis_label_devide_char_tl\arabic{equation}} + +\cs_set:Npn \thelstlisting {\thechapter\g__bithesis_label_devide_char_tl\arabic{lstlisting}} +\cs_set:Npn \lstlistingname {\c__bithesis_label_code_tl} + +\tolerance=1 +\emergencystretch=\maxdimen +\hyphenpenalty=10000 +\hbadness=10000 + +\definecolor{codegreen}{rgb}{0,0.6,0} +\definecolor{codegray}{rgb}{0.5,0.5,0.5} +\definecolor{codepurple}{rgb}{0.58,0,0.82} +\definecolor{backcolour}{rgb}{0.95,0.95,0.92} +\lstdefinestyle{examplestyle}{ + backgroundcolor=\color{backcolour}, + commentstyle=\color{codegreen}, + keywordstyle=\color{magenta}, + numberstyle=\tiny\color{codegray}, + stringstyle=\color{codepurple}, + basicstyle=\ttfamily\footnotesize, + breakatwhitespace=false, + breaklines=true, + captionpos=b, + keepspaces=true, + numbers=left, + numbersep=5pt, + showspaces=false, + showstringspaces=false, + showtabs=false, + tabsize=2 +} +\lstset{style=examplestyle} + +\cs_set:Npn \listfigurename {\c__bithesis_label_figure_tl} +\cs_set:Npn \listtablename {\c__bithesis_label_table_tl} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\DeclareDocumentCommand \BITSetup { m } + { \keys_set:nn { bithesis } { #1 }} + +\cs_new:Npn \__bithesis_render_cover_entry:nn #1#2 { + \makebox[\l__bithesis_cover_label_max_width_dim][\l__bithesis_cover_label_align_tl]{ + \tl_if_blank:VTF #1 {} {#1\l__bithesis_cover_dilimiter_tl} + } + \hspace{1ex} + \__bithesis_dunderline:nnn{\l__bithesis_cover_underline_offset_dim}{\l__bithesis_cover_underline_thickness_dim}{ + \makebox[\l__bithesis_cover_value_max_width_dim][\l__bithesis_cover_value_align_tl]{#2} + }\par +} + +\cs_new:Npn \__bithesis_get_text_width:Nn #1#2 + { + \hbox_set:Nn \l_tmpa_box {#2} + \dim_set:Nn #1 { \box_wd:N \l_tmpa_box } + } +\cs_generate_variant:Nn \__bithesis_get_text_width:Nn { NV } + +\cs_new:Npn \__bithesis_get_max_text_width:NN #1#2 + { + \group_begin: + \seq_set_eq:NN \l__bithesis_tmpa_seq #2 + \dim_zero_new:N \l__bithesis_tmpa_dim + \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_tmpa_seq } + { + \seq_pop_left:NN \l__bithesis_tmpa_seq \l__bithesis_tmpa_tl + \__bithesis_get_text_width:NV \l__bithesis_tmpa_dim \l__bithesis_tmpa_tl + \dim_gset:Nn #1 { \dim_max:nn {#1} { \l__bithesis_tmpa_dim } } + } + \group_end: + } + +\cs_new:Npn \__bithesis_parse_entry #1 #2 { + \seq_set_split:Nne \l__bithesis_tmp_right_seq {//} {#2} + \seq_clear:N \l__bithesis_tmp_left_seq + \seq_map_inline:Nn \l__bithesis_tmp_right_seq { + \seq_put_right:Nn \l__bithesis_tmp_left_seq {} + } + \seq_put_left:Nn \l__bithesis_tmp_left_seq {#1} + \seq_pop_right:NN \l__bithesis_tmp_left_seq \g__bithesis_trashcan_tl +} + +\cs_new:Npn \__bithesis_render_cover_entry:n #1 { + \seq_set_from_clist:NN \l__bithesis_input_seq #1 + % parse newline // + \seq_map_inline:Nn \l__bithesis_input_seq { + \__bithesis_parse_entry ##1 + \seq_concat:NNN \l__bithesis_right_seq \l__bithesis_right_seq \l__bithesis_tmp_right_seq + \seq_concat:NNN \l__bithesis_left_seq \l__bithesis_left_seq \l__bithesis_tmp_left_seq + } + + \bool_if:NT \l__bithesis_cover_auto_width_bool { + \__bithesis_get_max_text_width:NN \l__bithesis_cover_label_max_width_dim \l__bithesis_left_seq + \__bithesis_get_max_text_width:NN \l__bithesis_cover_value_max_width_dim \l__bithesis_right_seq + } + + \group_begin: + \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_left_seq } + { + \seq_pop_left:NN \l__bithesis_left_seq \l__bithesis_tmpa_tl + \seq_pop_left:NN \l__bithesis_right_seq \l__bithesis_tmpb_tl + \tl_if_empty:eTF \l__bithesis_tmpb_tl {} { + \__bithesis_render_cover_entry:nn {\l__bithesis_tmpa_tl} {\l__bithesis_tmpb_tl} + } + } + \group_end: +} + +\cs_new:Npn \__bithesis_dunderline:nnn #1#2#3 { + {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}} +} + +\cs_new:Npn \__bithesis_dunderline:nn #1#2 { + \__bithesis_dunderline:nnn {#1} {1pt} {#2} +} + +\cs_new:Npn \__bithesis_dunderline:n #1 { + \__bithesis_dunderline:nnn {-10pt} {1pt} {#1} +} + +\newcommand\dunderline[3][-1pt]{{% + \setbox0=\hbox{#3} + \ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}} + +\NewEnviron{blindPeerReview}{ + \bool_if:NTF \g__bithesis_blind_mode_bool {} { + \BODY + } +} + +\RenewDocumentCommand \cleardoublepage { } + { + \clearpage + \bool_if:NT \g__bithesis_twoside_bool + { + \int_if_odd:nF \c@page + { \hbox:n { } \thispagestyle { empty } \newpage } + } + } + +\cs_new:Npn \make_graduate_cover: { + \cleardoublepage + \begin{titlepage} + { + \heiti\zihao{5} + \tl_if_blank:VTF \l__bithesis_value_classified_level_tl {} { + \flushright + \c__bithesis_label_classified_level_tl:~ + \l__bithesis_value_classified_level_tl \par + } + } + \centering + \vspace*{65mm} + {\heiti\zihao{-2} \l__bithesis_value_title_tl} + \vskip 60mm + {\heiti \zihao{-3} \l__bithesis_value_author_tl} % 黑体 小三 + \vskip 10mm + {\heiti \zihao{-3} \l__bithesis_cover_date_tl} % 黑体 小三 + \end{titlepage} +} + +\cs_new:Npn \make_paper_back: { + \cleardoublepage + \begin{titlepage} + \vskip 5cm + \begin{center} + \setstretch{1.1} + \begin{minipage}[t][19.7cm]{2em} + \begin{center} + {\heiti\zihao{3}\l__bithesis_value_title_tl} + \vfill + {\heiti\zihao{3}\l__bithesis_value_author_tl} + \vfill + {\heiti\zihao{3}\c__bithesis_label_university_tl} + \end{center} + \end{minipage} + \end{center} + % \vskip 5cm + \end{titlepage} +} + +\cs_new:Npn \__bithesis_make_chinese_title_page: { + \cleardoublepage + \begin{titlepage} + { % + {\heiti \zihao{5} \noindent \c__bithesis_label_classification_tl} \l__bithesis_value_classification_tl\\ + {\heiti \zihao{5} \c__bithesis_label_udc_tl} \l__bithesis_value_udc_tl + } + \begin{center} + + \vskip \stretch{1} + {\heiti\zihao{-2} \l__bithesis_value_title_tl} + \vskip \stretch{1} + + % TODO: delete this? + {\fangsong\zihao{4}} + \def\tabcolsep{1pt} + \def\arraystretch{1.5} + + { + \renewcommand{\baselinestretch}{2} + + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\qquad} + } + \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {45mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {60mm} + } + } + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_graduate_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_graduate_label_school_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_graduate_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_graduate_label_chairman_tl} {\l__bithesis_value_chairman_tl}, + {\c__bithesis_graduate_label_degree_tl} {\l__bithesis_value_degree_tl}, + {\c__bithesis_graduate_label_major_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_graduate_label_institute_tl} {\l__bithesis_value_institute_tl}, + {\c__bithesis_graduate_label_defense_date_tl} {\l__bithesis_value_defense_date_tl}, + } + + \heiti\zihao{-3} + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + } + \end{center} + \vskip \stretch{0.5} + \end{titlepage} +} + +\cs_new:Npn \__bithesis_make_english_title_page: { + \begin{titlepage} + \begin{center} + + \vspace*{10em} + {\zihao{-2}\textbf{\l__bithesis_value_title_en_tl}} + % \bfseries + \vskip \stretch{1} + + { + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:~} + } + + \tl_set:Nn \l__bithesis_cover_label_align_tl {l} + \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} + + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {55mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {85mm} + } + } + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_graduate_label_author_en_tl} {\l__bithesis_value_author_en_tl}, + {\c__bithesis_graduate_label_school_en_tl} {\l__bithesis_value_school_en_tl}, + {\c__bithesis_graduate_label_supervisor_en_tl} {\l__bithesis_value_supervisor_en_tl}, + {\c__bithesis_graduate_label_chairman_en_tl} {\l__bithesis_value_chairman_en_tl}, + {\c__bithesis_graduate_label_degree_en_tl} {\l__bithesis_value_degree_en_tl}, + {\c__bithesis_graduate_label_major_en_tl} {\l__bithesis_value_major_en_tl}, + {\c__bithesis_graduate_label_institute_en_tl} {\l__bithesis_value_institute_en_tl}, + {\c__bithesis_graduate_label_defense_date_en_tl} {\l__bithesis_value_defense_date_en_tl}, + } + + \zihao{-3} + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + } + + \end{center} + + \vskip \stretch{0.5} + \end{titlepage} +} + +\DeclareDocumentCommand \MakeCover {} + { + \begin{blindPeerReview} + \group_begin: + + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} + { + \begin{titlepage} + \vspace*{16mm} + + \centering + + \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { + \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ + } + + \vspace*{-3mm} + + \zihao{-0}\textbf{\ziju{0.12}\songti{\c__bithesis_bachelor_label_title_tl}}\par + + \vspace{16mm} + + \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par + + \vspace{3mm} + + \begin{spacing}{1.2} + \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par + \end{spacing} + + \vspace{15mm} + + \begin{spacing}{1.8} + \begin{center} + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} + } + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} + } + } + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + } + + \zihao{3} + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{center} + \end{spacing} + + \vspace*{\fill} + \centering + \zihao{3}\ziju{0.5}\songti{ + \tl_if_empty:NTF \l__bithesis_cover_date_tl { + \today + } { + \l__bithesis_cover_date_tl + } + } + \end{titlepage} + } + {2} + { + \begin{titlepage} + \centering + + \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { + \includegraphics[width=6.87cm]{\l_bit_coverheaderimage_tl}\\ + } + + \vspace{1mm} + + \zihao{2}\textbf{\songti{本科生毕业设计(论文)外文翻译}} + + \vspace{8mm} + + { + + \begin{spacing}{1.8} + + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\textbf{:}} + \bool_set_false:N \l__bithesis_cover_auto_width_bool + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {115mm} + + \clist_set:Nn \l__bithesis_input_clist { + {\zihao{4}\textbf{外文原文题目}} {\l__bithesis_value_trans_origin_title_tl}, + {\zihao{4}\textbf{中文翻译题目}} {\l__bithesis_value_trans_title_tl}, + } + + \zihao{-3} + \centering + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{spacing} + + } + + \vspace{14mm} + + \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par + + \vspace{3mm} + + \begin{spacing}{1.2} + \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par + \end{spacing} + + \vspace{19mm} + + \begin{spacing}{1.8} + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} + } + + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} + } + } + + \zihao{3} + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + } + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{spacing} + + \vspace*{\fill} + \end{titlepage} + } + {3} { + \begin{titlepage} + \vspace*{16mm} + + \centering + + \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { + \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ + } + + \vspace*{-3mm} + + \zihao{1}\textbf{\ziju{0.12}Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis}\par + + \vspace{18mm} + + \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_en_tl}\par + + \vspace{10mm} + + \begin{spacing}{1.8} + \begin{center} + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} + } + + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {20mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {105mm} + } + } + + \zihao{4} + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_label_school_en_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_label_major_en_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_label_author_en_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_en_tl} {\l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_en_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_en_tl} {\l__bithesis_value_external_supervisor_tl}, + } + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{center} + \end{spacing} + + \vspace*{\fill} + \centering + \zihao{3}\ziju{0.5}\songti{ + \tl_if_empty:NTF \l__bithesis_cover_date_tl { + \today + } { + \l__bithesis_cover_date_tl + } + } + \end{titlepage} + } + {4} { + \make_graduate_cover: + } + {5} { + \make_graduate_cover: + } + } + \group_end: + \end{blindPeerReview} + } + +\newcommand{\circled}[2][]{\tikz[baseline=(char.base)] + {\node[shape = circle, draw, inner~sep = 1pt] + (char) {\phantom{\ifblank{#1}{#2}{#1}}}; + \node at (char.center) {\makebox[0pt][c]{#2}};}} +\robustify{\circled} + +\cs_new:Npn \__bithesis_graduate_originality: { + \ctexset { + chapter / pagestyle = plain, + } + + \begin{titlepage} + \pagenumbering{gobble} + + % 原创性声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{3}\c__bithesis_graduate_label_originality_tl} + \end{center}~\par + + % 本部分字号为小三 + \zihao{4} + \c__bithesis_graduate_label_originality_clause_tl + + \vspace{17mm} + + \begin{flushright} + \c__bithesis_graduate_label_originality_author_signature_tl\par + \end{flushright} + + \vspace{16mm} + + % 使用授权声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{3}\c__bithesis_graduate_label_authorization_tl} + \end{center}~\par + + \c__bithesis_graduate_label_authorization_clause_tl + + \vspace*{15mm} + + \begin{flushright} + \begin{spacing}{1.65} + \zihao{4} + % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} + \c__bithesis_graduate_label_originality_author_signature_tl\par + \c__bithesis_graduate_label_originality_supervisor_signature_tl\par + \end{spacing} + \end{flushright} + \end{titlepage} + \cleardoublepage +} + +\NewDocumentCommand \MakeOriginality {} +{ + \group_begin: + \begin{blindPeerReview} + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} + { + \pagestyle{BIThesis} + \pagenumbering{gobble} + + % 原创性声明部分 + \begin{center} + \vspace*{-2bp} + \__bithesis_same_page: + \chapter*{\heiti\zihao{2}\c__bithesis_bachelor_label_originality_tl} + \end{center}~\par + + % 本部分字号为小三 + \zihao{-3} + \c__bithesis_bachelor_label_originality_clause_tl + + \vspace{17mm} + + \begin{flushright} + \c__bithesis_bachelor_label_originality_author_signature_tl\par + \end{flushright} + + \vspace{16mm} + + % 使用授权声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{2}\c__bithesis_bachelor_label_authorization_tl} + \end{center}~\par + + \c__bithesis_bachelor_label_authorization_clause_tl + + \vspace*{3mm} + + \begin{flushright} + \begin{spacing}{1.65} + \zihao{-3} + % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} + \c__bithesis_bachelor_label_originality_author_signature_tl\par + \c__bithesis_bachelor_label_originality_supervisor_signature_tl\par + \end{spacing} + \end{flushright} + + \newpage + } + {3} { + \setstretch{1.26} + % 原创性声明部分 + \begin{center} + \vspace*{-2bp} + \__bithesis_same_page: + \chapter*{\heiti\zihao{-2}\c__bithesis_bachelor_english_label_originality_tl} + \end{center}~\par + + % 本部分字号为小三 + \zihao{-4} + \c__bithesis_bachelor_english_label_originality_clause_tl + + \bigbreak + + Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~Date:\par + + \vspace{6mm} + + % 使用授权声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{-2}\c__bithesis_bachelor_english_label_authorization_tl} + \end{center}~\par + + \c__bithesis_bachelor_english_label_authorization_clause_tl + + \bigbreak + Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm + 16bp]{}}~\hspace{2mm}Date:\par + Supervisor~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~\hspace{2mm}Date:\par + } + {4} {\__bithesis_graduate_originality:} + {5} {\__bithesis_graduate_originality:} + } + \end{blindPeerReview} + \group_end: +} + +\NewDocumentCommand \MakePaperBack {} + { + \begin{blindPeerReview} + \make_paper_back: + \end{blindPeerReview} + } + +\NewDocumentCommand \MakeTitle {} + { + \begin{blindPeerReview} + \__bithesis_make_chinese_title_page: + \__bithesis_make_english_title_page: + \end{blindPeerReview} + } + +\DeclareDocumentCommand \MakeTOC {} + { + { + \__bithesis_if_bachelor_thesis:TF { + \renewcommand{\baselinestretch}{1.35} + } { + \renewcommand{\baselinestretch}{1.56} + } + + \__bithesis_if_thesis_english:TF { + \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_en_tl} + } { + \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_tl} + } + + % 自定义目录样式 + \cs_set:Npn \contentsname { + \fontsize{16pt}{\baselineskip} + \l__bithesis_unnumchapter_style_cs:n\l__bithesis_title_font_cs:n{\l__bithesis_toc_title_tl} + \vspace{-8pt} + } + + % 制作目录 + \tableofcontents + + % 在本科生全英文模板中,添加「目录」本身到目录中。 + \__bithesis_if_thesis_int_type:nT {3} { + \addcontentsline{toc}{chapter}{\c__bithesis_label_toc_en_tl} + } + } + } + + % TODO: + \NewDocumentEnvironment {abstract} {o} + { + + \IfValueT {#1} { + \keys_set:nn { bit / abstract } {#1} + } + + \cleardoublepage + \setstretch{1.53} + + \__bithesis_if_bachelor_thesis:T { + \begin{center} + \vspace*{-17bp} + \heiti\zihao{-2}\textbf{ + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} {\l__bithesis_value_title_tl} + {2} {\l__bithesis_value_trans_title_tl} + {3} {\l__bithesis_value_title_tl} + } + } + \end{center} + + \vspace*{2mm} + } + + \ctexset{ + chapter/numbering = false, + } + + \__bithesis_if_bachelor_thesis:T { + \ctexset{ + chapter/titleformat = {\textmd} + } + } + + { + \__bithesis_same_page: + \bool_if:NTF \l__bithesis_add_to_toc_bool { + \chapter{\c__bithesis_label_abstract_tl} + } { + \chapter*{\c__bithesis_label_abstract_tl} + } + } + \vspace*{1mm} + \par + } + { + \par + \vspace{4ex}\noindent\textbf{\heiti \c__bithesis_label_keywords_tl \l__bithesis_value_keywords_tl}\par + \newpage + } + + \NewDocumentEnvironment {abstractEn} {o} + { + \IfValueT {#1} { + \keys_set:nn { bit / abstract_en } {#1} + } + + \cleardoublepage + \setstretch{1.53} + + \__bithesis_if_bachelor_thesis:T { + \begin{spacing}{0.95} + \centering + \vspace*{-2bp} + + \__bithesis_if_thesis_int_type:nTF {3} { + \arialfamily\zihao{-2}\textbf\l__bithesis_value_title_en_tl\\ + } { + \heiti\zihao{3}\textbf\l__bithesis_value_title_en_tl\\ + } + \end{spacing} + \vspace*{10mm} + } + + \ctexset{ + chapter/numbering = false, + } + + \__bithesis_if_bachelor_thesis:TF { + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \ctexset{ + chapter = { + titleformat = {\heiti\zihao{3}\centering\textbf}, + } + } + } { + \ctexset{ + chapter = { + titleformat = {\heiti\zihao{-3}\centering\textmd}, + } + } + } + } { + \ctexset { + chapter/titleformat = {\heiti\zihao{3}\centering\textbf} + } + } + + { + \__bithesis_same_page: + \bool_if:nTF {\l__bithesis_add_to_toc_bool} { + \chapter{\c__bithesis_label_abstract_en_tl} + } { + \chapter*{\c__bithesis_label_abstract_en_tl} + } + } + } + { + \par\vspace{3ex}\noindent\textbf{\c__bithesis_label_keywords_en_tl \l__bithesis_value_keywords_en_tl} + \newpage + } + + \NewDocumentEnvironment {conclusion} {} + { + \ctexset{ + section/number = \arabic{section} + } + + \__bithesis_if_thesis_english:TF { + \chapter{\c__bithesis_label_conclusion_en_tl} + } { + \chapter{\c__bithesis_label_conclusion_tl} + } + } + {} + + \NewDocumentEnvironment {bibprint} {} + { + % 设置参考文献字号为 5 号 + \renewcommand*{\bibfont}{\zihao{5}} + % 设置参考文献各个项目之间的垂直距离为 0 + \setlength{\bibitemsep}{0ex} + \setlength{\bibnamesep}{0ex} + \setlength{\bibinitsep}{0ex} + \__bithesis_if_graduate:TF { + } { + % 「本科生」设置单倍行距 + \renewcommand{\baselinestretch}{1.2} + } + % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 + \setlength{\biblabelsep}{1.7mm} + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + \RenewDocumentCommand \itemcmd {} { + \addvspace{\bibitemsep} % 恢复 \bibitemsep 的作用 + \mkgbnumlabel{\printfield{labelnumber}} + \hspace{\biblabelsep} + } + \__bithesis_if_thesis_english:TF { + \chapter{\c__bithesis_label_reference_en_tl} + } { + \chapter{\c__bithesis_label_reference_tl} + } + } + {} + + % #1: The name that used as chapter title + % #2: The name that used in ToC. + \NewDocumentEnvironment {appendices} { oo } + { + % Used in chapter, ToC. + \tl_new:N \l__bithesis_appendix_plain_label_tl + % Used before reference label. + \tl_new:N \l__bithesis_appendix_title_tl + + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_en_tl} + \tl_set:Nn \l__bithesis_appendix_title_tl {\c__bithesis_label_appendix_en_tl} + } { + \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_tl} + \tl_set:Nn \l__bithesis_appendix_title_tl {\c__bithesis_label_appendix_tl} + } + + \ctexset{ + section/number = \l__bithesis_appendix_plain_label_tl\hspace{1ex}\Alph{section}, + subsection/number = \Alph{section}. \arabic{subsection}, + } + + \IfValueTF {#1} { + \chapter*{#1} + \stepcounter{chapter} + \IfValueTF {#2} { + \addcontentsline{toc}{chapter}{#2} + } { + \addcontentsline{toc}{chapter}{\l__bithesis_appendix_title_tl} + } + } { + \chapter{\l__bithesis_appendix_title_tl} + } + + \cs_set:Npn \thechapter { + \Alph{section} + } + } + {} + + \NewDocumentEnvironment {acknowledgements} {+b} + { + \begin{blindPeerReview} + \ctexset{ + section/number = \arabic{section}, + subsection/number = \arabic{section}. \arabic{subsection}, + } + + \__bithesis_if_thesis_english:TF { + \chapter{\c__bithesis_label_ack_en_tl} + } { + \chapter{\c__bithesis_label_ack_tl} + } + #1 + \end{blindPeerReview} + } {} + + \NewDocumentEnvironment {publications} {+b} + { + \begin{blindPeerReview} + % 设置参考文献字号为 5 号 + \renewcommand*{\bibfont}{\zihao{5}} + % 设置参考文献各个项目之间的垂直距离为 0 + \setlength{\bibitemsep}{0ex} + \setlength{\bibnamesep}{0ex} + \setlength{\bibinitsep}{0ex} + % 设置单倍行距 + \renewcommand{\baselinestretch}{1.2} + % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 + \setlength{\biblabelsep}{1.7mm} + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + \RenewDocumentCommand \itemcmd {} { + \addvspace{\bibitemsep} % 恢复 \bibitemsep 的作用 + \mkgbnumlabel{\printfield{labelnumber}} + \hspace{\biblabelsep} + } + + % ===== 上方定义与「参考文献」部分相同 + \cs_set:Npn \mkbibnamegiven ##1 { + \ifitemannotation{myself}{\textbf{##1}}{##1} + } + + \cs_set:Npn \mkbibnamefamily ##1 { + \ifitemannotation{myself}{\textbf{##1}}{##1} + } + + % Sorting by year, name, type. + \newrefcontext[sorting=ynt] + \chapter{\c__bithesis_label_publications_tl} + #1 + \end{blindPeerReview} + } + {} + + \NewDocumentEnvironment {resume} {+b} + { + \begin{blindPeerReview} + \chapter{\c__bithesis_label_resume_tl} + #1 + \end{blindPeerReview} + } + { + } + + \NewDocumentEnvironment {symbols} {o} + { + \IfValueT {#1} { + \keys_set:nn { bit / symbols } {#1} + } + + \bool_if:NTF \l__bithesis_add_to_toc_bool { + \chapter{\c__bithesis_label_symbols_tl} + } { + \chapter*{\c__bithesis_label_symbols_tl} + } + \zihao{-4} + \begin{itemize}[labelwidth=2.5cm,labelsep=0.5cm,leftmargin=3cm,itemindent=0cm,itemsep=0cm] + \cs_set:Npn \makelabel ##1 {##1\hfil} + } + { + \end{itemize} + } + + +\endinput +%% +%% End of file `bithesis.cls'. diff --git a/templates/graduate-thesis/chapters/abstract.tex b/templates/graduate-thesis/chapters/abstract.tex index 4ef3f6aa..363d6724 100644 --- a/templates/graduate-thesis/chapters/abstract.tex +++ b/templates/graduate-thesis/chapters/abstract.tex @@ -20,6 +20,6 @@ \textcolor{blue}{(摘要是一篇具有独立性和完整性的短文,应概括而扼要地反映出本论文的主要内容。包括研究目的、研究方法、研究结果和结论等,特别要突出研究结果和结论。中文摘要力求语言精炼准确,博士学位论文建议1000~1200字,硕士学位论文摘要建议500~800字。摘要中不可出现参考文献、图、表、化学结构式、非公知公用的符号和术语。英文摘要与中文摘要的内容应完全一致,在语法、用词上应准确无误,语言简练通顺。留学生的英文版博士学位论文中应有不少于3000字的“详细中文摘要”。)} \end{abstract} -\begin{abstract*}[addTOC=false] +\begin{abstractEn}[addTOC=false] In order to exploit....... -\end{abstract*} +\end{abstractEn} diff --git a/templates/graduate-thesis/main.tex b/templates/graduate-thesis/main.tex index 17c67897..8d1b2d87 100644 --- a/templates/graduate-thesis/main.tex +++ b/templates/graduate-thesis/main.tex @@ -52,7 +52,7 @@ keywords = {形状记忆;聚氨酯;织物;合成;应用\textcolor{blue}{(硕士一般选3~6个单词或专业术语,博士一般选3~8个单词或专业术语,且中英文关键词必须对应。)}}, keywordsEn = shape memory properties; polyurethane; textile; synthesis; application, % 必要时置于封面右上角,并按照国家规定进行标记。 - % classified_level = 密级 $\bigstar$ 保密期限, + % classifiedLevel = 密级 $\bigstar$ 保密期限, } } diff --git a/templates/lab-report/README.md b/templates/lab-report/README.md index 4c4e0068..387b5602 100644 --- a/templates/lab-report/README.md +++ b/templates/lab-report/README.md @@ -10,15 +10,22 @@ ├── main.tex ├── main.pdf ├── misc -│ └── cover_v1.tex +│ └── refs.bib └── assets └── …… ``` ## 编译方式 +方式一(推荐): +``` +latexmk +``` + +方式二: ``` -> xelatex +-> biber -> xelatex -> xelatex ``` diff --git a/templates/lab-report/bitreport.cls b/templates/lab-report/bitreport.cls new file mode 100644 index 00000000..5af42046 --- /dev/null +++ b/templates/lab-report/bitreport.cls @@ -0,0 +1,329 @@ +%% +%% This is file `bitreport.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% bithesis.dtx (with options: `cls,report') +%% +%% Copyright (C) 2022 +%% Association of Bit Network Pioneer and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2020/11/27 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Feng Kaiyu. +%% ------------------------------------------------------------------------------ +%% +\RequirePackage{expl3,l3keys2e} +\ProvidesExplClass{bitreport} +{2022-06-10}{3.0.0}{BIT Thesis Templates} +%%%% TODO: + + +\int_new:N \g__bithesis_report_type_int + +\clist_const:Nn \c__bithesis_report_type_clist + { common, undergraduate_proposal} + +\seq_new:N \l__bithesis_right_seq +\seq_new:N \l__bithesis_left_seq + +\PassOptionsToPackage{AutoFakeBold,AutoFakeSlant}{xeCJK} + +\DeclareOption*{ + \PassOptionsToClass{\CurrentOption}{ctexart} +} +\ProcessOptions\relax +\LoadClass[zihao=-4]{ctexart} + +\RequirePackage[a4paper,left=3cm,right=2.4cm,top=2.6cm,bottom=2.38cm,includeheadfoot]{geometry} +\RequirePackage{fancyhdr} +\RequirePackage{setspace} +\RequirePackage{caption} +\RequirePackage{booktabs} +\RequirePackage{pdfpages} + +\keys_define:nn { bitreport } + { + option .meta:nn = {bitreport / option } {#1}, + cover .meta:nn = { bitreport / cover } {#1}, + info .meta:nn = { bitreport / info } {#1}, + misc .meta:nn = { bitreport / misc } {#1} + } + +\keys_define:nn { bitreport / cover } + { + imagePath .tl_set:N = \l_bit_coverimagepath_tl, + date .tl_set:N = \l__bithesis_cover_date_tl, + %% cover entry + dilimiter .tl_set:N = \l__bithesis_cover_dilimiter_tl, + labelAlign .tl_set:N = \l__bithesis_cover_label_align_tl, + labelAlign .initial:n = {r}, + valueAlign .tl_set:N = \l__bithesis_cover_value_align_tl, + valueAlign .initial:n = {c}, + labelMaxWidth .dim_set:N = \l__bithesis_cover_label_max_width_dim, + valueMaxWidth .dim_set:N = \l__bithesis_cover_value_max_width_dim, + autoWidth .bool_set:N = \l__bithesis_cover_auto_width_bool, + autoWidth .initial:n = {true}, + underlineThickness .dim_set:N = \l__bithesis_cover_underline_thickness_dim, + underlineThickness .initial:n = {1pt}, + underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, + underlineOffset .initial:n = { -10pt }, + } + +\keys_define:nn { bitreport / info } + { + title .tl_set:N = \l__bithesis_value_title_tl, + school .tl_set:N = \l__bithesis_value_school_tl, + major .tl_set:N = \l__bithesis_value_major_tl, + class .tl_set:N = \l__bithesis_value_class_tl, + author .tl_set:N = \l__bithesis_value_author_tl, + supervisor .tl_set:N = \l__bithesis_value_supervisor_tl, + externalSupervisor .tl_set:N = \l__bithesis_value_external_supervisor_tl, + studentId .tl_set:N = \l__bithesis_value_student_id_tl, + } + +\keys_define:nn { bitreport / option } +{ + type .choice:, + type .value_required:n = true, + type .choices:Vn = + \c__bithesis_report_type_clist + { + \int_set_eq:NN \g__bithesis_report_type_int \l_keys_choice_int + }, + type .initial:n = common, + +} + +\keys_define:nn { bitreport / misc } + { + reviewTable .tl_set:N = \l_bit_reviewtable_tl, + } + +\ProcessKeysOptions { bitreport / option } + +\cs_generate_variant:Nn \tl_if_empty:nTF {e} +\cs_generate_variant:Nn \seq_set_split:Nnn {Nne} + +\cs_new:Npn \__bithesis_dunderline:nnn #1#2#3 { + {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}} +} + +\cs_new:Npn \__bithesis_render_cover_entry:nn #1#2 { + \makebox[\l__bithesis_cover_label_max_width_dim][\l__bithesis_cover_label_align_tl]{ + \tl_if_blank:VTF #1 {} {#1\l__bithesis_cover_dilimiter_tl} + } + \hspace{1ex} + \__bithesis_dunderline:nnn{\l__bithesis_cover_underline_offset_dim}{\l__bithesis_cover_underline_thickness_dim}{ + \makebox[\l__bithesis_cover_value_max_width_dim][\l__bithesis_cover_value_align_tl]{#2} + }\par +} + +\cs_new:Npn \__bithesis_get_text_width:Nn #1#2 + { + \hbox_set:Nn \l_tmpa_box {#2} + \dim_set:Nn #1 { \box_wd:N \l_tmpa_box } + } +\cs_generate_variant:Nn \__bithesis_get_text_width:Nn { NV } + +\cs_new:Npn \__bithesis_get_max_text_width:NN #1#2 + { + \group_begin: + \seq_set_eq:NN \l__bithesis_tmpa_seq #2 + \dim_zero_new:N \l__bithesis_tmpa_dim + \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_tmpa_seq } + { + \seq_pop_left:NN \l__bithesis_tmpa_seq \l__bithesis_tmpa_tl + \__bithesis_get_text_width:NV \l__bithesis_tmpa_dim \l__bithesis_tmpa_tl + \dim_gset:Nn #1 { \dim_max:nn {#1} { \l__bithesis_tmpa_dim } } + } + \group_end: + } + +\cs_new:Npn \__bithesis_parse_entry #1 #2 { + \seq_set_split:Nne \l__bithesis_tmp_right_seq {//} {#2} + \seq_clear:N \l__bithesis_tmp_left_seq + \seq_map_inline:Nn \l__bithesis_tmp_right_seq { + \seq_put_right:Nn \l__bithesis_tmp_left_seq {} + } + \seq_put_left:Nn \l__bithesis_tmp_left_seq {#1} + \seq_pop_right:NN \l__bithesis_tmp_left_seq \g__bithesis_trashcan_tl +} + +\cs_new:Npn \__bithesis_render_cover_entry:n #1 { + \seq_set_from_clist:NN \l__bithesis_input_seq #1 + % parse newline // + \seq_map_inline:Nn \l__bithesis_input_seq { + \__bithesis_parse_entry ##1 + \seq_concat:NNN \l__bithesis_right_seq \l__bithesis_right_seq \l__bithesis_tmp_right_seq + \seq_concat:NNN \l__bithesis_left_seq \l__bithesis_left_seq \l__bithesis_tmp_left_seq + } + + \bool_if:NT \l__bithesis_cover_auto_width_bool { + \__bithesis_get_max_text_width:NN \l__bithesis_cover_label_max_width_dim \l__bithesis_left_seq + \__bithesis_get_max_text_width:NN \l__bithesis_cover_value_max_width_dim \l__bithesis_right_seq + } + + \group_begin: + \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_left_seq } + { + \seq_pop_left:NN \l__bithesis_left_seq \l__bithesis_tmpa_tl + \seq_pop_left:NN \l__bithesis_right_seq \l__bithesis_tmpb_tl + \tl_if_empty:eTF \l__bithesis_tmpb_tl {} { + \__bithesis_render_cover_entry:nn {\l__bithesis_tmpa_tl} {\l__bithesis_tmpb_tl} + } + } + \group_end: +} + +\DeclareDocumentCommand \BITSetup { m } + { \keys_set:nn { bitreport } { #1 }} +\DeclareDocumentCommand \MakeCover {} + { + \group_begin: + \int_case:nn {\g__bithesis_report_type_int} { + {1} { + \begin{titlepage} + \centering + \vspace{23mm} + \tl_if_empty:NF \l_bit_coverimagepath_tl { + \includegraphics[width=.5\textwidth]{\l_bit_coverimagepath_tl}\\ + } + \vspace{10mm} + \heiti\fontsize{24pt}{24pt}\selectfont{\l__bithesis_value_title_tl}\\ + \vspace{67mm} + \begin{spacing}{2.2} + \songti\zihao{3} + \clist_set:Nn \l__bithesis_input_clist { + {\textbf{学\qquad 院:}} {\l__bithesis_value_school_tl}, + {\textbf{专\qquad 业:}} {\l__bithesis_value_major_tl}, + {\textbf{班\qquad 级:}} {\l__bithesis_value_class_tl}, + {\textbf{学\qquad 号:}} {\l__bithesis_value_student_id_tl}, + {\textbf{姓\qquad 名:}} {\l__bithesis_value_author_tl}, + {\textbf{任课教师:}} {\l__bithesis_value_supervisor_tl}, + } + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{spacing} + \vspace*{\fill} + \centering + \songti\fontsize{12pt}{12pt}\selectfont{ + \tl_if_empty:NTF \l__bithesis_cover_date_tl { + \today + } { + \l__bithesis_cover_date_tl + } + } + \end{titlepage} + } + {2} { + % Main code for \MakeCover + \begin{titlepage} + \topskip=0pt + \vspace*{-16mm} + \centering + \hspace{-6mm}\songti\fontsize{22pt}{22pt}\selectfont{北京理工大学}\par + + \vspace{13mm} + + \hspace{-6mm}\heiti\fontsize{24pt}{24pt}\selectfont{本科生毕业设计(论文)开题报告}\par + + \vspace{53mm} + + \begin{spacing}{2.2} + \songti\zihao{3} + \clist_set:Nn \l__bithesis_input_clist { + {\textbf{学\qquad 院:}} {\l__bithesis_value_school_tl}, + {\textbf{专\qquad 业:}} {\l__bithesis_value_major_tl}, + {\textbf{班\qquad 级:}} {\l__bithesis_value_class_tl}, + {\textbf{姓\qquad 名:}} {\l__bithesis_value_author_tl}, + {\textbf{指导教师:}} {\l__bithesis_value_supervisor_tl}, + {\textbf{校外指导教师:}} {\l__bithesis_value_external_supervisor_tl}, + } + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{spacing} + + \vspace*{\fill} + + \centering + \hspace{-6mm}\songti\fontsize{12pt}{12pt}\selectfont{\today} + \end{titlepage} + } + } + \group_end: + } + +\DeclareDocumentCommand \MakeReviewTable {} + { + \group_begin: + \begin{titlepage} + \includepdf[pages=-]{\l_bit_reviewtable_tl} + \end{titlepage} + \group_end: + } + +\DeclareCaptionFont{kaiticaption}{\kaishu \normalsize} + +\renewcommand{\thefigure}{\thesection-\arabic{figure}} +\captionsetup[figure]{font=small,labelsep=space,skip=10bp,labelfont=bf,font=kaiticaption} + +\renewcommand{\thetable}{\thesection-\arabic{table}} +\captionsetup[table]{font=small,labelsep=space,skip=10bp,labelfont=bf,font=kaiticaption} + +\ctexset{today=big} + +\setromanfont{Times~New~Roman} + +%% 将中文楷体设置为 SIMKAI.TTF(如果需要) + +\setcounter{tocdepth}{3} +\setcounter{secnumdepth}{3} + +%% +\ctexset{section={ + format={\raggedright \bfseries \songti \zihao{-3}}, + beforeskip = 24bp plus 1ex minus .2ex, + afterskip = 24bp plus .2ex, + fixskip = true, + name = {,.\quad} + } +} +\ctexset{subsection={ + format = {\bfseries \songti \raggedright \zihao{4}}, + beforeskip = 24bp plus 1ex minus .2ex, + afterskip = 24bp plus .2ex, + fixskip = true, + } +} +\fancyhf{} +\int_case:nn {\g__bithesis_report_type_int} { + {1} {\fancyhead[R]{\fontsize{10.5pt}{10.5pt}\selectfont{\l__bithesis_value_title_tl}}} + {2} {\fancyhead[R]{\fontsize{10.5pt}{10.5pt}\selectfont{北京理工大学本科生毕业设计(论文)开题报告}}} +} +\fancyfoot[R]{\fontsize{9pt}{9pt}\selectfont{\thepage}} +\renewcommand{\headrulewidth}{1pt} +\renewcommand{\footrulewidth}{0pt} + +\pagestyle{fancy} +\setcounter{page}{1} + +\cs_set:Npn \baselinestretch {1.53} + +\endinput +%% +%% End of file `bitreport.cls'. diff --git a/templates/lab-report/main.tex b/templates/lab-report/main.tex index 8eee20ce..7d78b58d 100644 --- a/templates/lab-report/main.tex +++ b/templates/lab-report/main.tex @@ -1,5 +1,5 @@ %% -% The BIThesis Template for experiment report +% The BIThesis Template for Experiment Report % % Copyright 2020-2022 Silvester Wang, BITNP % @@ -16,12 +16,14 @@ % The Current Maintainer of this work is Feng Kaiyu. % % Compile with: xelatex -> biber -> xelatex -> xelatex +%% \documentclass[]{bitreport} % 将你的相关信息替换如下示例 \BITSetup{ cover = { + % 在封面中载入有「北京理工大学销毁」的图片,如无必要请勿改动。 imagePath = { assets/logo_bit.png }, %% 使用以下参数来自定义封面日期 % date = {2022年5月9日} @@ -42,13 +44,14 @@ %% 参考文献 \usepackage[style=gb7714-2015,backend=biber]{biblatex} -% used by figure. +% Required by `figure`. \usepackage{float,graphicx} \addbibresource{misc/refs.bib} \begin{document} +% 制作封面 \MakeCover \section{实验目的} diff --git a/templates/lab-report/misc/cover_v1.tex b/templates/lab-report/misc/cover_v1.tex deleted file mode 100644 index 41673993..00000000 --- a/templates/lab-report/misc/cover_v1.tex +++ /dev/null @@ -1,38 +0,0 @@ -\begin{titlepage} - \centering - - \vspace{23mm} - - \includegraphics[width=.5\textwidth]{assets/logo_bit.png} - - \vspace{10mm} - - \heiti\fontsize{24pt}{24pt}\selectfont{\reportName} - - \vspace{77mm} - - \begin{spacing}{2.2} - \songti\fontsize{16pt}{16pt}\selectfont{\textbf{学\hspace{11mm}院:}\underline{\makebox[51mm][c]{\deptName}}} - - \songti\fontsize{16pt}{16pt}\selectfont{\textbf{专\hspace{11mm}业:}\underline{\makebox[51mm][c]{\majorName}}} - - \songti\fontsize{16pt}{16pt}\selectfont{\textbf{班\hspace{11mm}级:}\underline{\makebox[51mm][c]{\className}}} - - \songti\fontsize{16pt}{16pt}\selectfont{\textbf{姓\hspace{11mm}名:}\underline{\makebox[51mm][c]{\yourName}}} - - \ifdefined\teacherName - \songti\fontsize{16pt}{16pt}\selectfont{\textbf{任课教师:}\underline{\makebox[51mm][c]{\teacherName}}} - \fi - \end{spacing} - - \vspace*{\fill} - - \centering - \songti\fontsize{12pt}{12pt}\selectfont{ - \ifdefined\coverDate - \coverDate - \else - \today - \fi - } -\end{titlepage} diff --git a/templates/paper-translation/README.md b/templates/paper-translation/README.md index 71ca4d1b..cf2c81c2 100644 --- a/templates/paper-translation/README.md +++ b/templates/paper-translation/README.md @@ -27,6 +27,12 @@ ## 编译方式 +方式一(推荐): +``` +latexmk +``` + +方式二: ``` -> xelatex -> biber diff --git a/templates/paper-translation/bithesis.cls b/templates/paper-translation/bithesis.cls new file mode 100644 index 00000000..e2155b36 --- /dev/null +++ b/templates/paper-translation/bithesis.cls @@ -0,0 +1,1589 @@ +%% +%% This is file `bithesis.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% bithesis.dtx (with options: `cls,thesis') +%% +%% Copyright (C) 2022 +%% Association of Bit Network Pioneer and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2020/11/27 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Feng Kaiyu. +%% ------------------------------------------------------------------------------ +%% +\RequirePackage{expl3,l3keys2e} +\ProvidesExplClass{bithesis} +{2022-06-10}{3.0.0}{BIT Thesis Templates} +%%%% TODO: + + +\int_new:N \g__bithesis_thesis_type_int +\int_new:N \g__bithesis_head_zihao_int +\bool_new:N \g__bithesis_twoside_bool +\bool_new:N \g__bithesis_thesis_type_english_bool +\bool_new:N \g__bithesis_blind_mode_bool +\tl_new:N \g__bithesis_label_devide_char_tl + +\seq_new:N \l__bithesis_right_seq +\seq_new:N \l__bithesis_left_seq + + +\cs_generate_variant:Nn \tl_if_empty:nTF {e} +\cs_generate_variant:Nn \seq_set_split:Nnn {Nne} + +\cs_new:Npn \__bithesis_same_page: { + \let\clearpage\relax + \let\cleardoublepage\relax +} + +\cs_new:Npn \__bithesis_if_graduate:TF #1#2 { + \int_compare:nNnTF {3} < {\g__bithesis_thesis_type_int} + {#1} + {#2} + } + +\cs_new:Npn \__bithesis_if_thesis_int_type:nTF #1#2#3 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {#1} {#2} {#3}} +\cs_new:Npn \__bithesis_if_thesis_int_type:nT #1#2 {\__bithesis_if_thesis_int_type:nTF {#1} {#2} {}} + +\cs_new:Npn \__bithesis_if_thesis_english:TF #1#2 {\bool_if:nTF {\g__bithesis_thesis_type_english_bool} {#1} {#2}} +\cs_new:Npn \__bithesis_if_thesis_english:T #1 {\__bithesis_if_thesis_english:TF {#1}{}} + +\cs_new:Npn \__bithesis_if_bachelor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} < {4} {#1} {#2}} +\cs_new:Npn \__bithesis_if_bachelor_thesis:T #1 {\__bithesis_if_bachelor_thesis:TF {#1} {}} +\cs_new:Npn \__bithesis_if_master_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {4} {#1} {#2}} +\cs_new:Npn \__bithesis_if_doctor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {5} {#1} {#2}} + +\clist_const:Nn \c__bithesis_thesis_type_clist + { bachelor, bachelor_translation, bachelor_english, master, docter} + +\cs_new_protected:Npn \__bithesis_define_label:nn #1#2 + { \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} } + +\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnn #1#2#3 + { + \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} + } + +\cs_new_protected:Npn \__bithesis_define_label:nnn #1#2#3 + { + \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} + \tl_const:cn { c__bithesis_label_ #1 _en_tl } {#3} + } + +\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnnn #1#2#3#4 + { + \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} + \tl_const:cn { c__bithesis_ #1 _label_ #2 _en_tl } {#4} + } + +\clist_map_inline:nn + { + {code} {代码}, + {udc} {UDC分类号:}, + {classification} {中国分类号:}, + {classified_level} {密级}, + {type} {种类}, + } + {\__bithesis_define_label:nn #1} + +\clist_map_inline:nn + { + {title} {本科生毕业设计(论文)}, + {originality} {原创性声明}, + {originality_clause} {本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,本文不包含任何其他个人或集体已经发表或撰写过的研究成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par~特此申明。}, + {authorization} {关于使用授权的声明}, + {authorization_clause} {本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,其中包括:\circled{1}~学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;\circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);\circled{3}~学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}~学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);\circled{5}~学校可以公布本毕业设计(论文)的全部或部分内容。}, + {originality_author_signature} {本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, + {originality_supervisor_signature} {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, + } {\__bithesis_define_label_by_thesis_type:nnn {bachelor} #1} + +\clist_map_inline:nn + { + {title} {}, + {originality} {原创性声明~Statement~of~Originality}, + {originality_clause} { + 本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,本文不包含任何其他个人或集体已经发表或撰写过的研究成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。特此申明。\par + \arialfamily I,\dunderline[-1pt]{1pt}{\makebox[18mm]{}},~solemnly~ + declare:~the~submitted~graduation~design~(thesis),~is~the~research~achievement~completed~independently~by~myself~ + under~the~guidance~of~the~supervisor.~This~article~does~not~contain~ + any~research~published~or~written~by~any~other~individual~or~group,~ + except~as~already~referenced~in~this~paper.~Individuals~and~groups~ + that~have~made~important~contributions~to~the~study~of~this~paper~ + are~clearly~indicated~and~cited~in~the~paper.\par + }, + {authorization} {关于使用授权的声明~State~of~Use~Authorization}, + {authorization_clause} { + 本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,其中包括:\circled{1}学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;\circled{2}学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);\circled{3}学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);\circled{5}学校可以公布本毕业设计(论文)的全部或部分内容。\par + I~fully~understand~the~regulations~on~the~storage,~use~of~graduation~design~(thesis)~in~Beijing~Institute~of~Technology.~Beijing~Institute~of~Technology~has~the~right~to~(1)~keep,~and~to~the~relevant~departments~to~send~the~original~or~copy~of~this~graduation~design~(thesis);~(2)~copy~and~preserve~this~graduation~design~(thesis)~by~photocopying,~miniature~or~other~means~of~reproduction;~(3)~allow~this~graduation~design~(thesis)~to~be~read~or~borrowed;~(4)~for~the~purpose~of~academic~exchange,~copy,~give~and~exchange~this~graduation~design~(thesis);~(5)~publish~all~or~part~of~the~contents~of~this~graduation~design~(thesis).~ + }, + } {\__bithesis_define_label_by_thesis_type:nnn {bachelor_english} #1} + +\cs_new:Npn \smallgap: { + \hspace{0.45ex} +} + +\cs_new:Npn \label_space: { + \__bithesis_if_bachelor_thesis:T { + \quad + } +} + +\clist_map_inline:nn + { + {originality} {研究成果声明}, + {originality_clause} {本人郑重声明:所提交的学位论文是我本人在指导教师的指导下进行的研究工作获得的研究成果。尽我所知,文中除特别标注和致谢的地方外,学位论文中不包含其他人已经发表或撰写过的研究成果,也不包含为获得北京理工大学或其它教育机构的学位或证书所使用过的材料。与我一同工作的合作者对此研究工作所做的任何贡献均已在学位论文中作了明确的说明并表示了谢意。\par~特此申明。}, + {authorization} {关于学位论文使用权的说明}, + {authorization_clause} {本人完全了解北京理工大学有关保管、使用学位论文的规定,其中包括:\circled{1}~学校有权保管、并向有关部门送交学位论文的原件与复印件;\circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存学位论文;\circled{3}~学校可允许学位论文被查阅或借阅;\circled{4}~学校可以学术交流为目的,复制赠送和交换学位论文;\circled{5}~学校可以公布学位论文的全部或部分内容(保密学位论文在解密后遵守此规定)。}, + {originality_author_signature} {签\qquad 名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, + {originality_supervisor_signature} {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, + } {\__bithesis_define_label_by_thesis_type:nnn {graduate} #1} + +\clist_map_inline:nn + { + {author} {作\quad 者\quad 姓\quad 名} {Candiate~Name}, + {school} {学\quad 院\quad 名\quad 称} {School~or~Department}, + {supervisor} {指\quad 导\quad 教\quad 师} {Faculty~Mentor}, + {chairman} {答辩委员会主席} {Chair,~Thesis~Committee}, + {degree} {申\smallgap: 请\smallgap: 学\smallgap: 位\smallgap: 级\smallgap: 别} {Degree~Applied}, + {major} {学\quad 科\quad 专\quad 业} {Major}, + {institute} {学\smallgap: 位\smallgap: 授\smallgap: 予\smallgap: 单\smallgap: 位} {Degree~by}, + {defense_date} {论\smallgap: 文\smallgap: 答\smallgap: 辩\smallgap: 日\smallgap: 期} {The~Date~of~Defence}, + } {\__bithesis_define_label_by_thesis_type:nnnn {graduate} #1} + +\clist_map_inline:nn + { + {school} {学\qquad 院} {School}, + {major} {专\qquad 业} {Degree}, + {author} {学生姓名} {Author}, + {student_id} {学\qquad 号} {Student~ID}, + {supervisor} {指导教师} {Supervisor}, + {co_supervisor} {校外指导教师} {Co-Supervisor}, + {keywords} {关键词:} {Key~Words:~}, + {toc} {目\label_space: 录} {Table~of~Contents}, + {abstract} {摘\label_space: 要} {Abstract}, + {conclusion} {结\label_space: 论} {Conclusions}, + {appendix} {附\label_space: 录} {Appendices}, + {ack} {致\label_space: 谢} {Acknowledgement}, + {figure} {插\quad 图} {Illustrations}, + {table} {表\quad 格} {Tables}, + {appendix_prefix} {附录} {Appendix}, + {reference} {参考文献} {References}, + {university} {北京理工大学} {Beijing~Institute~of~Technology}, + {publications} {攻读学位期间发表论文与研究成果清单} {Publications~During~Studies}, + % TODO: Not so sure about the translation. + {resume} {作者简介} {}, + {symbols} {主要符号对照表} {}, + } + {\__bithesis_define_label:nnn #1} + +\clist_const:Nn \c__bithesis_bachelor_thesis_header_clist + {北京理工大学本科生毕业设计(论文), 北京理工大学本科生毕业设计(论文)外文翻译, Beijing~Institute~of~Technology~Bachelor's~Thesis } +\clist_const:Nn \c__bithesis_bachelor_thesis_cover_title_clist + { + 本科生毕业设计(论文), + 本科生毕业设计(论文)外文翻译, + Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis, + } + +\keys_define:nn { bithesis } +{ + info .meta:nn = { bithesis / info } {#1}, + misc .meta:nn = { bithesis / misc } {#1}, + cover .meta:nn = { bithesis / cover } {#1}, + style .meta:nn = { bithesis / style } {#1}, + option .meta:nn = { bithesis / option } {#1}, +} + +\keys_define:nn { bithesis / option } +{ + type .choice:, + type .value_required:n = true, + type .choices:Vn = + \c__bithesis_thesis_type_clist + { + \int_set_eq:NN \g__bithesis_thesis_type_int \l_keys_choice_int + \int_case:nn {\l_keys_choice_int} { + % 本科全英文也是英文模板。 + {3} {\bool_set_true:N \g__bithesis_thesis_type_english_bool} + } + }, + type .initial:n = bachelor, + twoside .bool_gset:N = \g__bithesis_twoside_bool, + blindPeerReview .bool_gset:N = \g__bithesis_blind_mode_bool, +} + +\keys_define:nn { bithesis / cover } + { + date .tl_set:N = \l__bithesis_cover_date_tl, + headerImage .tl_set:N = \l_bit_coverheaderimage_tl, + xiheiFont .tl_set:N = \l__bithesis_cover_xihei_font_path_tl, + xiheiFont .default:n = {STXihei}, + %% cover entry + dilimiter .tl_set:N = \l__bithesis_cover_dilimiter_tl, + labelAlign .tl_set:N = \l__bithesis_cover_label_align_tl, + labelAlign .initial:n = {r}, + valueAlign .tl_set:N = \l__bithesis_cover_value_align_tl, + valueAlign .initial:n = {c}, + labelMaxWidth .dim_set:N = \l__bithesis_cover_label_max_width_dim, + valueMaxWidth .dim_set:N = \l__bithesis_cover_value_max_width_dim, + autoWidth .bool_set:N = \l__bithesis_cover_auto_width_bool, + autoWidth .initial:n = {true}, + underlineThickness .dim_set:N = \l__bithesis_cover_underline_thickness_dim, + underlineThickness .initial:n = {1pt}, + underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, + underlineOffset .initial:n = { -10pt }, + } + +\keys_define:nn { bithesis / info } + { + title .tl_set:N = \l__bithesis_value_title_tl, + titleEn .tl_set:N = \l__bithesis_value_title_en_tl, + school .tl_set:N = \l__bithesis_value_school_tl, + major .tl_set:N = \l__bithesis_value_major_tl, + author .tl_set:N = \l__bithesis_value_author_tl, + studentId .tl_set:N = \l__bithesis_value_student_id_tl, + supervisor .tl_set:N = \l__bithesis_value_supervisor_tl, + externalSupervisor .tl_set:N = \l__bithesis_value_external_supervisor_tl, + keywords .tl_set:N = \l__bithesis_value_keywords_tl, + keywordsEn .tl_set:N = \l__bithesis_value_keywords_en_tl, + translationTitle .tl_set:N = \l__bithesis_value_trans_title_tl, + translationOriginTitle .tl_set:N = \l__bithesis_value_trans_origin_title_tl, + % 中国分类号,研究生学位论文使用 + classification .tl_set:N = \l__bithesis_value_classification_tl, + % UDC 分类号,研究生学位论文使用 + UDC .tl_set:N = \l__bithesis_value_udc_tl, + chairman .tl_set:N = \l__bithesis_value_chairman_tl, + degree .tl_set:N = \l__bithesis_value_degree_tl, + degreeEn .tl_set:N = \l__bithesis_value_degree_en_tl, + institute .tl_set:N = \l__bithesis_value_institute_tl, + institute .initial:n = {\c__bithesis_label_university_tl}, + defenseDate .tl_set:N = \l__bithesis_value_defense_date_tl, + authorEn .tl_set:N = \l__bithesis_value_author_en_tl, + schoolEn .tl_set:N = \l__bithesis_value_school_en_tl, + supervisorEn .tl_set:N = \l__bithesis_value_supervisor_en_tl, + chairmanEn .tl_set:N = \l__bithesis_value_chairman_en_tl, + majorEn .tl_set:N = \l__bithesis_value_major_en_tl, + instituteEn .tl_set:N = \l__bithesis_value_institute_en_tl, + instituteEn .initial:n = {\c__bithesis_label_university_en_tl}, + defenseDateEn .tl_set:N = \l__bithesis_value_defense_date_en_tl, + classifiedLevel .tl_set:N = \l__bithesis_value_classified_level_tl, + } + +\keys_define:nn { bithesis / misc } + { + arialFont .tl_set:N = \l__bithesis_misc_arial_font_path_tl, + } + +\keys_define:nn { bithesis / style } +{ + head .tl_set:N = \l__bithesis_style_head_tl, + head .initial:n = { + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} {北京理工大学本科生毕业设计(论文)} + {2} {北京理工大学本科生毕业设计(论文)外文翻译} + {3} {Beijing~Institute~of~Technology~Bachelor's~Thesis} + {4} {北京理工大学硕士学位论文} + {5} {北京理工大学博士学位论文} + } + } +} + +\ProcessKeysOptions { bithesis / option } + +\__bithesis_if_thesis_english:T { + \PassOptionsToClass{scheme=plain}{ctexbook} +} + +\bool_if:NTF \g__bithesis_twoside_bool {} { + \PassOptionsToClass{oneside,openany}{ctexbook} +} + +\DeclareOption*{ + \PassOptionsToClass{\CurrentOption}{ctexbook} +} +\ProcessOptions\relax +\LoadClass[zihao=-4,]{ctexbook} + +\RequirePackage{geometry} +\RequirePackage{xeCJK} +\RequirePackage{titletoc} +\RequirePackage{setspace} +\RequirePackage{graphicx} +\RequirePackage{fancyhdr} +\RequirePackage{pdfpages} +\RequirePackage{setspace} +\RequirePackage{booktabs} +\RequirePackage{multirow} +\RequirePackage{tikz} +\RequirePackage{etoolbox} +\RequirePackage{hyperref} +\RequirePackage{xcolor} +\RequirePackage{caption} +\RequirePackage{array} +\RequirePackage{amsmath} +\RequirePackage{amssymb} +\RequirePackage{pdfpages} +\RequirePackage{listings} +\RequirePackage{enumitem} +\RequirePackage{environ} + +\__bithesis_if_graduate:TF { + \int_set:Nn \g__bithesis_head_zihao_int {5} + \geometry{ + a4paper, + left=2.7cm, + bottom=2.5cm + 7bp, + top=3.5cm + 7bp, + right=2.7cm, + headsep = 3.5cm + 7bp - 2.5cm - 15bp, + headheight = 15 bp, + footskip = 2.5cm + 7bp - 1.8cm, + } +} { + \int_set:Nn \g__bithesis_head_zihao_int {4} + \geometry{ + a4paper, + left=3cm, + bottom=2.6cm + 7bp, + top=3.5cm + 7bp, + right=2.6cm, + headsep = 3.5cm + 7bp - 2.4cm - 20bp, + headheight = 20 bp, + footskip = 2.6cm + 7bp - 2cm, + } +} + +\setlength{\intextsep}{2\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} + +\setromanfont{Times~New~Roman} + +\ctex_at_end_preamble:n { + \__bithesis_if_thesis_english:TF { + \__bithesis_if_thesis_int_type:nT {3} { + % font Arial needed + \newfontfamily\arialfamily{Arial} + } + + } { + \tl_if_blank:VTF \l__bithesis_cover_xihei_font_path_tl {} + { + \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]{\l__bithesis_cover_xihei_font_path_tl} + } + } + + \__bithesis_if_thesis_int_type:nT {3} { + \RequirePackage[en-US]{datetime2} + \RequirePackage{indentfirst} + \DTMlangsetup[en-US]{dayyearsep={\space}} + } + + % Define biblatex category if it was imported. + \cs_if_exist:NT \DeclareBibliographyCategory { + \DeclareBibliographyCategory{mypub} + } +} + +\cs_new:Npn \xihei:n #1 { + \xeCJK_family_if_exist:nTF {xihei} { + \CJKfamily{xihei} #1 + }{ + \heiti #1 + } +} + +\cs_new:Npn \l__bithesis_title_font_cs:n #1 { + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \arialfamily #1 + } { + \heiti #1 + } +} + +\cs_new:Npn \l__bithesis_unnumchapter_style_cs:n #1 { + % 本科全英文、研究生学位论文需要加粗 + \int_compare:nNnTF {\g__bithesis_thesis_type_int} > {2} + { + \bfseries #1 + } { + \mdseries #1 + } +} + +\cs_set:Npn \arabicHeiti #1 {#1} + +\fancypagestyle{BIThesis}{ + \fancyhf{} + % 定义页眉、页码 + \fancyhead[C]{\zihao{\int_use:N \g__bithesis_head_zihao_int}\ziju{0.08}\songti{\tl_use:N \l__bithesis_style_head_tl}} + \fancyfoot[C]{\songti\zihao{5} \thepage} + % 页眉分割线稍微粗一些 + \RenewDocumentCommand \headrulewidth {} {0.6pt} +} + +\ctexset{chapter={ + number = {\arabicHeiti{ \arabic{chapter} }}, + format = { \l__bithesis_title_font_cs:n \bfseries \centering \zihao{3}}, + nameformat = {}, + titleformat = {}, + aftername = \hspace{9bp}, + pagestyle = BIThesis, + beforeskip = 8bp, + afterskip = 32bp, + fixskip = true, + } +} + +\ctexset{section={ + number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}}}, + format = {\l__bithesis_title_font_cs:n \raggedright \bfseries \zihao{4}}, + nameformat = {}, + titleformat = {}, + aftername = \hspace{8bp}, + beforeskip = 20bp plus 1ex minus .2ex, + afterskip = 18bp plus .2ex, + fixskip = true, + } +} + +\ctexset{subsection={ + number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}}}, + format = {\l__bithesis_title_font_cs:n \bfseries \raggedright \zihao{-4}}, + nameformat = {}, + titleformat = {}, + aftername = \hspace{7bp}, + beforeskip = 17bp plus 1ex minus .2ex, + afterskip = 14bp plus .2ex, + fixskip = true, + } +} + +\ctexset{ + secnumdepth = 3, + subsubsection={ + numbering = true, + number = {\arabicHeiti{\arabic{chapter}.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}.\hspace{1bp}\arabic{subsubsection}}}, + format={\l__bithesis_title_font_cs:n \bfseries \raggedright \zihao{-4}}, + nameformat = {}, + titleformat = {}, + beforeskip=28bp plus 1ex minus .2ex, + afterskip=24bp plus .2ex, + fixskip=true, + } +} + +\addtocontents{toc}{\protect\hypersetup{hidelinks}} + + +\__bithesis_if_graduate:TF { + % 各章标题,宋体四号 + \titlecontents{chapter}[0pt]{\songti \zihao{4}} + {\thecontentslabel\hspace{\ccwd}}{} + {\hspace{.5em}\titlerule*{.}\contentspage} +} { + \titlecontents{chapter}[0pt]{\songti \zihao{-4}} + {\thecontentslabel\hspace{\ccwd}}{} + {\hspace{.5em}\titlerule*{.}\contentspage} +} +\titlecontents{section}[1\ccwd]{\songti \zihao{-4}} +{\thecontentslabel\hspace{\ccwd}}{} +{\hspace{.5em}\titlerule*{.}\contentspage} +\titlecontents{subsection}[2\ccwd]{\songti \zihao{-4}} +{\thecontentslabel\hspace{\ccwd}}{} +{\hspace{.5em}\titlerule*{.}\contentspage} + +\bool_new:N \l__bithesis_add_to_toc_bool +\bool_set_true:N \l__bithesis_add_to_toc_bool + +\keys_define:nn { bit } + { + abstract .meta:nn = { bit / abstract } {#1}, + abstract_en .meta:nn = { bit / abstract_en } {#1}, + } + +\keys_define:nn { bit / abstract } + { + addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, + } + +\keys_define:nn { bit / abstract_en } + { + addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, + } + +\keys_define:nn { bit / symbols } + { + addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, + } + +\RenewDocumentCommand \frontmatter {} { + + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \pagenumbering{roman} + } { + \pagenumbering{Roman} + } + \ctexset{ + chapter = { + numbering = false, + } + } + \pagestyle{BIThesis} +} + +\RenewDocumentCommand \mainmatter {} { + \cleardoublepage + + \ctexset{ + chapter = { + numbering = true, + } + } + \pagenumbering{arabic} + \pagestyle{BIThesis} + % 正文 22 磅的行距 + \setlength{\parskip}{0em} + \setstretch{1.53} + % 修复脚注出现跨页的问题 + \interfootnotelinepenalty=10000 +} + +\RenewDocumentCommand \backmatter {} { + \setcounter{section}{0} + \setcounter{subsection}{0} + \setcounter{subsubsection}{0} + \ctexset{ + chapter = { + numbering = false, + beforeskip = 18bp, + format = {\l__bithesis_title_font_cs:n \l__bithesis_unnumchapter_style_cs:n \centering \zihao{3}}, + afterskip = 26bp, + } + } +} + +\setlength{\abovecaptionskip}{11pt} +\setlength{\belowcaptionskip}{9pt} + +\__bithesis_if_graduate:TF { + \tl_set:Nn \g__bithesis_label_devide_char_tl {.} +} { + \tl_set:Nn \g__bithesis_label_devide_char_tl {-} +} + +\cs_set:Npn \thefigure {\thechapter\g__bithesis_label_devide_char_tl\arabic{figure}} +\captionsetup[figure]{font=small,labelsep=space} + +\cs_set:Npn \thetable {\thechapter\g__bithesis_label_devide_char_tl\arabic{table}} +\captionsetup[table]{font=small,labelsep=space,skip=2pt} + +\cs_set:Npn \theequation {\thechapter\g__bithesis_label_devide_char_tl\arabic{equation}} + +\cs_set:Npn \thelstlisting {\thechapter\g__bithesis_label_devide_char_tl\arabic{lstlisting}} +\cs_set:Npn \lstlistingname {\c__bithesis_label_code_tl} + +\tolerance=1 +\emergencystretch=\maxdimen +\hyphenpenalty=10000 +\hbadness=10000 + +\definecolor{codegreen}{rgb}{0,0.6,0} +\definecolor{codegray}{rgb}{0.5,0.5,0.5} +\definecolor{codepurple}{rgb}{0.58,0,0.82} +\definecolor{backcolour}{rgb}{0.95,0.95,0.92} +\lstdefinestyle{examplestyle}{ + backgroundcolor=\color{backcolour}, + commentstyle=\color{codegreen}, + keywordstyle=\color{magenta}, + numberstyle=\tiny\color{codegray}, + stringstyle=\color{codepurple}, + basicstyle=\ttfamily\footnotesize, + breakatwhitespace=false, + breaklines=true, + captionpos=b, + keepspaces=true, + numbers=left, + numbersep=5pt, + showspaces=false, + showstringspaces=false, + showtabs=false, + tabsize=2 +} +\lstset{style=examplestyle} + +\cs_set:Npn \listfigurename {\c__bithesis_label_figure_tl} +\cs_set:Npn \listtablename {\c__bithesis_label_table_tl} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\DeclareDocumentCommand \BITSetup { m } + { \keys_set:nn { bithesis } { #1 }} + +\cs_new:Npn \__bithesis_render_cover_entry:nn #1#2 { + \makebox[\l__bithesis_cover_label_max_width_dim][\l__bithesis_cover_label_align_tl]{ + \tl_if_blank:VTF #1 {} {#1\l__bithesis_cover_dilimiter_tl} + } + \hspace{1ex} + \__bithesis_dunderline:nnn{\l__bithesis_cover_underline_offset_dim}{\l__bithesis_cover_underline_thickness_dim}{ + \makebox[\l__bithesis_cover_value_max_width_dim][\l__bithesis_cover_value_align_tl]{#2} + }\par +} + +\cs_new:Npn \__bithesis_get_text_width:Nn #1#2 + { + \hbox_set:Nn \l_tmpa_box {#2} + \dim_set:Nn #1 { \box_wd:N \l_tmpa_box } + } +\cs_generate_variant:Nn \__bithesis_get_text_width:Nn { NV } + +\cs_new:Npn \__bithesis_get_max_text_width:NN #1#2 + { + \group_begin: + \seq_set_eq:NN \l__bithesis_tmpa_seq #2 + \dim_zero_new:N \l__bithesis_tmpa_dim + \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_tmpa_seq } + { + \seq_pop_left:NN \l__bithesis_tmpa_seq \l__bithesis_tmpa_tl + \__bithesis_get_text_width:NV \l__bithesis_tmpa_dim \l__bithesis_tmpa_tl + \dim_gset:Nn #1 { \dim_max:nn {#1} { \l__bithesis_tmpa_dim } } + } + \group_end: + } + +\cs_new:Npn \__bithesis_parse_entry #1 #2 { + \seq_set_split:Nne \l__bithesis_tmp_right_seq {//} {#2} + \seq_clear:N \l__bithesis_tmp_left_seq + \seq_map_inline:Nn \l__bithesis_tmp_right_seq { + \seq_put_right:Nn \l__bithesis_tmp_left_seq {} + } + \seq_put_left:Nn \l__bithesis_tmp_left_seq {#1} + \seq_pop_right:NN \l__bithesis_tmp_left_seq \g__bithesis_trashcan_tl +} + +\cs_new:Npn \__bithesis_render_cover_entry:n #1 { + \seq_set_from_clist:NN \l__bithesis_input_seq #1 + % parse newline // + \seq_map_inline:Nn \l__bithesis_input_seq { + \__bithesis_parse_entry ##1 + \seq_concat:NNN \l__bithesis_right_seq \l__bithesis_right_seq \l__bithesis_tmp_right_seq + \seq_concat:NNN \l__bithesis_left_seq \l__bithesis_left_seq \l__bithesis_tmp_left_seq + } + + \bool_if:NT \l__bithesis_cover_auto_width_bool { + \__bithesis_get_max_text_width:NN \l__bithesis_cover_label_max_width_dim \l__bithesis_left_seq + \__bithesis_get_max_text_width:NN \l__bithesis_cover_value_max_width_dim \l__bithesis_right_seq + } + + \group_begin: + \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_left_seq } + { + \seq_pop_left:NN \l__bithesis_left_seq \l__bithesis_tmpa_tl + \seq_pop_left:NN \l__bithesis_right_seq \l__bithesis_tmpb_tl + \tl_if_empty:eTF \l__bithesis_tmpb_tl {} { + \__bithesis_render_cover_entry:nn {\l__bithesis_tmpa_tl} {\l__bithesis_tmpb_tl} + } + } + \group_end: +} + +\cs_new:Npn \__bithesis_dunderline:nnn #1#2#3 { + {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}} +} + +\cs_new:Npn \__bithesis_dunderline:nn #1#2 { + \__bithesis_dunderline:nnn {#1} {1pt} {#2} +} + +\cs_new:Npn \__bithesis_dunderline:n #1 { + \__bithesis_dunderline:nnn {-10pt} {1pt} {#1} +} + +\newcommand\dunderline[3][-1pt]{{% + \setbox0=\hbox{#3} + \ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}} + +\NewEnviron{blindPeerReview}{ + \bool_if:NTF \g__bithesis_blind_mode_bool {} { + \BODY + } +} + +\RenewDocumentCommand \cleardoublepage { } + { + \clearpage + \bool_if:NT \g__bithesis_twoside_bool + { + \int_if_odd:nF \c@page + { \hbox:n { } \thispagestyle { empty } \newpage } + } + } + +\cs_new:Npn \make_graduate_cover: { + \cleardoublepage + \begin{titlepage} + { + \heiti\zihao{5} + \tl_if_blank:VTF \l__bithesis_value_classified_level_tl {} { + \flushright + \c__bithesis_label_classified_level_tl:~ + \l__bithesis_value_classified_level_tl \par + } + } + \centering + \vspace*{65mm} + {\heiti\zihao{-2} \l__bithesis_value_title_tl} + \vskip 60mm + {\heiti \zihao{-3} \l__bithesis_value_author_tl} % 黑体 小三 + \vskip 10mm + {\heiti \zihao{-3} \l__bithesis_cover_date_tl} % 黑体 小三 + \end{titlepage} +} + +\cs_new:Npn \make_paper_back: { + \cleardoublepage + \begin{titlepage} + \vskip 5cm + \begin{center} + \setstretch{1.1} + \begin{minipage}[t][19.7cm]{2em} + \begin{center} + {\heiti\zihao{3}\l__bithesis_value_title_tl} + \vfill + {\heiti\zihao{3}\l__bithesis_value_author_tl} + \vfill + {\heiti\zihao{3}\c__bithesis_label_university_tl} + \end{center} + \end{minipage} + \end{center} + % \vskip 5cm + \end{titlepage} +} + +\cs_new:Npn \__bithesis_make_chinese_title_page: { + \cleardoublepage + \begin{titlepage} + { % + {\heiti \zihao{5} \noindent \c__bithesis_label_classification_tl} \l__bithesis_value_classification_tl\\ + {\heiti \zihao{5} \c__bithesis_label_udc_tl} \l__bithesis_value_udc_tl + } + \begin{center} + + \vskip \stretch{1} + {\heiti\zihao{-2} \l__bithesis_value_title_tl} + \vskip \stretch{1} + + % TODO: delete this? + {\fangsong\zihao{4}} + \def\tabcolsep{1pt} + \def\arraystretch{1.5} + + { + \renewcommand{\baselinestretch}{2} + + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\qquad} + } + \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {45mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {60mm} + } + } + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_graduate_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_graduate_label_school_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_graduate_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_graduate_label_chairman_tl} {\l__bithesis_value_chairman_tl}, + {\c__bithesis_graduate_label_degree_tl} {\l__bithesis_value_degree_tl}, + {\c__bithesis_graduate_label_major_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_graduate_label_institute_tl} {\l__bithesis_value_institute_tl}, + {\c__bithesis_graduate_label_defense_date_tl} {\l__bithesis_value_defense_date_tl}, + } + + \heiti\zihao{-3} + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + } + \end{center} + \vskip \stretch{0.5} + \end{titlepage} +} + +\cs_new:Npn \__bithesis_make_english_title_page: { + \begin{titlepage} + \begin{center} + + \vspace*{10em} + {\zihao{-2}\textbf{\l__bithesis_value_title_en_tl}} + % \bfseries + \vskip \stretch{1} + + { + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:~} + } + + \tl_set:Nn \l__bithesis_cover_label_align_tl {l} + \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} + + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {55mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {85mm} + } + } + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_graduate_label_author_en_tl} {\l__bithesis_value_author_en_tl}, + {\c__bithesis_graduate_label_school_en_tl} {\l__bithesis_value_school_en_tl}, + {\c__bithesis_graduate_label_supervisor_en_tl} {\l__bithesis_value_supervisor_en_tl}, + {\c__bithesis_graduate_label_chairman_en_tl} {\l__bithesis_value_chairman_en_tl}, + {\c__bithesis_graduate_label_degree_en_tl} {\l__bithesis_value_degree_en_tl}, + {\c__bithesis_graduate_label_major_en_tl} {\l__bithesis_value_major_en_tl}, + {\c__bithesis_graduate_label_institute_en_tl} {\l__bithesis_value_institute_en_tl}, + {\c__bithesis_graduate_label_defense_date_en_tl} {\l__bithesis_value_defense_date_en_tl}, + } + + \zihao{-3} + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + } + + \end{center} + + \vskip \stretch{0.5} + \end{titlepage} +} + +\DeclareDocumentCommand \MakeCover {} + { + \begin{blindPeerReview} + \group_begin: + + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} + { + \begin{titlepage} + \vspace*{16mm} + + \centering + + \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { + \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ + } + + \vspace*{-3mm} + + \zihao{-0}\textbf{\ziju{0.12}\songti{\c__bithesis_bachelor_label_title_tl}}\par + + \vspace{16mm} + + \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par + + \vspace{3mm} + + \begin{spacing}{1.2} + \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par + \end{spacing} + + \vspace{15mm} + + \begin{spacing}{1.8} + \begin{center} + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} + } + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} + } + } + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + } + + \zihao{3} + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{center} + \end{spacing} + + \vspace*{\fill} + \centering + \zihao{3}\ziju{0.5}\songti{ + \tl_if_empty:NTF \l__bithesis_cover_date_tl { + \today + } { + \l__bithesis_cover_date_tl + } + } + \end{titlepage} + } + {2} + { + \begin{titlepage} + \centering + + \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { + \includegraphics[width=6.87cm]{\l_bit_coverheaderimage_tl}\\ + } + + \vspace{1mm} + + \zihao{2}\textbf{\songti{本科生毕业设计(论文)外文翻译}} + + \vspace{8mm} + + { + + \begin{spacing}{1.8} + + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\textbf{:}} + \bool_set_false:N \l__bithesis_cover_auto_width_bool + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {115mm} + + \clist_set:Nn \l__bithesis_input_clist { + {\zihao{4}\textbf{外文原文题目}} {\l__bithesis_value_trans_origin_title_tl}, + {\zihao{4}\textbf{中文翻译题目}} {\l__bithesis_value_trans_title_tl}, + } + + \zihao{-3} + \centering + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{spacing} + + } + + \vspace{14mm} + + \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par + + \vspace{3mm} + + \begin{spacing}{1.2} + \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par + \end{spacing} + + \vspace{19mm} + + \begin{spacing}{1.8} + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} + } + + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} + } + } + + \zihao{3} + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + } + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{spacing} + + \vspace*{\fill} + \end{titlepage} + } + {3} { + \begin{titlepage} + \vspace*{16mm} + + \centering + + \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { + \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ + } + + \vspace*{-3mm} + + \zihao{1}\textbf{\ziju{0.12}Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis}\par + + \vspace{18mm} + + \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_en_tl}\par + + \vspace{10mm} + + \begin{spacing}{1.8} + \begin{center} + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} + } + + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {20mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {105mm} + } + } + + \zihao{4} + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_label_school_en_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_label_major_en_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_label_author_en_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_en_tl} {\l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_en_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_en_tl} {\l__bithesis_value_external_supervisor_tl}, + } + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{center} + \end{spacing} + + \vspace*{\fill} + \centering + \zihao{3}\ziju{0.5}\songti{ + \tl_if_empty:NTF \l__bithesis_cover_date_tl { + \today + } { + \l__bithesis_cover_date_tl + } + } + \end{titlepage} + } + {4} { + \make_graduate_cover: + } + {5} { + \make_graduate_cover: + } + } + \group_end: + \end{blindPeerReview} + } + +\newcommand{\circled}[2][]{\tikz[baseline=(char.base)] + {\node[shape = circle, draw, inner~sep = 1pt] + (char) {\phantom{\ifblank{#1}{#2}{#1}}}; + \node at (char.center) {\makebox[0pt][c]{#2}};}} +\robustify{\circled} + +\cs_new:Npn \__bithesis_graduate_originality: { + \ctexset { + chapter / pagestyle = plain, + } + + \begin{titlepage} + \pagenumbering{gobble} + + % 原创性声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{3}\c__bithesis_graduate_label_originality_tl} + \end{center}~\par + + % 本部分字号为小三 + \zihao{4} + \c__bithesis_graduate_label_originality_clause_tl + + \vspace{17mm} + + \begin{flushright} + \c__bithesis_graduate_label_originality_author_signature_tl\par + \end{flushright} + + \vspace{16mm} + + % 使用授权声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{3}\c__bithesis_graduate_label_authorization_tl} + \end{center}~\par + + \c__bithesis_graduate_label_authorization_clause_tl + + \vspace*{15mm} + + \begin{flushright} + \begin{spacing}{1.65} + \zihao{4} + % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} + \c__bithesis_graduate_label_originality_author_signature_tl\par + \c__bithesis_graduate_label_originality_supervisor_signature_tl\par + \end{spacing} + \end{flushright} + \end{titlepage} + \cleardoublepage +} + +\NewDocumentCommand \MakeOriginality {} +{ + \group_begin: + \begin{blindPeerReview} + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} + { + \pagestyle{BIThesis} + \pagenumbering{gobble} + + % 原创性声明部分 + \begin{center} + \vspace*{-2bp} + \__bithesis_same_page: + \chapter*{\heiti\zihao{2}\c__bithesis_bachelor_label_originality_tl} + \end{center}~\par + + % 本部分字号为小三 + \zihao{-3} + \c__bithesis_bachelor_label_originality_clause_tl + + \vspace{17mm} + + \begin{flushright} + \c__bithesis_bachelor_label_originality_author_signature_tl\par + \end{flushright} + + \vspace{16mm} + + % 使用授权声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{2}\c__bithesis_bachelor_label_authorization_tl} + \end{center}~\par + + \c__bithesis_bachelor_label_authorization_clause_tl + + \vspace*{3mm} + + \begin{flushright} + \begin{spacing}{1.65} + \zihao{-3} + % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} + \c__bithesis_bachelor_label_originality_author_signature_tl\par + \c__bithesis_bachelor_label_originality_supervisor_signature_tl\par + \end{spacing} + \end{flushright} + + \newpage + } + {3} { + \setstretch{1.26} + % 原创性声明部分 + \begin{center} + \vspace*{-2bp} + \__bithesis_same_page: + \chapter*{\heiti\zihao{-2}\c__bithesis_bachelor_english_label_originality_tl} + \end{center}~\par + + % 本部分字号为小三 + \zihao{-4} + \c__bithesis_bachelor_english_label_originality_clause_tl + + \bigbreak + + Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~Date:\par + + \vspace{6mm} + + % 使用授权声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{-2}\c__bithesis_bachelor_english_label_authorization_tl} + \end{center}~\par + + \c__bithesis_bachelor_english_label_authorization_clause_tl + + \bigbreak + Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm + 16bp]{}}~\hspace{2mm}Date:\par + Supervisor~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~\hspace{2mm}Date:\par + } + {4} {\__bithesis_graduate_originality:} + {5} {\__bithesis_graduate_originality:} + } + \end{blindPeerReview} + \group_end: +} + +\NewDocumentCommand \MakePaperBack {} + { + \begin{blindPeerReview} + \make_paper_back: + \end{blindPeerReview} + } + +\NewDocumentCommand \MakeTitle {} + { + \begin{blindPeerReview} + \__bithesis_make_chinese_title_page: + \__bithesis_make_english_title_page: + \end{blindPeerReview} + } + +\DeclareDocumentCommand \MakeTOC {} + { + { + \__bithesis_if_bachelor_thesis:TF { + \renewcommand{\baselinestretch}{1.35} + } { + \renewcommand{\baselinestretch}{1.56} + } + + \__bithesis_if_thesis_english:TF { + \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_en_tl} + } { + \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_tl} + } + + % 自定义目录样式 + \cs_set:Npn \contentsname { + \fontsize{16pt}{\baselineskip} + \l__bithesis_unnumchapter_style_cs:n\l__bithesis_title_font_cs:n{\l__bithesis_toc_title_tl} + \vspace{-8pt} + } + + % 制作目录 + \tableofcontents + + % 在本科生全英文模板中,添加「目录」本身到目录中。 + \__bithesis_if_thesis_int_type:nT {3} { + \addcontentsline{toc}{chapter}{\c__bithesis_label_toc_en_tl} + } + } + } + + % TODO: + \NewDocumentEnvironment {abstract} {o} + { + + \IfValueT {#1} { + \keys_set:nn { bit / abstract } {#1} + } + + \cleardoublepage + \setstretch{1.53} + + \__bithesis_if_bachelor_thesis:T { + \begin{center} + \vspace*{-17bp} + \heiti\zihao{-2}\textbf{ + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} {\l__bithesis_value_title_tl} + {2} {\l__bithesis_value_trans_title_tl} + {3} {\l__bithesis_value_title_tl} + } + } + \end{center} + + \vspace*{2mm} + } + + \ctexset{ + chapter/numbering = false, + } + + \__bithesis_if_bachelor_thesis:T { + \ctexset{ + chapter/titleformat = {\textmd} + } + } + + { + \__bithesis_same_page: + \bool_if:NTF \l__bithesis_add_to_toc_bool { + \chapter{\c__bithesis_label_abstract_tl} + } { + \chapter*{\c__bithesis_label_abstract_tl} + } + } + \vspace*{1mm} + \par + } + { + \par + \vspace{4ex}\noindent\textbf{\heiti \c__bithesis_label_keywords_tl \l__bithesis_value_keywords_tl}\par + \newpage + } + + \NewDocumentEnvironment {abstractEn} {o} + { + \IfValueT {#1} { + \keys_set:nn { bit / abstract_en } {#1} + } + + \cleardoublepage + \setstretch{1.53} + + \__bithesis_if_bachelor_thesis:T { + \begin{spacing}{0.95} + \centering + \vspace*{-2bp} + + \__bithesis_if_thesis_int_type:nTF {3} { + \arialfamily\zihao{-2}\textbf\l__bithesis_value_title_en_tl\\ + } { + \heiti\zihao{3}\textbf\l__bithesis_value_title_en_tl\\ + } + \end{spacing} + \vspace*{10mm} + } + + \ctexset{ + chapter/numbering = false, + } + + \__bithesis_if_bachelor_thesis:TF { + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \ctexset{ + chapter = { + titleformat = {\heiti\zihao{3}\centering\textbf}, + } + } + } { + \ctexset{ + chapter = { + titleformat = {\heiti\zihao{-3}\centering\textmd}, + } + } + } + } { + \ctexset { + chapter/titleformat = {\heiti\zihao{3}\centering\textbf} + } + } + + { + \__bithesis_same_page: + \bool_if:nTF {\l__bithesis_add_to_toc_bool} { + \chapter{\c__bithesis_label_abstract_en_tl} + } { + \chapter*{\c__bithesis_label_abstract_en_tl} + } + } + } + { + \par\vspace{3ex}\noindent\textbf{\c__bithesis_label_keywords_en_tl \l__bithesis_value_keywords_en_tl} + \newpage + } + + \NewDocumentEnvironment {conclusion} {} + { + \ctexset{ + section/number = \arabic{section} + } + + \__bithesis_if_thesis_english:TF { + \chapter{\c__bithesis_label_conclusion_en_tl} + } { + \chapter{\c__bithesis_label_conclusion_tl} + } + } + {} + + \NewDocumentEnvironment {bibprint} {} + { + % 设置参考文献字号为 5 号 + \renewcommand*{\bibfont}{\zihao{5}} + % 设置参考文献各个项目之间的垂直距离为 0 + \setlength{\bibitemsep}{0ex} + \setlength{\bibnamesep}{0ex} + \setlength{\bibinitsep}{0ex} + \__bithesis_if_graduate:TF { + } { + % 「本科生」设置单倍行距 + \renewcommand{\baselinestretch}{1.2} + } + % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 + \setlength{\biblabelsep}{1.7mm} + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + \RenewDocumentCommand \itemcmd {} { + \addvspace{\bibitemsep} % 恢复 \bibitemsep 的作用 + \mkgbnumlabel{\printfield{labelnumber}} + \hspace{\biblabelsep} + } + \__bithesis_if_thesis_english:TF { + \chapter{\c__bithesis_label_reference_en_tl} + } { + \chapter{\c__bithesis_label_reference_tl} + } + } + {} + + % #1: The name that used as chapter title + % #2: The name that used in ToC. + \NewDocumentEnvironment {appendices} { oo } + { + % Used in chapter, ToC. + \tl_new:N \l__bithesis_appendix_plain_label_tl + % Used before reference label. + \tl_new:N \l__bithesis_appendix_title_tl + + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_en_tl} + \tl_set:Nn \l__bithesis_appendix_title_tl {\c__bithesis_label_appendix_en_tl} + } { + \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_tl} + \tl_set:Nn \l__bithesis_appendix_title_tl {\c__bithesis_label_appendix_tl} + } + + \ctexset{ + section/number = \l__bithesis_appendix_plain_label_tl\hspace{1ex}\Alph{section}, + subsection/number = \Alph{section}. \arabic{subsection}, + } + + \IfValueTF {#1} { + \chapter*{#1} + \stepcounter{chapter} + \IfValueTF {#2} { + \addcontentsline{toc}{chapter}{#2} + } { + \addcontentsline{toc}{chapter}{\l__bithesis_appendix_title_tl} + } + } { + \chapter{\l__bithesis_appendix_title_tl} + } + + \cs_set:Npn \thechapter { + \Alph{section} + } + } + {} + + \NewDocumentEnvironment {acknowledgements} {+b} + { + \begin{blindPeerReview} + \ctexset{ + section/number = \arabic{section}, + subsection/number = \arabic{section}. \arabic{subsection}, + } + + \__bithesis_if_thesis_english:TF { + \chapter{\c__bithesis_label_ack_en_tl} + } { + \chapter{\c__bithesis_label_ack_tl} + } + #1 + \end{blindPeerReview} + } {} + + \NewDocumentEnvironment {publications} {+b} + { + \begin{blindPeerReview} + % 设置参考文献字号为 5 号 + \renewcommand*{\bibfont}{\zihao{5}} + % 设置参考文献各个项目之间的垂直距离为 0 + \setlength{\bibitemsep}{0ex} + \setlength{\bibnamesep}{0ex} + \setlength{\bibinitsep}{0ex} + % 设置单倍行距 + \renewcommand{\baselinestretch}{1.2} + % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 + \setlength{\biblabelsep}{1.7mm} + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + \RenewDocumentCommand \itemcmd {} { + \addvspace{\bibitemsep} % 恢复 \bibitemsep 的作用 + \mkgbnumlabel{\printfield{labelnumber}} + \hspace{\biblabelsep} + } + + % ===== 上方定义与「参考文献」部分相同 + \cs_set:Npn \mkbibnamegiven ##1 { + \ifitemannotation{myself}{\textbf{##1}}{##1} + } + + \cs_set:Npn \mkbibnamefamily ##1 { + \ifitemannotation{myself}{\textbf{##1}}{##1} + } + + % Sorting by year, name, type. + \newrefcontext[sorting=ynt] + \chapter{\c__bithesis_label_publications_tl} + #1 + \end{blindPeerReview} + } + {} + + \NewDocumentEnvironment {resume} {+b} + { + \begin{blindPeerReview} + \chapter{\c__bithesis_label_resume_tl} + #1 + \end{blindPeerReview} + } + { + } + + \NewDocumentEnvironment {symbols} {o} + { + \IfValueT {#1} { + \keys_set:nn { bit / symbols } {#1} + } + + \bool_if:NTF \l__bithesis_add_to_toc_bool { + \chapter{\c__bithesis_label_symbols_tl} + } { + \chapter*{\c__bithesis_label_symbols_tl} + } + \zihao{-4} + \begin{itemize}[labelwidth=2.5cm,labelsep=0.5cm,leftmargin=3cm,itemindent=0cm,itemsep=0cm] + \cs_set:Npn \makelabel ##1 {##1\hfil} + } + { + \end{itemize} + } + + +\endinput +%% +%% End of file `bithesis.cls'. diff --git a/templates/paper-translation/chapters/0_abstract.tex b/templates/paper-translation/chapters/0_abstract.tex index 992b10ef..bf021333 100644 --- a/templates/paper-translation/chapters/0_abstract.tex +++ b/templates/paper-translation/chapters/0_abstract.tex @@ -1,7 +1,7 @@ %% -% The BIThesis Template for Bachelor Graduation Thesis +% The BIThesis Template for Bachelor Paper Translation % -% 北京理工大学毕业设计(论文)中英文摘要 —— 使用 XeLaTeX 编译 +% 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 % % Copyright 2020-2022 BITNP % @@ -16,8 +16,11 @@ % This work has the LPPL maintenance status `maintained'. % % The Current Maintainer of this work is Feng Kaiyu. +% +% Compile with: xelatex -> biber -> xelatex -> xelatex +%% -% 中英文摘要章节 +% 中文摘要 \begin{abstract} % 中文摘要正文从这里开始 本文……。 diff --git a/templates/paper-translation/chapters/1_chapter1.tex b/templates/paper-translation/chapters/1_chapter1.tex index d67217f0..6533363e 100644 --- a/templates/paper-translation/chapters/1_chapter1.tex +++ b/templates/paper-translation/chapters/1_chapter1.tex @@ -1,9 +1,9 @@ %% -% The BIThesis Template for Bachelor Graduation Thesis +% The BIThesis Template for Bachelor Paper Translation % -% 北京理工大学毕业设计(论文)第一章节 —— 使用 XeLaTeX 编译 +% 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 % -% Copyright 2020-2022 BITNP +% Copyright 2020-2022 BITNP % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -17,6 +17,9 @@ % % The Current Maintainer of this work is Feng Kaiyu. % +% Compile with: xelatex -> biber -> xelatex -> xelatex +%% + % 第一章节 \chapter{一级题目} diff --git a/templates/paper-translation/main.tex b/templates/paper-translation/main.tex index 422d3ce2..2b0c6ae1 100644 --- a/templates/paper-translation/main.tex +++ b/templates/paper-translation/main.tex @@ -1,5 +1,5 @@ %% -% The BIThesis Template for Bachelor Graduation Thesis +% The BIThesis Template for Bachelor Paper Translation % % 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 % @@ -18,20 +18,24 @@ % The Current Maintainer of this work is Feng Kaiyu. % % Compile with: xelatex -> biber -> xelatex -> xelatex +%% -% 章节支持、单面打印:ctexbook \documentclass[type=bachelor_translation]{bithesis} -% 如果想要修改样式,但无法找到样式在哪里定义:请参考 https://bithesis.bitnp.net/Guide/4-Others/Troubleshooting.html#%E6%83%B3%E8%A6%81%E4%BF%AE%E6%94%B9%E9%83%A8%E5%88%86%E6%A0%B7%E5%BC%8F-%E4%BD%86%E6%98%AF%E6%89%BE%E4%B8%8D%E5%88%B0%E6%A0%B7%E5%BC%8F%E5%9C%A8%E5%93%AA%E9%87%8C%E5%AE%9A%E4%B9%89 \BITSetup{ cover = { + % 在封面中载入有「北京理工大学」字样的图片,如无必要请勿改动。 headerImage = images/header.png, + % 在封面标题中使用思源黑体,使用此选项可以保证与 Word 封面标题的字体一致。 xiheiFont = STXIHEI.TTF, }, info = { title = 北京理工大学本科生毕业设计(论文)题目, titleEn = {The Subject of Undergraduate Graduation Project (Thesis) of Beijing Institute of Technology}, + % 想要删除某项封面信息,直接删除该项即可。 + % 想要让某项封面信息留空(但是保留下划线),请设置为空字符串。 + % 如需要换行,则用 “\\” 符号分割。 school = 计算机学院, major = 计算机科学与技术, author = 惠计算, @@ -48,6 +52,7 @@ } } +% 有关参考文献的样式可以在此处修改;如无必要无需修改。 \usepackage[ backend=biber, style=gb7714-2015, @@ -87,14 +92,15 @@ % \input{chapters/2_chapter2.tex} % \input{chapters/3_chapter3.tex} +% 后置部分 \backmatter % 结论:在结论相应的 TeX 文件处进行结论部分的撰写 -\input{misc/3_conclusion.tex} +\input{misc/1_conclusion.tex} % 参考文献:如无特殊需要,参考文献相应的 TeX 文件无需改动,添加参考文献请使用 BibTeX 的格式 % 添加至 misc/ref.bib 中,并在正文的相应位置使用 \cite{xxx} 的格式引用参考文献 -\input{misc/4_reference.tex} +\input{misc/2_reference.tex} % 附录:在附录相应的 TeX 文件处进行附录部分的撰写 -\input{misc/5_appendix.tex} +\input{misc/3_appendix.tex} \end{document} diff --git a/templates/paper-translation/misc/3_conclusion.tex b/templates/paper-translation/misc/1_conclusion.tex similarity index 91% rename from templates/paper-translation/misc/3_conclusion.tex rename to templates/paper-translation/misc/1_conclusion.tex index 176e5b4b..0db1cb87 100644 --- a/templates/paper-translation/misc/3_conclusion.tex +++ b/templates/paper-translation/misc/1_conclusion.tex @@ -1,7 +1,7 @@ %% -% The BIThesis Template for Bachelor Graduation Thesis +% The BIThesis Template for Bachelor Paper Translation % -% 北京理工大学毕业设计(论文)结论 —— 使用 XeLaTeX 编译 +% 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 % % Copyright 2020-2022 BITNP % @@ -18,6 +18,7 @@ % The Current Maintainer of this work is Feng Kaiyu. % % Compile with: xelatex -> biber -> xelatex -> xelatex +%% \begin{conclusion} % 结论部分尽量不使用 \subsection 二级标题,只使用 \section 一级标题 diff --git a/templates/paper-translation/misc/4_reference.tex b/templates/paper-translation/misc/2_reference.tex similarity index 95% rename from templates/paper-translation/misc/4_reference.tex rename to templates/paper-translation/misc/2_reference.tex index 11ca6c8e..805d5762 100644 --- a/templates/paper-translation/misc/4_reference.tex +++ b/templates/paper-translation/misc/2_reference.tex @@ -1,9 +1,9 @@ %% -% The BIThesis Template for Bachelor Graduation Thesis +% The BIThesis Template for Bachelor Paper Translation % -% 北京理工大学毕业设计(论文)参考文献 —— 使用 XeLaTeX 编译 +% 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 % -% Copyright 2020-2022 BITNP +% Copyright 2020-2022 BITNP % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -18,8 +18,7 @@ % The Current Maintainer of this work is Feng Kaiyu. % % Compile with: xelatex -> biber -> xelatex -> xelatex -% -% 如无特殊需要,本页面无需更改 +%% \begin{bibprint} diff --git a/templates/paper-translation/misc/5_appendix.tex b/templates/paper-translation/misc/3_appendix.tex similarity index 90% rename from templates/paper-translation/misc/5_appendix.tex rename to templates/paper-translation/misc/3_appendix.tex index 34e3f190..afc803bc 100644 --- a/templates/paper-translation/misc/5_appendix.tex +++ b/templates/paper-translation/misc/3_appendix.tex @@ -1,7 +1,7 @@ %% -% The BIThesis Template for Bachelor Graduation Thesis +% The BIThesis Template for Bachelor Paper Translation % -% 北京理工大学毕业设计(论文)附录 —— 使用 XeLaTeX 编译 +% 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 % % Copyright 2020-2022 BITNP % @@ -18,6 +18,7 @@ % The Current Maintainer of this work is Feng Kaiyu. % % Compile with: xelatex -> biber -> xelatex -> xelatex +%% \begin{appendices} 附录相关内容… diff --git a/templates/paper-translation/misc/ref.bib b/templates/paper-translation/misc/ref.bib index 084aa516..06f6a5e6 100644 --- a/templates/paper-translation/misc/ref.bib +++ b/templates/paper-translation/misc/ref.bib @@ -1,3 +1,25 @@ +%% +% The BIThesis Template for Bachelor Paper Translation +% +% 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 +% +% Copyright 2020-2022 BITNP +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Feng Kaiyu. +% +% Compile with: xelatex -> biber -> xelatex -> xelatex +%% + @article{yuFeiJiZongTiDuoXueKeSheJiYouHuaDeXianZhuangYuFaZhanFangXiang2008, title = {飞机总体多学科设计优化的现状与发展方向}, author = {余, 雄庆}, @@ -121,4 +143,4 @@ @online{yaoboyuan url = {http://www.cnnic.net.cn/hlwfzyj/hlwxzbg/201201/P020120709345264469680}, urldate = {2013-03-26}, keywords = {online}, -} \ No newline at end of file +} diff --git a/templates/presentation-slide/README.md b/templates/presentation-slide/README.md index a6e3386f..7fbf60f4 100644 --- a/templates/presentation-slide/README.md +++ b/templates/presentation-slide/README.md @@ -13,6 +13,12 @@ ## 编译方式 +方式一(推荐): +``` +latexmk +``` + +方式二: ``` -> xelatex -> biber diff --git a/templates/presentation-slide/bitbeamer.cls b/templates/presentation-slide/bitbeamer.cls new file mode 100644 index 00000000..bbb87d49 --- /dev/null +++ b/templates/presentation-slide/bitbeamer.cls @@ -0,0 +1,76 @@ +%% +%% This is file `bitbeamer.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% bithesis.dtx (with options: `cls,beamer') +%% +%% Copyright (C) 2022 +%% Association of Bit Network Pioneer and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2020/11/27 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Feng Kaiyu. +%% ------------------------------------------------------------------------------ +%% +\RequirePackage{expl3,l3keys2e} +\ProvidesExplClass{bitbeamer} +{2022-06-10}{3.0.0}{BIT Thesis Templates} +%%%% TODO: + + +\keys_define:nn { bitbeamer } + { + titlegraphic .tl_set:N = \l_bit_titlegraphic_tl, + framelogo .tl_set:N = \l_bit_framelogo_tl, + } +\ProcessKeysOptions { bitbeamer } + +\DeclareOption*{ + \PassOptionsToClass{\CurrentOption}{ctexbeamer} +} +\ProcessOptions\relax + +\LoadClass{ctexbeamer} + +\RequirePackage{xeCJKfntef} +\RequirePackage{tikz} + +\usetheme{Madrid} +\colorlet{beamer@blendedblue}{green!40!black} + +\cs_new:Npn \CJKhl:nn #1 #2 + { \CJKsout*[thickness=2.5ex, format=\color{#1}]{#2} } + +\tl_if_empty:NF \l_bit_titlegraphic_tl { + % BIT Logo + \titlegraphic{ + \includegraphics[width=2cm]{\l_bit_titlegraphic_tl} + } +} + +\tl_if_empty:NF \l_bit_framelogo_tl { + \addtobeamertemplate{frametitle}{}{% + \begin{tikzpicture}[remember~picture,overlay] + \node[anchor=north~east,yshift=2pt] at (current~page.north~east) {\includegraphics[height=0.8cm]{\tl_use:N \l_bit_framelogo_tl}}; + \end{tikzpicture} + } +} + +\cs_new_eq:NN \CJKhl \CJKhl:nn + +\endinput +%% +%% End of file `bitbeamer.cls'. diff --git a/templates/presentation-slide/main.tex b/templates/presentation-slide/main.tex index 9f9d5c8d..20f6576e 100644 --- a/templates/presentation-slide/main.tex +++ b/templates/presentation-slide/main.tex @@ -1,5 +1,5 @@ %% -% The BIThesis Template for Bachelor Graduation Thesis +% The BIThesis Template for Presentation % % 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 % @@ -18,6 +18,7 @@ % The Current Maintainer of this work is Feng Kaiyu. % % Compile with: xelatex -> biber -> xelatex -> xelatex +%% \documentclass[ %% ====== 这一部分选项将传递给 ctexbeamer,你也可以添加其他的选项 ==== @@ -129,8 +130,7 @@ \section{总结} \begin{frame}[t] \frametitle{参考文献} -\printbibliography[heading=none] - + \printbibliography[heading=none] \end{frame} \begin{frame}[c] diff --git a/templates/undergraduate-proposal-report/README.md b/templates/undergraduate-proposal-report/README.md index a6513320..75e59f36 100644 --- a/templates/undergraduate-proposal-report/README.md +++ b/templates/undergraduate-proposal-report/README.md @@ -1,6 +1,6 @@ -# Proposal Report 开题报告 ![](https://raw.githubusercontent.com/BITNP/BIThesis/main/assets/bithesis_badge_solid.svg?sanitize=true) +# Proposal Report 本科生毕业设计开题报告 ![](https://raw.githubusercontent.com/BITNP/BIThesis/main/assets/bithesis_badge_solid.svg?sanitize=true) -本目录中包含有北京理工大学本科生毕业设计(论文)的开题报告模板,有关模板的使用方法更为详细的介绍,请参考:[BIThesis Wiki - 本科生开题报告:Proposal report](https://bithesis.bitnp.net/Guide/3-Templates/Proposal-Report)。 +本目录中包含有北京理工大学本科生毕业设计的开题报告模板,有关模板的使用方法更为详细的介绍,请参考:[BIThesis Wiki - 本科生开题报告:Proposal report](https://bithesis.bitnp.net/Guide/3-Templates/Proposal-Report)。 ## 项目结构 @@ -10,7 +10,6 @@ ├── …… ├── main.pdf:开题报告编译得到的 PDF 文件 └── misc:开题报告中所需要的杂项目录 - ├── cover.tex:开题报告封面 ├── refs.bib:开题报告的参考文献 BibTeX 数据库 └── reviewTableBlank.pdf:开题报告 PDF 格式的「评审表」 ``` @@ -19,6 +18,12 @@ ## 编译方式 +方式一(推荐): +``` +latexmk +``` + +方式二: ``` -> xelatex -> biber diff --git a/templates/undergraduate-proposal-report/bitreport.cls b/templates/undergraduate-proposal-report/bitreport.cls new file mode 100644 index 00000000..5af42046 --- /dev/null +++ b/templates/undergraduate-proposal-report/bitreport.cls @@ -0,0 +1,329 @@ +%% +%% This is file `bitreport.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% bithesis.dtx (with options: `cls,report') +%% +%% Copyright (C) 2022 +%% Association of Bit Network Pioneer and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2020/11/27 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Feng Kaiyu. +%% ------------------------------------------------------------------------------ +%% +\RequirePackage{expl3,l3keys2e} +\ProvidesExplClass{bitreport} +{2022-06-10}{3.0.0}{BIT Thesis Templates} +%%%% TODO: + + +\int_new:N \g__bithesis_report_type_int + +\clist_const:Nn \c__bithesis_report_type_clist + { common, undergraduate_proposal} + +\seq_new:N \l__bithesis_right_seq +\seq_new:N \l__bithesis_left_seq + +\PassOptionsToPackage{AutoFakeBold,AutoFakeSlant}{xeCJK} + +\DeclareOption*{ + \PassOptionsToClass{\CurrentOption}{ctexart} +} +\ProcessOptions\relax +\LoadClass[zihao=-4]{ctexart} + +\RequirePackage[a4paper,left=3cm,right=2.4cm,top=2.6cm,bottom=2.38cm,includeheadfoot]{geometry} +\RequirePackage{fancyhdr} +\RequirePackage{setspace} +\RequirePackage{caption} +\RequirePackage{booktabs} +\RequirePackage{pdfpages} + +\keys_define:nn { bitreport } + { + option .meta:nn = {bitreport / option } {#1}, + cover .meta:nn = { bitreport / cover } {#1}, + info .meta:nn = { bitreport / info } {#1}, + misc .meta:nn = { bitreport / misc } {#1} + } + +\keys_define:nn { bitreport / cover } + { + imagePath .tl_set:N = \l_bit_coverimagepath_tl, + date .tl_set:N = \l__bithesis_cover_date_tl, + %% cover entry + dilimiter .tl_set:N = \l__bithesis_cover_dilimiter_tl, + labelAlign .tl_set:N = \l__bithesis_cover_label_align_tl, + labelAlign .initial:n = {r}, + valueAlign .tl_set:N = \l__bithesis_cover_value_align_tl, + valueAlign .initial:n = {c}, + labelMaxWidth .dim_set:N = \l__bithesis_cover_label_max_width_dim, + valueMaxWidth .dim_set:N = \l__bithesis_cover_value_max_width_dim, + autoWidth .bool_set:N = \l__bithesis_cover_auto_width_bool, + autoWidth .initial:n = {true}, + underlineThickness .dim_set:N = \l__bithesis_cover_underline_thickness_dim, + underlineThickness .initial:n = {1pt}, + underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, + underlineOffset .initial:n = { -10pt }, + } + +\keys_define:nn { bitreport / info } + { + title .tl_set:N = \l__bithesis_value_title_tl, + school .tl_set:N = \l__bithesis_value_school_tl, + major .tl_set:N = \l__bithesis_value_major_tl, + class .tl_set:N = \l__bithesis_value_class_tl, + author .tl_set:N = \l__bithesis_value_author_tl, + supervisor .tl_set:N = \l__bithesis_value_supervisor_tl, + externalSupervisor .tl_set:N = \l__bithesis_value_external_supervisor_tl, + studentId .tl_set:N = \l__bithesis_value_student_id_tl, + } + +\keys_define:nn { bitreport / option } +{ + type .choice:, + type .value_required:n = true, + type .choices:Vn = + \c__bithesis_report_type_clist + { + \int_set_eq:NN \g__bithesis_report_type_int \l_keys_choice_int + }, + type .initial:n = common, + +} + +\keys_define:nn { bitreport / misc } + { + reviewTable .tl_set:N = \l_bit_reviewtable_tl, + } + +\ProcessKeysOptions { bitreport / option } + +\cs_generate_variant:Nn \tl_if_empty:nTF {e} +\cs_generate_variant:Nn \seq_set_split:Nnn {Nne} + +\cs_new:Npn \__bithesis_dunderline:nnn #1#2#3 { + {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}} +} + +\cs_new:Npn \__bithesis_render_cover_entry:nn #1#2 { + \makebox[\l__bithesis_cover_label_max_width_dim][\l__bithesis_cover_label_align_tl]{ + \tl_if_blank:VTF #1 {} {#1\l__bithesis_cover_dilimiter_tl} + } + \hspace{1ex} + \__bithesis_dunderline:nnn{\l__bithesis_cover_underline_offset_dim}{\l__bithesis_cover_underline_thickness_dim}{ + \makebox[\l__bithesis_cover_value_max_width_dim][\l__bithesis_cover_value_align_tl]{#2} + }\par +} + +\cs_new:Npn \__bithesis_get_text_width:Nn #1#2 + { + \hbox_set:Nn \l_tmpa_box {#2} + \dim_set:Nn #1 { \box_wd:N \l_tmpa_box } + } +\cs_generate_variant:Nn \__bithesis_get_text_width:Nn { NV } + +\cs_new:Npn \__bithesis_get_max_text_width:NN #1#2 + { + \group_begin: + \seq_set_eq:NN \l__bithesis_tmpa_seq #2 + \dim_zero_new:N \l__bithesis_tmpa_dim + \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_tmpa_seq } + { + \seq_pop_left:NN \l__bithesis_tmpa_seq \l__bithesis_tmpa_tl + \__bithesis_get_text_width:NV \l__bithesis_tmpa_dim \l__bithesis_tmpa_tl + \dim_gset:Nn #1 { \dim_max:nn {#1} { \l__bithesis_tmpa_dim } } + } + \group_end: + } + +\cs_new:Npn \__bithesis_parse_entry #1 #2 { + \seq_set_split:Nne \l__bithesis_tmp_right_seq {//} {#2} + \seq_clear:N \l__bithesis_tmp_left_seq + \seq_map_inline:Nn \l__bithesis_tmp_right_seq { + \seq_put_right:Nn \l__bithesis_tmp_left_seq {} + } + \seq_put_left:Nn \l__bithesis_tmp_left_seq {#1} + \seq_pop_right:NN \l__bithesis_tmp_left_seq \g__bithesis_trashcan_tl +} + +\cs_new:Npn \__bithesis_render_cover_entry:n #1 { + \seq_set_from_clist:NN \l__bithesis_input_seq #1 + % parse newline // + \seq_map_inline:Nn \l__bithesis_input_seq { + \__bithesis_parse_entry ##1 + \seq_concat:NNN \l__bithesis_right_seq \l__bithesis_right_seq \l__bithesis_tmp_right_seq + \seq_concat:NNN \l__bithesis_left_seq \l__bithesis_left_seq \l__bithesis_tmp_left_seq + } + + \bool_if:NT \l__bithesis_cover_auto_width_bool { + \__bithesis_get_max_text_width:NN \l__bithesis_cover_label_max_width_dim \l__bithesis_left_seq + \__bithesis_get_max_text_width:NN \l__bithesis_cover_value_max_width_dim \l__bithesis_right_seq + } + + \group_begin: + \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_left_seq } + { + \seq_pop_left:NN \l__bithesis_left_seq \l__bithesis_tmpa_tl + \seq_pop_left:NN \l__bithesis_right_seq \l__bithesis_tmpb_tl + \tl_if_empty:eTF \l__bithesis_tmpb_tl {} { + \__bithesis_render_cover_entry:nn {\l__bithesis_tmpa_tl} {\l__bithesis_tmpb_tl} + } + } + \group_end: +} + +\DeclareDocumentCommand \BITSetup { m } + { \keys_set:nn { bitreport } { #1 }} +\DeclareDocumentCommand \MakeCover {} + { + \group_begin: + \int_case:nn {\g__bithesis_report_type_int} { + {1} { + \begin{titlepage} + \centering + \vspace{23mm} + \tl_if_empty:NF \l_bit_coverimagepath_tl { + \includegraphics[width=.5\textwidth]{\l_bit_coverimagepath_tl}\\ + } + \vspace{10mm} + \heiti\fontsize{24pt}{24pt}\selectfont{\l__bithesis_value_title_tl}\\ + \vspace{67mm} + \begin{spacing}{2.2} + \songti\zihao{3} + \clist_set:Nn \l__bithesis_input_clist { + {\textbf{学\qquad 院:}} {\l__bithesis_value_school_tl}, + {\textbf{专\qquad 业:}} {\l__bithesis_value_major_tl}, + {\textbf{班\qquad 级:}} {\l__bithesis_value_class_tl}, + {\textbf{学\qquad 号:}} {\l__bithesis_value_student_id_tl}, + {\textbf{姓\qquad 名:}} {\l__bithesis_value_author_tl}, + {\textbf{任课教师:}} {\l__bithesis_value_supervisor_tl}, + } + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{spacing} + \vspace*{\fill} + \centering + \songti\fontsize{12pt}{12pt}\selectfont{ + \tl_if_empty:NTF \l__bithesis_cover_date_tl { + \today + } { + \l__bithesis_cover_date_tl + } + } + \end{titlepage} + } + {2} { + % Main code for \MakeCover + \begin{titlepage} + \topskip=0pt + \vspace*{-16mm} + \centering + \hspace{-6mm}\songti\fontsize{22pt}{22pt}\selectfont{北京理工大学}\par + + \vspace{13mm} + + \hspace{-6mm}\heiti\fontsize{24pt}{24pt}\selectfont{本科生毕业设计(论文)开题报告}\par + + \vspace{53mm} + + \begin{spacing}{2.2} + \songti\zihao{3} + \clist_set:Nn \l__bithesis_input_clist { + {\textbf{学\qquad 院:}} {\l__bithesis_value_school_tl}, + {\textbf{专\qquad 业:}} {\l__bithesis_value_major_tl}, + {\textbf{班\qquad 级:}} {\l__bithesis_value_class_tl}, + {\textbf{姓\qquad 名:}} {\l__bithesis_value_author_tl}, + {\textbf{指导教师:}} {\l__bithesis_value_supervisor_tl}, + {\textbf{校外指导教师:}} {\l__bithesis_value_external_supervisor_tl}, + } + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{spacing} + + \vspace*{\fill} + + \centering + \hspace{-6mm}\songti\fontsize{12pt}{12pt}\selectfont{\today} + \end{titlepage} + } + } + \group_end: + } + +\DeclareDocumentCommand \MakeReviewTable {} + { + \group_begin: + \begin{titlepage} + \includepdf[pages=-]{\l_bit_reviewtable_tl} + \end{titlepage} + \group_end: + } + +\DeclareCaptionFont{kaiticaption}{\kaishu \normalsize} + +\renewcommand{\thefigure}{\thesection-\arabic{figure}} +\captionsetup[figure]{font=small,labelsep=space,skip=10bp,labelfont=bf,font=kaiticaption} + +\renewcommand{\thetable}{\thesection-\arabic{table}} +\captionsetup[table]{font=small,labelsep=space,skip=10bp,labelfont=bf,font=kaiticaption} + +\ctexset{today=big} + +\setromanfont{Times~New~Roman} + +%% 将中文楷体设置为 SIMKAI.TTF(如果需要) + +\setcounter{tocdepth}{3} +\setcounter{secnumdepth}{3} + +%% +\ctexset{section={ + format={\raggedright \bfseries \songti \zihao{-3}}, + beforeskip = 24bp plus 1ex minus .2ex, + afterskip = 24bp plus .2ex, + fixskip = true, + name = {,.\quad} + } +} +\ctexset{subsection={ + format = {\bfseries \songti \raggedright \zihao{4}}, + beforeskip = 24bp plus 1ex minus .2ex, + afterskip = 24bp plus .2ex, + fixskip = true, + } +} +\fancyhf{} +\int_case:nn {\g__bithesis_report_type_int} { + {1} {\fancyhead[R]{\fontsize{10.5pt}{10.5pt}\selectfont{\l__bithesis_value_title_tl}}} + {2} {\fancyhead[R]{\fontsize{10.5pt}{10.5pt}\selectfont{北京理工大学本科生毕业设计(论文)开题报告}}} +} +\fancyfoot[R]{\fontsize{9pt}{9pt}\selectfont{\thepage}} +\renewcommand{\headrulewidth}{1pt} +\renewcommand{\footrulewidth}{0pt} + +\pagestyle{fancy} +\setcounter{page}{1} + +\cs_set:Npn \baselinestretch {1.53} + +\endinput +%% +%% End of file `bitreport.cls'. diff --git a/templates/undergraduate-proposal-report/main.tex b/templates/undergraduate-proposal-report/main.tex index ce9f4053..6288709c 100644 --- a/templates/undergraduate-proposal-report/main.tex +++ b/templates/undergraduate-proposal-report/main.tex @@ -1,5 +1,5 @@ %% -% The BIThesis Template for Bachelor Graduation Thesis +% The BIThesis Template for Undergraduate Proposal Report % % 北京理工大学毕业设计开题报告 —— 使用 XeLaTeX 编译 % @@ -21,6 +21,7 @@ % the external PDF misc/reviewTable.pdf % % Compile with: xelatex -> biber -> xelatex -> xelatex +%% \documentclass[type=undergraduate_proposal]{bitreport} @@ -42,12 +43,11 @@ } } -%% usepackage +% Required by biber \usepackage[style=gb7714-2015,backend=biber]{biblatex} -% required by figure. +% Required by figure. \usepackage{float,graphicx} -% required by `\includepdf` -\usepackage{pdfpages} +% Required by tables. \usepackage{multirow} % 参考文献引用文件 refs.bib @@ -62,13 +62,6 @@ % 评审表 \MakeReviewTable -% TODO: -% 正文 22 磅的行距,段前段后间距为 0 -% \setlength{\parskip}{0em} -\renewcommand{\baselinestretch}{1.53} -% 正文首行悬挂 1.02cm -% \setlength{\parindent}{1.02cm} - % 内容开始 \section{毕业设计(论文)选题的内容} 开题报告总长度约 5 至 6 页,本部分重点介绍毕业设计选题的主要内容 \cite{LeCun2010},宋体,小三,段落前后 0.5 行。 diff --git a/templates/undergraduate-proposal-report/misc/cover.tex b/templates/undergraduate-proposal-report/misc/cover.tex deleted file mode 100644 index 8f08f253..00000000 --- a/templates/undergraduate-proposal-report/misc/cover.tex +++ /dev/null @@ -1,56 +0,0 @@ -%% -% The BIThesis Template for Bachelor Graduation Thesis -% -% 北京理工大学毕业设计开题报告 —— 使用 XeLaTeX 编译 -% -% Copyright 2020-2022 BITNP -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 -% of this license or (at your option) any later version. -% The latest version of this license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2005/12/01 or later. -% -% This work has the LPPL maintenance status `maintained'. -% -% The Current Maintainer of this work is Feng Kaiyu. -% -% This work consists of the files main.tex, misc/cover.tex and -% the external PDF misc/reviewTable.pdf - -% 校名顶部非常细小的空白 -\topskip=0pt - -\begin{titlepage} - \vspace*{-16mm} - \centering - \hspace{-6mm}\songti\fontsize{22pt}{22pt}\selectfont{北京理工大学} - - \vspace{13mm} - - \hspace{-6mm}\heiti\fontsize{24pt}{24pt}\selectfont{本科生毕业设计(论文)开题报告} - - \vspace{53mm} - - \flushleft - \begin{spacing}{2.2} - \hspace{46mm}\songti\fontsize{16pt}{16pt}\selectfont{\textbf{学\hspace{11mm}院:}\underline{\makebox[51mm][c]{\deptName}}} - - \hspace{46mm}\songti\fontsize{16pt}{16pt}\selectfont{\textbf{专\hspace{11mm}业:}\underline{\makebox[51mm][c]{\majorName}}} - - \hspace{46mm}\songti\fontsize{16pt}{16pt}\selectfont{\textbf{班\hspace{11mm}级:}\underline{\makebox[51mm][c]{\className}}} - - \hspace{46mm}\songti\fontsize{16pt}{16pt}\selectfont{\textbf{姓\hspace{11mm}名:}\underline{\makebox[51mm][c]{\yourName}}} - - \hspace{46mm}\songti\fontsize{16pt}{16pt}\selectfont{\textbf{指导教师:}\underline{\makebox[51mm][c]{\mentorName}}} - - \hspace{46mm}\songti\fontsize{16pt}{16pt}\selectfont{\textbf{校外指导教师:}\underline{\makebox[40mm][c]{\offCampusMentorName}}} - \end{spacing} - - \vspace*{\fill} - - \centering - \hspace{-6mm}\songti\fontsize{12pt}{12pt}\selectfont{\today} -\end{titlepage} diff --git a/templates/undergraduate-proposal-report/misc/refs.bib b/templates/undergraduate-proposal-report/misc/refs.bib index c0a76f4a..bdfe3608 100644 --- a/templates/undergraduate-proposal-report/misc/refs.bib +++ b/templates/undergraduate-proposal-report/misc/refs.bib @@ -1,3 +1,28 @@ +%% +% The BIThesis Template for Undergraduate Proposal Report +% +% 北京理工大学毕业设计开题报告 —— 使用 XeLaTeX 编译 +% +% Copyright 2020-2022 BITNP +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Feng Kaiyu. +% +% This work consists of the files main.tex, misc/cover.tex and +% the external PDF misc/reviewTable.pdf +% +% Compile with: xelatex -> biber -> xelatex -> xelatex +%% + @article{LeCun2010, abstract = {The MNIST database of handwritten digits, available from this page, has a training set of 60,000 examples, and a test set of 10,000 examples. It is a subset of a larger set available from NIST. The digits have been size-normalized and centered in a fixed-size image.}, author = {LeCun, Yann and Cortes, Corinna}, diff --git a/templates/undergraduate-thesis-en/README.md b/templates/undergraduate-thesis-en/README.md new file mode 100644 index 00000000..e86b6bfe --- /dev/null +++ b/templates/undergraduate-thesis-en/README.md @@ -0,0 +1,43 @@ +# Graduation Thesis 毕业设计论文(全英文专业)![](https://raw.githubusercontent.com/BITNP/BIThesis/main/assets/bithesis_badge_solid.svg?sanitize=true) + +
🚩 注意:目前版本的毕业设计论文已经按照北京理工大学毕业论文模板(全英文 2022)进行了设计与排版的更新。
+ +有关模板的使用方法更为详细的介绍,请参考: +[BIThesis Wiki - 本科生毕业论文:Graduation thesis](https://bithesis.bitnp.net/guide/3-templates/final-graduation-thesis)。 + +## 项目结构 + +``` +. +├── README.md +├── chapters +│   ├── 0_abstract.tex +│   ├── 1_chapter1.tex +│   ├── 2_chapter2.tex +│   └── 3_chapter3.tex +├── images +│   └── header.png +├── main.pdf +├── main.tex +└── misc + ├── 1_conclusion.tex + ├── 2_reference.tex + ├── 3_appendices.tex + ├── 4_acknowledgements.tex + └── ref.bib +``` + +## 编译方式 + +方式一(推荐): +``` +latexmk +``` + +方式二: +``` +-> xelatex +-> biber +-> xelatex +-> xelatex +``` diff --git a/templates/undergraduate-thesis-en/bithesis.cls b/templates/undergraduate-thesis-en/bithesis.cls new file mode 100644 index 00000000..e2155b36 --- /dev/null +++ b/templates/undergraduate-thesis-en/bithesis.cls @@ -0,0 +1,1589 @@ +%% +%% This is file `bithesis.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% bithesis.dtx (with options: `cls,thesis') +%% +%% Copyright (C) 2022 +%% Association of Bit Network Pioneer and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2020/11/27 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Feng Kaiyu. +%% ------------------------------------------------------------------------------ +%% +\RequirePackage{expl3,l3keys2e} +\ProvidesExplClass{bithesis} +{2022-06-10}{3.0.0}{BIT Thesis Templates} +%%%% TODO: + + +\int_new:N \g__bithesis_thesis_type_int +\int_new:N \g__bithesis_head_zihao_int +\bool_new:N \g__bithesis_twoside_bool +\bool_new:N \g__bithesis_thesis_type_english_bool +\bool_new:N \g__bithesis_blind_mode_bool +\tl_new:N \g__bithesis_label_devide_char_tl + +\seq_new:N \l__bithesis_right_seq +\seq_new:N \l__bithesis_left_seq + + +\cs_generate_variant:Nn \tl_if_empty:nTF {e} +\cs_generate_variant:Nn \seq_set_split:Nnn {Nne} + +\cs_new:Npn \__bithesis_same_page: { + \let\clearpage\relax + \let\cleardoublepage\relax +} + +\cs_new:Npn \__bithesis_if_graduate:TF #1#2 { + \int_compare:nNnTF {3} < {\g__bithesis_thesis_type_int} + {#1} + {#2} + } + +\cs_new:Npn \__bithesis_if_thesis_int_type:nTF #1#2#3 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {#1} {#2} {#3}} +\cs_new:Npn \__bithesis_if_thesis_int_type:nT #1#2 {\__bithesis_if_thesis_int_type:nTF {#1} {#2} {}} + +\cs_new:Npn \__bithesis_if_thesis_english:TF #1#2 {\bool_if:nTF {\g__bithesis_thesis_type_english_bool} {#1} {#2}} +\cs_new:Npn \__bithesis_if_thesis_english:T #1 {\__bithesis_if_thesis_english:TF {#1}{}} + +\cs_new:Npn \__bithesis_if_bachelor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} < {4} {#1} {#2}} +\cs_new:Npn \__bithesis_if_bachelor_thesis:T #1 {\__bithesis_if_bachelor_thesis:TF {#1} {}} +\cs_new:Npn \__bithesis_if_master_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {4} {#1} {#2}} +\cs_new:Npn \__bithesis_if_doctor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {5} {#1} {#2}} + +\clist_const:Nn \c__bithesis_thesis_type_clist + { bachelor, bachelor_translation, bachelor_english, master, docter} + +\cs_new_protected:Npn \__bithesis_define_label:nn #1#2 + { \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} } + +\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnn #1#2#3 + { + \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} + } + +\cs_new_protected:Npn \__bithesis_define_label:nnn #1#2#3 + { + \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} + \tl_const:cn { c__bithesis_label_ #1 _en_tl } {#3} + } + +\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnnn #1#2#3#4 + { + \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} + \tl_const:cn { c__bithesis_ #1 _label_ #2 _en_tl } {#4} + } + +\clist_map_inline:nn + { + {code} {代码}, + {udc} {UDC分类号:}, + {classification} {中国分类号:}, + {classified_level} {密级}, + {type} {种类}, + } + {\__bithesis_define_label:nn #1} + +\clist_map_inline:nn + { + {title} {本科生毕业设计(论文)}, + {originality} {原创性声明}, + {originality_clause} {本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,本文不包含任何其他个人或集体已经发表或撰写过的研究成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par~特此申明。}, + {authorization} {关于使用授权的声明}, + {authorization_clause} {本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,其中包括:\circled{1}~学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;\circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);\circled{3}~学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}~学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);\circled{5}~学校可以公布本毕业设计(论文)的全部或部分内容。}, + {originality_author_signature} {本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, + {originality_supervisor_signature} {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, + } {\__bithesis_define_label_by_thesis_type:nnn {bachelor} #1} + +\clist_map_inline:nn + { + {title} {}, + {originality} {原创性声明~Statement~of~Originality}, + {originality_clause} { + 本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,本文不包含任何其他个人或集体已经发表或撰写过的研究成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。特此申明。\par + \arialfamily I,\dunderline[-1pt]{1pt}{\makebox[18mm]{}},~solemnly~ + declare:~the~submitted~graduation~design~(thesis),~is~the~research~achievement~completed~independently~by~myself~ + under~the~guidance~of~the~supervisor.~This~article~does~not~contain~ + any~research~published~or~written~by~any~other~individual~or~group,~ + except~as~already~referenced~in~this~paper.~Individuals~and~groups~ + that~have~made~important~contributions~to~the~study~of~this~paper~ + are~clearly~indicated~and~cited~in~the~paper.\par + }, + {authorization} {关于使用授权的声明~State~of~Use~Authorization}, + {authorization_clause} { + 本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,其中包括:\circled{1}学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;\circled{2}学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);\circled{3}学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);\circled{5}学校可以公布本毕业设计(论文)的全部或部分内容。\par + I~fully~understand~the~regulations~on~the~storage,~use~of~graduation~design~(thesis)~in~Beijing~Institute~of~Technology.~Beijing~Institute~of~Technology~has~the~right~to~(1)~keep,~and~to~the~relevant~departments~to~send~the~original~or~copy~of~this~graduation~design~(thesis);~(2)~copy~and~preserve~this~graduation~design~(thesis)~by~photocopying,~miniature~or~other~means~of~reproduction;~(3)~allow~this~graduation~design~(thesis)~to~be~read~or~borrowed;~(4)~for~the~purpose~of~academic~exchange,~copy,~give~and~exchange~this~graduation~design~(thesis);~(5)~publish~all~or~part~of~the~contents~of~this~graduation~design~(thesis).~ + }, + } {\__bithesis_define_label_by_thesis_type:nnn {bachelor_english} #1} + +\cs_new:Npn \smallgap: { + \hspace{0.45ex} +} + +\cs_new:Npn \label_space: { + \__bithesis_if_bachelor_thesis:T { + \quad + } +} + +\clist_map_inline:nn + { + {originality} {研究成果声明}, + {originality_clause} {本人郑重声明:所提交的学位论文是我本人在指导教师的指导下进行的研究工作获得的研究成果。尽我所知,文中除特别标注和致谢的地方外,学位论文中不包含其他人已经发表或撰写过的研究成果,也不包含为获得北京理工大学或其它教育机构的学位或证书所使用过的材料。与我一同工作的合作者对此研究工作所做的任何贡献均已在学位论文中作了明确的说明并表示了谢意。\par~特此申明。}, + {authorization} {关于学位论文使用权的说明}, + {authorization_clause} {本人完全了解北京理工大学有关保管、使用学位论文的规定,其中包括:\circled{1}~学校有权保管、并向有关部门送交学位论文的原件与复印件;\circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存学位论文;\circled{3}~学校可允许学位论文被查阅或借阅;\circled{4}~学校可以学术交流为目的,复制赠送和交换学位论文;\circled{5}~学校可以公布学位论文的全部或部分内容(保密学位论文在解密后遵守此规定)。}, + {originality_author_signature} {签\qquad 名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, + {originality_supervisor_signature} {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, + } {\__bithesis_define_label_by_thesis_type:nnn {graduate} #1} + +\clist_map_inline:nn + { + {author} {作\quad 者\quad 姓\quad 名} {Candiate~Name}, + {school} {学\quad 院\quad 名\quad 称} {School~or~Department}, + {supervisor} {指\quad 导\quad 教\quad 师} {Faculty~Mentor}, + {chairman} {答辩委员会主席} {Chair,~Thesis~Committee}, + {degree} {申\smallgap: 请\smallgap: 学\smallgap: 位\smallgap: 级\smallgap: 别} {Degree~Applied}, + {major} {学\quad 科\quad 专\quad 业} {Major}, + {institute} {学\smallgap: 位\smallgap: 授\smallgap: 予\smallgap: 单\smallgap: 位} {Degree~by}, + {defense_date} {论\smallgap: 文\smallgap: 答\smallgap: 辩\smallgap: 日\smallgap: 期} {The~Date~of~Defence}, + } {\__bithesis_define_label_by_thesis_type:nnnn {graduate} #1} + +\clist_map_inline:nn + { + {school} {学\qquad 院} {School}, + {major} {专\qquad 业} {Degree}, + {author} {学生姓名} {Author}, + {student_id} {学\qquad 号} {Student~ID}, + {supervisor} {指导教师} {Supervisor}, + {co_supervisor} {校外指导教师} {Co-Supervisor}, + {keywords} {关键词:} {Key~Words:~}, + {toc} {目\label_space: 录} {Table~of~Contents}, + {abstract} {摘\label_space: 要} {Abstract}, + {conclusion} {结\label_space: 论} {Conclusions}, + {appendix} {附\label_space: 录} {Appendices}, + {ack} {致\label_space: 谢} {Acknowledgement}, + {figure} {插\quad 图} {Illustrations}, + {table} {表\quad 格} {Tables}, + {appendix_prefix} {附录} {Appendix}, + {reference} {参考文献} {References}, + {university} {北京理工大学} {Beijing~Institute~of~Technology}, + {publications} {攻读学位期间发表论文与研究成果清单} {Publications~During~Studies}, + % TODO: Not so sure about the translation. + {resume} {作者简介} {}, + {symbols} {主要符号对照表} {}, + } + {\__bithesis_define_label:nnn #1} + +\clist_const:Nn \c__bithesis_bachelor_thesis_header_clist + {北京理工大学本科生毕业设计(论文), 北京理工大学本科生毕业设计(论文)外文翻译, Beijing~Institute~of~Technology~Bachelor's~Thesis } +\clist_const:Nn \c__bithesis_bachelor_thesis_cover_title_clist + { + 本科生毕业设计(论文), + 本科生毕业设计(论文)外文翻译, + Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis, + } + +\keys_define:nn { bithesis } +{ + info .meta:nn = { bithesis / info } {#1}, + misc .meta:nn = { bithesis / misc } {#1}, + cover .meta:nn = { bithesis / cover } {#1}, + style .meta:nn = { bithesis / style } {#1}, + option .meta:nn = { bithesis / option } {#1}, +} + +\keys_define:nn { bithesis / option } +{ + type .choice:, + type .value_required:n = true, + type .choices:Vn = + \c__bithesis_thesis_type_clist + { + \int_set_eq:NN \g__bithesis_thesis_type_int \l_keys_choice_int + \int_case:nn {\l_keys_choice_int} { + % 本科全英文也是英文模板。 + {3} {\bool_set_true:N \g__bithesis_thesis_type_english_bool} + } + }, + type .initial:n = bachelor, + twoside .bool_gset:N = \g__bithesis_twoside_bool, + blindPeerReview .bool_gset:N = \g__bithesis_blind_mode_bool, +} + +\keys_define:nn { bithesis / cover } + { + date .tl_set:N = \l__bithesis_cover_date_tl, + headerImage .tl_set:N = \l_bit_coverheaderimage_tl, + xiheiFont .tl_set:N = \l__bithesis_cover_xihei_font_path_tl, + xiheiFont .default:n = {STXihei}, + %% cover entry + dilimiter .tl_set:N = \l__bithesis_cover_dilimiter_tl, + labelAlign .tl_set:N = \l__bithesis_cover_label_align_tl, + labelAlign .initial:n = {r}, + valueAlign .tl_set:N = \l__bithesis_cover_value_align_tl, + valueAlign .initial:n = {c}, + labelMaxWidth .dim_set:N = \l__bithesis_cover_label_max_width_dim, + valueMaxWidth .dim_set:N = \l__bithesis_cover_value_max_width_dim, + autoWidth .bool_set:N = \l__bithesis_cover_auto_width_bool, + autoWidth .initial:n = {true}, + underlineThickness .dim_set:N = \l__bithesis_cover_underline_thickness_dim, + underlineThickness .initial:n = {1pt}, + underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, + underlineOffset .initial:n = { -10pt }, + } + +\keys_define:nn { bithesis / info } + { + title .tl_set:N = \l__bithesis_value_title_tl, + titleEn .tl_set:N = \l__bithesis_value_title_en_tl, + school .tl_set:N = \l__bithesis_value_school_tl, + major .tl_set:N = \l__bithesis_value_major_tl, + author .tl_set:N = \l__bithesis_value_author_tl, + studentId .tl_set:N = \l__bithesis_value_student_id_tl, + supervisor .tl_set:N = \l__bithesis_value_supervisor_tl, + externalSupervisor .tl_set:N = \l__bithesis_value_external_supervisor_tl, + keywords .tl_set:N = \l__bithesis_value_keywords_tl, + keywordsEn .tl_set:N = \l__bithesis_value_keywords_en_tl, + translationTitle .tl_set:N = \l__bithesis_value_trans_title_tl, + translationOriginTitle .tl_set:N = \l__bithesis_value_trans_origin_title_tl, + % 中国分类号,研究生学位论文使用 + classification .tl_set:N = \l__bithesis_value_classification_tl, + % UDC 分类号,研究生学位论文使用 + UDC .tl_set:N = \l__bithesis_value_udc_tl, + chairman .tl_set:N = \l__bithesis_value_chairman_tl, + degree .tl_set:N = \l__bithesis_value_degree_tl, + degreeEn .tl_set:N = \l__bithesis_value_degree_en_tl, + institute .tl_set:N = \l__bithesis_value_institute_tl, + institute .initial:n = {\c__bithesis_label_university_tl}, + defenseDate .tl_set:N = \l__bithesis_value_defense_date_tl, + authorEn .tl_set:N = \l__bithesis_value_author_en_tl, + schoolEn .tl_set:N = \l__bithesis_value_school_en_tl, + supervisorEn .tl_set:N = \l__bithesis_value_supervisor_en_tl, + chairmanEn .tl_set:N = \l__bithesis_value_chairman_en_tl, + majorEn .tl_set:N = \l__bithesis_value_major_en_tl, + instituteEn .tl_set:N = \l__bithesis_value_institute_en_tl, + instituteEn .initial:n = {\c__bithesis_label_university_en_tl}, + defenseDateEn .tl_set:N = \l__bithesis_value_defense_date_en_tl, + classifiedLevel .tl_set:N = \l__bithesis_value_classified_level_tl, + } + +\keys_define:nn { bithesis / misc } + { + arialFont .tl_set:N = \l__bithesis_misc_arial_font_path_tl, + } + +\keys_define:nn { bithesis / style } +{ + head .tl_set:N = \l__bithesis_style_head_tl, + head .initial:n = { + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} {北京理工大学本科生毕业设计(论文)} + {2} {北京理工大学本科生毕业设计(论文)外文翻译} + {3} {Beijing~Institute~of~Technology~Bachelor's~Thesis} + {4} {北京理工大学硕士学位论文} + {5} {北京理工大学博士学位论文} + } + } +} + +\ProcessKeysOptions { bithesis / option } + +\__bithesis_if_thesis_english:T { + \PassOptionsToClass{scheme=plain}{ctexbook} +} + +\bool_if:NTF \g__bithesis_twoside_bool {} { + \PassOptionsToClass{oneside,openany}{ctexbook} +} + +\DeclareOption*{ + \PassOptionsToClass{\CurrentOption}{ctexbook} +} +\ProcessOptions\relax +\LoadClass[zihao=-4,]{ctexbook} + +\RequirePackage{geometry} +\RequirePackage{xeCJK} +\RequirePackage{titletoc} +\RequirePackage{setspace} +\RequirePackage{graphicx} +\RequirePackage{fancyhdr} +\RequirePackage{pdfpages} +\RequirePackage{setspace} +\RequirePackage{booktabs} +\RequirePackage{multirow} +\RequirePackage{tikz} +\RequirePackage{etoolbox} +\RequirePackage{hyperref} +\RequirePackage{xcolor} +\RequirePackage{caption} +\RequirePackage{array} +\RequirePackage{amsmath} +\RequirePackage{amssymb} +\RequirePackage{pdfpages} +\RequirePackage{listings} +\RequirePackage{enumitem} +\RequirePackage{environ} + +\__bithesis_if_graduate:TF { + \int_set:Nn \g__bithesis_head_zihao_int {5} + \geometry{ + a4paper, + left=2.7cm, + bottom=2.5cm + 7bp, + top=3.5cm + 7bp, + right=2.7cm, + headsep = 3.5cm + 7bp - 2.5cm - 15bp, + headheight = 15 bp, + footskip = 2.5cm + 7bp - 1.8cm, + } +} { + \int_set:Nn \g__bithesis_head_zihao_int {4} + \geometry{ + a4paper, + left=3cm, + bottom=2.6cm + 7bp, + top=3.5cm + 7bp, + right=2.6cm, + headsep = 3.5cm + 7bp - 2.4cm - 20bp, + headheight = 20 bp, + footskip = 2.6cm + 7bp - 2cm, + } +} + +\setlength{\intextsep}{2\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} + +\setromanfont{Times~New~Roman} + +\ctex_at_end_preamble:n { + \__bithesis_if_thesis_english:TF { + \__bithesis_if_thesis_int_type:nT {3} { + % font Arial needed + \newfontfamily\arialfamily{Arial} + } + + } { + \tl_if_blank:VTF \l__bithesis_cover_xihei_font_path_tl {} + { + \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]{\l__bithesis_cover_xihei_font_path_tl} + } + } + + \__bithesis_if_thesis_int_type:nT {3} { + \RequirePackage[en-US]{datetime2} + \RequirePackage{indentfirst} + \DTMlangsetup[en-US]{dayyearsep={\space}} + } + + % Define biblatex category if it was imported. + \cs_if_exist:NT \DeclareBibliographyCategory { + \DeclareBibliographyCategory{mypub} + } +} + +\cs_new:Npn \xihei:n #1 { + \xeCJK_family_if_exist:nTF {xihei} { + \CJKfamily{xihei} #1 + }{ + \heiti #1 + } +} + +\cs_new:Npn \l__bithesis_title_font_cs:n #1 { + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \arialfamily #1 + } { + \heiti #1 + } +} + +\cs_new:Npn \l__bithesis_unnumchapter_style_cs:n #1 { + % 本科全英文、研究生学位论文需要加粗 + \int_compare:nNnTF {\g__bithesis_thesis_type_int} > {2} + { + \bfseries #1 + } { + \mdseries #1 + } +} + +\cs_set:Npn \arabicHeiti #1 {#1} + +\fancypagestyle{BIThesis}{ + \fancyhf{} + % 定义页眉、页码 + \fancyhead[C]{\zihao{\int_use:N \g__bithesis_head_zihao_int}\ziju{0.08}\songti{\tl_use:N \l__bithesis_style_head_tl}} + \fancyfoot[C]{\songti\zihao{5} \thepage} + % 页眉分割线稍微粗一些 + \RenewDocumentCommand \headrulewidth {} {0.6pt} +} + +\ctexset{chapter={ + number = {\arabicHeiti{ \arabic{chapter} }}, + format = { \l__bithesis_title_font_cs:n \bfseries \centering \zihao{3}}, + nameformat = {}, + titleformat = {}, + aftername = \hspace{9bp}, + pagestyle = BIThesis, + beforeskip = 8bp, + afterskip = 32bp, + fixskip = true, + } +} + +\ctexset{section={ + number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}}}, + format = {\l__bithesis_title_font_cs:n \raggedright \bfseries \zihao{4}}, + nameformat = {}, + titleformat = {}, + aftername = \hspace{8bp}, + beforeskip = 20bp plus 1ex minus .2ex, + afterskip = 18bp plus .2ex, + fixskip = true, + } +} + +\ctexset{subsection={ + number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}}}, + format = {\l__bithesis_title_font_cs:n \bfseries \raggedright \zihao{-4}}, + nameformat = {}, + titleformat = {}, + aftername = \hspace{7bp}, + beforeskip = 17bp plus 1ex minus .2ex, + afterskip = 14bp plus .2ex, + fixskip = true, + } +} + +\ctexset{ + secnumdepth = 3, + subsubsection={ + numbering = true, + number = {\arabicHeiti{\arabic{chapter}.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}.\hspace{1bp}\arabic{subsubsection}}}, + format={\l__bithesis_title_font_cs:n \bfseries \raggedright \zihao{-4}}, + nameformat = {}, + titleformat = {}, + beforeskip=28bp plus 1ex minus .2ex, + afterskip=24bp plus .2ex, + fixskip=true, + } +} + +\addtocontents{toc}{\protect\hypersetup{hidelinks}} + + +\__bithesis_if_graduate:TF { + % 各章标题,宋体四号 + \titlecontents{chapter}[0pt]{\songti \zihao{4}} + {\thecontentslabel\hspace{\ccwd}}{} + {\hspace{.5em}\titlerule*{.}\contentspage} +} { + \titlecontents{chapter}[0pt]{\songti \zihao{-4}} + {\thecontentslabel\hspace{\ccwd}}{} + {\hspace{.5em}\titlerule*{.}\contentspage} +} +\titlecontents{section}[1\ccwd]{\songti \zihao{-4}} +{\thecontentslabel\hspace{\ccwd}}{} +{\hspace{.5em}\titlerule*{.}\contentspage} +\titlecontents{subsection}[2\ccwd]{\songti \zihao{-4}} +{\thecontentslabel\hspace{\ccwd}}{} +{\hspace{.5em}\titlerule*{.}\contentspage} + +\bool_new:N \l__bithesis_add_to_toc_bool +\bool_set_true:N \l__bithesis_add_to_toc_bool + +\keys_define:nn { bit } + { + abstract .meta:nn = { bit / abstract } {#1}, + abstract_en .meta:nn = { bit / abstract_en } {#1}, + } + +\keys_define:nn { bit / abstract } + { + addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, + } + +\keys_define:nn { bit / abstract_en } + { + addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, + } + +\keys_define:nn { bit / symbols } + { + addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, + } + +\RenewDocumentCommand \frontmatter {} { + + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \pagenumbering{roman} + } { + \pagenumbering{Roman} + } + \ctexset{ + chapter = { + numbering = false, + } + } + \pagestyle{BIThesis} +} + +\RenewDocumentCommand \mainmatter {} { + \cleardoublepage + + \ctexset{ + chapter = { + numbering = true, + } + } + \pagenumbering{arabic} + \pagestyle{BIThesis} + % 正文 22 磅的行距 + \setlength{\parskip}{0em} + \setstretch{1.53} + % 修复脚注出现跨页的问题 + \interfootnotelinepenalty=10000 +} + +\RenewDocumentCommand \backmatter {} { + \setcounter{section}{0} + \setcounter{subsection}{0} + \setcounter{subsubsection}{0} + \ctexset{ + chapter = { + numbering = false, + beforeskip = 18bp, + format = {\l__bithesis_title_font_cs:n \l__bithesis_unnumchapter_style_cs:n \centering \zihao{3}}, + afterskip = 26bp, + } + } +} + +\setlength{\abovecaptionskip}{11pt} +\setlength{\belowcaptionskip}{9pt} + +\__bithesis_if_graduate:TF { + \tl_set:Nn \g__bithesis_label_devide_char_tl {.} +} { + \tl_set:Nn \g__bithesis_label_devide_char_tl {-} +} + +\cs_set:Npn \thefigure {\thechapter\g__bithesis_label_devide_char_tl\arabic{figure}} +\captionsetup[figure]{font=small,labelsep=space} + +\cs_set:Npn \thetable {\thechapter\g__bithesis_label_devide_char_tl\arabic{table}} +\captionsetup[table]{font=small,labelsep=space,skip=2pt} + +\cs_set:Npn \theequation {\thechapter\g__bithesis_label_devide_char_tl\arabic{equation}} + +\cs_set:Npn \thelstlisting {\thechapter\g__bithesis_label_devide_char_tl\arabic{lstlisting}} +\cs_set:Npn \lstlistingname {\c__bithesis_label_code_tl} + +\tolerance=1 +\emergencystretch=\maxdimen +\hyphenpenalty=10000 +\hbadness=10000 + +\definecolor{codegreen}{rgb}{0,0.6,0} +\definecolor{codegray}{rgb}{0.5,0.5,0.5} +\definecolor{codepurple}{rgb}{0.58,0,0.82} +\definecolor{backcolour}{rgb}{0.95,0.95,0.92} +\lstdefinestyle{examplestyle}{ + backgroundcolor=\color{backcolour}, + commentstyle=\color{codegreen}, + keywordstyle=\color{magenta}, + numberstyle=\tiny\color{codegray}, + stringstyle=\color{codepurple}, + basicstyle=\ttfamily\footnotesize, + breakatwhitespace=false, + breaklines=true, + captionpos=b, + keepspaces=true, + numbers=left, + numbersep=5pt, + showspaces=false, + showstringspaces=false, + showtabs=false, + tabsize=2 +} +\lstset{style=examplestyle} + +\cs_set:Npn \listfigurename {\c__bithesis_label_figure_tl} +\cs_set:Npn \listtablename {\c__bithesis_label_table_tl} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\DeclareDocumentCommand \BITSetup { m } + { \keys_set:nn { bithesis } { #1 }} + +\cs_new:Npn \__bithesis_render_cover_entry:nn #1#2 { + \makebox[\l__bithesis_cover_label_max_width_dim][\l__bithesis_cover_label_align_tl]{ + \tl_if_blank:VTF #1 {} {#1\l__bithesis_cover_dilimiter_tl} + } + \hspace{1ex} + \__bithesis_dunderline:nnn{\l__bithesis_cover_underline_offset_dim}{\l__bithesis_cover_underline_thickness_dim}{ + \makebox[\l__bithesis_cover_value_max_width_dim][\l__bithesis_cover_value_align_tl]{#2} + }\par +} + +\cs_new:Npn \__bithesis_get_text_width:Nn #1#2 + { + \hbox_set:Nn \l_tmpa_box {#2} + \dim_set:Nn #1 { \box_wd:N \l_tmpa_box } + } +\cs_generate_variant:Nn \__bithesis_get_text_width:Nn { NV } + +\cs_new:Npn \__bithesis_get_max_text_width:NN #1#2 + { + \group_begin: + \seq_set_eq:NN \l__bithesis_tmpa_seq #2 + \dim_zero_new:N \l__bithesis_tmpa_dim + \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_tmpa_seq } + { + \seq_pop_left:NN \l__bithesis_tmpa_seq \l__bithesis_tmpa_tl + \__bithesis_get_text_width:NV \l__bithesis_tmpa_dim \l__bithesis_tmpa_tl + \dim_gset:Nn #1 { \dim_max:nn {#1} { \l__bithesis_tmpa_dim } } + } + \group_end: + } + +\cs_new:Npn \__bithesis_parse_entry #1 #2 { + \seq_set_split:Nne \l__bithesis_tmp_right_seq {//} {#2} + \seq_clear:N \l__bithesis_tmp_left_seq + \seq_map_inline:Nn \l__bithesis_tmp_right_seq { + \seq_put_right:Nn \l__bithesis_tmp_left_seq {} + } + \seq_put_left:Nn \l__bithesis_tmp_left_seq {#1} + \seq_pop_right:NN \l__bithesis_tmp_left_seq \g__bithesis_trashcan_tl +} + +\cs_new:Npn \__bithesis_render_cover_entry:n #1 { + \seq_set_from_clist:NN \l__bithesis_input_seq #1 + % parse newline // + \seq_map_inline:Nn \l__bithesis_input_seq { + \__bithesis_parse_entry ##1 + \seq_concat:NNN \l__bithesis_right_seq \l__bithesis_right_seq \l__bithesis_tmp_right_seq + \seq_concat:NNN \l__bithesis_left_seq \l__bithesis_left_seq \l__bithesis_tmp_left_seq + } + + \bool_if:NT \l__bithesis_cover_auto_width_bool { + \__bithesis_get_max_text_width:NN \l__bithesis_cover_label_max_width_dim \l__bithesis_left_seq + \__bithesis_get_max_text_width:NN \l__bithesis_cover_value_max_width_dim \l__bithesis_right_seq + } + + \group_begin: + \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_left_seq } + { + \seq_pop_left:NN \l__bithesis_left_seq \l__bithesis_tmpa_tl + \seq_pop_left:NN \l__bithesis_right_seq \l__bithesis_tmpb_tl + \tl_if_empty:eTF \l__bithesis_tmpb_tl {} { + \__bithesis_render_cover_entry:nn {\l__bithesis_tmpa_tl} {\l__bithesis_tmpb_tl} + } + } + \group_end: +} + +\cs_new:Npn \__bithesis_dunderline:nnn #1#2#3 { + {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}} +} + +\cs_new:Npn \__bithesis_dunderline:nn #1#2 { + \__bithesis_dunderline:nnn {#1} {1pt} {#2} +} + +\cs_new:Npn \__bithesis_dunderline:n #1 { + \__bithesis_dunderline:nnn {-10pt} {1pt} {#1} +} + +\newcommand\dunderline[3][-1pt]{{% + \setbox0=\hbox{#3} + \ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}} + +\NewEnviron{blindPeerReview}{ + \bool_if:NTF \g__bithesis_blind_mode_bool {} { + \BODY + } +} + +\RenewDocumentCommand \cleardoublepage { } + { + \clearpage + \bool_if:NT \g__bithesis_twoside_bool + { + \int_if_odd:nF \c@page + { \hbox:n { } \thispagestyle { empty } \newpage } + } + } + +\cs_new:Npn \make_graduate_cover: { + \cleardoublepage + \begin{titlepage} + { + \heiti\zihao{5} + \tl_if_blank:VTF \l__bithesis_value_classified_level_tl {} { + \flushright + \c__bithesis_label_classified_level_tl:~ + \l__bithesis_value_classified_level_tl \par + } + } + \centering + \vspace*{65mm} + {\heiti\zihao{-2} \l__bithesis_value_title_tl} + \vskip 60mm + {\heiti \zihao{-3} \l__bithesis_value_author_tl} % 黑体 小三 + \vskip 10mm + {\heiti \zihao{-3} \l__bithesis_cover_date_tl} % 黑体 小三 + \end{titlepage} +} + +\cs_new:Npn \make_paper_back: { + \cleardoublepage + \begin{titlepage} + \vskip 5cm + \begin{center} + \setstretch{1.1} + \begin{minipage}[t][19.7cm]{2em} + \begin{center} + {\heiti\zihao{3}\l__bithesis_value_title_tl} + \vfill + {\heiti\zihao{3}\l__bithesis_value_author_tl} + \vfill + {\heiti\zihao{3}\c__bithesis_label_university_tl} + \end{center} + \end{minipage} + \end{center} + % \vskip 5cm + \end{titlepage} +} + +\cs_new:Npn \__bithesis_make_chinese_title_page: { + \cleardoublepage + \begin{titlepage} + { % + {\heiti \zihao{5} \noindent \c__bithesis_label_classification_tl} \l__bithesis_value_classification_tl\\ + {\heiti \zihao{5} \c__bithesis_label_udc_tl} \l__bithesis_value_udc_tl + } + \begin{center} + + \vskip \stretch{1} + {\heiti\zihao{-2} \l__bithesis_value_title_tl} + \vskip \stretch{1} + + % TODO: delete this? + {\fangsong\zihao{4}} + \def\tabcolsep{1pt} + \def\arraystretch{1.5} + + { + \renewcommand{\baselinestretch}{2} + + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\qquad} + } + \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {45mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {60mm} + } + } + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_graduate_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_graduate_label_school_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_graduate_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_graduate_label_chairman_tl} {\l__bithesis_value_chairman_tl}, + {\c__bithesis_graduate_label_degree_tl} {\l__bithesis_value_degree_tl}, + {\c__bithesis_graduate_label_major_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_graduate_label_institute_tl} {\l__bithesis_value_institute_tl}, + {\c__bithesis_graduate_label_defense_date_tl} {\l__bithesis_value_defense_date_tl}, + } + + \heiti\zihao{-3} + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + } + \end{center} + \vskip \stretch{0.5} + \end{titlepage} +} + +\cs_new:Npn \__bithesis_make_english_title_page: { + \begin{titlepage} + \begin{center} + + \vspace*{10em} + {\zihao{-2}\textbf{\l__bithesis_value_title_en_tl}} + % \bfseries + \vskip \stretch{1} + + { + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:~} + } + + \tl_set:Nn \l__bithesis_cover_label_align_tl {l} + \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} + + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {55mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {85mm} + } + } + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_graduate_label_author_en_tl} {\l__bithesis_value_author_en_tl}, + {\c__bithesis_graduate_label_school_en_tl} {\l__bithesis_value_school_en_tl}, + {\c__bithesis_graduate_label_supervisor_en_tl} {\l__bithesis_value_supervisor_en_tl}, + {\c__bithesis_graduate_label_chairman_en_tl} {\l__bithesis_value_chairman_en_tl}, + {\c__bithesis_graduate_label_degree_en_tl} {\l__bithesis_value_degree_en_tl}, + {\c__bithesis_graduate_label_major_en_tl} {\l__bithesis_value_major_en_tl}, + {\c__bithesis_graduate_label_institute_en_tl} {\l__bithesis_value_institute_en_tl}, + {\c__bithesis_graduate_label_defense_date_en_tl} {\l__bithesis_value_defense_date_en_tl}, + } + + \zihao{-3} + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + } + + \end{center} + + \vskip \stretch{0.5} + \end{titlepage} +} + +\DeclareDocumentCommand \MakeCover {} + { + \begin{blindPeerReview} + \group_begin: + + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} + { + \begin{titlepage} + \vspace*{16mm} + + \centering + + \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { + \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ + } + + \vspace*{-3mm} + + \zihao{-0}\textbf{\ziju{0.12}\songti{\c__bithesis_bachelor_label_title_tl}}\par + + \vspace{16mm} + + \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par + + \vspace{3mm} + + \begin{spacing}{1.2} + \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par + \end{spacing} + + \vspace{15mm} + + \begin{spacing}{1.8} + \begin{center} + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} + } + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} + } + } + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + } + + \zihao{3} + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{center} + \end{spacing} + + \vspace*{\fill} + \centering + \zihao{3}\ziju{0.5}\songti{ + \tl_if_empty:NTF \l__bithesis_cover_date_tl { + \today + } { + \l__bithesis_cover_date_tl + } + } + \end{titlepage} + } + {2} + { + \begin{titlepage} + \centering + + \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { + \includegraphics[width=6.87cm]{\l_bit_coverheaderimage_tl}\\ + } + + \vspace{1mm} + + \zihao{2}\textbf{\songti{本科生毕业设计(论文)外文翻译}} + + \vspace{8mm} + + { + + \begin{spacing}{1.8} + + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\textbf{:}} + \bool_set_false:N \l__bithesis_cover_auto_width_bool + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {115mm} + + \clist_set:Nn \l__bithesis_input_clist { + {\zihao{4}\textbf{外文原文题目}} {\l__bithesis_value_trans_origin_title_tl}, + {\zihao{4}\textbf{中文翻译题目}} {\l__bithesis_value_trans_title_tl}, + } + + \zihao{-3} + \centering + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{spacing} + + } + + \vspace{14mm} + + \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par + + \vspace{3mm} + + \begin{spacing}{1.2} + \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par + \end{spacing} + + \vspace{19mm} + + \begin{spacing}{1.8} + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} + } + + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} + } + } + + \zihao{3} + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + } + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{spacing} + + \vspace*{\fill} + \end{titlepage} + } + {3} { + \begin{titlepage} + \vspace*{16mm} + + \centering + + \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { + \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ + } + + \vspace*{-3mm} + + \zihao{1}\textbf{\ziju{0.12}Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis}\par + + \vspace{18mm} + + \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_en_tl}\par + + \vspace{10mm} + + \begin{spacing}{1.8} + \begin{center} + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} + } + + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {20mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {105mm} + } + } + + \zihao{4} + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_label_school_en_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_label_major_en_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_label_author_en_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_en_tl} {\l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_en_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_en_tl} {\l__bithesis_value_external_supervisor_tl}, + } + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{center} + \end{spacing} + + \vspace*{\fill} + \centering + \zihao{3}\ziju{0.5}\songti{ + \tl_if_empty:NTF \l__bithesis_cover_date_tl { + \today + } { + \l__bithesis_cover_date_tl + } + } + \end{titlepage} + } + {4} { + \make_graduate_cover: + } + {5} { + \make_graduate_cover: + } + } + \group_end: + \end{blindPeerReview} + } + +\newcommand{\circled}[2][]{\tikz[baseline=(char.base)] + {\node[shape = circle, draw, inner~sep = 1pt] + (char) {\phantom{\ifblank{#1}{#2}{#1}}}; + \node at (char.center) {\makebox[0pt][c]{#2}};}} +\robustify{\circled} + +\cs_new:Npn \__bithesis_graduate_originality: { + \ctexset { + chapter / pagestyle = plain, + } + + \begin{titlepage} + \pagenumbering{gobble} + + % 原创性声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{3}\c__bithesis_graduate_label_originality_tl} + \end{center}~\par + + % 本部分字号为小三 + \zihao{4} + \c__bithesis_graduate_label_originality_clause_tl + + \vspace{17mm} + + \begin{flushright} + \c__bithesis_graduate_label_originality_author_signature_tl\par + \end{flushright} + + \vspace{16mm} + + % 使用授权声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{3}\c__bithesis_graduate_label_authorization_tl} + \end{center}~\par + + \c__bithesis_graduate_label_authorization_clause_tl + + \vspace*{15mm} + + \begin{flushright} + \begin{spacing}{1.65} + \zihao{4} + % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} + \c__bithesis_graduate_label_originality_author_signature_tl\par + \c__bithesis_graduate_label_originality_supervisor_signature_tl\par + \end{spacing} + \end{flushright} + \end{titlepage} + \cleardoublepage +} + +\NewDocumentCommand \MakeOriginality {} +{ + \group_begin: + \begin{blindPeerReview} + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} + { + \pagestyle{BIThesis} + \pagenumbering{gobble} + + % 原创性声明部分 + \begin{center} + \vspace*{-2bp} + \__bithesis_same_page: + \chapter*{\heiti\zihao{2}\c__bithesis_bachelor_label_originality_tl} + \end{center}~\par + + % 本部分字号为小三 + \zihao{-3} + \c__bithesis_bachelor_label_originality_clause_tl + + \vspace{17mm} + + \begin{flushright} + \c__bithesis_bachelor_label_originality_author_signature_tl\par + \end{flushright} + + \vspace{16mm} + + % 使用授权声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{2}\c__bithesis_bachelor_label_authorization_tl} + \end{center}~\par + + \c__bithesis_bachelor_label_authorization_clause_tl + + \vspace*{3mm} + + \begin{flushright} + \begin{spacing}{1.65} + \zihao{-3} + % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} + \c__bithesis_bachelor_label_originality_author_signature_tl\par + \c__bithesis_bachelor_label_originality_supervisor_signature_tl\par + \end{spacing} + \end{flushright} + + \newpage + } + {3} { + \setstretch{1.26} + % 原创性声明部分 + \begin{center} + \vspace*{-2bp} + \__bithesis_same_page: + \chapter*{\heiti\zihao{-2}\c__bithesis_bachelor_english_label_originality_tl} + \end{center}~\par + + % 本部分字号为小三 + \zihao{-4} + \c__bithesis_bachelor_english_label_originality_clause_tl + + \bigbreak + + Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~Date:\par + + \vspace{6mm} + + % 使用授权声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{-2}\c__bithesis_bachelor_english_label_authorization_tl} + \end{center}~\par + + \c__bithesis_bachelor_english_label_authorization_clause_tl + + \bigbreak + Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm + 16bp]{}}~\hspace{2mm}Date:\par + Supervisor~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~\hspace{2mm}Date:\par + } + {4} {\__bithesis_graduate_originality:} + {5} {\__bithesis_graduate_originality:} + } + \end{blindPeerReview} + \group_end: +} + +\NewDocumentCommand \MakePaperBack {} + { + \begin{blindPeerReview} + \make_paper_back: + \end{blindPeerReview} + } + +\NewDocumentCommand \MakeTitle {} + { + \begin{blindPeerReview} + \__bithesis_make_chinese_title_page: + \__bithesis_make_english_title_page: + \end{blindPeerReview} + } + +\DeclareDocumentCommand \MakeTOC {} + { + { + \__bithesis_if_bachelor_thesis:TF { + \renewcommand{\baselinestretch}{1.35} + } { + \renewcommand{\baselinestretch}{1.56} + } + + \__bithesis_if_thesis_english:TF { + \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_en_tl} + } { + \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_tl} + } + + % 自定义目录样式 + \cs_set:Npn \contentsname { + \fontsize{16pt}{\baselineskip} + \l__bithesis_unnumchapter_style_cs:n\l__bithesis_title_font_cs:n{\l__bithesis_toc_title_tl} + \vspace{-8pt} + } + + % 制作目录 + \tableofcontents + + % 在本科生全英文模板中,添加「目录」本身到目录中。 + \__bithesis_if_thesis_int_type:nT {3} { + \addcontentsline{toc}{chapter}{\c__bithesis_label_toc_en_tl} + } + } + } + + % TODO: + \NewDocumentEnvironment {abstract} {o} + { + + \IfValueT {#1} { + \keys_set:nn { bit / abstract } {#1} + } + + \cleardoublepage + \setstretch{1.53} + + \__bithesis_if_bachelor_thesis:T { + \begin{center} + \vspace*{-17bp} + \heiti\zihao{-2}\textbf{ + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} {\l__bithesis_value_title_tl} + {2} {\l__bithesis_value_trans_title_tl} + {3} {\l__bithesis_value_title_tl} + } + } + \end{center} + + \vspace*{2mm} + } + + \ctexset{ + chapter/numbering = false, + } + + \__bithesis_if_bachelor_thesis:T { + \ctexset{ + chapter/titleformat = {\textmd} + } + } + + { + \__bithesis_same_page: + \bool_if:NTF \l__bithesis_add_to_toc_bool { + \chapter{\c__bithesis_label_abstract_tl} + } { + \chapter*{\c__bithesis_label_abstract_tl} + } + } + \vspace*{1mm} + \par + } + { + \par + \vspace{4ex}\noindent\textbf{\heiti \c__bithesis_label_keywords_tl \l__bithesis_value_keywords_tl}\par + \newpage + } + + \NewDocumentEnvironment {abstractEn} {o} + { + \IfValueT {#1} { + \keys_set:nn { bit / abstract_en } {#1} + } + + \cleardoublepage + \setstretch{1.53} + + \__bithesis_if_bachelor_thesis:T { + \begin{spacing}{0.95} + \centering + \vspace*{-2bp} + + \__bithesis_if_thesis_int_type:nTF {3} { + \arialfamily\zihao{-2}\textbf\l__bithesis_value_title_en_tl\\ + } { + \heiti\zihao{3}\textbf\l__bithesis_value_title_en_tl\\ + } + \end{spacing} + \vspace*{10mm} + } + + \ctexset{ + chapter/numbering = false, + } + + \__bithesis_if_bachelor_thesis:TF { + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \ctexset{ + chapter = { + titleformat = {\heiti\zihao{3}\centering\textbf}, + } + } + } { + \ctexset{ + chapter = { + titleformat = {\heiti\zihao{-3}\centering\textmd}, + } + } + } + } { + \ctexset { + chapter/titleformat = {\heiti\zihao{3}\centering\textbf} + } + } + + { + \__bithesis_same_page: + \bool_if:nTF {\l__bithesis_add_to_toc_bool} { + \chapter{\c__bithesis_label_abstract_en_tl} + } { + \chapter*{\c__bithesis_label_abstract_en_tl} + } + } + } + { + \par\vspace{3ex}\noindent\textbf{\c__bithesis_label_keywords_en_tl \l__bithesis_value_keywords_en_tl} + \newpage + } + + \NewDocumentEnvironment {conclusion} {} + { + \ctexset{ + section/number = \arabic{section} + } + + \__bithesis_if_thesis_english:TF { + \chapter{\c__bithesis_label_conclusion_en_tl} + } { + \chapter{\c__bithesis_label_conclusion_tl} + } + } + {} + + \NewDocumentEnvironment {bibprint} {} + { + % 设置参考文献字号为 5 号 + \renewcommand*{\bibfont}{\zihao{5}} + % 设置参考文献各个项目之间的垂直距离为 0 + \setlength{\bibitemsep}{0ex} + \setlength{\bibnamesep}{0ex} + \setlength{\bibinitsep}{0ex} + \__bithesis_if_graduate:TF { + } { + % 「本科生」设置单倍行距 + \renewcommand{\baselinestretch}{1.2} + } + % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 + \setlength{\biblabelsep}{1.7mm} + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + \RenewDocumentCommand \itemcmd {} { + \addvspace{\bibitemsep} % 恢复 \bibitemsep 的作用 + \mkgbnumlabel{\printfield{labelnumber}} + \hspace{\biblabelsep} + } + \__bithesis_if_thesis_english:TF { + \chapter{\c__bithesis_label_reference_en_tl} + } { + \chapter{\c__bithesis_label_reference_tl} + } + } + {} + + % #1: The name that used as chapter title + % #2: The name that used in ToC. + \NewDocumentEnvironment {appendices} { oo } + { + % Used in chapter, ToC. + \tl_new:N \l__bithesis_appendix_plain_label_tl + % Used before reference label. + \tl_new:N \l__bithesis_appendix_title_tl + + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_en_tl} + \tl_set:Nn \l__bithesis_appendix_title_tl {\c__bithesis_label_appendix_en_tl} + } { + \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_tl} + \tl_set:Nn \l__bithesis_appendix_title_tl {\c__bithesis_label_appendix_tl} + } + + \ctexset{ + section/number = \l__bithesis_appendix_plain_label_tl\hspace{1ex}\Alph{section}, + subsection/number = \Alph{section}. \arabic{subsection}, + } + + \IfValueTF {#1} { + \chapter*{#1} + \stepcounter{chapter} + \IfValueTF {#2} { + \addcontentsline{toc}{chapter}{#2} + } { + \addcontentsline{toc}{chapter}{\l__bithesis_appendix_title_tl} + } + } { + \chapter{\l__bithesis_appendix_title_tl} + } + + \cs_set:Npn \thechapter { + \Alph{section} + } + } + {} + + \NewDocumentEnvironment {acknowledgements} {+b} + { + \begin{blindPeerReview} + \ctexset{ + section/number = \arabic{section}, + subsection/number = \arabic{section}. \arabic{subsection}, + } + + \__bithesis_if_thesis_english:TF { + \chapter{\c__bithesis_label_ack_en_tl} + } { + \chapter{\c__bithesis_label_ack_tl} + } + #1 + \end{blindPeerReview} + } {} + + \NewDocumentEnvironment {publications} {+b} + { + \begin{blindPeerReview} + % 设置参考文献字号为 5 号 + \renewcommand*{\bibfont}{\zihao{5}} + % 设置参考文献各个项目之间的垂直距离为 0 + \setlength{\bibitemsep}{0ex} + \setlength{\bibnamesep}{0ex} + \setlength{\bibinitsep}{0ex} + % 设置单倍行距 + \renewcommand{\baselinestretch}{1.2} + % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 + \setlength{\biblabelsep}{1.7mm} + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + \RenewDocumentCommand \itemcmd {} { + \addvspace{\bibitemsep} % 恢复 \bibitemsep 的作用 + \mkgbnumlabel{\printfield{labelnumber}} + \hspace{\biblabelsep} + } + + % ===== 上方定义与「参考文献」部分相同 + \cs_set:Npn \mkbibnamegiven ##1 { + \ifitemannotation{myself}{\textbf{##1}}{##1} + } + + \cs_set:Npn \mkbibnamefamily ##1 { + \ifitemannotation{myself}{\textbf{##1}}{##1} + } + + % Sorting by year, name, type. + \newrefcontext[sorting=ynt] + \chapter{\c__bithesis_label_publications_tl} + #1 + \end{blindPeerReview} + } + {} + + \NewDocumentEnvironment {resume} {+b} + { + \begin{blindPeerReview} + \chapter{\c__bithesis_label_resume_tl} + #1 + \end{blindPeerReview} + } + { + } + + \NewDocumentEnvironment {symbols} {o} + { + \IfValueT {#1} { + \keys_set:nn { bit / symbols } {#1} + } + + \bool_if:NTF \l__bithesis_add_to_toc_bool { + \chapter{\c__bithesis_label_symbols_tl} + } { + \chapter*{\c__bithesis_label_symbols_tl} + } + \zihao{-4} + \begin{itemize}[labelwidth=2.5cm,labelsep=0.5cm,leftmargin=3cm,itemindent=0cm,itemsep=0cm] + \cs_set:Npn \makelabel ##1 {##1\hfil} + } + { + \end{itemize} + } + + +\endinput +%% +%% End of file `bithesis.cls'. diff --git a/templates/undergraduate-thesis-en/chapters/0_abstract.tex b/templates/undergraduate-thesis-en/chapters/0_abstract.tex index a1c6748a..da6218c1 100644 --- a/templates/undergraduate-thesis-en/chapters/0_abstract.tex +++ b/templates/undergraduate-thesis-en/chapters/0_abstract.tex @@ -21,7 +21,7 @@ % % https://github.com/BITNP/BIThesis -\begin{abstract*} +\begin{abstractEn} Conventional product development employs a design-build-test philosophy. The sequentially executed development process often results in prolonged lead times and elevated product costs. The proposed e-Design paradigm employs @@ -31,4 +31,4 @@ trade-offs for design decision making. Physical prototypes of the product design are then produced using the rapid prototyping (RP) technique and computer numerical control (CNC) to support design verification and functional prototyping, respectively. -\end{abstract*} +\end{abstractEn} diff --git a/templates/undergraduate-thesis-en/main.tex b/templates/undergraduate-thesis-en/main.tex index 6fc6aba1..fad496d1 100644 --- a/templates/undergraduate-thesis-en/main.tex +++ b/templates/undergraduate-thesis-en/main.tex @@ -1,5 +1,5 @@ %% -% The BIThesis Template for Bachelor Graduation Thesis +% The BIThesis Template for Undergraduate Thesis % % 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 % @@ -18,16 +18,21 @@ % The Current Maintainer of this work is Feng Kaiyu. % % Compile with: xelatex -> biber -> xelatex -> xelatex +%% \documentclass[type=bachelor_english]{bithesis} -% 如果想要修改样式,但无法找到样式在哪里定义:请参考 https://bithesis.bitnp.net/Guide/4-Others/Troubleshooting.html#%E6%83%B3%E8%A6%81%E4%BF%AE%E6%94%B9%E9%83%A8%E5%88%86%E6%A0%B7%E5%BC%8F-%E4%BD%86%E6%98%AF%E6%89%BE%E4%B8%8D%E5%88%B0%E6%A0%B7%E5%BC%8F%E5%9C%A8%E5%93%AA%E9%87%8C%E5%AE%9A%E4%B9%89 \BITSetup{ cover = { + % 封面需要「北京理工大学」字样图片,如无必要请勿修改该项。 headerImage = images/header.png, + % 封面标题需要“华文细黑”,如无必要请勿修改该项。 xiheiFont = STXIHEI.TTF, }, info = { + % 想要删除某项封面信息,直接删除该项即可。 + % 想要让某项封面信息留空(但是保留下划线),请设置为空字符串。 + % 如需要换行,则用 “\\” 符号分割。 titleEn = Your Thesis Title, school = School of Mechanical Engineering, major = Bechelor of Science in Mechanical Engineering, @@ -39,6 +44,7 @@ % externalSupervisor = 左偏树, }, style = { + % 如无必要请勿修改该项。 % head = {自定义页眉文字} } } @@ -87,20 +93,21 @@ % 第一章 \input{chapters/1_chapter1.tex} -% 在这里添加第二章、第三章……TeX 文件的引用 +% 在这里添加第二章、第三章的 TeX 文件的引用 \input{chapters/2_chapter2.tex} \input{chapters/3_chapter3.tex} +% 后置内容 \backmatter % 结论:在结论相应的 TeX 文件处进行结论部分的撰写 -\input{misc/3_conclusions.tex} +\input{misc/1_conclusions.tex} % 参考文献:如无特殊需要,参考文献相应的 TeX 文件无需改动,添加参考文献请使用 BibTeX 的格式 % 添加至 misc/ref.bib 中,并在正文的相应位置使用 \cite{xxj} 的格式引用参考文献 -\input{misc/4_references.tex} +\input{misc/2_references.tex} % 附录:在附录相应的 TeX 文件处进行附录部分的撰写 -\input{misc/5_appendices.tex} +\input{misc/3_appendices.tex} % 致谢:在致谢相应的 TeX 文件处进行致谢部分的撰写 -\input{misc/6_acknowledgements.tex} +\input{misc/4_acknowledgements.tex} \end{document} diff --git a/templates/undergraduate-thesis-en/misc/3_conclusions.tex b/templates/undergraduate-thesis-en/misc/1_conclusions.tex similarity index 50% rename from templates/undergraduate-thesis-en/misc/3_conclusions.tex rename to templates/undergraduate-thesis-en/misc/1_conclusions.tex index 3b5123bb..3f7fe6bf 100644 --- a/templates/undergraduate-thesis-en/misc/3_conclusions.tex +++ b/templates/undergraduate-thesis-en/misc/1_conclusions.tex @@ -1,3 +1,25 @@ +%% +% The BIThesis Template for Undergraduate Thesis +% +% 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 +% +% Copyright 2021-2022 BITNP +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Feng Kaiyu. +% +% Compile with: xelatex -> biber -> xelatex -> xelatex +%% + \begin{conclusion} During the 1980s, design-for-manufacturing practices were put into place in thousands of firms. Today DFM is an essential part of almost every product development effort. No longer can designers “throw the design over the wall” to production engineers. As a result of this emphasis on improved design quality, some manufacturers claim to have reduced production costs of products by up to 50 percent. In fact, comparing current new product designs with earlier generations, one can usually identify fewer parts in the new product, as well as new materials, more integrated and custom parts, higher-volume standard parts and subassemblies, and simpler assembly procedures. \end{conclusion} diff --git a/templates/undergraduate-thesis-en/misc/1_originality.tex b/templates/undergraduate-thesis-en/misc/1_originality.tex deleted file mode 100644 index 0642275e..00000000 --- a/templates/undergraduate-thesis-en/misc/1_originality.tex +++ /dev/null @@ -1,89 +0,0 @@ -%% -% The BIThesis Template for Bachelor Graduation Thesis -% -% 北京理工大学毕业设计(论文)原创性声明页 —— 使用 XeLaTeX 编译 -% -% Copyright 2020-2022 BITNP -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 -% of this license or (at your option) any later version. -% The latest version of this license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2005/12/01 or later. -% -% This work has the LPPL maintenance status `maintained'. -% -% The Current Maintainer of this work is Feng Kaiyu. -% -% 如无特殊需要,本页面无需更改 - -% 原创性声明页无页码页面格式 -\fancypagestyle{originality}{ - % 页眉高度 - \setlength{\headheight}{20pt} - - % 页眉和页脚(页码)的格式设定 - \fancyhf{} - \fancyhead[C]{\zihao{4}\ziju{0.08}\songti{北京理工大学本科生毕业设计(论文)}} - - % 页眉分割线稍微粗一些 - \renewcommand{\headrulewidth}{0.6pt} -} - -\pagestyle{originality} -\topskip=0pt - -% 圆形数字编号定义 -\newcommand{\circled}[2][]{\tikz[baseline=(char.base)] - {\node[shape = circle, draw, inner sep = 1pt] - (char) {\phantom{\ifblank{#1}{#2}{#1}}}; - \node at (char.center) {\makebox[0pt][c]{#2}};}} -\robustify{\circled} - -% 设置行间距 -\setlength{\parskip}{0.4em} -\renewcommand{\baselinestretch}{1.41} - -% 顶部空白 -\vspace*{-6mm} - -% 原创性声明部分 -\begin{center} - \heiti\zihao{2}\textbf{原创性声明} -\end{center} - -% 本部分字号为小三 -\zihao{-3} - -本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,本文不包含任何其他个人或集体已经发表或撰写过的研究成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。 - -特此申明。 - -\vspace{13mm} - -\begin{flushright} - 本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日 -\end{flushright} - -\vspace{17mm} - -% 使用授权声明部分 -\begin{center} - \heiti\zihao{2}\textbf{关于使用授权的声明} -\end{center} - -本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,其中包括:\circled{1}学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;\circled{2}学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);\circled{3}学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);\circled{5}学校可以公布本毕业设计(论文)的全部或部分内容。 - -\vspace*{1mm} - -\begin{flushright} - \begin{spacing}{1.65} - \zihao{-3} - 本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日\\ - 指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日 - \end{spacing} -\end{flushright} - -\newpage diff --git a/templates/undergraduate-thesis-en/misc/2_references.tex b/templates/undergraduate-thesis-en/misc/2_references.tex new file mode 100644 index 00000000..11aeb340 --- /dev/null +++ b/templates/undergraduate-thesis-en/misc/2_references.tex @@ -0,0 +1,25 @@ +%% +% The BIThesis Template for Undergraduate Thesis +% +% 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 +% +% Copyright 2021-2022 BITNP +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Feng Kaiyu. +% +% Compile with: xelatex -> biber -> xelatex -> xelatex +%% + +\begin{bibprint} + \printbibliography[heading=none] +\end{bibprint} diff --git a/templates/undergraduate-thesis-en/misc/5_appendices.tex b/templates/undergraduate-thesis-en/misc/3_appendices.tex similarity index 55% rename from templates/undergraduate-thesis-en/misc/5_appendices.tex rename to templates/undergraduate-thesis-en/misc/3_appendices.tex index bba958ca..56e624ad 100644 --- a/templates/undergraduate-thesis-en/misc/5_appendices.tex +++ b/templates/undergraduate-thesis-en/misc/3_appendices.tex @@ -1,3 +1,25 @@ +%% +% The BIThesis Template for Undergraduate Thesis +% +% 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 +% +% Copyright 2021-2022 BITNP +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Feng Kaiyu. +% +% Compile with: xelatex -> biber -> xelatex -> xelatex +%% + \begin{appendices} \section{Design Structure Matrix Example} One of the most useful applications of the design structure matrix (DSM) method is to represent well-established, but complex, engineering design processes. This rich process modeling approach facilitates: diff --git a/templates/undergraduate-thesis-en/misc/4_acknowledgements.tex b/templates/undergraduate-thesis-en/misc/4_acknowledgements.tex new file mode 100644 index 00000000..869262be --- /dev/null +++ b/templates/undergraduate-thesis-en/misc/4_acknowledgements.tex @@ -0,0 +1,43 @@ +%% +% The BIThesis Template for Undergraduate Thesis +% +% 北京理工大学毕业设计(论文) —— 使用 XeLaTeX 编译 +% +% Copyright 2021-2022 BITNP +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Feng Kaiyu. +% +% Compile with: xelatex -> biber -> xelatex -> xelatex +%% + +\begin{acknowledgements} +acknowledgements This book contains material developed for use +in the interdisciplinary courses on product development that we teach. +Participants in these courses include graduate students in engineering, +industrial design students, and MBA students. While we +aimed the book at interdisciplinary graduate-level audiences such +as this, many faculty teaching graduate and undergraduate courses +in engineering design have also found the material useful. Product +Design and Development is also for practicing professionals. Indeed, +we could not avoid writing for a professional audience, +because most of our students are themselvesprofessionals who have worked +either in product development or in closely related functions. + +This book blends the perspectives of marketing, design, and manufacturing into +a single approach to product development. As a result, we provide students +of all kinds with an appreciation for the realities of industrial practice +and for the complex and essential roles played by the various members of +product development teams. For industrial practitioners, in particular, +we provide a set of product development methods that can be +put into immediate practice on development projects. +\end{acknowledgements} diff --git a/templates/undergraduate-thesis-en/misc/4_references.tex b/templates/undergraduate-thesis-en/misc/4_references.tex deleted file mode 100644 index e8b11faa..00000000 --- a/templates/undergraduate-thesis-en/misc/4_references.tex +++ /dev/null @@ -1,3 +0,0 @@ -\begin{bibprint} - \printbibliography[heading=none] -\end{bibprint} diff --git a/templates/undergraduate-thesis-en/misc/6_acknowledgements.tex b/templates/undergraduate-thesis-en/misc/6_acknowledgements.tex deleted file mode 100644 index 7aef10ae..00000000 --- a/templates/undergraduate-thesis-en/misc/6_acknowledgements.tex +++ /dev/null @@ -1,4 +0,0 @@ -\begin{acknowledgements} -acknowledgements This book contains material developed for use in the interdisciplinary courses on product development that we teach. Participants in these courses include graduate students in engineering, industrial design students, and MBA students. While we aimed the book at interdisciplinary graduate-level audiences such as this, many faculty teaching graduate and undergraduate courses in engineering design have also found the material useful. Product Design and Development is also for practicing professionals. Indeed, we could not avoid writing for a professional audience, because most of our students are themselvesprofessionals who have worked either in product development or in closely related functions. - This book blends the perspectives of marketing, design, and manufacturing into a single approach to product development. As a result, we provide students of all kinds with an appreciation for the realities of industrial practice and for the complex and essential roles played by the various members of product development teams. For industrial practitioners, in particular, we provide a set of product development methods that can be put into immediate practice on development projects. -\end{acknowledgements} diff --git a/templates/undergraduate-thesis/bithesis.cls b/templates/undergraduate-thesis/bithesis.cls new file mode 100644 index 00000000..e2155b36 --- /dev/null +++ b/templates/undergraduate-thesis/bithesis.cls @@ -0,0 +1,1589 @@ +%% +%% This is file `bithesis.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% bithesis.dtx (with options: `cls,thesis') +%% +%% Copyright (C) 2022 +%% Association of Bit Network Pioneer and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2020/11/27 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Feng Kaiyu. +%% ------------------------------------------------------------------------------ +%% +\RequirePackage{expl3,l3keys2e} +\ProvidesExplClass{bithesis} +{2022-06-10}{3.0.0}{BIT Thesis Templates} +%%%% TODO: + + +\int_new:N \g__bithesis_thesis_type_int +\int_new:N \g__bithesis_head_zihao_int +\bool_new:N \g__bithesis_twoside_bool +\bool_new:N \g__bithesis_thesis_type_english_bool +\bool_new:N \g__bithesis_blind_mode_bool +\tl_new:N \g__bithesis_label_devide_char_tl + +\seq_new:N \l__bithesis_right_seq +\seq_new:N \l__bithesis_left_seq + + +\cs_generate_variant:Nn \tl_if_empty:nTF {e} +\cs_generate_variant:Nn \seq_set_split:Nnn {Nne} + +\cs_new:Npn \__bithesis_same_page: { + \let\clearpage\relax + \let\cleardoublepage\relax +} + +\cs_new:Npn \__bithesis_if_graduate:TF #1#2 { + \int_compare:nNnTF {3} < {\g__bithesis_thesis_type_int} + {#1} + {#2} + } + +\cs_new:Npn \__bithesis_if_thesis_int_type:nTF #1#2#3 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {#1} {#2} {#3}} +\cs_new:Npn \__bithesis_if_thesis_int_type:nT #1#2 {\__bithesis_if_thesis_int_type:nTF {#1} {#2} {}} + +\cs_new:Npn \__bithesis_if_thesis_english:TF #1#2 {\bool_if:nTF {\g__bithesis_thesis_type_english_bool} {#1} {#2}} +\cs_new:Npn \__bithesis_if_thesis_english:T #1 {\__bithesis_if_thesis_english:TF {#1}{}} + +\cs_new:Npn \__bithesis_if_bachelor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} < {4} {#1} {#2}} +\cs_new:Npn \__bithesis_if_bachelor_thesis:T #1 {\__bithesis_if_bachelor_thesis:TF {#1} {}} +\cs_new:Npn \__bithesis_if_master_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {4} {#1} {#2}} +\cs_new:Npn \__bithesis_if_doctor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {5} {#1} {#2}} + +\clist_const:Nn \c__bithesis_thesis_type_clist + { bachelor, bachelor_translation, bachelor_english, master, docter} + +\cs_new_protected:Npn \__bithesis_define_label:nn #1#2 + { \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} } + +\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnn #1#2#3 + { + \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} + } + +\cs_new_protected:Npn \__bithesis_define_label:nnn #1#2#3 + { + \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} + \tl_const:cn { c__bithesis_label_ #1 _en_tl } {#3} + } + +\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnnn #1#2#3#4 + { + \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} + \tl_const:cn { c__bithesis_ #1 _label_ #2 _en_tl } {#4} + } + +\clist_map_inline:nn + { + {code} {代码}, + {udc} {UDC分类号:}, + {classification} {中国分类号:}, + {classified_level} {密级}, + {type} {种类}, + } + {\__bithesis_define_label:nn #1} + +\clist_map_inline:nn + { + {title} {本科生毕业设计(论文)}, + {originality} {原创性声明}, + {originality_clause} {本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,本文不包含任何其他个人或集体已经发表或撰写过的研究成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par~特此申明。}, + {authorization} {关于使用授权的声明}, + {authorization_clause} {本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,其中包括:\circled{1}~学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;\circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);\circled{3}~学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}~学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);\circled{5}~学校可以公布本毕业设计(论文)的全部或部分内容。}, + {originality_author_signature} {本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, + {originality_supervisor_signature} {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, + } {\__bithesis_define_label_by_thesis_type:nnn {bachelor} #1} + +\clist_map_inline:nn + { + {title} {}, + {originality} {原创性声明~Statement~of~Originality}, + {originality_clause} { + 本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,本文不包含任何其他个人或集体已经发表或撰写过的研究成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。特此申明。\par + \arialfamily I,\dunderline[-1pt]{1pt}{\makebox[18mm]{}},~solemnly~ + declare:~the~submitted~graduation~design~(thesis),~is~the~research~achievement~completed~independently~by~myself~ + under~the~guidance~of~the~supervisor.~This~article~does~not~contain~ + any~research~published~or~written~by~any~other~individual~or~group,~ + except~as~already~referenced~in~this~paper.~Individuals~and~groups~ + that~have~made~important~contributions~to~the~study~of~this~paper~ + are~clearly~indicated~and~cited~in~the~paper.\par + }, + {authorization} {关于使用授权的声明~State~of~Use~Authorization}, + {authorization_clause} { + 本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,其中包括:\circled{1}学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;\circled{2}学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);\circled{3}学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);\circled{5}学校可以公布本毕业设计(论文)的全部或部分内容。\par + I~fully~understand~the~regulations~on~the~storage,~use~of~graduation~design~(thesis)~in~Beijing~Institute~of~Technology.~Beijing~Institute~of~Technology~has~the~right~to~(1)~keep,~and~to~the~relevant~departments~to~send~the~original~or~copy~of~this~graduation~design~(thesis);~(2)~copy~and~preserve~this~graduation~design~(thesis)~by~photocopying,~miniature~or~other~means~of~reproduction;~(3)~allow~this~graduation~design~(thesis)~to~be~read~or~borrowed;~(4)~for~the~purpose~of~academic~exchange,~copy,~give~and~exchange~this~graduation~design~(thesis);~(5)~publish~all~or~part~of~the~contents~of~this~graduation~design~(thesis).~ + }, + } {\__bithesis_define_label_by_thesis_type:nnn {bachelor_english} #1} + +\cs_new:Npn \smallgap: { + \hspace{0.45ex} +} + +\cs_new:Npn \label_space: { + \__bithesis_if_bachelor_thesis:T { + \quad + } +} + +\clist_map_inline:nn + { + {originality} {研究成果声明}, + {originality_clause} {本人郑重声明:所提交的学位论文是我本人在指导教师的指导下进行的研究工作获得的研究成果。尽我所知,文中除特别标注和致谢的地方外,学位论文中不包含其他人已经发表或撰写过的研究成果,也不包含为获得北京理工大学或其它教育机构的学位或证书所使用过的材料。与我一同工作的合作者对此研究工作所做的任何贡献均已在学位论文中作了明确的说明并表示了谢意。\par~特此申明。}, + {authorization} {关于学位论文使用权的说明}, + {authorization_clause} {本人完全了解北京理工大学有关保管、使用学位论文的规定,其中包括:\circled{1}~学校有权保管、并向有关部门送交学位论文的原件与复印件;\circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存学位论文;\circled{3}~学校可允许学位论文被查阅或借阅;\circled{4}~学校可以学术交流为目的,复制赠送和交换学位论文;\circled{5}~学校可以公布学位论文的全部或部分内容(保密学位论文在解密后遵守此规定)。}, + {originality_author_signature} {签\qquad 名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, + {originality_supervisor_signature} {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, + } {\__bithesis_define_label_by_thesis_type:nnn {graduate} #1} + +\clist_map_inline:nn + { + {author} {作\quad 者\quad 姓\quad 名} {Candiate~Name}, + {school} {学\quad 院\quad 名\quad 称} {School~or~Department}, + {supervisor} {指\quad 导\quad 教\quad 师} {Faculty~Mentor}, + {chairman} {答辩委员会主席} {Chair,~Thesis~Committee}, + {degree} {申\smallgap: 请\smallgap: 学\smallgap: 位\smallgap: 级\smallgap: 别} {Degree~Applied}, + {major} {学\quad 科\quad 专\quad 业} {Major}, + {institute} {学\smallgap: 位\smallgap: 授\smallgap: 予\smallgap: 单\smallgap: 位} {Degree~by}, + {defense_date} {论\smallgap: 文\smallgap: 答\smallgap: 辩\smallgap: 日\smallgap: 期} {The~Date~of~Defence}, + } {\__bithesis_define_label_by_thesis_type:nnnn {graduate} #1} + +\clist_map_inline:nn + { + {school} {学\qquad 院} {School}, + {major} {专\qquad 业} {Degree}, + {author} {学生姓名} {Author}, + {student_id} {学\qquad 号} {Student~ID}, + {supervisor} {指导教师} {Supervisor}, + {co_supervisor} {校外指导教师} {Co-Supervisor}, + {keywords} {关键词:} {Key~Words:~}, + {toc} {目\label_space: 录} {Table~of~Contents}, + {abstract} {摘\label_space: 要} {Abstract}, + {conclusion} {结\label_space: 论} {Conclusions}, + {appendix} {附\label_space: 录} {Appendices}, + {ack} {致\label_space: 谢} {Acknowledgement}, + {figure} {插\quad 图} {Illustrations}, + {table} {表\quad 格} {Tables}, + {appendix_prefix} {附录} {Appendix}, + {reference} {参考文献} {References}, + {university} {北京理工大学} {Beijing~Institute~of~Technology}, + {publications} {攻读学位期间发表论文与研究成果清单} {Publications~During~Studies}, + % TODO: Not so sure about the translation. + {resume} {作者简介} {}, + {symbols} {主要符号对照表} {}, + } + {\__bithesis_define_label:nnn #1} + +\clist_const:Nn \c__bithesis_bachelor_thesis_header_clist + {北京理工大学本科生毕业设计(论文), 北京理工大学本科生毕业设计(论文)外文翻译, Beijing~Institute~of~Technology~Bachelor's~Thesis } +\clist_const:Nn \c__bithesis_bachelor_thesis_cover_title_clist + { + 本科生毕业设计(论文), + 本科生毕业设计(论文)外文翻译, + Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis, + } + +\keys_define:nn { bithesis } +{ + info .meta:nn = { bithesis / info } {#1}, + misc .meta:nn = { bithesis / misc } {#1}, + cover .meta:nn = { bithesis / cover } {#1}, + style .meta:nn = { bithesis / style } {#1}, + option .meta:nn = { bithesis / option } {#1}, +} + +\keys_define:nn { bithesis / option } +{ + type .choice:, + type .value_required:n = true, + type .choices:Vn = + \c__bithesis_thesis_type_clist + { + \int_set_eq:NN \g__bithesis_thesis_type_int \l_keys_choice_int + \int_case:nn {\l_keys_choice_int} { + % 本科全英文也是英文模板。 + {3} {\bool_set_true:N \g__bithesis_thesis_type_english_bool} + } + }, + type .initial:n = bachelor, + twoside .bool_gset:N = \g__bithesis_twoside_bool, + blindPeerReview .bool_gset:N = \g__bithesis_blind_mode_bool, +} + +\keys_define:nn { bithesis / cover } + { + date .tl_set:N = \l__bithesis_cover_date_tl, + headerImage .tl_set:N = \l_bit_coverheaderimage_tl, + xiheiFont .tl_set:N = \l__bithesis_cover_xihei_font_path_tl, + xiheiFont .default:n = {STXihei}, + %% cover entry + dilimiter .tl_set:N = \l__bithesis_cover_dilimiter_tl, + labelAlign .tl_set:N = \l__bithesis_cover_label_align_tl, + labelAlign .initial:n = {r}, + valueAlign .tl_set:N = \l__bithesis_cover_value_align_tl, + valueAlign .initial:n = {c}, + labelMaxWidth .dim_set:N = \l__bithesis_cover_label_max_width_dim, + valueMaxWidth .dim_set:N = \l__bithesis_cover_value_max_width_dim, + autoWidth .bool_set:N = \l__bithesis_cover_auto_width_bool, + autoWidth .initial:n = {true}, + underlineThickness .dim_set:N = \l__bithesis_cover_underline_thickness_dim, + underlineThickness .initial:n = {1pt}, + underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, + underlineOffset .initial:n = { -10pt }, + } + +\keys_define:nn { bithesis / info } + { + title .tl_set:N = \l__bithesis_value_title_tl, + titleEn .tl_set:N = \l__bithesis_value_title_en_tl, + school .tl_set:N = \l__bithesis_value_school_tl, + major .tl_set:N = \l__bithesis_value_major_tl, + author .tl_set:N = \l__bithesis_value_author_tl, + studentId .tl_set:N = \l__bithesis_value_student_id_tl, + supervisor .tl_set:N = \l__bithesis_value_supervisor_tl, + externalSupervisor .tl_set:N = \l__bithesis_value_external_supervisor_tl, + keywords .tl_set:N = \l__bithesis_value_keywords_tl, + keywordsEn .tl_set:N = \l__bithesis_value_keywords_en_tl, + translationTitle .tl_set:N = \l__bithesis_value_trans_title_tl, + translationOriginTitle .tl_set:N = \l__bithesis_value_trans_origin_title_tl, + % 中国分类号,研究生学位论文使用 + classification .tl_set:N = \l__bithesis_value_classification_tl, + % UDC 分类号,研究生学位论文使用 + UDC .tl_set:N = \l__bithesis_value_udc_tl, + chairman .tl_set:N = \l__bithesis_value_chairman_tl, + degree .tl_set:N = \l__bithesis_value_degree_tl, + degreeEn .tl_set:N = \l__bithesis_value_degree_en_tl, + institute .tl_set:N = \l__bithesis_value_institute_tl, + institute .initial:n = {\c__bithesis_label_university_tl}, + defenseDate .tl_set:N = \l__bithesis_value_defense_date_tl, + authorEn .tl_set:N = \l__bithesis_value_author_en_tl, + schoolEn .tl_set:N = \l__bithesis_value_school_en_tl, + supervisorEn .tl_set:N = \l__bithesis_value_supervisor_en_tl, + chairmanEn .tl_set:N = \l__bithesis_value_chairman_en_tl, + majorEn .tl_set:N = \l__bithesis_value_major_en_tl, + instituteEn .tl_set:N = \l__bithesis_value_institute_en_tl, + instituteEn .initial:n = {\c__bithesis_label_university_en_tl}, + defenseDateEn .tl_set:N = \l__bithesis_value_defense_date_en_tl, + classifiedLevel .tl_set:N = \l__bithesis_value_classified_level_tl, + } + +\keys_define:nn { bithesis / misc } + { + arialFont .tl_set:N = \l__bithesis_misc_arial_font_path_tl, + } + +\keys_define:nn { bithesis / style } +{ + head .tl_set:N = \l__bithesis_style_head_tl, + head .initial:n = { + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} {北京理工大学本科生毕业设计(论文)} + {2} {北京理工大学本科生毕业设计(论文)外文翻译} + {3} {Beijing~Institute~of~Technology~Bachelor's~Thesis} + {4} {北京理工大学硕士学位论文} + {5} {北京理工大学博士学位论文} + } + } +} + +\ProcessKeysOptions { bithesis / option } + +\__bithesis_if_thesis_english:T { + \PassOptionsToClass{scheme=plain}{ctexbook} +} + +\bool_if:NTF \g__bithesis_twoside_bool {} { + \PassOptionsToClass{oneside,openany}{ctexbook} +} + +\DeclareOption*{ + \PassOptionsToClass{\CurrentOption}{ctexbook} +} +\ProcessOptions\relax +\LoadClass[zihao=-4,]{ctexbook} + +\RequirePackage{geometry} +\RequirePackage{xeCJK} +\RequirePackage{titletoc} +\RequirePackage{setspace} +\RequirePackage{graphicx} +\RequirePackage{fancyhdr} +\RequirePackage{pdfpages} +\RequirePackage{setspace} +\RequirePackage{booktabs} +\RequirePackage{multirow} +\RequirePackage{tikz} +\RequirePackage{etoolbox} +\RequirePackage{hyperref} +\RequirePackage{xcolor} +\RequirePackage{caption} +\RequirePackage{array} +\RequirePackage{amsmath} +\RequirePackage{amssymb} +\RequirePackage{pdfpages} +\RequirePackage{listings} +\RequirePackage{enumitem} +\RequirePackage{environ} + +\__bithesis_if_graduate:TF { + \int_set:Nn \g__bithesis_head_zihao_int {5} + \geometry{ + a4paper, + left=2.7cm, + bottom=2.5cm + 7bp, + top=3.5cm + 7bp, + right=2.7cm, + headsep = 3.5cm + 7bp - 2.5cm - 15bp, + headheight = 15 bp, + footskip = 2.5cm + 7bp - 1.8cm, + } +} { + \int_set:Nn \g__bithesis_head_zihao_int {4} + \geometry{ + a4paper, + left=3cm, + bottom=2.6cm + 7bp, + top=3.5cm + 7bp, + right=2.6cm, + headsep = 3.5cm + 7bp - 2.4cm - 20bp, + headheight = 20 bp, + footskip = 2.6cm + 7bp - 2cm, + } +} + +\setlength{\intextsep}{2\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} + +\setromanfont{Times~New~Roman} + +\ctex_at_end_preamble:n { + \__bithesis_if_thesis_english:TF { + \__bithesis_if_thesis_int_type:nT {3} { + % font Arial needed + \newfontfamily\arialfamily{Arial} + } + + } { + \tl_if_blank:VTF \l__bithesis_cover_xihei_font_path_tl {} + { + \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]{\l__bithesis_cover_xihei_font_path_tl} + } + } + + \__bithesis_if_thesis_int_type:nT {3} { + \RequirePackage[en-US]{datetime2} + \RequirePackage{indentfirst} + \DTMlangsetup[en-US]{dayyearsep={\space}} + } + + % Define biblatex category if it was imported. + \cs_if_exist:NT \DeclareBibliographyCategory { + \DeclareBibliographyCategory{mypub} + } +} + +\cs_new:Npn \xihei:n #1 { + \xeCJK_family_if_exist:nTF {xihei} { + \CJKfamily{xihei} #1 + }{ + \heiti #1 + } +} + +\cs_new:Npn \l__bithesis_title_font_cs:n #1 { + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \arialfamily #1 + } { + \heiti #1 + } +} + +\cs_new:Npn \l__bithesis_unnumchapter_style_cs:n #1 { + % 本科全英文、研究生学位论文需要加粗 + \int_compare:nNnTF {\g__bithesis_thesis_type_int} > {2} + { + \bfseries #1 + } { + \mdseries #1 + } +} + +\cs_set:Npn \arabicHeiti #1 {#1} + +\fancypagestyle{BIThesis}{ + \fancyhf{} + % 定义页眉、页码 + \fancyhead[C]{\zihao{\int_use:N \g__bithesis_head_zihao_int}\ziju{0.08}\songti{\tl_use:N \l__bithesis_style_head_tl}} + \fancyfoot[C]{\songti\zihao{5} \thepage} + % 页眉分割线稍微粗一些 + \RenewDocumentCommand \headrulewidth {} {0.6pt} +} + +\ctexset{chapter={ + number = {\arabicHeiti{ \arabic{chapter} }}, + format = { \l__bithesis_title_font_cs:n \bfseries \centering \zihao{3}}, + nameformat = {}, + titleformat = {}, + aftername = \hspace{9bp}, + pagestyle = BIThesis, + beforeskip = 8bp, + afterskip = 32bp, + fixskip = true, + } +} + +\ctexset{section={ + number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}}}, + format = {\l__bithesis_title_font_cs:n \raggedright \bfseries \zihao{4}}, + nameformat = {}, + titleformat = {}, + aftername = \hspace{8bp}, + beforeskip = 20bp plus 1ex minus .2ex, + afterskip = 18bp plus .2ex, + fixskip = true, + } +} + +\ctexset{subsection={ + number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}}}, + format = {\l__bithesis_title_font_cs:n \bfseries \raggedright \zihao{-4}}, + nameformat = {}, + titleformat = {}, + aftername = \hspace{7bp}, + beforeskip = 17bp plus 1ex minus .2ex, + afterskip = 14bp plus .2ex, + fixskip = true, + } +} + +\ctexset{ + secnumdepth = 3, + subsubsection={ + numbering = true, + number = {\arabicHeiti{\arabic{chapter}.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}.\hspace{1bp}\arabic{subsubsection}}}, + format={\l__bithesis_title_font_cs:n \bfseries \raggedright \zihao{-4}}, + nameformat = {}, + titleformat = {}, + beforeskip=28bp plus 1ex minus .2ex, + afterskip=24bp plus .2ex, + fixskip=true, + } +} + +\addtocontents{toc}{\protect\hypersetup{hidelinks}} + + +\__bithesis_if_graduate:TF { + % 各章标题,宋体四号 + \titlecontents{chapter}[0pt]{\songti \zihao{4}} + {\thecontentslabel\hspace{\ccwd}}{} + {\hspace{.5em}\titlerule*{.}\contentspage} +} { + \titlecontents{chapter}[0pt]{\songti \zihao{-4}} + {\thecontentslabel\hspace{\ccwd}}{} + {\hspace{.5em}\titlerule*{.}\contentspage} +} +\titlecontents{section}[1\ccwd]{\songti \zihao{-4}} +{\thecontentslabel\hspace{\ccwd}}{} +{\hspace{.5em}\titlerule*{.}\contentspage} +\titlecontents{subsection}[2\ccwd]{\songti \zihao{-4}} +{\thecontentslabel\hspace{\ccwd}}{} +{\hspace{.5em}\titlerule*{.}\contentspage} + +\bool_new:N \l__bithesis_add_to_toc_bool +\bool_set_true:N \l__bithesis_add_to_toc_bool + +\keys_define:nn { bit } + { + abstract .meta:nn = { bit / abstract } {#1}, + abstract_en .meta:nn = { bit / abstract_en } {#1}, + } + +\keys_define:nn { bit / abstract } + { + addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, + } + +\keys_define:nn { bit / abstract_en } + { + addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, + } + +\keys_define:nn { bit / symbols } + { + addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, + } + +\RenewDocumentCommand \frontmatter {} { + + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \pagenumbering{roman} + } { + \pagenumbering{Roman} + } + \ctexset{ + chapter = { + numbering = false, + } + } + \pagestyle{BIThesis} +} + +\RenewDocumentCommand \mainmatter {} { + \cleardoublepage + + \ctexset{ + chapter = { + numbering = true, + } + } + \pagenumbering{arabic} + \pagestyle{BIThesis} + % 正文 22 磅的行距 + \setlength{\parskip}{0em} + \setstretch{1.53} + % 修复脚注出现跨页的问题 + \interfootnotelinepenalty=10000 +} + +\RenewDocumentCommand \backmatter {} { + \setcounter{section}{0} + \setcounter{subsection}{0} + \setcounter{subsubsection}{0} + \ctexset{ + chapter = { + numbering = false, + beforeskip = 18bp, + format = {\l__bithesis_title_font_cs:n \l__bithesis_unnumchapter_style_cs:n \centering \zihao{3}}, + afterskip = 26bp, + } + } +} + +\setlength{\abovecaptionskip}{11pt} +\setlength{\belowcaptionskip}{9pt} + +\__bithesis_if_graduate:TF { + \tl_set:Nn \g__bithesis_label_devide_char_tl {.} +} { + \tl_set:Nn \g__bithesis_label_devide_char_tl {-} +} + +\cs_set:Npn \thefigure {\thechapter\g__bithesis_label_devide_char_tl\arabic{figure}} +\captionsetup[figure]{font=small,labelsep=space} + +\cs_set:Npn \thetable {\thechapter\g__bithesis_label_devide_char_tl\arabic{table}} +\captionsetup[table]{font=small,labelsep=space,skip=2pt} + +\cs_set:Npn \theequation {\thechapter\g__bithesis_label_devide_char_tl\arabic{equation}} + +\cs_set:Npn \thelstlisting {\thechapter\g__bithesis_label_devide_char_tl\arabic{lstlisting}} +\cs_set:Npn \lstlistingname {\c__bithesis_label_code_tl} + +\tolerance=1 +\emergencystretch=\maxdimen +\hyphenpenalty=10000 +\hbadness=10000 + +\definecolor{codegreen}{rgb}{0,0.6,0} +\definecolor{codegray}{rgb}{0.5,0.5,0.5} +\definecolor{codepurple}{rgb}{0.58,0,0.82} +\definecolor{backcolour}{rgb}{0.95,0.95,0.92} +\lstdefinestyle{examplestyle}{ + backgroundcolor=\color{backcolour}, + commentstyle=\color{codegreen}, + keywordstyle=\color{magenta}, + numberstyle=\tiny\color{codegray}, + stringstyle=\color{codepurple}, + basicstyle=\ttfamily\footnotesize, + breakatwhitespace=false, + breaklines=true, + captionpos=b, + keepspaces=true, + numbers=left, + numbersep=5pt, + showspaces=false, + showstringspaces=false, + showtabs=false, + tabsize=2 +} +\lstset{style=examplestyle} + +\cs_set:Npn \listfigurename {\c__bithesis_label_figure_tl} +\cs_set:Npn \listtablename {\c__bithesis_label_table_tl} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\DeclareDocumentCommand \BITSetup { m } + { \keys_set:nn { bithesis } { #1 }} + +\cs_new:Npn \__bithesis_render_cover_entry:nn #1#2 { + \makebox[\l__bithesis_cover_label_max_width_dim][\l__bithesis_cover_label_align_tl]{ + \tl_if_blank:VTF #1 {} {#1\l__bithesis_cover_dilimiter_tl} + } + \hspace{1ex} + \__bithesis_dunderline:nnn{\l__bithesis_cover_underline_offset_dim}{\l__bithesis_cover_underline_thickness_dim}{ + \makebox[\l__bithesis_cover_value_max_width_dim][\l__bithesis_cover_value_align_tl]{#2} + }\par +} + +\cs_new:Npn \__bithesis_get_text_width:Nn #1#2 + { + \hbox_set:Nn \l_tmpa_box {#2} + \dim_set:Nn #1 { \box_wd:N \l_tmpa_box } + } +\cs_generate_variant:Nn \__bithesis_get_text_width:Nn { NV } + +\cs_new:Npn \__bithesis_get_max_text_width:NN #1#2 + { + \group_begin: + \seq_set_eq:NN \l__bithesis_tmpa_seq #2 + \dim_zero_new:N \l__bithesis_tmpa_dim + \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_tmpa_seq } + { + \seq_pop_left:NN \l__bithesis_tmpa_seq \l__bithesis_tmpa_tl + \__bithesis_get_text_width:NV \l__bithesis_tmpa_dim \l__bithesis_tmpa_tl + \dim_gset:Nn #1 { \dim_max:nn {#1} { \l__bithesis_tmpa_dim } } + } + \group_end: + } + +\cs_new:Npn \__bithesis_parse_entry #1 #2 { + \seq_set_split:Nne \l__bithesis_tmp_right_seq {//} {#2} + \seq_clear:N \l__bithesis_tmp_left_seq + \seq_map_inline:Nn \l__bithesis_tmp_right_seq { + \seq_put_right:Nn \l__bithesis_tmp_left_seq {} + } + \seq_put_left:Nn \l__bithesis_tmp_left_seq {#1} + \seq_pop_right:NN \l__bithesis_tmp_left_seq \g__bithesis_trashcan_tl +} + +\cs_new:Npn \__bithesis_render_cover_entry:n #1 { + \seq_set_from_clist:NN \l__bithesis_input_seq #1 + % parse newline // + \seq_map_inline:Nn \l__bithesis_input_seq { + \__bithesis_parse_entry ##1 + \seq_concat:NNN \l__bithesis_right_seq \l__bithesis_right_seq \l__bithesis_tmp_right_seq + \seq_concat:NNN \l__bithesis_left_seq \l__bithesis_left_seq \l__bithesis_tmp_left_seq + } + + \bool_if:NT \l__bithesis_cover_auto_width_bool { + \__bithesis_get_max_text_width:NN \l__bithesis_cover_label_max_width_dim \l__bithesis_left_seq + \__bithesis_get_max_text_width:NN \l__bithesis_cover_value_max_width_dim \l__bithesis_right_seq + } + + \group_begin: + \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_left_seq } + { + \seq_pop_left:NN \l__bithesis_left_seq \l__bithesis_tmpa_tl + \seq_pop_left:NN \l__bithesis_right_seq \l__bithesis_tmpb_tl + \tl_if_empty:eTF \l__bithesis_tmpb_tl {} { + \__bithesis_render_cover_entry:nn {\l__bithesis_tmpa_tl} {\l__bithesis_tmpb_tl} + } + } + \group_end: +} + +\cs_new:Npn \__bithesis_dunderline:nnn #1#2#3 { + {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}} +} + +\cs_new:Npn \__bithesis_dunderline:nn #1#2 { + \__bithesis_dunderline:nnn {#1} {1pt} {#2} +} + +\cs_new:Npn \__bithesis_dunderline:n #1 { + \__bithesis_dunderline:nnn {-10pt} {1pt} {#1} +} + +\newcommand\dunderline[3][-1pt]{{% + \setbox0=\hbox{#3} + \ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}} + +\NewEnviron{blindPeerReview}{ + \bool_if:NTF \g__bithesis_blind_mode_bool {} { + \BODY + } +} + +\RenewDocumentCommand \cleardoublepage { } + { + \clearpage + \bool_if:NT \g__bithesis_twoside_bool + { + \int_if_odd:nF \c@page + { \hbox:n { } \thispagestyle { empty } \newpage } + } + } + +\cs_new:Npn \make_graduate_cover: { + \cleardoublepage + \begin{titlepage} + { + \heiti\zihao{5} + \tl_if_blank:VTF \l__bithesis_value_classified_level_tl {} { + \flushright + \c__bithesis_label_classified_level_tl:~ + \l__bithesis_value_classified_level_tl \par + } + } + \centering + \vspace*{65mm} + {\heiti\zihao{-2} \l__bithesis_value_title_tl} + \vskip 60mm + {\heiti \zihao{-3} \l__bithesis_value_author_tl} % 黑体 小三 + \vskip 10mm + {\heiti \zihao{-3} \l__bithesis_cover_date_tl} % 黑体 小三 + \end{titlepage} +} + +\cs_new:Npn \make_paper_back: { + \cleardoublepage + \begin{titlepage} + \vskip 5cm + \begin{center} + \setstretch{1.1} + \begin{minipage}[t][19.7cm]{2em} + \begin{center} + {\heiti\zihao{3}\l__bithesis_value_title_tl} + \vfill + {\heiti\zihao{3}\l__bithesis_value_author_tl} + \vfill + {\heiti\zihao{3}\c__bithesis_label_university_tl} + \end{center} + \end{minipage} + \end{center} + % \vskip 5cm + \end{titlepage} +} + +\cs_new:Npn \__bithesis_make_chinese_title_page: { + \cleardoublepage + \begin{titlepage} + { % + {\heiti \zihao{5} \noindent \c__bithesis_label_classification_tl} \l__bithesis_value_classification_tl\\ + {\heiti \zihao{5} \c__bithesis_label_udc_tl} \l__bithesis_value_udc_tl + } + \begin{center} + + \vskip \stretch{1} + {\heiti\zihao{-2} \l__bithesis_value_title_tl} + \vskip \stretch{1} + + % TODO: delete this? + {\fangsong\zihao{4}} + \def\tabcolsep{1pt} + \def\arraystretch{1.5} + + { + \renewcommand{\baselinestretch}{2} + + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\qquad} + } + \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {45mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {60mm} + } + } + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_graduate_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_graduate_label_school_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_graduate_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_graduate_label_chairman_tl} {\l__bithesis_value_chairman_tl}, + {\c__bithesis_graduate_label_degree_tl} {\l__bithesis_value_degree_tl}, + {\c__bithesis_graduate_label_major_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_graduate_label_institute_tl} {\l__bithesis_value_institute_tl}, + {\c__bithesis_graduate_label_defense_date_tl} {\l__bithesis_value_defense_date_tl}, + } + + \heiti\zihao{-3} + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + } + \end{center} + \vskip \stretch{0.5} + \end{titlepage} +} + +\cs_new:Npn \__bithesis_make_english_title_page: { + \begin{titlepage} + \begin{center} + + \vspace*{10em} + {\zihao{-2}\textbf{\l__bithesis_value_title_en_tl}} + % \bfseries + \vskip \stretch{1} + + { + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:~} + } + + \tl_set:Nn \l__bithesis_cover_label_align_tl {l} + \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} + + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {55mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {85mm} + } + } + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_graduate_label_author_en_tl} {\l__bithesis_value_author_en_tl}, + {\c__bithesis_graduate_label_school_en_tl} {\l__bithesis_value_school_en_tl}, + {\c__bithesis_graduate_label_supervisor_en_tl} {\l__bithesis_value_supervisor_en_tl}, + {\c__bithesis_graduate_label_chairman_en_tl} {\l__bithesis_value_chairman_en_tl}, + {\c__bithesis_graduate_label_degree_en_tl} {\l__bithesis_value_degree_en_tl}, + {\c__bithesis_graduate_label_major_en_tl} {\l__bithesis_value_major_en_tl}, + {\c__bithesis_graduate_label_institute_en_tl} {\l__bithesis_value_institute_en_tl}, + {\c__bithesis_graduate_label_defense_date_en_tl} {\l__bithesis_value_defense_date_en_tl}, + } + + \zihao{-3} + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + } + + \end{center} + + \vskip \stretch{0.5} + \end{titlepage} +} + +\DeclareDocumentCommand \MakeCover {} + { + \begin{blindPeerReview} + \group_begin: + + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} + { + \begin{titlepage} + \vspace*{16mm} + + \centering + + \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { + \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ + } + + \vspace*{-3mm} + + \zihao{-0}\textbf{\ziju{0.12}\songti{\c__bithesis_bachelor_label_title_tl}}\par + + \vspace{16mm} + + \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par + + \vspace{3mm} + + \begin{spacing}{1.2} + \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par + \end{spacing} + + \vspace{15mm} + + \begin{spacing}{1.8} + \begin{center} + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} + } + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} + } + } + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + } + + \zihao{3} + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{center} + \end{spacing} + + \vspace*{\fill} + \centering + \zihao{3}\ziju{0.5}\songti{ + \tl_if_empty:NTF \l__bithesis_cover_date_tl { + \today + } { + \l__bithesis_cover_date_tl + } + } + \end{titlepage} + } + {2} + { + \begin{titlepage} + \centering + + \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { + \includegraphics[width=6.87cm]{\l_bit_coverheaderimage_tl}\\ + } + + \vspace{1mm} + + \zihao{2}\textbf{\songti{本科生毕业设计(论文)外文翻译}} + + \vspace{8mm} + + { + + \begin{spacing}{1.8} + + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\textbf{:}} + \bool_set_false:N \l__bithesis_cover_auto_width_bool + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {115mm} + + \clist_set:Nn \l__bithesis_input_clist { + {\zihao{4}\textbf{外文原文题目}} {\l__bithesis_value_trans_origin_title_tl}, + {\zihao{4}\textbf{中文翻译题目}} {\l__bithesis_value_trans_title_tl}, + } + + \zihao{-3} + \centering + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{spacing} + + } + + \vspace{14mm} + + \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par + + \vspace{3mm} + + \begin{spacing}{1.2} + \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par + \end{spacing} + + \vspace{19mm} + + \begin{spacing}{1.8} + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} + } + + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} + } + } + + \zihao{3} + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + } + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{spacing} + + \vspace*{\fill} + \end{titlepage} + } + {3} { + \begin{titlepage} + \vspace*{16mm} + + \centering + + \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { + \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ + } + + \vspace*{-3mm} + + \zihao{1}\textbf{\ziju{0.12}Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis}\par + + \vspace{18mm} + + \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_en_tl}\par + + \vspace{10mm} + + \begin{spacing}{1.8} + \begin{center} + \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { + \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} + } + + % if not auto width, try override width + \bool_if:NF \l__bithesis_cover_auto_width_bool { + \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_label_max_width_dim {20mm} + } + \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { + \dim_set:Nn \l__bithesis_cover_value_max_width_dim {105mm} + } + } + + \zihao{4} + + \clist_set:Nn \l__bithesis_input_clist { + {\c__bithesis_label_school_en_tl} {\l__bithesis_value_school_tl}, + {\c__bithesis_label_major_en_tl} {\l__bithesis_value_major_tl}, + {\c__bithesis_label_author_en_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_en_tl} {\l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_en_tl} {\l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_en_tl} {\l__bithesis_value_external_supervisor_tl}, + } + + \__bithesis_render_cover_entry:n \l__bithesis_input_clist + + \end{center} + \end{spacing} + + \vspace*{\fill} + \centering + \zihao{3}\ziju{0.5}\songti{ + \tl_if_empty:NTF \l__bithesis_cover_date_tl { + \today + } { + \l__bithesis_cover_date_tl + } + } + \end{titlepage} + } + {4} { + \make_graduate_cover: + } + {5} { + \make_graduate_cover: + } + } + \group_end: + \end{blindPeerReview} + } + +\newcommand{\circled}[2][]{\tikz[baseline=(char.base)] + {\node[shape = circle, draw, inner~sep = 1pt] + (char) {\phantom{\ifblank{#1}{#2}{#1}}}; + \node at (char.center) {\makebox[0pt][c]{#2}};}} +\robustify{\circled} + +\cs_new:Npn \__bithesis_graduate_originality: { + \ctexset { + chapter / pagestyle = plain, + } + + \begin{titlepage} + \pagenumbering{gobble} + + % 原创性声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{3}\c__bithesis_graduate_label_originality_tl} + \end{center}~\par + + % 本部分字号为小三 + \zihao{4} + \c__bithesis_graduate_label_originality_clause_tl + + \vspace{17mm} + + \begin{flushright} + \c__bithesis_graduate_label_originality_author_signature_tl\par + \end{flushright} + + \vspace{16mm} + + % 使用授权声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{3}\c__bithesis_graduate_label_authorization_tl} + \end{center}~\par + + \c__bithesis_graduate_label_authorization_clause_tl + + \vspace*{15mm} + + \begin{flushright} + \begin{spacing}{1.65} + \zihao{4} + % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} + \c__bithesis_graduate_label_originality_author_signature_tl\par + \c__bithesis_graduate_label_originality_supervisor_signature_tl\par + \end{spacing} + \end{flushright} + \end{titlepage} + \cleardoublepage +} + +\NewDocumentCommand \MakeOriginality {} +{ + \group_begin: + \begin{blindPeerReview} + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} + { + \pagestyle{BIThesis} + \pagenumbering{gobble} + + % 原创性声明部分 + \begin{center} + \vspace*{-2bp} + \__bithesis_same_page: + \chapter*{\heiti\zihao{2}\c__bithesis_bachelor_label_originality_tl} + \end{center}~\par + + % 本部分字号为小三 + \zihao{-3} + \c__bithesis_bachelor_label_originality_clause_tl + + \vspace{17mm} + + \begin{flushright} + \c__bithesis_bachelor_label_originality_author_signature_tl\par + \end{flushright} + + \vspace{16mm} + + % 使用授权声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{2}\c__bithesis_bachelor_label_authorization_tl} + \end{center}~\par + + \c__bithesis_bachelor_label_authorization_clause_tl + + \vspace*{3mm} + + \begin{flushright} + \begin{spacing}{1.65} + \zihao{-3} + % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} + \c__bithesis_bachelor_label_originality_author_signature_tl\par + \c__bithesis_bachelor_label_originality_supervisor_signature_tl\par + \end{spacing} + \end{flushright} + + \newpage + } + {3} { + \setstretch{1.26} + % 原创性声明部分 + \begin{center} + \vspace*{-2bp} + \__bithesis_same_page: + \chapter*{\heiti\zihao{-2}\c__bithesis_bachelor_english_label_originality_tl} + \end{center}~\par + + % 本部分字号为小三 + \zihao{-4} + \c__bithesis_bachelor_english_label_originality_clause_tl + + \bigbreak + + Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~Date:\par + + \vspace{6mm} + + % 使用授权声明部分 + \begin{center} + \__bithesis_same_page: + \chapter*{\heiti\zihao{-2}\c__bithesis_bachelor_english_label_authorization_tl} + \end{center}~\par + + \c__bithesis_bachelor_english_label_authorization_clause_tl + + \bigbreak + Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm + 16bp]{}}~\hspace{2mm}Date:\par + Supervisor~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~\hspace{2mm}Date:\par + } + {4} {\__bithesis_graduate_originality:} + {5} {\__bithesis_graduate_originality:} + } + \end{blindPeerReview} + \group_end: +} + +\NewDocumentCommand \MakePaperBack {} + { + \begin{blindPeerReview} + \make_paper_back: + \end{blindPeerReview} + } + +\NewDocumentCommand \MakeTitle {} + { + \begin{blindPeerReview} + \__bithesis_make_chinese_title_page: + \__bithesis_make_english_title_page: + \end{blindPeerReview} + } + +\DeclareDocumentCommand \MakeTOC {} + { + { + \__bithesis_if_bachelor_thesis:TF { + \renewcommand{\baselinestretch}{1.35} + } { + \renewcommand{\baselinestretch}{1.56} + } + + \__bithesis_if_thesis_english:TF { + \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_en_tl} + } { + \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_tl} + } + + % 自定义目录样式 + \cs_set:Npn \contentsname { + \fontsize{16pt}{\baselineskip} + \l__bithesis_unnumchapter_style_cs:n\l__bithesis_title_font_cs:n{\l__bithesis_toc_title_tl} + \vspace{-8pt} + } + + % 制作目录 + \tableofcontents + + % 在本科生全英文模板中,添加「目录」本身到目录中。 + \__bithesis_if_thesis_int_type:nT {3} { + \addcontentsline{toc}{chapter}{\c__bithesis_label_toc_en_tl} + } + } + } + + % TODO: + \NewDocumentEnvironment {abstract} {o} + { + + \IfValueT {#1} { + \keys_set:nn { bit / abstract } {#1} + } + + \cleardoublepage + \setstretch{1.53} + + \__bithesis_if_bachelor_thesis:T { + \begin{center} + \vspace*{-17bp} + \heiti\zihao{-2}\textbf{ + \int_case:nn {\g__bithesis_thesis_type_int} + { + {1} {\l__bithesis_value_title_tl} + {2} {\l__bithesis_value_trans_title_tl} + {3} {\l__bithesis_value_title_tl} + } + } + \end{center} + + \vspace*{2mm} + } + + \ctexset{ + chapter/numbering = false, + } + + \__bithesis_if_bachelor_thesis:T { + \ctexset{ + chapter/titleformat = {\textmd} + } + } + + { + \__bithesis_same_page: + \bool_if:NTF \l__bithesis_add_to_toc_bool { + \chapter{\c__bithesis_label_abstract_tl} + } { + \chapter*{\c__bithesis_label_abstract_tl} + } + } + \vspace*{1mm} + \par + } + { + \par + \vspace{4ex}\noindent\textbf{\heiti \c__bithesis_label_keywords_tl \l__bithesis_value_keywords_tl}\par + \newpage + } + + \NewDocumentEnvironment {abstractEn} {o} + { + \IfValueT {#1} { + \keys_set:nn { bit / abstract_en } {#1} + } + + \cleardoublepage + \setstretch{1.53} + + \__bithesis_if_bachelor_thesis:T { + \begin{spacing}{0.95} + \centering + \vspace*{-2bp} + + \__bithesis_if_thesis_int_type:nTF {3} { + \arialfamily\zihao{-2}\textbf\l__bithesis_value_title_en_tl\\ + } { + \heiti\zihao{3}\textbf\l__bithesis_value_title_en_tl\\ + } + \end{spacing} + \vspace*{10mm} + } + + \ctexset{ + chapter/numbering = false, + } + + \__bithesis_if_bachelor_thesis:TF { + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \ctexset{ + chapter = { + titleformat = {\heiti\zihao{3}\centering\textbf}, + } + } + } { + \ctexset{ + chapter = { + titleformat = {\heiti\zihao{-3}\centering\textmd}, + } + } + } + } { + \ctexset { + chapter/titleformat = {\heiti\zihao{3}\centering\textbf} + } + } + + { + \__bithesis_same_page: + \bool_if:nTF {\l__bithesis_add_to_toc_bool} { + \chapter{\c__bithesis_label_abstract_en_tl} + } { + \chapter*{\c__bithesis_label_abstract_en_tl} + } + } + } + { + \par\vspace{3ex}\noindent\textbf{\c__bithesis_label_keywords_en_tl \l__bithesis_value_keywords_en_tl} + \newpage + } + + \NewDocumentEnvironment {conclusion} {} + { + \ctexset{ + section/number = \arabic{section} + } + + \__bithesis_if_thesis_english:TF { + \chapter{\c__bithesis_label_conclusion_en_tl} + } { + \chapter{\c__bithesis_label_conclusion_tl} + } + } + {} + + \NewDocumentEnvironment {bibprint} {} + { + % 设置参考文献字号为 5 号 + \renewcommand*{\bibfont}{\zihao{5}} + % 设置参考文献各个项目之间的垂直距离为 0 + \setlength{\bibitemsep}{0ex} + \setlength{\bibnamesep}{0ex} + \setlength{\bibinitsep}{0ex} + \__bithesis_if_graduate:TF { + } { + % 「本科生」设置单倍行距 + \renewcommand{\baselinestretch}{1.2} + } + % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 + \setlength{\biblabelsep}{1.7mm} + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + \RenewDocumentCommand \itemcmd {} { + \addvspace{\bibitemsep} % 恢复 \bibitemsep 的作用 + \mkgbnumlabel{\printfield{labelnumber}} + \hspace{\biblabelsep} + } + \__bithesis_if_thesis_english:TF { + \chapter{\c__bithesis_label_reference_en_tl} + } { + \chapter{\c__bithesis_label_reference_tl} + } + } + {} + + % #1: The name that used as chapter title + % #2: The name that used in ToC. + \NewDocumentEnvironment {appendices} { oo } + { + % Used in chapter, ToC. + \tl_new:N \l__bithesis_appendix_plain_label_tl + % Used before reference label. + \tl_new:N \l__bithesis_appendix_title_tl + + \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} + { + \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_en_tl} + \tl_set:Nn \l__bithesis_appendix_title_tl {\c__bithesis_label_appendix_en_tl} + } { + \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_tl} + \tl_set:Nn \l__bithesis_appendix_title_tl {\c__bithesis_label_appendix_tl} + } + + \ctexset{ + section/number = \l__bithesis_appendix_plain_label_tl\hspace{1ex}\Alph{section}, + subsection/number = \Alph{section}. \arabic{subsection}, + } + + \IfValueTF {#1} { + \chapter*{#1} + \stepcounter{chapter} + \IfValueTF {#2} { + \addcontentsline{toc}{chapter}{#2} + } { + \addcontentsline{toc}{chapter}{\l__bithesis_appendix_title_tl} + } + } { + \chapter{\l__bithesis_appendix_title_tl} + } + + \cs_set:Npn \thechapter { + \Alph{section} + } + } + {} + + \NewDocumentEnvironment {acknowledgements} {+b} + { + \begin{blindPeerReview} + \ctexset{ + section/number = \arabic{section}, + subsection/number = \arabic{section}. \arabic{subsection}, + } + + \__bithesis_if_thesis_english:TF { + \chapter{\c__bithesis_label_ack_en_tl} + } { + \chapter{\c__bithesis_label_ack_tl} + } + #1 + \end{blindPeerReview} + } {} + + \NewDocumentEnvironment {publications} {+b} + { + \begin{blindPeerReview} + % 设置参考文献字号为 5 号 + \renewcommand*{\bibfont}{\zihao{5}} + % 设置参考文献各个项目之间的垂直距离为 0 + \setlength{\bibitemsep}{0ex} + \setlength{\bibnamesep}{0ex} + \setlength{\bibinitsep}{0ex} + % 设置单倍行距 + \renewcommand{\baselinestretch}{1.2} + % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 + \setlength{\biblabelsep}{1.7mm} + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + \RenewDocumentCommand \itemcmd {} { + \addvspace{\bibitemsep} % 恢复 \bibitemsep 的作用 + \mkgbnumlabel{\printfield{labelnumber}} + \hspace{\biblabelsep} + } + + % ===== 上方定义与「参考文献」部分相同 + \cs_set:Npn \mkbibnamegiven ##1 { + \ifitemannotation{myself}{\textbf{##1}}{##1} + } + + \cs_set:Npn \mkbibnamefamily ##1 { + \ifitemannotation{myself}{\textbf{##1}}{##1} + } + + % Sorting by year, name, type. + \newrefcontext[sorting=ynt] + \chapter{\c__bithesis_label_publications_tl} + #1 + \end{blindPeerReview} + } + {} + + \NewDocumentEnvironment {resume} {+b} + { + \begin{blindPeerReview} + \chapter{\c__bithesis_label_resume_tl} + #1 + \end{blindPeerReview} + } + { + } + + \NewDocumentEnvironment {symbols} {o} + { + \IfValueT {#1} { + \keys_set:nn { bit / symbols } {#1} + } + + \bool_if:NTF \l__bithesis_add_to_toc_bool { + \chapter{\c__bithesis_label_symbols_tl} + } { + \chapter*{\c__bithesis_label_symbols_tl} + } + \zihao{-4} + \begin{itemize}[labelwidth=2.5cm,labelsep=0.5cm,leftmargin=3cm,itemindent=0cm,itemsep=0cm] + \cs_set:Npn \makelabel ##1 {##1\hfil} + } + { + \end{itemize} + } + + +\endinput +%% +%% End of file `bithesis.cls'. diff --git a/templates/undergraduate-thesis/chapters/0_abstract.tex b/templates/undergraduate-thesis/chapters/0_abstract.tex index baa29490..92a8050e 100644 --- a/templates/undergraduate-thesis/chapters/0_abstract.tex +++ b/templates/undergraduate-thesis/chapters/0_abstract.tex @@ -29,9 +29,9 @@ \end{abstract} % 英文摘要章节 -\begin{abstract*} +\begin{abstractEn} % 英文摘要正文从这里开始 In order to study…… \textcolor{blue}{Abstract 正文设置成每段落首行缩进 2 字符,字体:Times New Roman,字号:小四,行距:固定值 22 磅,间距:段前、段后均为 0 行。阅后删除此段。} -\end{abstract*} +\end{abstractEn} diff --git a/templates/undergraduate-thesis/main.tex b/templates/undergraduate-thesis/main.tex index b580767b..5ab6b7b0 100644 --- a/templates/undergraduate-thesis/main.tex +++ b/templates/undergraduate-thesis/main.tex @@ -23,6 +23,7 @@ \BITSetup{ cover = { + % 在封面中载入有「北京理工大学」字样的图片,如无必要请勿改动。 headerImage = images/header.png, % 在封面标题中使用思源黑体,使用此选项可以保证与 Word 封面标题的字体一致。 xiheiFont = STXIHEI.TTF,