From 3c5dd0d2f091e5e866af1de0327171b253ec9178 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 29 Mar 2021 03:01:50 +0000 Subject: CTAN sync 202103290301 --- macros/latex/contrib/buctthesis/README.md | 82 + macros/latex/contrib/buctthesis/doc/ChangeLog.md | 160 ++ macros/latex/contrib/buctthesis/doc/LICENSE | 415 ++++ macros/latex/contrib/buctthesis/doc/buctthesis.pdf | Bin 0 -> 433065 bytes .../buctthesis/doc/chapter/acknowledgement.tex | 8 + .../latex/contrib/buctthesis/doc/chapter/app1.tex | 57 + .../contrib/buctthesis/doc/chapter/chapter1.tex | 272 +++ .../contrib/buctthesis/doc/chapter/chapter2.tex | 303 +++ .../contrib/buctthesis/doc/chapter/chapter3.tex | 4 + .../contrib/buctthesis/doc/chapter/conclusion.tex | 9 + .../contrib/buctthesis/doc/chapter/denotation.tex | 33 + .../contrib/buctthesis/doc/chapter/foreword.tex | 50 + .../contrib/buctthesis/doc/chapter/frontmatter.tex | 106 + .../contrib/buctthesis/doc/chapter/resume.tex | 22 + .../contrib/buctthesis/doc/chapter/translation.tex | 12 + .../contrib/buctthesis/doc/code/helloworld.cpp | 9 + .../contrib/buctthesis/doc/cover/BUCT-badge.pdf | Bin 0 -> 64254 bytes .../contrib/buctthesis/doc/cover/buctcover.tex | 23 + .../latex/contrib/buctthesis/doc/figure/AddBib.png | Bin 0 -> 24415 bytes .../buctthesis/doc/figure/declare-bachelor.png | Bin 0 -> 98671 bytes .../buctthesis/doc/figure/declare-master.png | Bin 0 -> 187456 bytes .../contrib/buctthesis/doc/figure/image-a.pdf | Bin 0 -> 12160 bytes .../contrib/buctthesis/doc/figure/image-c.pdf | Bin 0 -> 11708 bytes .../contrib/buctthesis/doc/figure/image-plain.pdf | Bin 0 -> 1143 bytes .../contrib/buctthesis/doc/figure/worm-gear.pdf | Bin 0 -> 42252 bytes macros/latex/contrib/buctthesis/doc/latexmkrc | 5 + macros/latex/contrib/buctthesis/doc/main.tex | 84 + macros/latex/contrib/buctthesis/doc/mycfg.sty | 35 + macros/latex/contrib/buctthesis/doc/thesisbib.bib | 70 + .../latex/contrib/buctthesis/source/buctthesis.dtx | 2409 ++++++++++++++++++++ .../latex/contrib/buctthesis/source/buctthesis.ins | 69 + 31 files changed, 4237 insertions(+) create mode 100644 macros/latex/contrib/buctthesis/README.md create mode 100644 macros/latex/contrib/buctthesis/doc/ChangeLog.md create mode 100644 macros/latex/contrib/buctthesis/doc/LICENSE create mode 100644 macros/latex/contrib/buctthesis/doc/buctthesis.pdf create mode 100644 macros/latex/contrib/buctthesis/doc/chapter/acknowledgement.tex create mode 100644 macros/latex/contrib/buctthesis/doc/chapter/app1.tex create mode 100644 macros/latex/contrib/buctthesis/doc/chapter/chapter1.tex create mode 100644 macros/latex/contrib/buctthesis/doc/chapter/chapter2.tex create mode 100644 macros/latex/contrib/buctthesis/doc/chapter/chapter3.tex create mode 100644 macros/latex/contrib/buctthesis/doc/chapter/conclusion.tex create mode 100644 macros/latex/contrib/buctthesis/doc/chapter/denotation.tex create mode 100644 macros/latex/contrib/buctthesis/doc/chapter/foreword.tex create mode 100644 macros/latex/contrib/buctthesis/doc/chapter/frontmatter.tex create mode 100644 macros/latex/contrib/buctthesis/doc/chapter/resume.tex create mode 100644 macros/latex/contrib/buctthesis/doc/chapter/translation.tex create mode 100644 macros/latex/contrib/buctthesis/doc/code/helloworld.cpp create mode 100644 macros/latex/contrib/buctthesis/doc/cover/BUCT-badge.pdf create mode 100644 macros/latex/contrib/buctthesis/doc/cover/buctcover.tex create mode 100644 macros/latex/contrib/buctthesis/doc/figure/AddBib.png create mode 100644 macros/latex/contrib/buctthesis/doc/figure/declare-bachelor.png create mode 100644 macros/latex/contrib/buctthesis/doc/figure/declare-master.png create mode 100644 macros/latex/contrib/buctthesis/doc/figure/image-a.pdf create mode 100644 macros/latex/contrib/buctthesis/doc/figure/image-c.pdf create mode 100644 macros/latex/contrib/buctthesis/doc/figure/image-plain.pdf create mode 100644 macros/latex/contrib/buctthesis/doc/figure/worm-gear.pdf create mode 100644 macros/latex/contrib/buctthesis/doc/latexmkrc create mode 100644 macros/latex/contrib/buctthesis/doc/main.tex create mode 100644 macros/latex/contrib/buctthesis/doc/mycfg.sty create mode 100644 macros/latex/contrib/buctthesis/doc/thesisbib.bib create mode 100644 macros/latex/contrib/buctthesis/source/buctthesis.dtx create mode 100644 macros/latex/contrib/buctthesis/source/buctthesis.ins (limited to 'macros/latex/contrib/buctthesis') diff --git a/macros/latex/contrib/buctthesis/README.md b/macros/latex/contrib/buctthesis/README.md new file mode 100644 index 0000000000..93f39c2526 --- /dev/null +++ b/macros/latex/contrib/buctthesis/README.md @@ -0,0 +1,82 @@ +# BUCTthesis + +[![BUCTthesis](https://img.shields.io/badge/BUCTthesis-LaTeX-blue)](https://github.com/Miracle0565/BUCTthesis) +[![GitHub license](https://img.shields.io/github/license/Miracle0565/BUCTthesis)](https://github.com/Miracle0565/BUCTthesis/blob/master/LICENSE) + +## BUCTthesis in a nutshell +BUCTthesis is a LaTeX writting template package for Beijing University of Chemical Technology, +supporting bachelor, master and doctor theses. + +You can [download](https://github.com/Miracle0565/BUCTthesis/releases) this package from GitHub Releases, +and the latest released version is strongly recommended. As this package is mainly provided for +Chinese users, the following of this file and the manual documents are written in Chinese only. + +This file 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. The latest version of this license +is in: + +http://www.latex-project.org/lppl.txt + +and version 1.3c or later is part of all distributions +of LaTeX version 1999/12/01 or later. + + +## BUCTthesis 是什么? + +本项目为北京化工大学学位论文的 LaTeX 模板,包括本科毕业设计(论文)与硕士、博士研究生学位论文。 + +## 快速使用 + +1. 安装 TeX 发行版,推荐使用 TeX Live。 +2. [在这里下载](https://github.com/Miracle0565/BUCTthesis/releases) 模板最新发行版的压缩文件。 +3. 于全英文路径下解压缩后,可在 `demo` 文件夹中找到本科、硕博两种论文类型所对应的示例文件夹;将所选论文类型文件夹中的所有文件与文件夹移动至模板的根目录。 +4. 对 `main.tex` 文件执行 `latexmk` 或 `xelatex -> bibtex -> xelatex -> xelatex` 的全编译。 +5. 阅读本模板的说明文档 `buctthesis.pdf`,该文档简要地说明了模板的使用方法。 +6. 相比于重建文件,直接在示例文件上修改会更加方便: + - `main.tex` 用于定义作者与论文信息,并组织论文结构; + - `mycfg.sty` 用于自定义命令等; + - `thesisbib.bib` 文件中插入参考文献条目; + - `chapter` 文件夹用于存放各部分内容,并在 `main.tex` 调用; + - `figure` 和 `code` 文件夹下分别保存插图和源代码,以方便写作时调用; +7. 按第 4 步执行全编译。 +8. 在 `cover` 文件夹中可生成硕博论文的封面,使用方法请阅读说明文档 `buctthesis.pdf`。 + +## 注意事项 + +- 北京化工大学教务处与研究生院仅提供了写作规范(见下)而**未对本模板做任何测试或授权**。模板作者自当尽力,但限于软件等各种因素,由本模板生成的文档可能仍与要求有所出入。所以使用本模板类造成(包括但不限于)论文审核不通过等问题作者不负责,请使用时慎酌。 +- 模板仅在 TeX Live 2020 顺利编译,可能不兼容于低版本。**不支持** CTeX 套装。 +- 模板仅在 Windows 10 系统下做编译测试,故不能保证在其他系统或平台上正确。 +- 学校会统一印制论文封面,使用本模板生成的硕博论文封面与学校有少许不同。 + +## 写作规范 + +- 本科:[《北京化工大学本科毕业环节工作规定》](https://jiaowuchu.buct.edu.cn/2019/0222/c515a22047/page.htm) +- 本科:[《本科生毕业设计(论文)撰写规范》](https://jiaowuchu.buct.edu.cn/2018/1009/c515a22046/page.htm) +- 硕博:[《北京化工大学研究生学位论文撰写规范(修订)》](https://xxgk.buct.edu.cn/2017/1107/c2835a39437/page.htm) +- 参考文献(链接为非校方源):[GB/T 7714—2015 信息与文献 参考文献著录规则](http://www.cessp.org.cn/uploads/1/file/public/201607/20160708142456_8mqgu0dpgk.pdf) + +## 勘误 + +### 本科 + +学校教务处提供了两份文件,而二者之间有出入之处,以及有少许笔误之处和歧义之处。模板作如下统一: + +- 二者间以后者( Word 文档)为准,如图、表编号中的分隔符使用 `-`( U+002D ) ; +- 标题 `诚信申明` 改为 `诚信声明`; +- 章节编号 `均以罗马数字表示顺序` 改为 `均以阿拉伯数字表示顺序`; +- 对章节 `标题加黑` ,“加黑”一词理解为 `使用(伪)粗体` 而非 `标题为黑体`。 + +### 硕博 + +- 英文摘要中的 `KEY WORDS:`,模板将字母后的全角冒号 `:`( U+FF1A )改为半角冒号 `:` ( U+003A ); +- 正文、参考文献条目的 `行间距20磅` 改为 `行距20磅` 。 + +## 提问 + +关于模板的任何问题或新功能需求,欢迎提交 [GitHub Issues](https://github.com/Miracle0565/BUCTthesis/issues) 。 + +## 开源许可 + +本项目基于 [LaTeX Project Public License](http://www.latex-project.org/lppl.txt)(版本 1.3c 或更高)开源于 [GitHub](https://github.com/Miracle0565/BUCTthesis) 。同时为了方便国内用户,在 [Gitee](https://gitee.com/Miracle0565/BUCTthesis) 建有代码的镜像。 diff --git a/macros/latex/contrib/buctthesis/doc/ChangeLog.md b/macros/latex/contrib/buctthesis/doc/ChangeLog.md new file mode 100644 index 0000000000..14bbbe196d --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/ChangeLog.md @@ -0,0 +1,160 @@ +# Changelog of BUCTthesis +在这里记录 BUCTthesis 中较为重要的改动。 + +## v1.1 - 2021/03/21. + +### Added + +- 增加论文封面,仅支持硕博 + + + +## v1.0 - 2021/02/18 + +### Added + +- 增加硕博论文模板,`\documentclass[]{buctthesis}` 必须指定类型 + +### Fixed + +- `denotation` 环境第二列宽的默认值的单位修正 +- 本科中文摘要的关键词中,字体都使用中易黑体 + +### Deleted + +- 模板发行版中取消 `blank` 文件夹,建议写作时直接在示例文件中修改 + +## Beta.v0.9.6 - 2020/12/10 + +### Added + +- 启用 `DocStrip`,增加文件 `buctthesis.dtx` 和 `buctthesis.ins`,以后将说明将在 `buctthesis.pdf` 查看;同时对示例文件进行大幅更改 +- `\buctsetup` 命令中增加一个 `studentid` 键 +- “诚信声明” 现在使用 `\makedeclare` 命令:其后可跟一个可选参数,参数为扫描页的路径 + +### Changed + +- 自定义命令的 `myconfig.tex` 文件更改为 `mycfg.sty` +- 更改了 `\buctsetup` 命令中的键名称大小写 +- 调整“任务书”中部分垂直间距,并在“进度安排”的表格里画上了竖线 +- 重排“摘要”部分,且现在中英文摘要只能排在不同页上 +- 设计图纸: `\designfig` -> `\dcaption`;以前需要在 `\caption` 后跟上 `\designfig` ,现在简化成了一个命令 `\dcaption` +- `denotation` 环境现在只接受一个参数,控制第二列宽度 + +### Deleted + +- 删除了校徽和校名的插图 +- 删除公式编号中“式”字 +- 删除 `declare` 、 `abstract*` 和 `abstracten*`环境 + +## Beta.v0.9.5 - 2020/08/17 + +### Added + +- 文档类选项 `openany` | `openright` ,适用于单双页打印:前者为原先设置;而后者会在适当之处插入一完全空白页,使得章页右开 +- 现在多余的文档类选项将传递至 `ctexbook` + +### Changed + +- 重写字体配置,修改字体切换的命令:粗体、黑体等有所变化 +- 微调双面摘要的垂直间距 +- 文档类选项 `TextBlack` 重命名为 `submit` +- 代码的标签编号以 `-` 而不是 `.` 连接,形如 `代码 2-1` +- “任务书”中,插入论文信息部分命令修改为带可选星号的 `\taskinfo` 命令。原定义 `\taskinfo` -> `\taskinfo*` ,`\Taskinfo` -> `\taskinfo`。类似于“摘要”的环境,带星号的是按照《规范》来定义的,无星号的则是为了应对一些变化 +- 修改了数学公式中的字体 + +### Deleted + +- 删除文档类选项 `LessTOC` ,代之以相应位置的 PDF 书签 +- 删除了“符号说明”中表格的表头 +- 删除了 `dcolumn` 宏包,其功能与 `siunitx` 有所重合 + +## Beta.v0.9.4 - 2020/06/08 + +### Changed + +- 格式控制从宏包改为文档类 +- 主文件 `buctthesis.tex` 更名为 `main.tex` ,并将“诚信声明” `declare.tex` 、“任务书” `taskbook.tex` 和“摘要” `abstract.tex` 整合成一个文件 `frontmatter.tex` +- “任务书”部分代码简化 +- 英文摘要关键词的字体改为中易黑体 +- 将“前言”编入 `\frontmatter` 里,将“第一章”设置为第一页 + +### Added + +- 主文件中增加 `\buctsetup` 命令,代替以往的多个 `\def` 来存储论文的相关信息 +- 以 `threeparttable` 宏包来排版有脚注的表格 +- 以 `gbt7714` 宏包控制参考文献格式 + +### Deleted + +- 删除原先的参考文献格式控制文件 `gbt7714-2005.bst` + +## Beta.v0.9.3 - 2020/04/08 + +### Changed + +- 脚注:修复正文里脚注标记与前后文字的间距问题;脚注文字固定在页面底部且跨页重置计数 +- 使用 `unicode-math` 宏包来配置数学字体 +- `\emph{}` `\em` 命令:中文改用加粗的宋体而非楷体,西文改用粗体而非斜体 + +### Deleted + +- 删除了算法的宏包,根据需要自行在 `myconfig.tex` 中调用 +- 删除 `bm` 宏包 + +### Added + +- 新增“任务书”部分 +- 新文件 `myconfig.tex`,用于装载宏包或自定义命令 +- 使用 `pdfpages` 宏包的相关命令来插入扫描PDF,可替换诚信声明、摘要页等 +- 新环境 `dfigure` ,用于排版机械专业的设计图纸,在主文件的生成目录命令后使用 `\listofdesignfigures` 产生“设计图纸目录”;原定义 `\designfig` 仍然可以在普通插图中使用,但效果不同 + +## Beta.v0.9.2 - 2020/03/14 + +### Changed + +- 重构宏包代码,重排了部分文本。 +- 取消等宽字体的使用,一律使用 Times New Roman,并稍微修改了代码环境 +- 现在使用 `\cite{}` 实现上标引用参考文献 +- 现在使用 `subcaption` 宏包来插入并列子图,而 `subfigure` 宏包好久没更新了 +- 一级编号列表环境的序号改变了样式 +- 修改章节标题间距、缩短插图后的间距,列表环境现在改为正常的行间距 +- 章、节、小节标题一律使用加粗的宋体,浮动体标签和数学定理内容改为宋体 +- “诚信申明”改为“诚信声明”;修正了“前言”的拼写错误 +- 在“结论”这一章标题中间加上了一个全角空格 +- 简化了“符号说明”的代码 + +### Deleted + +- 删除了在上个版本在摘要部分加入的作者及导师信息 +- 删除参考文献的文件 bibliography.tex,简化原来的代码并移动至主文件 +- 删除了一些宏包 + +### Added + +- 宏包载入多了选项:`TextBlack` 用于将超链接全部设置为黑色,`LessTOC` 将会取消将“第一章”之前的所有内容编目(这与《规范》的示例相同) + +## Beta.v0.9.1 - 2020/02/06 + +### Changed + +- 正文字号修正 +- 摘要同页排版的环境( `abstract*` 与 `abstracten*` ),关键词的代码( `\keywords` 和 `\keywordsen` )和格式 +- 行距调整至近似 Microsoft Word 中 22 磅 +- 修改节标题的前间距、小节标题的前后间距 +- 代码环境,关键字增设粗体、环境背景颜色减弱至浅灰色的10% +- 修改目录部分的缩进 +- 改用数字带圈圈的脚注 +- 修改列表环境的间距 +- 删除了部分数学类的环境 +- 更改了hyperref宏包设置,凸显超链接以便于查看 + +### Added + +- 摘要部分的作者( `\author` 和 `\authoren` )、导师( `\thesupervisor` 和 `\thesupervisoren` )等信息 +- 增加“设计图纸”编入目录的命令 `\designfig` +- 增加了化学类的宏包、算法的宏包 + +## Beta.v0.9.0 - 2020/01/23 + +The first version. Hello World! diff --git a/macros/latex/contrib/buctthesis/doc/LICENSE b/macros/latex/contrib/buctthesis/doc/LICENSE new file mode 100644 index 0000000000..4db9b5af29 --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/LICENSE @@ -0,0 +1,415 @@ +The LaTeX Project Public License +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +LPPL Version 1.3c 2008-05-04 + +Copyright 1999 2002-2008 LaTeX3 Project + Everyone is allowed to distribute verbatim copies of this + license document, but modification of it is not allowed. + + +PREAMBLE +======== + +The LaTeX Project Public License (LPPL) is the primary license under +which the LaTeX kernel and the base LaTeX packages are distributed. + +You may use this license for any work of which you hold the copyright +and which you wish to distribute. This license may be particularly +suitable if your work is TeX-related (such as a LaTeX package), but +it is written in such a way that you can use it even if your work is +unrelated to TeX. + +The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', +below, gives instructions, examples, and recommendations for authors +who are considering distributing their works under this license. + +This license gives conditions under which a work may be distributed +and modified, as well as conditions under which modified versions of +that work may be distributed. + +We, the LaTeX3 Project, believe that the conditions below give you +the freedom to make and distribute modified versions of your work +that conform with whatever technical specifications you wish while +maintaining the availability, integrity, and reliability of +that work. If you do not see how to achieve your goal while +meeting these conditions, then read the document `cfgguide.tex' +and `modguide.tex' in the base LaTeX distribution for suggestions. + + +DEFINITIONS +=========== + +In this license document the following terms are used: + + `Work' + Any work being distributed under this License. + + `Derived Work' + Any work that under any applicable law is derived from the Work. + + `Modification' + Any procedure that produces a Derived Work under any applicable + law -- for example, the production of a file containing an + original file associated with the Work or a significant portion of + such a file, either verbatim or with modifications and/or + translated into another language. + + `Modify' + To apply any procedure that produces a Derived Work under any + applicable law. + + `Distribution' + Making copies of the Work available from one person to another, in + whole or in part. Distribution includes (but is not limited to) + making any electronic components of the Work accessible by + file transfer protocols such as FTP or HTTP or by shared file + systems such as Sun's Network File System (NFS). + + `Compiled Work' + A version of the Work that has been processed into a form where it + is directly usable on a computer system. This processing may + include using installation facilities provided by the Work, + transformations of the Work, copying of components of the Work, or + other activities. Note that modification of any installation + facilities provided by the Work constitutes modification of the Work. + + `Current Maintainer' + A person or persons nominated as such within the Work. If there is + no such explicit nomination then it is the `Copyright Holder' under + any applicable law. + + `Base Interpreter' + A program or process that is normally needed for running or + interpreting a part or the whole of the Work. + + A Base Interpreter may depend on external components but these + are not considered part of the Base Interpreter provided that each + external component clearly identifies itself whenever it is used + interactively. Unless explicitly specified when applying the + license to the Work, the only applicable Base Interpreter is a + `LaTeX-Format' or in the case of files belonging to the + `LaTeX-format' a program implementing the `TeX language'. + + + +CONDITIONS ON DISTRIBUTION AND MODIFICATION +=========================================== + +1. Activities other than distribution and/or modification of the Work +are not covered by this license; they are outside its scope. In +particular, the act of running the Work is not restricted and no +requirements are made concerning any offers of support for the Work. + +2. You may distribute a complete, unmodified copy of the Work as you +received it. Distribution of only part of the Work is considered +modification of the Work, and no right to distribute such a Derived +Work may be assumed under the terms of this clause. + +3. You may distribute a Compiled Work that has been generated from a +complete, unmodified copy of the Work as distributed under Clause 2 +above, as long as that Compiled Work is distributed in such a way that +the recipients may install the Compiled Work on their system exactly +as it would have been installed if they generated a Compiled Work +directly from the Work. + +4. If you are the Current Maintainer of the Work, you may, without +restriction, modify the Work, thus creating a Derived Work. You may +also distribute the Derived Work without restriction, including +Compiled Works generated from the Derived Work. Derived Works +distributed in this manner by the Current Maintainer are considered to +be updated versions of the Work. + +5. If you are not the Current Maintainer of the Work, you may modify +your copy of the Work, thus creating a Derived Work based on the Work, +and compile this Derived Work, thus creating a Compiled Work based on +the Derived Work. + +6. If you are not the Current Maintainer of the Work, you may +distribute a Derived Work provided the following conditions are met +for every component of the Work unless that component clearly states +in the copyright notice that it is exempt from that condition. Only +the Current Maintainer is allowed to add such statements of exemption +to a component of the Work. + + a. If a component of this Derived Work can be a direct replacement + for a component of the Work when that component is used with the + Base Interpreter, then, wherever this component of the Work + identifies itself to the user when used interactively with that + Base Interpreter, the replacement component of this Derived Work + clearly and unambiguously identifies itself as a modified version + of this component to the user when used interactively with that + Base Interpreter. + + b. Every component of the Derived Work contains prominent notices + detailing the nature of the changes to that component, or a + prominent reference to another file that is distributed as part + of the Derived Work and that contains a complete and accurate log + of the changes. + + c. No information in the Derived Work implies that any persons, + including (but not limited to) the authors of the original version + of the Work, provide any support, including (but not limited to) + the reporting and handling of errors, to recipients of the + Derived Work unless those persons have stated explicitly that + they do provide such support for the Derived Work. + + d. You distribute at least one of the following with the Derived Work: + + 1. A complete, unmodified copy of the Work; + if your distribution of a modified component is made by + offering access to copy the modified component from a + designated place, then offering equivalent access to copy + the Work from the same or some similar place meets this + condition, even though third parties are not compelled to + copy the Work along with the modified component; + + 2. Information that is sufficient to obtain a complete, + unmodified copy of the Work. + +7. If you are not the Current Maintainer of the Work, you may +distribute a Compiled Work generated from a Derived Work, as long as +the Derived Work is distributed to all recipients of the Compiled +Work, and as long as the conditions of Clause 6, above, are met with +regard to the Derived Work. + +8. The conditions above are not intended to prohibit, and hence do not +apply to, the modification, by any method, of any component so that it +becomes identical to an updated version of that component of the Work as +it is distributed by the Current Maintainer under Clause 4, above. + +9. Distribution of the Work or any Derived Work in an alternative +format, where the Work or that Derived Work (in whole or in part) is +then produced by applying some process to that format, does not relax or +nullify any sections of this license as they pertain to the results of +applying that process. + +10. a. A Derived Work may be distributed under a different license + provided that license itself honors the conditions listed in + Clause 6 above, in regard to the Work, though it does not have + to honor the rest of the conditions in this license. + + b. If a Derived Work is distributed under a different license, that + Derived Work must provide sufficient documentation as part of + itself to allow each recipient of that Derived Work to honor the + restrictions in Clause 6 above, concerning changes from the Work. + +11. This license places no restrictions on works that are unrelated to +the Work, nor does this license place any restrictions on aggregating +such works with the Work by any means. + +12. Nothing in this license is intended to, or may be used to, prevent +complete compliance by all parties with all applicable laws. + + +NO WARRANTY +=========== + +There is no warranty for the Work. Except when otherwise stated in +writing, the Copyright Holder provides the Work `as is', without +warranty of any kind, either expressed or implied, including, but not +limited to, the implied warranties of merchantability and fitness for a +particular purpose. The entire risk as to the quality and performance +of the Work is with you. Should the Work prove defective, you assume +the cost of all necessary servicing, repair, or correction. + +In no event unless required by applicable law or agreed to in writing +will The Copyright Holder, or any author named in the components of the +Work, or any other party who may distribute and/or modify the Work as +permitted above, be liable to you for damages, including any general, +special, incidental or consequential damages arising out of any use of +the Work or out of inability to use the Work (including, but not limited +to, loss of data, data being rendered inaccurate, or losses sustained by +anyone as a result of any failure of the Work to operate with any other +programs), even if the Copyright Holder or said author or said other +party has been advised of the possibility of such damages. + + +MAINTENANCE OF THE WORK +======================= + +The Work has the status `author-maintained' if the Copyright Holder +explicitly and prominently states near the primary copyright notice in +the Work that the Work can only be maintained by the Copyright Holder +or simply that it is `author-maintained'. + +The Work has the status `maintained' if there is a Current Maintainer +who has indicated in the Work that they are willing to receive error +reports for the Work (for example, by supplying a valid e-mail +address). It is not required for the Current Maintainer to acknowledge +or act upon these error reports. + +The Work changes from status `maintained' to `unmaintained' if there +is no Current Maintainer, or the person stated to be Current +Maintainer of the work cannot be reached through the indicated means +of communication for a period of six months, and there are no other +significant signs of active maintenance. + +You can become the Current Maintainer of the Work by agreement with +any existing Current Maintainer to take over this role. + +If the Work is unmaintained, you can become the Current Maintainer of +the Work through the following steps: + + 1. Make a reasonable attempt to trace the Current Maintainer (and + the Copyright Holder, if the two differ) through the means of + an Internet or similar search. + + 2. If this search is successful, then enquire whether the Work + is still maintained. + + a. If it is being maintained, then ask the Current Maintainer + to update their communication data within one month. + + b. If the search is unsuccessful or no action to resume active + maintenance is taken by the Current Maintainer, then announce + within the pertinent community your intention to take over + maintenance. (If the Work is a LaTeX work, this could be + done, for example, by posting to comp.text.tex.) + + 3a. If the Current Maintainer is reachable and agrees to pass + maintenance of the Work to you, then this takes effect + immediately upon announcement. + + b. If the Current Maintainer is not reachable and the Copyright + Holder agrees that maintenance of the Work be passed to you, + then this takes effect immediately upon announcement. + + 4. If you make an `intention announcement' as described in 2b. above + and after three months your intention is challenged neither by + the Current Maintainer nor by the Copyright Holder nor by other + people, then you may arrange for the Work to be changed so as + to name you as the (new) Current Maintainer. + + 5. If the previously unreachable Current Maintainer becomes + reachable once more within three months of a change completed + under the terms of 3b) or 4), then that Current Maintainer must + become or remain the Current Maintainer upon request provided + they then update their communication data within one month. + +A change in the Current Maintainer does not, of itself, alter the fact +that the Work is distributed under the LPPL license. + +If you become the Current Maintainer of the Work, you should +immediately provide, within the Work, a prominent and unambiguous +statement of your status as Current Maintainer. You should also +announce your new status to the same pertinent community as +in 2b) above. + + +WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE +====================================================== + +This section contains important instructions, examples, and +recommendations for authors who are considering distributing their +works under this license. These authors are addressed as `you' in +this section. + +Choosing This License or Another License +---------------------------------------- + +If for any part of your work you want or need to use *distribution* +conditions that differ significantly from those in this license, then +do not refer to this license anywhere in your work but, instead, +distribute your work under a different license. You may use the text +of this license as a model for your own license, but your license +should not refer to the LPPL or otherwise give the impression that +your work is distributed under the LPPL. + +The document `modguide.tex' in the base LaTeX distribution explains +the motivation behind the conditions of this license. It explains, +for example, why distributing LaTeX under the GNU General Public +License (GPL) was considered inappropriate. Even if your work is +unrelated to LaTeX, the discussion in `modguide.tex' may still be +relevant, and authors intending to distribute their works under any +license are encouraged to read it. + +A Recommendation on Modification Without Distribution +----------------------------------------------------- + +It is wise never to modify a component of the Work, even for your own +personal use, without also meeting the above conditions for +distributing the modified component. While you might intend that such +modifications will never be distributed, often this will happen by +accident -- you may forget that you have modified that component; or +it may not occur to you when allowing others to access the modified +version that you are thus distributing it and violating the conditions +of this license in ways that could have legal implications and, worse, +cause problems for the community. It is therefore usually in your +best interest to keep your copy of the Work identical with the public +one. Many works provide ways to control the behavior of that work +without altering any of its licensed components. + +How to Use This License +----------------------- + +To use this license, place in each of the components of your work both +an explicit copyright notice including your name and the year the work +was authored and/or last substantially modified. Include also a +statement that the distribution and/or modification of that +component is constrained by the conditions in this license. + +Here is an example of such a notice and statement: + + %% pig.dtx + %% Copyright 2005 M. Y. Name + % + % 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 M. Y. Name. + % + % This work consists of the files pig.dtx and pig.ins + % and the derived file pig.sty. + +Given such a notice and statement in a file, the conditions +given in this license document would apply, with the `Work' referring +to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being +generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' +referring to any `LaTeX-Format', and both `Copyright Holder' and +`Current Maintainer' referring to the person `M. Y. Name'. + +If you do not want the Maintenance section of LPPL to apply to your +Work, change `maintained' above into `author-maintained'. +However, we recommend that you use `maintained', as the Maintenance +section was added in order to ensure that your Work remains useful to +the community even when you can no longer maintain and support it +yourself. + +Derived Works That Are Not Replacements +--------------------------------------- + +Several clauses of the LPPL specify means to provide reliability and +stability for the user community. They therefore concern themselves +with the case that a Derived Work is intended to be used as a +(compatible or incompatible) replacement of the original Work. If +this is not the case (e.g., if a few lines of code are reused for a +completely different task), then clauses 6b and 6d shall not apply. + + +Important Recommendations +------------------------- + + Defining What Constitutes the Work + + The LPPL requires that distributions of the Work contain all the + files of the Work. It is therefore important that you provide a + way for the licensee to determine which files constitute the Work. + This could, for example, be achieved by explicitly listing all the + files of the Work near the copyright notice of each file or by + using a line such as: + + % This work consists of all files listed in manifest.txt. + + in that place. In the absence of an unequivocal list it might be + impossible for the licensee to determine what is considered by you + to comprise the Work and, in such a case, the licensee would be + entitled to make reasonable conjectures as to which files comprise + the Work. diff --git a/macros/latex/contrib/buctthesis/doc/buctthesis.pdf b/macros/latex/contrib/buctthesis/doc/buctthesis.pdf new file mode 100644 index 0000000000..bcb0ad14f6 Binary files /dev/null and b/macros/latex/contrib/buctthesis/doc/buctthesis.pdf differ diff --git a/macros/latex/contrib/buctthesis/doc/chapter/acknowledgement.tex b/macros/latex/contrib/buctthesis/doc/chapter/acknowledgement.tex new file mode 100644 index 0000000000..b7d6c7e0a5 --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/chapter/acknowledgement.tex @@ -0,0 +1,8 @@ +%% 致谢--acknowledgement.tex +\begin{acknowledgement} + 致谢部分。 + + \dots + + %最后还要感谢 BUCTthesis 帮助我节省了论文排版的时间! +\end{acknowledgement} \ No newline at end of file diff --git a/macros/latex/contrib/buctthesis/doc/chapter/app1.tex b/macros/latex/contrib/buctthesis/doc/chapter/app1.tex new file mode 100644 index 0000000000..4280b9dd0b --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/chapter/app1.tex @@ -0,0 +1,57 @@ +%% 附录第一章--app1.tex +\chapter{这里是附录}\label{app:1} +未尽事宜可将其列在附录中加以说明。论文有关的数据表、符号说明、计算程序、运行结果、 +主要设备、仪器仪表的性能指标和测试分析结果、精度等均可列在附录中。 +\section{附录的节} +与正文类似。 +\begin{table}[ht] + \centering + \caption{测试表格}\label{tab:mytable} + \begin{tabular}{cc} + \toprule + a & B \\ + \midrule + 甲 & 乙丙丁 \\ + \bottomrule + \end{tabular} +\end{table} + +\subsection{附录的小节} +\zhlipsum[1][name = zhufu] + +\begin{figure}[ht] + \centering + \begin{minipage}{0.4\textwidth} + \centering + \includegraphics[height=4cm]{image-a.pdf} + \caption{第一张图}\label{fig:test1} + \end{minipage} + \hspace{1cm} + \begin{minipage}{0.4\textwidth} + \centering + \includegraphics[height=4cm]{image-c.pdf} + \caption{第二张图}\label{fig:test2} + \end{minipage} +\end{figure} + +\zhlipsum[name = xiangyu] + +\begin{dfigure}[tbp] + \centering\includegraphics[height=.9\textwidth ,angle=-90]{worm gear.pdf} + \caption{设计图纸测试} +\end{dfigure} + +\zhlipsum[1][name = aspirin] + +\begin{equation} + a^2+b^3=c^4 +\end{equation} + +\begin{definition} + 这是定义。\footnote{这是测试脚注。} +\end{definition} + +\begin{lstlisting}[language=c++,caption=一个测试,label=mycode] +#define mian main + \end{lstlisting} + diff --git a/macros/latex/contrib/buctthesis/doc/chapter/chapter1.tex b/macros/latex/contrib/buctthesis/doc/chapter/chapter1.tex new file mode 100644 index 0000000000..3cc3830a4a --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/chapter/chapter1.tex @@ -0,0 +1,272 @@ +%% 第一章--chapter1.tex +\chapter{绪论} +\section{字体} +\subsection{字体配置} +\begin{enumerate} + \item 中文:主字体(衬线字体)为宋体,无衬线字体族为黑体,% + \footnote{这里指中易宋体(SimSun)和中易黑体(SimHei),二者均为 Windows 系统的预装字体。 + 对于不方便安装该字体的系统,可定位至 \file{buctthesis.cls} + 文件中的 \cs{setCJKmainfont}\{SimSun\} 处,将 SimSun 替换为合适的衬线字体;无衬线字体同理。} + 且二者均可加粗为对应的伪粗体;《规范》中未规定的楷体和仿宋均为 \pkg{ctex} 宏集的预设,为避免格式审查问题,应当减少使用; + \item 西文:除英文摘要的关键词使用中易黑体、除公式中的西文(数字、字母等)使用特殊字体,其它一律使用 Times New Roman; + \item 公式:模板会根据实际字体安装情况,选择 $LibertinusMath$ 字体或使用 \LaTeX\ 的默认字体。 +\end{enumerate} + +\subsection{中文字体命令及对应西文示例} +\begin{enumerate} + \item 宋体:北京化工大学 BUCT 1958 或 \textrm{北京化工大学 BUCT 1958} + \item 粗宋体:{\bfsong 北京化工大学 BUCT 1958} 或 \emph{北京化工大学 BUCT 1958} + \item 黑体:{\heiti 北京化工大学 BUCT 1958} 或 \textsf{北京化工大学 BUCT 1958} + \item 粗黑体:{\bfhei 北京化工大学 BUCT 1958} 或 \textsf{\bfseries 北京化工大学 BUCT 1958} + \item 仿宋:{\ttfamily 北京化工大学 BUCT 1958} 或 \texttt{北京化工大学 BUCT 1958} + \item 斜体:{\itshape 北京化工大学 BUCT 1958} 或 \textit{北京化工大学 BUCT 1958} +\end{enumerate} + +\section{浮动体} +% 一些文字用来充版面。摘自 https://github.com/chinese-poetry/chinese-poetry +六王毕,四海一,蜀山兀,阿房出。覆压三百余里,隔离天日。骊山北构而西折,直走咸阳。 +二川溶溶,流入宫墙。五步一楼,十步一阁;廊腰缦回,檐牙高啄;各抱地势,钩心斗角。 +盘盘焉,囷囷焉,蜂房水涡,矗不知其几千万落。长桥卧波,未云何龙?复道行空,不霁何虹? +高低冥迷,不知西东。歌台暖响,春光融融;舞殿冷袖,风雨凄凄。一日之内,一宫之间,而气候不齐。 + +妃嫔媵嫱,王子皇孙,辞楼下殿,辇来于秦,朝歌夜弦,为秦宫人。明星荧荧,开妆镜也; +绿云扰扰,梳晓鬟也;渭流涨腻,弃脂水也;烟斜雾横,焚椒兰也。雷霆乍惊,宫车过也; +辘辘远听,杳不知其所之也。一肌一容,尽态极妍,缦立远视,而望幸焉。有不见者,三十六年。 +燕赵之收藏,韩魏之经营,齐楚之精英,几世几年,剽掠其人,倚叠如山。一旦不能有,输来其间。 +鼎铛玉石,金块珠砾,弃掷逦迤,秦人视之,亦不甚惜。 + +\subsection{插图}\label{subsec:fig} + +一般的图片插入使用 \env{figure} 环境。 +一张普普通通的插图参见图~\ref{fig:a-single-image}。 + +\begin{figure}[H] + \centering + \includegraphics[width=0.3\textwidth]{image-plain.pdf} + \caption{一张插图。加上参数 [H] 固定图片位置,禁止“浮动”}\label{fig:a-single-image} +\end{figure} + +嗟乎!一人之心,千万人之心也。秦爱纷奢,人亦念其家。奈何取之尽锱铢,用之如泥沙! +使负栋之柱,多于南亩之农夫;架梁之椽,多于机上之工女;钉头磷磷,多于在庾之粟粒; +瓦缝参差,多于周身之帛缕;直栏横槛,多于九土之城郭;管弦呕哑,多于市人之言语。 +使天下之人,不敢言而敢怒。独夫之心,日益骄固。戍卒叫,函谷举,楚人一炬,可怜焦土! + +至于图片的并排,如果只需为组图写一个图注,可在一个 \env{figure} 环境中多次使用 \cs{includegraphics} 命令(可根据需要在插图之间加入空白)。两张并排的图片参见图~\ref{fig:abreast-image}。 + +\begin{figure}[htbp] + \centering + \includegraphics[width=0.3\textwidth]{image-a.pdf} + \hspace{1cm} + \includegraphics[width=0.3\textwidth]{image-c.pdf} + \caption{并排的插图,这适合无需在每一张图下写图注的情况。}\label{fig:abreast-image} +\end{figure} + +呜呼!灭六国者六国也,非秦也;族秦者秦也,非天下也。嗟乎!使六国各爱其人,则足以拒秦; +使秦复爱六国之人,则递三世可至万世而为君,谁得而族灭也?秦人不暇自哀,而后人哀之; +后人哀之而不鉴之,亦使后人而复哀后人也。 + +梁惠王曰:“寡人之于国也,尽心焉耳矣。河内凶,则移其民于河东,移其粟于河内;河东凶亦然。 +察邻国之政,无如寡人之用心者。邻国之民不加少,寡人之民不加多,何也? + +但如果需要在每一个子图下写上图注(或需要对子图标序),可使用 \cs{subcaptionbox} 命令。 +一张子图见图~\ref{subfig:abreast-image-a},又一张子图见图~~\ref{subfig:abreast-image-c},这两张并排起来的组图见图~\ref{fig:abreast-image-a-c}。 + +\begin{figure}[htbp] + \centering + \subcaptionbox{这是一张图片。\label{subfig:abreast-image-a}} + {\includegraphics[height = 5cm]{image-a.pdf}} + \hspace{1cm} + \subcaptionbox{这又是一张图片。\label{subfig:abreast-image-c}} + {\includegraphics[angle = 90, height = 5cm]{image-c.pdf}} + \caption{并排的插图,这适合每一张图写一个图注的情况。}\label{fig:abreast-image-a-c} +\end{figure} + +孟子对曰:“王好战,请以战喻。填然鼓之,兵刃既接,弃甲曳兵而走。或百步而后止, +或五十步而后止。以五十步笑百步,则何如?”曰:“不可,直不百步耳,是亦走也。” +曰:“王如知此,则无望民之多于邻国也。不违农时,谷不可胜食也;数罟不入洿池, +鱼鳖不可胜食也;斧斤以时入山林,材木不可胜用也。谷与鱼鳖不可胜食,材木不可胜用, +是使民养生丧死无憾也。养生丧死无憾,王道之始也。五亩之宅,树之以桑,五十者可以衣帛矣 +。鸡豚狗彘之畜,无失其时,七十者可以食肉矣。百亩之田,勿夺其时,数口之家,可以无饥矣; +谨庠序之教,申之以孝悌之义,颁白者不负戴于道路矣。七十者衣帛食肉,黎民不饥不寒, +然而不王者,未之有也。狗彘食人食而不知检,涂有饿莩而不知发,人死,则曰:‘非我也, +岁也。’是何异于刺人而杀之,曰‘非我也,兵也’?王无罪岁,斯天下之民至焉。” + +(机械设计等)设计图纸需要编目。模板新定义了类似 \env{figure} 的 \env{dfigure}环境。 +设计图纸的标签与普通插图不同,且计数器相互独立。 +对于图纸的编目,可以在主文件以 \cs{listofdesignfigures} 生成独立的目录,或使用 +\cs{dcaption}\marg{Caption}命令与主目录合并。 +\begin{dfigure}% [H] or [htbp] is also available here. + \centering + \includegraphics[width = \textwidth]{worm-gear.pdf} + \caption{设计图纸示例} % \dcaption{设计图纸示例} % 该命令将其编入主目录。 +\end{dfigure} + +以上命令适合大部分图片的插入。 +但不可否认的是,\LaTeX{}对于图文混排的能力是较弱的,如果希望深入了解,推荐~ +\href{https://github.com/WenboSheng/epslatex-cn}{\LaTeXe 插图指南} +(中译本第三版)作为参考资料。 + + +\subsection{表格}\label{subsec:tab} +论文中常用三线表。本模板的组成见表~\ref{tab:mainfile}。 + +\begin{table}[ht] + \centering + \caption{模板的组成}\label{tab:mainfile} + \begin{tabular}{ll} + \toprule + 文件(夹)名 & 简述\\ + \midrule + \file{chapter/} & 论文各个部分的源文件路径\\ + \file{code/} & 源代码的路径\\ + \file{figure/} & 插图的路径\\ + \file{buctthesis.ins} & \textsc{DocStrip} 驱动文件\\ + \file{buctthesis.dtx} & \textsc{DocStrip} 源文件\\ + \file{main.tex} & 主文件\\ + \file{main.pdf} & 示例文档\\ + \file{buctthesis.cls} & 模板的文档类文件\\ + \file{thesisbib.bib} & \BibTeX{}参考文献数据库\\ + \file{mycfg.sty} & 自定义配置文件\\ + \file{README.md} & 项目自述文件\\ + \file{buctthesis.pdf} & 写作指南,即本文\\ + \bottomrule + \end{tabular} +\end{table} + +北冥有鱼,其名为鲲。鲲之大,不知其几千里也。化而为鸟,其名为鹏。鹏之背, +不知其几千里也,怒而飞,其翼若垂天之云。是鸟也,海运则将徙于南冥。南冥者, +天池也。《齐谐》者,志怪者也。《谐》之言曰:“鹏之徙于南冥也,水击三千里, +抟扶摇而上者九万里,去以六月息者也。” + +使用 \cs{hline}命令也能划线,但其线宽固定。关于表格内对齐与常用的命令见表~\ref{tab:tabcmd}。 +\begin{table}[H] + \centering + \caption{表格命令举例}\label{tab:tabcmd} + \begin{tabular}{lcrp{5em}@{\extracolsep{3em}}l} + \hline + 左对齐 & 居中对齐 & 右对齐 & 定宽 & 增加左侧间距\\ + l & c & r & p\marg{width} & @\{\cs{extracolsep}\marg{width}\}\\ + \hline + \end{tabular} +\end{table} + +野马也,尘埃也,生物之以息相吹也。 +天之苍苍,其正色邪?其远而无所至极邪?其视下也,亦若是则已矣。且夫水之积也不厚, +则其负大舟也无力。覆杯水于坳堂之上,则芥为之舟;置杯焉则胶,水浅而舟大也。 +风之积也不厚,则其负大翼也无力。故九万里,则风斯在下矣,而后乃今培风; +背负青天而莫之夭阏者,而后乃今将图南。 + +另外,三线表生成横线的命令 \cs{toprule}、\cs{midrule}和 +\cs{bottomrule}后可以加一个可选参数来实现对线宽的控制,如果不加参数则为默认值; +而\cs{cline}可针对某些表列画上横线。 +此外,两个表格也能横向并列排版,如表~\ref{tab:2tab}。 + +\begin{table}[H] + \centering + \caption{这是一个并列排版的示例} + \label{tab:2tab} + \begin{tabular}{|c|r|r|} + \hline + & \multicolumn{2}{c|}{成绩} \\\cline{2-3} + 姓名 & 语文 & 数学 \\\hline + 张三 & 91 & 92 \\\hline + \end{tabular} + \hspace{1cm} + \begin{tabular}{|c|r|r|} + \hline + \multirow{2}*{姓名} & \multicolumn{2}{c|}{成绩} \\ \cline{2-3} + & 语文 & 数学 \\ \hline + 李四 & 93 & 94 \\ \hline + \end{tabular} +\end{table} + +蜩与学鸠笑之曰:“我决起而飞,抢榆枋而止,时则不至,而控于地而已矣,奚以之九万里而南为?” +适莽苍者,三餐而反,腹犹果然;适百里者宿舂粮,适千里者,三月聚粮。之二虫又何知? +小知不及大知,小年不及大年。奚以知其然也?朝菌不知晦朔,蟪蛄不知春秋,此小年也。 +楚之南有冥灵者,以五百岁为春,五百岁为秋。上古有大椿者,以八千岁为春,八千岁为秋。 +此大年也。而彭祖乃今以久特闻,众人匹之。不亦悲乎! + +至于可跨页的长表格,可以使用 \env{longtable} 来帮忙,见表~\ref{tab:longtab}。 + +\begin{longtable}[c]{*{5}{l}r} + \caption{带有塑化剂的PEO-基聚合物电解质举例}\label{tab:longtab}\\ + \toprule + \textbf{Entry} & \textbf{聚合物基体} & \textbf{锂盐} & \textbf{塑化剂} & \textbf{$T$ (\si{\degreeCelsius})} & \textbf{离子电导率 (\si{S.cm^{-1}})}\\ \midrule + \endfirsthead + \multicolumn{6}{c}{\small 续表 \thetable\quad 带有塑化剂的PEO-基聚合物电解质举例} \\ + \toprule + \textbf{Entry} & \textbf{聚合物基体} & \textbf{锂盐} & \textbf{塑化剂} & \textbf{$T$ (\si{\degreeCelsius})} & \textbf{离子电导率 (\si{S.cm^{-1}})}\\ \midrule + \endhead + \bottomrule + \endfoot\endlastfoot + 1 & PEO & LiTf & PEG & 40 & \num{e-4} \\ + 2 & PEO & LiTFSI & PEGDME & 60 & \num{3.8e-4} \\ + 3 & PEO & LiTf & MC3 & 25 & \num{5.0e-5} \\ + 4 & PEO & LiTf & TEG & 30 & \num{6.5e-5} \\ + 5 & PEO & LiTf & EC & 60 & \num{9.0e-4} \\ + 6 & PEO & LiTf & PC & 60 & \num{5.2e-4} \\ + 7 & PEO/P(VDF-HFP) & \ce{LiClO4} & EC/PC & 30 & \num{1.25e-3} \\ + 8 & PEO/PDMAEMA & LiTFSI & Tetraglyme & 25 & \num{4.7e-4} \\ + 9 & PEO & LiTf & EC & 25 & \num{1.5e-4} \\ + 10 & PEO & LiTf & EC/PC & 25 & \num{1.2e-4} \\ + 11 & PEO & LiTf & EC & 30 & \num{1.6e-4} \\ + 12 & PEO & LiTf & LiTFSI/DEP & 20 & \num{4.6e-5} \\ + 13 & PEO & \ce{LiClO4} & DOP & 25 & \num{3.8e-4} \\ + 14 & PEO & \ce{LiClO4} & DBP & 25 & $\sim10^{-5}$ \\ + 15 & PEO & \ce{LiClO4} & DMP & 25 & $\sim10^{-5}$ \\ + 16 & PEO & LiTf & DBP & 25 & \num{6.0e-4} \\ + 17 & PEO & LiTFSI & CP & 25 & $\sim10^{-5}$ \\ + 18 & PEO & LiTFSI & SN & 30 & \num{1.0e-3} \\ + 19 & PEO & LiTFSI & SN & 25 & \num{2.9e-3} \\ + 20 & PEO & LiBOB & SN & 20 & $\sim10^{-4}$ \\ + 21 & PEO & LiTFSI & BMITFSI & 25 & \num{3.2e-4} \\ + 22 & PEO & LiTFSI & EMITFSI & 40 & \num{2.67e-4} \\ + 23 & PEO & LiTFSI & \ce{PP13TFSI} & 40 & \num{8.93e-5} \\ + 24 & PEO & LiTf & EMITf & 25 & \num{3.0e-4}\\ + 25 & PEO & LiTFSI & \ce{PP13FSI} & 60 & \num{2.18e-3} \\ + 26 & PEO & LiTFSI & \ce{Pyr24TFSI} & 35 & $\sim10^{-5}$ \\ + 27 & PEO & \ce{LiBF4} & \ce{MMPIBF4} & 25 & \num{2.06e-3} \\ + 28 & PEO & \ce{LiPF6} & \ce{MMPIPF6} & 25 & \num{1.13e-3} \\ \bottomrule +\end{longtable} + +汤之问棘也是已:“穷发之北有冥海者,天池也。有鱼焉,其广数千里,未有知其修者,其名为鲲。 +有鸟焉,其名为鹏。背若泰山,翼若垂天之云。抟扶摇羊角而上者九万里,绝云气,负青天,然后图南, +且适南冥也。斥鷃笑之曰:‘彼且奚适也?我腾跃而上,不过数仞而下,翱翔蓬蒿之间,此亦飞之至也。 +而彼且奚适也?’”此小大之辩也。 + + +如果希望单元格内自动换行以适应列宽, +可以使用\env{tabularx}环境,表 \ref{tab:tabularx} 是一个示例。 +\begin{table}[htbp] + \centering + \begin{minipage}{0.9\textwidth} + \caption{表格控制列宽及自动折行。有些时候标题会比较长,那么我们可以把表格放到一个小页环境里,从而达到比较好的折行效果。} + \label{tab:tabularx} + % 整张表格最大宽度设为文本宽度(由于处于小页,则为0.8倍论文文本宽度); + % 控制第一、二列列宽,第三列允许折行 + \begin{tabularx}{\textwidth}{p{4em}p{7.5em}X} + \toprule + & \multicolumn{1}{c}{\em 原文} & \multicolumn{1}{c}{\em 翻译} \\ + \cmidrule(l){2-3} + & 亦余心之所善兮,虽九死其犹未悔。 & For the ideal that I hold dear to my heart,I will not regret a thousand times to die. \\ + \cmidrule(l){2-3} + \multirow{3}{*}{古文翻译} & 不畏浮云遮望眼,自缘身在最高层。 & We have no fear of the clouds that may block our sights as we are already at the top of the height. \\ + \cmidrule(l){2-3} + & 苟利国家生死以,岂因祸福避趋之。 & I shall dedicate myself to the interests of the country in life and death irrespective of personal weal and woe. \\ + \bottomrule + \end{tabularx} + \end{minipage} +\end{table} + +故夫知效一官,行比一乡,德合一君,而征一国者,其自视也亦若此矣。而宋荣子 +犹然笑之。且举世誉之而不加劝,举世非之而不加沮,定乎内外之分,辩乎荣辱之 +境,斯已矣。彼其于世,未数数然也。虽然,犹有未树也。夫列子御风而行,泠然 +善也。旬有五日而后反。彼于致福者,未数数然也。此虽免乎行,犹有所待者也。 +若夫乘天地之正,而御六气之辩,以游无穷者,彼且恶乎待哉?故曰:至人无己, +神人无功,圣人无名。 + +若要在表格中使用脚注,请参见第~\ref{subsec:footnote}小节。 + +一些在线网站如 +~\href{http://www.tablesgenerator.com}{LaTeX Tables Generator}~ +可以帮助制作更复杂的表格。 \ No newline at end of file diff --git a/macros/latex/contrib/buctthesis/doc/chapter/chapter2.tex b/macros/latex/contrib/buctthesis/doc/chapter/chapter2.tex new file mode 100644 index 0000000000..bafdf9b27b --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/chapter/chapter2.tex @@ -0,0 +1,303 @@ +%% 第二章--chapter2.tex +\chapter{示例}\label{chap:CodeIntro} +\section{公式与数学类环境}\label{subsec:eqandmath} +公式分为编号和不编号的两类。可以使用\env{equation}环境为公式编号。 +\begin{equation}\label{eq:gougu} + x_{1,2}=\frac{-b \pm \sqrt{b^2-4ac}}{2a}. +\end{equation} +加上 \cs{label},就能使用 \cs{ref}或 \cs{eqref}引用了。 +代入式~\ref{eq:gougu},可解得式~\eqref{eq:gougu}。 + +不编号的公式使用 \env{equation*} 环境。 +\begin{equation*} + \int_{-\infty}^{+\infty}\frac{1}{\sqrt{2\uppi}\sigma} % 直立的 π + \mathrm{e}^{-\tfrac{(x-\mu)^2}{2\sigma^2}} \,\mathrm{d}x =1 +\end{equation*} + +行内公式可套以美元符号 \verb+$ $+,如 $f(x)=ax^2+bx+c$. +对于上述 \env{equation*} 环境中的公式(即行间公式),可套以双美元符号 \verb+$$ $$+ +或 \verb+\[ \]+。 +但是并不建议使用前者,因其在 \LaTeX\ 中并没有完整的重定义,有可能会在某些命令上失效。 + +关于公式的命令可以参考 \pkg{amsmath} 宏包说明文档,中译可参考 \href{http://static.latexstudio.net/article/2019/0204/amsmath-guide-zh-cn.pdf}{amsmath 包使用手册}; +%除此之外可参考 \href{http://media.cism.it/attachments/ch8.pdf}{Higher Mathematics}。 +还有一些在线网站,如 \href{https://latexlive.com/}{latexlive} 不仅能够即时预览,还提供了图像与手写识别系统。 +以下举几个例子来展示最常见的用法: + +由$\cos 2x=\cos^2x-\sin^2x$ , % 函数 +则$\Vector{n}=a\Vector{x}+b\Vector{y}+c\Vector{z}.$ % 自定义向量,区别于\vec。见 mycfg.sty +又因$\mathcal{M}\in \mathbb{R}$, % 字母样式 +于是 +\[ + \int_a^b f(t)\,\mathrm{d}t = \iint\limits_S g(x,y)\,\mathrm{d}x\mathrm{d}y + = \iiint\nolimits_D\, \mathrm{d}h. % 积分号及角标 +\] +得 +\[\lim_{n \to \infty}\sum_{i=1}^n{\frac{1}{n}}\sin\frac{k}{n}.\] % 极限、无穷、求和 +故 +\begin{equation}\label{eq:res} + \oint_{\gamma}f(z)\,\mathrm{d}z=2\uppi\symbfit{i}\sum^n_{k=1}\mathrm{I}(\gamma,a_k)\mathrm{Res}(f,a_k). +\end{equation} + +若要公式多行对齐,可以使用 \env{align} 环境。下面的例子在等号处对齐: +\begin{align} + x^2 + y^2 & = 1 \\ + x & = \sqrt{1-y^2} \\\text{and also } + y & =\sqrt{1-x^2} +\end{align} +这会对每一行的公式进行编号。若在 \env{equation} 环境中嵌套 \env{aligned} 环境,加上参数[b] +可以达到多行对齐但只对最后一个式子编号的效果: +\begin{equation} + \begin{aligned}[b] + (a + b)^3 & = (a + b) (a + b)^2 \\ + & = (a + b)(a^2 + 2ab + b^2) \\ + & = a^3 + 3a^2b + 3ab^2 + b^3 + \end{aligned} +\end{equation} + +模板使用 \pkg{amsthm} 宏包预定义了部分与数学相关的环境,格式及编号如下: +\begin{axiom} + 这是一条axiom,使用\env{axiom}环境。 +\end{axiom} +\begin{theorem}[某某定理] % []内为可选参数 + 这是一条theorem,使用\env{theorem}环境。 +\end{theorem} +\begin{corollary}[一条推论]\label{cor:cor1} + 这是一条corollary,使用\env{corollary}环境。 +\end{corollary} +\begin{proof} + 这是一条proof,使用\env{proof}环境。 + \[ + \Matrix{A}=\begin{bmatrix} + a_{11} & \cdots & a_{1n} \\ + \vdots & \ddots & \vdots \\ + 0 & \cdots & a_{nn} + \end{bmatrix}_{n\times n} + \] + + 在证明的最后一行会加上证毕符号,若其位置不合理则需加上命令 \cs{qedhere}。 + 综上所述,推论 \ref{cor:cor1} 成立。 +\end{proof} +\begin{remark} + 这是一条remark,使用\env{remark}环境。 +\end{remark} +\begin{assumption} + 这是一条assumption,使用\env{assumption}环境。 +\end{assumption} +\begin{definition} + 这是一条definition,使用\env{definition}环境。 +\end{definition} +\begin{property} + 这是一条property,使用\env{property}环境。 +\end{property} +\begin{proposition} + 这是一条proposition,使用\env{proposition}环境。 +\end{proposition} +\begin{lemma} + 这是一条lemma,使用\env{lemma}环境。 +\end{lemma} + +以上是模板已经定义了的数学类环境,但也能自定义。 +如: +\newtheorem{tale}{传说}[chapter] % 计数与章编号相关 +\begin{tale}[山经] % []内为可选参数 + 精卫衔微木,将以填沧海。 +\end{tale} +\begin{tale}[海经] + 刑天舞干戚,猛志固常在。 +\end{tale} + + +\section{代码}\label{subsec:code} +若要在文中插入代码,简单的代码可以使用原文照列命令~\verb+\verb+或~\verb*@\verb*@, +比如~\verb-i++-、\verb*|int main|,二者区别在于,带*号的将展示代码中的空格。 +如果插入代码块,可使用环境\env{lstlisting},且可以有如下选择: +\subsubsection{直接在 \LaTeX\ 中书写代码} +\begin{lstlisting}[language=C++,caption=Hello World!,label=code:HelloWorld] +/* Hello World C++ */ +#include +using namespace std; +/***** main function *****/ +int main() +{ + cout<<"Hello World!"<}B\bond{<-}C} & \\ + \end{tabular} +\end{table} +\subsubsection{化学方程式} +\begin{table}[H] + \centering + \begin{tabular}{llll} + \ce{A ->[H2O] B} & \ce{A <=>[{上方文字}][{text below}] B} & \ce{A ->[$x$][$x_i$] B} & \ce{A v B (v) -> C ^ D (^)} \\ + \end{tabular} +\end{table} +\subsubsection{其他} +\begin{itemize} + \item 标注(可能对 CJK 文字不支持): + \ce{Zn^2+ + <=>[+ 2OH-][+ 2H+] + $\underset{\text{amphoteres Hydroxid}}{\ce{Zn(OH)2 v}}$ + <=>[+ 2OH-][+ 2H+] + $\underset{\text{Hydroxozikat}}{\ce{[Zn(OH)4]^2-}}$ + } + \item 对于化学方程式等的编号,与数学方程相似: + $$\ce{2H2O ->[{electrify}] 2H2 ^ + O2 ^}$$ + \begin{equation} + K^\ominus = \ce{\frac{[Hg^2+][Hg]}{[Hg2^2+]}} + \end{equation} +\end{itemize} + +至于有机化学结构式等,尽管有一些宏包可以绘制,但使用图片插入可能是一个更好 +的选择。 + +\section{文献引用和参考文献}\label{sec:bib} +模板使用 \cs{cite}\marg{CiteKey}命令实现上标、方括号以“顺序编码制”引用参考文献, +这是学校《规范》的要求。一个例子。\cite{abbott2016observation}而使用 +\cs{nocite}\marg{CiteKey}命令则指明不引用但需要列出的参考文献。\nocite{*} + +同一处引用多个文献时,应将各篇文献的引用标签一同写在 \cs{cite} 命令中, +并以西文逗号“,”分隔各标签。所产生的样式为:当在同一处引用两篇参考文献时, +引用序号将以西文逗号分隔; +当多余两篇且连续时,将标示起止序号并以短划线相连。这\cite{texbook,latexrumen} +又是\cite{texbook,latexrumen,gbt7714-2005}一个例子。\cite{abbott2016observation,texbook,latexrumen,buctthesis} + +关于 \file{thesisbib.bib} 文件的编辑, +可以使用\href{http://scholar.google.com.cn/}{谷歌学术}\footnote{亦可以访问国内镜像站。}% +或\href{http://xueshu.baidu.com}{百度学术}两种方式(方法类似)将文献数据导入\BibTeX{}数据库,大致方法如下: +\begin{itemize} + \item 在搜索框中搜索题目(或作者、DOI等),确定所引用的论文后点击“引用”;并在弹出框中,单击最下方“BibTeX”的链接,如图~\ref{fig:addbib}; + \item 在弹出的网页中复制所有代码至 \file{thesisbib.bib} 文件; + \item 在论文中使用 \cs{cite} 命令引用相应的文献。 + % 这里用了一条简单的自定义命令,用于快速插入单张图片,见 \file{mycfg.sty}文件。 + \addfig{AddBib.png}{在谷歌学术中导出参考文献的步骤}{fig:addbib} +\end{itemize} + +举个例子:经过图~\ref{fig:addbib} 所示步骤后,弹出的网页文本如下: +\begin{lstlisting} +@article{abbott2016observation, + title={Observation of gravitational waves from a binary black hole merger}, + author={Abbott, Benjamin P and Abbott, Richard and %(省略) + }, + journal={Physical review letters}, + volume={116}, + number={6}, + pages={061102}, + year={2016}, + publisher={APS} +} + \end{lstlisting} +将以上内容复制进 \file{thesisbib.bib},在论文中使用 +\cs{cite\{abbott2016observation\}}即可引用此文献。 +这里的 “abbott2016observation”是该篇参考文献的引用标签,可以修改。 +再来一个\cite{ashirov2008tetramerization} , +网络上的资源引用\cite{buctthesis},等。 + +\section{其他}\label{sec:other} + +\subsection{脚注}\label{subsec:footnote} +本模板采用带圈数字脚注,计数跨页重置,使用命令 \cs{footnote}\marg{text}。 +前方高能\footnote{我是可爱的脚注。}。 + +有些情况下(比如在表格环境、各种盒子内)使用 \cs{footnote}并不能正确生成脚注。 +我们可以分两步进行,先使用 \cs{footnotemark}\oarg{text} 为脚注计数, +再在合适的位置用 \cs{footnotetext}\oarg{mark}\marg{text} 生成脚注。比如表~\ref{tab:ftnt1}。 +\begin{table}[htb] + \centering + \caption{脚注示例1} + \label{tab:ftnt1} + \begin{tabular}{llll} + \hline + 人之初 & 性本善 & 性相近 & 习相远 \\ + 苟\footnotemark 不教 & 性乃迁 & 教之道 & 贵以专 \\ + \hline + \end{tabular} +\end{table} +\footnotetext{苟:如果。} + +利用 \pkg{threeparttable} 宏包提供的 \env{threeparttable} 环境可以实现在表格底下写脚注,见表~\ref{tab:ftnt2}。 + +\begin{table}[htb] +\centering +\begin{threeparttable} + \caption{脚注示例2}\label{tab:ftnt2} + \begin{tabular}{cccc} + \toprule + 昔孟母 & 择邻处\tnote{*} & 子不学 & 断机杼\\ + \midrule + 窦燕山\tnote{$\dagger$} & 有义方 & 教五子\tnote{$\ddagger$} &名俱扬\\ + \bottomrule + \end{tabular} + \begin{tablenotes}\small + \item [*] 脚注1。 + \item [$\dagger$] 脚注2。 + \item [$\ddagger$] 脚注3。 + \end{tablenotes} +\end{threeparttable} +\end{table} + +\subsection{列表环境}\label{subsec:items} +本模板提供了三种列表环境:不编号的\env{itemize}、编号的\env{enumerate} +和使用关键字的\env{description}环境。在文档的中英文摘要部分分别展示了 +基础的编号和不编号的列表环境;上面三种列表环境可以嵌套使用(至多四层), +且会自动处理不同层次的缩进和编号,如下所示: +\begin{itemize} + \item 一条 + \item 次条 + \item 这一条可以分为\dots + \begin{itemize} + \item 子一条 + \end{itemize} +\end{itemize} +稍复杂一点的,如: +\begin{enumerate} + \item 中文 + \begin{description} + \item[文言文] 古代汉语 + \item[白话文] 现代汉语 + \begin{enumerate} + \item 口语 + \begin{enumerate} + \item 普通话 + \item 方言 + \end{enumerate} + \item 书面语 + \end{enumerate} + \end{description} + \item English +\end{enumerate} + +注意:一级编号列表环境最多罗列10条,否则标签会显示错误。 +%,到第11条时,标签将从第10条的\ding{201}到第11条的\ding{202} diff --git a/macros/latex/contrib/buctthesis/doc/chapter/chapter3.tex b/macros/latex/contrib/buctthesis/doc/chapter/chapter3.tex new file mode 100644 index 0000000000..b5467fcbe5 --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/chapter/chapter3.tex @@ -0,0 +1,4 @@ +%% 第三章--chapter3.tex +\chapter[含 English 的标题]{这是题目含有 English 的一章,用这个例子来说明虽然章节名很长,但是可以使用简短的编目} +\section[同理节亦然]{含有English的一节} +文字words \ No newline at end of file diff --git a/macros/latex/contrib/buctthesis/doc/chapter/conclusion.tex b/macros/latex/contrib/buctthesis/doc/chapter/conclusion.tex new file mode 100644 index 0000000000..bb315d214e --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/chapter/conclusion.tex @@ -0,0 +1,9 @@ +%% 结论--conclusion.tex +\begin{conclusion} + 这里是结论。 + + 对全文做出简明扼要的总结,获得的主要研究进展及结论。 + + Happy \TeX ing!祝大家一切顺利! + +\end{conclusion} \ No newline at end of file diff --git a/macros/latex/contrib/buctthesis/doc/chapter/denotation.tex b/macros/latex/contrib/buctthesis/doc/chapter/denotation.tex new file mode 100644 index 0000000000..bc16f6f3d7 --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/chapter/denotation.tex @@ -0,0 +1,33 @@ +%% 符号说明--denotation.tex +\begin{denotation}[11cm]\label{chap*:deno}% + $\uppi$ & 圆周率 \\ + $c_0$ & 真空中光速 \\ + $G$ & 万有引力常量 \\ + $k$ & 静电力常量 \\ + $\varepsilon _0$ & 真空电容率 \\ + $\mu_0$ & 真空磁导率 \\ + PVA & 聚乙烯醇,Polyvinyl Alcohol\\ + EDTA & 乙二胺四乙酸,Ethylenediaminetetraacetic Acid\\ + 上邪 & 上邪!我欲与君相知,长命无绝衰。 + 山无陵,江水为竭。冬雷震震,夏雨雪。 + 天地合,乃敢与君绝!\\ + 春江花月夜 & 春江潮水连海平,海上明月共潮生。 \\ + & 滟滟随波千万里,何处春江无月明! \\ + & 江流宛转绕芳甸,月照花林皆似霰; \\ + & 空里流霜不觉飞,汀上白沙看不见。 \\ + & 江天一色无纤尘,皎皎空中孤月轮。 \\ + & 江畔何人初见月?江月何年初照人? \\ + & 人生代代无穷已,江月年年望相似。 \\ + & 不知江月待何人,但见长江送流水。 \\ + & 白云一片去悠悠,青枫浦上不胜愁。 \\ + & 谁家今夜扁舟子?何处相思明月楼? \\ + & 可怜楼上月徘徊,应照离人妆镜台。 \\ + & 玉户帘中卷不去,捣衣砧上拂还来。 \\ + & 此时相望不相闻,愿逐月华流照君。 \\ + & 鸿雁长飞光不度,鱼龙潜跃水成文。 \\ + & 昨夜闲潭梦落花,可怜春半不还家。 \\ + & 江水流春去欲尽,江潭落月复西斜。 \\ + & 斜月沉沉藏海雾,碣石潇湘无限路。 \\ + & 不知乘月几人归,落月摇情满江树。 \\ + CTAN & Comprehensive \TeX\ Archive Network\\* +\end{denotation} \ No newline at end of file diff --git a/macros/latex/contrib/buctthesis/doc/chapter/foreword.tex b/macros/latex/contrib/buctthesis/doc/chapter/foreword.tex new file mode 100644 index 0000000000..b02dd6d498 --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/chapter/foreword.tex @@ -0,0 +1,50 @@ +%% 前言--foreword.tex +\begin{foreword} +这里是前言。点明毕业论文的论题、学术意义以及其与所阅读文献的关系, +简要说明文献收集的目的、重点、时空范围、文献种类、核心刊物等方面的内容。 + +豫章故郡,洪都新府。星分翼轸,地接衡庐。襟三江而带五湖,控蛮荆而引瓯越。 +物华天宝,龙光射牛斗之墟;人杰地灵,徐孺下陈蕃之榻。雄州雾列,俊采星驰。 +台隍枕夷夏之交,宾主尽东南之美。都督阎公之雅望,棨戟遥临;宇文新州之懿 +范,襜帷暂驻。十旬休假,胜友如云;千里逢迎,高朋满座。腾蛟起凤,孟学士 +之词宗;紫电青霜,王将军之武库。家君作宰,路出名区;童子何知,躬逢胜饯。 + +时维九月,序属三秋。潦水尽而寒潭清,烟光凝而暮山紫。俨骖騑于上路,访风 +景于崇阿。临帝子之长洲,得仙人之旧馆。层峦耸翠,上出重霄;飞阁流丹,下 +临无地。鹤汀凫渚,穷岛屿之萦回;桂殿兰宫,即冈峦之体势。 + +披绣闼,俯雕甍,山原旷其盈视,川泽纡其骇瞩。闾阎扑地,钟鸣鼎食之家;舸 +舰迷津,青雀黄龙之舳。云销雨霁,彩彻区明。落霞与孤鹜齐飞,秋水共长天一 +色。渔舟唱晚,响穷彭蠡之滨,雁阵惊寒,声断衡阳之浦。 + +遥襟甫畅,逸兴遄飞。爽籁发而清风生,纤歌凝而白云遏。睢园绿竹,气凌彭泽 +之樽;邺水朱华,光照临川之笔。四美具,二难并。穷睇眄于中天,极娱游于暇 +日。天高地迥,觉宇宙之无穷;兴尽悲来,识盈虚之有数。望长安于日下,目吴 +会于云间。地势极而南溟深,天柱高而北辰远。关山难越,谁悲失路之人;萍水 +相逢,尽是他乡之客。怀帝阍而不见,奉宣室以何年? + +嗟乎!时运不齐,命途多舛。冯唐易老,李广难封。屈贾谊于长沙,非无圣主; +窜梁鸿于海曲,岂乏明时?所赖君子见机,达人知命。老当益壮,宁移白首之心? +穷且益坚,不坠青云之志。酌贪泉而觉爽,处涸辙以犹欢。北海虽赊,扶摇可接; +东隅已逝,桑榆非晚。孟尝高洁,空余报国之情;阮籍猖狂,岂效穷途之哭! + +勃,三尺微命,一介书生。无路请缨,等终军之弱冠;有怀投笔,慕宗悫之长风。 +舍簪笏于百龄,奉晨昏于万里。非谢家之宝树,接孟氏之芳邻。他日趋庭,叨陪 +鲤对;今兹捧袂,喜托龙门。杨意不逢,抚凌云而自惜;钟期既遇,奏流水以何惭? + +呜乎!胜地不常,盛筵难再;兰亭已矣,梓泽丘墟。临别赠言,幸承恩于伟饯; +登高作赋,是所望于群公。敢竭鄙怀,恭疏短引;一言均赋,四韵俱成。请洒潘 +江,各倾陆海云尔: + +\begin{center} +滕王高阁临江渚,佩玉鸣鸾罢歌舞。 + +画栋朝飞南浦云,珠帘暮卷西山雨。 + +闲云潭影日悠悠,物换星移几度秋。 + +阁中帝子今何在?槛外长江空自流。 +\end{center} + +\end{foreword} + diff --git a/macros/latex/contrib/buctthesis/doc/chapter/frontmatter.tex b/macros/latex/contrib/buctthesis/doc/chapter/frontmatter.tex new file mode 100644 index 0000000000..766979da0f --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/chapter/frontmatter.tex @@ -0,0 +1,106 @@ +%% 前置部分--frontmatter.tex +%% 诚信声明 +\makedeclare%[figure/declare-bachelor.png] + +%% 任务书 +\begin{taskbook} +\taskinfo % or use `\taskinfo*' for less lines. + +\taskitem % 1.设计(论文)的主要任务及目标 +大学之道,在明明德,在亲民,在止于至善。知止而后有定; +定而后能静;静而后能安;安而后能虑;虑而后能得。 +物有本末,事有终始。知所先后,则近道矣。 + +古之欲明明德于天下者,先治其国;欲治其国者,先齐其家; +欲齐其家者,先修其身;欲修其身,先正其心;欲正其心者,先诚其意; +欲诚其意者,先致其知;致知在格物。物格而后知至;知至而后意诚; +意诚而后心正;心正而后身修;身修而后家齐;家齐而后国治; +国治而后天下平。 + +自天子以至于庶人,壹是皆以修身为本。其本乱而未治者否矣。 +其所厚者薄,而其所薄者厚,未之有也。此谓知本,此谓知之至也。 + +\taskitem % 2.设计(论文)的基本要求和内容 +古之学者必有师。师者,所以传道受业解惑也。人非生而知之者,孰能无惑? +惑而不从师,其为惑也,终不解矣。生乎吾前,其闻道也固先乎吾,吾从而 +师之;生乎吾後,其闻道也亦先乎吾,吾从而师之。吾师道也,夫庸知其年 +之先後生於吾乎!是故无贵无贱无长无少,道之所存,师之所存也。 + +\taskitem % 3.主要参考文献 + \begin{bibenumerate} + \item 北京化工大学教务处. 本科生毕业设计(论文)撰写规范 [EB/OL]. 2018[2020-04-08]. \url{https://jiaowuchu.buct.edu.cn/2018/1009/c515a22046/page.htm}. + \item 刘海洋. \LaTeX\ 入门 [M]. 北京 : 电子工业出版社, 2013. + \item MITTELBACH F, GOOSSENS M, BRAAMS J, et al. The \LaTeX\ Companion[M]. 2nd ed. Reading, Massachusetts : Addison-Wesley, 2004. + \item + \end{bibenumerate} + +\taskitem % 4.进度安排 + \begin{table}[H] + \centering + \begin{tabularx}{.95\textwidth}{p{1.5em}|X|p{6em}} + \hline + & 设计(论文)各阶段名称 & 起止日期 \\\hline + 1 & & \\\hline + 2 & & \\\hline + 3 & & \\ + \hline + \end{tabularx} + \end{table} +\end{taskbook} + + +%% 摘要 +\begin{cabstract} + 摘要和关键词一起写在这里。 + + 摘要介绍所研究的主要内容、方法、结果及创新点。应有中文、外文两种文本, + 如无特殊情况,外文文本摘要一般使用英文撰写。中文、外文摘要各占A4纸页面的一半。 + 外文摘要要与中文摘要相呼应,其写作模式同中文基本相同。中文摘要一般为300字左右, + 英文摘要为1500印刷符号左右,含中、英文摘要关键词。 + + 本项目的创新点有: + \begin{enumerate} + \item 开发了第一份适用于北京化工大学本科生毕业论文的\LaTeX{}模板; + \item 以自身为示例展示此模板的使用方法; + \item 这是编号列表环境的第三项。 + \end{enumerate} + + 这里是一些废话,用于填充文本,在后面的部分也会以类似的方式插入无关的文字。 + 这一段话的作用是将中文摘要写到 300 个字。 + + (这里总共约 300 字) +\end{cabstract} + +\begin{eabstract} + Here is the Abstract and the Keywords. + + In the abstract, you may introduce the main contents of your research, + as well as the methods, results and some innovation points. There should + be one Chinese version and one foreign version, while the foreign one + should generally be written in English except for some special occasions. + Each of the context of them takes up half of an A4-page. What's more, + the foreign abstract should be in correspondence to the Chinese one, + and the narrative pattern is supposed to be similar. The Chinese abstract + adds up to normally 300 Chinese characters, while the English abstract + totaled around 1500 printed characters, including Chinese and English keywords. + + Oh, here're just 900 letters total. So I have to add something nonsense\dots. + + One dollar and eighty-seven cents. That was all. And sixty cents of it was + in pennies. Pennies saved one and two at a time by bulldozing the grocer + and the vegetable man and the butcher until one's cheeks burned with the + silent imputation of parsimony that such close dealing implied. Three times + Della counted it. One dollar and eighty-seven cents. And the next day would + be Christmas. There was clearly nothing to do but flop down on the shabby + little couch and howl. So Della did it. + \hfill --- \textit{THE GIFT OF THE MAGI by O.Henry} + + Innovations in the research: + \begin{itemize} + \item Developing the first \LaTeX{} writting template for BUCT undergraduate thesis; + \item Using the PDF itself as an example to show how to use the template; + \item This is the third item of an unnumbered list. + \end{itemize} + + (Around 1500 letters total) +\end{eabstract} \ No newline at end of file diff --git a/macros/latex/contrib/buctthesis/doc/chapter/resume.tex b/macros/latex/contrib/buctthesis/doc/chapter/resume.tex new file mode 100644 index 0000000000..f35b219c12 --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/chapter/resume.tex @@ -0,0 +1,22 @@ +%% 成果与简介--resume.tex +\begin{achievements} + + \section*{发表及已接受的论文:} + + \begin{bibenumerate} + \item + \end{bibenumerate} + + \section*{成果及专利:} + \begin{bibenumerate} + \item + \end{bibenumerate} + +\end{achievements} + + +\begin{resume} + \section*{作者简介:} \zhlipsum[1] + + \section*{导师简介:} \zhlipsum[2] +\end{resume} \ No newline at end of file diff --git a/macros/latex/contrib/buctthesis/doc/chapter/translation.tex b/macros/latex/contrib/buctthesis/doc/chapter/translation.tex new file mode 100644 index 0000000000..475fe7e9e7 --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/chapter/translation.tex @@ -0,0 +1,12 @@ +%% 翻译--translation.tex +\begin{translation} + Battery + + 电池 + + 電池 + + バッテリー + + Батареи +\end{translation} \ No newline at end of file diff --git a/macros/latex/contrib/buctthesis/doc/code/helloworld.cpp b/macros/latex/contrib/buctthesis/doc/code/helloworld.cpp new file mode 100644 index 0000000000..692b8a8f5d --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/code/helloworld.cpp @@ -0,0 +1,9 @@ +/* Hello World C++ */ +#include +using namespace std; +/***** main function *****/ +int main() +{ + cout<<"Hello World!"<}[<参数个数>][<首参默认值>]{<具体的定义>} +% add a single fig. Usage:\addfig[Width]{Path}{Caption}{Label} +\newcommand{\addfig}[4][.8\textwidth]{% + \begin{figure}[H] + \centering + \includegraphics[width = #1]{#2} + \caption{#3}\label{#4} + \end{figure} +} +\newcommand{\version}{v1.1} +\newcommand{\cs}[1]{\texttt{\textbackslash#1}} +\newcommand{\file}{\textsf} +\newcommand{\pkg}{\textsf} +\newcommand{\env}{\texttt} +\newcommand{\opt}{\texttt} +\newcommand{\marg}[1]{\texttt{\{$\langle$#1$\rangle$\}}} +\newcommand{\oarg}[1]{\texttt{ [$\langle$#1$\rangle$] }} + +%% Maths +\newcommand\Vector{\symbfit} +\newcommand\Matrix{\symbfit} + +%% A sample of thesis cover +\title{BUCTthesis 写作示例文档\par\version} +\author{Miracle0565} +\ctexset{today=big} diff --git a/macros/latex/contrib/buctthesis/doc/thesisbib.bib b/macros/latex/contrib/buctthesis/doc/thesisbib.bib new file mode 100644 index 0000000000..e1e6bf30a4 --- /dev/null +++ b/macros/latex/contrib/buctthesis/doc/thesisbib.bib @@ -0,0 +1,70 @@ +% thesisbib.bib--bibliography database for Bibtex + +@article{abbott2016observation, + title = {Observation of gravitational waves from a binary black hole merger}, + author = {Abbott, Benjamin P and Abbott, Richard and Abbott, TD and Abernathy, MR and Acernese, Fausto and Ackley, Kendall and Adams, Carl and Adams, Thomas and Addesso, Paolo and Adhikari, RX and others}, + journal = {Physical Review Letters}, + volume = {116}, + number = {6}, + pages = {061102}, + year = {2016}, + publisher = {APS} +} + +@article{ashirov2008tetramerization, + title = {Tetramerization of 3-methyl-cyclopropene-3-carbonitrile: A novel CN-Alder-ene reaction}, + author = {Ashirov, Roman V and Shamov, Grigory A and Lodochnikova, Olga A and Litvynov, IA and Appolonova, Svetlana A and Plemenkov, Vitaly V}, + journal = {The Journal of organic chemistry}, + volume = {73}, + number = {15}, + pages = {5985--5988}, + year = {2008}, + publisher = {ACS Publications} +} +@software{buctthesis, + title = {{BUCTthesis: A LaTeX writting template for BUCT undergraduate thesis}}, + author = {{Miracle0565}}, + year = {2020}, + urldate = {2020-04-08}, + url = {https://github.com/Miracle0565/BUCTthesis} +} +@standard{gbt7714-2005, + author = {{中国国家标准化管理委员会}}, + title = {GB/T 7714-2005: 文后参考文献著录规则}, + year = {2005}, + address = {北京}, + publisher= {中国标准出版社}, + language = {chinese} +} +@book{latexcompanion, + author = {Frank Mittelbach and Michel Goossens and Johannes Braams and David, P.Carlisle and Chris Rowley}, + title = {The {\LaTeX{}} {C}ompanion}, + edition = {2}, + address = {Reading, Massachusetts}, + publisher = {Addison-Wesley}, + year = {2004} +} +@book{latexrumen, + author = {刘海洋}, + title = {\LaTeX{}入门}, + year = {2013}, + publisher = {电子工业出版社}, + address = {北京}, + isbn = {978-7-121-20208-7}, + language = {chinese} +} +@book{texbook, + author = {Donald~E. Knuth}, + title = {The {\TeX} book}, + year = {1989}, + edition = {15}, + address = {Reading, Massachusetts}, + publisher = {Addison-Wesley Publishing Company} +} +@online{thenorm, + title = {本科生毕业设计(论文)撰写规范}, + author = {北京化工大学教务处}, + year = {2019}, + urldate = {2020-02-06}, + url = {https://jiaowuchu.buct.edu.cn/2018/1009/c515a22046/page.htm} +} \ No newline at end of file diff --git a/macros/latex/contrib/buctthesis/source/buctthesis.dtx b/macros/latex/contrib/buctthesis/source/buctthesis.dtx new file mode 100644 index 0000000000..6ed3c2fa66 --- /dev/null +++ b/macros/latex/contrib/buctthesis/source/buctthesis.dtx @@ -0,0 +1,2409 @@ +% \iffalse meta-comment +% +% Copyright (C) 2019-2020 by Miracle0565 +% +% https://github.com/Miracle0565/BUCTthesis +% ------------------------------------------------------- +% +% This file 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. The latest version of this license +% is in: +% +% http://www.latex-project.org/lppl.txt +% +% and version 1.3c or later is part of all distributions +% of LaTeX version 1999/12/01 or later. +% +% \fi +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \iffalse +%<*driver> +\ProvidesFile{buctthesis.dtx}[2020/03/23 v1.1 BUCT Thesis Template] +\documentclass{ltxdoc} +\usepackage{manual} +\begin{document} +\DocInput{\jobname.dtx} +\PrintIndex +\PrintChanges +\end{document} +% +% \fi +% +% \DoNotIndex{\newcommand,\newenvironment,\renewcommand,\renewenvironment} +% \DoNotIndex{\providecommand,\NewDocumentCommand} +% \DoNotIndex{\begin,\end,\begingroup,\endgroup} +% \DoNotIndex{\Huge,\huge,\LARGE,\Large,\large,\normalsize} +% \DoNotIndex{\small,\footnotesize,\scriptsize,\tiny,\zihao} +% \DoNotIndex{\addtocounter,\label,\let,\linewidth,\newcounter} +% \DoNotIndex{\noindent,\normalfont,\par,\parskip,\phantomsection} +% \DoNotIndex{\providecommand,\ProvidesPackage,\refstepcounter} +% \DoNotIndex{\setcounter,\setlength,\string,\strut} +% \DoNotIndex{\textbackslash,\texttt,\ttfamily,\usepackage} +% \DoNotIndex{\par,\\} +% \DoNotIndex{\if,\ifx,\ifdim,\ifnum,\ifcase,\else,\or,\fi} +% \DoNotIndex{\let,\def,\xdef,\edef,\newcommand,\renewcommand} +% \DoNotIndex{\expandafter,\csname,\endcsname,\relax,\protect} +% \DoNotIndex{\normalfont,\bfseries,\slshape,\sffamily,\interlinepenalty} +% \DoNotIndex{\textbf,\textit,\textsf,\textsc} +% \DoNotIndex{\hfil,\par,\hskip,\vskip,\vspace,\quad} +% \DoNotIndex{\centering,\raggedright,\ref} +% \DoNotIndex{\c@secnumdepth,\@startsection,\@setfontsize} +% \DoNotIndex{\ ,\@plus,\@minus,\p@,\z@,\@m,\@M,\@ne,\m@ne} +% \DoNotIndex{\@@par,\DeclareOperation,\RequirePackage,\LoadClass} +% \DoNotIndex{\AtBeginDocument,\AtEndDocument} +% +% +% \GetFileInfo{buctthesis.dtx} +% +% \title{\textsf{BUCTthesis}:北京化工大学学位论文模板} +% \author{Miracle0565\\ \texttt{https://github.com/Miracle0565}} +% \date{\filedate} +% +% \maketitle +% \tableofcontents\clearpage +% +% \section{欢迎!} +% BUCTthesis是北京化工大学本科与硕士、博士研究生毕业论文的 \LaTeX\ 写作模板,版本号~\fileversion。 +% 本文是模板的使用指南,旨在帮助北化毕业生掌握此模板的使用方法,从而写出符合北化 +% \href{https://jiaowuchu.buct.edu.cn/2018/1009/c515a22046/page.htm}{《本科生毕业设计(论文)撰写规范》}(以下称《本科规范》) +% 和 \href{https://xxgk.buct.edu.cn/2017/1107/c2835a39437/page.htm}{《北京化工大学研究生学位论文撰写规范(修订)》}(以下称《研究生规范》) +% 要求的毕业论文。 +% +% \subsection{模板内容} +% 本模板为中文论文模板,暂不支持英语专业的论文写作。以下是完整论文的书序,其中划线部分为模板未完成的部分。 +% \begin{description} +% \item[本科] \without{开题报告} \footnote{格式未指定。}、\without{中期进展情况检查表} \footnote{由学校提供 Word,可转换为 PDF 文件插入。}、\without{论文封面} \footnote{学校统一印制,论文题目等信息需手写,可使用扫描件插入。}、诚信声明、任务书、摘要、目录、前言、正文、结论、参考文献、符号说明、致谢和附录; +% \item[研究生] 论文封面、版权页(独创性声明和授权书)、\without{学位论文数据集} \footnotemark[2]、中英文摘要、中英文目录、符号和缩略词说明、正文、参考文献、附录、致谢、作者攻读学位期间发表的学术论文及科研成果目录、作者和导师简介和\without{答辩委员会决议} \footnote{使用扫描件插入。}。 +% \end{description} +% +% \subsection{免责声明} +% 请您注意,至本文档编译时,北京化工大学教务处仅提供《本科规范》和《研究生规范》而未对本模板做任何测试或授权。 +% 模板作者自当尽力,但限于软件等各种因素,由本模板生成的文档可能仍与要求有所出入, +% 故不保证审查老师对格式不提意见。在开始使用之前,您需要同意: +% 任何由于使用本模板而引起的论文格式审查问题均与本模板作者无关。 +% +% \subsection{开源说明} +% 本模板开源于 \href{https://github.com/Miracle0565/BUCTthesis}{GitHub},代码部分遵循 +% \href{https://www.latex-project.org/lppl.txt}{\LaTeX\ Project Public License 1.3c} 及以上协议。 +% 模板文件夹中有关学校校徽和校名的插图,其版权归北京化工大学所有。 +% +% 由于模板建设尚在起步阶段,欢迎任何有兴趣的同学加入模板的开发工作。 +% +% \subsection{关于本文} +% 本文档将对使用这份模板作一简单介绍。在第~\ref{sec:start}~节将概述使用模板前的准备,以及介绍编译方法; +% 在第~\ref{sec:usage}~节将介绍本模板中新定义及实用的命令与环境; +% 最后在第~\ref{sec:implementation}~节将简述模板文档类代码,面向对 BUCTthesis 开发感兴趣的用户。 +% +% 本文档中的宏包、命令等内容以不同字体或形式展现,以作区分: +% 无衬线字体表示宏包、文档类等存在于计算机上的文件, +% 如 \file{buctthesis.cls} 文件、\pkg{amsmath}宏包、\cls{ctexbook} 文档类; +% 等宽字体表示命令与环境,如 \cs{buctsetup} 命令、\env{abstract} 环境。 +% 对于命令中的参数将置于尖括号(尖括号无需输入)中,如 \cs{include}\marg{file}; +% 对于命令行指令,将置于\ {\color{violet!65}\rule[.25ex]{1em}{1ex}} 颜色框内,且需要逐行输入; +% 而对于 \LaTeX\ 代码,将置于\ {\color{cyan}\rule[.25ex]{1em}{1ex}} 颜色框内, +% 需要保存为特定文件后进行编译。 +% +% \section{开始使用}\label{sec:start} +% \subsection{准备工作} +% 开始之前,您需要安装一个合适的 \TeX\ 发行版,以及需要一些必要的 \TeX\ 技能。 +% \begin{enumerate} +% \item \TeX\ 发行版:建议完整安装 \TeX\ Live 2020 或更新版本。模板\emph{不支持} \CTeX\ 套装。安装 \TeX 发行版的详细步骤可参考\href{https://github.com/OsbertWang/install-latex-guide-zh-cn}{《一份简短的关于 \LaTeX 安装的介绍》}。此外,该文档简要地介绍了几款常见的文本编辑器,可根据喜好自行选择。 +% \item \TeX\ 技能:本文档不是一份 \LaTeX\ 零基础教程,使用本模板需要对 \LaTeX\ 和参考文献管理工具 \BibTeX 有一定的熟练度。若您是新手,我们建议您先阅读一些入门文档,如\href{http://mirror.ctan.org/info/lshort/chinese/lshort-zh-cn.pdf}{《一份不太简短的 \LaTeXe 介绍》}。 +% \end{enumerate} +% +% \subsection{模板组成} +% 在表 \ref{tab:mainfile} 中罗列了本模板所包含的主要文件。 +% \begin{table}[ht] +% \centering +% \caption{模板的组成}\label{tab:mainfile} +% \begin{tabular}{ll} +% \toprule +% 文件(夹)名 & 简述\\ +% \midrule +% \file{buctthesis.ins} & \textsc{DocStrip} 驱动文件\\ +% \file{buctthesis.dtx} & \textsc{DocStrip} 源文件\\\cmidrule(lr){1-2} +% \file{chapter/} & 论文各部分的源文件路径\\ +% \file{code/} & 源代码的路径\\ +% \file{cover/} & 论文封面的路径\\ +% \file{figure/} & 插图的路径\\\cmidrule(lr){1-2} +% \file{main.tex} & 主文件\\ +% \file{main.pdf} & 示例文档\\ +% \file{buctthesis.cls} & 模板的文档类文件\\ +% \file{thesisbib.bib} & \BibTeX{}参考文献数据库\\ +% \file{mycfg.sty} & 自定义配置文件\\ +% \file{README.md} & 项目自述文件\\ +% \file{\bfseries buctthesis.pdf} & 写作指南,即本文\\ +% \bottomrule +% \end{tabular} +% \end{table} +% +% \begin{enumerate} +% \item 主文件 \file{main.tex}:定义论文相关信息,并对分散于 \file{chapter/} 文件夹下的各部分内容进行“整合”。这里的“各部分内容”包括诚信声明或版权页、摘要、正文等。 +% \item 文档类文件 \file{buctthesis.cls}:格式控制。可由 \file{buctthesis.ins} 和 \file{buctthesis.dtx} 生成: +% \begin{shell} +% xelatex buctthesis.ins +% \end{shell} +% \item \file{buctthesis.pdf}:写作指南,即本文。可由 \file{buctthesis.dtx} 生成: +% \begin{shell} +% xelatex buctthesis.ins +% xelatex buctthesis.dtx +% makeindex -s gind.ist -o buctthesis.ind buctthesis.idx +% xelatex buctthesis.dtx +% xelatex buctthesis.dtx +% \end{shell} +% \end{enumerate} +% +% \subsection{编译论文} +% 模板基于 \cls{ctexbook} 文档类构建,但\emph{仅} 支持 \XeTeX\ 引擎。 +% 目前参考文献生成基于 \BibTeX,因此完整的编译流程如下: +% (输入以下命令时可略去文件扩展名) +% \begin{shell} +% xelatex main.tex +% bibtex main.tex +% xelatex main.tex +% xelatex main.tex +% \end{shell} +% +% 或者使用更方便的 latexmk 工具:不加参数则默认对 \file{main.tex} 进行编译。 +% 相比上一种,使用 latexmk 更加自动化,能持续编译直到解决所有的交叉引用: +% \begin{shell} +% latexmk +% \end{shell} +% +% 示例文件会随模板一同发布。建议在写作开始前对示例文件执行一次全编译,以检查编程环境是否合适。 +% +% \subsection{提问} +% 对于模板的任何问题或新功能需求请提交至 \href{https://github.com/Miracle0565/BUCTthesis/issues}{GitHub Issues}。 +% 以下步骤可能对排除与精简问题有所帮助: +% \begin{enumerate} +% \item 将 \file{buctthesis.cls} 和 \file{main.tex} 文件复制到一空白文件夹; +% \item 简化 \file{main.tex} 中能复现问题的代码至如下所示: +% \begin{latex} +% \documentclass[ type = bachelor ]{buctthesis} % 请注意指定文档类型 +% \begin{document} +% sOmetHInG GoEs wRoNg. +% \end{document} +% \end{latex} +% \item 如果有必要的话可以将 \file{.log} 文件通过 \url{https://paste.ubuntu.com} 一并提交。 +% \end{enumerate} +% +% \section{使用说明}\label{sec:usage} +% 本节将简单介绍模板中的命令和环境。除了以下介绍,推荐对照示例文件及源代码看一看。 +% +% \subsection{论文选项}\label{subsec:options} +% \subsubsection{文档类选项} +% 主文件 \file{main.tex} 以 +% \begin{latex} +% \documentclass[ +% type = doctor, % bachelor | master | doctor +% submit, +% openany, % openany | openright(default) +% ]{buctthesis} +% \end{latex} +% 命令载入文档类,从而控制全文格式。 +% +% 以下逐一简述各个选项: +% +% \DescribeOpt{type = } +% \emph{必须指定一种类型}:本科 \opt{bachelor},硕士 \opt{master},以及博士 \opt{doctor}。 +% 如: +% \begin{latex} +% % 博士论文 +% \documentclass[type = doctor,]{buctthesis} +% % 或: +% % 本科论文 +% \documentclass[type = bachelor,]{buctthesis} +% \end{latex} +% +% \DescribeOpt{submit} +% 是否为提交版本。如果启用则会将文章超链接和代码块的颜色全部设置为黑色,适合论文最终提交与付梓。 +% +% \DescribeOpt{openright} +% \DescribeOpt{openany} +% 对于书籍而言,一般章都只出现在右边的页面(奇数页),之前不足的页面用空白补足。 +% 这也是打开模板 \opt{openright} 选项的结果,这会在适当处插入一完全空白页。 +% 而 \opt{openany} 则允许在任意页开启新的一章。 +% +% 其它选项:多余的选项将传递给 \pkg{ctexbook} 文档类,如 \opt{draft} 将关闭插图和部分宏包的渲染,从而加快编译速度。 +% +% \subsubsection{论文信息}\label{subsec:buctsetup} +% \DescribeMacro{\buctsetup} +% \DescribeOpt{ctitle} +% \DescribeOpt{etitle} +% \DescribeOpt{cauthor} +% \DescribeOpt{class} +% \DescribeOpt{studentid} +% \DescribeOpt{school} +% \DescribeOpt{major} +% \DescribeOpt{supervisor} +% \DescribeOpt{msupervisor} +% \begin{syntax}{buctsetup} +% \marg{键值列表} +% \end{syntax} +% +% 接下来需要定义论文相关信息,使用 \cs{buctsetup} 命令以 \meta{key}$=$\meta{value} +% 的形式进行定义,包括论文的中英文标题、作者个人信息等。 +% \begin{latex} +% \buctsetup{ +% % 论文的中文标题 +% ctitle = {基于 \LaTeX\ 的北京化工大学毕业论文写作模板}, +% % 论文的英文标题,一般需要大写 +% etitle = {BUCTthesis: A \LaTeX\ WRITING TEMPLATE FOR BUCT}, +% % 作者的中文姓名 +% cauthor = {张三}, +% % 班级(仅本科) +% class = {某某1024}, +% % 学号(仅本科) +% studentid = {2018020999}, +% % 学院(仅本科) +% school = {材料科学与工程学院}, +% % 专业名称(仅本科) +% major = {高分子材料与工程}, +% % 导师的姓名与职称(仅本科) +% supervisor = {李四教授}, +% % 专业负责人姓名(仅本科) +% msupervisor = {王五}, +% % 中文、英文关键词,各关键词间以西文逗号“,”分隔 +% ckeywords = {论文,\LaTeX{},模板}, +% ekeywords = {thesis,\LaTeX{},template}, +% } +% \end{latex} +% +% \emph{无论是文档类选项还是 \cs{buctsetup} 命令,各选项之间不要留有空行,并以西文逗号“,”分隔。} +% +% 此外,\cs{buctsetup}\marg{键值列表} 与下列命令等价: +% \begin{latex} +% % 于导言区 +% \ctitle{基于 \LaTeX\ 的北京化工大学毕业论文写作模板} +% \etitle{BUCTthesis: A \LaTeX\ WRITING TEMPLATE FOR BUCT} +% % ...(下同) +% \end{latex} +% +% \subsection{前置部分}\label{subsec:frontmatter} +% +% 在“目录”之前的几个部分,包括“诚信声明”\footnote{根据《现代汉语词典》对“申明”与“声明”二词的释义,% +% 《本科规范》中的“诚信申明”应作“诚信声明”;模板以后者作为标题。}(仅本科)、 +% 版权页(仅硕博)、“任务书”(仅本科)、“摘要”和“Abstract”, +% 分别对应于 \file{chapter/frontmatter.tex} 中的不同命令或环境。 +% +% \subsubsection{诚信声明与版权页} +% \DescribeMacro{\makedeclare} +% \begin{syntax}{makedeclare} +% \oarg{文件路径} +% \end{syntax} +% +% 直接使用 \cs{makedeclare} 会根据所选 \opt{type} 生成对应内容。 +% +% 此外,考虑到有时需要插入扫描页,所以该命令可跟一个可选参数,如: +% \begin{latex} +% \makedeclare[figure/declare.png] +% \end{latex} +% 即可插入位于 \file{figure/declare.png} 的图片来代替。 +% +% \subsubsection{摘要和关键词}\label{subsubsec:abstract} +% \DescribeEnv{cabstract} +% \DescribeEnv{eabstract} +% 中、英文摘要分别使用 \env{cabstract} 和 \env{eabstract} 环境。 +% \begin{latex} +% \begin{cabstract} +% 中文摘要。 +% \end{cabstract} +% \begin{eabstract} +% Abstract in English. +% \end{eabstract} +% \end{latex} +% +% 关键词会根据在 \cs{buctsetup} 中的定义自动生成,参见~\ref{subsec:buctsetup}。 +% +% \subsubsection{任务书}\label{subsubsec:taskbook} +% \DescribeEnv{taskbook} +% \DescribeMacro{\taskinfo} +% \DescribeMacro{\taskinfo*} +% \DescribeEnv{bibenumerate} +% 该环境仅适用于本科论文中。 +% +% “本科生毕业设计(论文)任务书”部分使用 \env{taskbook} 环境。 +% 主文件中所定义的部分信息会作用于“任务书”的开头部分; +% 该部分以 \cs{taskinfo} 或 \cs{taskinfo*} 命令来插入, +% 二者的区别在于后者比前者少了一次换行,是《本科规范》中示例的实现,但不适合文字较多时使用。 +% +% 除此之外,可以选择使用 \env{bibenumerate} 环境来排版有序文献列表, +% 序号已经设置为带方括号的数字。 +% +% \emph{以上各部分在源文件中含有部分代码,稍作改动即可。} +% +% \subsubsection{目录}\label{subsubsec:content} +% \DescribeMacro{\tableofcontents} +% \DescribeMacro{\tableofcontentsEN} +% \DescribeMacro{\listofdesignfigures} +% 三个命令分别生成中文目录、英文目录(仅硕博)、设计图纸目录(仅本科部分专业)。 +% \begin{latex} +% \tableofcontents +% \tableofcontentsEN +% \listofdesignfigures +% \end{latex} +% +% 三者是互相独立的。 +% 英文目录通过 \cs{echapter} 等命令指定某一标题的英文标题,参见~\ref{subsubsec:bitoc}。 +% 设计图纸目录通过 \env{dfigure} 环境指定插图为“设计图纸”并计数编号。 +% 参见~\ref{subsubsec:dfigure}。 +% +% \subsubsection{符号说明表}\label{subsubsec:deno} +% \DescribeEnv{denotation} +% 符号说明部分的源文件位于 \file{chapter/denotation.tex}, +% 使用 \env{denotation} 环境。 +% 《本科规范》和《研究生规范》中都未详细规定符号说明部分的格式, +% 模板设计了一个无框线、可跨页的长表格,直接在环境里填入内容即可。 +% 环境接受一个可选 \meta{Width} 参数 ,代表“说明”一列的宽度,用于在必要时调整。 +% \begin{latex} +% \begin{denotation}[12cm] % 设置第二列的列宽为 12 cm,默认 10 cm +% 符号1 & 说明1 \\ +% 符号2 & 说明2 \\ +% \end{denotation} +% \end{latex} +% +% \emph{注意:“符号说明表”在本科论文中置于“参考文献”之后,与研究生论文有所差异。} +% +% \subsubsection{前言}\label{subsubsec:foreword} +% 该环境仅适用于本科论文中。 +% +% 该部分的源代码位于 \file{chapter/foreword.tex}, +% 使用 \env{foreword} 环境,在相应位置输入文本即可。注意不能在此环境中使用 +% \cs{section}等与“章”计数器有关的命令,结论、翻译、致谢部分同理。 +% +% \subsection{正文部分}\label{subsec:mainmatter} +% +% \subsubsection{纲举目张} +% \DescribeMacro{\include} +% \DescribeMacro{\input} +% \begin{syntax}{include} +% \marg{文件} +% \end{syntax} +% \qquad +% \begin{syntax}{input} +% \marg{文件} +% \end{syntax} +% +% 正文部分各个章节的源文件存放于 \file{chapter/} 文件夹, +% 只要在 \file{main.tex} 正文部分以上述命令插入各章节即可成文。 +% 插入 \meta{文件} 可以不带扩展名,默认为 \file{.tex}。 +% +% 使用 \cs{include} 命令会在读入文件前另起一页,而 \cs{input} +% 纯粹插入文件里的内容。 +% 当随着写作章节增多,每次编译时间也会越来越长。 +% 此时可以选择性地注释部分章节,从而快速编译查错。 +% +% \subsubsection{双语目录}\label{subsubsec:bitoc} +% \DescribeMacro{\echapter} +% \DescribeMacro{\esection} +% \DescribeMacro{\esubsection} +% \DescribeMacro{\esubsubsection} +% \begin{syntax}{echapter} +% \marg{英文目录标题} +% \end{syntax} +% +% 这些命令仅适用于硕博论文中,支持章、节、小节和小小节标题,且语法相同。 +% +% 硕博论文要求中英双语目录,且英语目录要与中文对应。 +% 我们只需在正文章节标题命令后加上对应标签即可。 +% 如: +% \begin{latex} +% \chapter{绪论}\echapter{Intorduciton} +% \section{基本概念}\esection{Basic Conceptions} +% \section{本章小结}\esection{Chapter Summary} +% \chapter{实验}\echapter{The Experiments} +% \end{latex} +% +% 可能写两遍 chapter 或 section 显得过于繁琐,我们也有更简单的 \cs{bichapter} 与 \cs{bisection} 等命令。以 \cs{bichapter} 为例,语法格式为: +% +% \DescribeMacro{\bichapter} +% \DescribeMacro{\bisection} +% \DescribeMacro{\bisubsection} +% \DescribeMacro{\bisubsubsection} +% \begin{syntax}{bichapter} +% \oarg{中文目录标题}\marg{中文正文标题}\marg{英文目录标题} +% \end{syntax} +% +% 可见与 \cs{chapter} 相比,它多了一个参数用于接受 \meta{英文目录的标题}。 +% 于是,上面这个例子可以这样简化: +% \begin{latex} +% \bichapter{绪论}{Intorduciton} +% \bisection{基本概念}{Basic Conceptions} +% \bisection{本章小结}{Chapter Summary} +% \bichapter{实验}{The Experiments} +% \end{latex} +% +% 但这也有少许弊端:一些编辑器会检测代码中诸如 \cs{section} 等章节结构命令, +% 以此在编辑窗口中显示论文的结构树;但是,如果使用了 \cs{bisection} 等命令之后, +% 就可能无法正常显示了。 +% +% \DescribeMacro{\tableofcontentsEN} +% 然后,使用 \cs{tableofcontentsEN} 生成英文目录项。 +% 类似中文目录,英文目录需要经过两次编译才能正确生成。 +% +% \subsubsection{双语图表注}\label{subsubsec:bicaption} +% \DescribeMacro{\bicaption} +% \begin{syntax}{bicaption} +% \marg{中文长图表注}\marg{英文长图表注} +% \end{syntax} +% +% 该命令仅适用于硕博论文中。 +% +% 具体的用法很简单:使用 \cs{bicaption} 代替 \cs{caption} 命令即可,如: +% \begin{latex} +% \begin{figure} +% \centering \includegraphics[]{file} +% \bicaption{中文标题}{English Title} +% \end{figure} +% \end{latex} +% +% \subsubsection{设计图纸}\label{subsubsec:dfigure} +% 这些命令和环境仅适用于本科论文中。 +% +% 关于一般的插图请看示例文件,这里介绍关于“设计图纸”及编目的方法。 +% +% 由于《本科规范》未对所谓“设计图纸”详细说明,因此模板设计了两种编目方式: +% 一是加入主目录,另一种是单独生成目录。 +% +% \DescribeEnv{dfigure} +% 设计图纸的计数器是独立于一般插图的,故需要使用 \env{dfigure} 环境来代替 \env{figure}。 + +% \DescribeMacro{\dcaption} +% 先来看编入主目录的方式,在正文内插入插图的代码处, +% 除了使用 \cs{dcaption} 代替 \cs{caption}外都一样。 +% \begin{latex} +% \begin{dfigure}[htbp] +% \centering\includegraphics[]{file} +% \dcaption{设计图纸示例} +% \end{dfigure} +% \end{latex} +% +% \DescribeMacro{\listofdesignfigures} +% 而独立目录也很简单,一个 \cs{listofdesignfigures} 即可。参见~\ref{subsubsec:content}。 +% \subsubsection{结论} +% \DescribeEnv{conclusion} +% 该环境仅适用于本科论文中。 +% +% 结论部分的源文件位于 \file{chapter/conclusion.tex}。该环境与前言相似,没有章的编号。 +% 但如果希望把“结论”编入章节,如“第五章\hspace{\ccwd}结论”, +% 那么就不必使用 \env{conclusion} 环境,像其他章节一样使用 \cs{chapter} 就可以了。 +% \begin{latex} +% \begin{conclusion} +% 本文的结论有什么? +% \end{conclusion} +% \end{latex} +% +% \subsubsection{参考文献}\label{subsubsec:bib} +% \DescribeMacro{\cite} +% \DescribeMacro{\nocite} +% \begin{syntax}{cite} +% \marg{CiteKey} +% \end{syntax} +% +% 模板以上标、方括号按“顺序编码制”引用参考文献。 +% 而 \cs{nocite}\marg{CiteKey} 则指明不引用但需要列出的参考文献。 +% 在同一处引用多个文献时,应将各篇文献的引用标签一同写在参数里, +% 并以西文逗号“,”分隔每个 \meta{CiteKey}。 +% +% 主文件中以 +% \begin{latex} +% \bibliographystyle{gbt7714-numerical} +% \bibliography{thesisbib.bib} +% \end{latex} +% 来增加符合格式要求的参考文献章节。为罗列各条参考文献, +% 需要在 \file{thesisbib.bib} 文件中增删需引用的文献数据。 +% 在文章中相应位置引用文献后,需执行一次全编译以确保正确显示。 +% +% \emph{注意:至少需要引用一篇文献,否则执行完全编译可能会引起编译错误。} +% +% +% \subsection{后置部分}\label{subsec:backmatter} +% \subsubsection{翻译} +% \DescribeEnv{translation} +% 该环境仅适用于本科论文中。 +% +% 文献翻译的源文件位于 \file{chapter/translation.tex}, +% 使用 \env{translation} 环境,原文和翻译都要有。 +% \begin{latex} +% \begin{translations} +% English. +% +% 汉语。 +% \end{translations} +% \end{latex} +% +% \subsubsection{附录}\label{subsubsec:app} +% \DescribeMacro{\appendix} +% \cs{appendix} 命令作为附录部分的开始。 +% 与正文类似,只需往 \file{chapter/app1.tex} 等加入内容即可。 +% \begin{latex} +% \appendix +% \chapter{...} +% ... +% \end{latex} +% +% \subsubsection{致谢} +% \DescribeEnv{acknowledgement} +% 致谢部分的源文件位于 \file{chapter/acknowledgement.tex}, +% 使用 \env{acknowledgement} 环境, +% 往里面写入感谢的话就可以啦。 +% \begin{latex} +% \begin{acknowledgement} +% 谢谢你! +% \end{acknowledgement} +% \end{latex} +% +% \emph{注意:“致谢”在本科论文中置于“附录”之前,与研究生论文有所差异。} +% +% \subsubsection{成果与简介} +% \DescribeEnv{achievements} +% \DescribeEnv{resume} +% 这些环境仅适用于研究生论文中。 +% +% 该部分包括“作者攻读学位期间发表的学术论文及科研成果目录”与“作者和导师简介”, +% 源文件位于 \file{chapter/resume.tex}。示例文档中已有现成例子,推荐直接修改。 +% +% \DescribeEnv{bibenumerate} +% 其中可以使用 \env{bibenumerate} 环境来生成带有方括号的列表,适合罗列文献。 +% +% \begin{latex} +% \begin{achievements} +% \section*{发表及已接受的论文:} +% \section*{成果及专利:} +% \end{achievements} +% \begin{resume} +% \section*{作者简介:} +% \section*{导师简介:} +% \end{resume} +% \end{latex} +% +% \subsection{封面}\label{subsec:cover} +% 本小节将简单介绍研究生论文封面的代码与编译。 +% +% 与本科模板不同的是,BUCTthesis 的硕博模板在 \file{cover} 文件夹中仿制了学校的封面。 +% 在该文件夹中的三个文件都与封面有关,编译时请确保它们位于同一路径之下。 +% \begin{enumerate} +% \item \file{cover.tex}:源文档。与 \cs{buctsetup} 类似,这里使用\cs{coversetup} 定义论文信息。 +% \begin{latex} +% \coversetup{ +% % 学号,位于封面的右上角 +% studentid = {2021010234}, +% % 标题。封面的标题有两行,每一行控制在 13 个汉字长度以内 +% titleA = {甲乙丙丁戊己庚辛壬癸一二三}, +% titleB = {四五六七八九十甲乙丙丁戊己}, +% % 作者 +% author = {张三}, +% % 专业 +% major = {计算机科学与技术}, +% % 导师 +% supervisor = {某某某教授}, +% % 日期,不填为当日。请注意:务必使用形如“YYYY-MM-DD”的格式 +% date = {2021-12-23}, +% } +% \end{latex} +% +% 至于编译,只需一遍 xelatex 即可,扩展名可省略。 +% \begin{shell} +% xelatex cover.tex +% \end{shell} +% \item \file{buctcover.cls}:格式控制文件。类似 \file{buctthesis.cls},亦可由 \file{buctthesis.ins} 和 \file{buctthesis.dtx} 生成: +% \begin{shell} +% xelatex buctthesis.ins +% \end{shell} +% 请注意执行以上命令时会同时生成 \file{buctcover.cls} 和 \file{buctthesis.cls},只有前者是用于控制封面的。 +% \end{enumerate} +% +% 除此之外,封面使用的方正系列字体未预装于一些操作系统上, +% 可访问\href{https://www.foundertype.com}{方正字库官网}下载和安装,具体步骤从略。 +% +% 所使用的字体清单: +% \begin{enumerate} +% \item SimSun,宋体(特指中易宋体) +% \item SimHei,黑体(特指中易黑体) +% \item KaiTi,楷体(特指中易楷体) +% \item STXingkai,华文行楷 +% \item FZDaBiaoSong-B06S,方正大标宋简体 +% \item FZXiaoBiaoSong-B05S,方正小标宋简体 +% \end{enumerate} +% +% +% +% \StopEventually{\PrintChanges\PrintIndex} +% +% \clearpage +% \section{实现细节}\label{sec:implementation} +% \subsection{文档类信息与选项} +% \begin{macrocode} +%\NeedsTeXFormat{LaTeX2e}[1999/12/01] +%<*class> +\ProvidesClass{buctthesis}[2020/03/20 v1.1 BUCT Thesis Template] +% \end{macrocode} +% +% 装载 \pkg{ifxetex} 宏包,并通过 \cs{RequireXeTeX} 命令检查编译命令。 +% 若未使用 \XeTeX\ 或 \XeLaTeX\ 将强制中止编译并发出警告。 +% \begin{macrocode} +\RequirePackage{ifxetex} +\RequireXeTeX +% \end{macrocode} +% +% 定义选项和族。 +% \begin{macrocode} +\RequirePackage{kvoptions} +\SetupKeyvalOptions{ + family = buct, + prefix = buct@, + setkeys = \kvsetkeys, +} +% \end{macrocode} +% +% 定义载入文档类时的选项: +% +% 模板类型:本科、硕士、博士; +% \begin{macrocode} +\newif\ifbuct@bachelor\buct@bachelorfalse +\newif\ifbuct@master\buct@masterfalse +\newif\ifbuct@doctor\buct@doctorfalse +\define@key{buct}{type}{\expandafter\csname buct@#1true\endcsname} +% \end{macrocode} +% +% 是否为最终提交版本,默认否; +% \begin{macrocode} +\DeclareBoolOption[false]{submit} +% \end{macrocode} +% +% 每章从任意页或奇数页开始,默认 openright,即每章只从奇数页开始; +% \begin{macrocode} +\DeclareBoolOption[false]{openany} +\DeclareComplementaryOption{openright}{openany} +% \end{macrocode} +% +% 是否开启模板调试器,默认否。 +% \begin{macrocode} +\DeclareBoolOption[false]{debugger} +% \end{macrocode} +% +% 将文档类多余的选项传递给 \pkg{ctexbook} 文档类,并加载相应选项的文档类。 +% \begin{macrocode} +\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}} +\ProcessKeyvalOptions* +% \end{macrocode} +% +% 由于 \cls{ctexbook} 将会调用 \pkg{xeCJK} 宏包来配置字体,这里使用 \opt{quiet} +% 选项关闭因自定义字体(后述)而产生的警告。 +% 最后根据用户选项,加载相应选项的 \cls{ctexbook} 文档类。 +% \begin{macrocode} +\PassOptionsToPackage{quiet}{xeCJK} +\ifbuct@openany\LoadClass[zihao=-4,UTF8,oneside]{ctexbook} +\else\LoadClass[zihao=-4,UTF8,openright]{ctexbook}\fi +% \end{macrocode} +% +% 必须指定本、硕、博中的一种类型。 +% \begin{macrocode} +\ifbuct@bachelor\relax\else + \ifbuct@master\relax\else + \ifbuct@doctor\relax\else + \ClassError{buctthesis}{% + Specified thesis type is obligatory: \MessageBreak% + type = [ bachelor | master | doctor ]% + }{} +\fi\fi\fi +% \end{macrocode} +% +% \begin{macro}{\buct@def@key} +% 定义用于定义论文相关信息的内部命令。例如 +% \begin{latex} +% \buct@def@key{ctitle} +% \end{latex} +% 相当于: +% \begin{latex} +% \newcommand{\ctitle}[1]{\newcommand{\buct@ctitle}{#1}} +% \define@key{buct}{ctitle}{\ctitle{#1}} +% \end{latex} +% +% \begin{macrocode} +\newcommand{\buct@def@key}[1]{ + \@namedef{#1}##1{\@namedef{buct@#1}{##1}} + \define@key{buct}{#1}{\@nameuse{#1}{##1}} +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\buctsetup} +% 定义 \cs{buctsetup} 命令方便在正文中设置。 +% \begin{macrocode} +\newcommand{\buctsetup}[1]{\kvsetkeys{buct}{#1}} +\buct@def@key{ctitle} +\buct@def@key{etitle} +\buct@def@key{cauthor} +\buct@def@key{class} +\buct@def@key{studentid} +\buct@def@key{school} +\buct@def@key{major} +\buct@def@key{supervisor} +\buct@def@key{msupervisor} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\buct@def@sep@key} +% 对于 \texttt{ckeywords} 等键接受的是以西文逗号“,”分隔的值,上面的定义就不合适了。 +% 所以要对值做分隔。相比 \cs{buct@def@key} 这里多一个参数,为在论文中的分隔符。 +% 此处宏展开可参考\href{https://www.zhihu.com/question/26916597}{这篇讨论}。 +% \begin{macrocode} +\newcommand{\buct@def@sep@key}[2]{% + \@namedef{#1}##1{% + \@namedef{buct@#1}{}% + \@for\reserved@a:=##1\do{ + \expandafter\ifx\csname buct@#1\endcsname\@empty\else + \expandafter\g@addto@macro\csname buct@#1\endcsname{#2}\fi + \expandafter\expandafter\expandafter\g@addto@macro% + \expandafter\csname buct@#1\expandafter\endcsname% + \expandafter{\reserved@a} + } + } + \define@key{buct}{#1}{\@nameuse{#1}{##1}}% +} +\buct@def@sep@key{ckeywords}{\buct@ckeywords@sep} +\buct@def@sep@key{ekeywords}{\buct@ekeywords@sep} +% \end{macrocode} +% \end{macro} +% \subsection{载入宏包} +% +% 用于调整纸张与页面,这两个宏包提供了方便的命令来设置页面边距和页眉页脚。 +% \begin{macrocode} +\RequirePackage{geometry,fancyhdr} +% \end{macrocode} +% +% 自定义目录格式。 +% \begin{macrocode} +\RequirePackage{titletoc} +% \end{macrocode} +% +% \AmS{}系列宏包,包括: +% \begin{enumerate} +% \item \pkg{amsmath},提供了各种数学方面的增强型命令,以改进包含数学公式的文档结构; +% \item \pkg{amsthm},提供了定理类环境样式规范; +% \item \pkg{amssymb},提供各种数学符号。 +% \end{enumerate} +% 除此之外,载入 \pkg{unicode-math} 宏包以配置数学字体。 +% \begin{macrocode} +\RequirePackage{amsmath,amsthm,amssymb,unicode-math} +% \end{macrocode} +% +% 这两个宏包最重要的用途是排版本科的第五级标题。前者用于提供带圈序号,而后者提供了方便的格式控制。 +% \begin{macrocode} +\RequirePackage{pifont,enumitem} +% \end{macrocode} +% +% 一个适合排版含数值和单位的物理量的宏包,它也提供能使表格中小数点竖直对齐的命令。 +% \begin{macrocode} +\RequirePackage{siunitx} +% \end{macrocode} +% +% 关于化学式排版的宏包有很多,但这里载入 \pkg{mhchem}。 +% 它容易上手,偏向于无机和分析化学(方程)式的排版。 +% 至于有机化学结构式等,使用图片插入可能是一个更好的选择;若时间充裕可学习如 \pkg{chemfig} 等宏包。 +% \begin{macrocode} +\RequirePackage[version = 4]{mhchem} +% \end{macrocode} +% +% 浮动体系列宏包,控制表格、插图等浮动体及标签格式。 +% \begin{macrocode} +\RequirePackage{float} +\RequirePackage{longtable,threeparttable,tabularx,multirow,booktabs} +\RequirePackage{graphicx} +\RequirePackage[labelformat = simple]{subcaption} +\RequirePackage[format=hang]{caption} +\RequirePackage{bicaption} +% \end{macrocode} +% +% 一个用于绘图的宏包,模板里用于绘制脚注外的圆圈。 +% \begin{macrocode} +\RequirePackage{tikz} +% \end{macrocode} +% +% 代码块环境。 +% \begin{macrocode} +\RequirePackage{listings} +% \end{macrocode} +% +% 该宏包提供了符合要求的参考文献编排格式。这里的选项会传递至 \pkg{natbib}, +% 从而在正文中能数字上标、方括号引用。 +% \begin{macrocode} +\RequirePackage[sort&compress]{gbt7714} +% \end{macrocode} +% +% 为了方便查看,模板将以彩色标明超链接和代码块中的关键字。 +% \begin{macrocode} +\RequirePackage{xcolor} +% \end{macrocode} +% +% 用于插入PDF文件的宏包。可以插入封面、声明页(因为二者需要签字)等扫描或不方便排版的PDF文件。 +% \begin{macrocode} +\RequirePackage{pdfpages} +% \end{macrocode} +% +% \pkg{footmisc} 宏包的选项将脚注的位置固定在页面底端,且跨页重置计数。 +% \begin{macrocode} +\RequirePackage[bottom,perpage]{footmisc} +% \end{macrocode} +% +% 命令补丁,用于便捷地修改一些复杂命令,而无需重新定义之。 +% \begin{macrocode} +\RequirePackage{xpatch} +% \end{macrocode} +% +% 在页面画上标尺、边框线,和标注行号。仅当开启调试时。 +% \begin{macrocode} +\ifbuct@debugger + \RequirePackage[color=blue,type=upperleft,showframe,hshift=2.7cm,vshift=3.5cm]{fgruler} + \RequirePackage[pagewise]{lineno} +\fi +% \end{macrocode} +% +% 实现交叉引用与超链接。 +% \begin{macrocode} +\RequirePackage{hyperref} +% \end{macrocode} +% +% \subsection{字体配置} +% 以下仅对 Windows 系统下做了适配。 +% +% 开启“伪粗体”和“伪斜体”,并设置的相关系数。 +% \begin{macrocode} +\xeCJKsetup{EmboldenFactor=2.2,SlantFactor=0.2} +\setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant] +\setCJKsansfont{SimHei}[AutoFakeBold] +% \end{macrocode} +% +% \begin{macro}{\bfsong} +% 设置“伪粗体”后,使用 \cs{bfseries}将产生加粗的宋体, +% 这与一般的 \LaTeX\ 常识是相悖的。 +% 因此模板提供了更明确的命令 \cs{bfsong}。 +% \begin{macrocode} +\newcommand{\bfsong}{\bfseries} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\bfhei} +% +% 对于黑体同理。此外要注意模板将预设的无衬线字体(微软雅黑)改为了黑体。 +% \begin{macrocode} +\newcommand{\bfhei}{\sffamily\bfseries} +% \end{macrocode} +% \end{macro} +% +% 对于西文正文,全部统一设置为Times New Roman。 +% \begin{macrocode} +\setmainfont{Times New Roman} +\setsansfont{Times New Roman} +\setmonofont{Times New Roman} +% \end{macrocode} +% +% 设置数学公式中的字体。 +% \begin{macrocode} +\IfFontExistsTF{LibertinusMath-Regular.otf}{% + \setmathfont{latinmodern-math.otf} + \setmathfont[% + range = {% + up/{latin,Latin,num}, + it/{latin,Latin,greek}, + bfit/{latin,Latin}, + } + ]{LibertinusMath-Regular.otf} +}{} +% \end{macrocode} +% +% 页眉与页脚的字体。 +% \begin{macrocode} +\newcommand{\buct@headfont}{\zihao{-5}\songti} +\newcommand{\buct@footfont}{\zihao{-5}\songti} +% \end{macrocode} +% +% 诚信声明(本科),或论文原创性声明和授权声明(硕博)的字体。 +% \begin{macrocode} +\ifbuct@bachelor + \newcommand{\buct@dcl@titlefont}{\zihao{3}\songti} + \newcommand{\buct@dcl@ideclarefont}{\zihao{4}\songti} +\else + \newcommand{\buct@dcl@titlefont}{\zihao{4}\bfseries} + \newcommand{\buct@dcl@textfont}{\zihao{4}\mdseries} + \newcommand{\buct@auth@titlefont}{\zihao{4}\bfseries} + \newcommand{\buct@auth@textfont}{\zihao{4}\mdseries} +\fi +% \end{macrocode} +% +% 中英文摘要中的字体。 +% 这里的 \cs{CJKfamily+} 命令来自于 \pkg{xeCJK} 宏包,用于切换字体族: +% 当参数为空时,则使用当前的 CJK 字体族,且对所有字符类生效。 +% \begin{macrocode} +\ifbuct@bachelor + \newcommand{\buct@abs@titfont}{\zihao{3}\bfsong} + \newcommand{\buct@abs@infofont}{\zihao{5}\songti} + \newcommand{\buct@abs@absfont}{\zihao{4}\songti} + \newcommand{\buct@keywordsfont}{\zihao{4}\heiti\CJKfamily+{}} + \newcommand{\buct@abs@titfonten}{\zihao{3}\bfseries} + \newcommand{\buct@abs@absfonten}{\zihao{4}\songti} + \newcommand{\buct@keywordsfonten}{\zihao{4}\heiti\CJKfamily+{}} +\else + \newcommand{\buct@abs@titfont}{\zihao{3}\heiti} + \newcommand{\buct@abs@absfont}{\zihao{-3}\heiti} + \newcommand{\buct@abs@textfont}{\zihao{4}\songti} + \newcommand{\buct@keywords@titfont}{\zihao{4}\heiti} + \newcommand{\buct@keywords@font}{\zihao{4}\songti} + \newcommand{\buct@abs@titfonten}{\zihao{3}\bfseries} + \newcommand{\buct@abs@absfonten}{\zihao{-3}\bfseries} + \newcommand{\buct@keywords@titfonten}{\zihao{4}\bfseries} + \newcommand{\buct@keywords@fonten}{\zihao{4}\mdseries} +\fi +% \end{macrocode} +% +% 设置中英文目录、设计图纸目录标题和目录中的各级标题字体。 +% \begin{macrocode} +\ifbuct@bachelor + \newcommand{\buct@toc@tocfont}{\zihao{4}\mdseries\heiti} +\else + \newcommand{\buct@toc@tocfont}{\zihao{3}\heiti} +\fi +\newcommand{\buct@toc@chapfont}{\zihao{4}\heiti} +\newcommand{\buct@toc@secfont}{\zihao{4}\songti} +\newcommand{\buct@toc@ssecfont}{\zihao{4}\songti} +\newcommand{\buct@toc@sssecfont}{\zihao{-4}\songti} +\newcommand{\buct@toc@dsgfigfont}{\buct@toc@ssecfont} +\newcommand{\buct@toce@chapfont}{\zihao{4}\bfseries} +% \end{macrocode} +% +% 正文的各级标题。 +% \begin{macrocode} +\ifbuct@bachelor + \newcommand{\buct@chapfont}{\zihao{-3}\bfsong\centering} + \newcommand{\buct@secfont}{\zihao{-3}\bfsong\centering} + \newcommand{\buct@ssecfont}{\zihao{-4}\bfsong\raggedright} + \newcommand{\buct@sssecfont}{\zihao{-4}\songti} +\else + \newcommand{\buct@chapfont}{\zihao{3}\heiti\centering} + \newcommand{\buct@secfont}{\zihao{4}\heiti\raggedright} + \newcommand{\buct@ssecfont}{\zihao{-4}\heiti\raggedright} + \newcommand{\buct@sssecfont}{\buct@ssecfont} +\fi +% \end{macrocode} +% +% 设置浮动体(包括插图和表格)内容、编号和标题的字体。 +% \begin{macrocode} +\newcommand{\buct@floatfont}{\zihao{5}} +\newcommand{\buct@float@captionfont}{\zihao{5}\songti} +% \end{macrocode} +% +% 设置代码块的字体。根据是否开启 \opt{submit} 选项,设置关键字、注释的颜色。 +% 如果未开启,关键字将会使用深蓝色,注释会使用深灰色。 +% \begin{macrocode} +\newcommand{\buct@codefont}{\ttfamily\songti\zihao{5}} +\newcommand{\buct@codecomfont}{% + \ttfamily\slshape + \ifbuct@submit\relax\else\color{gray!80!black}\fi} +\newcommand{\buct@codekeyfont}{% + \ttfamily\bfseries + \ifbuct@submit\relax\else\color{blue!80!black}\fi} +% \end{macrocode} +% +% +% \subsection{常量设置} +% \begin{macrocode} +\ifbuct@bachelor + \newcommand\buct@headtext{北京化工大学毕业设计(论文)} + \newcommand\buct@foottext{\thepage} + \newcommand\buct@dcl@title{诚信声明} + \newcommand\buct@dcl@ideclare{本人声明:} + \newcommand\buct@dcl@text{ + 所呈交的学位论文是本人在导师的指导下独立进行研究工作所取得的成果。 + 据我所知,除文中已经注明引用的内容外,本论文不包含任何其他个人或集体 + 已经发表或撰写过的研究成果,也不包含为获得北京化工大学或其它教育机构 + 的学位或证书而使用过的材料。对论文所涉及的研究工作做出贡献的其他个人 + 和集体,均已在文中以明确方式标明或致谢。本人完全意识到本声明的法律 + 结果由本人承担。 + } + \newcommand\buct@dcl@sign{本人签名:\hspace{14em}年\hspace{2.5em}月\hspace{2.5em}日} + \newcommand\buct@task@title{本科生毕业设计(论文)任务书} + \newcommand\buct@task@pdf{任务书} + \newcommand\buct@task@ctitle{设计(论文)题目:} + \newcommand\buct@task@school{学院:} + \newcommand\buct@task@major{专业:} + \newcommand\buct@task@class{班级:} + \newcommand\buct@task@student{学生:} + \newcommand\buct@task@supervisor{指导教师(含职称):} + \newcommand\buct@task@msupervisor{专业负责人:} + \newcommand\buct@task@itema{1.设计(论文)的主要任务及目标} + \newcommand\buct@task@itemb{2.设计(论文)的基本要求和内容} + \newcommand\buct@task@itemc{3.主要参考文献} + \newcommand\buct@task@itemd{4.进度安排} + \newcommand\buct@cabstract@title{摘要} + \newcommand\buct@eabstract@title{ABSTRACT} + \newcommand\buct@ckeywords@title{关键词:} + \newcommand\buct@ekeywords@title{Keywords:~} + \newcommand\buct@ckeywords@sep{\quad} + \newcommand\buct@ekeywords@sep{; } + \newcommand\buct@supervisor@title{指导教师:} + \newcommand\buct@content@title{目\hspace{\ccwd}录} + \newcommand\buct@dfigurename{设计图纸} + \newcommand\buct@dfigure@content@title{设计图纸目录} + \newcommand\buct@foreword@title{前言} + \newcommand\buct@concl@title{结论} + \newcommand\buct@trans@title{翻译} + \newcommand\buct@ack@title{致谢} + \newcommand\buct@deno@title{符号说明} + \renewcommand\lstlistingname{代码} +\else + \newcommand\buct@headtext{\leftmark} + \newcommand\buct@foottext{\thepage} + \newcommand\buct@dcl@title{北京化工大学学位论文原创性声明} + \newcommand\buct@dcl@text{ + 本人郑重声明:所呈交的学位论文,是本人在导师的指导下,独立 + 进行研究工作所取得的成果。除文中已经注明引用的内容外,本论 + 文不含任何其他个人或集体已经发表或撰写过的作品成果。对本文 + 的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。 + 本人完全意识到本声明的法律结果由本人承担。 + } + \newcommand\buct@auth@title{关于论文使用授权的说明} + \newcommand\buct@auth@text{ + 学位论文作者完全了解北京化工大学有关保留和使用学位论文的规定, + 即:研究生在校攻读学位期间论文工作的知识产权单位属北京化工大学。 + 学校有权保留并向国家有关部门或机构送交论文的复印件和磁盘,允许 + 学位论文被查阅和借阅;学校可以公布学位论文的全部或部分内容, + 可以允许采用影印、缩印或其它复制手段保存、汇编学位论文。 + + $\Box$ 论文暂不公开(或保密)注释:本学位论文属于暂不公开 + (或保密)范围,在\rule{1.5em}{.6pt}年解密后适用本授权书。 + + $\Box$ 非暂不公开(或保密)论文注释:本学位论文不属于暂不公开 + (或保密)范围,适用本授权书。 + } + \newcommand\buct@dcl@pdf{版权页} + \newcommand\buct@sign@author{作者签名:\rule{7em}{.6pt}\qquad{日期:}\rule{7em}{.6pt}} + \newcommand\buct@sign@supervisor{导师签名:\rule{7em}{.6pt}\qquad{日期:}\rule{7em}{.6pt}} + \newcommand\buct@cabstract@title{摘\hspace{\ccwd}要} + \newcommand\buct@eabstract@title{ABSTRACT} + \newcommand\buct@ckeywords@title{关键词:} + \newcommand\buct@ekeywords@title{KEY WORDS:~} + \newcommand\buct@ckeywords@sep{,} + \newcommand\buct@ekeywords@sep{,~} + \newcommand\buct@content@title{目\hspace{\ccwd}录} + \newcommand\econtentsname{Contents} + \newcommand\buct@deno@title{符号和缩略词说明} + \newcommand\buct@ack@title{致谢} + \newcommand\buct@eack@title{Acknowledgement} + \newcommand\buct@achi@title{研究成果及发表的学术论文} + \newcommand\buct@eachi@title{Research Results and Published Academic Papaers} + \newcommand\buct@resu@title{作者及导师简介} + \newcommand\buct@eresu@title{About the Author} + \newcommand\equationname{式} + \newcommand\buct@bitable@name{Table} + \newcommand\buct@bifigure@name{Figure} + \newcommand\buct@ebib@title{Bibliography} + \renewcommand\lstlistingname{代码} +\fi +% \end{macrocode} +% +% \subsection{页面设置} +% \subsubsection{纸张与边距} +% 使用 \pkg{geometry} 宏包设置各边距为:(单双页打印、本硕博相同) +% 上 \SI{3.5}{cm}、下 \SI{2.6}{cm}、左右 \SI{2.7}{cm},页眉 \SI{2.4}{cm}、页脚 \SI{2}{cm}。 +% \begin{macrocode} +\geometry{% + a4paper,nomarginpar, + top = 3.5cm, bottom = 2.6cm, left = 2.7cm, right = 2.7cm, + headheight = 1.1cm, footskip = 0.6cm, +} +% \end{macrocode} +% +% \subsubsection{页眉和页脚} +% 使用 \pkg{fancyhdr} 宏包设置页眉页脚的文字和线宽。 +% \begin{macrocode} +\fancypagestyle{plain}{% + \fancyhf{} + \fancyhead[C]{\buct@headfont\buct@headtext} + \fancyfoot[C]{\buct@footfont\buct@foottext} + \renewcommand\headrulewidth{0.6pt} + \renewcommand\footrulewidth{0pt} +} +\pagestyle{plain} +% \end{macrocode} +% +% \begin{macro}{\frontmatter} +% 修改命令 \cs{frontmatter} ,仅将页码从小写罗马字母改为大写,用于“第一章”之前的部分。 +% \begin{macrocode} +\xpatchcmd{\frontmatter} + {\pagenumbering{roman}} + {\pagenumbering{Roman}} + {}{} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\cleardoublepage} +% 修改命令 \cs{cleardoublepage},使之能在插入一张完全空白页的同时 +% 保持页码的连续,适合章页右开的情况。 +% \begin{macrocode} +\xpatchcmd{\cleardoublepage} + {\newpage} + {\thispagestyle{empty}\newpage} + {}{} +% \end{macrocode} +% \end{macro} +% +% \subsection{前置部分} +% \begin{macro}{\buct@pdfmark} +% 为了方便查看,模板将前置部分编入PDF书签,实现跳转。 +% 这里定义了一个命令用于简化代码。 +% \begin{macrocode} +\newcommand{\buct@pdfmark}[2]{% + \hypertarget{#2}{} + \pdfbookmark{#1}{#2} +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{声明页} +% \begin{macro}{\buct@makedeclare} +% 本科为“诚信声明”,硕博为“原创性声明”与“使用授权说明”。这里定义不使用扫描页的命令。 +% \begin{macrocode} +\newcommand{\buct@makedeclare}{ + \ifbuct@bachelor + \centerline{\buct@dcl@titlefont\buct@dcl@title}\par\vspace{1em} + \leftline{\buct@dcl@ideclarefont\buct@dcl@ideclare}% + \buct@dcl@text + \par\vspace{2em}\hfill{\buct@dcl@sign} + \else{ + \thispagestyle{empty} + \linespread{1.5534} + \setlength{\parskip}{9pt} + \begin{center} + \buct@dcl@titlefont\buct@dcl@title + \end{center} + + \buct@dcl@textfont\buct@dcl@text + + \vspace{6pt}\buct@sign@author\vspace{6pt} + + \begin{center} + \buct@auth@titlefont\buct@auth@title + \end{center} + + \buct@auth@textfont\buct@auth@text + + \vspace{6pt}\buct@sign@author + + \vspace{6pt}\buct@sign@supervisor + }\fi + \clearpage\normalsize +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\makedeclare} +% 定义一个带可选参数的命令 \cs{makedeclare},可选参数为扫面页的相对路径; +% 若不加参数则使用 \cs{buct@makedeclare} 来插入文本。 +% \begin{macrocode} +\NewDocumentCommand{\makedeclare}{ o }{% + \buct@pdfmark{\ifbuct@bachelor\buct@dcl@title\else\buct@dcl@pdf\fi}{declare} + \IfNoValueTF{#1}{\buct@makedeclare}{% + \includepdf[pages=-]{#1} + } +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{任务书} +% \begin{environment}{taskbook} +% 环境 \env{taskbook} 用于插入任务书部分,该部分排在诚信声明之后。 +% \begin{macrocode} +\ifbuct@bachelor + \newenvironment{taskbook}{% + \cleardoublepage% + \buct@pdfmark{\buct@task@pdf}{taskbook}% + \section*{\buct@task@title}% + }{\clearpage} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\buct@ul} +% “任务书”开头部分的下划线。 +% \begin{macrocode} + \NewDocumentCommand{\buct@ul}{ o m }{\underline{\makebox[#1][c]{#2}}} +% \end{macrocode} +% \end{macro} +% +% 在这个环境中有如下的排版命令和环境: +% \begin{macro}{\taskinfo*} +% 命令 \cs{taskinfo} 或 \cs{taskinfo*}: +% 后者是学校样例的实现,但是由于换行、空位少造成书写不便,且不甚美观; +% 而前者比后者多了一次换行且设置了文本和横线的对齐,适合文字较多时使用。 +% \begin{macrocode} + \NewDocumentCommand\taskinfo{ s }{% + \noindent% + \begin{minipage}{\textwidth}% + \punctstyle{plain}\linespread{1.94}% + \buct@task@ctitle\buct@ul[27em]{\buct@ctitle}\\[3pt] + \IfBooleanTF{#1}{% less lines break + \buct@task@school\buct@ul[10em]{\buct@school}\quad + \buct@task@major\buct@ul[10em]{\buct@major}\quad + \buct@task@class\buct@ul[5em]{\buct@class}\\[3pt] + \buct@task@student\buct@ul[5em]{\buct@cauthor}\quad + \buct@task@supervisor\buct@ul[6em]{\buct@supervisor}\quad + \buct@task@msupervisor\buct@ul[4em]{\buct@msupervisor}% + }{% more lines break +% \end{macrocode} +% \end{macro} +% \begin{macro}{\taskinfo} +% 更多的换行,相比之下会更加整齐一些。 +% \begin{macrocode} + \buct@task@school\buct@ul[15em]{\buct@school}\qquad + \buct@task@major\buct@ul[13em]{\buct@major}\\[3pt] + \buct@task@class\buct@ul[15em]{\buct@class}\qquad + \buct@task@student\buct@ul[13em]{\buct@cauthor}\\[3pt] + \buct@task@supervisor\buct@ul[8em]{\buct@supervisor}\qquad + \buct@task@msupervisor\buct@ul[10em]{\buct@msupervisor}% + } + \end{minipage}\vspace{1.5em} + } +% \end{macrocode} +% \end{macro} +% +% 命令 \cs{taskitem} :用于排版任务书中“设计(论文)的主要任务及目标”等四项标题。 +% 该命令只能使用四次,超过则会报错且给予修正提示。 +% \begin{macrocode} + \newcounter{taskitemcnt} + \newcommand{\buct@taskitem}{% + \stepcounter{taskitemcnt}% + \ifcase\value{taskitemcnt}\relax\or% + {\buct@task@itema}\or% + {\buct@task@itemb}\or% + {\buct@task@itemc}\or% + {\buct@task@itemd}\else% + \ClassError{buctthesis}{Too many \protect\taskitem\space used}% + {Keep \protect\taskitem\space no more than 4 times.}\fi + } +% \end{macrocode} +% \begin{macro}{\taskitem} +% 这里相比学校的样例,段前增加了一点空白。 +% \begin{macrocode} + \newcommand{\taskitem}{\vspace{1em}\noindent\buct@taskitem\par} +\fi +% \end{macrocode} +% \end{macro} +% +% +% \begin{environment}{bibenumerate} +% 定义 \env{bibenumerate} 环境:可以生成带有方括号、阿拉伯数字的列表。 +% 该命令可用于本科的“任务书”中罗列主要参考文献, +% 亦可用于硕博“研究成果及发表的学术论文”中罗列发表的论文与专利。 +% \begin{macrocode} +\newenvironment{bibenumerate}{% + \begin{enumerate}[label={[\arabic*]},leftmargin=3em] +}{\end{enumerate}} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{摘要} +% \begin{environment}{cabstract} +% 中文摘要,使用 \env{cabstract} 环境。 +% \begin{macrocode} +\ifbuct@bachelor + \newenvironment{cabstract}{% + \cleardoublepage + \buct@pdfmark{\buct@cabstract@title}{cabstract} + \centerline{\buct@abs@titfont\buct@ctitle}\vspace{22pt}% + \centerline{% + \buct@abs@infofont\buct@cauthor\quad% + \buct@class\quad\buct@studentid\quad% + \buct@supervisor@title\buct@supervisor% + }\vspace{22pt}% + \centerline{\buct@abs@absfont\buct@cabstract@title}\vspace{22pt}% + }{\par\vspace{1em}\noindent\buct@keywordsfont\buct@ckeywords@title\buct@ckeywords} +\else + \newenvironment{cabstract}{% + \cleardoublepage + \buct@pdfmark{\buct@cabstract@title}{cabstract}\markboth{\buct@cabstract@title}{} + \centerline{\buct@abs@titfont\buct@ctitle}\vspace{24pt}% + \centerline{\buct@abs@absfont\buct@cabstract@title}\vspace{24pt}% + \buct@abs@textfont + }{\par\vspace{24pt}% + \noindent\buct@keywords@titfont\buct@ckeywords@title\buct@keywords@font\buct@ckeywords} +\fi +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{eabstract} +% 英文摘要,使用 \env{eabstract} 环境。 +% \begin{macrocode} +\ifbuct@bachelor + \newenvironment{eabstract}{% + \cleardoublepage% + \buct@pdfmark{\buct@eabstract@title}{abstracten} + \centerline{\buct@abs@titfonten{\buct@etitle}}\vspace{22pt}% + \centerline{\buct@abs@absfonten\buct@eabstract@title}\vspace{22pt}% + }{\par\vspace{1em}\noindent\buct@keywordsfonten \buct@ekeywords@title\buct@ekeywords} +\else + \newenvironment{eabstract}{% + \cleardoublepage% + \buct@pdfmark{\buct@eabstract@title}{eabstract}\markboth{\buct@eabstract@title}{} + { + \setlength{\leftskip}{3em plus 1em minus .5em} + \setlength{\rightskip}{3em plus 1em minus .5em} + \centerline{\buct@abs@titfonten\buct@etitle}\vspace{72pt} + \centerline{\buct@abs@absfonten\buct@eabstract@title}\vspace{48pt} + } + \buct@abs@textfont + }{\par\vspace{48pt}% + \noindent\buct@keywords@titfonten\buct@ekeywords@title\buct@keywords@fonten\buct@ekeywords} +\fi +% \end{macrocode} +% \end{environment} +% +% \subsubsection{目录} +% 正文中三级小节(subsubsubsection)不予编号; +% 本科:编目层次至小节(subsection),硕博:编目层次至小小节(subsubsection)。 +% \begin{macrocode} +\setcounter{secnumdepth}{3} +\ifbuct@bachelor + \setcounter{tocdepth}{2} +\else + \setcounter{tocdepth}{3} +\fi +% \end{macrocode} +% +% \begin{macro}{\tableofcontents} +% 重定义中文目录标题样式。该部分编入书签,同时在目录中不出现“目录”项。 +% \begin{macrocode} +\renewcommand\tableofcontents{% + \cleardoublepage + \pdfbookmark{\contentsname}{toc}% + \chapter*{\buct@toc@tocfont\buct@content@title}% + \ifbuct@bachelor\relax\else\markboth{\buct@content@title}\fi + \@starttoc{toc} +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\tableofcontentsEN} +% 定义英文目录,条目格式与中文目录相同。 +% \begin{macrocode} +\ifbuct@bachelor\relax\else + \newcommand\tableofcontentsEN{% + \cleardoublepage + \pdfbookmark{\econtentsname}{toce}% + \chapter*{% + \em\econtentsname% + \ifbuct@bachelor\relax\else\markboth{\econtentsname}\fi% + }% + \@starttoc{toce} + } +% \end{macrocode} +% \end{macro} +% \begin{macro}{\buct@addengcontents} +% 加入英文目录项。 +% \begin{macrocode} + \newcommand\buct@addengcontents[3]{% + \addcontentsline{toce}{#1}{\protect\numberline{#3\@nameuse{the#1}}#2} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\echapter} +% \begin{macro}{\esection} +% \begin{macro}{\esubsection} +% \begin{macro}{\esubsubsection} +% 定义将不同层次标题加入英文目录中的命令。 +% \begin{macrocode} + \newcommand\echapter[1]{\buct@addengcontents{chapter}{#1}{\buct@toce@chapfont}} + \newcommand\esection[1]{\buct@addengcontents{section}{#1}{}} + \newcommand\esubsection[1]{\buct@addengcontents{subsection}{#1}{}} + \newcommand\esubsubsection[1]{\buct@addengcontents{subsubsection}{#1}{}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\bichapter} +% \begin{macro}{\bisection} +% \begin{macro}{\bisubsection} +% \begin{macro}{\bisubsubsection} +% 类似 \cs{bicaption} 可接受两个参数来生成双语图标注一样,定义 \cs{bichapter} 命令从而更加方便一些。 +% \emph{以下定义的命令不可带星号。} +% \begin{macrocode} + \NewDocumentCommand{\bichapter}{ o m m }{\chapter[#1]{#2}\echapter{#3}} + \NewDocumentCommand{\bisection}{ o m m }{\section[#1]{#2}\esection{#3}} + \NewDocumentCommand{\bisubsection}{ o m m }{\subsection[#1]{#2}\esubsection{#3}} + \NewDocumentCommand{\bisubsubsection}{ o m m }{\subsubsection[#1]{#2}\esubsubsection{#3}} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% 使用 \pkg{titletoc} 宏包的 \cs{titlecontents} 命令来设置目录项格式。 +% 对于硕博论文而言,以下设置会同时影响中文和英文目录。 +% \cs{titlecontents} 的语法为: +% +% \begin{syntax}{titlecontents} +% \marg{标题层级}\oarg{左侧间距} +% +% \marg{上间距} +% \marg{标题格式}\marg{引导线与页码}\oarg{下间距} +% \end{syntax} +% +% \begin{macrocode} +\ifbuct@bachelor + \titlecontents{chapter}[0em] + {\buct@toc@chapfont\vspace{3pt}} + {\thecontentslabel\quad}{} + {\titlerule*[.4em]{$\cdot$}\bfseries\contentspage} + \titlecontents{section}[2em] + {\buct@toc@secfont\vspace{-3pt}} + {\thecontentslabel\quad}{} + {\titlerule*[.5em]{$\cdot$}\contentspage} + \titlecontents{subsection}[5em] + {\buct@toc@ssecfont\vspace{-3pt}} + {\thecontentslabel\quad}{} + {\titlerule*[1em]{$\cdot$}\contentspage} +\else + \titlecontents{chapter}[0em] + {\buct@toc@chapfont\vspace{3pt}} + {\thecontentslabel\quad}{} + {\titlerule*[.25em]{$\cdot$}\bfseries\contentspage} + \titlecontents{section}[2.25em] + {\buct@toc@secfont\vspace{-3pt}} + {\thecontentslabel\quad}{} + {\titlerule*[.5em]{$\cdot$}\contentspage} + \titlecontents{subsection}[5em] + {\buct@toc@ssecfont\vspace{-3pt}} + {\thecontentslabel\quad}{} + {\titlerule*[1em]{$\cdot$}\contentspage} + \titlecontents{subsubsection}[8.5em] + {\buct@toc@sssecfont\vspace{-3pt}} + {\thecontentslabel\quad}{} + {\titlerule*[1em]{$\cdot$}\contentspage} +\fi +% \end{macrocode} +% +% 通过重定义 \pkg{natbib} 宏包的 \cs{bibsection},实现参考文献的编目。 +% \begin{macrocode} +\renewcommand{\bibsection}{ + \chapter*{\bibname} + \addcontentsline{toc}{chapter}{\bibname} + \ifbuct@bachelor\relax\else + \addcontentsline{toce}{chapter}{\buct@toce@chapfont\buct@ebib@title} + \markboth{\bibname} + \fi +} +% \end{macrocode} +% +% 对于本科的设计图纸的两种编目方式:一是加入主目录,另一种是单独生成目录。 +% +% \begin{macro}{\dcaption} +% 定义命令 \cs{dcaption},在 \cs{caption} 的基础上将设计图纸加入主目录。 +% 模板设置“设计图纸”的目录级别和小节相同,但却没有小节的编号。 +% 为保证在目录中的文字对齐,所以增加其缩进。 +% \begin{macrocode} +\ifbuct@bachelor + \newcommand{\dcaption}[1]{% + \caption{#1}\addcontentsline{toc}{subsection}{% + \hspace{2.5em}\buct@dfigurename~\thefigure\hspace{1em}{#1}% + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\buct@listof} +% 另外新定义“设计图纸目录”。如果需要单独编目,可使用 \cs{listofdesignfigures} 命令生成。 +% 这里按照 \pkg{float}宏包的 \cs{listof} 命令来定义我们的 \cs{buct@listof} 命令。 +% \begin{macrocode} + \newcommand{\buct@listof}[2]{% + \xpatchcmd{\@dottedtocline}{\hbox{.}}{\hbox{$\cdot$}}{}{} + \renewcommand{\@dotsep}{1.7}% + \@ifundefined{ext@#1}{\float@error{#1}}{% + \@namedef{l@#1}{\@dottedtocline{1}{0em}{2em}} + \float@listhead{\buct@toc@tocfont{}#2}% + \begingroup\setlength{\parskip}{\z@}% + \buct@toc@dsgfigfont\@starttoc{\@nameuse{ext@#1}}% + \endgroup% + } + } +% \end{macrocode} +% \end{macro} +% \begin{macro}{\listofdesignfigures} +% “设计图纸目录”跟主目录相似。 +% \begin{macrocode} + \newcommand{\listofdesignfigures}{% + \cleardoublepage% + \buct@pdfmark{\buct@dfigure@content@title}{dfigure}% + \buct@listof{dfigure}{\buct@dfigure@content@title} + } +\fi +% \end{macrocode} +% \end{macro} +% +% \subsubsection{前言} +% \begin{environment}{foreword} +% 仅本科。定义环境 \env{foreword} 插入前言部分。 +% \begin{macrocode} +\newenvironment{foreword}{% + \cleardoublepage + \buct@pdfmark{\buct@foreword@title}{foreword} + \chapter*{\buct@foreword@title} +}{} +% \end{macrocode} +% \end{environment} +% +% \subsection{主文档部分} +% \subsubsection{行距设置} +% 计算公式: +% \[ +% 1.2 \times \meta{LineSpread} \times \meta{FontSize} = \meta{BaselineSkip} +% \] +% 其中,正文的 \meta{FontSize} 为小四号,而 \meta{BaselineSkip} 取 +% 本科行距 22 磅、硕博 20 磅,故可求得 \meta{LineSpread}。 +% \begin{macrocode} +\ifbuct@bachelor + \linespread{1.5221} +\else + \linespread{1.3837} +\fi +% \end{macrocode} +% +% \subsubsection{标题格式} +% \begin{macrocode} +\ifbuct@bachelor + \ctexset{% + chapter = {% + name = {第,章}, + number = \arabic{chapter}, + format = \buct@chapfont, + beforeskip = 12 pt, + afterskip = 32 pt, + fixskip = true, + aftername = \qquad, + }, + section = {% + name = {第,节}, + format = \buct@secfont, + aftername = \quad, + beforeskip = 29 pt, + afterskip = 32 pt, + fixskip = true, + }, + subsection = {% + format = \buct@ssecfont, + aftername = \quad, + beforeskip = 3 pt, + afterskip = 3 pt, + }, + subsubsection = {% + name = {(,)}, + format = \buct@sssecfont, + number = \arabic{subsubsection}, + beforeskip = 3 pt, + afterskip = 3 pt, + aftername = \hspace{0.5em}, + indent = 0.5em, + }, + } +\else + \ctexset{% + chapter = {% + name = {第,章}, + number = \chinese{chapter}, + format = \buct@chapfont, + beforeskip = 12 pt, + afterskip = 46 pt, + fixskip = true, + aftername = \qquad, + }, + section = {% + format = \buct@secfont, + aftername = \quad, + beforeskip = 26 pt, + afterskip = 28 pt, + fixskip = true, + }, + subsection = {% + format = \buct@ssecfont, + beforeskip = 3 pt, + afterskip = 3 pt, + }, + subsubsection = {% + format = \buct@sssecfont, + beforeskip = 3 pt, + afterskip = 3 pt, + }, + } +\fi +% \end{macrocode} +% +% \subsubsection{列表环境} +% \begin{environment}{enumerate} +% \begin{environment}{itemize} +% \begin{environment}{description} +% 使用 \pkg{enumitem} 宏包分别设置编号列表、无编号列表、描述列表环境的间距。 +% 这里将三种列表默认增加的垂直间距全部清除,即各行间距与正文行间距相同,以符合中文习惯。 +% +% 如果一级列表环境作为标题(对应《本科规范》中的五级标题,即带圈序号), +% 则不设置加粗、不增加段间距。由于列表间的垂直间距减小了,所以 +% 相应地稍微调小列表序号和文字之间的距离,使得文字更紧凑。 +% +% 另外,一级编号列表环境的序号改为 \pkg{pifont} 宏包提供的带圈数字, +% 二级及之后的列表、无编号列表保持默认设置。 +% \begin{macrocode} +\setlist{% + leftmargin = 2em, + nosep, +} +\setlist[enumerate,1]{% + label = \lower 0.1em\hbox{\large{\ding{\numexpr191+\value{enumi}}}}, + labelsep = 2pt, +} +\setlist[enumerate,2]{% + labelsep = 6pt, +} +\setlist[description]{% + labelsep = 1em, +} +% \end{macrocode} +% \end{environment} +% \end{environment} +% \end{environment} +% +% \subsubsection{数学类} +% 使用 \pkg{unicode-math} 宏包配置数学标准字形、粗体字形,并设置偏微分算子为直立体。 +% \begin{macrocode} +\unimathsetup{ + math-style = ISO, + bold-style = ISO, + partial = upright, +} +% \end{macrocode} +% +% 修改 \cs{mathbb},使得字母显示正确。 +% \begin{macrocode} +\let\mathbb\relax +\DeclareMathAlphabet{\mathbb}{U}{msb}{m}{n}% +% \end{macrocode} +% +% 使用 \pkg{amsthm} 宏包来进行定理类环境的格式控制,并预设如下定理类环境。编号跨章重置计数。 +% \begin{macrocode} +\newtheoremstyle{buctthm}% name +{3pt}% Space above +{3pt}% Space below +{}% Body font +{}% Indent amount +{\bfseries}% Theorem head font +{:}% Punctuation after theorem head +{.5em}% Space after theorem head +{}% Theorem head spec +\theoremstyle{buctthm} +\newtheorem{axiom}{公理}[chapter] +\newtheorem{theorem}{定理}[chapter] +\newtheorem{corollary}{推论}[chapter] +\newtheorem{remark}{注解}[chapter] +\newtheorem{assumption}{假设}[chapter] +\newtheorem{definition}{定义}[chapter] +\newtheorem{property}{性质}[chapter] +\newtheorem{proposition}{命题}[chapter] +\newtheorem{lemma}{引理}[chapter] +% \end{macrocode} +% +% \begin{environment}{proof} +% 按照 \pkg{amsthm} 宏包说明重定义 \env{proof}: +% \begin{macrocode} +\renewenvironment{proof}[1][\proofname]{\par + \pushQED{\qed}% + \normalfont\topsep6\p@\@plus6\p@\relax + \trivlist + \item\relax + {#1\@addpunct{.}}\hspace\labelsep\ignorespaces +}{\popQED\endtrivlist\@endpefalse} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{部分宏包汉化设置} +% 对 \pkg{siunitx} 宏包汉化处理,并将连接符改为“$\sim$”,符合中文习惯。 +% \begin{macrocode} +\sisetup{% + list-final-separator = { 和 }, + list-pair-separator = { 和 }, + range-phrase = {$\sim$}, +} +% \end{macrocode} +% +% \subsubsection{浮动体} +% 本科: +% 使用 \pkg{float} 宏包新定义浮动体环境 \env{dfigure},用于排版设计图纸。 +% 设计图纸与普通插图的区别在于: +% \begin{itemize} +% \item 标签不同,如:“设计图纸 1-1” 与 “图 1-1”; +% \item 编号相互独立; +% \item 仅设计图纸编入目录,且此目录独立于主目录。 +% \end{itemize} +% +% 硕博: +% 使用 \pkg{bicaption} 宏包设置双语标题,其中第二语言为英语。 +% \begin{macrocode} +\ifbuct@bachelor + \newfloat{dfigure}{htbp}{lodf}[chapter] + \floatname{dfigure}{\buct@dfigurename} +\else + \DeclareCaptionOption{english}[]{ + \renewcommand\figurename{\buct@bifigure@name} + \renewcommand\tablename{\buct@bitable@name} + } + \captionsetup[bi-second]{english} +\fi +% \end{macrocode} +% +% 《研究生规范》中规定表格单元格里的字号为五号,而未规定行距,这里保留前设的伸缩因子。 +% 其中 \cs{AtBeginEnvironment} 是 \pkg{etoolbox} 宏包中的命令,可给环境打补丁。 +% +% \begin{macrocode} +\ifbuct@bachelor\relax\else + \AtBeginEnvironment{tabular}{\buct@floatfont} + \AtBeginEnvironment{tabularx}{\buct@floatfont} +\fi +% \end{macrocode} +% +% 对于 \pkg{longtable} 宏包的设置则稍有不同: +% 在“符号说明表”中我们嵌套了 \env{longtable} 环境,但其中的字号仍应为小四号。 +% 因此这里需要保留原先的定义。 +% \begin{macrocode} + \let\oldlongtable=\longtable + \let\endoldlongtable=\endlongtable +\ifbuct@bachelor\relax\else + \def\longtable{\zihao{5}\oldlongtable} + \AtEndEnvironment{longtable}{\normalsize} +\fi +% \end{macrocode} +% +% 设置插图的文件路径。 +% \begin{macrocode} +\graphicspath{{figure/}} +% \end{macrocode} +% +% 使用 \pkg{caption} 宏包重定义图、表等浮动体的标签样式。 +% +% \begin{macrocode} +\renewcommand{\captionfont}{\buct@float@captionfont} +\renewcommand{\captionlabelfont}{\buct@float@captionfont} +\DeclareCaptionLabelSeparator{capspace}{\quad} +\captionsetup{labelsep=capspace} +\captionsetup[table]{% + position = top, + aboveskip = 0.5em, + belowskip = 0.5em, +} +\captionsetup[figure]{% + position = bottom, + aboveskip = 0.5em, + belowskip = -0.5em, +} +\captionsetup[dfigure]{% + position = bottom, + aboveskip = 1em, + belowskip = 1em, +} +% \end{macrocode} +% +% 更改图、表、公式和代码的编号格式。其中重定义 \cs{thelstlisting} 须在 \cs{AtBeginDocument} 中。 +% \begin{macrocode} +\AtBeginDocument{% + \renewcommand{\thesubtable}{(\alph{subtable})} + \renewcommand{\thetable}{\thechapter-\arabic{table}} + \renewcommand{\thesubfigure}{(\alph{subfigure})} + \renewcommand{\thefigure}{\arabic{chapter}-\arabic{figure}} + \ifbuct@bachelor + \renewcommand{\thedfigure}{\thechapter-\arabic{dfigure}} + \renewcommand{\theequation}{\thechapter-\arabic{equation}} + \else + \renewcommand{\eqref}[1]{\equationname~\textup{(\ref{#1})}} + \renewcommand{\theequation}{\thechapter-\arabic{equation}} + \fi + \renewcommand{\thelstlisting}{\thechapter-\arabic{lstlisting}} +} +% \end{macrocode} +% +% \subsubsection{数学公式} +% 硕博公式需要加入点线连接公式与编号。这里通过重定义 \file{source2e} +% 中的 \env{equation} 环境,故仅在 \env{equation} 环境中生效。 +% \begin{macrocode} +\ifbuct@bachelor\relax\else + \xpatchcmd{\dotfill}{.44em}{.3em}{}{} + \renewenvironment{equation}{ + \@beginparpenalty\predisplaypenalty + \@endparpenalty\postdisplaypenalty + \refstepcounter{equation}% + \trivlist \item[]\leavevmode + \hb@xt@\linewidth\bgroup $\m@th% $ + \displaystyle\hfill} + {$\;\dotfill % $ + \displaywidth\linewidth\hbox{\@eqnnum}% + \egroup + \endtrivlist} +\fi +% \end{macrocode} +% +% \subsubsection{代码块} +% \begin{macrocode} +\lstset{% + aboveskip = 0.5em, + belowskip = 0.5em, + tabsize = 4, + basicstyle = \buct@codefont, + frame = single, + basewidth = {.5em,.4em}, + xleftmargin = 1.5em, + xrightmargin = 1.5em, + commentstyle = \buct@codecomfont, + keywordstyle = \buct@codekeyfont, + backgroundcolor = \color{lightgray!10}, + showtabs = false, + showspaces = false, + showstringspaces = false, + captionpos = t, + breaklines = true, + numbers = left, + numberstyle = \tiny, + numbersep = 6 pt, + stepnumber = 1, + extendedchars = false, + escapechar = {@*}, +} +% \end{macrocode} +% +% \subsection{后置部分} +% 与前言不同的是,这几部分模板默认编入目录。 +% +% \begin{environment}{conclusion} +% 结论,仅本科。 +% \begin{macrocode} +\ifbuct@bachelor + \newenvironment{conclusion}{% + \chapter*{\buct@concl@title} + \addcontentsline{toc}{chapter}{\buct@concl@title} + }{} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{translation} +% 翻译,仅本科。 +% \begin{macrocode} + \newenvironment{translation}{% + \chapter*{\buct@trans@title} + \addcontentsline{toc}{chapter}{\buct@trans@title} + }{} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{achievements} +% 研究成果及发表的学术论文,仅硕博。 +% \begin{macrocode} +\else + \newenvironment{achievements}{% + \cleardoublepage + \chapter*{\buct@achi@title} + \markboth{\buct@achi@title}{} + \addcontentsline{toc}{chapter}{\buct@achi@title} + \addcontentsline{toce}{chapter}{\buct@toce@chapfont\buct@eachi@title} + }{} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{resume} +% 作者及导师简介,仅硕博。 +% \begin{macrocode} + \newenvironment{resume}{% + \cleardoublepage + \chapter*{\buct@resu@title} + \markboth{\buct@resu@title}{} + \addcontentsline{toc}{chapter}{\buct@resu@title} + \addcontentsline{toce}{chapter}{\buct@toce@chapfont\buct@eresu@title} + }{} +\fi +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{acknowledgement} +% 致谢。 +% \begin{macrocode} +\newenvironment{acknowledgement}{% + \chapter*{\buct@ack@title} + \ifbuct@bachelor\relax\else + \markboth{\buct@ack@title}{} + \addcontentsline{toce}{chapter}{\buct@toce@chapfont\buct@eack@title} + \fi + \addcontentsline{toc}{chapter}{\buct@ack@title} +}{} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{符号说明表} +% \begin{environment}{denotation} +% 关于章节编目同前。这里使用一个可跨页的无线长表格。 +% 为了防止符号较长,这里定义的环境需要一个可选参数用于在必要时控制第二列列宽。 +% \begin{macrocode} +\NewDocumentEnvironment{denotation}{ O{10cm} +b }{% + \cleardoublepage + \chapter*{\buct@deno@title}% + \ifbuct@bachelor + \addcontentsline{toc}{chapter}{\buct@deno@title} + \else + \buct@pdfmark{\buct@deno@title}{denotation} + \markboth{\buct@deno@title}{} + \fi + \vspace{-1em}% + \begin{oldlongtable}[c]{l@{\extracolsep{3em}}p{#1}} + #2 +}{\end{oldlongtable}} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{参考文献} +% 一方面,主文件中调用了符合要求的参考文献格式控制文件,使参考文献章节的格式规范化; +% 另一方面,调用 \pkg{gbt7714}(和 \pkg{natbib} )宏包时已经填入相关选项, +% 在文章中引用文献的格式也符合了要求。这里将本科模板罗列的各条参考文献之间距离稍微调小一些,而将硕博模板字号设为 5 号,行距 20 磅。 +% \begin{macrocode} +\ifbuct@bachelor + \setlength{\bibsep}{3pt} +\else + \setlength{\bibsep}{0pt} + \renewcommand\bibfont{\linespread{1.5814}\zihao{5}} +\fi +% \end{macrocode} +% +% \subsection{其他设置} +% \subsubsection{强调} +% \begin{macro}{\emph} +% 中西文统一使用粗体。 +% \begin{macrocode} +\renewcommand{\emph}[1]{\textbf{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\em} +% \begin{macrocode} +\renewcommand{\em}{\bfsong} +% \end{macrocode} +% \end{macro} + +% \subsubsection{脚注} +% \begin{macro}{\footnote} +% 使用带圈圈的脚注。尽管 \LaTeX\ 自带了 \cs{textcircled} 命令,但是效果并不如意。 +% 为了和一级列表环境的序号区分,这里使用 \pkg{tikz} 宏包来绘制一个围着阿拉伯数字脚注的圈。 +% 为了突出标号以便更加明确、清楚地显示,对编号设置了悬挂缩进。 +% \begin{macrocode} +\newcommand{\buct@ftntcircled}[1]{% + \lower 0.15em\hbox{% + \tikz\draw (0pt, 0pt) circle (0.4 em) node {#1};% + }% +} +\renewcommand\thefootnote{\protect\buct@ftntcircled{\tiny\arabic{footnote}}} +\renewcommand{\@makefntext}[1]{% + \setlength{\leftskip}{1.5\ccwd}% + \noindent\llap{\lower 1pt \hbox{\@thefnmark}\,}#1% +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{超链接} +% 实现PDF书签和交叉引用的跳转。 +% \begin{macrocode} +\urlstyle{same} +\hypersetup{% + colorlinks = true, + bookmarksnumbered = true, + pdfhighlight = /N, + breaklinks = true, + citecolor = cyan, +} +% \end{macrocode} +% +% 根据模板文档类是否打开 \opt{submit} 选项,设置是否关闭超链接颜色。 +% \begin{macrocode} +\ifbuct@submit + \hypersetup{hidelinks} +\fi +% \end{macrocode} +% +% 根据模板文档类是否打开 \opt{debugger} 选项,设置是否标注行号。 +% \begin{macrocode} +\ifbuct@debugger + \AtBeginDocument{\linenumbers} +\fi +% +% \end{macrocode} +% +% +% \subsection{封面} +% 由于学校会统一印制封面,这里仅提供\emph{硕博论文封面}的一个参考实现。 +% \begin{macrocode} +%<*cover> +\ProvidesClass{buctcover}[2020/03/20 Cover Maker for BUCTthesis] +\RequirePackage{ifxetex} +\RequireXeTeX +\RequirePackage{kvoptions} +\SetupKeyvalOptions{ + family = buct, + prefix = buct@, + setkeys = \kvsetkeys, +} +\newif\ifbuct@bachelor\buct@bachelorfalse +\newif\ifbuct@master\buct@masterfalse +\newif\ifbuct@doctor\buct@doctorfalse +\define@key{buct}{type}{\expandafter\csname buct@#1true\endcsname} +\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}} +\ProcessKeyvalOptions* +\PassOptionsToPackage{quiet}{xeCJK} +\LoadClass[zihao=-4]{ctexbook} +% \end{macrocode} +% +% 目前封面的 \opt{type} 选项仅允许硕博。 +% \begin{macrocode} +\ifbuct@bachelor% + \ClassError{buctcover}{% + type `bachelor' is unavailable. \MessageBreak% + type = [ master | doctor ]% + }{}\else + \ifbuct@master\relax\else + \ifbuct@doctor\relax\else + \ClassError{buctthesis}{% + Specified thesis type is obligatory: \MessageBreak% + type = [ master | doctor ]% + }{} +\fi\fi\fi +% \end{macrocode} +% +% 定义用于定义论文相关信息的内部命令。 +% 与 \cls{buctthesis} 不同的是:这里仅能通过 \cs{coversetup} 定义论文信息。其中 \opt{titleA} 和 \opt{titleB} 分别用于封面标题的第一行与第二行。 +% \begin{macrocode} +\newcommand{\coversetup}[1]{\kvsetkeys{buct}{#1}} +\DeclareStringOption[学号未定义]{studentid} +\DeclareStringOption[题目首行未定义]{titleA} +\DeclareStringOption[题目次行未定义]{titleB} +\DeclareStringOption[专业未定义]{major} +\DeclareStringOption[作者未定义]{author} +\DeclareStringOption[导师未定义]{supervisor} +\DeclareStringOption[\the\year-\two@digits{\month}-\two@digits{\day}]{date} +% \end{macrocode} +% +% 页边距设置。经过测量,各边距值比正文部分都要小。 +% \begin{macrocode} +\RequirePackage[a4paper,nomarginpar, + top = 2.1cm, bottom = 2.2cm, left = 2cm, right = 2cm, + headheight = 0cm, footskip = 0cm +]{geometry} +% \end{macrocode} +% +% 载入表格与插图的宏包。 +% \begin{macrocode} +\RequirePackage{array,graphicx,hyperref} +% \end{macrocode} +% +% 清空页眉页脚。 +% \begin{macrocode} +\pagestyle{empty} +% \end{macrocode} +% +% 字体配置。 +% +% 开启伪粗体,并且应比正文更粗一些。 +% \begin{macrocode} +\xeCJKsetup{EmboldenFactor=2.3} +% \end{macrocode} +% +% 各种字体的声明与设置。分别是:中易黑体、华文行楷、中易楷体、方正小标宋和方正大标宋。 +% 后二者需前往方正字库网站下载。 +% \begin{macrocode} +\setCJKsansfont{SimHei}[AutoFakeBold] +\newCJKfontfamily[xingkai]\xingkai{STXingkai} +\newCJKfontfamily[zhkai] \zhkai {KaiTi} [AutoFakeBold] +\newCJKfontfamily[xbsong] \xbsong {FZXiaoBiaoSong-B05S} +\newCJKfontfamily[dbsong] \dbsong {FZDaBiaoSong-B06S} +% \end{macrocode} +% +% 标尺,用于调试。 +% \begin{macrocode} +% \usepackage[unit=cm,type=upperleft,hshift=0cm,vshift=0cm]{fgruler} +% \end{macrocode} +% +% 日期格式处理,将输入的 \cs{buct@date} 拆分。 +% \begin{macrocode} +\newcommand\buct@format@date[1]{% + \edef\buct@@date{\buct@date}% + \def\buct@@process@date##1-##2-##3\@nil{% + #1{##1}{##2}{##3}% + }% + \expandafter\buct@@process@date\buct@@date\@nil +} +% \end{macrocode} +% +% \cs{@zhdate} 命令接受三个数字,将“年”转换为中文数字串,“月”和“日”转换为中文数字;其中“年”中的 0 映射为“〇”而非“零”。 +% \begin{macrocode} +\newcommand\@zhdate[3]{% + \Large\bfseries\zhkai\ziju{.1}% + 日\hspace{1.5\ccwd}期:\zhdigits{#1}年\zhnumber{#2}月\zhnumber{#3}日% +} +% \end{macrocode} +% +% \begin{macro}{\buct@makecover} +% 定义 \cs{buct@makecover} 命令来生成封面。 +% \begin{macrocode} +\newcommand{\buct@makecover}{% +% \end{macrocode} +% +% 封面右上角的“单位代码”和“学号”。 +% \begin{macrocode} + \begin{table}[h] + \renewcommand{\arraystretch}{1.3} + \raggedleft\large + \begin{tabular}{l@{}l} + \xbsong 单位代码 & :\CJKfamily+{zhsong}\mbox{10010}\\ + \xbsong 学\hspace{2\ccwd}号 & :\CJKfamily+{zhsong}\mbox{\buct@studentid}\\ + \end{tabular} + \end{table} + \vspace{26bp} +% \end{macrocode} +% +% 校徽与校名。前者是插图,后者是文字。 +% \begin{macrocode} + \begin{minipage}[c][][c]{2.35cm} + \includegraphics[width = 2.35cm]{BUCT-badge.pdf} + \end{minipage} + \qquad + \begin{minipage}[c][2.35cm][c]{9cm} + \ziju{-0.02}\xingkai\zihao{0}{北京化工大学} + \end{minipage} + \vspace{18bp} +% \end{macrocode} +% +% 标题。 +% \begin{macrocode} + \begin{center} + % \ziju{-0.05} + {\dbsong\fontsize{38bp}{60bp}\selectfont + \ifbuct@master{硕}\else{博}\fi{}士研究生学位论文} + \end{center} + \vspace{76bp} +% \end{macrocode} +% +% 论文信息。 +% \begin{macrocode} + \begin{center} + \fontsize{20}{36}\selectfont +% \end{macrocode} +% +% 禁用下划线的断点,调整粗细。 +% \begin{macrocode} + \xeCJKsetup{ + underline = { + skip = false, + thickness = 1.2pt, + } + } +% \end{macrocode} +% +% 使用一个表格来排版论文的信息。 +% \begin{macrocode} + \begin{tabular}{ + >{\begin{CJKfilltwosides}[b]{4\ccwd}\sffamily\bfseries}r% + <{\end{CJKfilltwosides}}% + @{}l% + @{}>{\zihao{3}\bfseries}l% + <{\vspace{.2em}}% + } +% \end{macrocode} +% +% 题目需要手动断行,且长度宜控制在 \SI{26}{em} 以内。 +% 因表格本身的横线与文字间距较大,这里采用下划线的方式来划线。 +% \begin{macrocode} + 题目 &: & \CJKunderline{\makebox[13em][l]{\buct@titleA}}\\ + &\phantom{:} & \CJKunderline{\makebox[13em][l]{\buct@titleB}}\\ + 专业 &: & \CJKunderline{\makebox[13em][l]{\buct@major}}\\ + 研究生 &: & \CJKunderline{\makebox[13em][l]{\buct@author}}\\ + 指导教师 &: & \CJKunderline{\makebox[13em][l]{\buct@supervisor}}\\ + \end{tabular} + \end{center} +% \end{macrocode} +% +% 在页面底部书写日期。 +% \begin{macrocode} + \vfill{% + \begin{center}% + \buct@format@date{\@zhdate}% + \end{center}% + } +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\makecover} +% 文档命令 \cs{makecover} 类似 \cs{makedeclare}, +% 接受一个可选参数用于插入扫描页,否则调用 \cs{buct@makecover} 生成封面。 +% \begin{macrocode} +\ifbuct@bachelor\relax\else + \NewDocumentCommand{\makecover}{ o }{% + \hypertarget{cover}{} + \pdfbookmark{封面}{cover} + \IfNoValueTF{#1}{\buct@makecover}{% + \includepdf[pages=-]{#1} + } + } +\fi +% +% \end{macrocode} +% \end{macro} +% +% +% \iffalse +% \begin{macrocode} +%<*manual> +\ProvidesPackage{manual}[2020/01/23 document style for BUCTthesis] +\RequirePackage{hypdoc} +\PassOptionsToPackage{AutoFakeSlant}{xeCJK} +\RequirePackage[UTF8, heading, fontset = none, linespread = 1.2,]{ctex} +\RequirePackage[toc]{multitoc} +\RequirePackage{ + listings, + float, + tabularx, + booktabs, + siunitx, + unicode-math, + xcolor, + caption, + enumitem, + metalogo, +} +\RequirePackage[bottom,perpage]{footmisc} +\RequirePackage[ + a4paper, + hmargin={40mm,20mm},vmargin={25mm,15mm},footskip=7mm, +]{geometry} +\ctexset{ + fontset, + abstractname = 简介, + indexname = 代码索引, + section = { + format = \Large\bfseries\raggedright, + name = {第,节}, + }, +} +\setcounter{secnumdepth}{4} +\setcounter{tocdepth}{3} +\setmainfont{Libertinus Serif} +\setmathfont{LibertinusMath-Regular.otf} +\captionsetup{strut=off, labelsep=quad, labelfont+=bf} +\lstdefinestyle{base}{ + aboveskip = 0 pt, + belowskip = 0 pt, + tabsize = 2, + basicstyle = \ttfamily\small, + columns = flexible, + frame = single, + framerule = 1 pt, + xleftmargin = 1 em, + aboveskip = 6 pt, + belowskip = 6 pt, + commentstyle = \slshape\color{gray}, + keywordstyle = \color{blue}, + backgroundcolor = \color{lightgray!10}, + showtabs = false, + showspaces = false, + showstringspaces = true, + captionpos = t, + breaklines = true, + numbers = none, + extendedchars = false, + escapechar = {@*}, + gobble = 4, +} +\lstdefinestyle{latex}{% + style=base, + rulecolor=\color{cyan}, + language=[LaTeX]TeX, +} +\lstdefinestyle{shell}{% + style=base, + rulecolor=\color{violet!65}, + language=bash, +} +\lstnewenvironment{latex}{\lstset{style=latex}}{} +\lstnewenvironment{shell}{\lstset{style=shell}}{} +\setlist{ + leftmargin = 0em, + nosep +} +\setlist[description]{% + itemindent = 2.5em, +} +\setlist[enumerate]{% + itemindent = 2em, +} +\newcommand\without\CJKsout +\newcommand\Arg[1]{ \texttt{\char`\{} \meta{#1} \texttt{\char`\}} } +\providecommand\marg[1]{ \Arg{#1} } +\providecommand\oarg[1]{ \texttt[ \meta{#1} \texttt] } +\providecommand\parg[1]{ \texttt( \meta{#1} \texttt) } +\DeclareRobustCommand{\opt}{\texttt} +\DeclareRobustCommand{\env}{\texttt} +\DeclareRobustCommand{\pkg}{\textsf} +\DeclareRobustCommand{\cls}{\textsf} +\DeclareRobustCommand{\file}{\textsf} +\def\DescribeOpt{\leavevmode\@bsphack% + \begingroup\MakePrivateLetters\Describe@Opt} +\def\Describe@Opt#1{\endgroup% + \marginpar{\raggedleft\PrintDescribeOpt{#1}}% + \SpecialOptIndex{#1}\@esphack\ignorespaces} +\def\PrintDescribeOpt#1{\strut \MacroFont #1\ } +\def\SpecialOptIndex#1{\@bsphack% + \begingroup% + \HD@target% + \let\HDorg@encapchar\encapchar% + \edef\encapchar usage{% + \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}% + }% + \@bsphack + \index{#1\actualchar{\protect\ttfamily#1} + (option)\encapchar usage}% + \index{options:\levelchar#1\actualchar% + {\protect\ttfamily#1}\encapchar usage}\@esphack% + \endgroup\@esphack} +\NewDocumentEnvironment{syntax}{ m }{% + \linespread{1}\xeCJKsetup{PunctStyle=plain}\xeCJKsetup{CJKecglue}% + \cs{#1}\ignorespaces% +}{\vspace{0.5em}} +\def\glossaryname{版本历史} +\GlossaryPrologue{\section{\glossaryname}} +\IndexPrologue{% + \clearpage\section{\indexname} + \textit{意大利体的数字表示描述对应索引项的页码; + 带下划线的数字表示定义对应索引项的代码行号; + 罗马字体的数字表示使用对应索引项的代码行号。} +} +\def\IndexLayout{% + \newgeometry{hmargin=15mm,vmargin={25mm,15mm},footskip=7mm}% + \setlength\IndexMin{.5\textheight}% + \ctexset{section/numbering=false}% +} +\hypersetup{ + pdftitle = {BUCTthesis: 北京化工大学学位论文模板}, + pdfauthor = {Miracle0565}, +} +\CodelineIndex +\EnableCrossrefs +\RecordChanges +\endinput +% +% \end{macrocode} +% \fi +% +% +% \Finale +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/buctthesis/source/buctthesis.ins b/macros/latex/contrib/buctthesis/source/buctthesis.ins new file mode 100644 index 0000000000..d2374560ac --- /dev/null +++ b/macros/latex/contrib/buctthesis/source/buctthesis.ins @@ -0,0 +1,69 @@ +%% +%% Copyright (C) 2019-2021 by Miracle0565 +%% +%% https://github.com/Miracle0565/BUCTthesis +%% +%% This file 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. The latest version of this license +%% is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3c or later is part of all distributions +%% of LaTeX version 1999/12/01 or later. +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input docstrip.tex + +\askforoverwritefalse +\keepsilent + +\preamble + +This is a generated file. + +Copyright (C) 2019-\the\year by Miracle0565 + + https://github.com/Miracle0565/BUCTthesis + +This file 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. The latest version of this license +is in: + + http://www.latex-project.org/lppl.txt + +and version 1.3c or later is part of all distributions +of LaTeX version 1999/12/01 or later. + +\endpreamble + +\generate{ + \usedir{tex/latex/buctthesis} + \file{buctthesis.cls}{\from{\jobname.dtx}{class} } + \file{manual.sty} {\from{\jobname.dtx}{manual}} + \file{buctcover.cls} {\from{\jobname.dtx}{cover}} +} + +\obeyspaces +\Msg{*************************************************************} +\Msg{* *} +\Msg{* To finish the installation you have to move the following *} +\Msg{* file into a directory searched by TeX: *} +\Msg{* *} +\Msg{* buctthesis.cls *} +\Msg{* munual.sty *} +\Msg{* buctcover.cls *} +\Msg{* *} +\Msg{* To produce the documentation run the file buctthesis.dtx *} +\Msg{* through LaTeX. *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{* *} +\Msg{*************************************************************} + +\endbatchfile -- cgit v1.2.3