diff options
Diffstat (limited to 'macros/latex/contrib/thuthesis')
21 files changed, 557 insertions, 1178 deletions
diff --git a/macros/latex/contrib/thuthesis/CHANGELOG.md b/macros/latex/contrib/thuthesis/CHANGELOG.md index 8989e48b9f..9864c944bc 100644 --- a/macros/latex/contrib/thuthesis/CHANGELOG.md +++ b/macros/latex/contrib/thuthesis/CHANGELOG.md @@ -6,6 +6,32 @@ ## [Unreleased] +## [v7.5.0] - 2024-03-29 + +### Added + +- 本科生的附录(调研阅读报告和书面翻译)支持 `biblatex`([#893](https://github.com/tuna/thuthesis/issues/893))。 +- 适配生命科学学院要求的 Cell 参考文献格式([#921](https://github.com/tuna/thuthesis/discussions/921))。 +- 增加 GitHub Actions 配置,自动从 master 分支发布预览版本、自动在多平台进行测试。 + +### Changed + +- 同步《写作指南》对 2023 年 3 月版本的后续修改: + - 封面的学科门类的字号改为三号(16bp)([#899](https://github.com/tuna/thuthesis/issues/899))。 + - 修改研究生目录的章标题段前距离([#926](https://github.com/tuna/thuthesis/issues/926))。 + - 统一并简化封面的布局([#900](https://github.com/tuna/thuthesis/issues/900))。 +- 不再插入 PDF 版书脊,改为编译生成([#551](https://github.com/tuna/thuthesis/issues/551))。 +- 本科生附录的参考文献编译方式改为 `bibtex thuthesis-appendix-{a,b,c...}`,同研究生一致。 +- 英文封面的导师姓名居中对齐([#883](https://github.com/tuna/thuthesis/issues/883))。 +- 修正 macOS 的 MS Office 字体名([#913](https://github.com/tuna/thuthesis/issues/913))。 +- 自动检测并使用 Windows 字体文件,默认从当前目录查找([#747](https://github.com/tuna/thuthesis/discussions/747))。 + +### Fixed + +- 修正封面的职称字距问题([#879](https://github.com/tuna/thuthesis/discussions/879))。 +- 解决了本科生附录的 `\printbibliography` 报错的问题([#882](https://github.com/tuna/thuthesis/issues/882))。 +- 修复了同时调用 `glossaries` 和 `hyperref` 时的多余空格([#901](https://github.com/tuna/thuthesis/issues/901))。 + ## [v7.4.0] - 2023-05-15 ### Added @@ -951,7 +977,8 @@ -[Unreleased]: https://github.com/tuna/thuthesis/compare/v7.4.0...HEAD +[Unreleased]: https://github.com/tuna/thuthesis/compare/v7.5.0...HEAD +[v7.5.0]: https://github.com/tuna/thuthesis/compare/v7.4.0...v7.5.0 [v7.4.0]: https://github.com/tuna/thuthesis/compare/v7.3.2...v7.4.0 [v7.3.2]: https://github.com/tuna/thuthesis/compare/v7.3.1...v7.3.2 [v7.3.1]: https://github.com/tuna/thuthesis/compare/v7.3.0...v7.3.1 diff --git a/macros/latex/contrib/thuthesis/LICENSE b/macros/latex/contrib/thuthesis/LICENSE deleted file mode 100644 index 2244313901..0000000000 --- a/macros/latex/contrib/thuthesis/LICENSE +++ /dev/null @@ -1,416 +0,0 @@ -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/thuthesis/Makefile b/macros/latex/contrib/thuthesis/Makefile deleted file mode 100644 index 1a7fd81641..0000000000 --- a/macros/latex/contrib/thuthesis/Makefile +++ /dev/null @@ -1,93 +0,0 @@ -# Makefile for ThuThesis - -PACKAGE = thuthesis -THESIS = thuthesis-example -SPINE = spine - -SOURCES = $(PACKAGE).ins $(PACKAGE).dtx -CLSFILE = dtx-style.sty $(PACKAGE).cls - -LATEXMK = latexmk -SHELL := /bin/bash -NPM ?= npm - -# make deletion work on Windows -ifdef SystemRoot - RM = del /Q -else - RM = rm -f -endif - -.PHONY: all all-dev clean distclean dist thesis viewthesis spine viewspine doc viewdoc cls check save savepdf test FORCE_MAKE - -thesis: $(THESIS).pdf - -all: thesis spine - -all-dev: doc all - -cls: $(CLSFILE) - -$(CLSFILE): $(SOURCES) - xetex $(PACKAGE).ins - -doc: $(PACKAGE).pdf - -spine: $(SPINE).pdf - -$(PACKAGE).pdf: cls FORCE_MAKE - $(LATEXMK) $(PACKAGE).dtx - -$(THESIS).pdf: cls FORCE_MAKE - $(LATEXMK) $(THESIS) - -$(SPINE).pdf: cls FORCE_MAKE - $(LATEXMK) $(SPINE) - -viewdoc: doc - $(LATEXMK) -pv $(PACKAGE).dtx - -viewthesis: thesis - $(LATEXMK) -pv $(THESIS) - -viewspine: spine - $(LATEXMK) -pv $(SPINE) - -save: -ifeq ($(target),) - bash testfiles/save.sh -else - bash testfiles/save.sh $(target) -endif - -test: -ifeq ($(target),) - l3build check -else - bash testfiles/test.sh $(target) -endif - -clean: - $(LATEXMK) -c $(PACKAGE).dtx $(THESIS) $(SPINE) - -@$(RM) -rf *~ main-survey.* main-translation.* _markdown_thuthesis* thuthesis.markdown.* - -cleanall: clean - -@$(RM) $(PACKAGE).pdf $(THESIS).pdf $(SPINE).pdf - -distclean: cleanall - -@$(RM) $(CLSFILE) - -@$(RM) -r dist - -check: FORCE_MAKE -ifeq ($(version),) - @echo "Error: version missing: \"make [check|dist] version=X.Y.Z\""; exit 1 -else - @[[ $(shell grep -E -c '$(version) Tsinghua University Thesis Template|\\def\\version\{$(version)\}' thuthesis.dtx) -eq 3 ]] || (echo "update version with \'l3build tag\" before release"; exit 1) - @[[ $(shell grep -E -c '"version": "$(version)"' package.json) -eq 1 ]] || (echo "update version with \'l3build tag\" before release"; exit 1) -endif - -dist: check all-dev - # use l3build for CTAN release (zip with .tds.zip) - l3build ctan --config build-ctan - # use gulp for GitHub release (zip with generated file) - $(NPM) run build -- --version=$(version) diff --git a/macros/latex/contrib/thuthesis/README.md b/macros/latex/contrib/thuthesis/README.md index 653ebffd56..d760190121 100644 --- a/macros/latex/contrib/thuthesis/README.md +++ b/macros/latex/contrib/thuthesis/README.md @@ -21,12 +21,12 @@ Scroll down for the English version of README. 推荐下载**发布版**模板,里面包括具体使用说明以及示例文档: -* 模板使用说明(thuthesis.pdf) -* 示例文档(thuthesis-example.pdf) +* 模板使用说明(`thuthesis.pdf`) +* 示例文档(`thuthesis-example.pdf`) -开发版中不提供预生成的 `cls` 文件和文档,仅包含源码。其仅供开发者与需要尚未发布的功能的有经验的 TeX 用户使用,不提供任何保证。 +在开始书写前,建议将 `thuthesis-example.tex` 复制或重命名为其他有意义的名称。 -下载途径: +### 下载途径 * 发布版: * 仅下载: @@ -35,17 +35,22 @@ Scroll down for the English version of README. * [TUNA 镜像站](https://mirrors.tuna.tsinghua.edu.cn/github-release/tuna/thuthesis/):GitHub Releases 的镜像。 * 在线编辑: * [TeXPage 模板](https://www.texpage.com/template/72b580ca-51fa-4ecc-82b3-0509bc1d6a07)(提供 Windows 中文字体) - * [Overleaf 模板](https://www.overleaf.com/latex/templates/thuthesis-tsinghua-university-thesis-latex-template/wddqnwbyhtnk) + * [Overleaf 模板](https://www.overleaf.com/latex/templates/thuthesis-tsinghua-university-thesis-latex-template/cfwgcxtvkbsx) * 开发版:[GitHub](https://github.com/tuna/thuthesis) -**任何在其他途径分发的 ThuThesis(包含其变体或衍生物)均不是官方版本,请谨慎使用。** +### 注意事项 + +* GitHub 仓库的开发版仅供开发者与需要尚未发布的功能的有经验的 TeX 用户使用,不提供任何保证。 +* **任何在其他途径分发的 ThuThesis(包含其变体或衍生物)均不是官方版本,请谨慎使用。** ## 更新日志 每个版本的详细更新日志,请见 [CHANGELOG.md](CHANGELOG.md)。使用文档中也包含了这一内容。 ## 升级 + ### 自动更新 + 通过 TeX 发行版工具(如 `tlmgr`)自动从 [CTAN](https://www.ctan.org/pkg/thuthesis) 更新。 ### 手动更新 @@ -56,34 +61,30 @@ Scroll down for the English version of README. #### 开发版 -从 GitHub clone 项目源码或者下载源码 zip 包,执行命令(Windows 用户在文件夹空白处按 `Shift + 鼠标右键`,点击“在此处打开命令行窗口”): - -```shell -xetex thuthesis.ins -``` +有两种获得开发版编译结果的方式: -即可得到 `thuthesis.cls` 等模板文件。 +1. 从 GitHub 上对应 commit 的名为 `Test` 的 workflow 中下载 `thuthesis-snapshot-release` 并解压,其中的 `dist` 文件夹包含了编译后的开发版代码。 +2. 从 GitHub clone 项目源码或者下载源码 zip 包,执行 `xetex thuthesis.ins`。 ## 提问 + 按推荐顺序排序: -* 先到 [FAQ](https://github.com/tuna/thuthesis/wiki/FAQ) 看看常见问题 -* 在 [GitHub Discussions](https://github.com/tuna/thuthesis/discussions) 搜索已有讨论,如果没有则提出新问题 -* 如果认为模板存在问题,可在 Issues 中提出 +* 先到 [FAQ](https://github.com/tuna/thuthesis/wiki/FAQ) 看看常见问题; +* 在 [GitHub Discussions](https://github.com/tuna/thuthesis/discussions) 搜索已有讨论,如果没有则提出新问题; +* 如果认为模板存在问题,可在 Issues 中使用相应的模板提出。 ## Makefile的用法 ```shell -make [{all|thesis|spine|doc|clean|cleanall|distclean}] +make [{thesis|doc|clean|cleanall|distclean}] ``` ### 目标 -* `make thesis` 生成论文 thuthesis-example.pdf; -* `make spine` 生成书脊 spine.pdf; -* `make doc` 生成模板使用说明书 thuthesis.pdf; -* `make all` 生成论文和书脊,相当于 `make thesis && make spine`; -* `make clean` 删除示例文件的中间文件(不含 thuthesis-example.pdf); -* `make cleanall` 删除示例文件的中间文件和 thuthesis-example.pdf; +* `make thesis` 生成论文 `thuthesis-example.pdf`; +* `make doc` 生成模板使用说明书 `thuthesis.pdf`; +* `make clean` 删除示例文件的中间文件(不含 `thuthesis-example.pdf`); +* `make cleanall` 删除示例文件的中间文件和 `thuthesis-example.pdf`; * `make distclean` 删除示例文件和模板的所有中间文件和 PDF。 --- @@ -100,11 +101,14 @@ Any use of ThuThesis in violation of [The LaTeX project public license v1.3c](ht ## Downloads -**Published versions** are recommended. Specific usage documentation and examples can be found in the archive. At present, these documents are <b>only available in Chinese</b>: -* Template usage documentation (thuthesis.pdf) -* Template example (thuthesis-example.pdf) +**Published versions** are recommended. Specific usage documentation and examples can be found in the archive. At present, these documents are **only available in Chinese**: + +* Template usage documentation (`thuthesis.pdf`) +* Template example (`thuthesis-example.pdf`) -Developer versions contain only source code but no pre-compiled `cls` file and documentations. They are only for the usage of developers and experienced TeX users in need of unpublished features. No warranties are provided. +Before you start writing, it is recommended to copy or rename `thuthesis-example.tex` to another meaningful name. + +### Download Methods * Published versions: * Download only: @@ -113,17 +117,22 @@ Developer versions contain only source code but no pre-compiled `cls` file and d * [TUNA Mirrors](https://mirrors.tuna.tsinghua.edu.cn/github-release/tuna/thuthesis/): mirror of GitHub Releases * Online editor: * [TeXPage template](https://www.texpage.com/template/72b580ca-51fa-4ecc-82b3-0509bc1d6a07) (providing Chinese fonts of Windows) - * [Overleaf template](https://www.overleaf.com/latex/templates/thuthesis-tsinghua-university-thesis-latex-template/wddqnwbyhtnk) + * [Overleaf template](https://www.overleaf.com/latex/templates/thuthesis-tsinghua-university-thesis-latex-template/cfwgcxtvkbsx) * Developer versions: [GitHub](https://github.com/tuna/thuthesis) -**ThuThesis (including its variants / derivatives) distributed in any other way is NOT an official version. Use at your own risk.** +### Notes + +* The development version in the GitHub repository is intended for developers and experienced TeX users who require unreleased features, and no guarantees are provided. +* **ThuThesis (including its variants / derivatives) distributed in any other way is NOT an official version. Use at your own risk.** ## Changelog See [CHANGELOG.md](CHANGELOG.md) for detailed changes in each release. They are also included in the usage documentation. ## Updates + ### Automatic + Get the most up-to-date published version with your TeX distribution from [CTAN](https://www.ctan.org/pkg/thuthesis). ### Manual @@ -132,34 +141,30 @@ Get the most up-to-date published version with your TeX distribution from [CTAN] Download the published zip files, extract `thuthesis.cls` and other files (if needed) and override the existing ones in your thesis. -#### Developer versions +#### Development versions -Download the source code package and unzip to the root directory of your thesis (or clone this project), then execute the command (Windows users `Shift + right click` white area in the file window and click "Open command line window here" from the popup menu): +There are two ways to obtain the compiled development version: -```shell -xetex thuthesis.ins -``` - -You'll get `thuthesis.cls` along with other template files. +1. Download the `thuthesis-snapshot-release` from the `Test` workflow of the corresponding commit on GitHub and extract it. The `dist` folder contains the compiled template of development version. +2. Clone the project source code from GitHub or download the source code tarball, and run `xetex thuthesis.ins`. ## Reporting Issues + Please follow the procedure below: -* Check the [FAQ](https://github.com/tuna/thuthesis/wiki/FAQ) -* Search [GitHub Discussions](https://github.com/tuna/thuthesis/discussions) and create if not existed -* Create an issue if you believe there is a bug +* Check the [FAQ](https://github.com/tuna/thuthesis/wiki/FAQ). +* Search [GitHub Discussions](https://github.com/tuna/thuthesis/discussions) and create if not existed. +* Create an issue (with specified template) if you believe there is a bug. ## Makefile Usage ```shell -make [{all|thesis|spine|doc|clean|cleanall|distclean}] +make [{all|thesis|doc|clean|cleanall|distclean}] ``` ### Targets -* `make thesis` generate thesis thuthesis-example.pdf; -* `make spine` generate book spine for printing spine.pdf; +* `make thesis` generate thesis `thuthesis-example.pdf`; * `make doc` generate template documentation thuthesis.pdf; -* `make all` generate thesis and spine, same as `make thesis && make spine`; * `make clean` delete all examples' files (excluding thuthesis-example.pdf); * `make cleanall` delete all examples' files and thuthesis-example.pdf; * `make distclean` delete all examples' and templates' files and PDFs. diff --git a/macros/latex/contrib/thuthesis/data/appendix-survey.tex b/macros/latex/contrib/thuthesis/data/appendix-survey.tex index 76fe5b12f5..705964fd60 100644 --- a/macros/latex/contrib/thuthesis/data/appendix-survey.tex +++ b/macros/latex/contrib/thuthesis/data/appendix-survey.tex @@ -38,7 +38,7 @@ An example table in appendix (Table~\ref{tab:appendix-survey-table}). \toprule File name & Description \\ \midrule - thuthesis.dtx & The source file including documentaion and comments \\ + thuthesis.dtx & The source file including documentation and comments \\ thuthesis.cls & The template file \\ thuthesis-*.bst & BibTeX styles \\ thuthesis-*.bbx & BibLaTeX styles for bibliographies \\ @@ -60,13 +60,17 @@ An example equation in appendix (Equation~\eqref{eq:appendix-survey-equation}). \section{Citations} -Example citations in appendix. -\cite{abrahams99tex} -\cite{salomon1995advanced} -\cite{abrahams99tex,salomon1995advanced} +Example\cite{dupont1974bone} citations\cite{merkt1995rotational} in appendix +\cite{dupont1974bone,merkt1995rotational}. +% 默认使用正文的参考文献样式; +% 如果使用 BibTeX,可以切换为其他兼容 natbib 的 BibTeX 样式。 \bibliographystyle{unsrtnat} -\bibliography{ref/appendix} +% \bibliographystyle{IEEEtranN} + +% 默认使用正文的参考文献 .bib 数据库; +% 如果使用 BibTeX,可以改为指定数据库,如 \bibliography{ref/refs}。 +\printbibliography \end{survey} diff --git a/macros/latex/contrib/thuthesis/data/appendix-translation.tex b/macros/latex/contrib/thuthesis/data/appendix-translation.tex index 0ca7d15264..b244af4735 100644 --- a/macros/latex/contrib/thuthesis/data/appendix-translation.tex +++ b/macros/latex/contrib/thuthesis/data/appendix-translation.tex @@ -59,7 +59,8 @@ \section{文献引用} -文献引用示例\cite{abrahams99tex}。 +附录\cite{dupont1974bone}中的参考文献引用\cite{merkt1995rotational}示例 +\cite{dupont1974bone,merkt1995rotational}。 \appendix @@ -70,14 +71,22 @@ % 书面翻译的参考文献 +% 默认使用正文的参考文献样式; +% 如果使用 BibTeX,可以切换为其他兼容 natbib 的 BibTeX 样式。 \bibliographystyle{unsrtnat} -\bibliography{ref/appendix} +% \bibliographystyle{IEEEtranN} + +% 默认使用正文的参考文献 .bib 数据库; +% 如果使用 BibTeX,可以改为指定数据库,如 \bibliography{ref/refs}。 +\printbibliography % 书面翻译对应的原文索引 \begin{translation-index} - \nocite{salomon1995advanced} + \nocite{mellinger1996laser} + \nocite{bixon1996dynamics} + \nocite{carlson1981two} \bibliographystyle{unsrtnat} - \bibliography{ref/appendix} + \printbibliography \end{translation-index} \end{translation} diff --git a/macros/latex/contrib/thuthesis/data/appendix.tex b/macros/latex/contrib/thuthesis/data/appendix.tex index a955b4e559..24d9485061 100644 --- a/macros/latex/contrib/thuthesis/data/appendix.tex +++ b/macros/latex/contrib/thuthesis/data/appendix.tex @@ -52,8 +52,9 @@ \end{equation} -\section{参考文献} +\section{文献引用} -附录中的参考文献示例(\cite{carlson1981two} 和 \cite{carlson1981two,taylor1983scanning,taylor1981study})。 +附录\cite{dupont1974bone}中的参考文献引用\cite{zhengkaiqing1987}示例 +\cite{dupont1974bone,zhengkaiqing1987}。 \printbibliography diff --git a/macros/latex/contrib/thuthesis/data/chap03.tex b/macros/latex/contrib/thuthesis/data/chap03.tex index 8cd4344fbb..54c83ed6c5 100644 --- a/macros/latex/contrib/thuthesis/data/chap03.tex +++ b/macros/latex/contrib/thuthesis/data/chap03.tex @@ -78,7 +78,7 @@ \section{数学定理} 定理环境的格式可以使用 \pkg{amsthm} 或者 \pkg{ntheorem} 宏包配置。 -用户在导言区载入这两者之一后,模板会自动配置 \env{thoerem}、\env{proof} 等环境。 +用户在导言区载入这两者之一后,模板会自动配置 \env{theorem}、\env{proof} 等环境。 \begin{theorem}[Lindeberg--Lévy 中心极限定理] 设随机变量 $X_1, X_2, \dots, X_n$ 独立同分布, 且具有期望 $\mu$ 和有限的方差 $\sigma^2 \ne 0$, diff --git a/macros/latex/contrib/thuthesis/latexmkrc b/macros/latex/contrib/thuthesis/latexmkrc deleted file mode 100644 index 848fd1312f..0000000000 --- a/macros/latex/contrib/thuthesis/latexmkrc +++ /dev/null @@ -1,19 +0,0 @@ -# vim: set ft=perl: - -$pdf_mode = 5; - -$xelatex = "xelatex -shell-escape -file-line-error -halt-on-error -interaction=nonstopmode -no-pdf -synctex=1 %O %S"; -$lualatex = "lualatex -shell-escape -file-line-error -halt-on-error -interaction=nonstopmode -synctex=1 %O %S"; -$xdvipdfmx = "xdvipdfmx -q -E -o %D %O %S"; - -$bibtex_use = 1.5; - -$clean_ext = "hd loe ptc run.xml synctex.gz thm xdv"; - -$makeindex = "makeindex -s gind.ist %O -o %D %S"; - -add_cus_dep('nlo', 'nls', 0, 'nlo2nls'); -sub nlo2nls { - system("makeindex -s nomencl.ist -o \"$_[0].nls\" \"$_[0].nlo\""); -} -push @generated_exts, 'nlo', 'nls'; diff --git a/macros/latex/contrib/thuthesis/ref/appendix.bib b/macros/latex/contrib/thuthesis/ref/appendix.bib deleted file mode 100644 index 0f9ae22352..0000000000 --- a/macros/latex/contrib/thuthesis/ref/appendix.bib +++ /dev/null @@ -1,14 +0,0 @@ -@book{abrahams99tex, - author = {Paul W. Abrahams and Karl Berry and Kathryn A. Hargreaves}, - title = {{\TeX} for the Impatient}, - publisher = {Addison-Wesley}, - year = 1990, -} - -@book{salomon1995advanced, - author = {David Salomon}, - title = {The advanced {\TeX}book}, - address = {New York}, - publisher = {Springer}, - year = 1995, -} diff --git a/macros/latex/contrib/thuthesis/ref/refs.bib b/macros/latex/contrib/thuthesis/ref/refs.bib index 6b51f03003..6eb5862de4 100644 --- a/macros/latex/contrib/thuthesis/ref/refs.bib +++ b/macros/latex/contrib/thuthesis/ref/refs.bib @@ -44,6 +44,7 @@ title = {一种温热外敷药制备方案}, address = {中国}, number = {88105607.3}, + year = {1980}, date = {1980-07-26}, key = {jiang1 xi1 zhou1}, } @@ -298,6 +299,7 @@ author = {傅刚 and 赵承 and 李佳路}, title = {大风沙过后的思考}, journal = {北京青年报}, + year = {2000}, date = {2000-04-12}, number = {14}, urldate = {2002-03-06}, @@ -318,6 +320,7 @@ @online{oclc2000about, author = {{Online Computer Library Center, Inc}}, title = {About {OCLC}: History of Cooperation}, + year = {2000}, urldate = {2000-01-08}, url = {http://www.oclc.org/about/cooperation.en.htm}, } diff --git a/macros/latex/contrib/thuthesis/spine.pdf b/macros/latex/contrib/thuthesis/spine.pdf Binary files differindex 7aff0d70d6..99892546a7 100644 --- a/macros/latex/contrib/thuthesis/spine.pdf +++ b/macros/latex/contrib/thuthesis/spine.pdf diff --git a/macros/latex/contrib/thuthesis/spine.tex b/macros/latex/contrib/thuthesis/spine.tex deleted file mode 100644 index 54f4d29842..0000000000 --- a/macros/latex/contrib/thuthesis/spine.tex +++ /dev/null @@ -1,19 +0,0 @@ -% !TeX encoding = UTF-8 -% !TeX program = xelatex -% !TeX spellcheck = en_US - -\documentclass[degree=master]{thuthesis} - -\input{thusetup.tex} - -% \thusetup{ -% spine-font = {\zihao{3}}, -% spine-title = {书脊的标题}, -% spine-author = {书脊的作者姓名}, -% } - -\begin{document} - -\spine - -\end{document} diff --git a/macros/latex/contrib/thuthesis/thusetup.tex b/macros/latex/contrib/thuthesis/thusetup.tex index 4eb5ae54b8..16cc0a68ac 100644 --- a/macros/latex/contrib/thuthesis/thusetup.tex +++ b/macros/latex/contrib/thuthesis/thusetup.tex @@ -14,6 +14,9 @@ % 选择打印版(print)或用于提交的电子版(electronic),前者会插入空白页以便直接双面打印 % output = print, + % 格式类型 + % 默认为论文(thesis),也可以设置为开题报告(proposal) + % thesis-type = proposal, % % 标题 % 可使用“\\”命令手动控制换行 @@ -67,6 +70,11 @@ author = {薛瑞尼}, author* = {Xue Ruini}, % + % 学号 + % 仅当书写开题报告时需要(同时设置 `thesis-type = proposal') + % + % student-id = {2000310000}, + % % 指导教师 % 中文姓名和职称之间以英文逗号“,”分开,下同 % @@ -154,6 +162,10 @@ % \usepackage{natbib} % \bibliographystyle{thuthesis-author-year} +% 生命科学学院要求使用 Cell 参考文献格式(2023 年以前使用 author-date 格式) +% \usepackage{natbib} +% \bibliographystyle{cell} + % 本科生参考文献的著录格式 % \usepackage[sort]{natbib} % \bibliographystyle{thuthesis-bachelor} @@ -161,6 +173,7 @@ % 参考文献使用 BibLaTeX 宏包 % \usepackage[style=thuthesis-numeric]{biblatex} % \usepackage[style=thuthesis-author-year]{biblatex} +% \usepackage[style=gb7714-2015]{biblatex} % \usepackage[style=apa]{biblatex} % \usepackage[style=mla-new]{biblatex} % 声明 BibLaTeX 的数据库 diff --git a/macros/latex/contrib/thuthesis/thuthesis-author-year.bst b/macros/latex/contrib/thuthesis/thuthesis-author-year.bst index fe7e0d20dd..9a46a4e461 100644 --- a/macros/latex/contrib/thuthesis/thuthesis-author-year.bst +++ b/macros/latex/contrib/thuthesis/thuthesis-author-year.bst @@ -8,9 +8,9 @@ %% ------------------------------------------------------------------- %% GB/T 7714 BibTeX Style %% https://github.com/zepinglee/gbt7714-bibtex-style -%% Version: 2022/03/21 v2.1.4 +%% Version: 2024/03/08 v2.1.6 %% ------------------------------------------------------------------- -%% Copyright (C) 2016--2022 by Zeping Lee <zepinglee AT gmail.com> +%% Copyright (C) 2016--2024 by Zeping Lee <zepinglee AT gmail.com> %% ------------------------------------------------------------------- %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -39,6 +39,7 @@ INTEGERS { show.medium.type short.journal italic.journal + link.journal bold.journal.volume show.missing.address.publisher space.before.pages @@ -83,6 +84,7 @@ FUNCTION {load.config} "slash" 'component.part.label := #0 'short.journal := #0 'italic.journal := + #0 'link.journal := #0 'bold.journal.volume := #0 'show.missing.address.publisher := #1 'space.before.pages := @@ -745,7 +747,7 @@ FUNCTION {editor.full} FUNCTION {make.full.names} { type$ "book" = - type$ "inbook" = + type$ "inbook" = booktitle empty$ not and or 'author.editor.full { type$ "collection" = @@ -887,7 +889,7 @@ FUNCTION {format.volume} { volume is.number { entry.lang lang.zh = { "第 " volume * " 卷" * } - { "volume" volume tie.or.space.connect } + { "Vol." volume tie.or.space.connect } if$ } { volume } @@ -902,7 +904,7 @@ FUNCTION {format.number} { number is.number { entry.lang lang.zh = { "第 " number * " 册" * } - { "number" number tie.or.space.connect } + { "No." number tie.or.space.connect } if$ } { number } @@ -1067,7 +1069,7 @@ FUNCTION {get.journal.title} } FUNCTION {check.arxiv.preprint} -{ #1 #5 substring$ "l" change.case$ "arxiv" = +{ #1 #5 substring$ purify$ "l" change.case$ "arxiv" = { #1 } { #0 } if$ @@ -1080,6 +1082,10 @@ FUNCTION {format.journal} 'emphasize 'skip$ if$ + link.journal + 'add.link + 'skip$ + if$ } 'skip$ if$ @@ -1976,6 +1982,10 @@ FUNCTION {preprint} format.urldate "" output.after output.eprint output.url + show.preprint not eprint empty$ or + 'output.doi + 'skip$ + if$ new.block format.note output fin.entry @@ -2040,7 +2050,12 @@ FUNCTION {dataset} electronic } -FUNCTION {inbook} { book } +FUNCTION {inbook} { + booktitle empty$ + 'book + 'incollection + if$ +} FUNCTION {inproceedings} { "C" set.entry.mark @@ -2058,7 +2073,7 @@ FUNCTION {map} FUNCTION {manual} { monograph } -FUNCTION {mastersthesis} +FUNCTION {thesis} { "D" set.entry.mark monograph } @@ -2073,7 +2088,9 @@ FUNCTION {online} electronic } -FUNCTION {phdthesis} { mastersthesis } +FUNCTION {mastersthesis} { thesis } + +FUNCTION {phdthesis} { thesis } FUNCTION {proceedings} { "C" set.entry.mark @@ -2090,11 +2107,13 @@ FUNCTION {standard} misc } -FUNCTION {techreport} +FUNCTION {report} { "R" set.entry.mark misc } +FUNCTION {techreport} { report } + FUNCTION {unpublished} { misc } FUNCTION {default.type} { misc } @@ -2281,7 +2300,7 @@ FUNCTION {editor.key.organization.label} FUNCTION {calc.short.authors} { "" 'short.label := type$ "book" = - type$ "inbook" = + type$ "inbook" = booktitle empty$ not and or 'author.editor.key.label { type$ "collection" = @@ -2483,7 +2502,7 @@ FUNCTION {presort} " " * type$ "book" = - type$ "inbook" = + type$ "inbook" = booktitle empty$ not and or 'author.editor.sort { type$ "collection" = diff --git a/macros/latex/contrib/thuthesis/thuthesis-bachelor.bst b/macros/latex/contrib/thuthesis/thuthesis-bachelor.bst index e7d7b7d85e..67e1f7eeb3 100644 --- a/macros/latex/contrib/thuthesis/thuthesis-bachelor.bst +++ b/macros/latex/contrib/thuthesis/thuthesis-bachelor.bst @@ -8,9 +8,9 @@ %% ------------------------------------------------------------------- %% GB/T 7714 BibTeX Style %% https://github.com/zepinglee/gbt7714-bibtex-style -%% Version: 2022/03/21 v2.1.4 +%% Version: 2024/03/08 v2.1.6 %% ------------------------------------------------------------------- -%% Copyright (C) 2016--2022 by Zeping Lee <zepinglee AT gmail.com> +%% Copyright (C) 2016--2024 by Zeping Lee <zepinglee AT gmail.com> %% ------------------------------------------------------------------- %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -39,6 +39,7 @@ INTEGERS { show.medium.type short.journal italic.journal + link.journal bold.journal.volume show.missing.address.publisher space.before.pages @@ -78,6 +79,7 @@ FUNCTION {load.config} "slash" 'component.part.label := #0 'short.journal := #0 'italic.journal := + #0 'link.journal := #0 'bold.journal.volume := #0 'show.missing.address.publisher := #1 'space.before.pages := @@ -735,7 +737,7 @@ FUNCTION {editor.full} FUNCTION {make.full.names} { type$ "book" = - type$ "inbook" = + type$ "inbook" = booktitle empty$ not and or 'author.editor.full { type$ "collection" = @@ -877,7 +879,7 @@ FUNCTION {format.volume} { volume is.number { entry.lang lang.zh = { "第 " volume * " 卷" * } - { "volume" volume tie.or.space.connect } + { "Vol." volume tie.or.space.connect } if$ } { volume } @@ -892,7 +894,7 @@ FUNCTION {format.number} { number is.number { entry.lang lang.zh = { "第 " number * " 册" * } - { "number" number tie.or.space.connect } + { "No." number tie.or.space.connect } if$ } { number } @@ -1057,7 +1059,7 @@ FUNCTION {get.journal.title} } FUNCTION {check.arxiv.preprint} -{ #1 #5 substring$ "l" change.case$ "arxiv" = +{ #1 #5 substring$ purify$ "l" change.case$ "arxiv" = { #1 } { #0 } if$ @@ -1070,6 +1072,10 @@ FUNCTION {format.journal} 'emphasize 'skip$ if$ + link.journal + 'add.link + 'skip$ + if$ } 'skip$ if$ @@ -1966,6 +1972,10 @@ FUNCTION {preprint} format.urldate "" output.after output.eprint output.url + show.preprint not eprint empty$ or + 'output.doi + 'skip$ + if$ new.block format.note output fin.entry @@ -2030,7 +2040,12 @@ FUNCTION {dataset} electronic } -FUNCTION {inbook} { book } +FUNCTION {inbook} { + booktitle empty$ + 'book + 'incollection + if$ +} FUNCTION {inproceedings} { "C" set.entry.mark @@ -2048,7 +2063,7 @@ FUNCTION {map} FUNCTION {manual} { monograph } -FUNCTION {mastersthesis} +FUNCTION {thesis} { "D" set.entry.mark monograph } @@ -2063,7 +2078,9 @@ FUNCTION {online} electronic } -FUNCTION {phdthesis} { mastersthesis } +FUNCTION {mastersthesis} { thesis } + +FUNCTION {phdthesis} { thesis } FUNCTION {proceedings} { "C" set.entry.mark @@ -2080,11 +2097,13 @@ FUNCTION {standard} misc } -FUNCTION {techreport} +FUNCTION {report} { "R" set.entry.mark misc } +FUNCTION {techreport} { report } + FUNCTION {unpublished} { misc } FUNCTION {default.type} { misc } @@ -2271,7 +2290,7 @@ FUNCTION {editor.key.organization.label} FUNCTION {calc.short.authors} { "" 'short.label := type$ "book" = - type$ "inbook" = + type$ "inbook" = booktitle empty$ not and or 'author.editor.key.label { type$ "collection" = diff --git a/macros/latex/contrib/thuthesis/thuthesis-example.pdf b/macros/latex/contrib/thuthesis/thuthesis-example.pdf Binary files differindex 6f37010a21..1a4d6b72b0 100644 --- a/macros/latex/contrib/thuthesis/thuthesis-example.pdf +++ b/macros/latex/contrib/thuthesis/thuthesis-example.pdf diff --git a/macros/latex/contrib/thuthesis/thuthesis-example.tex b/macros/latex/contrib/thuthesis/thuthesis-example.tex index 8c3061a0ed..298c45fde9 100644 --- a/macros/latex/contrib/thuthesis/thuthesis-example.tex +++ b/macros/latex/contrib/thuthesis/thuthesis-example.tex @@ -28,6 +28,7 @@ \input{data/committee} % 使用授权的说明 +% 本科生开题报告不需要 \copyrightpage % 将签字扫描后授权文件 scan-copyright.pdf 替换原始页面 % \copyrightpage[file=scan-copyright.pdf] @@ -74,6 +75,7 @@ \input{data/acknowledgements} % 声明 +% 本科生开题报告不需要 \statement % 将签字扫描后的声明文件 scan-statement.pdf 替换原始页面 % \statement[file=scan-statement.pdf] diff --git a/macros/latex/contrib/thuthesis/thuthesis-numeric.bst b/macros/latex/contrib/thuthesis/thuthesis-numeric.bst index f667907095..b27da61efc 100644 --- a/macros/latex/contrib/thuthesis/thuthesis-numeric.bst +++ b/macros/latex/contrib/thuthesis/thuthesis-numeric.bst @@ -8,9 +8,9 @@ %% ------------------------------------------------------------------- %% GB/T 7714 BibTeX Style %% https://github.com/zepinglee/gbt7714-bibtex-style -%% Version: 2022/03/21 v2.1.4 +%% Version: 2024/03/08 v2.1.6 %% ------------------------------------------------------------------- -%% Copyright (C) 2016--2022 by Zeping Lee <zepinglee AT gmail.com> +%% Copyright (C) 2016--2024 by Zeping Lee <zepinglee AT gmail.com> %% ------------------------------------------------------------------- %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -39,6 +39,7 @@ INTEGERS { show.medium.type short.journal italic.journal + link.journal bold.journal.volume show.missing.address.publisher space.before.pages @@ -78,6 +79,7 @@ FUNCTION {load.config} "slash" 'component.part.label := #0 'short.journal := #0 'italic.journal := + #0 'link.journal := #0 'bold.journal.volume := #0 'show.missing.address.publisher := #1 'space.before.pages := @@ -735,7 +737,7 @@ FUNCTION {editor.full} FUNCTION {make.full.names} { type$ "book" = - type$ "inbook" = + type$ "inbook" = booktitle empty$ not and or 'author.editor.full { type$ "collection" = @@ -877,7 +879,7 @@ FUNCTION {format.volume} { volume is.number { entry.lang lang.zh = { "第 " volume * " 卷" * } - { "volume" volume tie.or.space.connect } + { "Vol." volume tie.or.space.connect } if$ } { volume } @@ -892,7 +894,7 @@ FUNCTION {format.number} { number is.number { entry.lang lang.zh = { "第 " number * " 册" * } - { "number" number tie.or.space.connect } + { "No." number tie.or.space.connect } if$ } { number } @@ -1057,7 +1059,7 @@ FUNCTION {get.journal.title} } FUNCTION {check.arxiv.preprint} -{ #1 #5 substring$ "l" change.case$ "arxiv" = +{ #1 #5 substring$ purify$ "l" change.case$ "arxiv" = { #1 } { #0 } if$ @@ -1070,6 +1072,10 @@ FUNCTION {format.journal} 'emphasize 'skip$ if$ + link.journal + 'add.link + 'skip$ + if$ } 'skip$ if$ @@ -1966,6 +1972,10 @@ FUNCTION {preprint} format.urldate "" output.after output.eprint output.url + show.preprint not eprint empty$ or + 'output.doi + 'skip$ + if$ new.block format.note output fin.entry @@ -2030,7 +2040,12 @@ FUNCTION {dataset} electronic } -FUNCTION {inbook} { book } +FUNCTION {inbook} { + booktitle empty$ + 'book + 'incollection + if$ +} FUNCTION {inproceedings} { "C" set.entry.mark @@ -2048,7 +2063,7 @@ FUNCTION {map} FUNCTION {manual} { monograph } -FUNCTION {mastersthesis} +FUNCTION {thesis} { "D" set.entry.mark monograph } @@ -2063,7 +2078,9 @@ FUNCTION {online} electronic } -FUNCTION {phdthesis} { mastersthesis } +FUNCTION {mastersthesis} { thesis } + +FUNCTION {phdthesis} { thesis } FUNCTION {proceedings} { "C" set.entry.mark @@ -2080,11 +2097,13 @@ FUNCTION {standard} misc } -FUNCTION {techreport} +FUNCTION {report} { "R" set.entry.mark misc } +FUNCTION {techreport} { report } + FUNCTION {unpublished} { misc } FUNCTION {default.type} { misc } @@ -2271,7 +2290,7 @@ FUNCTION {editor.key.organization.label} FUNCTION {calc.short.authors} { "" 'short.label := type$ "book" = - type$ "inbook" = + type$ "inbook" = booktitle empty$ not and or 'author.editor.key.label { type$ "collection" = diff --git a/macros/latex/contrib/thuthesis/thuthesis.dtx b/macros/latex/contrib/thuthesis/thuthesis.dtx index d88e3d2377..6e25d0cdfb 100644 --- a/macros/latex/contrib/thuthesis/thuthesis.dtx +++ b/macros/latex/contrib/thuthesis/thuthesis.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2005-2021 by Tsinghua University TUNA Association <tuna@tsinghua.edu.cn> +% Copyright (C) 2005-2024 by Tsinghua University TUNA Association <tuna@tsinghua.edu.cn> % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3c @@ -14,7 +14,7 @@ % % \iffalse %<*driver> -\ProvidesFile{thuthesis.dtx}[2023/05/15 7.4.0 Tsinghua University Thesis Template] +\ProvidesFile{thuthesis.dtx}[2024/03/29 7.5.0 Tsinghua University Thesis Template] \documentclass{ltxdoc} \usepackage{dtx-style} @@ -73,7 +73,7 @@ % 容。 % \item 本模板为作者根据 % 清华大学研究生院颁发的《 -% \href{http://yjsy.cic.tsinghua.edu.cn/docinfo/board/boarddetail.jsp?columnId=001050603&parentColumnId=0010506&itemSeq=5365}{% +% \href{https://info2021.tsinghua.edu.cn/f/info/xxfb_fg/xnzx/template/detail?xxid=fa880bdf60102a29fbe3c31f36b76c7e}{% % 研究生学位论文写作指南}》(更新到2023年3月版本,限校内网络访问)、 % 英文版《Guide to Thesis Writing for Graduate Students》、 % 清华大学教务处颁发的《 @@ -170,7 +170,6 @@ % thuthesis-*.cbx & BibLaTeX 参考文献引用样式文件\\ % tsinghua-name-bachelor.pdf & 校名 logo,本科生封面使用 \\\midrule % thuthesis-example.tex & 示例文档主文件\\ -% spine.tex & 书脊示例文档\\ % ref/ & 示例文档参考文献目录\\ % data/ & 示例文档章节具体内容\\ % figures/ & 示例文档图片路径\\ @@ -250,8 +249,8 @@ % \begin{shell} % $ xelatex thuthesis-example.tex % $ bibtex thuthesis-example.aux # 生成 bbl 文件 -% $ bibtex thuthesis-example-survey.aux # 本科生的调研报告的参考文献 -% $ bibtex thuthesis-example-translation.aux # 本科生的外文资料翻译的参考文献 +% $ bibtex thuthesis-example-appendix-a.aux # 附录 A 的的参考文献 +% $ bibtex thuthesis-example-appendix-b.aux # 附录 B 的的参考文献…… % $ bibtex thuthesis-example-index.aux # 本科生的书面翻译对应的原文索引 % $ xelatex thuthesis-example.tex # 解决引用 % $ xelatex thuthesis-example.tex # 生成论文 PDF @@ -259,9 +258,6 @@ % $ xelatex spine.tex # 生成书脊 PDF % \end{shell} % -% 在调用 \XeLaTeX 时,如果设置了 \option{include-spine} 选项, -% 则需要在文件名前加上 \texttt{-shell-escape} 的命令行选项。 -% % 下面的命令用来生成用户手册: % \begin{shell} % $ xelatex -shell-escape thuthesis.dtx @@ -345,6 +341,7 @@ % 中易宋体 & 华文宋体 & 思源宋体 & Fandol 宋体 \\ % 中易黑体 & 华文黑体 & 思源黑体 & Fandol 黑体 \\ % 中易仿宋 & 华文仿宋 & Fandol 仿宋 & Fandol 仿宋 \\ +% 中易楷体 & 华文楷体 & Fandol 楷体 & Fandol 楷体 \\ % \bottomrule % \end{tabular} % \end{table} @@ -355,6 +352,20 @@ % 关于字体的配置, % 详见 \pkg{fontspec}、\pkg{xeCJK}、\pkg{ctex} 等宏包的使用说明和代码。 % +% \DescribeOption{font} +% 配置全文使用的西文字体。所有可选项目为 \option{auto}(默认)、\option{times}、\option{termes}、 +% \option{stix}、\option{xits}、\option{libertinus}、\option{newcm}、\option{lm}、 +% \option{newtx}、\option{none}。 +% 通常来说,用户\textbf{不需要}调整此选项。 +% +% \DescribeOption{cjk-font} +% 配置全文使用的中文字体。所有可选项为 \option{auto}(默认)、\option{windows}、\option{windows-local}、 +% \option{mac}、\option{mac-word}、\option{noto}、\option{fandol} 和 \option{none}。 +% 通常来说,用户\textbf{不需要}调整此选项,模板会自动通过 \option{fontset} 选项选择合适的字体。 +% +% \DescribeOption{windows-font-dir} +% 配置搜索 Windows 字体的路径,仅适用于 Overleaf 等不方便全局安装字体的环境。如果此目录下能找到中易宋体, +% 则将自动使用这些字体编译。如有可能,始终建议全局安装相应字体,模板能够自动检测。 % % \subsection{论文设置} % 论文的设置可以通过统一命令 \cs{thusetup} 设置 \emph{key=value} 形式完成。 @@ -415,7 +426,7 @@ % % \subsubsection{开题报告} % \DescribeOption{thesis-type} -% 模板还支持博士生论文开题报告的格式,可以通过设置 \option{thesis-type=proposal} 得到。 +% 模板还支持本科生、研究生论文开题报告的格式,可以通过设置 \option{thesis-type=proposal} 得到。 % % 开题报告与学位论文有两点不同: % \begin{enumerate} @@ -528,7 +539,7 @@ % \end{latex} % % \subsubsection{学号} -% 学号,仅用于博士生论文开题报告。 +% 学号,仅用于本、研论文开题报告。 % \begin{latex} % \thusetup{ % student-id = {20000310000}, @@ -554,11 +565,10 @@ % } % \end{latex} % -% \myentry{联合导师} -% 硕士生、本科生联合指导教师,博士生联合导师。 +% \myentry{联合指导教师} % \begin{latex} % \thusetup{ -% co-supervisor = {联合导师姓名, 教授}, +% co-supervisor = {联合指导教师姓名, 教授}, % co-supervisor* = {Professor Join-Supervisor Name}, % } % \end{latex} @@ -1234,12 +1244,7 @@ % } % \end{latex} % 打开此选项后,书籍会出现在中文封面后面的第一个空白页。如果有英文封面,则在英文封面之前。 -% 如果需要书籍出现在其他位置,请手工使用 \cs{spine} 生成,不要使用此命令。 -% -% 在使用 Fandol 仿宋时,如果打开 \option{include-spine} 选项, -% 模板将使用 \cs{write18} 来生成独立的 \file{spine.tex},并调用 \XeLaTeX 进行排版后插入论文中。 -% 在这种情况下,请确保编译时打开了 shell escape 功能,或者在论文目录下放置编译完成的 \file{spine.pdf}, -% 否则编译将因为无法正常生成书脊而失败。 +% 如果需要书籍出现在其他位置,请手工使用 \cs{spine} 生成,不要使用此选项。 % % \section{致谢} % \label{sec:thanks} @@ -1264,7 +1269,7 @@ % \begin{macrocode} %<cls>\NeedsTeXFormat{LaTeX2e}[2017/04/15] %<cls>\ProvidesClass{thuthesis} -%<cls>[2023/05/15 7.4.0 Tsinghua University Thesis Template] +%<cls>[2024/03/29 7.5.0 Tsinghua University Thesis Template] % \end{macrocode} % % 报错 @@ -1275,6 +1280,9 @@ \newcommand\thu@warning[1]{% \ClassWarning{thuthesis}{#1}% } +\newcommand\thu@debug[1]{% + \typeout{Package thuthesis Info: #1}% +} \newcommand\thu@patch@error[1]{% \thu@error{Failed to patch command \protect#1}% } @@ -1322,7 +1330,7 @@ %<*cls> \hyphenation{Thu-Thesis} \def\thuthesis{ThuThesis} -\def\version{7.4.0} +\def\version{7.5.0} \RequirePackage{kvdefinekeys} \RequirePackage{kvsetkeys} \RequirePackage{kvoptions} @@ -1556,6 +1564,7 @@ choices = { auto, windows, + windows-local, mac, mac-word, noto, @@ -1564,6 +1573,10 @@ }, default = auto, }, + windows-font-dir = { + name = windows@font@dir, + default = {.}, + }, math-font = { name = math@font, choices = { @@ -2245,13 +2258,14 @@ \thusetup{system = windows} } } + \thu@debug{Detected system: \thu@system} \fi % \end{macrocode} % % 使用 \pkg{fontspec} 配置字体。 % \begin{macrocode} -\newcommand\thu@mac@word@font@path{% - /Applications/Microsoft Word.app/Contents/Resources/DFonts/% +\newcommand\thu@mac@word@font@dir{% + /Applications/Microsoft Word.app/Contents/Resources/DFonts% } \ifthu@fontset@auto \ifthu@system@windows @@ -2260,21 +2274,26 @@ \IfFontExistsTF{SimSun}{ \thusetup{fontset = windows} }{ - \IfFileExists{\thu@mac@word@font@path/SimSun.ttf}{ - \thusetup{fontset = windows} + \IfFileExists{\thu@windows@font@dir/Simsun.ttc}{ + \thusetup{fontset = windows, cjk-font = windows-local} }{ - \ifthu@system@mac - \thusetup{fontset = mac} - \else - \IfFontExistsTF{Noto Serif CJK SC}{ - \thusetup{fontset = ubuntu} - }{ - \thusetup{fontset = fandol} - } - \fi + \IfFileExists{\thu@mac@word@font@dir/Simsun.ttc}{ + \thusetup{fontset = windows, cjk-font = mac-word} + }{ + \ifthu@system@mac + \thusetup{fontset = mac} + \else + \IfFontExistsTF{Noto Serif CJK SC}{ + \thusetup{fontset = ubuntu} + }{ + \thusetup{fontset = fandol} + } + \fi + } } } \fi + \thu@debug{Detected fontset: \thu@fontset} \fi % \end{macrocode} % @@ -2536,15 +2555,6 @@ % % \subsubsection{中文字体} % -% 去掉“no requested script”警告。 -% \begin{macrocode} -\ExplSyntaxOn -\@ifpackageloaded { xeCJK } - { \msg_redirect_name:nnn { fontspec } { no-script } { info } } - { } -\ExplSyntaxOff -% \end{macrocode} -% % \begin{macrocode} \ifthu@cjk@font@auto \ifthu@fontset@mac @@ -2554,10 +2564,14 @@ \IfFontExistsTF{SimSun}{ \thusetup{cjk-font = windows} }{ - \IfFileExists{\thu@mac@word@font@path/SimSun.ttf}{ - \thusetup{cjk-font = mac-word} + \IfFileExists{\thu@windows@font@dir/Simsun.ttc}{ + \thusetup{cjk-font = windows-local} }{ - \thu@error{Cannot find "SimSun" font} + \IfFileExists{\thu@mac@word@font@dir/Simsun.ttc}{ + \thusetup{cjk-font = mac-word} + }{ + \thu@error{Cannot find "SimSun" font} + } } } \else @@ -2568,6 +2582,7 @@ \fi \fi \fi + \thu@debug{Detected CJK font: \thu@cjk@font} \fi % \end{macrocode} % @@ -2587,35 +2602,86 @@ } % \end{macrocode} % -% macOS 的 Microsoft Word 字体。 -% \begin{macrocode} -\@namedef{thu@set@cjk@font@mac-word}{% - \setCJKmainfont{SimSun}[% - Path = \thu@mac@word@font@path, - AutoFakeBold = 3, - ItalicFont = KaiTi, - ]% +% 使用本地的 Windows 字体文件。 +% +% Windows 的中易楷体和仿宋字体文件名分别为 \file{Simkai.ttf} 和 +% \file{Simfang.ttf}(见 +% \url{https://learn.microsoft.com/en-us/typography/fonts/windows_11_font_list}), +% 而 macOS 版 Word 对应的字体名为 \file{Kaiti.ttf} 和 \file{Fangsong.ttf}。 +% 所以需要进行判断。 +% \begin{macrocode} +\@namedef{thu@set@cjk@font@windows-local}{% + \IfFileExists{\thu@windows@font@dir/Kaiti.ttf}{ + \setCJKmainfont{SimSun}[% + Path = \thu@windows@font@dir/, + Extension = .ttc, + AutoFakeBold = 3, + ItalicFont = Kaiti, + ItalicFeatures = {Extension = .ttf}, + ]% + \setCJKmonofont{Fangsong}[ + Path = \thu@windows@font@dir/, + Extension = .ttf, + ]% + \setCJKfamilyfont{zhkai}{Kaiti}[ + Path = \thu@windows@font@dir/, + Extension = .ttf, + ]% + \setCJKfamilyfont{zhfs}{Fangsong}[ + Path = \thu@windows@font@dir/, + Extension = .ttf, + ]% + }{ + \setCJKmainfont{SimSun}[% + Path = \thu@windows@font@dir/, + Extension = .ttc, + AutoFakeBold = 3, + ItalicFont = Simkai, + ItalicFeatures = {Extension = .ttf}, + ]% + \setCJKmonofont{Simfang}[ + Path = \thu@windows@font@dir/, + Extension = .ttf, + ]% + \setCJKfamilyfont{zhkai}{Simkai}[ + Path = \thu@windows@font@dir/, + Extension = .ttf, + ]% + \setCJKfamilyfont{zhfs}{Simfang}[ + Path = \thu@windows@font@dir/, + Extension = .ttf, + ]% + } \setCJKsansfont{SimHei}[% - Path = \thu@mac@word@font@path, + Path = \thu@windows@font@dir/, + Extension = .ttf, AutoFakeBold = 3, ]% - \setCJKmonofont{FangSong}[Path=\thu@mac@word@font@path]% \setCJKfamilyfont{zhsong}{SimSun}[% - Path = \thu@mac@word@font@path, + Path = \thu@windows@font@dir/, + Extension = .ttc, AutoFakeBold = 3, ]% \setCJKfamilyfont{zhhei}{SimHei}[% - Path = \thu@mac@word@font@path, + Path = \thu@windows@font@dir/, + Extension = .ttf, AutoFakeBold = 3, ]% - \setCJKfamilyfont{zhkai}{KaiTi}[Path = \thu@mac@word@font@path]% - \setCJKfamilyfont{zhfs}{FangSong}[Path = \thu@mac@word@font@path]% +} +% \end{macrocode} +% +% macOS 的 Microsoft Word 字体。 +% \begin{macrocode} +\@namedef{thu@set@cjk@font@mac-word}{% + \let\thu@windows@font@dir\thu@mac@word@font@dir + \@nameuse{thu@set@cjk@font@windows-local}% } % \end{macrocode} % % macOS 的华文字体。 % \begin{macrocode} \newcommand\thu@set@cjk@font@mac{% + \defaultCJKfontfeatures{}% \setCJKmainfont{Songti SC}[ UprightFont = * Light, BoldFont = * Bold, @@ -2652,19 +2718,30 @@ % 注意 Noto CJK 的 regular 字重名字不带“Regular”。 % \begin{macrocode} \newcommand\thu@set@cjk@font@noto{% + \defaultCJKfontfeatures{}% \setCJKmainfont{Noto Serif CJK SC}[ UprightFont = * Light, BoldFont = * Bold, ItalicFont = FandolKai-Regular, ItalicFeatures = {Extension = .otf}, + Script = CJK, + ]% + \setCJKsansfont{Noto Sans CJK SC}[ + BoldFont = * Medium, + Script = CJK, + ]% + \setCJKmonofont{Noto Sans Mono CJK SC}[ + Script = CJK, ]% - \setCJKsansfont{Noto Sans CJK SC}[BoldFont = * Medium]% - \setCJKmonofont{Noto Sans Mono CJK SC}% \setCJKfamilyfont{zhsong}{Noto Serif CJK SC}[ UprightFont = * Light, UprightFont = * Bold, + Script = CJK, + ]% + \setCJKfamilyfont{zhhei}{Noto Sans CJK SC}[ + BoldFont = * Medium, + Script = CJK, ]% - \setCJKfamilyfont{zhhei}{Noto Sans CJK SC}[BoldFont = * Medium]% \setCJKfamilyfont{zhfs}{FandolFang}[ Extension = .otf, UprightFont = *-Regular, @@ -2679,6 +2756,7 @@ % Fandol 字体。 % \begin{macrocode} \newcommand\thu@set@cjk@font@fandol{% + \defaultCJKfontfeatures{}% \setCJKmainfont{FandolSong}[ Extension = .otf, UprightFont = *-Regular, @@ -3510,8 +3588,7 @@ {}{\thu@patch@error{\@getpen}} % \end{macrocode} % -% 下面这组命令使浮动对象的缺省值稍微宽松一点,从而防止幅度对象占据过多的文本页面, -% 也可以防止在很大空白的浮动页上放置很小的图形。 +% 将浮动参数设为较宽松的值。 % \begin{macrocode} \renewcommand{\textfraction}{0.15} \renewcommand{\topfraction}{0.85} @@ -4019,8 +4096,8 @@ % % 研究生: % \begin{enumerate} -% \item 目录中的章标题行采用黑体小四号字,固定行距 20 磅,段前空 6 磅, -% 段后 0 磅;其他内容采用宋体小四号字,行距为固定值 20 磅, +% \item 目录中的章标题行采用黑体小四号字,固定行距 20 磅,段前段后 0 磅; +% 其他内容采用宋体小四号字,行距为固定值 20 磅, % 段前、段后均为 0 磅。 % \item 目录中的章标题行居左书写,一级节标题行缩进 1 个汉字符, % 二级节标题行缩进 2 个汉字符。 @@ -4032,7 +4109,7 @@ \else \ifthu@main@language@chinese \titlecontents{chapter} - [\z@]{\addvspace{6bp}\sffamily} + [\z@]{\sffamily} {\contentspush{\thecontentslabel\quad}}{} {\rmfamily\thu@leaders\thecontentspage}% \titlecontents{section} @@ -4045,7 +4122,7 @@ {\thu@leaders\thecontentspage}% \else \titlecontents{chapter} - [\z@]{\addvspace{6bp}\heiti} + [\z@]{\heiti} {\contentspush{\MakeUppercase{\thecontentslabel}\space}\MakeUppercase}{\MakeUppercase} {\rmfamily\thu@leaders\thecontentspage}% \titlecontents{section} @@ -4343,19 +4420,8 @@ \stepcounter{thu@csl@count}% } \newcommand\thu@name@title@format[2]{% - \ifthu@degree@type@professional - % 字距 9.8bp,共 16bp * 3 + 9.8bp * 2 = 67.5bp - \thu@stretch{67.6bp}{#1}% - \hspace{9.8bp}% - % 字距 6bp - \begingroup - \renewcommand\CJKglue{\hspace{9.8bp}}% - #2% - \endgroup - \else - \thu@pad{3cm}{\thu@stretch{4em}{#1}}% - \thu@stretch{3em}{#2}% - \fi + \thu@pad{3cm}{\thu@stretch{4em}{#1}}% + \thu@stretch{3em}{#2}% } \newcommand\thu@name@title[1]{% \setcounter{thu@csl@count}{0}% @@ -4376,7 +4442,7 @@ \thu@pdfbookmark{-1}{\thu@title}% \thu@titlepage \ifthu@include@spine@true - \thu@spine + \spine \fi \ifthu@degree@graduate \ifthu@thesis@type@thesis @@ -4392,44 +4458,27 @@ % \begin{macro}{\thu@titlepage} % 中文封面(题名页) % -% 研究生的中文封面分“学术型”和“专业型”两种 layout,但是“工程硕士”跟“学术型” 的 -% layout 一样,所以按照 \cs{thu@discipline}(工程领域)是否为空来区分“工程硕士”。 % \begin{macrocode} \newcommand\thu@titlepage{% \thusetup{language = chinese}% \ifthu@degree@graduate + % 研究生 \ifthu@thesis@type@thesis - \ifthu@degree@type@academic - \ifthu@degree@doctor - \thu@titlepage@doctor@academic - \else - \thu@titlepage@master@academic - \fi - \else - \ifthu@degree@doctor - \thu@titlepage@doctor@professional - \else - \ifx\thu@professional@field\@empty - \ifx\thu@engineering@field\@empty - \thu@titlepage@master@professional@without@field - \else - \thu@titlepage@master@professional@with@field - \fi - \else - \thu@titlepage@master@professional@with@field - \fi - \fi - \fi + % 学位论文 + \thu@titlepage@thesis \else \ifthu@thesis@type@proposal + % 选题报告 \thu@titlepage@proposal \fi \fi \else \ifthu@degree@bachelor + % 本科生 \thu@titlepage@bachelor \else \ifthu@degree@postdoc + % 博后 \thu@cover@postdoc \cleardoublepage \thu@titlepage@postdoc @@ -4447,7 +4496,7 @@ % 然而作为事实标准的 Word 模板的页边距是上下 6.0 厘米,左右 4.0 厘米。 % 这里缩小上边距以方便排版保密信息。 % \begin{macrocode} -\newcommand\thu@titlepage@doctor@academic{% +\newcommand\thu@titlepage@thesis{% \newgeometry{ top = 2cm, bottom = 6cm, @@ -4475,218 +4524,21 @@ \vskip -9.2pt% \fi \vskip 24.1pt% - \thu@titlepage@degree\par - \vfill - \parbox[t][7.25cm][t]{\textwidth}{% - \fangsong\fontsize{16bp}{31.2bp}\selectfont - \thu@titlepage@info - }\par - \parbox[t][1.03cm][t]{\textwidth}{\centering\thu@titlepage@date}\par - \endgroup - \clearpage - \restoregeometry -} -% \end{macrocode} -% -% 专业型学位论文中文封面 -% \begin{macrocode} -\newcommand\thu@titlepage@doctor@professional{% - \newgeometry{ - top = 2cm, - bottom = 6cm, - hmargin = 3.5cm, - }% - \thispagestyle{empty}% - \null\vskip 0.45cm% - \begingroup - \centering - \parbox[t][1.52cm][t]{\textwidth}{% - \hskip -0.69cm% - \thu@titlepage@secret - }\par - \vskip 1.5cm% - \begingroup - % 1.21 倍行距,无网格 - \sffamily\fontsize{26bp}{40.9bp}\selectfont - \thu@title\par - \endgroup - \ifthu@main@language@english - \vskip 5.4pt% - \begingroup - \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont - \thu@title@en\par - \endgroup - \vskip -9.2pt% - \fi - \vskip 25.5pt% - \thu@titlepage@degree - \vfill - \parbox[b][5.24cm][b]{\textwidth}{% - \fangsong\fontsize{16bp}{1cm}\selectfont - \thu@titlepage@info - }\par - \vskip 2.22cm% - \parbox[t][1.0cm][t]{\textwidth}{\centering\thu@titlepage@date}\par - \endgroup - \clearpage - \restoregeometry -} -% \end{macrocode} -% -% 学术型硕士 -% \begin{macrocode} -\newcommand\thu@titlepage@master@academic{% - \newgeometry{ - top = 2cm, - bottom = 6cm, - hmargin = 3.5cm, - }% - \thispagestyle{empty}% - \null\vskip 10bp% - \begingroup - \centering - \parbox[t][55bp][t]{\textwidth}{% - \hskip -23bp% - \thu@titlepage@secret - }\par - \vskip 34pt% - \begingroup - % 1.21 倍行距 - \sffamily\fontsize{26bp}{40.898bp}\selectfont - \thu@title\par - \endgroup - \ifthu@main@language@english - \vskip 5.4pt% - \begingroup - \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont - \thu@title@en\par - \endgroup - \vskip -9.2pt% - \fi - \vskip 18pt% - \thu@titlepage@degree\par - \vfill - \parbox[t][7.05cm][t]{\textwidth}{% - % 表格行高 1cm = 28.35bp - \fangsong\fontsize{16bp}{28.35bp}\selectfont - \thu@titlepage@info - }\par - \parbox[t][37bp][t]{\textwidth}{\centering\thu@titlepage@date}\par - \endgroup - \clearpage - \restoregeometry -} -% \end{macrocode} -% -% 专业型硕士 -% \begin{macrocode} -\newcommand\thu@titlepage@master@professional@without@field{% - \newgeometry{ - top = 2cm, - bottom = 6cm, - hmargin = 3.5cm, - }% - \thispagestyle{empty}% - \null\vskip 15bp% - \begingroup - \centering - \parbox[t][41bp][t]{\textwidth}{% - \hskip -23bp% - \thu@titlepage@secret - }\par - \vskip 1.5cm% - \begingroup - % 1.21 倍行距,无网格 - \sffamily\fontsize{26bp}{40.9bp}\selectfont - \thu@title\par - \endgroup - \ifthu@main@language@english - \vskip 5.4pt% - \begingroup - \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont - \thu@title@en\par - \endgroup - \vskip -9.2pt% - \fi - \vskip 25.5pt% - \thu@titlepage@degree + \thu@title@page@degree@category\par \vfill - \parbox[b][5.24cm][b]{\textwidth}{% - \fangsong\fontsize{16bp}{1cm}\selectfont - \thu@titlepage@info - }\par - \vskip 2.22cm% - \parbox[t][35.5bp][t]{\textwidth}{\centering\thu@titlepage@date}\par - \endgroup - \clearpage - \restoregeometry -} -% \end{macrocode} -% -% 专业型硕士(有专业领域) -% \begin{macrocode} -\newcommand\thu@titlepage@master@professional@with@field{% - \newgeometry{ - top = 2cm, - bottom = 6cm, - hmargin = 3.5cm, - }% - \thispagestyle{empty}% - \null\vskip 10bp% - \begingroup - \centering - \parbox[t][46bp][t]{\textwidth}{% - \hskip -23bp% - \thu@titlepage@secret - }\par - \vskip 1.5cm% - \begingroup - % 1.21 倍行距,无网格 - \sffamily\fontsize{26bp}{40.9bp}\selectfont - \thu@title\par - \endgroup - \ifthu@main@language@english - \vskip 5.4pt% - \begingroup - \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont - \thu@title@en\par - \endgroup - \vskip -9.2pt% - \fi - \vskip 25.5pt% - \thu@titlepage@degree - \vskip 119bp% - \parbox[b][5.24cm][b]{\textwidth}{% - \fangsong\fontsize{16bp}{31bp}\selectfont - \renewcommand\thu@info@item@format[2]{% - \begingroup - \renewcommand\CJKglue{\hspace{##1}}% - ##2% - \endgroup - }% - \renewcommand\thu@name@title@format[2]{% - % 字距 9bp,共 16bp * 3 + 9bp * 2 = 66bp - \thu@stretch{66bp}{##1}% - \hspace{22bp}% - % 字距 6bp - \begingroup - \renewcommand\CJKglue{\hspace{16bp}}% - ##2% - \endgroup - }% - \thu@titlepage@info@tabular{65bp}{86.5bp}{81bp}{30.5bp}{% - \thu@info@item{培养单位}{\thu@info@item@format{1bp}}{\thu@department}% - \thu@info@item{专业领域}{\thu@info@item@format{2bp}}{\thu@professional@field}% - \thu@info@item{工程领域}{\thu@info@item@format{2bp}}{\thu@engineering@field}% - \thu@info@item{申请人}{\thu@name@title}{\thu@author}% - \thu@info@item{学号}{}{\thu@student@id}% - \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% - \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% + \ifthu@degree@type@academic + \parbox[t][7.25cm][t]{\textwidth}{% + \fangsong\fontsize{16bp}{31.2bp}\selectfont + \thu@titlepage@info }\par - }\par - \vfill - \parbox[t][33.5bp][t]{\textwidth}{\centering\thu@titlepage@date}\par + \else + \parbox[t][5.25cm][b]{\textwidth}{% + \fangsong\fontsize{16bp}{31.2bp}\selectfont + \thu@titlepage@info + }\par + \vskip 62pt% + \fi + \parbox[t][1.03cm][t]{\textwidth}{\centering\thu@titlepage@date}\par \endgroup \clearpage \restoregeometry @@ -4713,7 +4565,7 @@ \thu@title\par }% \vskip 0.85cm% - \thu@titlepage@degree + \thu@title@page@degree@category \vfill \parbox[t][8.5cm][t]{\textwidth}{% \centering @@ -4742,6 +4594,7 @@ \thu@option@hook{thesis-type}{\thu@set@student@id} % \end{macrocode} % +% 涉密信息 % \begin{macrocode} \newcommand\thu@titlepage@secret{% \sffamily\sanhao @@ -4753,12 +4606,12 @@ } % \end{macrocode} % -% 申请学位的学科门类: 小二号宋体字,字距延伸 0.5bp, +% 申请学位的学科门类或专业学位类别: 三号(16bp)宋体字,字距延伸 0.5bp, % 所以 \cs{CJKglue} 应该设为 1 bp。 % \begin{macrocode} -\newcommand\thu@titlepage@degree{% +\newcommand\thu@title@page@degree@category{% \begingroup - \xiaoer + \fontsize{16bp}{22bp}\selectfont \ifLuaTeX \fontspec{\CJK@family}% \ltjsetparameter{kanjiskip = {1bp}}% @@ -4790,38 +4643,32 @@ } % \end{macrocode} % -% 作者及导师信息部分使用三号仿宋字 +% 作者及指导教师信息 % \begin{macrocode} \newcommand\thu@titlepage@info{% - \ifthu@degree@doctor - \ifthu@degree@type@academic - \thu@titlepage@info@doctor@academic - \else - \thu@titlepage@info@doctor@professional - \fi - \else + \thu@titlepage@info@tabular{2.3cm}{2.85cm}{2.75cm}{0.77cm}{% + \thu@info@item{培养单位}{}{\thu@department}% \ifthu@degree@type@academic - \thu@titlepage@info@master@academic + \thu@info@item{学科}{}{\thu@discipline}% + \thu@info@item{研究生}{\thu@name@title}{\thu@author}% \else - \ifx\thu@professional@field\@empty - \ifx\thu@engineering@field\@empty - \thu@titlepage@info@master@professional@without@field - \else - \thu@titlepage@info@master@professional@with@field - \fi - \else - \thu@titlepage@info@master@professional@with@field - \fi + \thu@info@item{专业领域}{}{\thu@professional@field}% + \thu@info@item{工程领域}{}{\thu@engineering@field}% + \thu@info@item{申请人}{\thu@name@title}{\thu@author}% \fi - \fi + \thu@info@item{学号}{}{\thu@student@id}% + \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% + \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% + \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% + }\par } % \end{macrocode} % % 标题页作者信息表 % \texttt{\#1}: 表格左侧至版心的距离;\\ -% \texttt{\#2}: “培养方案”的边框宽度;\\ -% \texttt{\#3}: “培养方案”的文字宽度;\\ -% \texttt{\#4}: 冒号的边框;\\ +% \texttt{\#2}: “培养单位”的边框宽度;\\ +% \texttt{\#3}: “培养单位”的文字宽度;\\ +% \texttt{\#4}: 冒号的边框;\\ % \texttt{\#5}: 表格内容。 % \begin{macrocode} \newcommand\thu@titlepage@info@tabular[5]{% @@ -4838,85 +4685,6 @@ #5% \end{tabular}% } -\newcommand\thu@info@item@format[1]{#1} -\newcommand\thu@titlepage@info@doctor@academic{% - \thu@titlepage@info@tabular{2.3cm}{2.85cm}{2.75cm}{0.77cm}{% - \thu@info@item{培养单位}{}{\thu@department}% - \thu@info@item{学科}{}{\thu@discipline}% - \thu@info@item{研究生}{\thu@name@title}{\thu@author}% - \thu@info@item{学号}{}{\thu@student@id}% - \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% - \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合导师}{\thu@name@title}{\thu@co@supervisor}% - }\par -} -\newcommand\thu@titlepage@info@doctor@professional{% - \thu@titlepage@info@tabular{2.3cm}{3.1cm}{5em}{1.42cm}{% - \thu@info@item{培养单位}{}{{\thu@department}}% - \thu@info@item{申请人}{\thu@name@title}{\thu@author}% - \thu@info@item{学号}{}{\thu@student@id}% - \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% - \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% - }\par -} -\newcommand\thu@titlepage@info@master@academic{% - \renewcommand\thu@info@item@format[2]{% - \begingroup - \renewcommand\CJKglue{\hspace{##1}}% - ##2% - \endgroup - } - \renewcommand\thu@name@title@format[2]{% - % 字距 9.8bp,共 16bp * 3 + 9.8bp * 2 = 67.5bp - \thu@stretch{67.6bp}{##1}% - \hspace{9.8bp}% - % 字距 6bp - \begingroup - \renewcommand\CJKglue{\hspace{6bp}}% - ##2% - \endgroup - }% - \thu@titlepage@info@tabular{58bp}{3.59cm}{5.5em}{0.82cm}{% - \thu@info@item{培养单位}{\thu@info@item@format{1bp}}{\thu@department}% - \thu@info@item{学科}{\thu@info@item@format{2bp}}{\thu@discipline}% - \thu@info@item{研究生}{\thu@name@title}{\thu@author}% - \thu@info@item{学号}{}{\thu@student@id}% - \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% - \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% - }\par -} -% 无专业领域 -\newcommand\thu@titlepage@info@master@professional@without@field{% - \renewcommand\thu@info@item@format[2]{% - \begingroup - \renewcommand\CJKglue{\hspace{##1}}% - ##2% - \endgroup - } - \renewcommand\thu@name@title@format[2]{% - % 字距 9.8bp,共 16bp * 3 + 9.8bp * 2 = 67.5bp - \thu@stretch{67.6bp}{##1}% - \hspace{9.8bp}% - % 字距 6bp - \begingroup - \renewcommand\CJKglue{\hspace{6bp}}% - ##2% - \endgroup - }% - \thu@titlepage@info@tabular{58bp}{3.28cm}{5em}{1.52cm}{% - \thu@info@item{培养单位}{\thu@info@item@format{1bp}}{\thu@department}% - \thu@info@item{申请人}{\thu@name@title}{\thu@author}% - \thu@info@item{学号}{}{\thu@student@id}% - \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% - \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% - }\par -} -% 有专业领域 -\newcommand\thu@titlepage@info@master@professional@with@field{% -} % \end{macrocode} % % 论文成文打印的日期,用三号宋体汉字,字距延伸 0.5bp, @@ -4974,6 +4742,7 @@ {\sffamily\bfseries\thu@author@en\par}% \vskip 0.18cm% \parbox[t][3.0cm][t]{\textwidth}{% + \centering \xiaosan[2.1]% \thu@titlepage@en@supervisor }\par @@ -5002,6 +4771,7 @@ \vskip 1.1cm% \fi \parbox[t][3.37cm][t]{\textwidth}{% + \centering \xiaosan[1.82]% \thu@titlepage@en@supervisor }\par @@ -5035,7 +4805,6 @@ {\sffamily\bfseries\thu@degree@category@en\par}% } \newcommand\thu@titlepage@en@supervisor{% - \hspace{1.27cm}% \begin{tabular}{r@{\makebox[20.5bp][l]{\hspace{2bp}:}}l}% \renewcommand\arraystretch{1}% \thu@thesis@name@en{} Supervisor & \thu@supervisor@en \\ @@ -5088,7 +4857,11 @@ \centering \includegraphics{tsinghua-name-bachelor.pdf}% \vskip 0.94cm% - {\sffamily\bfseries\xiaochu\ziju{0.5}综合论文训练\par}% + \ifthu@thesis@type@proposal + {\sffamily\bfseries\xiaochu\ziju{0.5}综合论文训练\\开题报告\par}% + \else + {\sffamily\bfseries\xiaochu\ziju{0.5}综合论文训练\par}% + \fi \endgroup \vskip 1.8cm% \begingroup @@ -5858,6 +5631,7 @@ % \begin{macrocode} \@namedef{bibstyle@thuthesis-numeric}{\citestyle{super}} \@namedef{bibstyle@thuthesis-author-year}{\citestyle{author-year}} + \@namedef{bibstyle@cell}{\citestyle{author-year}} \@namedef{bibstyle@thuthesis-bachelor}{\citestyle{super}} % \end{macrocode} % @@ -6332,60 +6106,142 @@ \newcommand\thu@end@appendix@ref@section{} % \end{macrocode} % -% 如果正文和附录引用了同一文献,\pkg{bibunits} 会给出无意义的警告,这里消除警告。 % \begin{macrocode} +% \end{macrocode} +% +% \pkg{bibunits} 在载入时会保存 \cs{bibliography} 和 \cs{bibliographystyle}, +% 所以在载入宏包前修改定义。 +% \begin{macrocode} +\AtBeginOfPackageFile*{bibunits}{ + \def\bibliography#1{% + \if@filesw + \immediate\write\@auxout{\string\bibdata{\zap@space#1 \@empty}}% +% \end{macrocode} +% +% 正文的 \cs{bibliography} 同时设置附录参考文献的默认 \file{.bib} 数据库。 +% \begin{macrocode} + \immediate\write\@auxout{\string\gdef\string\bu@bibdata{#1}}% + \fi + \@input@{\jobname.bbl}% + \gdef\bu@bibdata{#1}% + } + \def\bibliographystyle#1{% + \ifx\@begindocumenthook\@undefined\else + \expandafter\AtBeginDocument + \fi + {\if@filesw + \immediate\write\@auxout{\string\bibstyle{#1}}% +% \end{macrocode} +% +% 正文的 \cs{bibliographystyle} 同时设置附录参考文献的默认 \file{.bst} 样式。 +% \begin{macrocode} + \immediate\write\@auxout{\string\gdef\string\bu@bibstyle{#1}}% + \fi}% + \gdef\bu@bibstyle{#1}% + } +} \AtEndOfPackageFile*{bibunits}{ - \ifthu@degree@graduate - \newcommand\thu@appendix@bib@num@format[1]{[\@Alph\c@chapter.#1]\hfill} - \g@addto@macro\appendix{% - \renewcommand\@bibunitname{\jobname-appendix-\@alph\c@chapter}% - \bibliographyunit[\chapter]% + \def\@startbibunit{% + \global\let\@startbibunitorrelax\relax + \global\let\@finishbibunit\@finishstartedbibunit + \global\advance\@bibunitauxcnt 1 + \if@filesw + {\endlinechar-1 +% \end{macrocode} +% +% 使附录 aux 文件的 \cs{gdef}\cs{@localbibstyle} 能够生效。 +% \begin{macrocode} + \makeatletter + \@input{\@bibunitname.aux}}% + \immediate\openout\@bibunitaux\@bibunitname.aux + \immediate\write\@bibunitaux{\string\bibstyle{\@localbibstyle}}% + \fi + } + \def\bu@bibliography#1{% + \putbib[#1]% + } + \def\bu@bibliographystyle#1{% + \if@filesw + \immediate\write\@bibunitaux{\string\gdef\string\@localbibstyle{#1}}% + \fi + \gdef\@localbibstyle{#1}% + } + \providecommand\printbibliography{\putbib\relax}% + \g@addto@macro\appendix{% + \renewcommand\@bibunitname{\jobname-appendix-\@alph\c@chapter}% + \bibliographyunit[\chapter]% + \renewcommand\bibsection{% + \ctexset{section/numbering = false}% + \section{\bibname}% + \ctexset{section/numbering = true}% + }% +% \end{macrocode} +% +% 研究生附录的引用编号加前缀,如附录 A 的引用 [1] 为 [A.1]。 +% \begin{macrocode} + \ifthu@degree@graduate \renewcommand\citenumfont{\@Alph\c@chapter.}% - \renewcommand\bibsection{% - \ctexset{section/numbering = false}% - \section{\bibname}% - \ctexset{section/numbering = true}% - }% \renewcommand\@extra@binfo{@-\@alph\c@chapter}% \renewcommand\@extra@b@citeb{@-\@alph\c@chapter}% - \let\bibnumfmt\thu@appendix@bib@num@format - \let\bibliographystyle\defaultbibliographystyle - \let\bibliography\thu@appendix@bibliography - } - \renewcommand\thu@end@appendix@ref@section{% - \bibliographyunit\relax - } - \providecommand\printbibliography{\putbib\relax}% - \AtEndDocument{\thu@end@appendix@ref@section} + \renewcommand\bibnumfmt[1]{[\@Alph\c@chapter.#1]\hfill}% + \fi + } + \renewcommand\thu@end@appendix@ref@section{% + \bibliographyunit\relax + } + \AtEndDocument{\thu@end@appendix@ref@section} + \renewcommand\thu@set@survey@bibheading{% + \renewcommand\bibsection{% + \par + \vskip 20bp% + \thu@pdfbookmark{1}{\bibname}% + \begingroup + \centering + \xiaosi[1.667]\bibname\par + \endgroup + \vskip 6bp% + }% + }% % \end{macrocode} % % 如果正文和附录引用了同一文献,\pkg{bibunits} 会给出无意义的警告,这里消除警告。 % \begin{macrocode} - % \let\@xtestdef\@gobbletwo % This doesn't work - \def\bibunits@rerun@warning{\relax} - \fi + % \let\@xtestdef\@gobbletwo % This doesn't work + \def\bibunits@rerun@warning{\relax} } \PassOptionsToPackage{defernumbers = true}{biblatex} \AtEndOfPackageFile*{biblatex}{ - \ifthu@degree@graduate - \DeclareRefcontext{appendix}{} - \g@addto@macro\appendix{% - \pretocmd\chapter{% - \newrefsection + \DeclareRefcontext{appendix}{} + \g@addto@macro\appendix{% + \pretocmd\chapter{% + \newrefsection + \ifthu@degree@bachelor\else \@tempcnta=\c@chapter \advance\@tempcnta\@ne \newrefcontext[labelprefix = {\@Alph\@tempcnta.}]{appendix}% - }{}{\thu@patch@error{\chapter}}% - \defbibheading{bibliography}[\bibname]{% - \ctexset{section/numbering = false}% - \section{#1}% - \ctexset{section/numbering = true}% - }% - } - % \renewcommand\thu@end@appendix@ref@section{% - % \endrefsection - % } - \fi + \fi + }{}{\thu@patch@error{\chapter}}% + \defbibheading{bibliography}[\bibname]{% + \ctexset{section/numbering = false}% + \section{#1}% + \ctexset{section/numbering = true}% + }% + } + \renewcommand\thu@set@survey@bibheading{% + \defbibheading{bibliography}[\bibname]{% + \par + \vskip 20bp% + \thu@pdfbookmark{1}{\bibname}% + \begingroup + \centering + \xiaosi[1.667]##1\par + \endgroup + \vskip 6bp% + }% + }% + \def\bibliographystyle#1{% + \thu@warning{'bibliographystyle' invalid for 'biblatex'.}% + } } % \end{macrocode} % @@ -6424,18 +6280,14 @@ \vskip 20bp% }% \let\appendix\thu@appendix@appendix + \thu@set@survey@bibheading \renewcommand\bibname{参考文献}% - \let\bibsection\thu@appendix@bibsection - \renewcommand\@bibunitname{\jobname-survey}% - \let\bibliographystyle\defaultbibliographystyle - \let\bibliography\thu@appendix@bibliography - \begin{bibunit}% \startcontents[survey]% }{% \stopcontents[survey]% - \end{bibunit}% \thu@reset@main@language % restore language } +\newcommand\thu@set@appendix@bib@heading{} % \end{macrocode} % \end{environment} % @@ -6475,14 +6327,9 @@ \section{\bibname}% \endgroup }% - \renewcommand\@bibunitname{\jobname-translation}% - \let\bibliographystyle\defaultbibliographystyle - \let\bibliography\thu@appendix@bibliography - \begin{bibunit}% \startcontents[translation]% }{% \stopcontents[translation]% - \end{bibunit}% \thu@reset@main@language % restore language } % \end{macrocode} @@ -6491,13 +6338,26 @@ % \begin{environment}{translation} % 书面翻译对应的原文索引,区别于译文的参考文献。 % \begin{macrocode} -\newenvironment{translation-index}{% - \begin{bibunit}% - \renewcommand\@bibunitname{\jobname-index}% - \renewcommand\bibname{书面翻译对应的原文索引}% - \let\bibsection\thu@appendix@bibsection -}{% - \end{bibunit}% +\newenvironment{translation-index}{}{} +\AtEndOfPackageFile*{bibunits}{ + \renewenvironment{translation-index}{% + \begin{bibunit}% + \renewcommand\@bibunitname{\jobname-index}% + \renewcommand\bibname{书面翻译对应的原文索引}% + \thu@set@survey@bibheading + }{% + \end{bibunit}% + } +} +\AtEndOfPackageFile*{biblatex}{ + \renewenvironment{translation-index}{% + \endrefsection + \begin{refsection}% + \renewcommand\bibname{书面翻译对应的原文索引}% + \thu@set@survey@bibheading + }{% + \end{refsection}% + } } % \end{macrocode} % \end{environment} @@ -6543,17 +6403,7 @@ % % 调研阅读报告的参考文献(或书面翻译对应的外文资料的原文索引)标题用宋体小四号字,段前 20pt,段后 6pt,行距 20pt。 % \begin{macrocode} -\newcommand\thu@appendix@bibsection{% - \par - \vskip 20bp% - \thu@pdfbookmark{1}{\bibname}% - \begingroup - \centering - \xiaosi[1.667]\bibname\par - \endgroup - \vskip 6bp% -}% -\newcommand\thu@appendix@bibliography[1]{\putbib[#1]} +\newcommand\thu@set@survey@bibheading{} % \end{macrocode} % % @@ -6590,7 +6440,7 @@ \ifthu@degree@graduate \fontsize{12bp}{16bp}\selectfont \fi - }, + }, align = left, label = [\arabic*], resume = achievements, @@ -6734,7 +6584,7 @@ % % \subsubsection{\pkg{hyperref} 宏包} % -% 使用 \cs{PassOptionsToPackage} 的方式进行配置,允许用户在 \cs{usepackage} +% 使用 \cs{PassOptionsToPackage} 的方式进行配置,允许用户在 \cs{usepackage} % 覆盖配置(\href{https://github.com/tuna/thuthesis/issues/863}{tuna/thuthesis\#863})。 % % \begin{macrocode} @@ -6762,7 +6612,7 @@ \renewcommand\thu@phantomsection{% \phantomsection } - \pdfstringdefDisableCommands{ + \pdfstringdefDisableCommands{% \let\\\relax \let\quad\relax \let\qquad\relax @@ -7081,32 +6931,6 @@ \restoregeometry } % \end{macrocode} -% -% Fandol 仿宋无法同时用于横排和竖排 -%(\href{https://github.com/tuna/thuthesis/issues/551}{\#551}), -% 所以只能独立编译 \file{spine.pdf},然后插入封面后。 -% \begin{macrocode} -\newcommand\thu@input@spine{% - \IfFileExists{spine.pdf}{}{% - \immediate\write18{xelatex spine.tex}% - \IfFileExists{spine.pdf}{}{% - \thu@error{Cannot find file "spine.pdf". Compile "spine.tex" first, or enable shell escape}% - }% - }% - \includepdf[pages=1]{spine.pdf}% -} -\newcommand\thu@spine{% - \ifthu@cjk@font@fandol - \thu@input@spine - \else - \ifthu@cjk@font@noto - \thu@input@spine - \else - \spine - \fi - \fi -} -% \end{macrocode} % \end{macro} % % @@ -7151,12 +6975,7 @@ \RequirePackage{enumitem} \RequirePackage{etoolbox} \RequirePackage{metalogo} - -% Pretending the `amssymb` has been loaded. -% This should be removed after `markdown` v2.13.0. -\expandafter\def\csname ver@amssymb.sty\endcsname{0000/00/00} \RequirePackage[tightLists=false]{markdown} -\expandafter\let\csname ver@amssymb.sty\endcsname\relax \markdownSetup{ renderers = { diff --git a/macros/latex/contrib/thuthesis/thuthesis.pdf b/macros/latex/contrib/thuthesis/thuthesis.pdf Binary files differindex b1fe7510f5..9f55312fdd 100644 --- a/macros/latex/contrib/thuthesis/thuthesis.pdf +++ b/macros/latex/contrib/thuthesis/thuthesis.pdf |