diff --git a/.github/ISSUE_TEMPLATE/release-tracker.md b/.github/ISSUE_TEMPLATE/release-tracker.md index bd92378f..7e1ec2b6 100644 --- a/.github/ISSUE_TEMPLATE/release-tracker.md +++ b/.github/ISSUE_TEMPLATE/release-tracker.md @@ -6,7 +6,7 @@ labels: Release --- - [ ] 提升版本号到最新 -- [ ] 生成 CHANGLOG +- [ ] 生成 CHANGELOG - [ ] 通过单元测试 - [ ] `bithesis` 是否需要更新 - [ ] 上传 CTAN diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 12574926..aa1c6faf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,22 @@ jobs: strategy: matrix: - template: [graduate-thesis, undergraduate-thesis, lab-report, paper-translation, presentation-slide, undergraduate-thesis-en] + template: [graduate-thesis, undergraduate-thesis, lab-report, paper-translation, presentation-slide, undergraduate-thesis-en, reading-report] + include: + - template: graduate-thesis + cls: bithesis + - template: undergraduate-thesis + cls: bithesis + - template: lab-report + cls: bitreport + - template: paper-translation + cls: bithesis + - template: presentation-slide + cls: bitbeamer + - template: undergraduate-thesis-en + cls: bithesis + - template: reading-report + cls: bithesis steps: - uses: actions/checkout@v2 @@ -46,8 +61,14 @@ jobs: uses: actions/download-artifact@v3 with: name: bithesis + - name: Download `*.cls` + uses: actions/download-artifact@v3 + with: + name: cls - name: Copy manual to the template folder. - run: cp bithesis.pdf ./templates/${{ matrix.template }} + run: | + mv bithesis.pdf ./templates/${{ matrix.template }} + mv ${{ matrix.cls }}.cls ./templates/${{ matrix.template }} - name: Install zip uses: montudor/action-zip@v1 - name: Zip files under ./${{ matrix.template }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 12a16d28..f325e0ef 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,19 +28,6 @@ jobs: - name: Check spelling of bithesis.dtx uses: crate-ci/typos@master - ensure_updated_cls: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: xu-cheng/texlive-action/full@v1 - name: Check there is nothing to diff. - with: - run: | - apk add make git - git config --global --add safe.directory /github/workspace - - make check-cls - markdown-link-check: runs-on: ubuntu-latest steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 947bc5d0..1488f0fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,225 @@ Acronyms: - GT: graduate-thesis (研究生学位论文模板) - PT: paper-translation (本科生毕业设计外文翻译模板) - PS: presentation-slide (演讲幻灯片模板) +- RR: reading-report (读书报告模板) - UTE: undergraduate-thesis-en (本科生毕业设计论文模板(全英文专业)) - UT: undergraduate-thesis (本科生毕业设计论文模板) **Bolded text highlights its importance.** +## [3.6.0] - 2023-09-26 + +[fc8061b](https://github.com/BITNP/BIThesis/commit/fc8061b4ee21caacffb7e38c1271d73bb2baba81)...[fc8061b](https://github.com/BITNP/BIThesis/commit/fc8061b4ee21caacffb7e38c1271d73bb2baba81) + +### Bug Fixes + +- Redundant teacher in cover ([4cbd11c](https://github.com/BITNP/BIThesis/commit/4cbd11cfb44c13d0f25f8f251817ba36b82aad49)) +- Typo in release-tracker.md ([1250c53](https://github.com/BITNP/BIThesis/commit/1250c5353e1249c1659529f8c51013d94f00a4f0)) + +### Documentation + +- Update README for reading-report ([2591bd6](https://github.com/BITNP/BIThesis/commit/2591bd6b220bd5e41a9ad1c19ad8a72c57119257)) + +### Features + +- Add type reading_report to change the title ([8d97017](https://github.com/BITNP/BIThesis/commit/8d97017da74b16625102aa5b746c9eddb6a11292)) + +### Refactor + +- Basic setup for reading-report ([1d08feb](https://github.com/BITNP/BIThesis/commit/1d08feb26b57140aa96414b242cd15ce717bdf07)) +- Remove hard-coded title in reading_report ([a0df6e3](https://github.com/BITNP/BIThesis/commit/a0df6e303110807e1806fd06c80965e8197ff7fd)) +- Reading_report cover info ([ce1905c](https://github.com/BITNP/BIThesis/commit/ce1905cea6fcfa52f787c7ae8d125f5d46c9bf88)) + +### Ci + +- Add reading-report ([492eecd](https://github.com/BITNP/BIThesis/commit/492eecdc07e50a47479b168dadc1e07aaa255d7d)) + +## [3.6.0-beta-11-test-2] - 2023-07-13 + +[d77f47f](https://github.com/BITNP/BIThesis/commit/d77f47f99638c7c12d81d3fba6beeb84e64c5154)...[c85fa6b](https://github.com/BITNP/BIThesis/commit/c85fa6b35b440b7ccf3bfa9732881437f35592a7) + +### Bug Fixes + +- Typo in release-tracker.md ([1250c53](https://github.com/BITNP/BIThesis/commit/1250c5353e1249c1659529f8c51013d94f00a4f0)) +- Update gitignore. ([c85fa6b](https://github.com/BITNP/BIThesis/commit/c85fa6b35b440b7ccf3bfa9732881437f35592a7)) + +### Refactor + +- Remove all templates/*/*.cls. ([e457dae](https://github.com/BITNP/BIThesis/commit/e457daea0f6ede972ec2fa03d0bbe03105c21ef9)) + +### Styling + +- Remove a trailing space ([7f73122](https://github.com/BITNP/BIThesis/commit/7f73122a69a6b05dc07f88d787dce438a61de8df)) + +### Ci + +- Remove templates/*cls. ([ac5463c](https://github.com/BITNP/BIThesis/commit/ac5463ceb2fa734ba27ccc66b82f6ec4839069ad)) +- Remove ensure_updated_cls. ([1cab540](https://github.com/BITNP/BIThesis/commit/1cab540c184ec9fadc69f7de6125a0c2bde75263)) + +## [3.6.0-beta-11-test-1] - 2023-07-08 + +[c0a20dc](https://github.com/BITNP/BIThesis/commit/c0a20dcff038f4ad1ab0fd4549c73f1b3c1a06aa)...[d77f47f](https://github.com/BITNP/BIThesis/commit/d77f47f99638c7c12d81d3fba6beeb84e64c5154) + +### Bug Fixes + +- Typo ([ea08115](https://github.com/BITNP/BIThesis/commit/ea0811589a281281f410329da479116ea804f6cd)) +- Fix broken images in README.md ([c9779ee](https://github.com/BITNP/BIThesis/commit/c9779eebe0cae2627a147b6d522712071fcc252f)) +- Redundant teacher in cover ([4cbd11c](https://github.com/BITNP/BIThesis/commit/4cbd11cfb44c13d0f25f8f251817ba36b82aad49)) +- Remove default values to make entry can-be-deleted. ([e8f67b4](https://github.com/BITNP/BIThesis/commit/e8f67b48b3229df966d92fd8a1bea17fdf8f53da)) +- Typo ([fcbb3ce](https://github.com/BITNP/BIThesis/commit/fcbb3ce682553b2ff944f1c3fb1c3631c962973e)) +- Use meta key. ([4b7b6a1](https://github.com/BITNP/BIThesis/commit/4b7b6a150bb0a248d59bcd73af1aeac7e50e39f0)) +- Update links. ([999eb2e](https://github.com/BITNP/BIThesis/commit/999eb2e93cada08bbe1d6ac3070c8be690fa1c70)) +- Secret info expansion. ([d4decf9](https://github.com/BITNP/BIThesis/commit/d4decf9f2b47e3b14c398eec87c891a45650edfb)) +- Remove \@@_secret_info:x ([6c8a0f6](https://github.com/BITNP/BIThesis/commit/6c8a0f6336599742f84601f1a52442722261ba0a)) +- Note environment does not work as expected ([c703854](https://github.com/BITNP/BIThesis/commit/c7038542c7a2730651feabc745c6f543df505955)) + +### Documentation + +- Update README for reading-report ([2591bd6](https://github.com/BITNP/BIThesis/commit/2591bd6b220bd5e41a9ad1c19ad8a72c57119257)) +- Add docs for cleardoublepage ([9348300](https://github.com/BITNP/BIThesis/commit/934830077eb6d47b1ee9bd6d44bd3e275d4f2479)) +- Maybe helps. ([3df8e5d](https://github.com/BITNP/BIThesis/commit/3df8e5d9a58c770f8ea9fddec3f6a82e4bd45a33)) +- A reference to how to add the watermark. ([14cb57c](https://github.com/BITNP/BIThesis/commit/14cb57cb1b54bba92a8cc85cd2eac99fa4b4ae10)) +- Fix the description about passing emtpy values. ([a942e6c](https://github.com/BITNP/BIThesis/commit/a942e6c6795dafa39dd7c7bbb9227b38dc775ab0)) +- Add docs on const/info/x. ([77b4582](https://github.com/BITNP/BIThesis/commit/77b4582f3a00c37c796eca1b4feb8c02ae5e4f3f)) +- `style / headline`适用范围 ([58cf8a3](https://github.com/BITNP/BIThesis/commit/58cf8a35f679713c48701a942f547937bf802224)) +- 更新教务部网站 ([3dc9f64](https://github.com/BITNP/BIThesis/commit/3dc9f644a16e99436fe4fff53ba41a3fc7dbdef2)) +- Replace code of conduct contact ([ea26d66](https://github.com/BITNP/BIThesis/commit/ea26d660beeac04319ebf36b6575d3aeea238cf1)) +- Add a doc entry for hyphen. ([b8eccd2](https://github.com/BITNP/BIThesis/commit/b8eccd2b82cdfb0727f45ff4d6c123d1f2d8d28b)) + +### Features + +- Add parencite examples ([82800ec](https://github.com/BITNP/BIThesis/commit/82800ec8bcc77c421f9c592f2302d94499aeed5d)) +- Add type reading_report to change the title ([8d97017](https://github.com/BITNP/BIThesis/commit/8d97017da74b16625102aa5b746c9eddb6a11292)) +- Support customize cover label. ([f73359f](https://github.com/BITNP/BIThesis/commit/f73359fb0cf2731fd701613f0c1877c9171b4354)) +- Customizable headline ([9de5df6](https://github.com/BITNP/BIThesis/commit/9de5df6253bf4cfa965cfdf21cca97f8dff316a2)) +- Support hyphenation by default. ([9b849dd](https://github.com/BITNP/BIThesis/commit/9b849dd0132494b92af5d5fca40d89c32186e095)) + +### Refactor + +- Basic setup for reading-report ([1d08feb](https://github.com/BITNP/BIThesis/commit/1d08feb26b57140aa96414b242cd15ce717bdf07)) +- Remove hard-coded title in reading_report ([a0df6e3](https://github.com/BITNP/BIThesis/commit/a0df6e303110807e1806fd06c80965e8197ff7fd)) +- Reading_report cover info ([ce1905c](https://github.com/BITNP/BIThesis/commit/ce1905cea6fcfa52f787c7ae8d125f5d46c9bf88)) +- `style / head`使用`\c_@@_bachelor_thesis_header_clist` ([e420412](https://github.com/BITNP/BIThesis/commit/e420412b9a47738b23f18c43fad58e0d2b4bee8c)) + +### Build + +- PowerShell version of regression-test ([d8f44bf](https://github.com/BITNP/BIThesis/commit/d8f44bf24c6829d4e75fa25a9827680d78da4bb4)) + +### Ci + +- Add reading-report ([492eecd](https://github.com/BITNP/BIThesis/commit/492eecdc07e50a47479b168dadc1e07aaa255d7d)) +- Add markdown link check. ([e400fac](https://github.com/BITNP/BIThesis/commit/e400facec5bb3ca978c87fae2c39cabb0ccb434c)) + +## [3.6.0-beta-9] - 2023-06-01 + +[bd6221d](https://github.com/BITNP/BIThesis/commit/bd6221d7e8a2e453c76e0d679e2da0b19692a35f)...[c0a20dc](https://github.com/BITNP/BIThesis/commit/c0a20dcff038f4ad1ab0fd4549c73f1b3c1a06aa) + +### Bug Fixes + +- Page numbering bug fix for two-side printing ([e435cc0](https://github.com/BITNP/BIThesis/commit/e435cc009daba6767ac88f769b3ed2e2d02a902e)) + +### Refactor + +- A bunch of fixes. ([a6c7f33](https://github.com/BITNP/BIThesis/commit/a6c7f3381a48ad9db02a29db6f02043f5b0cb297)) + +## [3.6.0-beta-8] - 2023-05-29 + +[9b348a3](https://github.com/BITNP/BIThesis/commit/9b348a35b0cdee56cdf5ff914a6646b50ae1476f)...[bd6221d](https://github.com/BITNP/BIThesis/commit/bd6221d7e8a2e453c76e0d679e2da0b19692a35f) + +### Bug Fixes + +- More of tabular. ([e316c41](https://github.com/BITNP/BIThesis/commit/e316c41267af91948624effbc96ff4d8b042e556)) +- Add more. ([681ed0f](https://github.com/BITNP/BIThesis/commit/681ed0f144ba342ba05162c392e87eb50f164ddb)) +- Hotfix for ref.bib ([bd6221d](https://github.com/BITNP/BIThesis/commit/bd6221d7e8a2e453c76e0d679e2da0b19692a35f)) + +### Documentation + +- Add the doc for windowsSimSunFakeBold. ([fa1eaca](https://github.com/BITNP/BIThesis/commit/fa1eacab87eb8ac7b5a8fff9aa9b7f962ed2fbae)) + +### Features + +- Default fake bold SimSun on Windows. ([554871d](https://github.com/BITNP/BIThesis/commit/554871d6258ce0f85c49eb335718324bef5d104d)) + +### Miscellaneous Tasks + +- Update docs. ([e4558dc](https://github.com/BITNP/BIThesis/commit/e4558dcc5977b8af72034f9bfcda1038a737e6ab)) + +### Refactor + +- Move docs into separate file. ([8ad8bf8](https://github.com/BITNP/BIThesis/commit/8ad8bf8e261e3b03f138acbbdb39adb4a472d789)) +- Docs. ([e5c5ea7](https://github.com/BITNP/BIThesis/commit/e5c5ea7f70aacf0d8963a32020233ed40ebdc302)) +- Disable bibliographyIndent. ([30b651c](https://github.com/BITNP/BIThesis/commit/30b651cb738ee3e434b7d67bde6c4178c31ec3f2)) + +## [3.6.0-beta-7] - 2023-05-21 + +[626c75b](https://github.com/BITNP/BIThesis/commit/626c75b5fd1eb920c40e43ef3607720f42e56fea)...[9b348a3](https://github.com/BITNP/BIThesis/commit/9b348a35b0cdee56cdf5ff914a6646b50ae1476f) + +### Bug Fixes + +- Update example of references ([8fd6c79](https://github.com/BITNP/BIThesis/commit/8fd6c79a6dbd13cfe26eaf743002b467baa2c4fc)) +- Add Chinese abstract section. ([55cd7d2](https://github.com/BITNP/BIThesis/commit/55cd7d28413371c6ed10181b5ef24cc0b000d1cc)) +- Remove covers in peer review mode. ([65cf4e2](https://github.com/BITNP/BIThesis/commit/65cf4e25e05cf53fb3ef402a9304bfeb3cd45477)) + +### Miscellaneous Tasks + +- Ignore .DS_Store. ([7f78856](https://github.com/BITNP/BIThesis/commit/7f78856d8160bc6a53ddab54ba2846b80e7d36d0)) + +## [3.6.0-beta-6] - 2023-05-18 + +[dc5d722](https://github.com/BITNP/BIThesis/commit/dc5d72228ac7730a771866d3bded2ff211452883)...[626c75b](https://github.com/BITNP/BIThesis/commit/626c75b5fd1eb920c40e43ef3607720f42e56fea) + +### Bug Fixes + +- Restore hyphenation for Eng template. ([f5ece01](https://github.com/BITNP/BIThesis/commit/f5ece01b9cd5734db4de8b9b81a5b1ac5deeca85)) +- Fix alignment. ([c7073e0](https://github.com/BITNP/BIThesis/commit/c7073e0430ac150d5bebacb01bac3a6c7222da44)) + +## [3.6.0-beta-5] - 2023-05-17 + +[b769a14](https://github.com/BITNP/BIThesis/commit/b769a146f745a629386fbb39ebc0d27906f5f0d6)...[dc5d722](https://github.com/BITNP/BIThesis/commit/dc5d72228ac7730a771866d3bded2ff211452883) + +### Bug Fixes + +- Fix non-effective listings numbering. ([4c2757f](https://github.com/BITNP/BIThesis/commit/4c2757fe94cfeade53691792ba666252819ae824)) + +## [3.6.0-beta-4] - 2023-05-16 + +[29c2061](https://github.com/BITNP/BIThesis/commit/29c20613771e3ae20e47d3ac241ac7926628b4e5)...[b769a14](https://github.com/BITNP/BIThesis/commit/b769a146f745a629386fbb39ebc0d27906f5f0d6) + +### Bug Fixes + +- Fix section-level appendix bookmark. ([5c2dbf5](https://github.com/BITNP/BIThesis/commit/5c2dbf5def8c03083aa9ee689f7ab8f2bff91450)) +- Reset section counter at the beginning of appendix. ([21f0661](https://github.com/BITNP/BIThesis/commit/21f0661b9a55c63e7ac0c41780cb5712b987260a)) + +### Refactor + +- Remove all source-code docs. ([1be9eb7](https://github.com/BITNP/BIThesis/commit/1be9eb73681da324600196f1bb288fd712e7c9bb)) +- Remove deprecated code. ([80576ab](https://github.com/BITNP/BIThesis/commit/80576abb526c339f0050918571c8bf2efedd49f7)) + +## [3.6.0-beta-3] - 2023-05-09 + +[3a19d34](https://github.com/BITNP/BIThesis/commit/3a19d34d7507d79ebe90346343968569745d9499)...[29c2061](https://github.com/BITNP/BIThesis/commit/29c20613771e3ae20e47d3ac241ac7926628b4e5) + +### Bug Fixes + +- Graduate-thesis indent is larger than normal. ([c2b1d37](https://github.com/BITNP/BIThesis/commit/c2b1d37be0c127ddcc34e76770ffba2be58053fa)) +- Typo fix. ([6fa12af](https://github.com/BITNP/BIThesis/commit/6fa12af528c124a4c8e51596263d8caf7782f7d0)) +- Add autoref label for figure(fig),table(tab),euqation(equ) ([1a62cc5](https://github.com/BITNP/BIThesis/commit/1a62cc50e77da71fde234424dac5c3e2ba745de3)) +- Replace the _bithesis with @@ in .dtx, add updated property ([e02253a](https://github.com/BITNP/BIThesis/commit/e02253a2eff2b78aaa05478c9b929a762eacaa25)) +- Apply same rules to bachelor thesis. ([b0b3740](https://github.com/BITNP/BIThesis/commit/b0b3740c5f62bd0d690888b201f5dd517ca85d48)) + +### Documentation + +- Add docs for SecretInfo feature. ([6f37ad2](https://github.com/BITNP/BIThesis/commit/6f37ad27d2c426ee81e2bc13a84078e7ec8c70e4)) + +### Features + +- Hide only secret info in cover. ([026c529](https://github.com/BITNP/BIThesis/commit/026c529fc9ecafcf31fe89af07df7d1bd22e8192)) +- Provide const/style/substituteSymbol option. ([1f40eef](https://github.com/BITNP/BIThesis/commit/1f40eeff976af485e2cc3c19d0f17243c5c1d7c9)) +- [**breaking**] Add back cover pages in blindPeerReview mode. ([6953c61](https://github.com/BITNP/BIThesis/commit/6953c61b949c92be370b7a620e769f0a674ea29d)) +- Add interface for secret info. ([a39f545](https://github.com/BITNP/BIThesis/commit/a39f54551f790afb465bacd731396917b181ec0c)) +- Suppress twoside in blindPeerReview. ([f1db9e7](https://github.com/BITNP/BIThesis/commit/f1db9e7858ce4c8ccbe5cc80b3effa8d6fd6147f)) +- Also expose paperback and originality claim. ([61483f5](https://github.com/BITNP/BIThesis/commit/61483f5701ea0742f9602d65f7c07239b51ba854)) + ## [3.5.4] - 2023-04-29 [22fccf5](https://github.com/BITNP/BIThesis/commit/22fccf5cc1c62cc69288fdf292857d4f3c08c4bc)...[b19599b](https://github.com/BITNP/BIThesis/commit/b19599bcd5b0917120aaf05fc8961f49f54700ef) diff --git a/Makefile b/Makefile index d0fc2362..5530e52f 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,7 @@ test: doc copy FORCE_MAKE cd $(SCAFFOLDDIR)/paper-translation && latexmk && cd .. cd $(SCAFFOLDDIR)/undergraduate-thesis-en && latexmk && cd .. cd $(SCAFFOLDDIR)/graduate-thesis && latexmk && cd .. + cd $(SCAFFOLDDIR)/reading-report && latexmk && cd .. cd $(SCAFFOLDDIR)/lab-report && latexmk && cd .. cd $(SCAFFOLDDIR)/presentation-slide && latexmk && cd .. cd $(TESTDIR)/doctor-thesis && latexmk && cd .. @@ -63,6 +64,7 @@ copy: cls cp bithesis.cls $(SCAFFOLDDIR)/undergraduate-thesis-en cp bithesis.cls $(SCAFFOLDDIR)/paper-translation cp bithesis.cls $(SCAFFOLDDIR)/graduate-thesis + cp bithesis.cls $(SCAFFOLDDIR)/reading-report cp bithesis.cls $(TESTDIR)/doctor-thesis cp bithesis.cls $(TESTDIR)/autorefs cp bitreport.cls $(SCAFFOLDDIR)/lab-report diff --git a/bithesis.dtx b/bithesis.dtx index 3c18bb79..40e07fd4 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -135,7 +135,7 @@ % % \subsubsection{辅助函数与常量} % -% \begin{macro}[added=2023-05-06]{\@@_secret_info:nn,\@@_secret_info:N,\@@_secret_info:n,\@@_secret_info:x} +% \begin{macro}[added=2023-05-06,updated=2023-07-04]{\@@_secret_info:nn,\@@_secret_info:N,\@@_secret_info:n} % 普通模式下显示参数一,盲审模式下显示参数二。 % \begin{macrocode} \cs_new:Npn \@@_hide:n #1 { @@ -156,9 +156,6 @@ \cs_new:Npn \@@_secret_info:n #1 { \@@_secret_info:nn {#1} {\tl_map_function:NN {#1} \@@_hide:n } } - -\cs_generate_variant:Nn \@@_secret_info:n {x} - % \end{macrocode} % % \end{macro} @@ -442,11 +439,14 @@ { {school} {学\qquad 院} {School}, {major} {专\qquad 业} {Degree}, + {course} {课程名称} {Course}, {class} {班\qquad{}级} {Class}, {author} {学生姓名} {Author}, {student_id} {学\qquad 号} {Student~ID}, {supervisor} {指导教师} {Supervisor}, {co_supervisor} {校外指导教师} {Co-Supervisor}, + {teacher} {任课教师} {Teacher}, + {semester} {上课学期} {Semester}, {keywords} {关键词:} {Key~Words:~}, {toc} {目\label_space: 录} {Table~of~Contents}, {abstract} {摘\label_space: 要} {Abstract}, @@ -591,11 +591,18 @@ school .tl_set:N = \l_@@_value_school_tl, major .tl_set:N = \l_@@_value_major_tl, class .tl_set:N = \l_@@_value_class_tl, + % 课程名称,读书报告使用 + course .tl_set:N = \l_@@_value_course_tl, author .tl_set:N = \l_@@_value_author_tl, studentId .tl_set:N = \l_@@_value_student_id_tl, + % 指导教师 supervisor .tl_set:N = \l_@@_value_supervisor_tl, % 因为默认不显示,所以不需要设置初始值。 externalSupervisor .tl_set:N = \l_@@_value_external_supervisor_tl, + % 任课教师,读书报告使用 + teacher .tl_set:N = \l_@@_value_teacher_tl, + % 上课学期,读书报告使用 + semester .tl_set:N = \l_@@_value_semester_tl, keywords .tl_set:N = \l_@@_value_keywords_tl, keywords .initial:n = {聚氨酯,形状记忆,织物(示例)}, keywordsEn .tl_set:N = \l_@@_value_keywords_en_tl, @@ -1828,8 +1835,8 @@ \clist_set:Nn \l_@@_input_clist { {\c_@@_graduate_label_author_tl} {\@@_secret_info:nn{\l_@@_value_author_tl}{\g_@@_const_substitute_symbol_tl\g_@@_const_substitute_symbol_tl\g_@@_const_substitute_symbol_tl}}, {\c_@@_graduate_label_school_tl} {\l_@@_value_school_tl}, - {\c_@@_graduate_label_supervisor_tl} {\@@_secret_info:x{\l_@@_value_supervisor_tl}}, - {\c_@@_graduate_label_chairman_tl} {\@@_secret_info:x{\l_@@_value_chairman_tl}}, + {\c_@@_graduate_label_supervisor_tl} {\@@_secret_info:N{\l_@@_value_supervisor_tl}}, + {\c_@@_graduate_label_chairman_tl} {\@@_secret_info:N{\l_@@_value_chairman_tl}}, {\g_@@_const_info_degree_tl} {\l_@@_value_degree_tl}, {\g_@@_const_info_major_tl} {\l_@@_value_major_tl}, {\c_@@_graduate_label_institute_tl} {\l_@@_value_institute_tl}, @@ -1883,10 +1890,10 @@ % 渲染信息。 \clist_set:Nn \l_@@_input_clist { - {\c_@@_graduate_label_author_en_tl} {\@@_secret_info:x{\l_@@_value_author_en_tl}}, + {\c_@@_graduate_label_author_en_tl} {\@@_secret_info:N{\l_@@_value_author_en_tl}}, {\c_@@_graduate_label_school_en_tl} {\l_@@_value_school_en_tl}, - {\c_@@_graduate_label_supervisor_en_tl} {\@@_secret_info:x{\l_@@_value_supervisor_en_tl}}, - {\c_@@_graduate_label_chairman_en_tl} {\@@_secret_info:x{\l_@@_value_chairman_en_tl}}, + {\c_@@_graduate_label_supervisor_en_tl} {\@@_secret_info:N{\l_@@_value_supervisor_en_tl}}, + {\c_@@_graduate_label_chairman_en_tl} {\@@_secret_info:N{\l_@@_value_chairman_en_tl}}, {\c_@@_graduate_label_degree_en_tl} {\l_@@_value_degree_en_tl}, {\c_@@_graduate_label_major_en_tl} {\l_@@_value_major_en_tl}, {\c_@@_graduate_label_institute_en_tl} {\l_@@_value_institute_en_tl}, @@ -2038,7 +2045,7 @@ \IfValueTF {#2} { \@@_secret_info:nn {#1} {#2} } { - \@@_secret_info:x {#1} + \@@_secret_info:n {#1} } } % \end{macrocode} @@ -2098,13 +2105,16 @@ } \clist_set:Nn \l_@@_input_clist { + {\c_@@_label_semester_tl} {\l_@@_value_semester_tl}, {\c_@@_label_school_tl} {\l_@@_value_school_tl}, {\g_@@_const_info_major_tl} {\l_@@_value_major_tl}, {\c_@@_label_class_tl} {\@@_secret_info:N \l_@@_value_class_tl}, {\c_@@_label_author_tl} {\@@_secret_info:N \l_@@_value_author_tl}, {\c_@@_label_student_id_tl} {\@@_secret_info:N \l_@@_value_student_id_tl}, + {\c_@@_label_course_tl} {\l_@@_value_course_tl}, {\c_@@_label_supervisor_tl} {\@@_secret_info:N \l_@@_value_supervisor_tl}, {\c_@@_label_co_supervisor_tl} {\@@_secret_info:N \l_@@_value_external_supervisor_tl}, + {\c_@@_label_teacher_tl} {\l_@@_value_teacher_tl}, } \zihao{3} @@ -3955,8 +3965,9 @@ \DeclareDocumentCommand{\env}{m}{\texttt{#1}} \newcommand{\myentry}[1]{% \marginpar{\raggedleft\color{purple}\bfseries\strut #1}} -\newcommand{\note}[2][Note]{{% - \color{magenta}{\bfseries #1}\emph{#2}}} +\newenvironment{note}[1][Note] + {{\color{magenta} \bfseries #1} \itshape} + {} \DeclareDocumentCommand{\githubuser}{m}{\href{https://github.com/#1}{@#1}} diff --git a/cliff.toml b/cliff.toml index 3e7eefef..257386eb 100644 --- a/cliff.toml +++ b/cliff.toml @@ -10,6 +10,7 @@ Acronyms: - GT: graduate-thesis (研究生学位论文模板) - PT: paper-translation (本科生毕业设计外文翻译模板) - PS: presentation-slide (演讲幻灯片模板) +- RR: reading-report (读书报告模板) - UTE: undergraduate-thesis-en (本科生毕业设计论文模板(全英文专业)) - UT: undergraduate-thesis (本科生毕业设计论文模板)\n **Bolded text highlights its importance.**\n diff --git a/templates/graduate-thesis/.gitignore b/templates/graduate-thesis/.gitignore index 58957643..74fc0de7 100644 --- a/templates/graduate-thesis/.gitignore +++ b/templates/graduate-thesis/.gitignore @@ -313,4 +313,3 @@ TSWLatexianTemp* *.glstex # End of https://www.toptal.com/developers/gitignore/api/latex -!*.cls diff --git a/templates/graduate-thesis/bithesis.cls b/templates/graduate-thesis/bithesis.cls deleted file mode 100644 index 7a6104a8..00000000 --- a/templates/graduate-thesis/bithesis.cls +++ /dev/null @@ -1,2333 +0,0 @@ -%% -%% This is file `bithesis.cls', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% bithesis.dtx (with options: `cls,thesis') -%% -%% Copyright (C) 2023 -%% Association of Bit Network Pioneer and any individual authors listed in the documentation. -%% ------------------------------------------------------------------------------ -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.3c of this license or (at your option) any later -%% version. This version of this license is in -%% http://www.latex-project.org/lppl/lppl-1-3c.txt -%% and the latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of -%% LaTeX version 2020/11/27 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Feng Kaiyu. -%% ------------------------------------------------------------------------------ -%% -\RequirePackage{expl3,l3keys2e} -\ProvidesExplClass{bithesis} -{2023-05-01}{3.5.4}{BIT Thesis Templates} -\int_new:N \g__bithesis_thesis_type_int -\int_new:N \g__bithesis_head_zihao_int -\bool_new:N \g__bithesis_twoside_bool -\bool_new:N \g__bithesis_thesis_type_english_bool -\bool_new:N \g__bithesis_blind_mode_bool -\bool_new:N \g__bithesis_quirks_mode_bool -\tl_new:N \g__bithesis_label_divide_char_tl -\seq_new:N \l__bithesis_right_seq -\seq_new:N \l__bithesis_left_seq -\cs_new:Npn \__bithesis_hide:n #1 { - \g__bithesis_const_substitute_symbol_tl -} - -\cs_new:Npn \__bithesis_secret_info:nn #1 #2 { - \bool_if:nTF \g__bithesis_blind_mode_bool { - #2 - } { - #1 - } -} - -\cs_new:Npn \__bithesis_secret_info:N #1 { - \__bithesis_secret_info:nn {#1} {\tl_map_function:NN #1 \__bithesis_hide:n } -} -\cs_new:Npn \__bithesis_secret_info:n #1 { - \__bithesis_secret_info:nn {#1} {\tl_map_function:NN {#1} \__bithesis_hide:n } -} - -\cs_generate_variant:Nn \__bithesis_secret_info:n {x} - -\cs_new:Npn \__bithesis_get_const:N #1 { - \__bithesis_if_thesis_english:TF { - \use:c {c__bithesis_label_ #1 _en_tl} - } { - \use:c {c__bithesis_label_ #1 _tl} - } -} -\cs_new:Npn \__bithesis_set_english_mode: { - \bool_gset_true:N \g__bithesis_thesis_type_english_bool -} -\cs_generate_variant:Nn \tl_if_empty:nTF {x} -\cs_generate_variant:Nn \seq_set_split:Nnn {Nnx} -\cs_new:Npn \__bithesis_same_page: { - \let\clearpage\relax - \let\cleardoublepage\relax -} -\cs_new:Npn \__bithesis_if_graduate:TF #1#2 { - \int_compare:nNnTF {3} < {\g__bithesis_thesis_type_int} - {#1} - {#2} - } - -\cs_new:Npn \__bithesis_if_thesis_int_type:nTF #1#2#3 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {#1} {#2} {#3}} -\cs_new:Npn \__bithesis_if_thesis_int_type:nT #1#2 {\__bithesis_if_thesis_int_type:nTF {#1} {#2} {}} - -\cs_new:Npn \__bithesis_if_thesis_english:TF #1#2 {\bool_if:nTF {\g__bithesis_thesis_type_english_bool} {#1} {#2}} -\cs_new:Npn \__bithesis_if_thesis_english:T #1 {\__bithesis_if_thesis_english:TF {#1}{}} -\cs_new:Npn \__bithesis_if_bachelor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} < {4} {#1} {#2}} -\cs_new:Npn \__bithesis_if_bachelor_thesis:T #1 {\__bithesis_if_bachelor_thesis:TF {#1} {}} -\cs_new:Npn \__bithesis_if_master_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {4} {#1} {#2}} -\cs_new:Npn \__bithesis_if_doctor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {5} {#1} {#2}} -\clist_const:Nn \c__bithesis_thesis_type_clist - { bachelor, bachelor_translation, bachelor_english, master, doctor} -\clist_const:Nn \c__bithesis_publication_modes_clist - { biblatex, custom } -\cs_new_protected:Npn \__bithesis_define_label:nn #1#2 - { \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} } - -\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnn #1#2#3 - { - \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} - } - -\cs_new_protected:Npn \__bithesis_define_label:nnn #1#2#3 - { - \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} - \tl_const:cn { c__bithesis_label_ #1 _en_tl } {#3} - } - -\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnnn #1#2#3#4 - { - \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} - \tl_const:cn { c__bithesis_ #1 _label_ #2 _en_tl } {#4} - } -\cs_new:Npn \smallgap: { - \hspace{0.45ex} -} -\cs_new:Npn \label_space: { - \__bithesis_if_bachelor_thesis:T { - \quad - } -} -\clist_map_inline:nn - { - {code} {代码}, - {udc} {UDC分类号:}, - {classification} {中图分类号:}, - {classified_level} {密级}, - {type} {种类}, - } - {\__bithesis_define_label:nn #1} -\clist_map_inline:nn - { - {originality} {原创性声明}, - {originality_clause} {本人郑重声明:所呈交的毕业设计(论文), - 是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外, - 本文不包含任何其他个人或集体已经发表或撰写过的研究成果。 - 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par~特此申明。}, - {authorization} {关于使用授权的声明}, - {authorization_clause} {本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定, - 其中包括:\circled{1}~学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件; - \circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文); - \circled{3}~学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}~学校可以学术交流为目的, - 复制赠送和交换本毕业设计(论文);\circled{5}~学校可以公布本毕业设计(论文)的全部或部分内容。}, - {originality_author_signature} - {本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, - {originality_supervisor_signature} - {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, - } {\__bithesis_define_label_by_thesis_type:nnn {bachelor} #1} -\clist_map_inline:nn - { - {originality} {原创性声明~Statement~of~Originality}, - {originality_clause} { - 本人郑重声明:所呈交的毕业设计(论文), - 是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外, - 本文不包含任何其他个人或集体已经发表或撰写过的研究成果。 - 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。特此申明。\par - \arialfamily I,\dunderline[-1pt]{1pt}{\makebox[18mm]{}},~solemnly~ - declare:~the~submitted~graduation~design~(thesis),~ - is~the~research~achievement~completed~independently~by~myself~ - under~the~guidance~of~the~supervisor.~This~article~does~not~contain~ - any~research~published~or~written~by~any~other~individual~or~group,~ - except~as~already~referenced~in~this~paper.~Individuals~and~groups~ - that~have~made~important~contributions~to~the~study~of~this~paper~ - are~clearly~indicated~and~cited~in~the~paper.\par - }, - {authorization} {关于使用授权的声明~State~of~Use~Authorization}, - {authorization_clause} { - 本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定, - 其中包括:\circled{1}学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件; - \circled{2}学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文); - \circled{3}学校可允许本毕业设计(论文)被查阅或借阅; - \circled{4}学校可以学术交流为目的,复制赠送和交换本毕业设计(论文); - \circled{5}学校可以公布本毕业设计(论文)的全部或部分内容。\par - I~fully~understand~the~regulations~on~the~storage,~ - use~of~graduation~design~(thesis)~in~Beijing~Institute~of~Technology.~ - Beijing~Institute~of~Technology~has~the~right~to~(1)~keep,~ - and~to~the~relevant~departments~to~send~the~original~or~copy~ - of~this~graduation~design~(thesis);~(2)~copy~and~preserve~this~ - graduation~design~(thesis)~by~photocopying,~miniature~or~other~ - means~of~reproduction;~(3)~allow~this~graduation~design~(thesis)~ - to~be~read~or~borrowed;~(4)~for~the~purpose~of~academic~exchange,~ - copy,~give~and~exchange~this~graduation~design~(thesis);~(5)~ - publish~all~or~part~of~the~contents~of~this~graduation~design~(thesis).~ - }, - } {\__bithesis_define_label_by_thesis_type:nnn {bachelor_english} #1} -\clist_map_inline:nn - { - {originality} {研究成果声明}, - {originality_clause} {本人郑重声明: - 所提交的学位论文是我本人在指导教师的指导下进行的研究工作获得的研究成果。 - 尽我所知,文中除特别标注和致谢的地方外, - 学位论文中不包含其他人已经发表或撰写过的研究成果, - 也不包含为获得北京理工大学或其它教育机构的学位或证书所使用过的材料。 - 与我一同工作的合作者对此研究工作所做的任何贡献均已在 - 学位论文中作了明确的说明并表示了谢意。\par~特此申明。}, - {authorization} {关于学位论文使用权的说明}, - {authorization_clause} {本人完全了解北京理工大学有关保管、使用学位论文的规定, - 其中包括:\circled{1}~学校有权保管、并向有关部门送交学位论文的原件与复印件; - \circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存学位论文; - \circled{3}~学校可允许学位论文被查阅或借阅;\circled{4}~ - 学校可以学术交流为目的,复制赠送和交换学位论文;\circled{5}~ - 学校可以公布学位论文的全部或部分内容(保密学位论文在解密后遵守此规定)。}, - {originality_author_signature} - {签\qquad 名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, - {originality_supervisor_signature} - {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, - } {\__bithesis_define_label_by_thesis_type:nnn {graduate} #1} -\clist_map_inline:nn - { - {author} {作\quad 者\quad 姓\quad 名} {Candidate~Name}, - {school} {学\quad 院\quad 名\quad 称} {School~or~Department}, - {supervisor} {指\quad 导\quad 教\quad 师} {Faculty~Mentor}, - {chairman} {答辩委员会主席} {Chair,~Thesis~Committee}, - {degree} - {申\smallgap: 请\smallgap: 学\smallgap: 位\smallgap: 级\smallgap: 别} - {Degree~Applied}, - {major} {学\quad 科\quad 专\quad 业} {Major}, - {institute} - {学\smallgap: 位\smallgap: 授\smallgap: 予\smallgap: 单\smallgap: 位} - {Degree~by}, - {defense_date} - {论\smallgap: 文\smallgap: 答\smallgap: 辩\smallgap: 日\smallgap: 期} - {The~Date~of~Defence}, - } {\__bithesis_define_label_by_thesis_type:nnnn {graduate} #1} -\clist_map_inline:nn - { - {school} {学\qquad 院} {School}, - {major} {专\qquad 业} {Degree}, - {class} {班\qquad{}级} {Class}, - {author} {学生姓名} {Author}, - {student_id} {学\qquad 号} {Student~ID}, - {supervisor} {指导教师} {Supervisor}, - {co_supervisor} {校外指导教师} {Co-Supervisor}, - {keywords} {关键词:} {Key~Words:~}, - {toc} {目\label_space: 录} {Table~of~Contents}, - {abstract} {摘\label_space: 要} {Abstract}, - {conclusion} {结\label_space: 论} {Conclusions}, - {appendix} {附\label_space: 录} {Appendices}, - {ack} {致\label_space: 谢} {Acknowledgement}, - {figure} {插\label_space: 图} {Illustrations}, - {table} {表\label_space: 格} {Tables}, - {appendix_prefix} {附录} {Appendix}, - {reference} {参考文献} {References}, - {university} {北京理工大学} {Beijing~Institute~of~Technology}, - {publications} {攻读学位期间发表论文与研究成果清单} - {Publications~During~Studies}, - % TODO: Not so sure about the translation. - {resume} {作者简介} {Author~Biography}, - {symbols} {主要符号对照表} {Nomenclature}, - {algo} {算法} {Algorithm}, - {them} {定理} {Theorem}, - {lem} {引理} {Lemma}, - {prop} {命题} {Proposition}, - {cor} {推论} {Corollary}, - {axi} {公理} {Axiom}, - {defn} {定义} {Definition}, - {conj} {猜想} {Conjecture}, - {exmp} {例} {Example}, - {case} {情形} {Case}, - {rem} {注} {Remark}, - {fig} {图} {Figure}, - {tab} {表} {Table}, - {equ} {式} {Equation}, - } - {\__bithesis_define_label:nnn #1} -\clist_const:Nn \c__bithesis_bachelor_thesis_header_clist - { - 北京理工大学本科生毕业设计(论文), - 北京理工大学本科生毕业设计(论文)外文翻译, - Beijing~Institute~of~Technology~Bachelor's~Thesis, - 北京理工大学硕士学位论文, - 北京理工大学博士学位论文, - } -\clist_const:Nn \c__bithesis_bachelor_thesis_headline_clist - { - 本科生毕业设计(论文), - 本科生毕业设计(论文)外文翻译, - Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis, - } -\keys_define:nn { bithesis } -{ - info .meta:nn = { bithesis / info } {#1}, - misc .meta:nn = { bithesis / misc } {#1}, - cover .meta:nn = { bithesis / cover } {#1}, - style .meta:nn = { bithesis / style } {#1}, - option .meta:nn = { bithesis / option } {#1}, - TOC .meta:nn = { bithesis / TOC } {#1}, - appendices .meta:nn = { bithesis / appendices } {#1}, - publications .meta:nn = { bithesis / publications } {#1}, - const .meta:nn = { bithesis / const } {#1}, -} -\keys_define:nn { bithesis / option } -{ - type .choice:, - type .value_required:n = true, - type .choices:Vn = - \c__bithesis_thesis_type_clist - { - \int_set_eq:NN \g__bithesis_thesis_type_int \l_keys_choice_int - \int_case:nn {\l_keys_choice_int} { - % 本科全英文也是英文模板。 - {3} {\__bithesis_set_english_mode:} - } - }, - type .initial:n = bachelor, - twoside .bool_gset:N = \g__bithesis_twoside_bool, - blindPeerReview .bool_gset:N = \g__bithesis_blind_mode_bool, - ctex .tl_set:N = \l__bithesis_options_to_ctex_tl, - quirks .bool_gset:N = \g__bithesis_quirks_mode_bool, - % xeCJK - autoFakeBold .tl_set:N = \g__bithesis_auto_fake_bold_tl, - autoFakeBold .initial:n = {3}, - % 是否开启英文模式。目前在设计上,这个选项仅对研究生模板生效。 - % 本科生模板的英文模式是根据 |type| 选项自动判断的。 - english .code:n = { \__bithesis_set_english_mode: } , -} -\keys_define:nn { bithesis / cover } - { - date .tl_set:N = \l__bithesis_cover_date_tl, - headerImage .tl_set:N = \l_bit_coverheaderimage_tl, - xiheiFont .tl_set:N = \l__bithesis_cover_xihei_font_path_tl, - xiheiFont .default:n = {STXihei}, - %% cover entry - dilimiter .tl_set:N = \l__bithesis_cover_dilimiter_tl, - labelAlign .tl_set:N = \l__bithesis_cover_label_align_tl, - labelAlign .initial:n = {r}, - valueAlign .tl_set:N = \l__bithesis_cover_value_align_tl, - valueAlign .initial:n = {c}, - labelMaxWidth .dim_set:N = \l__bithesis_cover_label_max_width_dim, - valueMaxWidth .dim_set:N = \l__bithesis_cover_value_max_width_dim, - autoWidthPadding .dim_set:N = \l__bithesis_cover_auto_width_padding_dim, - autoWidthPadding .initial:n = {0.25em}, - autoWidth .bool_set:N = \l__bithesis_cover_auto_width_bool, - autoWidth .initial:n = {true}, - underlineThickness .dim_set:N = \l__bithesis_cover_underline_thickness_dim, - underlineThickness .initial:n = {1pt}, - underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, - underlineOffset .initial:n = { -10pt }, - hideCoverInPeerReview .bool_set:N = \l__bithesis_style_hide_cover_in_peer_review_bool, - hideCoverInPeerReview .initial:n = {false}, - } -\keys_define:nn { bithesis / info } - { - title .tl_set:N = \l__bithesis_value_title_tl, - title .initial:n = {形状记忆聚氨酯的合成及其在织物中的应用(示例)}, - titleEn .tl_set:N = \l__bithesis_value_title_en_tl, - titleEn .initial:n = {Synthesis~and~Application~on~Texttiles~of~the~Shape~Memory~Polyurethane~(example)}, - % 因为是覆盖选项,所以不需要设置初始值。 - verticalTitle .tl_set:N = \l__bithesis_value_vertical_title_tl, - school .tl_set:N = \l__bithesis_value_school_tl, - major .tl_set:N = \l__bithesis_value_major_tl, - class .tl_set:N = \l__bithesis_value_class_tl, - author .tl_set:N = \l__bithesis_value_author_tl, - studentId .tl_set:N = \l__bithesis_value_student_id_tl, - supervisor .tl_set:N = \l__bithesis_value_supervisor_tl, - % 因为默认不显示,所以不需要设置初始值。 - externalSupervisor .tl_set:N = \l__bithesis_value_external_supervisor_tl, - keywords .tl_set:N = \l__bithesis_value_keywords_tl, - keywords .initial:n = {聚氨酯,形状记忆,织物(示例)}, - keywordsEn .tl_set:N = \l__bithesis_value_keywords_en_tl, - keywordsEn .initial:n = {Polyurethane,Shape Memory,Textiles (example)}, - translationTitle .tl_set:N = \l__bithesis_value_trans_title_tl, - translationOriginTitle .tl_set:N = \l__bithesis_value_trans_origin_title_tl, - % 中图分类号,研究生学位论文使用 - classification .tl_set:N = \l__bithesis_value_classification_tl, - classification .initial:n = {TQ~028.1(示例)}, - % UDC 分类号,研究生学位论文使用 - UDC .tl_set:N = \l__bithesis_value_udc_tl, - UDC .initial:n = {540(示例)}, - chairman .tl_set:N = \l__bithesis_value_chairman_tl, - degree .tl_set:N = \l__bithesis_value_degree_tl, - degreeEn .tl_set:N = \l__bithesis_value_degree_en_tl, - institute .tl_set:N = \l__bithesis_value_institute_tl, - institute .initial:n = {\tl_use:N \c__bithesis_label_university_tl}, - defenseDate .tl_set:N = \l__bithesis_value_defense_date_tl, - authorEn .tl_set:N = \l__bithesis_value_author_en_tl, - schoolEn .tl_set:N = \l__bithesis_value_school_en_tl, - supervisorEn .tl_set:N = \l__bithesis_value_supervisor_en_tl, - chairmanEn .tl_set:N = \l__bithesis_value_chairman_en_tl, - majorEn .tl_set:N = \l__bithesis_value_major_en_tl, - instituteEn .tl_set:N = \l__bithesis_value_institute_en_tl, - instituteEn .initial:n = {\c__bithesis_label_university_en_tl}, - defenseDateEn .tl_set:N = \l__bithesis_value_defense_date_en_tl, - defenseDateEn .initial:n = {June,~2019~(example)}, - % 因为默认不显示,所以不需要设置初始值。 - classifiedLevel .tl_set:N = \l__bithesis_value_classified_level_tl, - } -\keys_define:nn { bithesis / misc } - { - % 表格字体大小,默认为 5 号字体。 - tabularFontSize .tl_set:N = \l__bithesis_misc_tabular_font_size_tl, - tabularFontSize .initial:n = {5}, - arialFont .tl_set:N = \l__bithesis_misc_arial_font_path_tl, - autoref / algo .tl_set:N = \algoautorefname, - autoref / algo .initial:n = {\g__bithesis_const_autoref_algo_tl}, - autoref / them .tl_set:N = \themautorefname, - autoref / them .initial:n = {\g__bithesis_const_autoref_them_tl}, - autoref / lem .tl_set:N = \lemautorefname, - autoref / lem .initial:n = {\g__bithesis_const_autoref_lem_tl}, - autoref / prop .tl_set:N = \propautorefname, - autoref / prop .initial:n = {\g__bithesis_const_autoref_prop_tl}, - autoref / cor .tl_set:N = \corautorefname, - autoref / cor .initial:n = {\g__bithesis_const_autoref_cor_tl}, - autoref / axi .tl_set:N = \axiautorefname, - autoref / axi .initial:n = {\g__bithesis_const_autoref_axi_tl}, - autoref / defn .tl_set:N = \defnautorefname, - autoref / defn .initial:n = {\g__bithesis_const_autoref_defn_tl}, - autoref / conj .tl_set:N = \conjautorefname, - autoref / conj .initial:n = {\g__bithesis_const_autoref_conj_tl}, - autoref / exmp .tl_set:N = \exmpautorefname, - autoref / exmp .initial:n = {\g__bithesis_const_autoref_exmp_tl}, - autoref / case .tl_set:N = \caseautorefname, - autoref / case .initial:n = {\g__bithesis_const_autoref_case_tl}, - autoref / rem .tl_set:N = \remautorefname, - autoref / rem .initial:n = {\g__bithesis_const_autoref_rem_tl}, - hideLinks .bool_set:N = \l__bithesis_misc_hide_links_bool, - hideLinks .initial:n = {true}, - autoref / figure .tl_set:N = \figureautorefname, - autoref / figure .initial:n = {\g__bithesis_const_autoref_fig_tl}, - autoref / table .tl_set:N = \tableautorefname, - autoref / table .initial:n = {\g__bithesis_const_autoref_tab_tl}, - autoref / equ .tl_set:N = \equationautorefname, - autoref / equ .initial:n = {\g__bithesis_const_autoref_equ_tl}, - } -\keys_define:nn { bithesis / const } - { - autoref .meta:nn = { bithesis / const / autoref } { #1 }, - style .meta:nn = { bithesis / const / style } { #1 }, - info .meta:nn = { bithesis / const / info } { #1 }, - } -\keys_define:nn { bithesis / const / autoref } - { - algo .tl_set:N = \g__bithesis_const_autoref_algo_tl, - algo .initial:n = {\__bithesis_get_const:N {algo}}, - them .tl_set:N = \g__bithesis_const_autoref_them_tl, - them .initial:n = {\__bithesis_get_const:N {them}}, - lem .tl_set:N = \g__bithesis_const_autoref_lem_tl, - lem .initial:n = {\__bithesis_get_const:N {lem}}, - prop .tl_set:N = \g__bithesis_const_autoref_prop_tl, - prop .initial:n = {\__bithesis_get_const:N {prop}}, - cor .tl_set:N = \g__bithesis_const_autoref_cor_tl, - cor .initial:n = {\__bithesis_get_const:N {cor}}, - axi .tl_set:N = \g__bithesis_const_autoref_axi_tl, - axi .initial:n = {\__bithesis_get_const:N {axi}}, - defn .tl_set:N = \g__bithesis_const_autoref_defn_tl, - defn .initial:n = {\__bithesis_get_const:N {defn}}, - conj .tl_set:N = \g__bithesis_const_autoref_conj_tl, - conj .initial:n = {\__bithesis_get_const:N {conj}}, - exmp .tl_set:N = \g__bithesis_const_autoref_exmp_tl, - exmp .initial:n = {\__bithesis_get_const:N {exmp}}, - case .tl_set:N = \g__bithesis_const_autoref_case_tl, - case .initial:n = {\__bithesis_get_const:N {case}}, - rem .tl_set:N = \g__bithesis_const_autoref_rem_tl, - rem .initial:n = {\__bithesis_get_const:N {rem}}, - figure .tl_set:N = \g__bithesis_const_autoref_fig_tl, - figure .initial:n = {\__bithesis_get_const:N {fig}}, - table .tl_set:N = \g__bithesis_const_autoref_tab_tl, - table .initial:n = {\__bithesis_get_const:N {tab}}, - equ .tl_set:N = \g__bithesis_const_autoref_equ_tl, - equ .initial:n = {\__bithesis_get_const:N {equ}}, - } -\keys_define:nn { bithesis / const / style } - { - substituteSymbol .tl_set:N = \g__bithesis_const_substitute_symbol_tl, - substituteSymbol .initial:n = {*}, - } -\keys_define:nn { bithesis / const / info } - { - degree .tl_set:N = \g__bithesis_const_info_degree_tl, - degree .initial:n = { - \c__bithesis_graduate_label_degree_tl - }, - major .tl_set:N = \g__bithesis_const_info_major_tl, - major .initial:n = { - \__bithesis_if_graduate:TF { - \c__bithesis_graduate_label_major_tl - } { - \__bithesis_get_const:N {major} - } - }, - } -\keys_define:nn { bithesis / style } -{ - head .tl_set:N = \l__bithesis_style_head_tl, - head .initial:n = { - \clist_item:Nn \c__bithesis_bachelor_thesis_header_clist \g__bithesis_thesis_type_int - }, - headline .tl_set:N = \l__bithesis_style_headline_tl, - headline .initial:n = { - \clist_item:Nn \c__bithesis_bachelor_thesis_headline_clist \g__bithesis_thesis_type_int - }, - bibliographyIndent .bool_set:N = \l__bithesis_style_bibliography_indent_bool, - bibliographyIndent .initial:n = {true}, - pageVerticalAlign .choices:nn = {top, scattered} { - \tl_if_eq:NnTF \l_keys_choice_tl {top} - { \raggedbottom } - { \flushbottom } - }, - pageVerticalAlign .initial:n = {top}, - % 数学字体配置 - mathFont .choices:nn = { - asana, bonum, cm, concrete, dejavu, erewhon, euler, - fira, garamond, gfsneohellenic, kp, libertinus, lm, newcm, - pagella, schola, stix, stix2, termes, xcharter, xits, none, - } { \tl_set_eq:NN \l__bithesis_style_math_font_tl \l_keys_choice_tl }, - mathFont .initial:n = {cm}, - % Options that will be pass to `unicode-math` pkgs. - unicodeMathOptions .tl_set:N = \l__bithesis_unicode_math_options_tl, - % Windows 平台开启宋体伪粗体。 - windowsSimSunFakeBold .bool_set:N = \l__bithesis_style_windows_simsum_fake_bold, - windowsSimSunFakeBold .initial:n = {false}, - % 控制英文是否使用 hyphen 进行换行 - hyphen .bool_set:N = \l__bithesis_style_hyphen_bool, - hyphen .initial:n = {true}, -} -\keys_define:nn { bithesis / TOC } -{ - abstract .bool_set:N = \l__bithesis_add_abstract_to_toc_bool, - abstract .initial:n = {true}, - abstractEn .bool_set:N = \l__bithesis_add_abstract_en_to_toc_bool, - abstractEn .initial:n = {true}, - symbols .bool_set:N = \l__bithesis_add_symbols_to_toc_bool, - symbols .initial:n = {true}, -} -\keys_define:nn { bithesis / appendices } -{ - chapterLevel .bool_set:N = \l__bithesis_appendices_chapter_level_bool, - title .tl_set:N = \l__bithesis_appendices_title_tl, - TOCTitle .tl_set:N = \l__bithesis_appendix_toc_title_tl, -} -\keys_define:nn { bithesis / publications } -{ - % mode .choice:, - % mode .value_required:n = true, - % mode .choices:Vn = - % \c__bithesis_publication_modes_clist - % { - % \int_new:N \l__bithesis_publication_mode_int - % \int_set:Nn \l__bithesis_publication_mode_int \l_keys_choice_int - % }, - % mode .initial:n = biblatex, - sorting .bool_set:N = \l__bithesis_publications_sorting_bool, - sorting .initial:n = {true}, - omit .bool_set:N = \l__bithesis_publications_omit_bool, - omit .initial:n = {false}, - maxbibnames .int_set:N = \l__bithesis_publications_maxbibnames_int, - maxbibnames .initial:n = {3}, - minbibnames .int_set:N = \l__bithesis_publications_minbibnames_int, - minbibnames .initial:n = {1}, -} -\ProcessKeysOptions { bithesis / option } -\__bithesis_if_thesis_english:T { - \PassOptionsToClass{scheme=plain}{ctexbook} -} -\bool_if:NT \g__bithesis_blind_mode_bool { - \bool_set_false:N \g__bithesis_twoside_bool -} -\bool_if:NTF \g__bithesis_twoside_bool {} { - \PassOptionsToClass{oneside}{ctexbook} -} -\PassOptionsToClass{openany}{ctexbook} -\DeclareOption*{ - \PassOptionsToClass{\l__bithesis_options_to_ctex_tl}{ctexbook} -} -\PassOptionsToPackage{quiet,AutoFakeBold=\g__bithesis_auto_fake_bold_tl,AutoFakeSlant}{xeCJK} -\ProcessOptions\relax -\LoadClass[zihao=-4,]{ctexbook} -\RequirePackage{geometry} -\RequirePackage[table,xcdraw]{xcolor} -\RequirePackage{xeCJK} -\RequirePackage{titletoc} -\RequirePackage{setspace} -\RequirePackage{graphicx} -\RequirePackage{fancyhdr} -\RequirePackage{pdfpages} -\RequirePackage{setspace} -\RequirePackage{booktabs} -\RequirePackage{multirow} -\RequirePackage{tikz} -\RequirePackage{etoolbox} -\RequirePackage[bookmarksnumbered]{hyperref} -\RequirePackage[strut=off]{caption} -\RequirePackage{array} -\RequirePackage{amsmath} -\RequirePackage{amssymb} -\RequirePackage{pifont} -\RequirePackage{amsthm} -\RequirePackage{pdfpages} -\RequirePackage{listings} -\RequirePackage{enumitem} -\RequirePackage{fmtcount} -\pdfstringdefDisableCommands{% - \let\quad\empty -} -\__bithesis_if_graduate:TF { - \int_set:Nn \g__bithesis_head_zihao_int {5} - \geometry{ - a4paper, - left=2.7cm, - bottom=2.5cm + 7bp, - top=3.5cm + 7bp, - right=2.7cm, - % `headsep' is affected by `top' option. - headsep = 3.5cm + 7bp - 2.5cm - 15bp, - headheight = 15 bp, - % `footskip' is affected by `bottom' option. - footskip = 2.5cm + 7bp - 1.8cm, - } -} { - \int_set:Nn \g__bithesis_head_zihao_int {4} - \geometry{ - a4paper, - left=3cm, - bottom=2.6cm + 7bp, - top=3.5cm + 7bp, - right=2.6cm, - % `headsep' is affected by `top' option. - headsep = 3.5cm + 7bp - 2.4cm - 20bp, - headheight = 20 bp, - % `footskip' is affected by `bottom' option. - footskip = 2.6cm + 7bp - 2cm, - } -} -\__bithesis_if_bachelor_thesis:T { - \setlength{\intextsep}{1.80\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} -} -\setmainfont{Times~New~Roman} -\setromanfont{Times~New~Roman} -\cs_new:Npn \__bithesis_font_path: - { - \str_if_eq:NNTF { \l__bithesis_font_type_tl } { font } - { } - { Path = \l__bithesis_font_path_tl / , } - } -\cs_new:Npn \__bithesis_load_unicode_math_pkg: - { - \PassOptionsToPackage { \l__bithesis_unicode_math_options_tl } { unicode-math } - \RequirePackage { unicode-math } - } -\cs_new:Npn \__bithesis_define_math_font:nn #1#2 - { - \cs_new:cpn { __bithesis_load_math_font_ #1 : } - { - \__bithesis_load_unicode_math_pkg: - \setmathfont { #2 } - } - } -\clist_map_inline:nn - { - { asana } { Asana-Math.otf }, - { concrete } { Concrete-Math.otf }, - { erewhon } { Erewhon-Math.otf }, - { euler } { Euler-Math.otf }, - { fira } { FiraMath-Regular.otf }, - { garamond } { Garamond-Math.otf }, - { gfsneohellenic } { GFSNeohellenicMath.otf }, - { kp } { KpMath-Regular.otf }, - { libertinus } { LibertinusMath-Regular.otf }, - { lm } { latinmodern-math.otf }, - { newcm } { NewCMMath-Regular.otf }, - { stix } { STIXMath-Regular.otf }, - { stix2 } { STIXTwoMath-Regular.otf }, - { xcharter } { XCharter-Math.otf }, - { xits } { XITSMath-Regular.otf }, - { bonum } { texgyrebonum-math.otf }, - { dejavu } { texgyredejavu-math.otf }, - { pagella } { texgyrepagella-math.otf }, - { schola } { texgyreschola-math.otf }, - { termes } { texgyretermes-math.otf } - } - { \__bithesis_define_math_font:nn #1 } -\cs_new:Npn \__bithesis_load_math_font_cm: { } -\cs_new:Npn \__bithesis_load_math_font_none: { } -\cs_new:Npn \__bithesis_load_font: - { - \use:c { __bithesis_load_math_font_ \l__bithesis_style_math_font_tl : } - } -\ctex_at_end_preamble:n { - % 针对 Windows 字体采用 Fake Bold 宋体 - \bool_if:NT \l__bithesis_style_windows_simsum_fake_bold - { - \RequirePackage{ifplatform} - \ifwindows - \setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant] - \fi - } - - % 在导言区末尾加载数学字体。 - \__bithesis_load_font: - - % misc / hideLinks 选项 - \bool_if:NT \l__bithesis_misc_hide_links_bool - { - \hypersetup { hidelinks } - } - - \__bithesis_if_thesis_english:TF { - \__bithesis_if_thesis_int_type:nT {3} { - % 对于本科全英文专业模板 - % Font Arial is needed. - \newfontfamily\arialfamily{Arial} - } - - } { - % 对于其他的中文模板, - % 需要加载细黑体。 - \tl_if_blank:VTF \l__bithesis_cover_xihei_font_path_tl {} - { - \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant] - {\l__bithesis_cover_xihei_font_path_tl} - } - } - - % 对于本科全英文专业模板,需要自定义日期格式。 - \__bithesis_if_thesis_int_type:nT {3} { - \RequirePackage[en-US]{datetime2} - \RequirePackage{indentfirst} - \DTMlangsetup[en-US]{dayyearsep={\space}} - } - - % Define biblatex category if it was imported. - % 这部分是给研究生模板中的 - % 「攻读学位期间发表论文与研究成果清单」使用的。 - \cs_if_exist:NT \DeclareBibliographyCategory { - \DeclareBibliographyCategory{mypub} - } - - % Define biblatex strings if it was imported. - % 这部分是给研究生模板中的 - % gbpunctin = false 时使用的。 - \cs_if_exist:NT \DefineBibliographyStrings { - \DefineBibliographyStrings{english}{in={}} - \DefineBibliographyStrings{english}{incn={}} - } - - % 修改 biblatex 中「专利」(patent)部分的著录格式。 - % 主要根据北理工自定义的规范,参考 biblatex 和 - % biblatex-gb7714-2015 的实现修改而成。 - % - % 默认不开启,因为此修改可能会产生其他边界问题。 - \bool_if:NT \g__bithesis_quirks_mode_bool { - \cs_if_exist:NT \DeclareBibliographyDriver { - % - % 重设专利title的输出,将文献类型标识符输出出去 - % - \newbibmacro*{patenttitle}{%原输出来自biblatex.def文件 - \ifboolexpr{% - test{\iffieldundef{title}}% - and% - test{\iffieldundef{subtitle}}% - }% - {}% - {\printtext[title]{\bibtitlefont% - \printfield[titlecase]{title}% - \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 - {}{\setunit{\subtitlepunct}% - \printfield[titlecase]{subtitle}}% - \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}% - \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 - {\setunit{\subtitlepunct}\printfield{titleaddon}}% - % :地区 - \setunit{\subtitlepunct}\iflistundef{location} - {} - {\setunit*{\subtitlepunct}% - \printtext{%[parens] - \printlist[][-\value{listtotal}]{location}}}% - % ,专利号 - \setunit{\addcomma\addspace}\printfield{number}%写专利号 - \setunit{\addcomma\addspace} - \usebibmacro{newsdate}% - }% - }% - } - - % - % 重定义专利文献驱动 - % - \DeclareBibliographyDriver{patent}{%源来自standard.BBX - \usebibmacro{bibindex}% - \usebibmacro{begentry}% - \usebibmacro{author}% - \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 - \usebibmacro{patenttitle}%给出专利专用的标题输出 - \iftoggle{bbx:gbstrict}{}{% - \newunit% - \printlist{language}% - \newunit\newblock - \usebibmacro{byauthor} - }% - \newunit\newblock - \printfield{type}% - \setunit*{\addspace}% - \newunit\newblock - \usebibmacro{byholder}% - \newunit\newblock - \printfield{note}% - \newunit\newblock - \usebibmacro{doi+eprint+url}% - \newunit\newblock - \usebibmacro{addendum+pubstate}% - \setunit{\bibpagerefpunct}\newblock - \usebibmacro{pageref}% - \newunit\newblock - \iftoggle{bbx:related} - {\usebibmacro{related:init}% - \usebibmacro{related}} - {}% - \usebibmacro{annotation}\usebibmacro{finentry}} - } - } -} -\cs_new:Npn \xihei:n #1 { - \xeCJK_family_if_exist:nTF {xihei} { - \CJKfamily{xihei} #1 - }{ - \heiti #1 - } -} -\cs_new:Npn \l__bithesis_title_font_cs:n #1 { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - \arialfamily #1 - } { - \heiti #1 - } -} -\cs_new:Npn \l__bithesis_unnumchapter_style_cs:n #1 { - % 本科全英文、研究生学位论文需要加粗 - \int_compare:nNnTF {\g__bithesis_thesis_type_int} > {2} - { - \bfseries #1 - } { - \mdseries #1 - } -} -\cs_set:Npn \arabicHeiti #1 {#1} -\fancypagestyle{BIThesis}{ - \fancyhf{} - % 定义页眉、页码 - \fancyhead[C]{ - \zihao{\int_use:N \g__bithesis_head_zihao_int} - \ziju{0.08} - \songti{\tl_use:N \l__bithesis_style_head_tl} - } - \fancyfoot[C]{\songti\zihao{5} \thepage} - % 页眉分割线稍微粗一些 - \RenewDocumentCommand \headrulewidth {} {0.6pt} -} -\ctexset{chapter={ - number = {\arabicHeiti{ \arabic{chapter} }}, - format = { \l__bithesis_title_font_cs:n \bfseries \centering \zihao{3}}, - nameformat = {}, - titleformat = {}, - aftername = \hspace{9bp}, - pagestyle = BIThesis, - beforeskip = 8bp, - afterskip = 32bp, - fixskip = true, - lofskip = 0cm, - lotskip = 0cm, - } -} - -\ctexset{section={ - number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}}}, - format = {\l__bithesis_title_font_cs:n \raggedright \bfseries \zihao{4}}, - nameformat = {}, - titleformat = {}, - aftername = \hspace{8bp}, - beforeskip = 20bp plus 1ex minus .2ex, - afterskip = 18bp plus .2ex, - fixskip = true, - } -} - -\ctexset{subsection={ - number = { - \arabicHeiti{ - \thechapter.\hspace{1bp} - \arabic{section}.\hspace{1bp} - \arabic{subsection} - } - }, - format = {\l__bithesis_title_font_cs:n \bfseries \raggedright \zihao{-4}}, - nameformat = {}, - titleformat = {}, - aftername = \hspace{7bp}, - beforeskip = 17bp plus 1ex minus .2ex, - afterskip = 14bp plus .2ex, - fixskip = true, - } -} - -\ctexset{ - secnumdepth = 3, - subsubsection={ - numbering = true, - number = { - \arabicHeiti{ - \arabic{chapter}.\hspace{1bp} - \arabic{section}.\hspace{1bp} - \arabic{subsection}.\hspace{1bp} - \arabic{subsubsection} - } - }, - format={\l__bithesis_title_font_cs:n \raggedright \zihao{-4}}, - nameformat = {}, - titleformat = {}, - beforeskip=14bp plus 1ex minus .2ex, - afterskip=14bp plus .2ex, - fixskip=true, - } -} -\addtocontents{toc}{\protect\hypersetup{hidelinks}} - -\__bithesis_if_graduate:TF { - % 对于研究生模板,定义各章标题为宋体四号。 - \titlecontents{chapter}[0pt]{\songti \zihao{4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % section 标题为宋体小四号。缩进为两个字符宽度。 - \titlecontents{section}[2\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % subsection 标题为宋体小四号。缩进为四个字符宽度。 - \titlecontents{subsection}[4\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} -} { - % 对于其他,定义各章标题为宋体小四号。 - \titlecontents{chapter}[0pt]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % section 标题为宋体小四号。 - \titlecontents{section}[1\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % subsection 标题为宋体小四号。 - \titlecontents{subsection}[2\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} -} -\titlecontents{figure}[0pt]{\songti\zihao{-4}} - {\figurename~\thecontentslabel\quad}{\hspace*{-1.5cm}} - {\hspace{.5em}\titlerule*{.}\contentspage} -\titlecontents{table}[0pt]{\songti\zihao{-4}} - {\tablename~\thecontentslabel\quad}{\hspace*{-1.5cm}} - {\hspace{.5em}\titlerule*{.}\contentspage} -\RenewDocumentCommand \frontmatter {} { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - % 本科全英文专业论文,页码使用小罗马数字。 - \pagenumbering{roman} - } { - \pagenumbering{Roman} - } - % 这部分的章节标题不进行编号。 - \ctexset{ - chapter = { - numbering = false, - } - } - \setstretch{1.53} - \pagestyle{BIThesis} - - % 表格内容默认使用五号字。 - % - % 由于这种方式会影响所有的表格, - % 所以我们尽可能延迟这种影响。 - % - % 不过,在目前的代码实现中没有在封面 - % 之类的地方使用表格,所以目前即使放在 - % preamble 中也不会有影响。 - \AtBeginEnvironment{tabular}{\zihao{\l__bithesis_misc_tabular_font_size_tl}} - \AtBeginEnvironment{tabular*}{\zihao{\l__bithesis_misc_tabular_font_size_tl}} -} -\RenewDocumentCommand \mainmatter {} { - % 另起一个空页,以便于后续的章节标题编号。 - % \clearpage - \cleardoublepage - % 这部分的章节标题进行编号。 - \ctexset{ - chapter = { - numbering = true, - } - } - % 页码使用阿拉伯数字。 - \pagenumbering{arabic} - \pagestyle{BIThesis} - % 正文 22 磅的行距 - \setlength{\parskip}{0em} - \setstretch{1.53} - % 修复脚注出现跨页的问题 - \interfootnotelinepenalty=10000 -} -\RenewDocumentCommand \backmatter {} { - % 同样,所有的章节标题不进行编号。 - \setcounter{section}{0} - \setcounter{subsection}{0} - \setcounter{subsubsection}{0} - \ctexset{ - chapter = { - numbering = false, - beforeskip = 18bp, - format = { - \l__bithesis_title_font_cs:n \l__bithesis_unnumchapter_style_cs:n \centering \zihao{3} - }, - afterskip = 26bp, - } - } -} -\setlength{\abovecaptionskip}{11pt} -\__bithesis_if_bachelor_thesis:TF { - \__bithesis_if_thesis_english:TF { - \setlength{\belowcaptionskip}{9pt} - } { - % 为了满足 “前后一行空白的问题”,需要删除 Caption 下方的间距。 - % 详见 `caption` 宏包手册和 - % https://github.com/CTeX-org/forum/issues/86 - % - % 这里实际的 skip 在 15pt 左右,但是全部移除会导致当图片置于页面顶部时, - % 图片与上方的间距过小,因此这里只移除 5pt。 - % 当然,这样会导致文本间的图片的 Caption 下方的间距微微大于一行。 - \captionsetup{belowskip=-5pt} - } -} { - % 而研究生模板不存在这个问题。 - \setlength{\belowcaptionskip}{9pt} -} -\__bithesis_if_graduate:TF { - \tl_set:Nn \g__bithesis_label_divide_char_tl {.} -} { - \tl_set:Nn \g__bithesis_label_divide_char_tl {-} -} -\cs_set:Npn \thefigure {\thechapter\g__bithesis_label_divide_char_tl\arabic{figure}} -\captionsetup[figure]{font=small,labelsep=space} - -\cs_set:Npn \thetable {\thechapter\g__bithesis_label_divide_char_tl\arabic{table}} -\captionsetup[table]{font=small,labelsep=space} - -\cs_set:Npn \theequation {\thechapter\g__bithesis_label_divide_char_tl\arabic{equation}} - -\AtBeginDocument{ - \cs_gset:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}} - \cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl} -} -\captionsetup[lstlisting]{font=small,labelsep=space} -\bool_if:NF \l__bithesis_style_hyphen_bool { - \hbadness=10000 - \tolerance=1 - \emergencystretch=\maxdimen - \hyphenpenalty=10000 -} -\definecolor{codegreen}{rgb}{0,0.6,0} -\definecolor{codegray}{rgb}{0.5,0.5,0.5} -\definecolor{codepurple}{rgb}{0.58,0,0.82} -\definecolor{backcolour}{rgb}{0.95,0.95,0.92} -\lstdefinestyle{examplestyle}{ - backgroundcolor=\color{backcolour}, - commentstyle=\color{codegreen}, - keywordstyle=\color{magenta}, - numberstyle=\tiny\color{codegray}, - stringstyle=\color{codepurple}, - basicstyle=\ttfamily\footnotesize, - breakatwhitespace=false, - breaklines=true, - captionpos=b, - keepspaces=true, - numbers=left, - numbersep=5pt, - showspaces=false, - showstringspaces=false, - showtabs=false, - tabsize=2 -} -\lstset{style=examplestyle} -\cs_set:Npn \listfigurename {\__bithesis_get_const:N {figure}} -\cs_set:Npn \listtablename {\__bithesis_get_const:N {table}} -\theoremstyle{plain} - \newtheorem{algo}{\__bithesis_get_const:N {algo}}[chapter] - \newtheorem{them}{\__bithesis_get_const:N {them}}[chapter] - \newtheorem{lem}{\__bithesis_get_const:N {lem}}[chapter] - \newtheorem{prop}{\__bithesis_get_const:N {prop}}[chapter] - \newtheorem{cor}{\__bithesis_get_const:N {cor}}[chapter] - \newtheorem{axi}{\__bithesis_get_const:N {axi}}[chapter] -\theoremstyle{definition} - \newtheorem{defn}{\__bithesis_get_const:N {defn}}[chapter] - \newtheorem{conj}{\__bithesis_get_const:N {conj}}[chapter] - \newtheorem{exmp}{\__bithesis_get_const:N {exmp}}[chapter] - \newtheorem{case}{\__bithesis_get_const:N {case}} -\theoremstyle{remark} - \newtheorem{rem}{\__bithesis_get_const:N {rem}} - \renewcommand{\qedsymbol}{\ensuremath{\blacksquare}} -\cs_new:Npn \__bithesis_dunderline:nnn #1#2#3 { - {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}} -} -\cs_new:Npn \__bithesis_dunderline:nn #1#2 { - \__bithesis_dunderline:nnn {#1} {1pt} {#2} -} -\cs_new:Npn \__bithesis_dunderline:n #1 { - \__bithesis_dunderline:nnn {-10pt} {1pt} {#1} -} -\newcommand\dunderline[3][-1pt]{{% - \setbox0=\hbox{#3} - \ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}} -\cs_new:Npn \__bithesis_render_cover_entry:nn #1#2 { - \makebox[\l__bithesis_cover_label_max_width_dim][\l__bithesis_cover_label_align_tl]{ - \tl_if_blank:VTF #1 {} {#1\l__bithesis_cover_dilimiter_tl} - } - \hspace{1ex} - \__bithesis_dunderline:nnn{\l__bithesis_cover_underline_offset_dim} - {\l__bithesis_cover_underline_thickness_dim}{ - \makebox[\l__bithesis_cover_value_max_width_dim][\l__bithesis_cover_value_align_tl]{#2} - }\par -} -\cs_new:Npn \__bithesis_get_text_width:Nn #1#2 - { - \hbox_set:Nn \l_tmpa_box {#2} - \dim_set:Nn #1 { \box_wd:N \l_tmpa_box } - } -\cs_generate_variant:Nn \__bithesis_get_text_width:Nn { NV } -\cs_new:Npn \__bithesis_get_max_text_width:NN #1#2 - { - \group_begin: - \seq_set_eq:NN \l__bithesis_tmpa_seq #2 - \dim_zero_new:N \l__bithesis_tmpa_dim - \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_tmpa_seq } - { - \seq_pop_left:NN \l__bithesis_tmpa_seq \l__bithesis_tmpa_tl - \__bithesis_get_text_width:NV \l__bithesis_tmpa_dim \l__bithesis_tmpa_tl - % 在两边加上空白,避免文本太靠边。 - \dim_gset:Nn #1 { \dim_max:nn {#1} { \l__bithesis_tmpa_dim + \l__bithesis_cover_auto_width_padding_dim * 2} } - } - \group_end: - } -\cs_new:Npn \__bithesis_parse_entry #1 #2 { - \seq_set_split:Nnx \l__bithesis_tmp_right_seq {\\} {#2} - \seq_clear:N \l__bithesis_tmp_left_seq - \seq_map_inline:Nn \l__bithesis_tmp_right_seq { - \seq_put_right:Nn \l__bithesis_tmp_left_seq {} - } - \seq_put_left:Nn \l__bithesis_tmp_left_seq {#1} - \seq_pop_right:NN \l__bithesis_tmp_left_seq \g__bithesis_trashcan_tl -} -\cs_new:Npn \__bithesis_render_cover_entry:n #1 { - % 左边是标签,右边是值。 - % 形如: - % { {label_1} {value_1}, {label_2} {value 2} } - % 首先转换成 seq 类型。 - \seq_set_from_clist:NN \l__bithesis_input_seq #1 - \seq_map_inline:Nn \l__bithesis_input_seq { - % 然后对于每一对 label 和 value,首先查找 - % value 中是否含有 \\ 字符,如果有,则将其分割成多个 - % label - value 对。 - % 比如 {label_1} {value \\ 1} 会被转换成 - % { {label_1} {value}, {} {1} } - \__bithesis_parse_entry ##1 - % 然后将这些 label - value 对添加到 \l__bithesis_right_seq - % 或者 \l__bithesis_left_sql 中。 - % left 就是 label,right 就是 value。 - \seq_concat:NNN \l__bithesis_right_seq \l__bithesis_right_seq \l__bithesis_tmp_right_seq - \seq_concat:NNN \l__bithesis_left_seq \l__bithesis_left_seq \l__bithesis_tmp_left_seq - } - - % 如果用户选择自动计算最大宽度,则计算最大宽度。 - \bool_if:NT \l__bithesis_cover_auto_width_bool { - \__bithesis_get_max_text_width:NN \l__bithesis_cover_label_max_width_dim \l__bithesis_left_seq - \__bithesis_get_max_text_width:NN \l__bithesis_cover_value_max_width_dim \l__bithesis_right_seq - } - - % 最后,根据宽度渲染 label 和 value 对。 - \group_begin: - \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_left_seq } - { - \seq_pop_left:NN \l__bithesis_left_seq \l__bithesis_tmpa_tl - \seq_pop_left:NN \l__bithesis_right_seq \l__bithesis_tmpb_tl - \tl_if_empty:xTF \l__bithesis_tmpb_tl {} { - \__bithesis_render_cover_entry:nn {\l__bithesis_tmpa_tl} {\l__bithesis_tmpb_tl} - } - } - \group_end: -} -\cs_new:Npn \make_graduate_cover: { - \cleardoublepage - \begin{titlepage} - { - \heiti\zihao{5} - \tl_if_blank:VTF \l__bithesis_value_classified_level_tl {} { - \flushright - \c__bithesis_label_classified_level_tl:~ - \l__bithesis_value_classified_level_tl \par - } - } - \centering - \vspace*{65mm} - {\heiti\zihao{-2} \l__bithesis_value_title_tl} - \vskip 60mm - % 黑体 小三 - {\heiti \zihao{-3} \__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl}} - \vskip 10mm - % 黑体 小三 - {\heiti \zihao{-3} \l__bithesis_cover_date_tl} - \end{titlepage} -} -\cs_new:Npn \make_paper_back: { - \cleardoublepage - \begin{titlepage} - \vskip 5cm - \begin{center} - \setstretch{1.1} - \begin{minipage}[t][19.7cm]{2em} - \begin{center} - { - \heiti\zihao{3} - \tl_if_blank:VTF \l__bithesis_value_vertical_title_tl - {\l__bithesis_value_title_tl}{\l__bithesis_value_vertical_title_tl} - } - \vfill - {\heiti\zihao{3}\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl}} - \vfill - {\heiti\zihao{3}\c__bithesis_label_university_tl} - \end{center} - \end{minipage} - \end{center} - % \vskip 5cm - \end{titlepage} -} -\cs_new:Npn \__bithesis_make_chinese_title_page: { - \cleardoublepage - \begin{titlepage} - { - % 密级、分类号 - {\heiti \zihao{5} \noindent \c__bithesis_label_classification_tl} - \l__bithesis_value_classification_tl\\ - {\heiti \zihao{5} \c__bithesis_label_udc_tl} \l__bithesis_value_udc_tl - } - - \begin{center} - - \vskip \stretch{1} - - {\heiti\zihao{-2} \l__bithesis_value_title_tl} - - \vskip \stretch{1} - - \def\tabcolsep{1pt} - \def\arraystretch{1.5} - - { - \renewcommand{\baselinestretch}{2} - - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\qquad} - } - \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} - - % 如果不是自动计算宽度,且用户没有自定义宽度, - % 则尝试提供一个默认宽度。 - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {45mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {60mm} - } - } - - % 渲染信息。 - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_tl} {\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl}}, - {\c__bithesis_graduate_label_school_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_graduate_label_supervisor_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_tl}}, - {\c__bithesis_graduate_label_chairman_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_tl}}, - {\g__bithesis_const_info_degree_tl} {\l__bithesis_value_degree_tl}, - {\g__bithesis_const_info_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_graduate_label_institute_tl} {\l__bithesis_value_institute_tl}, - {\c__bithesis_graduate_label_defense_date_tl} {\l__bithesis_value_defense_date_tl}, - } - - \heiti\zihao{-3} - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - } - \end{center} - \vskip \stretch{0.5} - \end{titlepage} -} -\cs_new:Npn \__bithesis_make_english_title_page: { - \begin{titlepage} - \begin{center} - - \vspace*{10em} - - { - \zihao{-2} - \textbf{\l__bithesis_value_title_en_tl} - } - - \vskip \stretch{1} - - { - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:~} - } - - \tl_set:Nn \l__bithesis_cover_label_align_tl {l} - \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} - - % 如果不是自动计算宽度,且用户没有自定义宽度, - % 则尝试提供一个默认宽度。 - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {55mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {85mm} - } - } - - % 渲染信息。 - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_author_en_tl}}, - {\c__bithesis_graduate_label_school_en_tl} {\l__bithesis_value_school_en_tl}, - {\c__bithesis_graduate_label_supervisor_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_en_tl}}, - {\c__bithesis_graduate_label_chairman_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_en_tl}}, - {\c__bithesis_graduate_label_degree_en_tl} {\l__bithesis_value_degree_en_tl}, - {\c__bithesis_graduate_label_major_en_tl} {\l__bithesis_value_major_en_tl}, - {\c__bithesis_graduate_label_institute_en_tl} {\l__bithesis_value_institute_en_tl}, - {\c__bithesis_graduate_label_defense_date_en_tl} {\l__bithesis_value_defense_date_en_tl}, - } - - \zihao{-3} - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - } - - \end{center} - - \vskip \stretch{0.5} - \end{titlepage} -} -\newcommand{\circled}[2][]{\tikz[baseline=(char.base)] - {\node[shape = circle, draw, inner~sep = 1pt] - (char) {\phantom{\ifblank{#1}{#2}{#1}}}; - \node at (char.center) {\makebox[0pt][c]{#2}};}} -\robustify{\circled} -\cs_new:Npn \__bithesis_graduate_originality: - { - % 取消页眉页脚。 - \ctexset { - chapter / pagestyle = plain, - } - - \begin{titlepage} - % 不计算页码。 - \pagenumbering{gobble} - - % 原创性声明部分 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{3} - \c__bithesis_graduate_label_originality_tl - } - \end{center} - - % 本部分字号为四号。 - \zihao{4} - \qquad\c__bithesis_graduate_label_originality_clause_tl - - \vspace{17mm} - - \begin{flushright} - \c__bithesis_graduate_label_originality_author_signature_tl\par - \end{flushright} - - \vspace{16mm} - - % 使用授权声明部分。 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{3} - \c__bithesis_graduate_label_authorization_tl - } - \end{center} - - \qquad\c__bithesis_graduate_label_authorization_clause_tl - - \vspace*{15mm} - - \begin{flushright} - \begin{spacing}{1.65} - \zihao{4} - % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} - \c__bithesis_graduate_label_originality_author_signature_tl\par - \c__bithesis_graduate_label_originality_supervisor_signature_tl\par - \end{spacing} - \end{flushright} - \end{titlepage} - \cleardoublepage - } -\DeclareDocumentCommand \BITSetup { m } - { \keys_set:nn { bithesis } { #1 }} -\DeclareDocumentCommand \BigStar { } - { \ding{72} } - \NewDocumentEnvironment {blindPeerReview} {O{\c_true_bool} +b} - { - \bool_if:nTF {\g__bithesis_blind_mode_bool && #1} {} { - #2 - } - } {} -\RenewDocumentCommand \cleardoublepage { } - { - \clearpage - \bool_if:NT \g__bithesis_twoside_bool - { - \int_if_odd:nF \c@page - { \hbox:n { } \thispagestyle { empty } \newpage } - } - } -\DeclareDocumentCommand \SecretInfo { m o } - { - \IfValueTF {#2} { - \__bithesis_secret_info:nn {#1} {#2} - } { - \__bithesis_secret_info:x {#1} - } - } -\DeclareDocumentCommand \MakeCover {} - { - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \group_begin: - - \int_case:nn {\g__bithesis_thesis_type_int} - { - {1} - { - \begin{titlepage} - \vspace*{16mm} - - \centering - - \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { - \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ - } - - \vspace*{-3mm} - - \zihao{-0}\textbf{\ziju{0.12}\songti{\l__bithesis_style_headline_tl}}\par - - \vspace{16mm} - - \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par - - \vspace{3mm} - - \begin{spacing}{1.2} - \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par - \end{spacing} - - \vspace{15mm} - - \begin{spacing}{1.8} - \begin{center} - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} - } - % if not auto width, try override width - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} - } - } - - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, - {\g__bithesis_const_info_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, - } - - \zihao{3} - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{center} - \end{spacing} - - \vspace*{\fill} - \centering - \zihao{3}\ziju{0.5}\songti{ - \tl_if_empty:NTF \l__bithesis_cover_date_tl { - \today - } { - \l__bithesis_cover_date_tl - } - } - \end{titlepage} - } - {2} - { - \begin{titlepage} - \centering - - \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { - \includegraphics[width=6.87cm]{\l_bit_coverheaderimage_tl}\\ - } - - \vspace{1.2mm} - - \zihao{2}\textbf{\songti{\l__bithesis_style_headline_tl}} - - \vspace{10mm} - - { - - \begin{spacing}{1.8} - - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\textbf{:}} - \bool_set_false:N \l__bithesis_cover_auto_width_bool - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {115mm} - - \clist_set:Nn \l__bithesis_input_clist { - {\zihao{4}\textbf{外文原文题目}} {\l__bithesis_value_trans_origin_title_tl}, - {\zihao{4}\textbf{中文翻译题目}} {\l__bithesis_value_trans_title_tl}, - } - - \zihao{-3} - \centering - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{spacing} - - } - - \vspace{19mm} - - \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par - - \vspace{3mm} - - \begin{spacing}{1.2} - \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par - \end{spacing} - - \vspace{19mm} - - \begin{spacing}{1.8} - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} - } - - % 如果不是自动计算宽度,且用户没有自定义宽度, - % 则尝试提供一个默认宽度。 - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} - } - } - - \zihao{3} - - % 渲染信息。 - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, - } - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{spacing} - - \vspace*{\fill} - \end{titlepage} - } - {3} { - \begin{titlepage} - \vspace*{16mm} - - \centering - - \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { - \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ - } - - \vspace*{-3mm} - - \zihao{1}\textbf{\ziju{0.12}\l__bithesis_style_headline_tl}\par - - \vspace{18mm} - - \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_en_tl}\par - - \vspace{10mm} - - \begin{spacing}{1.8} - \begin{center} - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} - } - - % if not auto width, try override width - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {20mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {105mm} - } - } - - \zihao{4} - - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_label_school_en_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_label_major_en_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_author_en_tl} {\l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_en_tl} {\l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_en_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_en_tl} {\l__bithesis_value_external_supervisor_tl}, - } - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{center} - \end{spacing} - - \vspace*{\fill} - \centering - \zihao{3}\ziju{0.5}\songti{ - \tl_if_empty:NTF \l__bithesis_cover_date_tl { - \today - } { - \l__bithesis_cover_date_tl - } - } - \end{titlepage} - } - {4} { - \make_graduate_cover: - } - {5} { - \make_graduate_cover: - } - } - \group_end: - \end{blindPeerReview} - } -\NewDocumentCommand \MakeOriginality {} - { - \group_begin: - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \int_case:nn {\g__bithesis_thesis_type_int} - { - {1} - { - \pagestyle{BIThesis} - \pagenumbering{gobble} - - % 原创性声明部分 - \begin{center} - \vspace*{-2bp} - \__bithesis_same_page: - \chapter*{\heiti\zihao{2}\c__bithesis_bachelor_label_originality_tl} - \end{center}~\par - - % 本部分字号为小三。 - \zihao{-3} - \c__bithesis_bachelor_label_originality_clause_tl - - \vspace{17mm} - - \begin{flushright} - \c__bithesis_bachelor_label_originality_author_signature_tl\par - \end{flushright} - - \vspace{16mm} - - % 使用授权声明部分 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{2} - \c__bithesis_bachelor_label_authorization_tl - } - \end{center}~\par - - \c__bithesis_bachelor_label_authorization_clause_tl - - \vspace*{3mm} - - \begin{flushright} - \begin{spacing}{1.65} - \zihao{-3} - % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} - \c__bithesis_bachelor_label_originality_author_signature_tl\par - \c__bithesis_bachelor_label_originality_supervisor_signature_tl\par - \end{spacing} - \end{flushright} - - \newpage - } - {3} { - \setstretch{1.26} - % 原创性声明部分 - \begin{center} - \vspace*{-2bp} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{-2} - \c__bithesis_bachelor_english_label_originality_tl - } - \end{center}~\par - - % 本部分字号为小三 - \zihao{-4} - \c__bithesis_bachelor_english_label_originality_clause_tl - - \bigbreak - - Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~Date:\par - - \vspace{6mm} - - % 使用授权声明部分 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{-2} - \c__bithesis_bachelor_english_label_authorization_tl - } - \end{center}~\par - - \c__bithesis_bachelor_english_label_authorization_clause_tl - - \bigbreak - Student~(Signature):~ - \dunderline[-1pt]{1pt}{\makebox[18mm + 16bp]{}}~ - \hspace{2mm}Date:\par - Supervisor~(Signature):~ - \dunderline[-1pt]{1pt}{\makebox[18mm]{}}~ - \hspace{2mm}Date:\par - } - {4} {\__bithesis_graduate_originality:} - {5} {\__bithesis_graduate_originality:} - } - % 单独成页 - \clearpage - \end{blindPeerReview} - \group_end: - } -\NewDocumentCommand \MakePaperBack {} - { - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \make_paper_back: - \end{blindPeerReview} - } -\NewDocumentCommand \MakeTitle {} - { - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \__bithesis_make_chinese_title_page: - \__bithesis_make_english_title_page: - \end{blindPeerReview} - } -\DeclareDocumentCommand \MakeTOC {} - { - { - \__bithesis_if_bachelor_thesis:TF { - \renewcommand{\baselinestretch}{1.35} - } { - \renewcommand{\baselinestretch}{1.56} - } - - \__bithesis_if_thesis_english:TF { - \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_en_tl} - } { - \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_tl} - } - - % 自定义目录样式 - \cs_set:Npn \contentsname { - \fontsize{16pt}{\baselineskip} - \l__bithesis_unnumchapter_style_cs:n - \l__bithesis_title_font_cs:n - {\l__bithesis_toc_title_tl} - \vspace{-8pt} - } - - % 制作目录 - \tableofcontents - - % 在本科生全英文模板中,添加「目录」本身到目录中。 - \__bithesis_if_thesis_int_type:nT {3} { - \addcontentsline{toc}{chapter}{\c__bithesis_label_toc_en_tl} - } - - % 单独成页 - \clearpage - } - } -\NewDocumentEnvironment {abstract} {} - { - - \cleardoublepage - \setstretch{1.53} - - \__bithesis_if_bachelor_thesis:T { - \begin{center} - \vspace*{-17bp} - \heiti\zihao{-2}\textbf{ - \int_case:nn {\g__bithesis_thesis_type_int} - { - {1} {\l__bithesis_value_title_tl} - {2} {\l__bithesis_value_trans_title_tl} - {3} {\l__bithesis_value_title_tl} - } - } - \end{center} - - \vspace*{2mm} - } - - \ctexset{ - chapter/numbering = false, - } - - \__bithesis_if_bachelor_thesis:T { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - \ctexset{ - chapter/titleformat = {\heiti} - } - } - { - \ctexset{ - chapter/titleformat = {\textmd} - } - } - } - - { - \__bithesis_same_page: - \bool_if:NTF \l__bithesis_add_abstract_to_toc_bool { - \chapter{\c__bithesis_label_abstract_tl} - } { - \chapter*{\c__bithesis_label_abstract_tl} - \currentpdfbookmark{\c__bithesis_label_abstract_tl}{ch:abstract} - } - } - \vspace*{1mm} - \par - } - { - \par - \vspace{4ex} - \noindent - \__bithesis_if_graduate:TF { - % 研究生模板中,“关键词”宋体小四加粗 - % 关键词为宋体小四号字。 - \textbf{\c__bithesis_label_keywords_tl}\l__bithesis_value_keywords_tl\par - } { - % 本科生模板中,关键词为黑体加粗 - \textbf{\heiti \c__bithesis_label_keywords_tl \l__bithesis_value_keywords_tl}\par - } - \newpage - } -\NewDocumentEnvironment {abstractEn} {} - { - \setstretch{1.53} - - \__bithesis_if_bachelor_thesis:T { - \begin{spacing}{0.95} - \centering - \vspace*{-2bp} - - \__bithesis_if_thesis_int_type:nTF {3} { - \arialfamily\zihao{-2}\textbf - \l__bithesis_value_title_en_tl\\ - } { - \heiti\zihao{3}\textbf - \l__bithesis_value_title_en_tl\\ - } - \end{spacing} - \vspace*{10mm} - } - - \ctexset{ - chapter/numbering = false, - } - - \__bithesis_if_bachelor_thesis:TF { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - \ctexset{ - chapter = { - titleformat = {\heiti\zihao{3}\centering\textbf}, - } - } - } { - \ctexset{ - chapter = { - titleformat = {\heiti\zihao{-3}\centering\textmd}, - } - } - } - } { - \ctexset { - chapter/titleformat = {\heiti\zihao{3}\centering\textbf} - } - } - - { - \__bithesis_same_page: - \bool_if:nTF {\l__bithesis_add_abstract_en_to_toc_bool} { - \chapter{\c__bithesis_label_abstract_en_tl} - } { - \chapter*{\c__bithesis_label_abstract_en_tl} - \currentpdfbookmark{\c__bithesis_label_abstract_en_tl}{ch:abstract:en} - } - } - } - { - \par\vspace{3ex}\noindent - \__bithesis_if_graduate:TF { - % Times New Roman小四号字,行距22磅 - % “Key Words” - % Times New Roman小四号字加粗 - \textbf{\c__bithesis_label_keywords_en_tl} \l__bithesis_value_keywords_en_tl - } { - \textbf{\c__bithesis_label_keywords_en_tl \l__bithesis_value_keywords_en_tl} - } - \newpage - } - -\NewDocumentEnvironment {conclusion} {} - { - \ctexset{ - section/number = \arabic{section} - } - - \__bithesis_if_thesis_english:TF { - \chapter{\c__bithesis_label_conclusion_en_tl} - } { - \chapter{\c__bithesis_label_conclusion_tl} - } - } - {} -\NewDocumentEnvironment {bibprint} {} - { - % 设置参考文献字号为 5 号 - \renewcommand*{\bibfont}{\zihao{5}} - % 设置参考文献各个项目之间的垂直距离为 0 - \setlength{\bibitemsep}{0ex} - \setlength{\bibnamesep}{0ex} - \setlength{\bibinitsep}{0ex} - \__bithesis_if_graduate:TF { - } { - % 「本科生」设置单倍行距 - \renewcommand{\baselinestretch}{1.2} - } - % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 - \setlength{\biblabelsep}{1.7mm} - - \bool_if:NF \l__bithesis_style_bibliography_indent_bool { - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} - } - } - - \__bithesis_if_thesis_english:TF { - \chapter{\c__bithesis_label_reference_en_tl} - } { - \chapter{\c__bithesis_label_reference_tl} - } - } - {} -\NewDocumentEnvironment {appendices} {} - { - % Used in chapter, ToC. - \tl_new:N \l__bithesis_appendix_plain_label_tl - % Used before reference label. - \tl_new:N \l__bithesis_appendix_default_title_tl - - \__bithesis_if_thesis_english:TF { - \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_en_tl} - \tl_set:Nn \l__bithesis_appendix_default_title_tl {\c__bithesis_label_appendix_en_tl} - } { - \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_tl} - \tl_set:Nn \l__bithesis_appendix_default_title_tl {\c__bithesis_label_appendix_tl} - } - - \bool_if:NTF \l__bithesis_appendices_chapter_level_bool { - % 附录章节级别 - - % 仅设置 \setcounter{chapter}{0} 时,pdf 目录会索引到正文章节。 - % 因此,需要使用 \appendix 重置计数器,并将附录后面的 - % 几个章节视为特殊的附录页。 - \appendix - - \ctexset{ - chapter/numbering = true, - chapter/name = {}, - chapter/number = \l__bithesis_appendix_plain_label_tl\hspace{1ex}\Alph{chapter}, - section/number = \Alph{chapter}. \arabic{section}, - subsection/number = \Alph{chapter}. \arabic{section}. \arabic{subsection}, - } - - \cs_set:Npn \thechapter { - \Alph{chapter} - } - } { - % 附录节(section)级别 - - % 因为不需要用到 chapter counter, 所以直接加一即可。 - \stepcounter{chapter} - \setcounter{section}{0} - % (与上面方法至少用一个) - % 需要让 section 在 pdf bookmark 中输出字母而不是数字。 - % 详见 hyperref 代码。 - \gdef\theHsection{\Alph{section}} - - % 定义 \thefigure 采用节而不是章 -\cs_set:Npn \thefigure {\theHsection \g__bithesis_label_divide_char_tl\arabic{figure}} - - \ctexset{ - section/number = \l__bithesis_appendix_plain_label_tl\hspace{1ex}\Alph{section}, - subsection/number = \Alph{section}. \arabic{subsection}, - } - - \cs_gset:Npn \thechapter { - \Alph{section} - } - % \gdef \thechapter{\Alph{section}} - - \tl_if_blank:VTF \l__bithesis_appendices_title_tl { - \chapter{\l__bithesis_appendix_default_title_tl} - } { - \chapter*{\l__bithesis_appendices_title_tl} - \stepcounter{chapter} - \tl_if_blank:VTF \l__bithesis_appendix_toc_title_tl { - \addcontentsline{toc}{chapter}{\l__bithesis_appendix_default_title_tl} - } { - \addcontentsline{toc}{chapter}{\l__bithesis_appendix_toc_title_tl} - } - } - } - } - { - } -\NewDocumentEnvironment {acknowledgements} {+b} - { - \begin{blindPeerReview} - % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。 - % 不知为何,需要手动重置 section 计数器。 - \setcounter{section}{0} - \ctexset{ - appendix/numbering = false, - section/number = \arabic{section}, - subsection/number = \arabic{section}. \arabic{subsection}, - subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection}, - } - - \__bithesis_if_thesis_english:TF { - \chapter{\c__bithesis_label_ack_en_tl} - } { - \chapter{\c__bithesis_label_ack_tl} - } - \__bithesis_if_graduate:TF {\fangsong}{} - #1 - \end{blindPeerReview} - } {} -\NewDocumentCommand \Author {O{1} o o} - { - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式 - \IfValueTF {#3} { - #3 - } { - 第\zhnumber{#1}作者 - } - } { - % 普通模式 - \IfValueTF {#2} { - % 覆盖默认的 \author 命令 - #2 - } { - % 默认采用作者姓名 - \l__bithesis_value_author_tl - } - } - } - -\NewDocumentCommand \AuthorEn {O{1} o o} - { - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式 - \IfValueTF {#3} { - #3 - } { - \Ordinalstringnum{#1}~Author - } - } { - % 普通模式 - \IfValueTF {#2} { - % 覆盖默认的 \author 命令 - #2 - } { - % 默认采用作者姓名 - \l__bithesis_value_author_en_tl - } - } - } -\NewDocumentCommand \addpub {m} { - \nocite{#1} - \addtocategory{mypub}{#1} -} - -\NewDocumentCommand \addpubs {m} { - % apply a clist - \clist_map_function:nN {#1} \addpub -} -\NewDocumentCommand \pubsection {m} { - { - % 自增计数器 - \par\stepcounter{pub} - % 设置小标题,暂时没有考虑英文模式 - \noindent - \textbf{ - \heiti{ - \zhnumber{\thepub}、#1 - } - }\par - } -} -\NewDocumentEnvironment {publications} {+b} - { - % 同时设置 omit 以及 blindPeerReview 才能跳过此章节生成。 - \begin{blindPeerReview}[\l__bithesis_publications_omit_bool] - % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。 - % 不知为何,需要手动重置 section 计数器。 - \setcounter{section}{0} - \ctexset{ - appendix/numbering = false, - section/number = \arabic{section}, - subsection/number = \arabic{section}. \arabic{subsection}, - subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection}, - } - % 设置参考文献字号为 5 号 - \renewcommand*{\bibfont}{\zihao{5}} - % 设置参考文献各个项目之间的垂直距离为 0 - \setlength{\bibitemsep}{0ex} - \setlength{\bibnamesep}{0ex} - \setlength{\bibinitsep}{0ex} - % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 - \setlength{\biblabelsep}{1.7mm} - - \bool_if:NF \l__bithesis_style_bibliography_indent_bool { - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} - } - } - - % If in blindPeerReview mode, omit delimiters in author field. - \bool_if:NT \g__bithesis_blind_mode_bool { - % 如果有多个作者,不修改此项的话,作者与标题之间会有逗号。 - \DeclareDelimFormat[bib,biblist]{finalnamedelim}{} - % 如果自己不是第一个作者,不修改此项的话,会在最开始有逗号。 - \DeclareDelimFormat{multinamedelim}{} - % 如果覆盖的是英文作者,不修改此项的话,会在最开始有空格。 - \DeclareDelimFormat{bibnamedelimd}{} - } - - % ===== 上方定义与「参考文献」部分相同 - - % 中文姓名下,此部分不参与输出。 - \cs_set:Npn \mkbibnamegiven ##1 { - \haspartannotation{myself}{ - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式,不输出内容 - } { - % 普通模式 - \textbf{##1} - } - }{ - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式,不输出内容 - } { - % 普通模式 - ##1 - } - } - } - - \cs_set:Npn \mkbibnamefamily ##1 { - \haspartannotation{myself}{ - % 作者为自己 - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式 - \getpartannotation{myself} - } { - % 普通模式 - \textbf{##1} - } - }{ - % 作者不是自己 - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式,不输出 - } { - % 普通模式 - ##1 - } - } - } - - \if_cs_exist:N \c@pub { - % 重置计数器 - \setcounter{pub}{0} - } \else: { - % 设置计数器 - \newcounter{pub} - } \fi: - - % 设置参考文献的排序 - \bool_if:NTF \l__bithesis_publications_sorting_bool { - % Sorting by year, name, type. - \newrefcontext[sorting=ynt] - } { - % Do not sort. - \newrefcontext - } - - % 根据 maxbibnames 的设置,覆盖 \blx@maxbibnames 选项,保证所有作者都能显示。 - \cs_set:Npn \blx@maxbibnames { - \l__bithesis_publications_maxbibnames_int - } - - % 根据 minbibnames 的设置,覆盖 \blx@minbibnames 选项,保证所有作者都能显示。 - \cs_set:Npn \blx@minbibnames { - \l__bithesis_publications_minbibnames_int - } - - \chapter{\__bithesis_get_const:N {publications}} - #1 - \end{blindPeerReview} - } - {} -\NewDocumentEnvironment {resume} {+b} - { - \begin{blindPeerReview} - % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。 - % 不知为何,需要手动重置 section 计数器。 - \setcounter{section}{0} - \ctexset{ - appendix/numbering = false, - section/number = \arabic{section}, - subsection/number = \arabic{section}. \arabic{subsection}, - subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection}, - } - \chapter{\__bithesis_get_const:N{resume}} - #1 - \end{blindPeerReview} - } - { - } - -\NewDocumentEnvironment {symbols} {} - { - \bool_if:NTF \l__bithesis_add_symbols_to_toc_bool { - \chapter{\__bithesis_get_const:N {symbols}} - } { - \chapter*{\__bithesis_get_const:N {symbols}} - \currentpdfbookmark{\c__bithesis_label_symbols_tl}{ch:symbols} - } - \zihao{-4} - \begin{itemize}[ - labelwidth=2.5cm, - labelsep=0.5cm, - leftmargin=3cm, - itemindent=0cm, - % 不再在两项之间增加额外的间距(1.5 倍的行间距已经够宽了)(未来可以提供一个接口以供用户手动设置间距) - itemsep=-0.5ex, - ] - \cs_set:Npn \makelabel ##1 {##1\hfil} - } - { - \end{itemize} - - % 单独一页 - \clearpage - } -\endinput -%% -%% End of file `bithesis.cls'. diff --git a/templates/lab-report/bitreport.cls b/templates/lab-report/bitreport.cls deleted file mode 100644 index 63ae46d8..00000000 --- a/templates/lab-report/bitreport.cls +++ /dev/null @@ -1,338 +0,0 @@ -%% -%% This is file `bitreport.cls', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% bithesis.dtx (with options: `cls,report') -%% -%% Copyright (C) 2023 -%% Association of Bit Network Pioneer and any individual authors listed in the documentation. -%% ------------------------------------------------------------------------------ -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.3c of this license or (at your option) any later -%% version. This version of this license is in -%% http://www.latex-project.org/lppl/lppl-1-3c.txt -%% and the latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of -%% LaTeX version 2020/11/27 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Feng Kaiyu. -%% ------------------------------------------------------------------------------ -%% -\RequirePackage{expl3,l3keys2e} -\ProvidesExplClass{bitreport} -{2023-05-01}{3.5.4}{BIT Thesis Templates} -\int_new:N \g__bithesis_report_type_int -\clist_const:Nn \c__bithesis_report_type_clist - { common, undergraduate_proposal} -\seq_new:N \l__bithesis_right_seq -\seq_new:N \l__bithesis_left_seq -\PassOptionsToPackage{AutoFakeBold,AutoFakeSlant}{xeCJK} -\keys_define:nn { bitreport } - { - option .meta:nn = {bitreport / option } {#1}, - cover .meta:nn = { bitreport / cover } {#1}, - info .meta:nn = { bitreport / info } {#1}, - misc .meta:nn = { bitreport / misc } {#1} - } -\keys_define:nn { bitreport / option } - { - type .choice:, - type .value_required:n = true, - type .choices:Vn = - \c__bithesis_report_type_clist - { - \int_set_eq:NN \g__bithesis_report_type_int \l_keys_choice_int - }, - type .initial:n = common, - ctex .tl_set:N = \l__bithesis_options_to_ctex_tl, - } -\keys_define:nn { bitreport / cover } - { - imagePath .tl_set:N = \l_bit_coverimagepath_tl, - date .tl_set:N = \l__bithesis_cover_date_tl, - %% cover entry - dilimiter .tl_set:N = \l__bithesis_cover_dilimiter_tl, - labelAlign .tl_set:N = \l__bithesis_cover_label_align_tl, - labelAlign .initial:n = {r}, - valueAlign .tl_set:N = \l__bithesis_cover_value_align_tl, - valueAlign .initial:n = {c}, - labelMaxWidth .dim_set:N = \l__bithesis_cover_label_max_width_dim, - valueMaxWidth .dim_set:N = \l__bithesis_cover_value_max_width_dim, - autoWidthPadding .dim_set:N = \l__bithesis_cover_auto_width_padding_dim, - autoWidthPadding .initial:n = {0.25em}, - autoWidth .bool_set:N = \l__bithesis_cover_auto_width_bool, - autoWidth .initial:n = {true}, - underlineThickness .dim_set:N = \l__bithesis_cover_underline_thickness_dim, - underlineThickness .initial:n = {1pt}, - underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, - underlineOffset .initial:n = { -10pt }, - } -\keys_define:nn { bitreport / info } - { - title .tl_set:N = \l__bithesis_value_title_tl, - school .tl_set:N = \l__bithesis_value_school_tl, - major .tl_set:N = \l__bithesis_value_major_tl, - class .tl_set:N = \l__bithesis_value_class_tl, - author .tl_set:N = \l__bithesis_value_author_tl, - supervisor .tl_set:N = \l__bithesis_value_supervisor_tl, - externalSupervisor .tl_set:N = \l__bithesis_value_external_supervisor_tl, - studentId .tl_set:N = \l__bithesis_value_student_id_tl, - } -\keys_define:nn { bitreport / misc } - { - reviewTable .tl_set:N = \l_bit_reviewtable_tl, - } -\DeclareOption*{ - \PassOptionsToClass{\l__bithesis_options_to_ctex_tl}{ctexart} -} -\ProcessOptions\relax -\LoadClass[zihao=-4]{ctexart} -\RequirePackage[a4paper,left=3cm,right=2.4cm,top=2.6cm,bottom=2.38cm,includeheadfoot]{geometry} -\RequirePackage{fancyhdr} -\RequirePackage{setspace} -\RequirePackage{caption} -\RequirePackage{booktabs} -\RequirePackage{pdfpages} -\ProcessKeysOptions { bitreport / option } -\cs_generate_variant:Nn \tl_if_empty:nTF {x} -\cs_generate_variant:Nn \seq_set_split:Nnn {Nnx} -\cs_new:Npn \__bithesis_dunderline:nnn #1#2#3 { - {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}} -} -\cs_new:Npn \__bithesis_render_cover_entry:nn #1#2 { - \makebox[\l__bithesis_cover_label_max_width_dim][\l__bithesis_cover_label_align_tl]{ - \tl_if_blank:VTF #1 {} {#1\l__bithesis_cover_dilimiter_tl} - } - \hspace{1ex} - \__bithesis_dunderline:nnn{\l__bithesis_cover_underline_offset_dim}{\l__bithesis_cover_underline_thickness_dim}{ - \makebox[\l__bithesis_cover_value_max_width_dim][\l__bithesis_cover_value_align_tl]{#2} - }\par -} -\cs_new:Npn \__bithesis_get_text_width:Nn #1#2 - { - \hbox_set:Nn \l_tmpa_box {#2} - \dim_set:Nn #1 { \box_wd:N \l_tmpa_box } - } -\cs_generate_variant:Nn \__bithesis_get_text_width:Nn { NV } -\cs_new:Npn \__bithesis_get_max_text_width:NN #1#2 - { - \group_begin: - \seq_set_eq:NN \l__bithesis_tmpa_seq #2 - \dim_zero_new:N \l__bithesis_tmpa_dim - \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_tmpa_seq } - { - \seq_pop_left:NN \l__bithesis_tmpa_seq \l__bithesis_tmpa_tl - \__bithesis_get_text_width:NV \l__bithesis_tmpa_dim \l__bithesis_tmpa_tl - % 在两边加上空白,避免文本太靠边。 - \dim_gset:Nn #1 { \dim_max:nn {#1} { \l__bithesis_tmpa_dim + \l__bithesis_cover_auto_width_padding_dim * 2} } - } - \group_end: - } -\cs_new:Npn \__bithesis_parse_entry #1 #2 { - \seq_set_split:Nnx \l__bithesis_tmp_right_seq {\\} {#2} - \seq_clear:N \l__bithesis_tmp_left_seq - \seq_map_inline:Nn \l__bithesis_tmp_right_seq { - \seq_put_right:Nn \l__bithesis_tmp_left_seq {} - } - \seq_put_left:Nn \l__bithesis_tmp_left_seq {#1} - \seq_pop_right:NN \l__bithesis_tmp_left_seq \g__bithesis_trashcan_tl -} -\cs_new:Npn \__bithesis_render_cover_entry:n #1 { - % 左边是标签,右边是值。 - % 形如: - % { {label_1} {value_1}, {label_2} {value 2} } - % 首先转换成 seq 类型。 - \seq_set_from_clist:NN \l__bithesis_input_seq #1 - \seq_map_inline:Nn \l__bithesis_input_seq { - % 然后对于每一对 label 和 value,首先查找 - % value 中是否含有 \\ 字符,如果有,则将其分割成多个 - % label - value 对。 - % 比如 {label_1} {value \\ 1} 会被转换成 - % { {label_1} {value}, {} {1} } - \__bithesis_parse_entry ##1 - % 然后将这些 label - value 对添加到 \l__bithesis_right_seq - % 或者 \l__bithesis_left_sql 中。 - % left 就是 label,right 就是 value。 - \seq_concat:NNN \l__bithesis_right_seq \l__bithesis_right_seq \l__bithesis_tmp_right_seq - \seq_concat:NNN \l__bithesis_left_seq \l__bithesis_left_seq \l__bithesis_tmp_left_seq - } - - % 如果用户选择自动计算最大宽度,则计算最大宽度。 - \bool_if:NT \l__bithesis_cover_auto_width_bool { - \__bithesis_get_max_text_width:NN \l__bithesis_cover_label_max_width_dim \l__bithesis_left_seq - \__bithesis_get_max_text_width:NN \l__bithesis_cover_value_max_width_dim \l__bithesis_right_seq - } - - % 最后,根据宽度渲染 label 和 value 对。 - \group_begin: - \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_left_seq } - { - \seq_pop_left:NN \l__bithesis_left_seq \l__bithesis_tmpa_tl - \seq_pop_left:NN \l__bithesis_right_seq \l__bithesis_tmpb_tl - \tl_if_empty:xTF \l__bithesis_tmpb_tl {} { - \__bithesis_render_cover_entry:nn {\l__bithesis_tmpa_tl} {\l__bithesis_tmpb_tl} - } - } - \group_end: -} -\DeclareDocumentCommand \BITSetup { m } - { \keys_set:nn { bitreport } { #1 }} -\DeclareDocumentCommand \MakeCover {} - { - \group_begin: - \int_case:nn {\g__bithesis_report_type_int} { - {1} { - \begin{titlepage} - \centering - - \vspace{23mm} - - \tl_if_empty:NF \l_bit_coverimagepath_tl { - \includegraphics[width=.5\textwidth]{\l_bit_coverimagepath_tl}\\ - } - - \vspace{10mm} - - \heiti\fontsize{24pt}{24pt}\selectfont{\l__bithesis_value_title_tl}\\ - - \vspace{67mm} - - \begin{spacing}{2.2} - \songti\zihao{3} - - \clist_set:Nn \l__bithesis_input_clist { - {\textbf{学\qquad 院:}} {\l__bithesis_value_school_tl}, - {\textbf{专\qquad 业:}} {\l__bithesis_value_major_tl}, - {\textbf{班\qquad 级:}} {\l__bithesis_value_class_tl}, - {\textbf{学\qquad 号:}} {\l__bithesis_value_student_id_tl}, - {\textbf{姓\qquad 名:}} {\l__bithesis_value_author_tl}, - {\textbf{任课教师:}} {\l__bithesis_value_supervisor_tl}, - } - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{spacing} - - \vspace*{\fill} - - \centering - - \songti\fontsize{12pt}{12pt}\selectfont{ - \tl_if_empty:NTF \l__bithesis_cover_date_tl { - \today - } { - \l__bithesis_cover_date_tl - } - } - \end{titlepage} - } - {2} { - % Main code for \MakeCover - \begin{titlepage} - \topskip=0pt - \vspace*{-16mm} - \centering - \hspace{-6mm} - \songti\fontsize{22pt}{22pt} - \selectfont{北京理工大学}\par - - \vspace{13mm} - - \hspace{-6mm} - \heiti\fontsize{24pt}{24pt} - \selectfont{本科生毕业设计(论文)开题报告}\par - - \vspace{53mm} - - \begin{spacing}{2.2} - \songti\zihao{3} - \clist_set:Nn \l__bithesis_input_clist { - {\textbf{学\qquad 院:}} {\l__bithesis_value_school_tl}, - {\textbf{专\qquad 业:}} {\l__bithesis_value_major_tl}, - {\textbf{班\qquad 级:}} {\l__bithesis_value_class_tl}, - {\textbf{姓\qquad 名:}} {\l__bithesis_value_author_tl}, - {\textbf{指导教师:}} {\l__bithesis_value_supervisor_tl}, - {\textbf{校外指导教师:}} {\l__bithesis_value_external_supervisor_tl}, - } - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{spacing} - - \vspace*{\fill} - - \centering - \hspace{-6mm}\songti\fontsize{12pt}{12pt}\selectfont{\today} - - \end{titlepage} - } - } - \group_end: - } -\DeclareDocumentCommand \MakeReviewTable {} - { - \group_begin: - \begin{titlepage} - \includepdf[pages=-]{\l_bit_reviewtable_tl} - \end{titlepage} - \group_end: - } -\DeclareCaptionFont{kaiticaption}{\kaishu \normalsize} -\renewcommand{\thefigure}{\thesection-\arabic{figure}} -\captionsetup[figure]{font=small,labelsep=space,skip=10bp,labelfont=bf,font=kaiticaption} -\renewcommand{\thetable}{\thesection-\arabic{table}} -\captionsetup[table]{font=small,labelsep=space,skip=10bp,labelfont=bf,font=kaiticaption} -\ctexset{today=big} -\setromanfont{Times~New~Roman} -\setcounter{tocdepth}{3} -\setcounter{secnumdepth}{3} -\ctexset{section={ - format={ - \raggedright \bfseries \songti \zihao{-3} - }, - beforeskip = 24bp plus 1ex minus .2ex, - afterskip = 24bp plus .2ex, - fixskip = true, - name = {,.\quad} - } -} -\ctexset{subsection={ - format = { - \bfseries \songti \raggedright \zihao{4} - }, - beforeskip = 24bp plus 1ex minus .2ex, - afterskip = 24bp plus .2ex, - fixskip = true, - } -} -\fancyhf{} -\int_case:nn {\g__bithesis_report_type_int} { - {1} { - \fancyhead[R]{ - \fontsize{10.5pt}{10.5pt} - \selectfont{\l__bithesis_value_title_tl} - } - } - {2} { - \fancyhead[R]{ - \fontsize{10.5pt}{10.5pt} - \selectfont{北京理工大学本科生毕业设计(论文)开题报告} - } - } -} -\fancyfoot[R]{\fontsize{9pt}{9pt}\selectfont{\thepage}} -\renewcommand{\headrulewidth}{1pt} -\renewcommand{\footrulewidth}{0pt} -\pagestyle{fancy} -\setcounter{page}{1} -\cs_set:Npn \baselinestretch {1.53} -\endinput -%% -%% End of file `bitreport.cls'. diff --git a/templates/paper-translation/bithesis.cls b/templates/paper-translation/bithesis.cls deleted file mode 100644 index 7a6104a8..00000000 --- a/templates/paper-translation/bithesis.cls +++ /dev/null @@ -1,2333 +0,0 @@ -%% -%% This is file `bithesis.cls', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% bithesis.dtx (with options: `cls,thesis') -%% -%% Copyright (C) 2023 -%% Association of Bit Network Pioneer and any individual authors listed in the documentation. -%% ------------------------------------------------------------------------------ -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.3c of this license or (at your option) any later -%% version. This version of this license is in -%% http://www.latex-project.org/lppl/lppl-1-3c.txt -%% and the latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of -%% LaTeX version 2020/11/27 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Feng Kaiyu. -%% ------------------------------------------------------------------------------ -%% -\RequirePackage{expl3,l3keys2e} -\ProvidesExplClass{bithesis} -{2023-05-01}{3.5.4}{BIT Thesis Templates} -\int_new:N \g__bithesis_thesis_type_int -\int_new:N \g__bithesis_head_zihao_int -\bool_new:N \g__bithesis_twoside_bool -\bool_new:N \g__bithesis_thesis_type_english_bool -\bool_new:N \g__bithesis_blind_mode_bool -\bool_new:N \g__bithesis_quirks_mode_bool -\tl_new:N \g__bithesis_label_divide_char_tl -\seq_new:N \l__bithesis_right_seq -\seq_new:N \l__bithesis_left_seq -\cs_new:Npn \__bithesis_hide:n #1 { - \g__bithesis_const_substitute_symbol_tl -} - -\cs_new:Npn \__bithesis_secret_info:nn #1 #2 { - \bool_if:nTF \g__bithesis_blind_mode_bool { - #2 - } { - #1 - } -} - -\cs_new:Npn \__bithesis_secret_info:N #1 { - \__bithesis_secret_info:nn {#1} {\tl_map_function:NN #1 \__bithesis_hide:n } -} -\cs_new:Npn \__bithesis_secret_info:n #1 { - \__bithesis_secret_info:nn {#1} {\tl_map_function:NN {#1} \__bithesis_hide:n } -} - -\cs_generate_variant:Nn \__bithesis_secret_info:n {x} - -\cs_new:Npn \__bithesis_get_const:N #1 { - \__bithesis_if_thesis_english:TF { - \use:c {c__bithesis_label_ #1 _en_tl} - } { - \use:c {c__bithesis_label_ #1 _tl} - } -} -\cs_new:Npn \__bithesis_set_english_mode: { - \bool_gset_true:N \g__bithesis_thesis_type_english_bool -} -\cs_generate_variant:Nn \tl_if_empty:nTF {x} -\cs_generate_variant:Nn \seq_set_split:Nnn {Nnx} -\cs_new:Npn \__bithesis_same_page: { - \let\clearpage\relax - \let\cleardoublepage\relax -} -\cs_new:Npn \__bithesis_if_graduate:TF #1#2 { - \int_compare:nNnTF {3} < {\g__bithesis_thesis_type_int} - {#1} - {#2} - } - -\cs_new:Npn \__bithesis_if_thesis_int_type:nTF #1#2#3 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {#1} {#2} {#3}} -\cs_new:Npn \__bithesis_if_thesis_int_type:nT #1#2 {\__bithesis_if_thesis_int_type:nTF {#1} {#2} {}} - -\cs_new:Npn \__bithesis_if_thesis_english:TF #1#2 {\bool_if:nTF {\g__bithesis_thesis_type_english_bool} {#1} {#2}} -\cs_new:Npn \__bithesis_if_thesis_english:T #1 {\__bithesis_if_thesis_english:TF {#1}{}} -\cs_new:Npn \__bithesis_if_bachelor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} < {4} {#1} {#2}} -\cs_new:Npn \__bithesis_if_bachelor_thesis:T #1 {\__bithesis_if_bachelor_thesis:TF {#1} {}} -\cs_new:Npn \__bithesis_if_master_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {4} {#1} {#2}} -\cs_new:Npn \__bithesis_if_doctor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {5} {#1} {#2}} -\clist_const:Nn \c__bithesis_thesis_type_clist - { bachelor, bachelor_translation, bachelor_english, master, doctor} -\clist_const:Nn \c__bithesis_publication_modes_clist - { biblatex, custom } -\cs_new_protected:Npn \__bithesis_define_label:nn #1#2 - { \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} } - -\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnn #1#2#3 - { - \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} - } - -\cs_new_protected:Npn \__bithesis_define_label:nnn #1#2#3 - { - \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} - \tl_const:cn { c__bithesis_label_ #1 _en_tl } {#3} - } - -\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnnn #1#2#3#4 - { - \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} - \tl_const:cn { c__bithesis_ #1 _label_ #2 _en_tl } {#4} - } -\cs_new:Npn \smallgap: { - \hspace{0.45ex} -} -\cs_new:Npn \label_space: { - \__bithesis_if_bachelor_thesis:T { - \quad - } -} -\clist_map_inline:nn - { - {code} {代码}, - {udc} {UDC分类号:}, - {classification} {中图分类号:}, - {classified_level} {密级}, - {type} {种类}, - } - {\__bithesis_define_label:nn #1} -\clist_map_inline:nn - { - {originality} {原创性声明}, - {originality_clause} {本人郑重声明:所呈交的毕业设计(论文), - 是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外, - 本文不包含任何其他个人或集体已经发表或撰写过的研究成果。 - 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par~特此申明。}, - {authorization} {关于使用授权的声明}, - {authorization_clause} {本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定, - 其中包括:\circled{1}~学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件; - \circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文); - \circled{3}~学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}~学校可以学术交流为目的, - 复制赠送和交换本毕业设计(论文);\circled{5}~学校可以公布本毕业设计(论文)的全部或部分内容。}, - {originality_author_signature} - {本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, - {originality_supervisor_signature} - {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, - } {\__bithesis_define_label_by_thesis_type:nnn {bachelor} #1} -\clist_map_inline:nn - { - {originality} {原创性声明~Statement~of~Originality}, - {originality_clause} { - 本人郑重声明:所呈交的毕业设计(论文), - 是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外, - 本文不包含任何其他个人或集体已经发表或撰写过的研究成果。 - 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。特此申明。\par - \arialfamily I,\dunderline[-1pt]{1pt}{\makebox[18mm]{}},~solemnly~ - declare:~the~submitted~graduation~design~(thesis),~ - is~the~research~achievement~completed~independently~by~myself~ - under~the~guidance~of~the~supervisor.~This~article~does~not~contain~ - any~research~published~or~written~by~any~other~individual~or~group,~ - except~as~already~referenced~in~this~paper.~Individuals~and~groups~ - that~have~made~important~contributions~to~the~study~of~this~paper~ - are~clearly~indicated~and~cited~in~the~paper.\par - }, - {authorization} {关于使用授权的声明~State~of~Use~Authorization}, - {authorization_clause} { - 本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定, - 其中包括:\circled{1}学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件; - \circled{2}学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文); - \circled{3}学校可允许本毕业设计(论文)被查阅或借阅; - \circled{4}学校可以学术交流为目的,复制赠送和交换本毕业设计(论文); - \circled{5}学校可以公布本毕业设计(论文)的全部或部分内容。\par - I~fully~understand~the~regulations~on~the~storage,~ - use~of~graduation~design~(thesis)~in~Beijing~Institute~of~Technology.~ - Beijing~Institute~of~Technology~has~the~right~to~(1)~keep,~ - and~to~the~relevant~departments~to~send~the~original~or~copy~ - of~this~graduation~design~(thesis);~(2)~copy~and~preserve~this~ - graduation~design~(thesis)~by~photocopying,~miniature~or~other~ - means~of~reproduction;~(3)~allow~this~graduation~design~(thesis)~ - to~be~read~or~borrowed;~(4)~for~the~purpose~of~academic~exchange,~ - copy,~give~and~exchange~this~graduation~design~(thesis);~(5)~ - publish~all~or~part~of~the~contents~of~this~graduation~design~(thesis).~ - }, - } {\__bithesis_define_label_by_thesis_type:nnn {bachelor_english} #1} -\clist_map_inline:nn - { - {originality} {研究成果声明}, - {originality_clause} {本人郑重声明: - 所提交的学位论文是我本人在指导教师的指导下进行的研究工作获得的研究成果。 - 尽我所知,文中除特别标注和致谢的地方外, - 学位论文中不包含其他人已经发表或撰写过的研究成果, - 也不包含为获得北京理工大学或其它教育机构的学位或证书所使用过的材料。 - 与我一同工作的合作者对此研究工作所做的任何贡献均已在 - 学位论文中作了明确的说明并表示了谢意。\par~特此申明。}, - {authorization} {关于学位论文使用权的说明}, - {authorization_clause} {本人完全了解北京理工大学有关保管、使用学位论文的规定, - 其中包括:\circled{1}~学校有权保管、并向有关部门送交学位论文的原件与复印件; - \circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存学位论文; - \circled{3}~学校可允许学位论文被查阅或借阅;\circled{4}~ - 学校可以学术交流为目的,复制赠送和交换学位论文;\circled{5}~ - 学校可以公布学位论文的全部或部分内容(保密学位论文在解密后遵守此规定)。}, - {originality_author_signature} - {签\qquad 名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, - {originality_supervisor_signature} - {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, - } {\__bithesis_define_label_by_thesis_type:nnn {graduate} #1} -\clist_map_inline:nn - { - {author} {作\quad 者\quad 姓\quad 名} {Candidate~Name}, - {school} {学\quad 院\quad 名\quad 称} {School~or~Department}, - {supervisor} {指\quad 导\quad 教\quad 师} {Faculty~Mentor}, - {chairman} {答辩委员会主席} {Chair,~Thesis~Committee}, - {degree} - {申\smallgap: 请\smallgap: 学\smallgap: 位\smallgap: 级\smallgap: 别} - {Degree~Applied}, - {major} {学\quad 科\quad 专\quad 业} {Major}, - {institute} - {学\smallgap: 位\smallgap: 授\smallgap: 予\smallgap: 单\smallgap: 位} - {Degree~by}, - {defense_date} - {论\smallgap: 文\smallgap: 答\smallgap: 辩\smallgap: 日\smallgap: 期} - {The~Date~of~Defence}, - } {\__bithesis_define_label_by_thesis_type:nnnn {graduate} #1} -\clist_map_inline:nn - { - {school} {学\qquad 院} {School}, - {major} {专\qquad 业} {Degree}, - {class} {班\qquad{}级} {Class}, - {author} {学生姓名} {Author}, - {student_id} {学\qquad 号} {Student~ID}, - {supervisor} {指导教师} {Supervisor}, - {co_supervisor} {校外指导教师} {Co-Supervisor}, - {keywords} {关键词:} {Key~Words:~}, - {toc} {目\label_space: 录} {Table~of~Contents}, - {abstract} {摘\label_space: 要} {Abstract}, - {conclusion} {结\label_space: 论} {Conclusions}, - {appendix} {附\label_space: 录} {Appendices}, - {ack} {致\label_space: 谢} {Acknowledgement}, - {figure} {插\label_space: 图} {Illustrations}, - {table} {表\label_space: 格} {Tables}, - {appendix_prefix} {附录} {Appendix}, - {reference} {参考文献} {References}, - {university} {北京理工大学} {Beijing~Institute~of~Technology}, - {publications} {攻读学位期间发表论文与研究成果清单} - {Publications~During~Studies}, - % TODO: Not so sure about the translation. - {resume} {作者简介} {Author~Biography}, - {symbols} {主要符号对照表} {Nomenclature}, - {algo} {算法} {Algorithm}, - {them} {定理} {Theorem}, - {lem} {引理} {Lemma}, - {prop} {命题} {Proposition}, - {cor} {推论} {Corollary}, - {axi} {公理} {Axiom}, - {defn} {定义} {Definition}, - {conj} {猜想} {Conjecture}, - {exmp} {例} {Example}, - {case} {情形} {Case}, - {rem} {注} {Remark}, - {fig} {图} {Figure}, - {tab} {表} {Table}, - {equ} {式} {Equation}, - } - {\__bithesis_define_label:nnn #1} -\clist_const:Nn \c__bithesis_bachelor_thesis_header_clist - { - 北京理工大学本科生毕业设计(论文), - 北京理工大学本科生毕业设计(论文)外文翻译, - Beijing~Institute~of~Technology~Bachelor's~Thesis, - 北京理工大学硕士学位论文, - 北京理工大学博士学位论文, - } -\clist_const:Nn \c__bithesis_bachelor_thesis_headline_clist - { - 本科生毕业设计(论文), - 本科生毕业设计(论文)外文翻译, - Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis, - } -\keys_define:nn { bithesis } -{ - info .meta:nn = { bithesis / info } {#1}, - misc .meta:nn = { bithesis / misc } {#1}, - cover .meta:nn = { bithesis / cover } {#1}, - style .meta:nn = { bithesis / style } {#1}, - option .meta:nn = { bithesis / option } {#1}, - TOC .meta:nn = { bithesis / TOC } {#1}, - appendices .meta:nn = { bithesis / appendices } {#1}, - publications .meta:nn = { bithesis / publications } {#1}, - const .meta:nn = { bithesis / const } {#1}, -} -\keys_define:nn { bithesis / option } -{ - type .choice:, - type .value_required:n = true, - type .choices:Vn = - \c__bithesis_thesis_type_clist - { - \int_set_eq:NN \g__bithesis_thesis_type_int \l_keys_choice_int - \int_case:nn {\l_keys_choice_int} { - % 本科全英文也是英文模板。 - {3} {\__bithesis_set_english_mode:} - } - }, - type .initial:n = bachelor, - twoside .bool_gset:N = \g__bithesis_twoside_bool, - blindPeerReview .bool_gset:N = \g__bithesis_blind_mode_bool, - ctex .tl_set:N = \l__bithesis_options_to_ctex_tl, - quirks .bool_gset:N = \g__bithesis_quirks_mode_bool, - % xeCJK - autoFakeBold .tl_set:N = \g__bithesis_auto_fake_bold_tl, - autoFakeBold .initial:n = {3}, - % 是否开启英文模式。目前在设计上,这个选项仅对研究生模板生效。 - % 本科生模板的英文模式是根据 |type| 选项自动判断的。 - english .code:n = { \__bithesis_set_english_mode: } , -} -\keys_define:nn { bithesis / cover } - { - date .tl_set:N = \l__bithesis_cover_date_tl, - headerImage .tl_set:N = \l_bit_coverheaderimage_tl, - xiheiFont .tl_set:N = \l__bithesis_cover_xihei_font_path_tl, - xiheiFont .default:n = {STXihei}, - %% cover entry - dilimiter .tl_set:N = \l__bithesis_cover_dilimiter_tl, - labelAlign .tl_set:N = \l__bithesis_cover_label_align_tl, - labelAlign .initial:n = {r}, - valueAlign .tl_set:N = \l__bithesis_cover_value_align_tl, - valueAlign .initial:n = {c}, - labelMaxWidth .dim_set:N = \l__bithesis_cover_label_max_width_dim, - valueMaxWidth .dim_set:N = \l__bithesis_cover_value_max_width_dim, - autoWidthPadding .dim_set:N = \l__bithesis_cover_auto_width_padding_dim, - autoWidthPadding .initial:n = {0.25em}, - autoWidth .bool_set:N = \l__bithesis_cover_auto_width_bool, - autoWidth .initial:n = {true}, - underlineThickness .dim_set:N = \l__bithesis_cover_underline_thickness_dim, - underlineThickness .initial:n = {1pt}, - underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, - underlineOffset .initial:n = { -10pt }, - hideCoverInPeerReview .bool_set:N = \l__bithesis_style_hide_cover_in_peer_review_bool, - hideCoverInPeerReview .initial:n = {false}, - } -\keys_define:nn { bithesis / info } - { - title .tl_set:N = \l__bithesis_value_title_tl, - title .initial:n = {形状记忆聚氨酯的合成及其在织物中的应用(示例)}, - titleEn .tl_set:N = \l__bithesis_value_title_en_tl, - titleEn .initial:n = {Synthesis~and~Application~on~Texttiles~of~the~Shape~Memory~Polyurethane~(example)}, - % 因为是覆盖选项,所以不需要设置初始值。 - verticalTitle .tl_set:N = \l__bithesis_value_vertical_title_tl, - school .tl_set:N = \l__bithesis_value_school_tl, - major .tl_set:N = \l__bithesis_value_major_tl, - class .tl_set:N = \l__bithesis_value_class_tl, - author .tl_set:N = \l__bithesis_value_author_tl, - studentId .tl_set:N = \l__bithesis_value_student_id_tl, - supervisor .tl_set:N = \l__bithesis_value_supervisor_tl, - % 因为默认不显示,所以不需要设置初始值。 - externalSupervisor .tl_set:N = \l__bithesis_value_external_supervisor_tl, - keywords .tl_set:N = \l__bithesis_value_keywords_tl, - keywords .initial:n = {聚氨酯,形状记忆,织物(示例)}, - keywordsEn .tl_set:N = \l__bithesis_value_keywords_en_tl, - keywordsEn .initial:n = {Polyurethane,Shape Memory,Textiles (example)}, - translationTitle .tl_set:N = \l__bithesis_value_trans_title_tl, - translationOriginTitle .tl_set:N = \l__bithesis_value_trans_origin_title_tl, - % 中图分类号,研究生学位论文使用 - classification .tl_set:N = \l__bithesis_value_classification_tl, - classification .initial:n = {TQ~028.1(示例)}, - % UDC 分类号,研究生学位论文使用 - UDC .tl_set:N = \l__bithesis_value_udc_tl, - UDC .initial:n = {540(示例)}, - chairman .tl_set:N = \l__bithesis_value_chairman_tl, - degree .tl_set:N = \l__bithesis_value_degree_tl, - degreeEn .tl_set:N = \l__bithesis_value_degree_en_tl, - institute .tl_set:N = \l__bithesis_value_institute_tl, - institute .initial:n = {\tl_use:N \c__bithesis_label_university_tl}, - defenseDate .tl_set:N = \l__bithesis_value_defense_date_tl, - authorEn .tl_set:N = \l__bithesis_value_author_en_tl, - schoolEn .tl_set:N = \l__bithesis_value_school_en_tl, - supervisorEn .tl_set:N = \l__bithesis_value_supervisor_en_tl, - chairmanEn .tl_set:N = \l__bithesis_value_chairman_en_tl, - majorEn .tl_set:N = \l__bithesis_value_major_en_tl, - instituteEn .tl_set:N = \l__bithesis_value_institute_en_tl, - instituteEn .initial:n = {\c__bithesis_label_university_en_tl}, - defenseDateEn .tl_set:N = \l__bithesis_value_defense_date_en_tl, - defenseDateEn .initial:n = {June,~2019~(example)}, - % 因为默认不显示,所以不需要设置初始值。 - classifiedLevel .tl_set:N = \l__bithesis_value_classified_level_tl, - } -\keys_define:nn { bithesis / misc } - { - % 表格字体大小,默认为 5 号字体。 - tabularFontSize .tl_set:N = \l__bithesis_misc_tabular_font_size_tl, - tabularFontSize .initial:n = {5}, - arialFont .tl_set:N = \l__bithesis_misc_arial_font_path_tl, - autoref / algo .tl_set:N = \algoautorefname, - autoref / algo .initial:n = {\g__bithesis_const_autoref_algo_tl}, - autoref / them .tl_set:N = \themautorefname, - autoref / them .initial:n = {\g__bithesis_const_autoref_them_tl}, - autoref / lem .tl_set:N = \lemautorefname, - autoref / lem .initial:n = {\g__bithesis_const_autoref_lem_tl}, - autoref / prop .tl_set:N = \propautorefname, - autoref / prop .initial:n = {\g__bithesis_const_autoref_prop_tl}, - autoref / cor .tl_set:N = \corautorefname, - autoref / cor .initial:n = {\g__bithesis_const_autoref_cor_tl}, - autoref / axi .tl_set:N = \axiautorefname, - autoref / axi .initial:n = {\g__bithesis_const_autoref_axi_tl}, - autoref / defn .tl_set:N = \defnautorefname, - autoref / defn .initial:n = {\g__bithesis_const_autoref_defn_tl}, - autoref / conj .tl_set:N = \conjautorefname, - autoref / conj .initial:n = {\g__bithesis_const_autoref_conj_tl}, - autoref / exmp .tl_set:N = \exmpautorefname, - autoref / exmp .initial:n = {\g__bithesis_const_autoref_exmp_tl}, - autoref / case .tl_set:N = \caseautorefname, - autoref / case .initial:n = {\g__bithesis_const_autoref_case_tl}, - autoref / rem .tl_set:N = \remautorefname, - autoref / rem .initial:n = {\g__bithesis_const_autoref_rem_tl}, - hideLinks .bool_set:N = \l__bithesis_misc_hide_links_bool, - hideLinks .initial:n = {true}, - autoref / figure .tl_set:N = \figureautorefname, - autoref / figure .initial:n = {\g__bithesis_const_autoref_fig_tl}, - autoref / table .tl_set:N = \tableautorefname, - autoref / table .initial:n = {\g__bithesis_const_autoref_tab_tl}, - autoref / equ .tl_set:N = \equationautorefname, - autoref / equ .initial:n = {\g__bithesis_const_autoref_equ_tl}, - } -\keys_define:nn { bithesis / const } - { - autoref .meta:nn = { bithesis / const / autoref } { #1 }, - style .meta:nn = { bithesis / const / style } { #1 }, - info .meta:nn = { bithesis / const / info } { #1 }, - } -\keys_define:nn { bithesis / const / autoref } - { - algo .tl_set:N = \g__bithesis_const_autoref_algo_tl, - algo .initial:n = {\__bithesis_get_const:N {algo}}, - them .tl_set:N = \g__bithesis_const_autoref_them_tl, - them .initial:n = {\__bithesis_get_const:N {them}}, - lem .tl_set:N = \g__bithesis_const_autoref_lem_tl, - lem .initial:n = {\__bithesis_get_const:N {lem}}, - prop .tl_set:N = \g__bithesis_const_autoref_prop_tl, - prop .initial:n = {\__bithesis_get_const:N {prop}}, - cor .tl_set:N = \g__bithesis_const_autoref_cor_tl, - cor .initial:n = {\__bithesis_get_const:N {cor}}, - axi .tl_set:N = \g__bithesis_const_autoref_axi_tl, - axi .initial:n = {\__bithesis_get_const:N {axi}}, - defn .tl_set:N = \g__bithesis_const_autoref_defn_tl, - defn .initial:n = {\__bithesis_get_const:N {defn}}, - conj .tl_set:N = \g__bithesis_const_autoref_conj_tl, - conj .initial:n = {\__bithesis_get_const:N {conj}}, - exmp .tl_set:N = \g__bithesis_const_autoref_exmp_tl, - exmp .initial:n = {\__bithesis_get_const:N {exmp}}, - case .tl_set:N = \g__bithesis_const_autoref_case_tl, - case .initial:n = {\__bithesis_get_const:N {case}}, - rem .tl_set:N = \g__bithesis_const_autoref_rem_tl, - rem .initial:n = {\__bithesis_get_const:N {rem}}, - figure .tl_set:N = \g__bithesis_const_autoref_fig_tl, - figure .initial:n = {\__bithesis_get_const:N {fig}}, - table .tl_set:N = \g__bithesis_const_autoref_tab_tl, - table .initial:n = {\__bithesis_get_const:N {tab}}, - equ .tl_set:N = \g__bithesis_const_autoref_equ_tl, - equ .initial:n = {\__bithesis_get_const:N {equ}}, - } -\keys_define:nn { bithesis / const / style } - { - substituteSymbol .tl_set:N = \g__bithesis_const_substitute_symbol_tl, - substituteSymbol .initial:n = {*}, - } -\keys_define:nn { bithesis / const / info } - { - degree .tl_set:N = \g__bithesis_const_info_degree_tl, - degree .initial:n = { - \c__bithesis_graduate_label_degree_tl - }, - major .tl_set:N = \g__bithesis_const_info_major_tl, - major .initial:n = { - \__bithesis_if_graduate:TF { - \c__bithesis_graduate_label_major_tl - } { - \__bithesis_get_const:N {major} - } - }, - } -\keys_define:nn { bithesis / style } -{ - head .tl_set:N = \l__bithesis_style_head_tl, - head .initial:n = { - \clist_item:Nn \c__bithesis_bachelor_thesis_header_clist \g__bithesis_thesis_type_int - }, - headline .tl_set:N = \l__bithesis_style_headline_tl, - headline .initial:n = { - \clist_item:Nn \c__bithesis_bachelor_thesis_headline_clist \g__bithesis_thesis_type_int - }, - bibliographyIndent .bool_set:N = \l__bithesis_style_bibliography_indent_bool, - bibliographyIndent .initial:n = {true}, - pageVerticalAlign .choices:nn = {top, scattered} { - \tl_if_eq:NnTF \l_keys_choice_tl {top} - { \raggedbottom } - { \flushbottom } - }, - pageVerticalAlign .initial:n = {top}, - % 数学字体配置 - mathFont .choices:nn = { - asana, bonum, cm, concrete, dejavu, erewhon, euler, - fira, garamond, gfsneohellenic, kp, libertinus, lm, newcm, - pagella, schola, stix, stix2, termes, xcharter, xits, none, - } { \tl_set_eq:NN \l__bithesis_style_math_font_tl \l_keys_choice_tl }, - mathFont .initial:n = {cm}, - % Options that will be pass to `unicode-math` pkgs. - unicodeMathOptions .tl_set:N = \l__bithesis_unicode_math_options_tl, - % Windows 平台开启宋体伪粗体。 - windowsSimSunFakeBold .bool_set:N = \l__bithesis_style_windows_simsum_fake_bold, - windowsSimSunFakeBold .initial:n = {false}, - % 控制英文是否使用 hyphen 进行换行 - hyphen .bool_set:N = \l__bithesis_style_hyphen_bool, - hyphen .initial:n = {true}, -} -\keys_define:nn { bithesis / TOC } -{ - abstract .bool_set:N = \l__bithesis_add_abstract_to_toc_bool, - abstract .initial:n = {true}, - abstractEn .bool_set:N = \l__bithesis_add_abstract_en_to_toc_bool, - abstractEn .initial:n = {true}, - symbols .bool_set:N = \l__bithesis_add_symbols_to_toc_bool, - symbols .initial:n = {true}, -} -\keys_define:nn { bithesis / appendices } -{ - chapterLevel .bool_set:N = \l__bithesis_appendices_chapter_level_bool, - title .tl_set:N = \l__bithesis_appendices_title_tl, - TOCTitle .tl_set:N = \l__bithesis_appendix_toc_title_tl, -} -\keys_define:nn { bithesis / publications } -{ - % mode .choice:, - % mode .value_required:n = true, - % mode .choices:Vn = - % \c__bithesis_publication_modes_clist - % { - % \int_new:N \l__bithesis_publication_mode_int - % \int_set:Nn \l__bithesis_publication_mode_int \l_keys_choice_int - % }, - % mode .initial:n = biblatex, - sorting .bool_set:N = \l__bithesis_publications_sorting_bool, - sorting .initial:n = {true}, - omit .bool_set:N = \l__bithesis_publications_omit_bool, - omit .initial:n = {false}, - maxbibnames .int_set:N = \l__bithesis_publications_maxbibnames_int, - maxbibnames .initial:n = {3}, - minbibnames .int_set:N = \l__bithesis_publications_minbibnames_int, - minbibnames .initial:n = {1}, -} -\ProcessKeysOptions { bithesis / option } -\__bithesis_if_thesis_english:T { - \PassOptionsToClass{scheme=plain}{ctexbook} -} -\bool_if:NT \g__bithesis_blind_mode_bool { - \bool_set_false:N \g__bithesis_twoside_bool -} -\bool_if:NTF \g__bithesis_twoside_bool {} { - \PassOptionsToClass{oneside}{ctexbook} -} -\PassOptionsToClass{openany}{ctexbook} -\DeclareOption*{ - \PassOptionsToClass{\l__bithesis_options_to_ctex_tl}{ctexbook} -} -\PassOptionsToPackage{quiet,AutoFakeBold=\g__bithesis_auto_fake_bold_tl,AutoFakeSlant}{xeCJK} -\ProcessOptions\relax -\LoadClass[zihao=-4,]{ctexbook} -\RequirePackage{geometry} -\RequirePackage[table,xcdraw]{xcolor} -\RequirePackage{xeCJK} -\RequirePackage{titletoc} -\RequirePackage{setspace} -\RequirePackage{graphicx} -\RequirePackage{fancyhdr} -\RequirePackage{pdfpages} -\RequirePackage{setspace} -\RequirePackage{booktabs} -\RequirePackage{multirow} -\RequirePackage{tikz} -\RequirePackage{etoolbox} -\RequirePackage[bookmarksnumbered]{hyperref} -\RequirePackage[strut=off]{caption} -\RequirePackage{array} -\RequirePackage{amsmath} -\RequirePackage{amssymb} -\RequirePackage{pifont} -\RequirePackage{amsthm} -\RequirePackage{pdfpages} -\RequirePackage{listings} -\RequirePackage{enumitem} -\RequirePackage{fmtcount} -\pdfstringdefDisableCommands{% - \let\quad\empty -} -\__bithesis_if_graduate:TF { - \int_set:Nn \g__bithesis_head_zihao_int {5} - \geometry{ - a4paper, - left=2.7cm, - bottom=2.5cm + 7bp, - top=3.5cm + 7bp, - right=2.7cm, - % `headsep' is affected by `top' option. - headsep = 3.5cm + 7bp - 2.5cm - 15bp, - headheight = 15 bp, - % `footskip' is affected by `bottom' option. - footskip = 2.5cm + 7bp - 1.8cm, - } -} { - \int_set:Nn \g__bithesis_head_zihao_int {4} - \geometry{ - a4paper, - left=3cm, - bottom=2.6cm + 7bp, - top=3.5cm + 7bp, - right=2.6cm, - % `headsep' is affected by `top' option. - headsep = 3.5cm + 7bp - 2.4cm - 20bp, - headheight = 20 bp, - % `footskip' is affected by `bottom' option. - footskip = 2.6cm + 7bp - 2cm, - } -} -\__bithesis_if_bachelor_thesis:T { - \setlength{\intextsep}{1.80\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} -} -\setmainfont{Times~New~Roman} -\setromanfont{Times~New~Roman} -\cs_new:Npn \__bithesis_font_path: - { - \str_if_eq:NNTF { \l__bithesis_font_type_tl } { font } - { } - { Path = \l__bithesis_font_path_tl / , } - } -\cs_new:Npn \__bithesis_load_unicode_math_pkg: - { - \PassOptionsToPackage { \l__bithesis_unicode_math_options_tl } { unicode-math } - \RequirePackage { unicode-math } - } -\cs_new:Npn \__bithesis_define_math_font:nn #1#2 - { - \cs_new:cpn { __bithesis_load_math_font_ #1 : } - { - \__bithesis_load_unicode_math_pkg: - \setmathfont { #2 } - } - } -\clist_map_inline:nn - { - { asana } { Asana-Math.otf }, - { concrete } { Concrete-Math.otf }, - { erewhon } { Erewhon-Math.otf }, - { euler } { Euler-Math.otf }, - { fira } { FiraMath-Regular.otf }, - { garamond } { Garamond-Math.otf }, - { gfsneohellenic } { GFSNeohellenicMath.otf }, - { kp } { KpMath-Regular.otf }, - { libertinus } { LibertinusMath-Regular.otf }, - { lm } { latinmodern-math.otf }, - { newcm } { NewCMMath-Regular.otf }, - { stix } { STIXMath-Regular.otf }, - { stix2 } { STIXTwoMath-Regular.otf }, - { xcharter } { XCharter-Math.otf }, - { xits } { XITSMath-Regular.otf }, - { bonum } { texgyrebonum-math.otf }, - { dejavu } { texgyredejavu-math.otf }, - { pagella } { texgyrepagella-math.otf }, - { schola } { texgyreschola-math.otf }, - { termes } { texgyretermes-math.otf } - } - { \__bithesis_define_math_font:nn #1 } -\cs_new:Npn \__bithesis_load_math_font_cm: { } -\cs_new:Npn \__bithesis_load_math_font_none: { } -\cs_new:Npn \__bithesis_load_font: - { - \use:c { __bithesis_load_math_font_ \l__bithesis_style_math_font_tl : } - } -\ctex_at_end_preamble:n { - % 针对 Windows 字体采用 Fake Bold 宋体 - \bool_if:NT \l__bithesis_style_windows_simsum_fake_bold - { - \RequirePackage{ifplatform} - \ifwindows - \setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant] - \fi - } - - % 在导言区末尾加载数学字体。 - \__bithesis_load_font: - - % misc / hideLinks 选项 - \bool_if:NT \l__bithesis_misc_hide_links_bool - { - \hypersetup { hidelinks } - } - - \__bithesis_if_thesis_english:TF { - \__bithesis_if_thesis_int_type:nT {3} { - % 对于本科全英文专业模板 - % Font Arial is needed. - \newfontfamily\arialfamily{Arial} - } - - } { - % 对于其他的中文模板, - % 需要加载细黑体。 - \tl_if_blank:VTF \l__bithesis_cover_xihei_font_path_tl {} - { - \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant] - {\l__bithesis_cover_xihei_font_path_tl} - } - } - - % 对于本科全英文专业模板,需要自定义日期格式。 - \__bithesis_if_thesis_int_type:nT {3} { - \RequirePackage[en-US]{datetime2} - \RequirePackage{indentfirst} - \DTMlangsetup[en-US]{dayyearsep={\space}} - } - - % Define biblatex category if it was imported. - % 这部分是给研究生模板中的 - % 「攻读学位期间发表论文与研究成果清单」使用的。 - \cs_if_exist:NT \DeclareBibliographyCategory { - \DeclareBibliographyCategory{mypub} - } - - % Define biblatex strings if it was imported. - % 这部分是给研究生模板中的 - % gbpunctin = false 时使用的。 - \cs_if_exist:NT \DefineBibliographyStrings { - \DefineBibliographyStrings{english}{in={}} - \DefineBibliographyStrings{english}{incn={}} - } - - % 修改 biblatex 中「专利」(patent)部分的著录格式。 - % 主要根据北理工自定义的规范,参考 biblatex 和 - % biblatex-gb7714-2015 的实现修改而成。 - % - % 默认不开启,因为此修改可能会产生其他边界问题。 - \bool_if:NT \g__bithesis_quirks_mode_bool { - \cs_if_exist:NT \DeclareBibliographyDriver { - % - % 重设专利title的输出,将文献类型标识符输出出去 - % - \newbibmacro*{patenttitle}{%原输出来自biblatex.def文件 - \ifboolexpr{% - test{\iffieldundef{title}}% - and% - test{\iffieldundef{subtitle}}% - }% - {}% - {\printtext[title]{\bibtitlefont% - \printfield[titlecase]{title}% - \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 - {}{\setunit{\subtitlepunct}% - \printfield[titlecase]{subtitle}}% - \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}% - \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 - {\setunit{\subtitlepunct}\printfield{titleaddon}}% - % :地区 - \setunit{\subtitlepunct}\iflistundef{location} - {} - {\setunit*{\subtitlepunct}% - \printtext{%[parens] - \printlist[][-\value{listtotal}]{location}}}% - % ,专利号 - \setunit{\addcomma\addspace}\printfield{number}%写专利号 - \setunit{\addcomma\addspace} - \usebibmacro{newsdate}% - }% - }% - } - - % - % 重定义专利文献驱动 - % - \DeclareBibliographyDriver{patent}{%源来自standard.BBX - \usebibmacro{bibindex}% - \usebibmacro{begentry}% - \usebibmacro{author}% - \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 - \usebibmacro{patenttitle}%给出专利专用的标题输出 - \iftoggle{bbx:gbstrict}{}{% - \newunit% - \printlist{language}% - \newunit\newblock - \usebibmacro{byauthor} - }% - \newunit\newblock - \printfield{type}% - \setunit*{\addspace}% - \newunit\newblock - \usebibmacro{byholder}% - \newunit\newblock - \printfield{note}% - \newunit\newblock - \usebibmacro{doi+eprint+url}% - \newunit\newblock - \usebibmacro{addendum+pubstate}% - \setunit{\bibpagerefpunct}\newblock - \usebibmacro{pageref}% - \newunit\newblock - \iftoggle{bbx:related} - {\usebibmacro{related:init}% - \usebibmacro{related}} - {}% - \usebibmacro{annotation}\usebibmacro{finentry}} - } - } -} -\cs_new:Npn \xihei:n #1 { - \xeCJK_family_if_exist:nTF {xihei} { - \CJKfamily{xihei} #1 - }{ - \heiti #1 - } -} -\cs_new:Npn \l__bithesis_title_font_cs:n #1 { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - \arialfamily #1 - } { - \heiti #1 - } -} -\cs_new:Npn \l__bithesis_unnumchapter_style_cs:n #1 { - % 本科全英文、研究生学位论文需要加粗 - \int_compare:nNnTF {\g__bithesis_thesis_type_int} > {2} - { - \bfseries #1 - } { - \mdseries #1 - } -} -\cs_set:Npn \arabicHeiti #1 {#1} -\fancypagestyle{BIThesis}{ - \fancyhf{} - % 定义页眉、页码 - \fancyhead[C]{ - \zihao{\int_use:N \g__bithesis_head_zihao_int} - \ziju{0.08} - \songti{\tl_use:N \l__bithesis_style_head_tl} - } - \fancyfoot[C]{\songti\zihao{5} \thepage} - % 页眉分割线稍微粗一些 - \RenewDocumentCommand \headrulewidth {} {0.6pt} -} -\ctexset{chapter={ - number = {\arabicHeiti{ \arabic{chapter} }}, - format = { \l__bithesis_title_font_cs:n \bfseries \centering \zihao{3}}, - nameformat = {}, - titleformat = {}, - aftername = \hspace{9bp}, - pagestyle = BIThesis, - beforeskip = 8bp, - afterskip = 32bp, - fixskip = true, - lofskip = 0cm, - lotskip = 0cm, - } -} - -\ctexset{section={ - number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}}}, - format = {\l__bithesis_title_font_cs:n \raggedright \bfseries \zihao{4}}, - nameformat = {}, - titleformat = {}, - aftername = \hspace{8bp}, - beforeskip = 20bp plus 1ex minus .2ex, - afterskip = 18bp plus .2ex, - fixskip = true, - } -} - -\ctexset{subsection={ - number = { - \arabicHeiti{ - \thechapter.\hspace{1bp} - \arabic{section}.\hspace{1bp} - \arabic{subsection} - } - }, - format = {\l__bithesis_title_font_cs:n \bfseries \raggedright \zihao{-4}}, - nameformat = {}, - titleformat = {}, - aftername = \hspace{7bp}, - beforeskip = 17bp plus 1ex minus .2ex, - afterskip = 14bp plus .2ex, - fixskip = true, - } -} - -\ctexset{ - secnumdepth = 3, - subsubsection={ - numbering = true, - number = { - \arabicHeiti{ - \arabic{chapter}.\hspace{1bp} - \arabic{section}.\hspace{1bp} - \arabic{subsection}.\hspace{1bp} - \arabic{subsubsection} - } - }, - format={\l__bithesis_title_font_cs:n \raggedright \zihao{-4}}, - nameformat = {}, - titleformat = {}, - beforeskip=14bp plus 1ex minus .2ex, - afterskip=14bp plus .2ex, - fixskip=true, - } -} -\addtocontents{toc}{\protect\hypersetup{hidelinks}} - -\__bithesis_if_graduate:TF { - % 对于研究生模板,定义各章标题为宋体四号。 - \titlecontents{chapter}[0pt]{\songti \zihao{4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % section 标题为宋体小四号。缩进为两个字符宽度。 - \titlecontents{section}[2\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % subsection 标题为宋体小四号。缩进为四个字符宽度。 - \titlecontents{subsection}[4\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} -} { - % 对于其他,定义各章标题为宋体小四号。 - \titlecontents{chapter}[0pt]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % section 标题为宋体小四号。 - \titlecontents{section}[1\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % subsection 标题为宋体小四号。 - \titlecontents{subsection}[2\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} -} -\titlecontents{figure}[0pt]{\songti\zihao{-4}} - {\figurename~\thecontentslabel\quad}{\hspace*{-1.5cm}} - {\hspace{.5em}\titlerule*{.}\contentspage} -\titlecontents{table}[0pt]{\songti\zihao{-4}} - {\tablename~\thecontentslabel\quad}{\hspace*{-1.5cm}} - {\hspace{.5em}\titlerule*{.}\contentspage} -\RenewDocumentCommand \frontmatter {} { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - % 本科全英文专业论文,页码使用小罗马数字。 - \pagenumbering{roman} - } { - \pagenumbering{Roman} - } - % 这部分的章节标题不进行编号。 - \ctexset{ - chapter = { - numbering = false, - } - } - \setstretch{1.53} - \pagestyle{BIThesis} - - % 表格内容默认使用五号字。 - % - % 由于这种方式会影响所有的表格, - % 所以我们尽可能延迟这种影响。 - % - % 不过,在目前的代码实现中没有在封面 - % 之类的地方使用表格,所以目前即使放在 - % preamble 中也不会有影响。 - \AtBeginEnvironment{tabular}{\zihao{\l__bithesis_misc_tabular_font_size_tl}} - \AtBeginEnvironment{tabular*}{\zihao{\l__bithesis_misc_tabular_font_size_tl}} -} -\RenewDocumentCommand \mainmatter {} { - % 另起一个空页,以便于后续的章节标题编号。 - % \clearpage - \cleardoublepage - % 这部分的章节标题进行编号。 - \ctexset{ - chapter = { - numbering = true, - } - } - % 页码使用阿拉伯数字。 - \pagenumbering{arabic} - \pagestyle{BIThesis} - % 正文 22 磅的行距 - \setlength{\parskip}{0em} - \setstretch{1.53} - % 修复脚注出现跨页的问题 - \interfootnotelinepenalty=10000 -} -\RenewDocumentCommand \backmatter {} { - % 同样,所有的章节标题不进行编号。 - \setcounter{section}{0} - \setcounter{subsection}{0} - \setcounter{subsubsection}{0} - \ctexset{ - chapter = { - numbering = false, - beforeskip = 18bp, - format = { - \l__bithesis_title_font_cs:n \l__bithesis_unnumchapter_style_cs:n \centering \zihao{3} - }, - afterskip = 26bp, - } - } -} -\setlength{\abovecaptionskip}{11pt} -\__bithesis_if_bachelor_thesis:TF { - \__bithesis_if_thesis_english:TF { - \setlength{\belowcaptionskip}{9pt} - } { - % 为了满足 “前后一行空白的问题”,需要删除 Caption 下方的间距。 - % 详见 `caption` 宏包手册和 - % https://github.com/CTeX-org/forum/issues/86 - % - % 这里实际的 skip 在 15pt 左右,但是全部移除会导致当图片置于页面顶部时, - % 图片与上方的间距过小,因此这里只移除 5pt。 - % 当然,这样会导致文本间的图片的 Caption 下方的间距微微大于一行。 - \captionsetup{belowskip=-5pt} - } -} { - % 而研究生模板不存在这个问题。 - \setlength{\belowcaptionskip}{9pt} -} -\__bithesis_if_graduate:TF { - \tl_set:Nn \g__bithesis_label_divide_char_tl {.} -} { - \tl_set:Nn \g__bithesis_label_divide_char_tl {-} -} -\cs_set:Npn \thefigure {\thechapter\g__bithesis_label_divide_char_tl\arabic{figure}} -\captionsetup[figure]{font=small,labelsep=space} - -\cs_set:Npn \thetable {\thechapter\g__bithesis_label_divide_char_tl\arabic{table}} -\captionsetup[table]{font=small,labelsep=space} - -\cs_set:Npn \theequation {\thechapter\g__bithesis_label_divide_char_tl\arabic{equation}} - -\AtBeginDocument{ - \cs_gset:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}} - \cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl} -} -\captionsetup[lstlisting]{font=small,labelsep=space} -\bool_if:NF \l__bithesis_style_hyphen_bool { - \hbadness=10000 - \tolerance=1 - \emergencystretch=\maxdimen - \hyphenpenalty=10000 -} -\definecolor{codegreen}{rgb}{0,0.6,0} -\definecolor{codegray}{rgb}{0.5,0.5,0.5} -\definecolor{codepurple}{rgb}{0.58,0,0.82} -\definecolor{backcolour}{rgb}{0.95,0.95,0.92} -\lstdefinestyle{examplestyle}{ - backgroundcolor=\color{backcolour}, - commentstyle=\color{codegreen}, - keywordstyle=\color{magenta}, - numberstyle=\tiny\color{codegray}, - stringstyle=\color{codepurple}, - basicstyle=\ttfamily\footnotesize, - breakatwhitespace=false, - breaklines=true, - captionpos=b, - keepspaces=true, - numbers=left, - numbersep=5pt, - showspaces=false, - showstringspaces=false, - showtabs=false, - tabsize=2 -} -\lstset{style=examplestyle} -\cs_set:Npn \listfigurename {\__bithesis_get_const:N {figure}} -\cs_set:Npn \listtablename {\__bithesis_get_const:N {table}} -\theoremstyle{plain} - \newtheorem{algo}{\__bithesis_get_const:N {algo}}[chapter] - \newtheorem{them}{\__bithesis_get_const:N {them}}[chapter] - \newtheorem{lem}{\__bithesis_get_const:N {lem}}[chapter] - \newtheorem{prop}{\__bithesis_get_const:N {prop}}[chapter] - \newtheorem{cor}{\__bithesis_get_const:N {cor}}[chapter] - \newtheorem{axi}{\__bithesis_get_const:N {axi}}[chapter] -\theoremstyle{definition} - \newtheorem{defn}{\__bithesis_get_const:N {defn}}[chapter] - \newtheorem{conj}{\__bithesis_get_const:N {conj}}[chapter] - \newtheorem{exmp}{\__bithesis_get_const:N {exmp}}[chapter] - \newtheorem{case}{\__bithesis_get_const:N {case}} -\theoremstyle{remark} - \newtheorem{rem}{\__bithesis_get_const:N {rem}} - \renewcommand{\qedsymbol}{\ensuremath{\blacksquare}} -\cs_new:Npn \__bithesis_dunderline:nnn #1#2#3 { - {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}} -} -\cs_new:Npn \__bithesis_dunderline:nn #1#2 { - \__bithesis_dunderline:nnn {#1} {1pt} {#2} -} -\cs_new:Npn \__bithesis_dunderline:n #1 { - \__bithesis_dunderline:nnn {-10pt} {1pt} {#1} -} -\newcommand\dunderline[3][-1pt]{{% - \setbox0=\hbox{#3} - \ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}} -\cs_new:Npn \__bithesis_render_cover_entry:nn #1#2 { - \makebox[\l__bithesis_cover_label_max_width_dim][\l__bithesis_cover_label_align_tl]{ - \tl_if_blank:VTF #1 {} {#1\l__bithesis_cover_dilimiter_tl} - } - \hspace{1ex} - \__bithesis_dunderline:nnn{\l__bithesis_cover_underline_offset_dim} - {\l__bithesis_cover_underline_thickness_dim}{ - \makebox[\l__bithesis_cover_value_max_width_dim][\l__bithesis_cover_value_align_tl]{#2} - }\par -} -\cs_new:Npn \__bithesis_get_text_width:Nn #1#2 - { - \hbox_set:Nn \l_tmpa_box {#2} - \dim_set:Nn #1 { \box_wd:N \l_tmpa_box } - } -\cs_generate_variant:Nn \__bithesis_get_text_width:Nn { NV } -\cs_new:Npn \__bithesis_get_max_text_width:NN #1#2 - { - \group_begin: - \seq_set_eq:NN \l__bithesis_tmpa_seq #2 - \dim_zero_new:N \l__bithesis_tmpa_dim - \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_tmpa_seq } - { - \seq_pop_left:NN \l__bithesis_tmpa_seq \l__bithesis_tmpa_tl - \__bithesis_get_text_width:NV \l__bithesis_tmpa_dim \l__bithesis_tmpa_tl - % 在两边加上空白,避免文本太靠边。 - \dim_gset:Nn #1 { \dim_max:nn {#1} { \l__bithesis_tmpa_dim + \l__bithesis_cover_auto_width_padding_dim * 2} } - } - \group_end: - } -\cs_new:Npn \__bithesis_parse_entry #1 #2 { - \seq_set_split:Nnx \l__bithesis_tmp_right_seq {\\} {#2} - \seq_clear:N \l__bithesis_tmp_left_seq - \seq_map_inline:Nn \l__bithesis_tmp_right_seq { - \seq_put_right:Nn \l__bithesis_tmp_left_seq {} - } - \seq_put_left:Nn \l__bithesis_tmp_left_seq {#1} - \seq_pop_right:NN \l__bithesis_tmp_left_seq \g__bithesis_trashcan_tl -} -\cs_new:Npn \__bithesis_render_cover_entry:n #1 { - % 左边是标签,右边是值。 - % 形如: - % { {label_1} {value_1}, {label_2} {value 2} } - % 首先转换成 seq 类型。 - \seq_set_from_clist:NN \l__bithesis_input_seq #1 - \seq_map_inline:Nn \l__bithesis_input_seq { - % 然后对于每一对 label 和 value,首先查找 - % value 中是否含有 \\ 字符,如果有,则将其分割成多个 - % label - value 对。 - % 比如 {label_1} {value \\ 1} 会被转换成 - % { {label_1} {value}, {} {1} } - \__bithesis_parse_entry ##1 - % 然后将这些 label - value 对添加到 \l__bithesis_right_seq - % 或者 \l__bithesis_left_sql 中。 - % left 就是 label,right 就是 value。 - \seq_concat:NNN \l__bithesis_right_seq \l__bithesis_right_seq \l__bithesis_tmp_right_seq - \seq_concat:NNN \l__bithesis_left_seq \l__bithesis_left_seq \l__bithesis_tmp_left_seq - } - - % 如果用户选择自动计算最大宽度,则计算最大宽度。 - \bool_if:NT \l__bithesis_cover_auto_width_bool { - \__bithesis_get_max_text_width:NN \l__bithesis_cover_label_max_width_dim \l__bithesis_left_seq - \__bithesis_get_max_text_width:NN \l__bithesis_cover_value_max_width_dim \l__bithesis_right_seq - } - - % 最后,根据宽度渲染 label 和 value 对。 - \group_begin: - \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_left_seq } - { - \seq_pop_left:NN \l__bithesis_left_seq \l__bithesis_tmpa_tl - \seq_pop_left:NN \l__bithesis_right_seq \l__bithesis_tmpb_tl - \tl_if_empty:xTF \l__bithesis_tmpb_tl {} { - \__bithesis_render_cover_entry:nn {\l__bithesis_tmpa_tl} {\l__bithesis_tmpb_tl} - } - } - \group_end: -} -\cs_new:Npn \make_graduate_cover: { - \cleardoublepage - \begin{titlepage} - { - \heiti\zihao{5} - \tl_if_blank:VTF \l__bithesis_value_classified_level_tl {} { - \flushright - \c__bithesis_label_classified_level_tl:~ - \l__bithesis_value_classified_level_tl \par - } - } - \centering - \vspace*{65mm} - {\heiti\zihao{-2} \l__bithesis_value_title_tl} - \vskip 60mm - % 黑体 小三 - {\heiti \zihao{-3} \__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl}} - \vskip 10mm - % 黑体 小三 - {\heiti \zihao{-3} \l__bithesis_cover_date_tl} - \end{titlepage} -} -\cs_new:Npn \make_paper_back: { - \cleardoublepage - \begin{titlepage} - \vskip 5cm - \begin{center} - \setstretch{1.1} - \begin{minipage}[t][19.7cm]{2em} - \begin{center} - { - \heiti\zihao{3} - \tl_if_blank:VTF \l__bithesis_value_vertical_title_tl - {\l__bithesis_value_title_tl}{\l__bithesis_value_vertical_title_tl} - } - \vfill - {\heiti\zihao{3}\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl}} - \vfill - {\heiti\zihao{3}\c__bithesis_label_university_tl} - \end{center} - \end{minipage} - \end{center} - % \vskip 5cm - \end{titlepage} -} -\cs_new:Npn \__bithesis_make_chinese_title_page: { - \cleardoublepage - \begin{titlepage} - { - % 密级、分类号 - {\heiti \zihao{5} \noindent \c__bithesis_label_classification_tl} - \l__bithesis_value_classification_tl\\ - {\heiti \zihao{5} \c__bithesis_label_udc_tl} \l__bithesis_value_udc_tl - } - - \begin{center} - - \vskip \stretch{1} - - {\heiti\zihao{-2} \l__bithesis_value_title_tl} - - \vskip \stretch{1} - - \def\tabcolsep{1pt} - \def\arraystretch{1.5} - - { - \renewcommand{\baselinestretch}{2} - - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\qquad} - } - \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} - - % 如果不是自动计算宽度,且用户没有自定义宽度, - % 则尝试提供一个默认宽度。 - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {45mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {60mm} - } - } - - % 渲染信息。 - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_tl} {\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl}}, - {\c__bithesis_graduate_label_school_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_graduate_label_supervisor_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_tl}}, - {\c__bithesis_graduate_label_chairman_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_tl}}, - {\g__bithesis_const_info_degree_tl} {\l__bithesis_value_degree_tl}, - {\g__bithesis_const_info_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_graduate_label_institute_tl} {\l__bithesis_value_institute_tl}, - {\c__bithesis_graduate_label_defense_date_tl} {\l__bithesis_value_defense_date_tl}, - } - - \heiti\zihao{-3} - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - } - \end{center} - \vskip \stretch{0.5} - \end{titlepage} -} -\cs_new:Npn \__bithesis_make_english_title_page: { - \begin{titlepage} - \begin{center} - - \vspace*{10em} - - { - \zihao{-2} - \textbf{\l__bithesis_value_title_en_tl} - } - - \vskip \stretch{1} - - { - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:~} - } - - \tl_set:Nn \l__bithesis_cover_label_align_tl {l} - \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} - - % 如果不是自动计算宽度,且用户没有自定义宽度, - % 则尝试提供一个默认宽度。 - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {55mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {85mm} - } - } - - % 渲染信息。 - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_author_en_tl}}, - {\c__bithesis_graduate_label_school_en_tl} {\l__bithesis_value_school_en_tl}, - {\c__bithesis_graduate_label_supervisor_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_en_tl}}, - {\c__bithesis_graduate_label_chairman_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_en_tl}}, - {\c__bithesis_graduate_label_degree_en_tl} {\l__bithesis_value_degree_en_tl}, - {\c__bithesis_graduate_label_major_en_tl} {\l__bithesis_value_major_en_tl}, - {\c__bithesis_graduate_label_institute_en_tl} {\l__bithesis_value_institute_en_tl}, - {\c__bithesis_graduate_label_defense_date_en_tl} {\l__bithesis_value_defense_date_en_tl}, - } - - \zihao{-3} - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - } - - \end{center} - - \vskip \stretch{0.5} - \end{titlepage} -} -\newcommand{\circled}[2][]{\tikz[baseline=(char.base)] - {\node[shape = circle, draw, inner~sep = 1pt] - (char) {\phantom{\ifblank{#1}{#2}{#1}}}; - \node at (char.center) {\makebox[0pt][c]{#2}};}} -\robustify{\circled} -\cs_new:Npn \__bithesis_graduate_originality: - { - % 取消页眉页脚。 - \ctexset { - chapter / pagestyle = plain, - } - - \begin{titlepage} - % 不计算页码。 - \pagenumbering{gobble} - - % 原创性声明部分 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{3} - \c__bithesis_graduate_label_originality_tl - } - \end{center} - - % 本部分字号为四号。 - \zihao{4} - \qquad\c__bithesis_graduate_label_originality_clause_tl - - \vspace{17mm} - - \begin{flushright} - \c__bithesis_graduate_label_originality_author_signature_tl\par - \end{flushright} - - \vspace{16mm} - - % 使用授权声明部分。 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{3} - \c__bithesis_graduate_label_authorization_tl - } - \end{center} - - \qquad\c__bithesis_graduate_label_authorization_clause_tl - - \vspace*{15mm} - - \begin{flushright} - \begin{spacing}{1.65} - \zihao{4} - % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} - \c__bithesis_graduate_label_originality_author_signature_tl\par - \c__bithesis_graduate_label_originality_supervisor_signature_tl\par - \end{spacing} - \end{flushright} - \end{titlepage} - \cleardoublepage - } -\DeclareDocumentCommand \BITSetup { m } - { \keys_set:nn { bithesis } { #1 }} -\DeclareDocumentCommand \BigStar { } - { \ding{72} } - \NewDocumentEnvironment {blindPeerReview} {O{\c_true_bool} +b} - { - \bool_if:nTF {\g__bithesis_blind_mode_bool && #1} {} { - #2 - } - } {} -\RenewDocumentCommand \cleardoublepage { } - { - \clearpage - \bool_if:NT \g__bithesis_twoside_bool - { - \int_if_odd:nF \c@page - { \hbox:n { } \thispagestyle { empty } \newpage } - } - } -\DeclareDocumentCommand \SecretInfo { m o } - { - \IfValueTF {#2} { - \__bithesis_secret_info:nn {#1} {#2} - } { - \__bithesis_secret_info:x {#1} - } - } -\DeclareDocumentCommand \MakeCover {} - { - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \group_begin: - - \int_case:nn {\g__bithesis_thesis_type_int} - { - {1} - { - \begin{titlepage} - \vspace*{16mm} - - \centering - - \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { - \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ - } - - \vspace*{-3mm} - - \zihao{-0}\textbf{\ziju{0.12}\songti{\l__bithesis_style_headline_tl}}\par - - \vspace{16mm} - - \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par - - \vspace{3mm} - - \begin{spacing}{1.2} - \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par - \end{spacing} - - \vspace{15mm} - - \begin{spacing}{1.8} - \begin{center} - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} - } - % if not auto width, try override width - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} - } - } - - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, - {\g__bithesis_const_info_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, - } - - \zihao{3} - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{center} - \end{spacing} - - \vspace*{\fill} - \centering - \zihao{3}\ziju{0.5}\songti{ - \tl_if_empty:NTF \l__bithesis_cover_date_tl { - \today - } { - \l__bithesis_cover_date_tl - } - } - \end{titlepage} - } - {2} - { - \begin{titlepage} - \centering - - \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { - \includegraphics[width=6.87cm]{\l_bit_coverheaderimage_tl}\\ - } - - \vspace{1.2mm} - - \zihao{2}\textbf{\songti{\l__bithesis_style_headline_tl}} - - \vspace{10mm} - - { - - \begin{spacing}{1.8} - - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\textbf{:}} - \bool_set_false:N \l__bithesis_cover_auto_width_bool - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {115mm} - - \clist_set:Nn \l__bithesis_input_clist { - {\zihao{4}\textbf{外文原文题目}} {\l__bithesis_value_trans_origin_title_tl}, - {\zihao{4}\textbf{中文翻译题目}} {\l__bithesis_value_trans_title_tl}, - } - - \zihao{-3} - \centering - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{spacing} - - } - - \vspace{19mm} - - \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par - - \vspace{3mm} - - \begin{spacing}{1.2} - \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par - \end{spacing} - - \vspace{19mm} - - \begin{spacing}{1.8} - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} - } - - % 如果不是自动计算宽度,且用户没有自定义宽度, - % 则尝试提供一个默认宽度。 - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} - } - } - - \zihao{3} - - % 渲染信息。 - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, - } - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{spacing} - - \vspace*{\fill} - \end{titlepage} - } - {3} { - \begin{titlepage} - \vspace*{16mm} - - \centering - - \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { - \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ - } - - \vspace*{-3mm} - - \zihao{1}\textbf{\ziju{0.12}\l__bithesis_style_headline_tl}\par - - \vspace{18mm} - - \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_en_tl}\par - - \vspace{10mm} - - \begin{spacing}{1.8} - \begin{center} - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} - } - - % if not auto width, try override width - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {20mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {105mm} - } - } - - \zihao{4} - - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_label_school_en_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_label_major_en_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_author_en_tl} {\l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_en_tl} {\l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_en_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_en_tl} {\l__bithesis_value_external_supervisor_tl}, - } - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{center} - \end{spacing} - - \vspace*{\fill} - \centering - \zihao{3}\ziju{0.5}\songti{ - \tl_if_empty:NTF \l__bithesis_cover_date_tl { - \today - } { - \l__bithesis_cover_date_tl - } - } - \end{titlepage} - } - {4} { - \make_graduate_cover: - } - {5} { - \make_graduate_cover: - } - } - \group_end: - \end{blindPeerReview} - } -\NewDocumentCommand \MakeOriginality {} - { - \group_begin: - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \int_case:nn {\g__bithesis_thesis_type_int} - { - {1} - { - \pagestyle{BIThesis} - \pagenumbering{gobble} - - % 原创性声明部分 - \begin{center} - \vspace*{-2bp} - \__bithesis_same_page: - \chapter*{\heiti\zihao{2}\c__bithesis_bachelor_label_originality_tl} - \end{center}~\par - - % 本部分字号为小三。 - \zihao{-3} - \c__bithesis_bachelor_label_originality_clause_tl - - \vspace{17mm} - - \begin{flushright} - \c__bithesis_bachelor_label_originality_author_signature_tl\par - \end{flushright} - - \vspace{16mm} - - % 使用授权声明部分 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{2} - \c__bithesis_bachelor_label_authorization_tl - } - \end{center}~\par - - \c__bithesis_bachelor_label_authorization_clause_tl - - \vspace*{3mm} - - \begin{flushright} - \begin{spacing}{1.65} - \zihao{-3} - % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} - \c__bithesis_bachelor_label_originality_author_signature_tl\par - \c__bithesis_bachelor_label_originality_supervisor_signature_tl\par - \end{spacing} - \end{flushright} - - \newpage - } - {3} { - \setstretch{1.26} - % 原创性声明部分 - \begin{center} - \vspace*{-2bp} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{-2} - \c__bithesis_bachelor_english_label_originality_tl - } - \end{center}~\par - - % 本部分字号为小三 - \zihao{-4} - \c__bithesis_bachelor_english_label_originality_clause_tl - - \bigbreak - - Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~Date:\par - - \vspace{6mm} - - % 使用授权声明部分 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{-2} - \c__bithesis_bachelor_english_label_authorization_tl - } - \end{center}~\par - - \c__bithesis_bachelor_english_label_authorization_clause_tl - - \bigbreak - Student~(Signature):~ - \dunderline[-1pt]{1pt}{\makebox[18mm + 16bp]{}}~ - \hspace{2mm}Date:\par - Supervisor~(Signature):~ - \dunderline[-1pt]{1pt}{\makebox[18mm]{}}~ - \hspace{2mm}Date:\par - } - {4} {\__bithesis_graduate_originality:} - {5} {\__bithesis_graduate_originality:} - } - % 单独成页 - \clearpage - \end{blindPeerReview} - \group_end: - } -\NewDocumentCommand \MakePaperBack {} - { - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \make_paper_back: - \end{blindPeerReview} - } -\NewDocumentCommand \MakeTitle {} - { - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \__bithesis_make_chinese_title_page: - \__bithesis_make_english_title_page: - \end{blindPeerReview} - } -\DeclareDocumentCommand \MakeTOC {} - { - { - \__bithesis_if_bachelor_thesis:TF { - \renewcommand{\baselinestretch}{1.35} - } { - \renewcommand{\baselinestretch}{1.56} - } - - \__bithesis_if_thesis_english:TF { - \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_en_tl} - } { - \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_tl} - } - - % 自定义目录样式 - \cs_set:Npn \contentsname { - \fontsize{16pt}{\baselineskip} - \l__bithesis_unnumchapter_style_cs:n - \l__bithesis_title_font_cs:n - {\l__bithesis_toc_title_tl} - \vspace{-8pt} - } - - % 制作目录 - \tableofcontents - - % 在本科生全英文模板中,添加「目录」本身到目录中。 - \__bithesis_if_thesis_int_type:nT {3} { - \addcontentsline{toc}{chapter}{\c__bithesis_label_toc_en_tl} - } - - % 单独成页 - \clearpage - } - } -\NewDocumentEnvironment {abstract} {} - { - - \cleardoublepage - \setstretch{1.53} - - \__bithesis_if_bachelor_thesis:T { - \begin{center} - \vspace*{-17bp} - \heiti\zihao{-2}\textbf{ - \int_case:nn {\g__bithesis_thesis_type_int} - { - {1} {\l__bithesis_value_title_tl} - {2} {\l__bithesis_value_trans_title_tl} - {3} {\l__bithesis_value_title_tl} - } - } - \end{center} - - \vspace*{2mm} - } - - \ctexset{ - chapter/numbering = false, - } - - \__bithesis_if_bachelor_thesis:T { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - \ctexset{ - chapter/titleformat = {\heiti} - } - } - { - \ctexset{ - chapter/titleformat = {\textmd} - } - } - } - - { - \__bithesis_same_page: - \bool_if:NTF \l__bithesis_add_abstract_to_toc_bool { - \chapter{\c__bithesis_label_abstract_tl} - } { - \chapter*{\c__bithesis_label_abstract_tl} - \currentpdfbookmark{\c__bithesis_label_abstract_tl}{ch:abstract} - } - } - \vspace*{1mm} - \par - } - { - \par - \vspace{4ex} - \noindent - \__bithesis_if_graduate:TF { - % 研究生模板中,“关键词”宋体小四加粗 - % 关键词为宋体小四号字。 - \textbf{\c__bithesis_label_keywords_tl}\l__bithesis_value_keywords_tl\par - } { - % 本科生模板中,关键词为黑体加粗 - \textbf{\heiti \c__bithesis_label_keywords_tl \l__bithesis_value_keywords_tl}\par - } - \newpage - } -\NewDocumentEnvironment {abstractEn} {} - { - \setstretch{1.53} - - \__bithesis_if_bachelor_thesis:T { - \begin{spacing}{0.95} - \centering - \vspace*{-2bp} - - \__bithesis_if_thesis_int_type:nTF {3} { - \arialfamily\zihao{-2}\textbf - \l__bithesis_value_title_en_tl\\ - } { - \heiti\zihao{3}\textbf - \l__bithesis_value_title_en_tl\\ - } - \end{spacing} - \vspace*{10mm} - } - - \ctexset{ - chapter/numbering = false, - } - - \__bithesis_if_bachelor_thesis:TF { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - \ctexset{ - chapter = { - titleformat = {\heiti\zihao{3}\centering\textbf}, - } - } - } { - \ctexset{ - chapter = { - titleformat = {\heiti\zihao{-3}\centering\textmd}, - } - } - } - } { - \ctexset { - chapter/titleformat = {\heiti\zihao{3}\centering\textbf} - } - } - - { - \__bithesis_same_page: - \bool_if:nTF {\l__bithesis_add_abstract_en_to_toc_bool} { - \chapter{\c__bithesis_label_abstract_en_tl} - } { - \chapter*{\c__bithesis_label_abstract_en_tl} - \currentpdfbookmark{\c__bithesis_label_abstract_en_tl}{ch:abstract:en} - } - } - } - { - \par\vspace{3ex}\noindent - \__bithesis_if_graduate:TF { - % Times New Roman小四号字,行距22磅 - % “Key Words” - % Times New Roman小四号字加粗 - \textbf{\c__bithesis_label_keywords_en_tl} \l__bithesis_value_keywords_en_tl - } { - \textbf{\c__bithesis_label_keywords_en_tl \l__bithesis_value_keywords_en_tl} - } - \newpage - } - -\NewDocumentEnvironment {conclusion} {} - { - \ctexset{ - section/number = \arabic{section} - } - - \__bithesis_if_thesis_english:TF { - \chapter{\c__bithesis_label_conclusion_en_tl} - } { - \chapter{\c__bithesis_label_conclusion_tl} - } - } - {} -\NewDocumentEnvironment {bibprint} {} - { - % 设置参考文献字号为 5 号 - \renewcommand*{\bibfont}{\zihao{5}} - % 设置参考文献各个项目之间的垂直距离为 0 - \setlength{\bibitemsep}{0ex} - \setlength{\bibnamesep}{0ex} - \setlength{\bibinitsep}{0ex} - \__bithesis_if_graduate:TF { - } { - % 「本科生」设置单倍行距 - \renewcommand{\baselinestretch}{1.2} - } - % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 - \setlength{\biblabelsep}{1.7mm} - - \bool_if:NF \l__bithesis_style_bibliography_indent_bool { - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} - } - } - - \__bithesis_if_thesis_english:TF { - \chapter{\c__bithesis_label_reference_en_tl} - } { - \chapter{\c__bithesis_label_reference_tl} - } - } - {} -\NewDocumentEnvironment {appendices} {} - { - % Used in chapter, ToC. - \tl_new:N \l__bithesis_appendix_plain_label_tl - % Used before reference label. - \tl_new:N \l__bithesis_appendix_default_title_tl - - \__bithesis_if_thesis_english:TF { - \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_en_tl} - \tl_set:Nn \l__bithesis_appendix_default_title_tl {\c__bithesis_label_appendix_en_tl} - } { - \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_tl} - \tl_set:Nn \l__bithesis_appendix_default_title_tl {\c__bithesis_label_appendix_tl} - } - - \bool_if:NTF \l__bithesis_appendices_chapter_level_bool { - % 附录章节级别 - - % 仅设置 \setcounter{chapter}{0} 时,pdf 目录会索引到正文章节。 - % 因此,需要使用 \appendix 重置计数器,并将附录后面的 - % 几个章节视为特殊的附录页。 - \appendix - - \ctexset{ - chapter/numbering = true, - chapter/name = {}, - chapter/number = \l__bithesis_appendix_plain_label_tl\hspace{1ex}\Alph{chapter}, - section/number = \Alph{chapter}. \arabic{section}, - subsection/number = \Alph{chapter}. \arabic{section}. \arabic{subsection}, - } - - \cs_set:Npn \thechapter { - \Alph{chapter} - } - } { - % 附录节(section)级别 - - % 因为不需要用到 chapter counter, 所以直接加一即可。 - \stepcounter{chapter} - \setcounter{section}{0} - % (与上面方法至少用一个) - % 需要让 section 在 pdf bookmark 中输出字母而不是数字。 - % 详见 hyperref 代码。 - \gdef\theHsection{\Alph{section}} - - % 定义 \thefigure 采用节而不是章 -\cs_set:Npn \thefigure {\theHsection \g__bithesis_label_divide_char_tl\arabic{figure}} - - \ctexset{ - section/number = \l__bithesis_appendix_plain_label_tl\hspace{1ex}\Alph{section}, - subsection/number = \Alph{section}. \arabic{subsection}, - } - - \cs_gset:Npn \thechapter { - \Alph{section} - } - % \gdef \thechapter{\Alph{section}} - - \tl_if_blank:VTF \l__bithesis_appendices_title_tl { - \chapter{\l__bithesis_appendix_default_title_tl} - } { - \chapter*{\l__bithesis_appendices_title_tl} - \stepcounter{chapter} - \tl_if_blank:VTF \l__bithesis_appendix_toc_title_tl { - \addcontentsline{toc}{chapter}{\l__bithesis_appendix_default_title_tl} - } { - \addcontentsline{toc}{chapter}{\l__bithesis_appendix_toc_title_tl} - } - } - } - } - { - } -\NewDocumentEnvironment {acknowledgements} {+b} - { - \begin{blindPeerReview} - % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。 - % 不知为何,需要手动重置 section 计数器。 - \setcounter{section}{0} - \ctexset{ - appendix/numbering = false, - section/number = \arabic{section}, - subsection/number = \arabic{section}. \arabic{subsection}, - subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection}, - } - - \__bithesis_if_thesis_english:TF { - \chapter{\c__bithesis_label_ack_en_tl} - } { - \chapter{\c__bithesis_label_ack_tl} - } - \__bithesis_if_graduate:TF {\fangsong}{} - #1 - \end{blindPeerReview} - } {} -\NewDocumentCommand \Author {O{1} o o} - { - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式 - \IfValueTF {#3} { - #3 - } { - 第\zhnumber{#1}作者 - } - } { - % 普通模式 - \IfValueTF {#2} { - % 覆盖默认的 \author 命令 - #2 - } { - % 默认采用作者姓名 - \l__bithesis_value_author_tl - } - } - } - -\NewDocumentCommand \AuthorEn {O{1} o o} - { - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式 - \IfValueTF {#3} { - #3 - } { - \Ordinalstringnum{#1}~Author - } - } { - % 普通模式 - \IfValueTF {#2} { - % 覆盖默认的 \author 命令 - #2 - } { - % 默认采用作者姓名 - \l__bithesis_value_author_en_tl - } - } - } -\NewDocumentCommand \addpub {m} { - \nocite{#1} - \addtocategory{mypub}{#1} -} - -\NewDocumentCommand \addpubs {m} { - % apply a clist - \clist_map_function:nN {#1} \addpub -} -\NewDocumentCommand \pubsection {m} { - { - % 自增计数器 - \par\stepcounter{pub} - % 设置小标题,暂时没有考虑英文模式 - \noindent - \textbf{ - \heiti{ - \zhnumber{\thepub}、#1 - } - }\par - } -} -\NewDocumentEnvironment {publications} {+b} - { - % 同时设置 omit 以及 blindPeerReview 才能跳过此章节生成。 - \begin{blindPeerReview}[\l__bithesis_publications_omit_bool] - % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。 - % 不知为何,需要手动重置 section 计数器。 - \setcounter{section}{0} - \ctexset{ - appendix/numbering = false, - section/number = \arabic{section}, - subsection/number = \arabic{section}. \arabic{subsection}, - subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection}, - } - % 设置参考文献字号为 5 号 - \renewcommand*{\bibfont}{\zihao{5}} - % 设置参考文献各个项目之间的垂直距离为 0 - \setlength{\bibitemsep}{0ex} - \setlength{\bibnamesep}{0ex} - \setlength{\bibinitsep}{0ex} - % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 - \setlength{\biblabelsep}{1.7mm} - - \bool_if:NF \l__bithesis_style_bibliography_indent_bool { - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} - } - } - - % If in blindPeerReview mode, omit delimiters in author field. - \bool_if:NT \g__bithesis_blind_mode_bool { - % 如果有多个作者,不修改此项的话,作者与标题之间会有逗号。 - \DeclareDelimFormat[bib,biblist]{finalnamedelim}{} - % 如果自己不是第一个作者,不修改此项的话,会在最开始有逗号。 - \DeclareDelimFormat{multinamedelim}{} - % 如果覆盖的是英文作者,不修改此项的话,会在最开始有空格。 - \DeclareDelimFormat{bibnamedelimd}{} - } - - % ===== 上方定义与「参考文献」部分相同 - - % 中文姓名下,此部分不参与输出。 - \cs_set:Npn \mkbibnamegiven ##1 { - \haspartannotation{myself}{ - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式,不输出内容 - } { - % 普通模式 - \textbf{##1} - } - }{ - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式,不输出内容 - } { - % 普通模式 - ##1 - } - } - } - - \cs_set:Npn \mkbibnamefamily ##1 { - \haspartannotation{myself}{ - % 作者为自己 - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式 - \getpartannotation{myself} - } { - % 普通模式 - \textbf{##1} - } - }{ - % 作者不是自己 - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式,不输出 - } { - % 普通模式 - ##1 - } - } - } - - \if_cs_exist:N \c@pub { - % 重置计数器 - \setcounter{pub}{0} - } \else: { - % 设置计数器 - \newcounter{pub} - } \fi: - - % 设置参考文献的排序 - \bool_if:NTF \l__bithesis_publications_sorting_bool { - % Sorting by year, name, type. - \newrefcontext[sorting=ynt] - } { - % Do not sort. - \newrefcontext - } - - % 根据 maxbibnames 的设置,覆盖 \blx@maxbibnames 选项,保证所有作者都能显示。 - \cs_set:Npn \blx@maxbibnames { - \l__bithesis_publications_maxbibnames_int - } - - % 根据 minbibnames 的设置,覆盖 \blx@minbibnames 选项,保证所有作者都能显示。 - \cs_set:Npn \blx@minbibnames { - \l__bithesis_publications_minbibnames_int - } - - \chapter{\__bithesis_get_const:N {publications}} - #1 - \end{blindPeerReview} - } - {} -\NewDocumentEnvironment {resume} {+b} - { - \begin{blindPeerReview} - % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。 - % 不知为何,需要手动重置 section 计数器。 - \setcounter{section}{0} - \ctexset{ - appendix/numbering = false, - section/number = \arabic{section}, - subsection/number = \arabic{section}. \arabic{subsection}, - subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection}, - } - \chapter{\__bithesis_get_const:N{resume}} - #1 - \end{blindPeerReview} - } - { - } - -\NewDocumentEnvironment {symbols} {} - { - \bool_if:NTF \l__bithesis_add_symbols_to_toc_bool { - \chapter{\__bithesis_get_const:N {symbols}} - } { - \chapter*{\__bithesis_get_const:N {symbols}} - \currentpdfbookmark{\c__bithesis_label_symbols_tl}{ch:symbols} - } - \zihao{-4} - \begin{itemize}[ - labelwidth=2.5cm, - labelsep=0.5cm, - leftmargin=3cm, - itemindent=0cm, - % 不再在两项之间增加额外的间距(1.5 倍的行间距已经够宽了)(未来可以提供一个接口以供用户手动设置间距) - itemsep=-0.5ex, - ] - \cs_set:Npn \makelabel ##1 {##1\hfil} - } - { - \end{itemize} - - % 单独一页 - \clearpage - } -\endinput -%% -%% End of file `bithesis.cls'. diff --git a/templates/presentation-slide/bitbeamer.cls b/templates/presentation-slide/bitbeamer.cls deleted file mode 100644 index cc8996cf..00000000 --- a/templates/presentation-slide/bitbeamer.cls +++ /dev/null @@ -1,68 +0,0 @@ -%% -%% This is file `bitbeamer.cls', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% bithesis.dtx (with options: `cls,beamer') -%% -%% Copyright (C) 2023 -%% Association of Bit Network Pioneer and any individual authors listed in the documentation. -%% ------------------------------------------------------------------------------ -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.3c of this license or (at your option) any later -%% version. This version of this license is in -%% http://www.latex-project.org/lppl/lppl-1-3c.txt -%% and the latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of -%% LaTeX version 2020/11/27 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Feng Kaiyu. -%% ------------------------------------------------------------------------------ -%% -\RequirePackage{expl3,l3keys2e} -\ProvidesExplClass{bitbeamer} -{2023-05-01}{3.5.4}{BIT Thesis Templates} -\keys_define:nn { bitbeamer } - { - titlegraphic .tl_set:N = \l_bit_titlegraphic_tl, - framelogo .tl_set:N = \l_bit_framelogo_tl, - } -\ProcessKeysOptions { bitbeamer } -\DeclareOption*{ - \PassOptionsToClass{\CurrentOption}{ctexbeamer} -} -\ProcessOptions\relax -\LoadClass{ctexbeamer} -\RequirePackage{xeCJKfntef} -\RequirePackage{tikz} -\usetheme{Madrid} -\definecolor{bitred}{HTML}{A13E0B} -\definecolor{bitgreen}{HTML}{0A8F30} -\definecolor{bitdarkgreen}{HTML}{005B30} -\colorlet{beamer@blendedblue}{bitdarkgreen} -\cs_new:Npn \CJKhl:nn #1 #2 - { \CJKsout*[thickness=2.5ex, format=\color{#1}]{#2} } -\tl_if_empty:NF \l_bit_titlegraphic_tl { - % BIT Logo - \titlegraphic{ - \includegraphics[width=2cm]{\l_bit_titlegraphic_tl} - } -} -\tl_if_empty:NF \l_bit_framelogo_tl { - \addtobeamertemplate{frametitle}{}{% - \begin{tikzpicture}[remember~picture,overlay] - \node[anchor=north~east,yshift=2pt] at (current~page.north~east) - {\includegraphics[height=0.8cm]{\tl_use:N \l_bit_framelogo_tl}}; - \end{tikzpicture} - } -} -\cs_new_eq:NN \CJKhl \CJKhl:nn -\endinput -%% -%% End of file `bitbeamer.cls'. diff --git a/templates/reading-report/.gitignore b/templates/reading-report/.gitignore new file mode 100644 index 00000000..74fc0de7 --- /dev/null +++ b/templates/reading-report/.gitignore @@ -0,0 +1,315 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/latex +# Edit at https://www.toptal.com/developers/gitignore?templates=latex + +### LaTeX ### +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs +*.lzo +*.lzs +*.slg +*.slo +*.sls + +# uncomment this for glossaries-extra (will ignore makeindex's style files!) +# *.ist + +# gnuplot +*.gnuplot +*.table + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.glog +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files +# *.tikz +*-tikzDictionary + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# newpax +*.newpax + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# svg +svg-inkscape/ + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# titletoc +*.ptc + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices and outlines +*.xyc +*.xyd + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# gummi +.*.swp + +# KBibTeX +*~[0-9]* + +# TeXnicCenter +*.tps + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +# Makeindex log files +*.lpz + +# xwatermark package +*.xwm + +# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib +# option is specified. Footnotes are the stored in a file with suffix Notes.bib. +# Uncomment the next line to have this generated file ignored. +#*Notes.bib + +### LaTeX Patch ### +# LIPIcs / OASIcs +*.vtc + +# glossaries +*.glstex + +# End of https://www.toptal.com/developers/gitignore/api/latex diff --git a/templates/reading-report/README.md b/templates/reading-report/README.md new file mode 100644 index 00000000..eb8b97bb --- /dev/null +++ b/templates/reading-report/README.md @@ -0,0 +1,67 @@ +# Reading Report 北京理工大学读书报告 + +**请尽可能使用最新版本[^1]撰写文章,我们的代码仓库是:https://github.com/BITNP/BIThesis 。** + +此文件夹中包含了北京理工大学读书报告模板的全部内容,有关模板的使用方法更为详细的介绍,请参考:[bithesis 使用手册][manual]。 + +> :warning: 重要提示:建议 macOS 用户使用最新版的 [texlive 2023](https://www.tug.org/mactex/mactex-download.html),否则可能会遇到参考文献被查重的情况。详见 https://github.com/BITNP/BIThesis/issues/326 + +## 特性 + +- 由毕业设计(论文)模板删改而成,符合学校(特别是信息与电子学院)对读书报告的要求。 +- 内容和样式分离,所有的配置可以集中管理。 +- 封面信息的下划线自动调整长度。 +- 由社区驱动,在积极地吸纳新功能、修复现有问题。 + +## 项目结构 + +```sh +. +├── README.md +├── bithesis.pdf # bithesis 使用手册 +├── chapters +│   ├── 1_chapter1.tex +│   └── 2_chapter2.tex +├── images +│   ├── bit_logo.png +│   └── header.png +├── main.pdf +├── main.tex +└── misc + ├── 1_conclusion.tex + ├── 2_reference.tex + └── ref.bib +``` + +## 编译方式 + +方式一(推荐): +``` +latexmk +``` + +方式二: +``` +-> xelatex +-> biber +-> xelatex +-> xelatex +``` + +- *不推荐使用 pdflatex 进行编译* + +## 其他链接 + +- BIThesis wiki:https://bithesis.bitnp.net +- 项目地址:https://github.com/BITNP/BIThesis +- Bug Report 与 Feature Request:https://github.com/BITNP/BIThesis/issues +- QQ 交流群:737548118 + +## 排版参考 + +- 《北京理工大学本科生毕业设计(论文)书写规范及打印装订要求》 +- 《北京理工大学本科生毕业设计(论文)模板》 + +[^1]: 关于如何升级模板的版本,请参考[手册][manual]中「版本号与升级」这一章节内容。 + +[manual]: ./bithesis.pdf diff --git a/templates/reading-report/STXIHEI.TTF b/templates/reading-report/STXIHEI.TTF new file mode 100644 index 00000000..e85ffd12 Binary files /dev/null and b/templates/reading-report/STXIHEI.TTF differ diff --git a/templates/reading-report/chapters/1_chapter1.tex b/templates/reading-report/chapters/1_chapter1.tex new file mode 100644 index 00000000..077657ef --- /dev/null +++ b/templates/reading-report/chapters/1_chapter1.tex @@ -0,0 +1,108 @@ +%% +% The BIThesis Template for Reading Report +% +% 北京理工大学读书报告第一章节 —— 使用 XeLaTeX 编译 +% +% Copyright 2020-2023 BITNP +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Feng Kaiyu. +% +% 第一章节 + +\chapter{一级题目} + +\section{二级题目} +% 这里插入一个参考文献,仅作参考 + +\subsection{三级题目} + +正文……\parencite{yuFeiJiZongTiDuoXueKeSheJiYouHuaDeXianZhuangYuFaZhanFangXiang2008}……\cite{Hajela2012Application} + +\textcolor{blue}{正文部分:宋体、小四;正文行距:22磅;间距段前段后均为0行。阅后删除此段。} + +\textcolor{blue}{图、表居中,图注标在图下方,表头标在表上方,宋体、五号、居中,1.25倍行距,间距段前段后均为0行,图表与上下文之间各空一行。阅后删除此段。} + +\textcolor{blue}{\underline{\underline{图-示例:(阅后删除此段)}}} + + +\begin{figure}[htbp] + \centering + \includegraphics[]{images/bit_logo.png} + \caption{标题序号}\label{标题序号} % label 用来在文中索引 +\end{figure} + +\textcolor{blue}{\underline{\underline{表-示例:(阅后删除此段)}}} +% 三线表 +\begin{table}[htbp] + \linespread{1.5} + \zihao{5} + \centering + \caption{统计表}\label{统计表} + \begin{tabular}{*{5}{>{\centering\arraybackslash}p{2cm}}} \toprule + 项目 & 产量 & 销量 & 产值 & 比重 \\ \hline + 手机 & 1000 & 10000 & 500 & 50\% \\ + 计算机 & 5500 & 5000 & 220 & 22\% \\ + 笔记本电脑 & 1100 & 1000 & 280 & 28\% \\ + 合计 & 17600 & 16000 & 1000 & 100\% \\ \bottomrule + \end{tabular} +\end{table} + +\textcolor{blue}{公式标注应于该公式所在行的最右侧。对于较长的公式只可在符号处(+、-、*、/、$\leqslant$ $\geqslant$ 等)转行。在文中引用公式时,在标号前加“式”,如式(1-2)。阅后删除此 +段。} + +\textcolor{blue}{公式-示例:(阅后删除此段)} +% 公式上下不要空行,置于同一个段落下即可,否则上下距离会出现高度不一致的问题 +\begin{equation} + LRI=1\ ∕\ \sqrt{1+{\left(\frac{{\mu }_{R}}{{\mu }_{s}}\right)}^{2}{\left(\frac{{\delta }_{R}}{{\delta }_{s}}\right)}^{2}} +\end{equation} + +\subsubsection{生僻字} + +% 一个可能无法正常显示的生僻字 +% 一个可能无法正常显示的生僻字: 彧。下文注释中,介绍了如何通过自定义字体来显示生僻字。 + +% 定义一个提供了生僻字的字体,注意要确保你的系统存在该字体 +% \setCJKfamilyfont{custom-font}{Noto Serif CJK SC} + +% 使用自己定义的字体 +% 使用提供了相应字型的字体:\CJKfamily{custom-font}{彧}。 + + +\section{字体效果表格} + +% 列:Regular、Italic、Bold、Bold Italic +% 行:宋体、黑体、楷体、Serif、Sans Serif、Typewriter、Math + +\begin{table}[htb] + \linespread{1.5} + \zihao{5} + \centering + \caption{字体效果表格} + \begin{tabular}{@{}lllll@{}} + \toprule + & Regular & Bold & Italic & Bold Italic \\ \midrule + 宋体 & 宋体 & \colorbox{orange}{\textbf{宋体粗体}} & \textit{楷体} & \colorbox{gray}{\textbf{\textit{楷书粗斜体}}} \\ + 黑体 & {\heiti{}黑体} & \textbf{\heiti{}黑体粗体} & \textit{\heiti{}黑体斜体} & \colorbox{gray}{\textit{\textbf{\heiti{}黑体粗斜体}}} \\ + 楷体 & {\kaishu{}楷书} & \textbf{\kaishu{}楷书粗体} & \textit{\kaishu{}斜体楷体} & \colorbox{gray}{\textbf{\textit{\kaishu{}楷书粗斜体}}} \\ + Serif(Roman/Normal) & Regular & \textbf{Bold} & \textit{Italic} & \textbf{\textit{Bold Italic}} \\ + Sans Serif & \textsf{Regular} & \textbf{\textsf{Bold}} & \textit{\textsf{Bold}} & \textbf{\textit{\textsf{Bold}}} \\ + Typewriter & \texttt{Regular} & \textbf{\texttt{Bold}} & \textit{\texttt{Bold}} & \textbf{\textit{\texttt{Bold}}} \\ + Math & $\mathnormal{Regular} \mathrm{Roman}$ & $\mathbf{Bold}$ & $\mathit{Italic}$ & $\mathbf{\mathit{Bold Italic}}$ \\ \bottomrule + \end{tabular} +\end{table} + +\begin{itemize}[nosep] + \item \colorbox{orange}{宋体粗体}在 Windows 下会成为黑体。这是因为 Windows 的中易宋体没有粗体字重而进行的妥协。 + 如果想要获得宋体粗体的样式,请在配置中开启伪粗体选项。 + \item \colorbox{gray}{粗斜体}的效果是因操作系统字体而定的,中文写作中不会使用这种字形,可以忽略。 +\end{itemize} diff --git a/templates/reading-report/chapters/2_chapter2.tex b/templates/reading-report/chapters/2_chapter2.tex new file mode 100644 index 00000000..664fcef5 --- /dev/null +++ b/templates/reading-report/chapters/2_chapter2.tex @@ -0,0 +1,55 @@ +%% +% The BIThesis Template for Reading Report +% +% 北京理工大学读书报告第二章节 —— 使用 XeLaTeX 编译 +% +% Copyright 2020-2023 BITNP +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Feng Kaiyu. +%% + +\chapter{另一个章节} + +\section{代码片段} + +\begin{lstlisting}[language=Python, caption={Python Code}, label={lst:pythonfile}] +import numpy as np + +def incmatrix(genl1,genl2): + m = len(genl1) + n = len(genl2) + M = None #to become the incidence matrix + VT = np.zeros((n*m,1), int) #dummy variable + + #compute the bitwise xor matrix + M1 = bitxormatrix(genl1) + M2 = np.triu(bitxormatrix(genl2),1) + + for i in range(m-1): + for j in range(i+1, m): + [r,c] = np.where(M2 == M1[i,j]) + for k in range(len(r)): + VT[(i)*n + r[k]] = 1; + VT[(i)*n + c[k]] = 1; + VT[(j)*n + r[k]] = 1; + VT[(j)*n + c[k]] = 1; + + if M is None: + M = np.copy(VT) + else: + M = np.concatenate((M, VT), 1) + + VT = np.zeros((n*m,1), int) + + return M +\end{lstlisting} diff --git a/templates/reading-report/images/bit_logo.png b/templates/reading-report/images/bit_logo.png new file mode 100644 index 00000000..55f3bebe Binary files /dev/null and b/templates/reading-report/images/bit_logo.png differ diff --git a/templates/reading-report/images/header.png b/templates/reading-report/images/header.png new file mode 100644 index 00000000..41ba8a03 Binary files /dev/null and b/templates/reading-report/images/header.png differ diff --git a/templates/reading-report/latexmkrc b/templates/reading-report/latexmkrc new file mode 100644 index 00000000..267b0c22 --- /dev/null +++ b/templates/reading-report/latexmkrc @@ -0,0 +1,3 @@ +$pdf_mode = 5; +$dvi_mode = 0; +$postscript_mode = 0; diff --git a/templates/reading-report/main.tex b/templates/reading-report/main.tex new file mode 100644 index 00000000..7c414bf7 --- /dev/null +++ b/templates/reading-report/main.tex @@ -0,0 +1,118 @@ +%% +% The BIThesis Template for Reading Report +% +% 北京理工大学读书报告 —— 使用 XeLaTeX 编译 +% +% Copyright 2021-2023 BITNP +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Feng Kaiyu. +% +% Compile with: xelatex -> biber -> xelatex -> xelatex + +% !TeX program = xelatex +% !BIB program = biber + + +\documentclass[type=bachelor]{bithesis} + +% 此处仅列出常用的配置。全部配置用法请见「bithesis.pdf」手册。 +\BITSetup{ + cover = { + % 在封面中载入有「北京理工大学」字样的图片,如无必要请勿改动。 + headerImage = images/header.png, + % 在封面标题中使用思源黑体,使用此选项可以保证与 Word 封面标题的字体一致。 + xiheiFont = STXIHEI.TTF, + %% 使用以下参数来自定义封面日期 + % date = 2023年6月, + }, + info = { + % 想要删除某项封面信息,直接删除该项即可。 + % 想要让某项封面信息留空(但是保留下划线),请传入空白符组成的字符串,如"{~}"。 + % 如需要换行,则用 “\\” 符号分割。 + title = 北京理工大学本科生读书报告题目, + semester = {1840-1841学年第一学期}, + school = 信息与电子学院, + author = 罗辑, + studentId = 11xxxxxxxx, + course = 宇宙社会学, + teacher = 叶文洁, + % 以下用于隐藏字段 + titleEn = {}, + }, + style = { + head = 北京理工大学本科生读书报告, + headline = 本科生读书报告, + % 开启 Windows 平台下的中易宋体伪粗体。 + % windowsSimSunFakeBold = true, + } +} + +% 使用 listings 宏包进行代码块使用,并使用了预定义的样式, +% 你也可以选用自己的喜欢的其他宏包,如 minted; +% 然而由于 minted 依赖 Python 的 Pygments 库作为外部依赖,因此出于模板的简洁程度考虑,我们没有提供 minted 进行代码块书写的示例。 +\usepackage{listings} + + +% 大部分关于参考文献样式的修改,都可以通过此处的选项进行配置。 +% 详情请搜索「biblatex-gb7714-2015 文档」进行阅读。 +\usepackage[ + backend=biber, + style=gb7714-2015, + gbalign=gb7714-2015, + gbnamefmt=lowercase, + gbpub=false, + doi=false, + url=false, + eprint=false, + isbn=false, +]{biblatex} + +% 参考文献引用文件位于 misc/ref.bib +\addbibresource{misc/ref.bib} + +% 如果要按照计算机学院的要求, +% 在外文翻译报告中使用带有“北京理工大学”水印 +% 请使用此 issue 提供的方法: +% https://github.com/BITNP/BIThesis/issues/350#issuecomment-1565974141 + +% 文档开始 +\begin{document} + +% 标题页面:如无特殊需要,本部分无需改动 +% \input{misc/0_cover.tex} +\MakeCover + +% 前置页面定义 +\frontmatter + +\MakeTOC + +% 正文开始 +\mainmatter + +% 第一章 +\input{chapters/1_chapter1.tex} +% 在这里添加第二章、第三章……TeX 文件的引用 +\input{chapters/2_chapter2.tex} +% \input{chapters/3_chapter3.tex} + +% 后置部分 +\backmatter + +% 结论:在结论相应的 TeX 文件处进行结论部分的撰写 +\input{misc/1_conclusion.tex} +% 参考文献:如无特殊需要,参考文献相应的 TeX 文件无需改动,添加参考文献请使用 BibTeX 的格式 +% 添加至 misc/ref.bib 中,并在正文的相应位置使用 \cite{xxx} 的格式引用参考文献 +\input{misc/2_reference.tex} + +\end{document} diff --git a/templates/reading-report/misc/1_conclusion.tex b/templates/reading-report/misc/1_conclusion.tex new file mode 100644 index 00000000..8eda4a4e --- /dev/null +++ b/templates/reading-report/misc/1_conclusion.tex @@ -0,0 +1,32 @@ +%% +% The BIThesis Template for Reading Report +% +% 北京理工大学读书报告结论 —— 使用 XeLaTeX 编译 +% +% Copyright 2020-2023 BITNP +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Feng Kaiyu. +% +% Compile with: xelatex -> biber -> xelatex -> xelatex + +\begin{conclusion} + % 结论部分尽量不使用 \subsection 二级标题,只使用 \section 一级标题 + + % 这里插入一个参考文献,仅作参考 + 本文结论……\cite{张伯伟2002全唐五代诗格会考}。 + + \textcolor{blue}{结论作为正文的最后部分单独排写,但不加章号。阅后删除此段。} + + \textcolor{blue}{结论正文样式与文章正文相同:宋体、小四;行距:22磅;间距段前段后均为0行。阅后删除此段。} +\end{conclusion} + diff --git a/templates/reading-report/misc/2_reference.tex b/templates/reading-report/misc/2_reference.tex new file mode 100644 index 00000000..fd43f6a0 --- /dev/null +++ b/templates/reading-report/misc/2_reference.tex @@ -0,0 +1,121 @@ +%% +% The BIThesis Template for Reading Report +% +% 北京理工大学读书报告参考文献 —— 使用 XeLaTeX 编译 +% +% Copyright 2020-2023 BITNP +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Feng Kaiyu. +% +% Compile with: xelatex -> biber -> xelatex -> xelatex +% +% 如无特殊需要,本页面无需更改 + +\begin{bibprint} + +% -------------------------------- 示例内容(正式使用时请删除) ------------------------------------- % + +% 抑制多次调用 \printbibliography 的 warning,只有示例代码会需要此语句。 +\BiblatexSplitbibDefernumbersWarningOff + +\textcolor{blue}{参考文献书写规范} + +\textcolor{blue}{参考国家标准《信息与文献参考文献著录规则》【GB/T 7714—2015】,参考文献书写规范如下:} + +\textcolor{blue}{\textbf{1. 文献类型和标识代码}} + +\textcolor{blue}{普通图书:M}\qquad\textcolor{blue}{会议录:C}\qquad\textcolor{blue}{汇编:G}\qquad\textcolor{blue}{报纸:N} + +\textcolor{blue}{期刊:J}\qquad\textcolor{blue}{学位论文:D}\qquad\textcolor{blue}{报告:R}\qquad\textcolor{blue}{标准:S} + +\textcolor{blue}{专利:P}\qquad\textcolor{blue}{数据库:DB}\qquad\textcolor{blue}{计算机程序:CP}\qquad\textcolor{blue}{电子公告:EB} + +\textcolor{blue}{档案:A}\qquad\textcolor{blue}{舆图:CM}\qquad\textcolor{blue}{数据集:DS}\qquad\textcolor{blue}{其他:Z} + +\textcolor{blue}{\textbf{2. 不同类别文献书写规范要求}} + +\textcolor{blue}{\textbf{期刊}} + +\noindent\textcolor{blue}{[序号] 主要责任者. 文献题名[J]. 刊名, 出版年份, 卷号(期号): 起止页码. } +\cite{yuFeiJiZongTiDuoXueKeSheJiYouHuaDeXianZhuangYuFaZhanFangXiang2008, Hajela2012Application} + +\printbibliography [type=article,heading=none] + +\textcolor{blue}{\textbf{普通图书}} + +\noindent\textcolor{blue}{[序号] 主要责任者. 文献题名[M]. 出版地: 出版者, 出版年: 起止页码. } +\cite{张伯伟2002全唐五代诗格会考, OBRIEN1994Aircraft} + +\printbibliography [keyword={book},heading=none] + +\textcolor{blue}{\textbf{会议论文集}} + +\noindent\textcolor{blue}{[序号] 主要责任者.题名:其他题名信息[C]. 出版地: 出版者, 出版年. } +\cite{雷光春2012} + +\printbibliography [type=proceedings,heading=none] + +\textcolor{blue}{\textbf{专著中析出的文献}} + +\noindent\textcolor{blue}{[序号] 析出文献主要责任者. 析出题名[M]//专著主要责任者. 专著题名. 出版地: 出版者, 出版年: 起止页码. } +\cite{白书农} + +\printbibliography [type=inbook,heading=none] + +\textcolor{blue}{\textbf{学位论文}} + +\noindent\textcolor{blue}{[序号] 主要责任者. 文献题名[D]. 保存地: 保存单位, 年份. } +\cite{zhanghesheng, Sobieski} + +\printbibliography [keyword={thesis},heading=none] + +\textcolor{blue}{\textbf{报告}} + +\noindent\textcolor{blue}{[序号] 主要责任者. 文献题名[R]. 报告地: 报告会主办单位, 年份. } +\cite{fengxiqiao, Sobieszczanski} + +\printbibliography [keyword={techreport},heading=none] + +\textcolor{blue}{\textbf{专利文献}} + +\noindent\textcolor{blue}{[序号] 专利所有者. 专利题名:专利号[P]. 公告日期或公开日期[引用日期]. 获取和访问路径. 数字对象唯一标识符.} +\cite{jiangxizhou} + +\printbibliography [type=patent,heading=none] + +\textcolor{blue}{\textbf{国际、国家标准}} + +\noindent\textcolor{blue}{[序号] 主要责任人. 题名: 其他题名信息[S]. 出版地: 出版者, 出版年: 引文页码.} +\cite{GB/T3792.4-2009} + +\printbibliography [keyword={standard},heading=none] + +\textcolor{blue}{\textbf{报纸文章}} + +\noindent\textcolor{blue}{[序号] 主要责任者. 文献题名[N]. 报纸名, 年(期): 页码. } +\cite{xiexide} + +\printbibliography [keyword={newspaper},heading=none] + +\textcolor{blue}{\textbf{电子文献}} + +\noindent\textcolor{blue}{[序号] 主要责任者. 电子文献题名[文献类型/载体类型]. (发表或更新日期) [引用日期]. 获取和访问路径. 数字对象唯一标识符. } +\cite{yaoboyuan} + +\printbibliography [keyword={online},heading=none] + +\textcolor{blue}{关于参考文献的未尽事项可参考国家标准《信息与文献参考文献著录规则》(GB/T 7714—2015)} + +% 在使用时,请删除/注释上方示例内容,并启用下方语句以输出所有的参考文献 +% \printbibliography[heading=none] +\end{bibprint} diff --git a/templates/reading-report/misc/ref.bib b/templates/reading-report/misc/ref.bib new file mode 100644 index 00000000..af96912d --- /dev/null +++ b/templates/reading-report/misc/ref.bib @@ -0,0 +1,142 @@ +%% +% The BIThesis Template for Reading Report +% +% 北京理工大学读书报告参考文献管理 —— 使用 XeLaTeX 编译 +% +% Copyright 2020-2023 BITNP +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Feng Kaiyu. +% +% Compile with: xelatex -> biber -> xelatex -> xelatex + +@article{yuFeiJiZongTiDuoXueKeSheJiYouHuaDeXianZhuangYuFaZhanFangXiang2008, + title = {飞机总体多学科设计优化的现状与发展方向}, + author = {余, 雄庆}, + date = {2008}, + journaltitle = {南京航空航天大学学报}, + pages = {417--426}, + issn = {1005-2615}, + url = {http://kns.cnki.net/kcms/detail/detail.aspx?filename=NJHK200804000&dbcode=CJFQ&dbname=CJFD2008&v=}, + urldate = {2020-02-29}, + keywords = {aircraft design,multidisciplinary design optimization,optimization,优化,多学科设计优化,飞行器设计}, + langid = {中文;}, + number = {04} +} +@article{Hajela2012Application, + title={Application of Global Sensitivity Equations in Multidisciplinary Aircraft Synthesis}, + author={Hajela, P. and Bloebaum, C. L. and Sobieszczanski-Sobieski, Jaroslaw}, + journal={Journal of Aircraft}, + volume={27}, + number={12}, + pages = {1002-110}, + year={1990}, +} +@book{张伯伟2002全唐五代诗格会考, + title={全唐五代诗格会考}, + author={张伯伟}, + publisher={江苏古籍出版社}, + location={南京}, + year={2002}, + language={zh}, + keywords={book}, +} +@book{OBRIEN1994Aircraft, + title={Introduction to information systems}, + author={O'BRIEN, James A}, + location={$\text{7}^\text{th}$ ed. Burr Ridge, III}, + publisher={Irwin}, + year={1994}, + keywords={book}, +} +@proceedings{雷光春2012, + author = {雷光春}, + title = {综合湿地管理: 综合湿地管理国际研讨会论文集}, + location = {北京}, + publisher = {海洋出版社}, + year = {2012}, +} +@inbook{白书农, + title={植物开花研究}, + author={白书农}, + location = {北京}, + publisher={高等教育出版社}, + year={1998}, + pages = {146-163}, + editor = {李承森}, + booktitle = {植物科学进展}, +} +@phdthesis{zhanghesheng, + author = {张和生}, + title = {嵌入式单片机系统设计}, + location = {北京}, + school = {北京理工大学}, + year = {1998}, + language={zh}, + keywords={thesis}, +} +@phdthesis{Sobieski, + author = {Sobieski, I. P.}, + title = {Multidisciplinary Design Using Collaborative Optimization}, + location = {United States -- California}, + school = {Stanford University}, + year = {1998}, + keywords={thesis}, +} +@techreport{fengxiqiao, + author = {冯西桥}, + title = {核反应堆压力容器的LBB分析}, + address = {北京}, + institution = {清华大学核能技术设计研究院}, + year = {1997}, + language={zh}, + keywords={techreport}, +} +@techreport{Sobieszczanski, + author = {Sobieszczanski-Sobieski, J.}, + title = {Optimization by Decomposition: A Step from Hierarchic to Non-Hierarchic Systems}, + institution = {NASA CP-3031}, + year = {1989}, + keywords={techreport}, +} +@patent{jiangxizhou, + author = {姜锡洲}, + title = {一种温热外敷药制备方案}, + number = {881056078}, + date = {1983-08-12}, +} +@standard{GB/T3792.4-2009, + publisher ={中国标准出版社}, + title={全国信息与文献标准化技术委员会. 文献著录: 第4部分$\,$非书资料: GB/T 3792.4-2009}, + location = {北京}, + year={2010}, + language={zh}, + pages = {3}, + keywords={standard}, +} +@newspaper{xiexide, + author = {谢希德}, + title={创造学习的思路}, + date={1998-12-25}, + number = {10}, + journal = {人民日报}, + keywords = {newspaper}, +} +@online{yaoboyuan, + author = {姚伯元}, + title = {毕业设计(论文)规范化管理与培养学生综合素质}, + organization = {中国高等教育网教学研究}, + date = {2005-02-02}, + url = {http://www.cnnic.net.cn/hlwfzyj/hlwxzbg/201201/P020120709345264469680}, + urldate = {2013-03-26}, + keywords = {online}, +} diff --git a/templates/undergraduate-thesis-en/bithesis.cls b/templates/undergraduate-thesis-en/bithesis.cls deleted file mode 100644 index 7a6104a8..00000000 --- a/templates/undergraduate-thesis-en/bithesis.cls +++ /dev/null @@ -1,2333 +0,0 @@ -%% -%% This is file `bithesis.cls', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% bithesis.dtx (with options: `cls,thesis') -%% -%% Copyright (C) 2023 -%% Association of Bit Network Pioneer and any individual authors listed in the documentation. -%% ------------------------------------------------------------------------------ -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.3c of this license or (at your option) any later -%% version. This version of this license is in -%% http://www.latex-project.org/lppl/lppl-1-3c.txt -%% and the latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of -%% LaTeX version 2020/11/27 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Feng Kaiyu. -%% ------------------------------------------------------------------------------ -%% -\RequirePackage{expl3,l3keys2e} -\ProvidesExplClass{bithesis} -{2023-05-01}{3.5.4}{BIT Thesis Templates} -\int_new:N \g__bithesis_thesis_type_int -\int_new:N \g__bithesis_head_zihao_int -\bool_new:N \g__bithesis_twoside_bool -\bool_new:N \g__bithesis_thesis_type_english_bool -\bool_new:N \g__bithesis_blind_mode_bool -\bool_new:N \g__bithesis_quirks_mode_bool -\tl_new:N \g__bithesis_label_divide_char_tl -\seq_new:N \l__bithesis_right_seq -\seq_new:N \l__bithesis_left_seq -\cs_new:Npn \__bithesis_hide:n #1 { - \g__bithesis_const_substitute_symbol_tl -} - -\cs_new:Npn \__bithesis_secret_info:nn #1 #2 { - \bool_if:nTF \g__bithesis_blind_mode_bool { - #2 - } { - #1 - } -} - -\cs_new:Npn \__bithesis_secret_info:N #1 { - \__bithesis_secret_info:nn {#1} {\tl_map_function:NN #1 \__bithesis_hide:n } -} -\cs_new:Npn \__bithesis_secret_info:n #1 { - \__bithesis_secret_info:nn {#1} {\tl_map_function:NN {#1} \__bithesis_hide:n } -} - -\cs_generate_variant:Nn \__bithesis_secret_info:n {x} - -\cs_new:Npn \__bithesis_get_const:N #1 { - \__bithesis_if_thesis_english:TF { - \use:c {c__bithesis_label_ #1 _en_tl} - } { - \use:c {c__bithesis_label_ #1 _tl} - } -} -\cs_new:Npn \__bithesis_set_english_mode: { - \bool_gset_true:N \g__bithesis_thesis_type_english_bool -} -\cs_generate_variant:Nn \tl_if_empty:nTF {x} -\cs_generate_variant:Nn \seq_set_split:Nnn {Nnx} -\cs_new:Npn \__bithesis_same_page: { - \let\clearpage\relax - \let\cleardoublepage\relax -} -\cs_new:Npn \__bithesis_if_graduate:TF #1#2 { - \int_compare:nNnTF {3} < {\g__bithesis_thesis_type_int} - {#1} - {#2} - } - -\cs_new:Npn \__bithesis_if_thesis_int_type:nTF #1#2#3 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {#1} {#2} {#3}} -\cs_new:Npn \__bithesis_if_thesis_int_type:nT #1#2 {\__bithesis_if_thesis_int_type:nTF {#1} {#2} {}} - -\cs_new:Npn \__bithesis_if_thesis_english:TF #1#2 {\bool_if:nTF {\g__bithesis_thesis_type_english_bool} {#1} {#2}} -\cs_new:Npn \__bithesis_if_thesis_english:T #1 {\__bithesis_if_thesis_english:TF {#1}{}} -\cs_new:Npn \__bithesis_if_bachelor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} < {4} {#1} {#2}} -\cs_new:Npn \__bithesis_if_bachelor_thesis:T #1 {\__bithesis_if_bachelor_thesis:TF {#1} {}} -\cs_new:Npn \__bithesis_if_master_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {4} {#1} {#2}} -\cs_new:Npn \__bithesis_if_doctor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {5} {#1} {#2}} -\clist_const:Nn \c__bithesis_thesis_type_clist - { bachelor, bachelor_translation, bachelor_english, master, doctor} -\clist_const:Nn \c__bithesis_publication_modes_clist - { biblatex, custom } -\cs_new_protected:Npn \__bithesis_define_label:nn #1#2 - { \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} } - -\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnn #1#2#3 - { - \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} - } - -\cs_new_protected:Npn \__bithesis_define_label:nnn #1#2#3 - { - \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} - \tl_const:cn { c__bithesis_label_ #1 _en_tl } {#3} - } - -\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnnn #1#2#3#4 - { - \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} - \tl_const:cn { c__bithesis_ #1 _label_ #2 _en_tl } {#4} - } -\cs_new:Npn \smallgap: { - \hspace{0.45ex} -} -\cs_new:Npn \label_space: { - \__bithesis_if_bachelor_thesis:T { - \quad - } -} -\clist_map_inline:nn - { - {code} {代码}, - {udc} {UDC分类号:}, - {classification} {中图分类号:}, - {classified_level} {密级}, - {type} {种类}, - } - {\__bithesis_define_label:nn #1} -\clist_map_inline:nn - { - {originality} {原创性声明}, - {originality_clause} {本人郑重声明:所呈交的毕业设计(论文), - 是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外, - 本文不包含任何其他个人或集体已经发表或撰写过的研究成果。 - 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par~特此申明。}, - {authorization} {关于使用授权的声明}, - {authorization_clause} {本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定, - 其中包括:\circled{1}~学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件; - \circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文); - \circled{3}~学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}~学校可以学术交流为目的, - 复制赠送和交换本毕业设计(论文);\circled{5}~学校可以公布本毕业设计(论文)的全部或部分内容。}, - {originality_author_signature} - {本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, - {originality_supervisor_signature} - {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, - } {\__bithesis_define_label_by_thesis_type:nnn {bachelor} #1} -\clist_map_inline:nn - { - {originality} {原创性声明~Statement~of~Originality}, - {originality_clause} { - 本人郑重声明:所呈交的毕业设计(论文), - 是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外, - 本文不包含任何其他个人或集体已经发表或撰写过的研究成果。 - 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。特此申明。\par - \arialfamily I,\dunderline[-1pt]{1pt}{\makebox[18mm]{}},~solemnly~ - declare:~the~submitted~graduation~design~(thesis),~ - is~the~research~achievement~completed~independently~by~myself~ - under~the~guidance~of~the~supervisor.~This~article~does~not~contain~ - any~research~published~or~written~by~any~other~individual~or~group,~ - except~as~already~referenced~in~this~paper.~Individuals~and~groups~ - that~have~made~important~contributions~to~the~study~of~this~paper~ - are~clearly~indicated~and~cited~in~the~paper.\par - }, - {authorization} {关于使用授权的声明~State~of~Use~Authorization}, - {authorization_clause} { - 本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定, - 其中包括:\circled{1}学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件; - \circled{2}学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文); - \circled{3}学校可允许本毕业设计(论文)被查阅或借阅; - \circled{4}学校可以学术交流为目的,复制赠送和交换本毕业设计(论文); - \circled{5}学校可以公布本毕业设计(论文)的全部或部分内容。\par - I~fully~understand~the~regulations~on~the~storage,~ - use~of~graduation~design~(thesis)~in~Beijing~Institute~of~Technology.~ - Beijing~Institute~of~Technology~has~the~right~to~(1)~keep,~ - and~to~the~relevant~departments~to~send~the~original~or~copy~ - of~this~graduation~design~(thesis);~(2)~copy~and~preserve~this~ - graduation~design~(thesis)~by~photocopying,~miniature~or~other~ - means~of~reproduction;~(3)~allow~this~graduation~design~(thesis)~ - to~be~read~or~borrowed;~(4)~for~the~purpose~of~academic~exchange,~ - copy,~give~and~exchange~this~graduation~design~(thesis);~(5)~ - publish~all~or~part~of~the~contents~of~this~graduation~design~(thesis).~ - }, - } {\__bithesis_define_label_by_thesis_type:nnn {bachelor_english} #1} -\clist_map_inline:nn - { - {originality} {研究成果声明}, - {originality_clause} {本人郑重声明: - 所提交的学位论文是我本人在指导教师的指导下进行的研究工作获得的研究成果。 - 尽我所知,文中除特别标注和致谢的地方外, - 学位论文中不包含其他人已经发表或撰写过的研究成果, - 也不包含为获得北京理工大学或其它教育机构的学位或证书所使用过的材料。 - 与我一同工作的合作者对此研究工作所做的任何贡献均已在 - 学位论文中作了明确的说明并表示了谢意。\par~特此申明。}, - {authorization} {关于学位论文使用权的说明}, - {authorization_clause} {本人完全了解北京理工大学有关保管、使用学位论文的规定, - 其中包括:\circled{1}~学校有权保管、并向有关部门送交学位论文的原件与复印件; - \circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存学位论文; - \circled{3}~学校可允许学位论文被查阅或借阅;\circled{4}~ - 学校可以学术交流为目的,复制赠送和交换学位论文;\circled{5}~ - 学校可以公布学位论文的全部或部分内容(保密学位论文在解密后遵守此规定)。}, - {originality_author_signature} - {签\qquad 名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, - {originality_supervisor_signature} - {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, - } {\__bithesis_define_label_by_thesis_type:nnn {graduate} #1} -\clist_map_inline:nn - { - {author} {作\quad 者\quad 姓\quad 名} {Candidate~Name}, - {school} {学\quad 院\quad 名\quad 称} {School~or~Department}, - {supervisor} {指\quad 导\quad 教\quad 师} {Faculty~Mentor}, - {chairman} {答辩委员会主席} {Chair,~Thesis~Committee}, - {degree} - {申\smallgap: 请\smallgap: 学\smallgap: 位\smallgap: 级\smallgap: 别} - {Degree~Applied}, - {major} {学\quad 科\quad 专\quad 业} {Major}, - {institute} - {学\smallgap: 位\smallgap: 授\smallgap: 予\smallgap: 单\smallgap: 位} - {Degree~by}, - {defense_date} - {论\smallgap: 文\smallgap: 答\smallgap: 辩\smallgap: 日\smallgap: 期} - {The~Date~of~Defence}, - } {\__bithesis_define_label_by_thesis_type:nnnn {graduate} #1} -\clist_map_inline:nn - { - {school} {学\qquad 院} {School}, - {major} {专\qquad 业} {Degree}, - {class} {班\qquad{}级} {Class}, - {author} {学生姓名} {Author}, - {student_id} {学\qquad 号} {Student~ID}, - {supervisor} {指导教师} {Supervisor}, - {co_supervisor} {校外指导教师} {Co-Supervisor}, - {keywords} {关键词:} {Key~Words:~}, - {toc} {目\label_space: 录} {Table~of~Contents}, - {abstract} {摘\label_space: 要} {Abstract}, - {conclusion} {结\label_space: 论} {Conclusions}, - {appendix} {附\label_space: 录} {Appendices}, - {ack} {致\label_space: 谢} {Acknowledgement}, - {figure} {插\label_space: 图} {Illustrations}, - {table} {表\label_space: 格} {Tables}, - {appendix_prefix} {附录} {Appendix}, - {reference} {参考文献} {References}, - {university} {北京理工大学} {Beijing~Institute~of~Technology}, - {publications} {攻读学位期间发表论文与研究成果清单} - {Publications~During~Studies}, - % TODO: Not so sure about the translation. - {resume} {作者简介} {Author~Biography}, - {symbols} {主要符号对照表} {Nomenclature}, - {algo} {算法} {Algorithm}, - {them} {定理} {Theorem}, - {lem} {引理} {Lemma}, - {prop} {命题} {Proposition}, - {cor} {推论} {Corollary}, - {axi} {公理} {Axiom}, - {defn} {定义} {Definition}, - {conj} {猜想} {Conjecture}, - {exmp} {例} {Example}, - {case} {情形} {Case}, - {rem} {注} {Remark}, - {fig} {图} {Figure}, - {tab} {表} {Table}, - {equ} {式} {Equation}, - } - {\__bithesis_define_label:nnn #1} -\clist_const:Nn \c__bithesis_bachelor_thesis_header_clist - { - 北京理工大学本科生毕业设计(论文), - 北京理工大学本科生毕业设计(论文)外文翻译, - Beijing~Institute~of~Technology~Bachelor's~Thesis, - 北京理工大学硕士学位论文, - 北京理工大学博士学位论文, - } -\clist_const:Nn \c__bithesis_bachelor_thesis_headline_clist - { - 本科生毕业设计(论文), - 本科生毕业设计(论文)外文翻译, - Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis, - } -\keys_define:nn { bithesis } -{ - info .meta:nn = { bithesis / info } {#1}, - misc .meta:nn = { bithesis / misc } {#1}, - cover .meta:nn = { bithesis / cover } {#1}, - style .meta:nn = { bithesis / style } {#1}, - option .meta:nn = { bithesis / option } {#1}, - TOC .meta:nn = { bithesis / TOC } {#1}, - appendices .meta:nn = { bithesis / appendices } {#1}, - publications .meta:nn = { bithesis / publications } {#1}, - const .meta:nn = { bithesis / const } {#1}, -} -\keys_define:nn { bithesis / option } -{ - type .choice:, - type .value_required:n = true, - type .choices:Vn = - \c__bithesis_thesis_type_clist - { - \int_set_eq:NN \g__bithesis_thesis_type_int \l_keys_choice_int - \int_case:nn {\l_keys_choice_int} { - % 本科全英文也是英文模板。 - {3} {\__bithesis_set_english_mode:} - } - }, - type .initial:n = bachelor, - twoside .bool_gset:N = \g__bithesis_twoside_bool, - blindPeerReview .bool_gset:N = \g__bithesis_blind_mode_bool, - ctex .tl_set:N = \l__bithesis_options_to_ctex_tl, - quirks .bool_gset:N = \g__bithesis_quirks_mode_bool, - % xeCJK - autoFakeBold .tl_set:N = \g__bithesis_auto_fake_bold_tl, - autoFakeBold .initial:n = {3}, - % 是否开启英文模式。目前在设计上,这个选项仅对研究生模板生效。 - % 本科生模板的英文模式是根据 |type| 选项自动判断的。 - english .code:n = { \__bithesis_set_english_mode: } , -} -\keys_define:nn { bithesis / cover } - { - date .tl_set:N = \l__bithesis_cover_date_tl, - headerImage .tl_set:N = \l_bit_coverheaderimage_tl, - xiheiFont .tl_set:N = \l__bithesis_cover_xihei_font_path_tl, - xiheiFont .default:n = {STXihei}, - %% cover entry - dilimiter .tl_set:N = \l__bithesis_cover_dilimiter_tl, - labelAlign .tl_set:N = \l__bithesis_cover_label_align_tl, - labelAlign .initial:n = {r}, - valueAlign .tl_set:N = \l__bithesis_cover_value_align_tl, - valueAlign .initial:n = {c}, - labelMaxWidth .dim_set:N = \l__bithesis_cover_label_max_width_dim, - valueMaxWidth .dim_set:N = \l__bithesis_cover_value_max_width_dim, - autoWidthPadding .dim_set:N = \l__bithesis_cover_auto_width_padding_dim, - autoWidthPadding .initial:n = {0.25em}, - autoWidth .bool_set:N = \l__bithesis_cover_auto_width_bool, - autoWidth .initial:n = {true}, - underlineThickness .dim_set:N = \l__bithesis_cover_underline_thickness_dim, - underlineThickness .initial:n = {1pt}, - underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, - underlineOffset .initial:n = { -10pt }, - hideCoverInPeerReview .bool_set:N = \l__bithesis_style_hide_cover_in_peer_review_bool, - hideCoverInPeerReview .initial:n = {false}, - } -\keys_define:nn { bithesis / info } - { - title .tl_set:N = \l__bithesis_value_title_tl, - title .initial:n = {形状记忆聚氨酯的合成及其在织物中的应用(示例)}, - titleEn .tl_set:N = \l__bithesis_value_title_en_tl, - titleEn .initial:n = {Synthesis~and~Application~on~Texttiles~of~the~Shape~Memory~Polyurethane~(example)}, - % 因为是覆盖选项,所以不需要设置初始值。 - verticalTitle .tl_set:N = \l__bithesis_value_vertical_title_tl, - school .tl_set:N = \l__bithesis_value_school_tl, - major .tl_set:N = \l__bithesis_value_major_tl, - class .tl_set:N = \l__bithesis_value_class_tl, - author .tl_set:N = \l__bithesis_value_author_tl, - studentId .tl_set:N = \l__bithesis_value_student_id_tl, - supervisor .tl_set:N = \l__bithesis_value_supervisor_tl, - % 因为默认不显示,所以不需要设置初始值。 - externalSupervisor .tl_set:N = \l__bithesis_value_external_supervisor_tl, - keywords .tl_set:N = \l__bithesis_value_keywords_tl, - keywords .initial:n = {聚氨酯,形状记忆,织物(示例)}, - keywordsEn .tl_set:N = \l__bithesis_value_keywords_en_tl, - keywordsEn .initial:n = {Polyurethane,Shape Memory,Textiles (example)}, - translationTitle .tl_set:N = \l__bithesis_value_trans_title_tl, - translationOriginTitle .tl_set:N = \l__bithesis_value_trans_origin_title_tl, - % 中图分类号,研究生学位论文使用 - classification .tl_set:N = \l__bithesis_value_classification_tl, - classification .initial:n = {TQ~028.1(示例)}, - % UDC 分类号,研究生学位论文使用 - UDC .tl_set:N = \l__bithesis_value_udc_tl, - UDC .initial:n = {540(示例)}, - chairman .tl_set:N = \l__bithesis_value_chairman_tl, - degree .tl_set:N = \l__bithesis_value_degree_tl, - degreeEn .tl_set:N = \l__bithesis_value_degree_en_tl, - institute .tl_set:N = \l__bithesis_value_institute_tl, - institute .initial:n = {\tl_use:N \c__bithesis_label_university_tl}, - defenseDate .tl_set:N = \l__bithesis_value_defense_date_tl, - authorEn .tl_set:N = \l__bithesis_value_author_en_tl, - schoolEn .tl_set:N = \l__bithesis_value_school_en_tl, - supervisorEn .tl_set:N = \l__bithesis_value_supervisor_en_tl, - chairmanEn .tl_set:N = \l__bithesis_value_chairman_en_tl, - majorEn .tl_set:N = \l__bithesis_value_major_en_tl, - instituteEn .tl_set:N = \l__bithesis_value_institute_en_tl, - instituteEn .initial:n = {\c__bithesis_label_university_en_tl}, - defenseDateEn .tl_set:N = \l__bithesis_value_defense_date_en_tl, - defenseDateEn .initial:n = {June,~2019~(example)}, - % 因为默认不显示,所以不需要设置初始值。 - classifiedLevel .tl_set:N = \l__bithesis_value_classified_level_tl, - } -\keys_define:nn { bithesis / misc } - { - % 表格字体大小,默认为 5 号字体。 - tabularFontSize .tl_set:N = \l__bithesis_misc_tabular_font_size_tl, - tabularFontSize .initial:n = {5}, - arialFont .tl_set:N = \l__bithesis_misc_arial_font_path_tl, - autoref / algo .tl_set:N = \algoautorefname, - autoref / algo .initial:n = {\g__bithesis_const_autoref_algo_tl}, - autoref / them .tl_set:N = \themautorefname, - autoref / them .initial:n = {\g__bithesis_const_autoref_them_tl}, - autoref / lem .tl_set:N = \lemautorefname, - autoref / lem .initial:n = {\g__bithesis_const_autoref_lem_tl}, - autoref / prop .tl_set:N = \propautorefname, - autoref / prop .initial:n = {\g__bithesis_const_autoref_prop_tl}, - autoref / cor .tl_set:N = \corautorefname, - autoref / cor .initial:n = {\g__bithesis_const_autoref_cor_tl}, - autoref / axi .tl_set:N = \axiautorefname, - autoref / axi .initial:n = {\g__bithesis_const_autoref_axi_tl}, - autoref / defn .tl_set:N = \defnautorefname, - autoref / defn .initial:n = {\g__bithesis_const_autoref_defn_tl}, - autoref / conj .tl_set:N = \conjautorefname, - autoref / conj .initial:n = {\g__bithesis_const_autoref_conj_tl}, - autoref / exmp .tl_set:N = \exmpautorefname, - autoref / exmp .initial:n = {\g__bithesis_const_autoref_exmp_tl}, - autoref / case .tl_set:N = \caseautorefname, - autoref / case .initial:n = {\g__bithesis_const_autoref_case_tl}, - autoref / rem .tl_set:N = \remautorefname, - autoref / rem .initial:n = {\g__bithesis_const_autoref_rem_tl}, - hideLinks .bool_set:N = \l__bithesis_misc_hide_links_bool, - hideLinks .initial:n = {true}, - autoref / figure .tl_set:N = \figureautorefname, - autoref / figure .initial:n = {\g__bithesis_const_autoref_fig_tl}, - autoref / table .tl_set:N = \tableautorefname, - autoref / table .initial:n = {\g__bithesis_const_autoref_tab_tl}, - autoref / equ .tl_set:N = \equationautorefname, - autoref / equ .initial:n = {\g__bithesis_const_autoref_equ_tl}, - } -\keys_define:nn { bithesis / const } - { - autoref .meta:nn = { bithesis / const / autoref } { #1 }, - style .meta:nn = { bithesis / const / style } { #1 }, - info .meta:nn = { bithesis / const / info } { #1 }, - } -\keys_define:nn { bithesis / const / autoref } - { - algo .tl_set:N = \g__bithesis_const_autoref_algo_tl, - algo .initial:n = {\__bithesis_get_const:N {algo}}, - them .tl_set:N = \g__bithesis_const_autoref_them_tl, - them .initial:n = {\__bithesis_get_const:N {them}}, - lem .tl_set:N = \g__bithesis_const_autoref_lem_tl, - lem .initial:n = {\__bithesis_get_const:N {lem}}, - prop .tl_set:N = \g__bithesis_const_autoref_prop_tl, - prop .initial:n = {\__bithesis_get_const:N {prop}}, - cor .tl_set:N = \g__bithesis_const_autoref_cor_tl, - cor .initial:n = {\__bithesis_get_const:N {cor}}, - axi .tl_set:N = \g__bithesis_const_autoref_axi_tl, - axi .initial:n = {\__bithesis_get_const:N {axi}}, - defn .tl_set:N = \g__bithesis_const_autoref_defn_tl, - defn .initial:n = {\__bithesis_get_const:N {defn}}, - conj .tl_set:N = \g__bithesis_const_autoref_conj_tl, - conj .initial:n = {\__bithesis_get_const:N {conj}}, - exmp .tl_set:N = \g__bithesis_const_autoref_exmp_tl, - exmp .initial:n = {\__bithesis_get_const:N {exmp}}, - case .tl_set:N = \g__bithesis_const_autoref_case_tl, - case .initial:n = {\__bithesis_get_const:N {case}}, - rem .tl_set:N = \g__bithesis_const_autoref_rem_tl, - rem .initial:n = {\__bithesis_get_const:N {rem}}, - figure .tl_set:N = \g__bithesis_const_autoref_fig_tl, - figure .initial:n = {\__bithesis_get_const:N {fig}}, - table .tl_set:N = \g__bithesis_const_autoref_tab_tl, - table .initial:n = {\__bithesis_get_const:N {tab}}, - equ .tl_set:N = \g__bithesis_const_autoref_equ_tl, - equ .initial:n = {\__bithesis_get_const:N {equ}}, - } -\keys_define:nn { bithesis / const / style } - { - substituteSymbol .tl_set:N = \g__bithesis_const_substitute_symbol_tl, - substituteSymbol .initial:n = {*}, - } -\keys_define:nn { bithesis / const / info } - { - degree .tl_set:N = \g__bithesis_const_info_degree_tl, - degree .initial:n = { - \c__bithesis_graduate_label_degree_tl - }, - major .tl_set:N = \g__bithesis_const_info_major_tl, - major .initial:n = { - \__bithesis_if_graduate:TF { - \c__bithesis_graduate_label_major_tl - } { - \__bithesis_get_const:N {major} - } - }, - } -\keys_define:nn { bithesis / style } -{ - head .tl_set:N = \l__bithesis_style_head_tl, - head .initial:n = { - \clist_item:Nn \c__bithesis_bachelor_thesis_header_clist \g__bithesis_thesis_type_int - }, - headline .tl_set:N = \l__bithesis_style_headline_tl, - headline .initial:n = { - \clist_item:Nn \c__bithesis_bachelor_thesis_headline_clist \g__bithesis_thesis_type_int - }, - bibliographyIndent .bool_set:N = \l__bithesis_style_bibliography_indent_bool, - bibliographyIndent .initial:n = {true}, - pageVerticalAlign .choices:nn = {top, scattered} { - \tl_if_eq:NnTF \l_keys_choice_tl {top} - { \raggedbottom } - { \flushbottom } - }, - pageVerticalAlign .initial:n = {top}, - % 数学字体配置 - mathFont .choices:nn = { - asana, bonum, cm, concrete, dejavu, erewhon, euler, - fira, garamond, gfsneohellenic, kp, libertinus, lm, newcm, - pagella, schola, stix, stix2, termes, xcharter, xits, none, - } { \tl_set_eq:NN \l__bithesis_style_math_font_tl \l_keys_choice_tl }, - mathFont .initial:n = {cm}, - % Options that will be pass to `unicode-math` pkgs. - unicodeMathOptions .tl_set:N = \l__bithesis_unicode_math_options_tl, - % Windows 平台开启宋体伪粗体。 - windowsSimSunFakeBold .bool_set:N = \l__bithesis_style_windows_simsum_fake_bold, - windowsSimSunFakeBold .initial:n = {false}, - % 控制英文是否使用 hyphen 进行换行 - hyphen .bool_set:N = \l__bithesis_style_hyphen_bool, - hyphen .initial:n = {true}, -} -\keys_define:nn { bithesis / TOC } -{ - abstract .bool_set:N = \l__bithesis_add_abstract_to_toc_bool, - abstract .initial:n = {true}, - abstractEn .bool_set:N = \l__bithesis_add_abstract_en_to_toc_bool, - abstractEn .initial:n = {true}, - symbols .bool_set:N = \l__bithesis_add_symbols_to_toc_bool, - symbols .initial:n = {true}, -} -\keys_define:nn { bithesis / appendices } -{ - chapterLevel .bool_set:N = \l__bithesis_appendices_chapter_level_bool, - title .tl_set:N = \l__bithesis_appendices_title_tl, - TOCTitle .tl_set:N = \l__bithesis_appendix_toc_title_tl, -} -\keys_define:nn { bithesis / publications } -{ - % mode .choice:, - % mode .value_required:n = true, - % mode .choices:Vn = - % \c__bithesis_publication_modes_clist - % { - % \int_new:N \l__bithesis_publication_mode_int - % \int_set:Nn \l__bithesis_publication_mode_int \l_keys_choice_int - % }, - % mode .initial:n = biblatex, - sorting .bool_set:N = \l__bithesis_publications_sorting_bool, - sorting .initial:n = {true}, - omit .bool_set:N = \l__bithesis_publications_omit_bool, - omit .initial:n = {false}, - maxbibnames .int_set:N = \l__bithesis_publications_maxbibnames_int, - maxbibnames .initial:n = {3}, - minbibnames .int_set:N = \l__bithesis_publications_minbibnames_int, - minbibnames .initial:n = {1}, -} -\ProcessKeysOptions { bithesis / option } -\__bithesis_if_thesis_english:T { - \PassOptionsToClass{scheme=plain}{ctexbook} -} -\bool_if:NT \g__bithesis_blind_mode_bool { - \bool_set_false:N \g__bithesis_twoside_bool -} -\bool_if:NTF \g__bithesis_twoside_bool {} { - \PassOptionsToClass{oneside}{ctexbook} -} -\PassOptionsToClass{openany}{ctexbook} -\DeclareOption*{ - \PassOptionsToClass{\l__bithesis_options_to_ctex_tl}{ctexbook} -} -\PassOptionsToPackage{quiet,AutoFakeBold=\g__bithesis_auto_fake_bold_tl,AutoFakeSlant}{xeCJK} -\ProcessOptions\relax -\LoadClass[zihao=-4,]{ctexbook} -\RequirePackage{geometry} -\RequirePackage[table,xcdraw]{xcolor} -\RequirePackage{xeCJK} -\RequirePackage{titletoc} -\RequirePackage{setspace} -\RequirePackage{graphicx} -\RequirePackage{fancyhdr} -\RequirePackage{pdfpages} -\RequirePackage{setspace} -\RequirePackage{booktabs} -\RequirePackage{multirow} -\RequirePackage{tikz} -\RequirePackage{etoolbox} -\RequirePackage[bookmarksnumbered]{hyperref} -\RequirePackage[strut=off]{caption} -\RequirePackage{array} -\RequirePackage{amsmath} -\RequirePackage{amssymb} -\RequirePackage{pifont} -\RequirePackage{amsthm} -\RequirePackage{pdfpages} -\RequirePackage{listings} -\RequirePackage{enumitem} -\RequirePackage{fmtcount} -\pdfstringdefDisableCommands{% - \let\quad\empty -} -\__bithesis_if_graduate:TF { - \int_set:Nn \g__bithesis_head_zihao_int {5} - \geometry{ - a4paper, - left=2.7cm, - bottom=2.5cm + 7bp, - top=3.5cm + 7bp, - right=2.7cm, - % `headsep' is affected by `top' option. - headsep = 3.5cm + 7bp - 2.5cm - 15bp, - headheight = 15 bp, - % `footskip' is affected by `bottom' option. - footskip = 2.5cm + 7bp - 1.8cm, - } -} { - \int_set:Nn \g__bithesis_head_zihao_int {4} - \geometry{ - a4paper, - left=3cm, - bottom=2.6cm + 7bp, - top=3.5cm + 7bp, - right=2.6cm, - % `headsep' is affected by `top' option. - headsep = 3.5cm + 7bp - 2.4cm - 20bp, - headheight = 20 bp, - % `footskip' is affected by `bottom' option. - footskip = 2.6cm + 7bp - 2cm, - } -} -\__bithesis_if_bachelor_thesis:T { - \setlength{\intextsep}{1.80\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} -} -\setmainfont{Times~New~Roman} -\setromanfont{Times~New~Roman} -\cs_new:Npn \__bithesis_font_path: - { - \str_if_eq:NNTF { \l__bithesis_font_type_tl } { font } - { } - { Path = \l__bithesis_font_path_tl / , } - } -\cs_new:Npn \__bithesis_load_unicode_math_pkg: - { - \PassOptionsToPackage { \l__bithesis_unicode_math_options_tl } { unicode-math } - \RequirePackage { unicode-math } - } -\cs_new:Npn \__bithesis_define_math_font:nn #1#2 - { - \cs_new:cpn { __bithesis_load_math_font_ #1 : } - { - \__bithesis_load_unicode_math_pkg: - \setmathfont { #2 } - } - } -\clist_map_inline:nn - { - { asana } { Asana-Math.otf }, - { concrete } { Concrete-Math.otf }, - { erewhon } { Erewhon-Math.otf }, - { euler } { Euler-Math.otf }, - { fira } { FiraMath-Regular.otf }, - { garamond } { Garamond-Math.otf }, - { gfsneohellenic } { GFSNeohellenicMath.otf }, - { kp } { KpMath-Regular.otf }, - { libertinus } { LibertinusMath-Regular.otf }, - { lm } { latinmodern-math.otf }, - { newcm } { NewCMMath-Regular.otf }, - { stix } { STIXMath-Regular.otf }, - { stix2 } { STIXTwoMath-Regular.otf }, - { xcharter } { XCharter-Math.otf }, - { xits } { XITSMath-Regular.otf }, - { bonum } { texgyrebonum-math.otf }, - { dejavu } { texgyredejavu-math.otf }, - { pagella } { texgyrepagella-math.otf }, - { schola } { texgyreschola-math.otf }, - { termes } { texgyretermes-math.otf } - } - { \__bithesis_define_math_font:nn #1 } -\cs_new:Npn \__bithesis_load_math_font_cm: { } -\cs_new:Npn \__bithesis_load_math_font_none: { } -\cs_new:Npn \__bithesis_load_font: - { - \use:c { __bithesis_load_math_font_ \l__bithesis_style_math_font_tl : } - } -\ctex_at_end_preamble:n { - % 针对 Windows 字体采用 Fake Bold 宋体 - \bool_if:NT \l__bithesis_style_windows_simsum_fake_bold - { - \RequirePackage{ifplatform} - \ifwindows - \setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant] - \fi - } - - % 在导言区末尾加载数学字体。 - \__bithesis_load_font: - - % misc / hideLinks 选项 - \bool_if:NT \l__bithesis_misc_hide_links_bool - { - \hypersetup { hidelinks } - } - - \__bithesis_if_thesis_english:TF { - \__bithesis_if_thesis_int_type:nT {3} { - % 对于本科全英文专业模板 - % Font Arial is needed. - \newfontfamily\arialfamily{Arial} - } - - } { - % 对于其他的中文模板, - % 需要加载细黑体。 - \tl_if_blank:VTF \l__bithesis_cover_xihei_font_path_tl {} - { - \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant] - {\l__bithesis_cover_xihei_font_path_tl} - } - } - - % 对于本科全英文专业模板,需要自定义日期格式。 - \__bithesis_if_thesis_int_type:nT {3} { - \RequirePackage[en-US]{datetime2} - \RequirePackage{indentfirst} - \DTMlangsetup[en-US]{dayyearsep={\space}} - } - - % Define biblatex category if it was imported. - % 这部分是给研究生模板中的 - % 「攻读学位期间发表论文与研究成果清单」使用的。 - \cs_if_exist:NT \DeclareBibliographyCategory { - \DeclareBibliographyCategory{mypub} - } - - % Define biblatex strings if it was imported. - % 这部分是给研究生模板中的 - % gbpunctin = false 时使用的。 - \cs_if_exist:NT \DefineBibliographyStrings { - \DefineBibliographyStrings{english}{in={}} - \DefineBibliographyStrings{english}{incn={}} - } - - % 修改 biblatex 中「专利」(patent)部分的著录格式。 - % 主要根据北理工自定义的规范,参考 biblatex 和 - % biblatex-gb7714-2015 的实现修改而成。 - % - % 默认不开启,因为此修改可能会产生其他边界问题。 - \bool_if:NT \g__bithesis_quirks_mode_bool { - \cs_if_exist:NT \DeclareBibliographyDriver { - % - % 重设专利title的输出,将文献类型标识符输出出去 - % - \newbibmacro*{patenttitle}{%原输出来自biblatex.def文件 - \ifboolexpr{% - test{\iffieldundef{title}}% - and% - test{\iffieldundef{subtitle}}% - }% - {}% - {\printtext[title]{\bibtitlefont% - \printfield[titlecase]{title}% - \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 - {}{\setunit{\subtitlepunct}% - \printfield[titlecase]{subtitle}}% - \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}% - \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 - {\setunit{\subtitlepunct}\printfield{titleaddon}}% - % :地区 - \setunit{\subtitlepunct}\iflistundef{location} - {} - {\setunit*{\subtitlepunct}% - \printtext{%[parens] - \printlist[][-\value{listtotal}]{location}}}% - % ,专利号 - \setunit{\addcomma\addspace}\printfield{number}%写专利号 - \setunit{\addcomma\addspace} - \usebibmacro{newsdate}% - }% - }% - } - - % - % 重定义专利文献驱动 - % - \DeclareBibliographyDriver{patent}{%源来自standard.BBX - \usebibmacro{bibindex}% - \usebibmacro{begentry}% - \usebibmacro{author}% - \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 - \usebibmacro{patenttitle}%给出专利专用的标题输出 - \iftoggle{bbx:gbstrict}{}{% - \newunit% - \printlist{language}% - \newunit\newblock - \usebibmacro{byauthor} - }% - \newunit\newblock - \printfield{type}% - \setunit*{\addspace}% - \newunit\newblock - \usebibmacro{byholder}% - \newunit\newblock - \printfield{note}% - \newunit\newblock - \usebibmacro{doi+eprint+url}% - \newunit\newblock - \usebibmacro{addendum+pubstate}% - \setunit{\bibpagerefpunct}\newblock - \usebibmacro{pageref}% - \newunit\newblock - \iftoggle{bbx:related} - {\usebibmacro{related:init}% - \usebibmacro{related}} - {}% - \usebibmacro{annotation}\usebibmacro{finentry}} - } - } -} -\cs_new:Npn \xihei:n #1 { - \xeCJK_family_if_exist:nTF {xihei} { - \CJKfamily{xihei} #1 - }{ - \heiti #1 - } -} -\cs_new:Npn \l__bithesis_title_font_cs:n #1 { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - \arialfamily #1 - } { - \heiti #1 - } -} -\cs_new:Npn \l__bithesis_unnumchapter_style_cs:n #1 { - % 本科全英文、研究生学位论文需要加粗 - \int_compare:nNnTF {\g__bithesis_thesis_type_int} > {2} - { - \bfseries #1 - } { - \mdseries #1 - } -} -\cs_set:Npn \arabicHeiti #1 {#1} -\fancypagestyle{BIThesis}{ - \fancyhf{} - % 定义页眉、页码 - \fancyhead[C]{ - \zihao{\int_use:N \g__bithesis_head_zihao_int} - \ziju{0.08} - \songti{\tl_use:N \l__bithesis_style_head_tl} - } - \fancyfoot[C]{\songti\zihao{5} \thepage} - % 页眉分割线稍微粗一些 - \RenewDocumentCommand \headrulewidth {} {0.6pt} -} -\ctexset{chapter={ - number = {\arabicHeiti{ \arabic{chapter} }}, - format = { \l__bithesis_title_font_cs:n \bfseries \centering \zihao{3}}, - nameformat = {}, - titleformat = {}, - aftername = \hspace{9bp}, - pagestyle = BIThesis, - beforeskip = 8bp, - afterskip = 32bp, - fixskip = true, - lofskip = 0cm, - lotskip = 0cm, - } -} - -\ctexset{section={ - number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}}}, - format = {\l__bithesis_title_font_cs:n \raggedright \bfseries \zihao{4}}, - nameformat = {}, - titleformat = {}, - aftername = \hspace{8bp}, - beforeskip = 20bp plus 1ex minus .2ex, - afterskip = 18bp plus .2ex, - fixskip = true, - } -} - -\ctexset{subsection={ - number = { - \arabicHeiti{ - \thechapter.\hspace{1bp} - \arabic{section}.\hspace{1bp} - \arabic{subsection} - } - }, - format = {\l__bithesis_title_font_cs:n \bfseries \raggedright \zihao{-4}}, - nameformat = {}, - titleformat = {}, - aftername = \hspace{7bp}, - beforeskip = 17bp plus 1ex minus .2ex, - afterskip = 14bp plus .2ex, - fixskip = true, - } -} - -\ctexset{ - secnumdepth = 3, - subsubsection={ - numbering = true, - number = { - \arabicHeiti{ - \arabic{chapter}.\hspace{1bp} - \arabic{section}.\hspace{1bp} - \arabic{subsection}.\hspace{1bp} - \arabic{subsubsection} - } - }, - format={\l__bithesis_title_font_cs:n \raggedright \zihao{-4}}, - nameformat = {}, - titleformat = {}, - beforeskip=14bp plus 1ex minus .2ex, - afterskip=14bp plus .2ex, - fixskip=true, - } -} -\addtocontents{toc}{\protect\hypersetup{hidelinks}} - -\__bithesis_if_graduate:TF { - % 对于研究生模板,定义各章标题为宋体四号。 - \titlecontents{chapter}[0pt]{\songti \zihao{4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % section 标题为宋体小四号。缩进为两个字符宽度。 - \titlecontents{section}[2\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % subsection 标题为宋体小四号。缩进为四个字符宽度。 - \titlecontents{subsection}[4\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} -} { - % 对于其他,定义各章标题为宋体小四号。 - \titlecontents{chapter}[0pt]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % section 标题为宋体小四号。 - \titlecontents{section}[1\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % subsection 标题为宋体小四号。 - \titlecontents{subsection}[2\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} -} -\titlecontents{figure}[0pt]{\songti\zihao{-4}} - {\figurename~\thecontentslabel\quad}{\hspace*{-1.5cm}} - {\hspace{.5em}\titlerule*{.}\contentspage} -\titlecontents{table}[0pt]{\songti\zihao{-4}} - {\tablename~\thecontentslabel\quad}{\hspace*{-1.5cm}} - {\hspace{.5em}\titlerule*{.}\contentspage} -\RenewDocumentCommand \frontmatter {} { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - % 本科全英文专业论文,页码使用小罗马数字。 - \pagenumbering{roman} - } { - \pagenumbering{Roman} - } - % 这部分的章节标题不进行编号。 - \ctexset{ - chapter = { - numbering = false, - } - } - \setstretch{1.53} - \pagestyle{BIThesis} - - % 表格内容默认使用五号字。 - % - % 由于这种方式会影响所有的表格, - % 所以我们尽可能延迟这种影响。 - % - % 不过,在目前的代码实现中没有在封面 - % 之类的地方使用表格,所以目前即使放在 - % preamble 中也不会有影响。 - \AtBeginEnvironment{tabular}{\zihao{\l__bithesis_misc_tabular_font_size_tl}} - \AtBeginEnvironment{tabular*}{\zihao{\l__bithesis_misc_tabular_font_size_tl}} -} -\RenewDocumentCommand \mainmatter {} { - % 另起一个空页,以便于后续的章节标题编号。 - % \clearpage - \cleardoublepage - % 这部分的章节标题进行编号。 - \ctexset{ - chapter = { - numbering = true, - } - } - % 页码使用阿拉伯数字。 - \pagenumbering{arabic} - \pagestyle{BIThesis} - % 正文 22 磅的行距 - \setlength{\parskip}{0em} - \setstretch{1.53} - % 修复脚注出现跨页的问题 - \interfootnotelinepenalty=10000 -} -\RenewDocumentCommand \backmatter {} { - % 同样,所有的章节标题不进行编号。 - \setcounter{section}{0} - \setcounter{subsection}{0} - \setcounter{subsubsection}{0} - \ctexset{ - chapter = { - numbering = false, - beforeskip = 18bp, - format = { - \l__bithesis_title_font_cs:n \l__bithesis_unnumchapter_style_cs:n \centering \zihao{3} - }, - afterskip = 26bp, - } - } -} -\setlength{\abovecaptionskip}{11pt} -\__bithesis_if_bachelor_thesis:TF { - \__bithesis_if_thesis_english:TF { - \setlength{\belowcaptionskip}{9pt} - } { - % 为了满足 “前后一行空白的问题”,需要删除 Caption 下方的间距。 - % 详见 `caption` 宏包手册和 - % https://github.com/CTeX-org/forum/issues/86 - % - % 这里实际的 skip 在 15pt 左右,但是全部移除会导致当图片置于页面顶部时, - % 图片与上方的间距过小,因此这里只移除 5pt。 - % 当然,这样会导致文本间的图片的 Caption 下方的间距微微大于一行。 - \captionsetup{belowskip=-5pt} - } -} { - % 而研究生模板不存在这个问题。 - \setlength{\belowcaptionskip}{9pt} -} -\__bithesis_if_graduate:TF { - \tl_set:Nn \g__bithesis_label_divide_char_tl {.} -} { - \tl_set:Nn \g__bithesis_label_divide_char_tl {-} -} -\cs_set:Npn \thefigure {\thechapter\g__bithesis_label_divide_char_tl\arabic{figure}} -\captionsetup[figure]{font=small,labelsep=space} - -\cs_set:Npn \thetable {\thechapter\g__bithesis_label_divide_char_tl\arabic{table}} -\captionsetup[table]{font=small,labelsep=space} - -\cs_set:Npn \theequation {\thechapter\g__bithesis_label_divide_char_tl\arabic{equation}} - -\AtBeginDocument{ - \cs_gset:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}} - \cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl} -} -\captionsetup[lstlisting]{font=small,labelsep=space} -\bool_if:NF \l__bithesis_style_hyphen_bool { - \hbadness=10000 - \tolerance=1 - \emergencystretch=\maxdimen - \hyphenpenalty=10000 -} -\definecolor{codegreen}{rgb}{0,0.6,0} -\definecolor{codegray}{rgb}{0.5,0.5,0.5} -\definecolor{codepurple}{rgb}{0.58,0,0.82} -\definecolor{backcolour}{rgb}{0.95,0.95,0.92} -\lstdefinestyle{examplestyle}{ - backgroundcolor=\color{backcolour}, - commentstyle=\color{codegreen}, - keywordstyle=\color{magenta}, - numberstyle=\tiny\color{codegray}, - stringstyle=\color{codepurple}, - basicstyle=\ttfamily\footnotesize, - breakatwhitespace=false, - breaklines=true, - captionpos=b, - keepspaces=true, - numbers=left, - numbersep=5pt, - showspaces=false, - showstringspaces=false, - showtabs=false, - tabsize=2 -} -\lstset{style=examplestyle} -\cs_set:Npn \listfigurename {\__bithesis_get_const:N {figure}} -\cs_set:Npn \listtablename {\__bithesis_get_const:N {table}} -\theoremstyle{plain} - \newtheorem{algo}{\__bithesis_get_const:N {algo}}[chapter] - \newtheorem{them}{\__bithesis_get_const:N {them}}[chapter] - \newtheorem{lem}{\__bithesis_get_const:N {lem}}[chapter] - \newtheorem{prop}{\__bithesis_get_const:N {prop}}[chapter] - \newtheorem{cor}{\__bithesis_get_const:N {cor}}[chapter] - \newtheorem{axi}{\__bithesis_get_const:N {axi}}[chapter] -\theoremstyle{definition} - \newtheorem{defn}{\__bithesis_get_const:N {defn}}[chapter] - \newtheorem{conj}{\__bithesis_get_const:N {conj}}[chapter] - \newtheorem{exmp}{\__bithesis_get_const:N {exmp}}[chapter] - \newtheorem{case}{\__bithesis_get_const:N {case}} -\theoremstyle{remark} - \newtheorem{rem}{\__bithesis_get_const:N {rem}} - \renewcommand{\qedsymbol}{\ensuremath{\blacksquare}} -\cs_new:Npn \__bithesis_dunderline:nnn #1#2#3 { - {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}} -} -\cs_new:Npn \__bithesis_dunderline:nn #1#2 { - \__bithesis_dunderline:nnn {#1} {1pt} {#2} -} -\cs_new:Npn \__bithesis_dunderline:n #1 { - \__bithesis_dunderline:nnn {-10pt} {1pt} {#1} -} -\newcommand\dunderline[3][-1pt]{{% - \setbox0=\hbox{#3} - \ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}} -\cs_new:Npn \__bithesis_render_cover_entry:nn #1#2 { - \makebox[\l__bithesis_cover_label_max_width_dim][\l__bithesis_cover_label_align_tl]{ - \tl_if_blank:VTF #1 {} {#1\l__bithesis_cover_dilimiter_tl} - } - \hspace{1ex} - \__bithesis_dunderline:nnn{\l__bithesis_cover_underline_offset_dim} - {\l__bithesis_cover_underline_thickness_dim}{ - \makebox[\l__bithesis_cover_value_max_width_dim][\l__bithesis_cover_value_align_tl]{#2} - }\par -} -\cs_new:Npn \__bithesis_get_text_width:Nn #1#2 - { - \hbox_set:Nn \l_tmpa_box {#2} - \dim_set:Nn #1 { \box_wd:N \l_tmpa_box } - } -\cs_generate_variant:Nn \__bithesis_get_text_width:Nn { NV } -\cs_new:Npn \__bithesis_get_max_text_width:NN #1#2 - { - \group_begin: - \seq_set_eq:NN \l__bithesis_tmpa_seq #2 - \dim_zero_new:N \l__bithesis_tmpa_dim - \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_tmpa_seq } - { - \seq_pop_left:NN \l__bithesis_tmpa_seq \l__bithesis_tmpa_tl - \__bithesis_get_text_width:NV \l__bithesis_tmpa_dim \l__bithesis_tmpa_tl - % 在两边加上空白,避免文本太靠边。 - \dim_gset:Nn #1 { \dim_max:nn {#1} { \l__bithesis_tmpa_dim + \l__bithesis_cover_auto_width_padding_dim * 2} } - } - \group_end: - } -\cs_new:Npn \__bithesis_parse_entry #1 #2 { - \seq_set_split:Nnx \l__bithesis_tmp_right_seq {\\} {#2} - \seq_clear:N \l__bithesis_tmp_left_seq - \seq_map_inline:Nn \l__bithesis_tmp_right_seq { - \seq_put_right:Nn \l__bithesis_tmp_left_seq {} - } - \seq_put_left:Nn \l__bithesis_tmp_left_seq {#1} - \seq_pop_right:NN \l__bithesis_tmp_left_seq \g__bithesis_trashcan_tl -} -\cs_new:Npn \__bithesis_render_cover_entry:n #1 { - % 左边是标签,右边是值。 - % 形如: - % { {label_1} {value_1}, {label_2} {value 2} } - % 首先转换成 seq 类型。 - \seq_set_from_clist:NN \l__bithesis_input_seq #1 - \seq_map_inline:Nn \l__bithesis_input_seq { - % 然后对于每一对 label 和 value,首先查找 - % value 中是否含有 \\ 字符,如果有,则将其分割成多个 - % label - value 对。 - % 比如 {label_1} {value \\ 1} 会被转换成 - % { {label_1} {value}, {} {1} } - \__bithesis_parse_entry ##1 - % 然后将这些 label - value 对添加到 \l__bithesis_right_seq - % 或者 \l__bithesis_left_sql 中。 - % left 就是 label,right 就是 value。 - \seq_concat:NNN \l__bithesis_right_seq \l__bithesis_right_seq \l__bithesis_tmp_right_seq - \seq_concat:NNN \l__bithesis_left_seq \l__bithesis_left_seq \l__bithesis_tmp_left_seq - } - - % 如果用户选择自动计算最大宽度,则计算最大宽度。 - \bool_if:NT \l__bithesis_cover_auto_width_bool { - \__bithesis_get_max_text_width:NN \l__bithesis_cover_label_max_width_dim \l__bithesis_left_seq - \__bithesis_get_max_text_width:NN \l__bithesis_cover_value_max_width_dim \l__bithesis_right_seq - } - - % 最后,根据宽度渲染 label 和 value 对。 - \group_begin: - \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_left_seq } - { - \seq_pop_left:NN \l__bithesis_left_seq \l__bithesis_tmpa_tl - \seq_pop_left:NN \l__bithesis_right_seq \l__bithesis_tmpb_tl - \tl_if_empty:xTF \l__bithesis_tmpb_tl {} { - \__bithesis_render_cover_entry:nn {\l__bithesis_tmpa_tl} {\l__bithesis_tmpb_tl} - } - } - \group_end: -} -\cs_new:Npn \make_graduate_cover: { - \cleardoublepage - \begin{titlepage} - { - \heiti\zihao{5} - \tl_if_blank:VTF \l__bithesis_value_classified_level_tl {} { - \flushright - \c__bithesis_label_classified_level_tl:~ - \l__bithesis_value_classified_level_tl \par - } - } - \centering - \vspace*{65mm} - {\heiti\zihao{-2} \l__bithesis_value_title_tl} - \vskip 60mm - % 黑体 小三 - {\heiti \zihao{-3} \__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl}} - \vskip 10mm - % 黑体 小三 - {\heiti \zihao{-3} \l__bithesis_cover_date_tl} - \end{titlepage} -} -\cs_new:Npn \make_paper_back: { - \cleardoublepage - \begin{titlepage} - \vskip 5cm - \begin{center} - \setstretch{1.1} - \begin{minipage}[t][19.7cm]{2em} - \begin{center} - { - \heiti\zihao{3} - \tl_if_blank:VTF \l__bithesis_value_vertical_title_tl - {\l__bithesis_value_title_tl}{\l__bithesis_value_vertical_title_tl} - } - \vfill - {\heiti\zihao{3}\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl}} - \vfill - {\heiti\zihao{3}\c__bithesis_label_university_tl} - \end{center} - \end{minipage} - \end{center} - % \vskip 5cm - \end{titlepage} -} -\cs_new:Npn \__bithesis_make_chinese_title_page: { - \cleardoublepage - \begin{titlepage} - { - % 密级、分类号 - {\heiti \zihao{5} \noindent \c__bithesis_label_classification_tl} - \l__bithesis_value_classification_tl\\ - {\heiti \zihao{5} \c__bithesis_label_udc_tl} \l__bithesis_value_udc_tl - } - - \begin{center} - - \vskip \stretch{1} - - {\heiti\zihao{-2} \l__bithesis_value_title_tl} - - \vskip \stretch{1} - - \def\tabcolsep{1pt} - \def\arraystretch{1.5} - - { - \renewcommand{\baselinestretch}{2} - - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\qquad} - } - \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} - - % 如果不是自动计算宽度,且用户没有自定义宽度, - % 则尝试提供一个默认宽度。 - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {45mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {60mm} - } - } - - % 渲染信息。 - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_tl} {\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl}}, - {\c__bithesis_graduate_label_school_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_graduate_label_supervisor_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_tl}}, - {\c__bithesis_graduate_label_chairman_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_tl}}, - {\g__bithesis_const_info_degree_tl} {\l__bithesis_value_degree_tl}, - {\g__bithesis_const_info_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_graduate_label_institute_tl} {\l__bithesis_value_institute_tl}, - {\c__bithesis_graduate_label_defense_date_tl} {\l__bithesis_value_defense_date_tl}, - } - - \heiti\zihao{-3} - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - } - \end{center} - \vskip \stretch{0.5} - \end{titlepage} -} -\cs_new:Npn \__bithesis_make_english_title_page: { - \begin{titlepage} - \begin{center} - - \vspace*{10em} - - { - \zihao{-2} - \textbf{\l__bithesis_value_title_en_tl} - } - - \vskip \stretch{1} - - { - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:~} - } - - \tl_set:Nn \l__bithesis_cover_label_align_tl {l} - \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} - - % 如果不是自动计算宽度,且用户没有自定义宽度, - % 则尝试提供一个默认宽度。 - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {55mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {85mm} - } - } - - % 渲染信息。 - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_author_en_tl}}, - {\c__bithesis_graduate_label_school_en_tl} {\l__bithesis_value_school_en_tl}, - {\c__bithesis_graduate_label_supervisor_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_en_tl}}, - {\c__bithesis_graduate_label_chairman_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_en_tl}}, - {\c__bithesis_graduate_label_degree_en_tl} {\l__bithesis_value_degree_en_tl}, - {\c__bithesis_graduate_label_major_en_tl} {\l__bithesis_value_major_en_tl}, - {\c__bithesis_graduate_label_institute_en_tl} {\l__bithesis_value_institute_en_tl}, - {\c__bithesis_graduate_label_defense_date_en_tl} {\l__bithesis_value_defense_date_en_tl}, - } - - \zihao{-3} - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - } - - \end{center} - - \vskip \stretch{0.5} - \end{titlepage} -} -\newcommand{\circled}[2][]{\tikz[baseline=(char.base)] - {\node[shape = circle, draw, inner~sep = 1pt] - (char) {\phantom{\ifblank{#1}{#2}{#1}}}; - \node at (char.center) {\makebox[0pt][c]{#2}};}} -\robustify{\circled} -\cs_new:Npn \__bithesis_graduate_originality: - { - % 取消页眉页脚。 - \ctexset { - chapter / pagestyle = plain, - } - - \begin{titlepage} - % 不计算页码。 - \pagenumbering{gobble} - - % 原创性声明部分 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{3} - \c__bithesis_graduate_label_originality_tl - } - \end{center} - - % 本部分字号为四号。 - \zihao{4} - \qquad\c__bithesis_graduate_label_originality_clause_tl - - \vspace{17mm} - - \begin{flushright} - \c__bithesis_graduate_label_originality_author_signature_tl\par - \end{flushright} - - \vspace{16mm} - - % 使用授权声明部分。 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{3} - \c__bithesis_graduate_label_authorization_tl - } - \end{center} - - \qquad\c__bithesis_graduate_label_authorization_clause_tl - - \vspace*{15mm} - - \begin{flushright} - \begin{spacing}{1.65} - \zihao{4} - % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} - \c__bithesis_graduate_label_originality_author_signature_tl\par - \c__bithesis_graduate_label_originality_supervisor_signature_tl\par - \end{spacing} - \end{flushright} - \end{titlepage} - \cleardoublepage - } -\DeclareDocumentCommand \BITSetup { m } - { \keys_set:nn { bithesis } { #1 }} -\DeclareDocumentCommand \BigStar { } - { \ding{72} } - \NewDocumentEnvironment {blindPeerReview} {O{\c_true_bool} +b} - { - \bool_if:nTF {\g__bithesis_blind_mode_bool && #1} {} { - #2 - } - } {} -\RenewDocumentCommand \cleardoublepage { } - { - \clearpage - \bool_if:NT \g__bithesis_twoside_bool - { - \int_if_odd:nF \c@page - { \hbox:n { } \thispagestyle { empty } \newpage } - } - } -\DeclareDocumentCommand \SecretInfo { m o } - { - \IfValueTF {#2} { - \__bithesis_secret_info:nn {#1} {#2} - } { - \__bithesis_secret_info:x {#1} - } - } -\DeclareDocumentCommand \MakeCover {} - { - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \group_begin: - - \int_case:nn {\g__bithesis_thesis_type_int} - { - {1} - { - \begin{titlepage} - \vspace*{16mm} - - \centering - - \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { - \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ - } - - \vspace*{-3mm} - - \zihao{-0}\textbf{\ziju{0.12}\songti{\l__bithesis_style_headline_tl}}\par - - \vspace{16mm} - - \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par - - \vspace{3mm} - - \begin{spacing}{1.2} - \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par - \end{spacing} - - \vspace{15mm} - - \begin{spacing}{1.8} - \begin{center} - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} - } - % if not auto width, try override width - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} - } - } - - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, - {\g__bithesis_const_info_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, - } - - \zihao{3} - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{center} - \end{spacing} - - \vspace*{\fill} - \centering - \zihao{3}\ziju{0.5}\songti{ - \tl_if_empty:NTF \l__bithesis_cover_date_tl { - \today - } { - \l__bithesis_cover_date_tl - } - } - \end{titlepage} - } - {2} - { - \begin{titlepage} - \centering - - \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { - \includegraphics[width=6.87cm]{\l_bit_coverheaderimage_tl}\\ - } - - \vspace{1.2mm} - - \zihao{2}\textbf{\songti{\l__bithesis_style_headline_tl}} - - \vspace{10mm} - - { - - \begin{spacing}{1.8} - - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\textbf{:}} - \bool_set_false:N \l__bithesis_cover_auto_width_bool - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {115mm} - - \clist_set:Nn \l__bithesis_input_clist { - {\zihao{4}\textbf{外文原文题目}} {\l__bithesis_value_trans_origin_title_tl}, - {\zihao{4}\textbf{中文翻译题目}} {\l__bithesis_value_trans_title_tl}, - } - - \zihao{-3} - \centering - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{spacing} - - } - - \vspace{19mm} - - \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par - - \vspace{3mm} - - \begin{spacing}{1.2} - \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par - \end{spacing} - - \vspace{19mm} - - \begin{spacing}{1.8} - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} - } - - % 如果不是自动计算宽度,且用户没有自定义宽度, - % 则尝试提供一个默认宽度。 - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} - } - } - - \zihao{3} - - % 渲染信息。 - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, - } - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{spacing} - - \vspace*{\fill} - \end{titlepage} - } - {3} { - \begin{titlepage} - \vspace*{16mm} - - \centering - - \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { - \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ - } - - \vspace*{-3mm} - - \zihao{1}\textbf{\ziju{0.12}\l__bithesis_style_headline_tl}\par - - \vspace{18mm} - - \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_en_tl}\par - - \vspace{10mm} - - \begin{spacing}{1.8} - \begin{center} - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} - } - - % if not auto width, try override width - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {20mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {105mm} - } - } - - \zihao{4} - - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_label_school_en_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_label_major_en_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_author_en_tl} {\l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_en_tl} {\l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_en_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_en_tl} {\l__bithesis_value_external_supervisor_tl}, - } - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{center} - \end{spacing} - - \vspace*{\fill} - \centering - \zihao{3}\ziju{0.5}\songti{ - \tl_if_empty:NTF \l__bithesis_cover_date_tl { - \today - } { - \l__bithesis_cover_date_tl - } - } - \end{titlepage} - } - {4} { - \make_graduate_cover: - } - {5} { - \make_graduate_cover: - } - } - \group_end: - \end{blindPeerReview} - } -\NewDocumentCommand \MakeOriginality {} - { - \group_begin: - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \int_case:nn {\g__bithesis_thesis_type_int} - { - {1} - { - \pagestyle{BIThesis} - \pagenumbering{gobble} - - % 原创性声明部分 - \begin{center} - \vspace*{-2bp} - \__bithesis_same_page: - \chapter*{\heiti\zihao{2}\c__bithesis_bachelor_label_originality_tl} - \end{center}~\par - - % 本部分字号为小三。 - \zihao{-3} - \c__bithesis_bachelor_label_originality_clause_tl - - \vspace{17mm} - - \begin{flushright} - \c__bithesis_bachelor_label_originality_author_signature_tl\par - \end{flushright} - - \vspace{16mm} - - % 使用授权声明部分 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{2} - \c__bithesis_bachelor_label_authorization_tl - } - \end{center}~\par - - \c__bithesis_bachelor_label_authorization_clause_tl - - \vspace*{3mm} - - \begin{flushright} - \begin{spacing}{1.65} - \zihao{-3} - % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} - \c__bithesis_bachelor_label_originality_author_signature_tl\par - \c__bithesis_bachelor_label_originality_supervisor_signature_tl\par - \end{spacing} - \end{flushright} - - \newpage - } - {3} { - \setstretch{1.26} - % 原创性声明部分 - \begin{center} - \vspace*{-2bp} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{-2} - \c__bithesis_bachelor_english_label_originality_tl - } - \end{center}~\par - - % 本部分字号为小三 - \zihao{-4} - \c__bithesis_bachelor_english_label_originality_clause_tl - - \bigbreak - - Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~Date:\par - - \vspace{6mm} - - % 使用授权声明部分 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{-2} - \c__bithesis_bachelor_english_label_authorization_tl - } - \end{center}~\par - - \c__bithesis_bachelor_english_label_authorization_clause_tl - - \bigbreak - Student~(Signature):~ - \dunderline[-1pt]{1pt}{\makebox[18mm + 16bp]{}}~ - \hspace{2mm}Date:\par - Supervisor~(Signature):~ - \dunderline[-1pt]{1pt}{\makebox[18mm]{}}~ - \hspace{2mm}Date:\par - } - {4} {\__bithesis_graduate_originality:} - {5} {\__bithesis_graduate_originality:} - } - % 单独成页 - \clearpage - \end{blindPeerReview} - \group_end: - } -\NewDocumentCommand \MakePaperBack {} - { - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \make_paper_back: - \end{blindPeerReview} - } -\NewDocumentCommand \MakeTitle {} - { - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \__bithesis_make_chinese_title_page: - \__bithesis_make_english_title_page: - \end{blindPeerReview} - } -\DeclareDocumentCommand \MakeTOC {} - { - { - \__bithesis_if_bachelor_thesis:TF { - \renewcommand{\baselinestretch}{1.35} - } { - \renewcommand{\baselinestretch}{1.56} - } - - \__bithesis_if_thesis_english:TF { - \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_en_tl} - } { - \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_tl} - } - - % 自定义目录样式 - \cs_set:Npn \contentsname { - \fontsize{16pt}{\baselineskip} - \l__bithesis_unnumchapter_style_cs:n - \l__bithesis_title_font_cs:n - {\l__bithesis_toc_title_tl} - \vspace{-8pt} - } - - % 制作目录 - \tableofcontents - - % 在本科生全英文模板中,添加「目录」本身到目录中。 - \__bithesis_if_thesis_int_type:nT {3} { - \addcontentsline{toc}{chapter}{\c__bithesis_label_toc_en_tl} - } - - % 单独成页 - \clearpage - } - } -\NewDocumentEnvironment {abstract} {} - { - - \cleardoublepage - \setstretch{1.53} - - \__bithesis_if_bachelor_thesis:T { - \begin{center} - \vspace*{-17bp} - \heiti\zihao{-2}\textbf{ - \int_case:nn {\g__bithesis_thesis_type_int} - { - {1} {\l__bithesis_value_title_tl} - {2} {\l__bithesis_value_trans_title_tl} - {3} {\l__bithesis_value_title_tl} - } - } - \end{center} - - \vspace*{2mm} - } - - \ctexset{ - chapter/numbering = false, - } - - \__bithesis_if_bachelor_thesis:T { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - \ctexset{ - chapter/titleformat = {\heiti} - } - } - { - \ctexset{ - chapter/titleformat = {\textmd} - } - } - } - - { - \__bithesis_same_page: - \bool_if:NTF \l__bithesis_add_abstract_to_toc_bool { - \chapter{\c__bithesis_label_abstract_tl} - } { - \chapter*{\c__bithesis_label_abstract_tl} - \currentpdfbookmark{\c__bithesis_label_abstract_tl}{ch:abstract} - } - } - \vspace*{1mm} - \par - } - { - \par - \vspace{4ex} - \noindent - \__bithesis_if_graduate:TF { - % 研究生模板中,“关键词”宋体小四加粗 - % 关键词为宋体小四号字。 - \textbf{\c__bithesis_label_keywords_tl}\l__bithesis_value_keywords_tl\par - } { - % 本科生模板中,关键词为黑体加粗 - \textbf{\heiti \c__bithesis_label_keywords_tl \l__bithesis_value_keywords_tl}\par - } - \newpage - } -\NewDocumentEnvironment {abstractEn} {} - { - \setstretch{1.53} - - \__bithesis_if_bachelor_thesis:T { - \begin{spacing}{0.95} - \centering - \vspace*{-2bp} - - \__bithesis_if_thesis_int_type:nTF {3} { - \arialfamily\zihao{-2}\textbf - \l__bithesis_value_title_en_tl\\ - } { - \heiti\zihao{3}\textbf - \l__bithesis_value_title_en_tl\\ - } - \end{spacing} - \vspace*{10mm} - } - - \ctexset{ - chapter/numbering = false, - } - - \__bithesis_if_bachelor_thesis:TF { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - \ctexset{ - chapter = { - titleformat = {\heiti\zihao{3}\centering\textbf}, - } - } - } { - \ctexset{ - chapter = { - titleformat = {\heiti\zihao{-3}\centering\textmd}, - } - } - } - } { - \ctexset { - chapter/titleformat = {\heiti\zihao{3}\centering\textbf} - } - } - - { - \__bithesis_same_page: - \bool_if:nTF {\l__bithesis_add_abstract_en_to_toc_bool} { - \chapter{\c__bithesis_label_abstract_en_tl} - } { - \chapter*{\c__bithesis_label_abstract_en_tl} - \currentpdfbookmark{\c__bithesis_label_abstract_en_tl}{ch:abstract:en} - } - } - } - { - \par\vspace{3ex}\noindent - \__bithesis_if_graduate:TF { - % Times New Roman小四号字,行距22磅 - % “Key Words” - % Times New Roman小四号字加粗 - \textbf{\c__bithesis_label_keywords_en_tl} \l__bithesis_value_keywords_en_tl - } { - \textbf{\c__bithesis_label_keywords_en_tl \l__bithesis_value_keywords_en_tl} - } - \newpage - } - -\NewDocumentEnvironment {conclusion} {} - { - \ctexset{ - section/number = \arabic{section} - } - - \__bithesis_if_thesis_english:TF { - \chapter{\c__bithesis_label_conclusion_en_tl} - } { - \chapter{\c__bithesis_label_conclusion_tl} - } - } - {} -\NewDocumentEnvironment {bibprint} {} - { - % 设置参考文献字号为 5 号 - \renewcommand*{\bibfont}{\zihao{5}} - % 设置参考文献各个项目之间的垂直距离为 0 - \setlength{\bibitemsep}{0ex} - \setlength{\bibnamesep}{0ex} - \setlength{\bibinitsep}{0ex} - \__bithesis_if_graduate:TF { - } { - % 「本科生」设置单倍行距 - \renewcommand{\baselinestretch}{1.2} - } - % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 - \setlength{\biblabelsep}{1.7mm} - - \bool_if:NF \l__bithesis_style_bibliography_indent_bool { - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} - } - } - - \__bithesis_if_thesis_english:TF { - \chapter{\c__bithesis_label_reference_en_tl} - } { - \chapter{\c__bithesis_label_reference_tl} - } - } - {} -\NewDocumentEnvironment {appendices} {} - { - % Used in chapter, ToC. - \tl_new:N \l__bithesis_appendix_plain_label_tl - % Used before reference label. - \tl_new:N \l__bithesis_appendix_default_title_tl - - \__bithesis_if_thesis_english:TF { - \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_en_tl} - \tl_set:Nn \l__bithesis_appendix_default_title_tl {\c__bithesis_label_appendix_en_tl} - } { - \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_tl} - \tl_set:Nn \l__bithesis_appendix_default_title_tl {\c__bithesis_label_appendix_tl} - } - - \bool_if:NTF \l__bithesis_appendices_chapter_level_bool { - % 附录章节级别 - - % 仅设置 \setcounter{chapter}{0} 时,pdf 目录会索引到正文章节。 - % 因此,需要使用 \appendix 重置计数器,并将附录后面的 - % 几个章节视为特殊的附录页。 - \appendix - - \ctexset{ - chapter/numbering = true, - chapter/name = {}, - chapter/number = \l__bithesis_appendix_plain_label_tl\hspace{1ex}\Alph{chapter}, - section/number = \Alph{chapter}. \arabic{section}, - subsection/number = \Alph{chapter}. \arabic{section}. \arabic{subsection}, - } - - \cs_set:Npn \thechapter { - \Alph{chapter} - } - } { - % 附录节(section)级别 - - % 因为不需要用到 chapter counter, 所以直接加一即可。 - \stepcounter{chapter} - \setcounter{section}{0} - % (与上面方法至少用一个) - % 需要让 section 在 pdf bookmark 中输出字母而不是数字。 - % 详见 hyperref 代码。 - \gdef\theHsection{\Alph{section}} - - % 定义 \thefigure 采用节而不是章 -\cs_set:Npn \thefigure {\theHsection \g__bithesis_label_divide_char_tl\arabic{figure}} - - \ctexset{ - section/number = \l__bithesis_appendix_plain_label_tl\hspace{1ex}\Alph{section}, - subsection/number = \Alph{section}. \arabic{subsection}, - } - - \cs_gset:Npn \thechapter { - \Alph{section} - } - % \gdef \thechapter{\Alph{section}} - - \tl_if_blank:VTF \l__bithesis_appendices_title_tl { - \chapter{\l__bithesis_appendix_default_title_tl} - } { - \chapter*{\l__bithesis_appendices_title_tl} - \stepcounter{chapter} - \tl_if_blank:VTF \l__bithesis_appendix_toc_title_tl { - \addcontentsline{toc}{chapter}{\l__bithesis_appendix_default_title_tl} - } { - \addcontentsline{toc}{chapter}{\l__bithesis_appendix_toc_title_tl} - } - } - } - } - { - } -\NewDocumentEnvironment {acknowledgements} {+b} - { - \begin{blindPeerReview} - % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。 - % 不知为何,需要手动重置 section 计数器。 - \setcounter{section}{0} - \ctexset{ - appendix/numbering = false, - section/number = \arabic{section}, - subsection/number = \arabic{section}. \arabic{subsection}, - subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection}, - } - - \__bithesis_if_thesis_english:TF { - \chapter{\c__bithesis_label_ack_en_tl} - } { - \chapter{\c__bithesis_label_ack_tl} - } - \__bithesis_if_graduate:TF {\fangsong}{} - #1 - \end{blindPeerReview} - } {} -\NewDocumentCommand \Author {O{1} o o} - { - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式 - \IfValueTF {#3} { - #3 - } { - 第\zhnumber{#1}作者 - } - } { - % 普通模式 - \IfValueTF {#2} { - % 覆盖默认的 \author 命令 - #2 - } { - % 默认采用作者姓名 - \l__bithesis_value_author_tl - } - } - } - -\NewDocumentCommand \AuthorEn {O{1} o o} - { - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式 - \IfValueTF {#3} { - #3 - } { - \Ordinalstringnum{#1}~Author - } - } { - % 普通模式 - \IfValueTF {#2} { - % 覆盖默认的 \author 命令 - #2 - } { - % 默认采用作者姓名 - \l__bithesis_value_author_en_tl - } - } - } -\NewDocumentCommand \addpub {m} { - \nocite{#1} - \addtocategory{mypub}{#1} -} - -\NewDocumentCommand \addpubs {m} { - % apply a clist - \clist_map_function:nN {#1} \addpub -} -\NewDocumentCommand \pubsection {m} { - { - % 自增计数器 - \par\stepcounter{pub} - % 设置小标题,暂时没有考虑英文模式 - \noindent - \textbf{ - \heiti{ - \zhnumber{\thepub}、#1 - } - }\par - } -} -\NewDocumentEnvironment {publications} {+b} - { - % 同时设置 omit 以及 blindPeerReview 才能跳过此章节生成。 - \begin{blindPeerReview}[\l__bithesis_publications_omit_bool] - % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。 - % 不知为何,需要手动重置 section 计数器。 - \setcounter{section}{0} - \ctexset{ - appendix/numbering = false, - section/number = \arabic{section}, - subsection/number = \arabic{section}. \arabic{subsection}, - subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection}, - } - % 设置参考文献字号为 5 号 - \renewcommand*{\bibfont}{\zihao{5}} - % 设置参考文献各个项目之间的垂直距离为 0 - \setlength{\bibitemsep}{0ex} - \setlength{\bibnamesep}{0ex} - \setlength{\bibinitsep}{0ex} - % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 - \setlength{\biblabelsep}{1.7mm} - - \bool_if:NF \l__bithesis_style_bibliography_indent_bool { - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} - } - } - - % If in blindPeerReview mode, omit delimiters in author field. - \bool_if:NT \g__bithesis_blind_mode_bool { - % 如果有多个作者,不修改此项的话,作者与标题之间会有逗号。 - \DeclareDelimFormat[bib,biblist]{finalnamedelim}{} - % 如果自己不是第一个作者,不修改此项的话,会在最开始有逗号。 - \DeclareDelimFormat{multinamedelim}{} - % 如果覆盖的是英文作者,不修改此项的话,会在最开始有空格。 - \DeclareDelimFormat{bibnamedelimd}{} - } - - % ===== 上方定义与「参考文献」部分相同 - - % 中文姓名下,此部分不参与输出。 - \cs_set:Npn \mkbibnamegiven ##1 { - \haspartannotation{myself}{ - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式,不输出内容 - } { - % 普通模式 - \textbf{##1} - } - }{ - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式,不输出内容 - } { - % 普通模式 - ##1 - } - } - } - - \cs_set:Npn \mkbibnamefamily ##1 { - \haspartannotation{myself}{ - % 作者为自己 - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式 - \getpartannotation{myself} - } { - % 普通模式 - \textbf{##1} - } - }{ - % 作者不是自己 - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式,不输出 - } { - % 普通模式 - ##1 - } - } - } - - \if_cs_exist:N \c@pub { - % 重置计数器 - \setcounter{pub}{0} - } \else: { - % 设置计数器 - \newcounter{pub} - } \fi: - - % 设置参考文献的排序 - \bool_if:NTF \l__bithesis_publications_sorting_bool { - % Sorting by year, name, type. - \newrefcontext[sorting=ynt] - } { - % Do not sort. - \newrefcontext - } - - % 根据 maxbibnames 的设置,覆盖 \blx@maxbibnames 选项,保证所有作者都能显示。 - \cs_set:Npn \blx@maxbibnames { - \l__bithesis_publications_maxbibnames_int - } - - % 根据 minbibnames 的设置,覆盖 \blx@minbibnames 选项,保证所有作者都能显示。 - \cs_set:Npn \blx@minbibnames { - \l__bithesis_publications_minbibnames_int - } - - \chapter{\__bithesis_get_const:N {publications}} - #1 - \end{blindPeerReview} - } - {} -\NewDocumentEnvironment {resume} {+b} - { - \begin{blindPeerReview} - % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。 - % 不知为何,需要手动重置 section 计数器。 - \setcounter{section}{0} - \ctexset{ - appendix/numbering = false, - section/number = \arabic{section}, - subsection/number = \arabic{section}. \arabic{subsection}, - subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection}, - } - \chapter{\__bithesis_get_const:N{resume}} - #1 - \end{blindPeerReview} - } - { - } - -\NewDocumentEnvironment {symbols} {} - { - \bool_if:NTF \l__bithesis_add_symbols_to_toc_bool { - \chapter{\__bithesis_get_const:N {symbols}} - } { - \chapter*{\__bithesis_get_const:N {symbols}} - \currentpdfbookmark{\c__bithesis_label_symbols_tl}{ch:symbols} - } - \zihao{-4} - \begin{itemize}[ - labelwidth=2.5cm, - labelsep=0.5cm, - leftmargin=3cm, - itemindent=0cm, - % 不再在两项之间增加额外的间距(1.5 倍的行间距已经够宽了)(未来可以提供一个接口以供用户手动设置间距) - itemsep=-0.5ex, - ] - \cs_set:Npn \makelabel ##1 {##1\hfil} - } - { - \end{itemize} - - % 单独一页 - \clearpage - } -\endinput -%% -%% End of file `bithesis.cls'. diff --git a/templates/undergraduate-thesis/bithesis.cls b/templates/undergraduate-thesis/bithesis.cls deleted file mode 100644 index 7a6104a8..00000000 --- a/templates/undergraduate-thesis/bithesis.cls +++ /dev/null @@ -1,2333 +0,0 @@ -%% -%% This is file `bithesis.cls', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% bithesis.dtx (with options: `cls,thesis') -%% -%% Copyright (C) 2023 -%% Association of Bit Network Pioneer and any individual authors listed in the documentation. -%% ------------------------------------------------------------------------------ -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.3c of this license or (at your option) any later -%% version. This version of this license is in -%% http://www.latex-project.org/lppl/lppl-1-3c.txt -%% and the latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of -%% LaTeX version 2020/11/27 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Feng Kaiyu. -%% ------------------------------------------------------------------------------ -%% -\RequirePackage{expl3,l3keys2e} -\ProvidesExplClass{bithesis} -{2023-05-01}{3.5.4}{BIT Thesis Templates} -\int_new:N \g__bithesis_thesis_type_int -\int_new:N \g__bithesis_head_zihao_int -\bool_new:N \g__bithesis_twoside_bool -\bool_new:N \g__bithesis_thesis_type_english_bool -\bool_new:N \g__bithesis_blind_mode_bool -\bool_new:N \g__bithesis_quirks_mode_bool -\tl_new:N \g__bithesis_label_divide_char_tl -\seq_new:N \l__bithesis_right_seq -\seq_new:N \l__bithesis_left_seq -\cs_new:Npn \__bithesis_hide:n #1 { - \g__bithesis_const_substitute_symbol_tl -} - -\cs_new:Npn \__bithesis_secret_info:nn #1 #2 { - \bool_if:nTF \g__bithesis_blind_mode_bool { - #2 - } { - #1 - } -} - -\cs_new:Npn \__bithesis_secret_info:N #1 { - \__bithesis_secret_info:nn {#1} {\tl_map_function:NN #1 \__bithesis_hide:n } -} -\cs_new:Npn \__bithesis_secret_info:n #1 { - \__bithesis_secret_info:nn {#1} {\tl_map_function:NN {#1} \__bithesis_hide:n } -} - -\cs_generate_variant:Nn \__bithesis_secret_info:n {x} - -\cs_new:Npn \__bithesis_get_const:N #1 { - \__bithesis_if_thesis_english:TF { - \use:c {c__bithesis_label_ #1 _en_tl} - } { - \use:c {c__bithesis_label_ #1 _tl} - } -} -\cs_new:Npn \__bithesis_set_english_mode: { - \bool_gset_true:N \g__bithesis_thesis_type_english_bool -} -\cs_generate_variant:Nn \tl_if_empty:nTF {x} -\cs_generate_variant:Nn \seq_set_split:Nnn {Nnx} -\cs_new:Npn \__bithesis_same_page: { - \let\clearpage\relax - \let\cleardoublepage\relax -} -\cs_new:Npn \__bithesis_if_graduate:TF #1#2 { - \int_compare:nNnTF {3} < {\g__bithesis_thesis_type_int} - {#1} - {#2} - } - -\cs_new:Npn \__bithesis_if_thesis_int_type:nTF #1#2#3 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {#1} {#2} {#3}} -\cs_new:Npn \__bithesis_if_thesis_int_type:nT #1#2 {\__bithesis_if_thesis_int_type:nTF {#1} {#2} {}} - -\cs_new:Npn \__bithesis_if_thesis_english:TF #1#2 {\bool_if:nTF {\g__bithesis_thesis_type_english_bool} {#1} {#2}} -\cs_new:Npn \__bithesis_if_thesis_english:T #1 {\__bithesis_if_thesis_english:TF {#1}{}} -\cs_new:Npn \__bithesis_if_bachelor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} < {4} {#1} {#2}} -\cs_new:Npn \__bithesis_if_bachelor_thesis:T #1 {\__bithesis_if_bachelor_thesis:TF {#1} {}} -\cs_new:Npn \__bithesis_if_master_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {4} {#1} {#2}} -\cs_new:Npn \__bithesis_if_doctor_thesis:TF #1#2 {\int_compare:nNnTF {\g__bithesis_thesis_type_int} = {5} {#1} {#2}} -\clist_const:Nn \c__bithesis_thesis_type_clist - { bachelor, bachelor_translation, bachelor_english, master, doctor} -\clist_const:Nn \c__bithesis_publication_modes_clist - { biblatex, custom } -\cs_new_protected:Npn \__bithesis_define_label:nn #1#2 - { \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} } - -\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnn #1#2#3 - { - \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} - } - -\cs_new_protected:Npn \__bithesis_define_label:nnn #1#2#3 - { - \tl_const:cn { c__bithesis_label_ #1 _tl } {#2} - \tl_const:cn { c__bithesis_label_ #1 _en_tl } {#3} - } - -\cs_new_protected:Npn \__bithesis_define_label_by_thesis_type:nnnn #1#2#3#4 - { - \tl_const:cn { c__bithesis_ #1 _label_ #2 _tl } {#3} - \tl_const:cn { c__bithesis_ #1 _label_ #2 _en_tl } {#4} - } -\cs_new:Npn \smallgap: { - \hspace{0.45ex} -} -\cs_new:Npn \label_space: { - \__bithesis_if_bachelor_thesis:T { - \quad - } -} -\clist_map_inline:nn - { - {code} {代码}, - {udc} {UDC分类号:}, - {classification} {中图分类号:}, - {classified_level} {密级}, - {type} {种类}, - } - {\__bithesis_define_label:nn #1} -\clist_map_inline:nn - { - {originality} {原创性声明}, - {originality_clause} {本人郑重声明:所呈交的毕业设计(论文), - 是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外, - 本文不包含任何其他个人或集体已经发表或撰写过的研究成果。 - 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par~特此申明。}, - {authorization} {关于使用授权的声明}, - {authorization_clause} {本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定, - 其中包括:\circled{1}~学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件; - \circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文); - \circled{3}~学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}~学校可以学术交流为目的, - 复制赠送和交换本毕业设计(论文);\circled{5}~学校可以公布本毕业设计(论文)的全部或部分内容。}, - {originality_author_signature} - {本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, - {originality_supervisor_signature} - {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, - } {\__bithesis_define_label_by_thesis_type:nnn {bachelor} #1} -\clist_map_inline:nn - { - {originality} {原创性声明~Statement~of~Originality}, - {originality_clause} { - 本人郑重声明:所呈交的毕业设计(论文), - 是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外, - 本文不包含任何其他个人或集体已经发表或撰写过的研究成果。 - 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。特此申明。\par - \arialfamily I,\dunderline[-1pt]{1pt}{\makebox[18mm]{}},~solemnly~ - declare:~the~submitted~graduation~design~(thesis),~ - is~the~research~achievement~completed~independently~by~myself~ - under~the~guidance~of~the~supervisor.~This~article~does~not~contain~ - any~research~published~or~written~by~any~other~individual~or~group,~ - except~as~already~referenced~in~this~paper.~Individuals~and~groups~ - that~have~made~important~contributions~to~the~study~of~this~paper~ - are~clearly~indicated~and~cited~in~the~paper.\par - }, - {authorization} {关于使用授权的声明~State~of~Use~Authorization}, - {authorization_clause} { - 本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定, - 其中包括:\circled{1}学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件; - \circled{2}学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文); - \circled{3}学校可允许本毕业设计(论文)被查阅或借阅; - \circled{4}学校可以学术交流为目的,复制赠送和交换本毕业设计(论文); - \circled{5}学校可以公布本毕业设计(论文)的全部或部分内容。\par - I~fully~understand~the~regulations~on~the~storage,~ - use~of~graduation~design~(thesis)~in~Beijing~Institute~of~Technology.~ - Beijing~Institute~of~Technology~has~the~right~to~(1)~keep,~ - and~to~the~relevant~departments~to~send~the~original~or~copy~ - of~this~graduation~design~(thesis);~(2)~copy~and~preserve~this~ - graduation~design~(thesis)~by~photocopying,~miniature~or~other~ - means~of~reproduction;~(3)~allow~this~graduation~design~(thesis)~ - to~be~read~or~borrowed;~(4)~for~the~purpose~of~academic~exchange,~ - copy,~give~and~exchange~this~graduation~design~(thesis);~(5)~ - publish~all~or~part~of~the~contents~of~this~graduation~design~(thesis).~ - }, - } {\__bithesis_define_label_by_thesis_type:nnn {bachelor_english} #1} -\clist_map_inline:nn - { - {originality} {研究成果声明}, - {originality_clause} {本人郑重声明: - 所提交的学位论文是我本人在指导教师的指导下进行的研究工作获得的研究成果。 - 尽我所知,文中除特别标注和致谢的地方外, - 学位论文中不包含其他人已经发表或撰写过的研究成果, - 也不包含为获得北京理工大学或其它教育机构的学位或证书所使用过的材料。 - 与我一同工作的合作者对此研究工作所做的任何贡献均已在 - 学位论文中作了明确的说明并表示了谢意。\par~特此申明。}, - {authorization} {关于学位论文使用权的说明}, - {authorization_clause} {本人完全了解北京理工大学有关保管、使用学位论文的规定, - 其中包括:\circled{1}~学校有权保管、并向有关部门送交学位论文的原件与复印件; - \circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存学位论文; - \circled{3}~学校可允许学位论文被查阅或借阅;\circled{4}~ - 学校可以学术交流为目的,复制赠送和交换学位论文;\circled{5}~ - 学校可以公布学位论文的全部或部分内容(保密学位论文在解密后遵守此规定)。}, - {originality_author_signature} - {签\qquad 名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, - {originality_supervisor_signature} - {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, - } {\__bithesis_define_label_by_thesis_type:nnn {graduate} #1} -\clist_map_inline:nn - { - {author} {作\quad 者\quad 姓\quad 名} {Candidate~Name}, - {school} {学\quad 院\quad 名\quad 称} {School~or~Department}, - {supervisor} {指\quad 导\quad 教\quad 师} {Faculty~Mentor}, - {chairman} {答辩委员会主席} {Chair,~Thesis~Committee}, - {degree} - {申\smallgap: 请\smallgap: 学\smallgap: 位\smallgap: 级\smallgap: 别} - {Degree~Applied}, - {major} {学\quad 科\quad 专\quad 业} {Major}, - {institute} - {学\smallgap: 位\smallgap: 授\smallgap: 予\smallgap: 单\smallgap: 位} - {Degree~by}, - {defense_date} - {论\smallgap: 文\smallgap: 答\smallgap: 辩\smallgap: 日\smallgap: 期} - {The~Date~of~Defence}, - } {\__bithesis_define_label_by_thesis_type:nnnn {graduate} #1} -\clist_map_inline:nn - { - {school} {学\qquad 院} {School}, - {major} {专\qquad 业} {Degree}, - {class} {班\qquad{}级} {Class}, - {author} {学生姓名} {Author}, - {student_id} {学\qquad 号} {Student~ID}, - {supervisor} {指导教师} {Supervisor}, - {co_supervisor} {校外指导教师} {Co-Supervisor}, - {keywords} {关键词:} {Key~Words:~}, - {toc} {目\label_space: 录} {Table~of~Contents}, - {abstract} {摘\label_space: 要} {Abstract}, - {conclusion} {结\label_space: 论} {Conclusions}, - {appendix} {附\label_space: 录} {Appendices}, - {ack} {致\label_space: 谢} {Acknowledgement}, - {figure} {插\label_space: 图} {Illustrations}, - {table} {表\label_space: 格} {Tables}, - {appendix_prefix} {附录} {Appendix}, - {reference} {参考文献} {References}, - {university} {北京理工大学} {Beijing~Institute~of~Technology}, - {publications} {攻读学位期间发表论文与研究成果清单} - {Publications~During~Studies}, - % TODO: Not so sure about the translation. - {resume} {作者简介} {Author~Biography}, - {symbols} {主要符号对照表} {Nomenclature}, - {algo} {算法} {Algorithm}, - {them} {定理} {Theorem}, - {lem} {引理} {Lemma}, - {prop} {命题} {Proposition}, - {cor} {推论} {Corollary}, - {axi} {公理} {Axiom}, - {defn} {定义} {Definition}, - {conj} {猜想} {Conjecture}, - {exmp} {例} {Example}, - {case} {情形} {Case}, - {rem} {注} {Remark}, - {fig} {图} {Figure}, - {tab} {表} {Table}, - {equ} {式} {Equation}, - } - {\__bithesis_define_label:nnn #1} -\clist_const:Nn \c__bithesis_bachelor_thesis_header_clist - { - 北京理工大学本科生毕业设计(论文), - 北京理工大学本科生毕业设计(论文)外文翻译, - Beijing~Institute~of~Technology~Bachelor's~Thesis, - 北京理工大学硕士学位论文, - 北京理工大学博士学位论文, - } -\clist_const:Nn \c__bithesis_bachelor_thesis_headline_clist - { - 本科生毕业设计(论文), - 本科生毕业设计(论文)外文翻译, - Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis, - } -\keys_define:nn { bithesis } -{ - info .meta:nn = { bithesis / info } {#1}, - misc .meta:nn = { bithesis / misc } {#1}, - cover .meta:nn = { bithesis / cover } {#1}, - style .meta:nn = { bithesis / style } {#1}, - option .meta:nn = { bithesis / option } {#1}, - TOC .meta:nn = { bithesis / TOC } {#1}, - appendices .meta:nn = { bithesis / appendices } {#1}, - publications .meta:nn = { bithesis / publications } {#1}, - const .meta:nn = { bithesis / const } {#1}, -} -\keys_define:nn { bithesis / option } -{ - type .choice:, - type .value_required:n = true, - type .choices:Vn = - \c__bithesis_thesis_type_clist - { - \int_set_eq:NN \g__bithesis_thesis_type_int \l_keys_choice_int - \int_case:nn {\l_keys_choice_int} { - % 本科全英文也是英文模板。 - {3} {\__bithesis_set_english_mode:} - } - }, - type .initial:n = bachelor, - twoside .bool_gset:N = \g__bithesis_twoside_bool, - blindPeerReview .bool_gset:N = \g__bithesis_blind_mode_bool, - ctex .tl_set:N = \l__bithesis_options_to_ctex_tl, - quirks .bool_gset:N = \g__bithesis_quirks_mode_bool, - % xeCJK - autoFakeBold .tl_set:N = \g__bithesis_auto_fake_bold_tl, - autoFakeBold .initial:n = {3}, - % 是否开启英文模式。目前在设计上,这个选项仅对研究生模板生效。 - % 本科生模板的英文模式是根据 |type| 选项自动判断的。 - english .code:n = { \__bithesis_set_english_mode: } , -} -\keys_define:nn { bithesis / cover } - { - date .tl_set:N = \l__bithesis_cover_date_tl, - headerImage .tl_set:N = \l_bit_coverheaderimage_tl, - xiheiFont .tl_set:N = \l__bithesis_cover_xihei_font_path_tl, - xiheiFont .default:n = {STXihei}, - %% cover entry - dilimiter .tl_set:N = \l__bithesis_cover_dilimiter_tl, - labelAlign .tl_set:N = \l__bithesis_cover_label_align_tl, - labelAlign .initial:n = {r}, - valueAlign .tl_set:N = \l__bithesis_cover_value_align_tl, - valueAlign .initial:n = {c}, - labelMaxWidth .dim_set:N = \l__bithesis_cover_label_max_width_dim, - valueMaxWidth .dim_set:N = \l__bithesis_cover_value_max_width_dim, - autoWidthPadding .dim_set:N = \l__bithesis_cover_auto_width_padding_dim, - autoWidthPadding .initial:n = {0.25em}, - autoWidth .bool_set:N = \l__bithesis_cover_auto_width_bool, - autoWidth .initial:n = {true}, - underlineThickness .dim_set:N = \l__bithesis_cover_underline_thickness_dim, - underlineThickness .initial:n = {1pt}, - underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, - underlineOffset .initial:n = { -10pt }, - hideCoverInPeerReview .bool_set:N = \l__bithesis_style_hide_cover_in_peer_review_bool, - hideCoverInPeerReview .initial:n = {false}, - } -\keys_define:nn { bithesis / info } - { - title .tl_set:N = \l__bithesis_value_title_tl, - title .initial:n = {形状记忆聚氨酯的合成及其在织物中的应用(示例)}, - titleEn .tl_set:N = \l__bithesis_value_title_en_tl, - titleEn .initial:n = {Synthesis~and~Application~on~Texttiles~of~the~Shape~Memory~Polyurethane~(example)}, - % 因为是覆盖选项,所以不需要设置初始值。 - verticalTitle .tl_set:N = \l__bithesis_value_vertical_title_tl, - school .tl_set:N = \l__bithesis_value_school_tl, - major .tl_set:N = \l__bithesis_value_major_tl, - class .tl_set:N = \l__bithesis_value_class_tl, - author .tl_set:N = \l__bithesis_value_author_tl, - studentId .tl_set:N = \l__bithesis_value_student_id_tl, - supervisor .tl_set:N = \l__bithesis_value_supervisor_tl, - % 因为默认不显示,所以不需要设置初始值。 - externalSupervisor .tl_set:N = \l__bithesis_value_external_supervisor_tl, - keywords .tl_set:N = \l__bithesis_value_keywords_tl, - keywords .initial:n = {聚氨酯,形状记忆,织物(示例)}, - keywordsEn .tl_set:N = \l__bithesis_value_keywords_en_tl, - keywordsEn .initial:n = {Polyurethane,Shape Memory,Textiles (example)}, - translationTitle .tl_set:N = \l__bithesis_value_trans_title_tl, - translationOriginTitle .tl_set:N = \l__bithesis_value_trans_origin_title_tl, - % 中图分类号,研究生学位论文使用 - classification .tl_set:N = \l__bithesis_value_classification_tl, - classification .initial:n = {TQ~028.1(示例)}, - % UDC 分类号,研究生学位论文使用 - UDC .tl_set:N = \l__bithesis_value_udc_tl, - UDC .initial:n = {540(示例)}, - chairman .tl_set:N = \l__bithesis_value_chairman_tl, - degree .tl_set:N = \l__bithesis_value_degree_tl, - degreeEn .tl_set:N = \l__bithesis_value_degree_en_tl, - institute .tl_set:N = \l__bithesis_value_institute_tl, - institute .initial:n = {\tl_use:N \c__bithesis_label_university_tl}, - defenseDate .tl_set:N = \l__bithesis_value_defense_date_tl, - authorEn .tl_set:N = \l__bithesis_value_author_en_tl, - schoolEn .tl_set:N = \l__bithesis_value_school_en_tl, - supervisorEn .tl_set:N = \l__bithesis_value_supervisor_en_tl, - chairmanEn .tl_set:N = \l__bithesis_value_chairman_en_tl, - majorEn .tl_set:N = \l__bithesis_value_major_en_tl, - instituteEn .tl_set:N = \l__bithesis_value_institute_en_tl, - instituteEn .initial:n = {\c__bithesis_label_university_en_tl}, - defenseDateEn .tl_set:N = \l__bithesis_value_defense_date_en_tl, - defenseDateEn .initial:n = {June,~2019~(example)}, - % 因为默认不显示,所以不需要设置初始值。 - classifiedLevel .tl_set:N = \l__bithesis_value_classified_level_tl, - } -\keys_define:nn { bithesis / misc } - { - % 表格字体大小,默认为 5 号字体。 - tabularFontSize .tl_set:N = \l__bithesis_misc_tabular_font_size_tl, - tabularFontSize .initial:n = {5}, - arialFont .tl_set:N = \l__bithesis_misc_arial_font_path_tl, - autoref / algo .tl_set:N = \algoautorefname, - autoref / algo .initial:n = {\g__bithesis_const_autoref_algo_tl}, - autoref / them .tl_set:N = \themautorefname, - autoref / them .initial:n = {\g__bithesis_const_autoref_them_tl}, - autoref / lem .tl_set:N = \lemautorefname, - autoref / lem .initial:n = {\g__bithesis_const_autoref_lem_tl}, - autoref / prop .tl_set:N = \propautorefname, - autoref / prop .initial:n = {\g__bithesis_const_autoref_prop_tl}, - autoref / cor .tl_set:N = \corautorefname, - autoref / cor .initial:n = {\g__bithesis_const_autoref_cor_tl}, - autoref / axi .tl_set:N = \axiautorefname, - autoref / axi .initial:n = {\g__bithesis_const_autoref_axi_tl}, - autoref / defn .tl_set:N = \defnautorefname, - autoref / defn .initial:n = {\g__bithesis_const_autoref_defn_tl}, - autoref / conj .tl_set:N = \conjautorefname, - autoref / conj .initial:n = {\g__bithesis_const_autoref_conj_tl}, - autoref / exmp .tl_set:N = \exmpautorefname, - autoref / exmp .initial:n = {\g__bithesis_const_autoref_exmp_tl}, - autoref / case .tl_set:N = \caseautorefname, - autoref / case .initial:n = {\g__bithesis_const_autoref_case_tl}, - autoref / rem .tl_set:N = \remautorefname, - autoref / rem .initial:n = {\g__bithesis_const_autoref_rem_tl}, - hideLinks .bool_set:N = \l__bithesis_misc_hide_links_bool, - hideLinks .initial:n = {true}, - autoref / figure .tl_set:N = \figureautorefname, - autoref / figure .initial:n = {\g__bithesis_const_autoref_fig_tl}, - autoref / table .tl_set:N = \tableautorefname, - autoref / table .initial:n = {\g__bithesis_const_autoref_tab_tl}, - autoref / equ .tl_set:N = \equationautorefname, - autoref / equ .initial:n = {\g__bithesis_const_autoref_equ_tl}, - } -\keys_define:nn { bithesis / const } - { - autoref .meta:nn = { bithesis / const / autoref } { #1 }, - style .meta:nn = { bithesis / const / style } { #1 }, - info .meta:nn = { bithesis / const / info } { #1 }, - } -\keys_define:nn { bithesis / const / autoref } - { - algo .tl_set:N = \g__bithesis_const_autoref_algo_tl, - algo .initial:n = {\__bithesis_get_const:N {algo}}, - them .tl_set:N = \g__bithesis_const_autoref_them_tl, - them .initial:n = {\__bithesis_get_const:N {them}}, - lem .tl_set:N = \g__bithesis_const_autoref_lem_tl, - lem .initial:n = {\__bithesis_get_const:N {lem}}, - prop .tl_set:N = \g__bithesis_const_autoref_prop_tl, - prop .initial:n = {\__bithesis_get_const:N {prop}}, - cor .tl_set:N = \g__bithesis_const_autoref_cor_tl, - cor .initial:n = {\__bithesis_get_const:N {cor}}, - axi .tl_set:N = \g__bithesis_const_autoref_axi_tl, - axi .initial:n = {\__bithesis_get_const:N {axi}}, - defn .tl_set:N = \g__bithesis_const_autoref_defn_tl, - defn .initial:n = {\__bithesis_get_const:N {defn}}, - conj .tl_set:N = \g__bithesis_const_autoref_conj_tl, - conj .initial:n = {\__bithesis_get_const:N {conj}}, - exmp .tl_set:N = \g__bithesis_const_autoref_exmp_tl, - exmp .initial:n = {\__bithesis_get_const:N {exmp}}, - case .tl_set:N = \g__bithesis_const_autoref_case_tl, - case .initial:n = {\__bithesis_get_const:N {case}}, - rem .tl_set:N = \g__bithesis_const_autoref_rem_tl, - rem .initial:n = {\__bithesis_get_const:N {rem}}, - figure .tl_set:N = \g__bithesis_const_autoref_fig_tl, - figure .initial:n = {\__bithesis_get_const:N {fig}}, - table .tl_set:N = \g__bithesis_const_autoref_tab_tl, - table .initial:n = {\__bithesis_get_const:N {tab}}, - equ .tl_set:N = \g__bithesis_const_autoref_equ_tl, - equ .initial:n = {\__bithesis_get_const:N {equ}}, - } -\keys_define:nn { bithesis / const / style } - { - substituteSymbol .tl_set:N = \g__bithesis_const_substitute_symbol_tl, - substituteSymbol .initial:n = {*}, - } -\keys_define:nn { bithesis / const / info } - { - degree .tl_set:N = \g__bithesis_const_info_degree_tl, - degree .initial:n = { - \c__bithesis_graduate_label_degree_tl - }, - major .tl_set:N = \g__bithesis_const_info_major_tl, - major .initial:n = { - \__bithesis_if_graduate:TF { - \c__bithesis_graduate_label_major_tl - } { - \__bithesis_get_const:N {major} - } - }, - } -\keys_define:nn { bithesis / style } -{ - head .tl_set:N = \l__bithesis_style_head_tl, - head .initial:n = { - \clist_item:Nn \c__bithesis_bachelor_thesis_header_clist \g__bithesis_thesis_type_int - }, - headline .tl_set:N = \l__bithesis_style_headline_tl, - headline .initial:n = { - \clist_item:Nn \c__bithesis_bachelor_thesis_headline_clist \g__bithesis_thesis_type_int - }, - bibliographyIndent .bool_set:N = \l__bithesis_style_bibliography_indent_bool, - bibliographyIndent .initial:n = {true}, - pageVerticalAlign .choices:nn = {top, scattered} { - \tl_if_eq:NnTF \l_keys_choice_tl {top} - { \raggedbottom } - { \flushbottom } - }, - pageVerticalAlign .initial:n = {top}, - % 数学字体配置 - mathFont .choices:nn = { - asana, bonum, cm, concrete, dejavu, erewhon, euler, - fira, garamond, gfsneohellenic, kp, libertinus, lm, newcm, - pagella, schola, stix, stix2, termes, xcharter, xits, none, - } { \tl_set_eq:NN \l__bithesis_style_math_font_tl \l_keys_choice_tl }, - mathFont .initial:n = {cm}, - % Options that will be pass to `unicode-math` pkgs. - unicodeMathOptions .tl_set:N = \l__bithesis_unicode_math_options_tl, - % Windows 平台开启宋体伪粗体。 - windowsSimSunFakeBold .bool_set:N = \l__bithesis_style_windows_simsum_fake_bold, - windowsSimSunFakeBold .initial:n = {false}, - % 控制英文是否使用 hyphen 进行换行 - hyphen .bool_set:N = \l__bithesis_style_hyphen_bool, - hyphen .initial:n = {true}, -} -\keys_define:nn { bithesis / TOC } -{ - abstract .bool_set:N = \l__bithesis_add_abstract_to_toc_bool, - abstract .initial:n = {true}, - abstractEn .bool_set:N = \l__bithesis_add_abstract_en_to_toc_bool, - abstractEn .initial:n = {true}, - symbols .bool_set:N = \l__bithesis_add_symbols_to_toc_bool, - symbols .initial:n = {true}, -} -\keys_define:nn { bithesis / appendices } -{ - chapterLevel .bool_set:N = \l__bithesis_appendices_chapter_level_bool, - title .tl_set:N = \l__bithesis_appendices_title_tl, - TOCTitle .tl_set:N = \l__bithesis_appendix_toc_title_tl, -} -\keys_define:nn { bithesis / publications } -{ - % mode .choice:, - % mode .value_required:n = true, - % mode .choices:Vn = - % \c__bithesis_publication_modes_clist - % { - % \int_new:N \l__bithesis_publication_mode_int - % \int_set:Nn \l__bithesis_publication_mode_int \l_keys_choice_int - % }, - % mode .initial:n = biblatex, - sorting .bool_set:N = \l__bithesis_publications_sorting_bool, - sorting .initial:n = {true}, - omit .bool_set:N = \l__bithesis_publications_omit_bool, - omit .initial:n = {false}, - maxbibnames .int_set:N = \l__bithesis_publications_maxbibnames_int, - maxbibnames .initial:n = {3}, - minbibnames .int_set:N = \l__bithesis_publications_minbibnames_int, - minbibnames .initial:n = {1}, -} -\ProcessKeysOptions { bithesis / option } -\__bithesis_if_thesis_english:T { - \PassOptionsToClass{scheme=plain}{ctexbook} -} -\bool_if:NT \g__bithesis_blind_mode_bool { - \bool_set_false:N \g__bithesis_twoside_bool -} -\bool_if:NTF \g__bithesis_twoside_bool {} { - \PassOptionsToClass{oneside}{ctexbook} -} -\PassOptionsToClass{openany}{ctexbook} -\DeclareOption*{ - \PassOptionsToClass{\l__bithesis_options_to_ctex_tl}{ctexbook} -} -\PassOptionsToPackage{quiet,AutoFakeBold=\g__bithesis_auto_fake_bold_tl,AutoFakeSlant}{xeCJK} -\ProcessOptions\relax -\LoadClass[zihao=-4,]{ctexbook} -\RequirePackage{geometry} -\RequirePackage[table,xcdraw]{xcolor} -\RequirePackage{xeCJK} -\RequirePackage{titletoc} -\RequirePackage{setspace} -\RequirePackage{graphicx} -\RequirePackage{fancyhdr} -\RequirePackage{pdfpages} -\RequirePackage{setspace} -\RequirePackage{booktabs} -\RequirePackage{multirow} -\RequirePackage{tikz} -\RequirePackage{etoolbox} -\RequirePackage[bookmarksnumbered]{hyperref} -\RequirePackage[strut=off]{caption} -\RequirePackage{array} -\RequirePackage{amsmath} -\RequirePackage{amssymb} -\RequirePackage{pifont} -\RequirePackage{amsthm} -\RequirePackage{pdfpages} -\RequirePackage{listings} -\RequirePackage{enumitem} -\RequirePackage{fmtcount} -\pdfstringdefDisableCommands{% - \let\quad\empty -} -\__bithesis_if_graduate:TF { - \int_set:Nn \g__bithesis_head_zihao_int {5} - \geometry{ - a4paper, - left=2.7cm, - bottom=2.5cm + 7bp, - top=3.5cm + 7bp, - right=2.7cm, - % `headsep' is affected by `top' option. - headsep = 3.5cm + 7bp - 2.5cm - 15bp, - headheight = 15 bp, - % `footskip' is affected by `bottom' option. - footskip = 2.5cm + 7bp - 1.8cm, - } -} { - \int_set:Nn \g__bithesis_head_zihao_int {4} - \geometry{ - a4paper, - left=3cm, - bottom=2.6cm + 7bp, - top=3.5cm + 7bp, - right=2.6cm, - % `headsep' is affected by `top' option. - headsep = 3.5cm + 7bp - 2.4cm - 20bp, - headheight = 20 bp, - % `footskip' is affected by `bottom' option. - footskip = 2.6cm + 7bp - 2cm, - } -} -\__bithesis_if_bachelor_thesis:T { - \setlength{\intextsep}{1.80\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} -} -\setmainfont{Times~New~Roman} -\setromanfont{Times~New~Roman} -\cs_new:Npn \__bithesis_font_path: - { - \str_if_eq:NNTF { \l__bithesis_font_type_tl } { font } - { } - { Path = \l__bithesis_font_path_tl / , } - } -\cs_new:Npn \__bithesis_load_unicode_math_pkg: - { - \PassOptionsToPackage { \l__bithesis_unicode_math_options_tl } { unicode-math } - \RequirePackage { unicode-math } - } -\cs_new:Npn \__bithesis_define_math_font:nn #1#2 - { - \cs_new:cpn { __bithesis_load_math_font_ #1 : } - { - \__bithesis_load_unicode_math_pkg: - \setmathfont { #2 } - } - } -\clist_map_inline:nn - { - { asana } { Asana-Math.otf }, - { concrete } { Concrete-Math.otf }, - { erewhon } { Erewhon-Math.otf }, - { euler } { Euler-Math.otf }, - { fira } { FiraMath-Regular.otf }, - { garamond } { Garamond-Math.otf }, - { gfsneohellenic } { GFSNeohellenicMath.otf }, - { kp } { KpMath-Regular.otf }, - { libertinus } { LibertinusMath-Regular.otf }, - { lm } { latinmodern-math.otf }, - { newcm } { NewCMMath-Regular.otf }, - { stix } { STIXMath-Regular.otf }, - { stix2 } { STIXTwoMath-Regular.otf }, - { xcharter } { XCharter-Math.otf }, - { xits } { XITSMath-Regular.otf }, - { bonum } { texgyrebonum-math.otf }, - { dejavu } { texgyredejavu-math.otf }, - { pagella } { texgyrepagella-math.otf }, - { schola } { texgyreschola-math.otf }, - { termes } { texgyretermes-math.otf } - } - { \__bithesis_define_math_font:nn #1 } -\cs_new:Npn \__bithesis_load_math_font_cm: { } -\cs_new:Npn \__bithesis_load_math_font_none: { } -\cs_new:Npn \__bithesis_load_font: - { - \use:c { __bithesis_load_math_font_ \l__bithesis_style_math_font_tl : } - } -\ctex_at_end_preamble:n { - % 针对 Windows 字体采用 Fake Bold 宋体 - \bool_if:NT \l__bithesis_style_windows_simsum_fake_bold - { - \RequirePackage{ifplatform} - \ifwindows - \setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant] - \fi - } - - % 在导言区末尾加载数学字体。 - \__bithesis_load_font: - - % misc / hideLinks 选项 - \bool_if:NT \l__bithesis_misc_hide_links_bool - { - \hypersetup { hidelinks } - } - - \__bithesis_if_thesis_english:TF { - \__bithesis_if_thesis_int_type:nT {3} { - % 对于本科全英文专业模板 - % Font Arial is needed. - \newfontfamily\arialfamily{Arial} - } - - } { - % 对于其他的中文模板, - % 需要加载细黑体。 - \tl_if_blank:VTF \l__bithesis_cover_xihei_font_path_tl {} - { - \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant] - {\l__bithesis_cover_xihei_font_path_tl} - } - } - - % 对于本科全英文专业模板,需要自定义日期格式。 - \__bithesis_if_thesis_int_type:nT {3} { - \RequirePackage[en-US]{datetime2} - \RequirePackage{indentfirst} - \DTMlangsetup[en-US]{dayyearsep={\space}} - } - - % Define biblatex category if it was imported. - % 这部分是给研究生模板中的 - % 「攻读学位期间发表论文与研究成果清单」使用的。 - \cs_if_exist:NT \DeclareBibliographyCategory { - \DeclareBibliographyCategory{mypub} - } - - % Define biblatex strings if it was imported. - % 这部分是给研究生模板中的 - % gbpunctin = false 时使用的。 - \cs_if_exist:NT \DefineBibliographyStrings { - \DefineBibliographyStrings{english}{in={}} - \DefineBibliographyStrings{english}{incn={}} - } - - % 修改 biblatex 中「专利」(patent)部分的著录格式。 - % 主要根据北理工自定义的规范,参考 biblatex 和 - % biblatex-gb7714-2015 的实现修改而成。 - % - % 默认不开启,因为此修改可能会产生其他边界问题。 - \bool_if:NT \g__bithesis_quirks_mode_bool { - \cs_if_exist:NT \DeclareBibliographyDriver { - % - % 重设专利title的输出,将文献类型标识符输出出去 - % - \newbibmacro*{patenttitle}{%原输出来自biblatex.def文件 - \ifboolexpr{% - test{\iffieldundef{title}}% - and% - test{\iffieldundef{subtitle}}% - }% - {}% - {\printtext[title]{\bibtitlefont% - \printfield[titlecase]{title}% - \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 - {}{\setunit{\subtitlepunct}% - \printfield[titlecase]{subtitle}}% - \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}% - \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 - {\setunit{\subtitlepunct}\printfield{titleaddon}}% - % :地区 - \setunit{\subtitlepunct}\iflistundef{location} - {} - {\setunit*{\subtitlepunct}% - \printtext{%[parens] - \printlist[][-\value{listtotal}]{location}}}% - % ,专利号 - \setunit{\addcomma\addspace}\printfield{number}%写专利号 - \setunit{\addcomma\addspace} - \usebibmacro{newsdate}% - }% - }% - } - - % - % 重定义专利文献驱动 - % - \DeclareBibliographyDriver{patent}{%源来自standard.BBX - \usebibmacro{bibindex}% - \usebibmacro{begentry}% - \usebibmacro{author}% - \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 - \usebibmacro{patenttitle}%给出专利专用的标题输出 - \iftoggle{bbx:gbstrict}{}{% - \newunit% - \printlist{language}% - \newunit\newblock - \usebibmacro{byauthor} - }% - \newunit\newblock - \printfield{type}% - \setunit*{\addspace}% - \newunit\newblock - \usebibmacro{byholder}% - \newunit\newblock - \printfield{note}% - \newunit\newblock - \usebibmacro{doi+eprint+url}% - \newunit\newblock - \usebibmacro{addendum+pubstate}% - \setunit{\bibpagerefpunct}\newblock - \usebibmacro{pageref}% - \newunit\newblock - \iftoggle{bbx:related} - {\usebibmacro{related:init}% - \usebibmacro{related}} - {}% - \usebibmacro{annotation}\usebibmacro{finentry}} - } - } -} -\cs_new:Npn \xihei:n #1 { - \xeCJK_family_if_exist:nTF {xihei} { - \CJKfamily{xihei} #1 - }{ - \heiti #1 - } -} -\cs_new:Npn \l__bithesis_title_font_cs:n #1 { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - \arialfamily #1 - } { - \heiti #1 - } -} -\cs_new:Npn \l__bithesis_unnumchapter_style_cs:n #1 { - % 本科全英文、研究生学位论文需要加粗 - \int_compare:nNnTF {\g__bithesis_thesis_type_int} > {2} - { - \bfseries #1 - } { - \mdseries #1 - } -} -\cs_set:Npn \arabicHeiti #1 {#1} -\fancypagestyle{BIThesis}{ - \fancyhf{} - % 定义页眉、页码 - \fancyhead[C]{ - \zihao{\int_use:N \g__bithesis_head_zihao_int} - \ziju{0.08} - \songti{\tl_use:N \l__bithesis_style_head_tl} - } - \fancyfoot[C]{\songti\zihao{5} \thepage} - % 页眉分割线稍微粗一些 - \RenewDocumentCommand \headrulewidth {} {0.6pt} -} -\ctexset{chapter={ - number = {\arabicHeiti{ \arabic{chapter} }}, - format = { \l__bithesis_title_font_cs:n \bfseries \centering \zihao{3}}, - nameformat = {}, - titleformat = {}, - aftername = \hspace{9bp}, - pagestyle = BIThesis, - beforeskip = 8bp, - afterskip = 32bp, - fixskip = true, - lofskip = 0cm, - lotskip = 0cm, - } -} - -\ctexset{section={ - number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}}}, - format = {\l__bithesis_title_font_cs:n \raggedright \bfseries \zihao{4}}, - nameformat = {}, - titleformat = {}, - aftername = \hspace{8bp}, - beforeskip = 20bp plus 1ex minus .2ex, - afterskip = 18bp plus .2ex, - fixskip = true, - } -} - -\ctexset{subsection={ - number = { - \arabicHeiti{ - \thechapter.\hspace{1bp} - \arabic{section}.\hspace{1bp} - \arabic{subsection} - } - }, - format = {\l__bithesis_title_font_cs:n \bfseries \raggedright \zihao{-4}}, - nameformat = {}, - titleformat = {}, - aftername = \hspace{7bp}, - beforeskip = 17bp plus 1ex minus .2ex, - afterskip = 14bp plus .2ex, - fixskip = true, - } -} - -\ctexset{ - secnumdepth = 3, - subsubsection={ - numbering = true, - number = { - \arabicHeiti{ - \arabic{chapter}.\hspace{1bp} - \arabic{section}.\hspace{1bp} - \arabic{subsection}.\hspace{1bp} - \arabic{subsubsection} - } - }, - format={\l__bithesis_title_font_cs:n \raggedright \zihao{-4}}, - nameformat = {}, - titleformat = {}, - beforeskip=14bp plus 1ex minus .2ex, - afterskip=14bp plus .2ex, - fixskip=true, - } -} -\addtocontents{toc}{\protect\hypersetup{hidelinks}} - -\__bithesis_if_graduate:TF { - % 对于研究生模板,定义各章标题为宋体四号。 - \titlecontents{chapter}[0pt]{\songti \zihao{4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % section 标题为宋体小四号。缩进为两个字符宽度。 - \titlecontents{section}[2\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % subsection 标题为宋体小四号。缩进为四个字符宽度。 - \titlecontents{subsection}[4\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} -} { - % 对于其他,定义各章标题为宋体小四号。 - \titlecontents{chapter}[0pt]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % section 标题为宋体小四号。 - \titlecontents{section}[1\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} - % subsection 标题为宋体小四号。 - \titlecontents{subsection}[2\ccwd]{\songti \zihao{-4}} - {\thecontentslabel\hspace{\ccwd}}{} - {\hspace{.5em}\titlerule*{.}\contentspage} -} -\titlecontents{figure}[0pt]{\songti\zihao{-4}} - {\figurename~\thecontentslabel\quad}{\hspace*{-1.5cm}} - {\hspace{.5em}\titlerule*{.}\contentspage} -\titlecontents{table}[0pt]{\songti\zihao{-4}} - {\tablename~\thecontentslabel\quad}{\hspace*{-1.5cm}} - {\hspace{.5em}\titlerule*{.}\contentspage} -\RenewDocumentCommand \frontmatter {} { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - % 本科全英文专业论文,页码使用小罗马数字。 - \pagenumbering{roman} - } { - \pagenumbering{Roman} - } - % 这部分的章节标题不进行编号。 - \ctexset{ - chapter = { - numbering = false, - } - } - \setstretch{1.53} - \pagestyle{BIThesis} - - % 表格内容默认使用五号字。 - % - % 由于这种方式会影响所有的表格, - % 所以我们尽可能延迟这种影响。 - % - % 不过,在目前的代码实现中没有在封面 - % 之类的地方使用表格,所以目前即使放在 - % preamble 中也不会有影响。 - \AtBeginEnvironment{tabular}{\zihao{\l__bithesis_misc_tabular_font_size_tl}} - \AtBeginEnvironment{tabular*}{\zihao{\l__bithesis_misc_tabular_font_size_tl}} -} -\RenewDocumentCommand \mainmatter {} { - % 另起一个空页,以便于后续的章节标题编号。 - % \clearpage - \cleardoublepage - % 这部分的章节标题进行编号。 - \ctexset{ - chapter = { - numbering = true, - } - } - % 页码使用阿拉伯数字。 - \pagenumbering{arabic} - \pagestyle{BIThesis} - % 正文 22 磅的行距 - \setlength{\parskip}{0em} - \setstretch{1.53} - % 修复脚注出现跨页的问题 - \interfootnotelinepenalty=10000 -} -\RenewDocumentCommand \backmatter {} { - % 同样,所有的章节标题不进行编号。 - \setcounter{section}{0} - \setcounter{subsection}{0} - \setcounter{subsubsection}{0} - \ctexset{ - chapter = { - numbering = false, - beforeskip = 18bp, - format = { - \l__bithesis_title_font_cs:n \l__bithesis_unnumchapter_style_cs:n \centering \zihao{3} - }, - afterskip = 26bp, - } - } -} -\setlength{\abovecaptionskip}{11pt} -\__bithesis_if_bachelor_thesis:TF { - \__bithesis_if_thesis_english:TF { - \setlength{\belowcaptionskip}{9pt} - } { - % 为了满足 “前后一行空白的问题”,需要删除 Caption 下方的间距。 - % 详见 `caption` 宏包手册和 - % https://github.com/CTeX-org/forum/issues/86 - % - % 这里实际的 skip 在 15pt 左右,但是全部移除会导致当图片置于页面顶部时, - % 图片与上方的间距过小,因此这里只移除 5pt。 - % 当然,这样会导致文本间的图片的 Caption 下方的间距微微大于一行。 - \captionsetup{belowskip=-5pt} - } -} { - % 而研究生模板不存在这个问题。 - \setlength{\belowcaptionskip}{9pt} -} -\__bithesis_if_graduate:TF { - \tl_set:Nn \g__bithesis_label_divide_char_tl {.} -} { - \tl_set:Nn \g__bithesis_label_divide_char_tl {-} -} -\cs_set:Npn \thefigure {\thechapter\g__bithesis_label_divide_char_tl\arabic{figure}} -\captionsetup[figure]{font=small,labelsep=space} - -\cs_set:Npn \thetable {\thechapter\g__bithesis_label_divide_char_tl\arabic{table}} -\captionsetup[table]{font=small,labelsep=space} - -\cs_set:Npn \theequation {\thechapter\g__bithesis_label_divide_char_tl\arabic{equation}} - -\AtBeginDocument{ - \cs_gset:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}} - \cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl} -} -\captionsetup[lstlisting]{font=small,labelsep=space} -\bool_if:NF \l__bithesis_style_hyphen_bool { - \hbadness=10000 - \tolerance=1 - \emergencystretch=\maxdimen - \hyphenpenalty=10000 -} -\definecolor{codegreen}{rgb}{0,0.6,0} -\definecolor{codegray}{rgb}{0.5,0.5,0.5} -\definecolor{codepurple}{rgb}{0.58,0,0.82} -\definecolor{backcolour}{rgb}{0.95,0.95,0.92} -\lstdefinestyle{examplestyle}{ - backgroundcolor=\color{backcolour}, - commentstyle=\color{codegreen}, - keywordstyle=\color{magenta}, - numberstyle=\tiny\color{codegray}, - stringstyle=\color{codepurple}, - basicstyle=\ttfamily\footnotesize, - breakatwhitespace=false, - breaklines=true, - captionpos=b, - keepspaces=true, - numbers=left, - numbersep=5pt, - showspaces=false, - showstringspaces=false, - showtabs=false, - tabsize=2 -} -\lstset{style=examplestyle} -\cs_set:Npn \listfigurename {\__bithesis_get_const:N {figure}} -\cs_set:Npn \listtablename {\__bithesis_get_const:N {table}} -\theoremstyle{plain} - \newtheorem{algo}{\__bithesis_get_const:N {algo}}[chapter] - \newtheorem{them}{\__bithesis_get_const:N {them}}[chapter] - \newtheorem{lem}{\__bithesis_get_const:N {lem}}[chapter] - \newtheorem{prop}{\__bithesis_get_const:N {prop}}[chapter] - \newtheorem{cor}{\__bithesis_get_const:N {cor}}[chapter] - \newtheorem{axi}{\__bithesis_get_const:N {axi}}[chapter] -\theoremstyle{definition} - \newtheorem{defn}{\__bithesis_get_const:N {defn}}[chapter] - \newtheorem{conj}{\__bithesis_get_const:N {conj}}[chapter] - \newtheorem{exmp}{\__bithesis_get_const:N {exmp}}[chapter] - \newtheorem{case}{\__bithesis_get_const:N {case}} -\theoremstyle{remark} - \newtheorem{rem}{\__bithesis_get_const:N {rem}} - \renewcommand{\qedsymbol}{\ensuremath{\blacksquare}} -\cs_new:Npn \__bithesis_dunderline:nnn #1#2#3 { - {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}} -} -\cs_new:Npn \__bithesis_dunderline:nn #1#2 { - \__bithesis_dunderline:nnn {#1} {1pt} {#2} -} -\cs_new:Npn \__bithesis_dunderline:n #1 { - \__bithesis_dunderline:nnn {-10pt} {1pt} {#1} -} -\newcommand\dunderline[3][-1pt]{{% - \setbox0=\hbox{#3} - \ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}} -\cs_new:Npn \__bithesis_render_cover_entry:nn #1#2 { - \makebox[\l__bithesis_cover_label_max_width_dim][\l__bithesis_cover_label_align_tl]{ - \tl_if_blank:VTF #1 {} {#1\l__bithesis_cover_dilimiter_tl} - } - \hspace{1ex} - \__bithesis_dunderline:nnn{\l__bithesis_cover_underline_offset_dim} - {\l__bithesis_cover_underline_thickness_dim}{ - \makebox[\l__bithesis_cover_value_max_width_dim][\l__bithesis_cover_value_align_tl]{#2} - }\par -} -\cs_new:Npn \__bithesis_get_text_width:Nn #1#2 - { - \hbox_set:Nn \l_tmpa_box {#2} - \dim_set:Nn #1 { \box_wd:N \l_tmpa_box } - } -\cs_generate_variant:Nn \__bithesis_get_text_width:Nn { NV } -\cs_new:Npn \__bithesis_get_max_text_width:NN #1#2 - { - \group_begin: - \seq_set_eq:NN \l__bithesis_tmpa_seq #2 - \dim_zero_new:N \l__bithesis_tmpa_dim - \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_tmpa_seq } - { - \seq_pop_left:NN \l__bithesis_tmpa_seq \l__bithesis_tmpa_tl - \__bithesis_get_text_width:NV \l__bithesis_tmpa_dim \l__bithesis_tmpa_tl - % 在两边加上空白,避免文本太靠边。 - \dim_gset:Nn #1 { \dim_max:nn {#1} { \l__bithesis_tmpa_dim + \l__bithesis_cover_auto_width_padding_dim * 2} } - } - \group_end: - } -\cs_new:Npn \__bithesis_parse_entry #1 #2 { - \seq_set_split:Nnx \l__bithesis_tmp_right_seq {\\} {#2} - \seq_clear:N \l__bithesis_tmp_left_seq - \seq_map_inline:Nn \l__bithesis_tmp_right_seq { - \seq_put_right:Nn \l__bithesis_tmp_left_seq {} - } - \seq_put_left:Nn \l__bithesis_tmp_left_seq {#1} - \seq_pop_right:NN \l__bithesis_tmp_left_seq \g__bithesis_trashcan_tl -} -\cs_new:Npn \__bithesis_render_cover_entry:n #1 { - % 左边是标签,右边是值。 - % 形如: - % { {label_1} {value_1}, {label_2} {value 2} } - % 首先转换成 seq 类型。 - \seq_set_from_clist:NN \l__bithesis_input_seq #1 - \seq_map_inline:Nn \l__bithesis_input_seq { - % 然后对于每一对 label 和 value,首先查找 - % value 中是否含有 \\ 字符,如果有,则将其分割成多个 - % label - value 对。 - % 比如 {label_1} {value \\ 1} 会被转换成 - % { {label_1} {value}, {} {1} } - \__bithesis_parse_entry ##1 - % 然后将这些 label - value 对添加到 \l__bithesis_right_seq - % 或者 \l__bithesis_left_sql 中。 - % left 就是 label,right 就是 value。 - \seq_concat:NNN \l__bithesis_right_seq \l__bithesis_right_seq \l__bithesis_tmp_right_seq - \seq_concat:NNN \l__bithesis_left_seq \l__bithesis_left_seq \l__bithesis_tmp_left_seq - } - - % 如果用户选择自动计算最大宽度,则计算最大宽度。 - \bool_if:NT \l__bithesis_cover_auto_width_bool { - \__bithesis_get_max_text_width:NN \l__bithesis_cover_label_max_width_dim \l__bithesis_left_seq - \__bithesis_get_max_text_width:NN \l__bithesis_cover_value_max_width_dim \l__bithesis_right_seq - } - - % 最后,根据宽度渲染 label 和 value 对。 - \group_begin: - \bool_until_do:nn { \seq_if_empty_p:N \l__bithesis_left_seq } - { - \seq_pop_left:NN \l__bithesis_left_seq \l__bithesis_tmpa_tl - \seq_pop_left:NN \l__bithesis_right_seq \l__bithesis_tmpb_tl - \tl_if_empty:xTF \l__bithesis_tmpb_tl {} { - \__bithesis_render_cover_entry:nn {\l__bithesis_tmpa_tl} {\l__bithesis_tmpb_tl} - } - } - \group_end: -} -\cs_new:Npn \make_graduate_cover: { - \cleardoublepage - \begin{titlepage} - { - \heiti\zihao{5} - \tl_if_blank:VTF \l__bithesis_value_classified_level_tl {} { - \flushright - \c__bithesis_label_classified_level_tl:~ - \l__bithesis_value_classified_level_tl \par - } - } - \centering - \vspace*{65mm} - {\heiti\zihao{-2} \l__bithesis_value_title_tl} - \vskip 60mm - % 黑体 小三 - {\heiti \zihao{-3} \__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl}} - \vskip 10mm - % 黑体 小三 - {\heiti \zihao{-3} \l__bithesis_cover_date_tl} - \end{titlepage} -} -\cs_new:Npn \make_paper_back: { - \cleardoublepage - \begin{titlepage} - \vskip 5cm - \begin{center} - \setstretch{1.1} - \begin{minipage}[t][19.7cm]{2em} - \begin{center} - { - \heiti\zihao{3} - \tl_if_blank:VTF \l__bithesis_value_vertical_title_tl - {\l__bithesis_value_title_tl}{\l__bithesis_value_vertical_title_tl} - } - \vfill - {\heiti\zihao{3}\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl}} - \vfill - {\heiti\zihao{3}\c__bithesis_label_university_tl} - \end{center} - \end{minipage} - \end{center} - % \vskip 5cm - \end{titlepage} -} -\cs_new:Npn \__bithesis_make_chinese_title_page: { - \cleardoublepage - \begin{titlepage} - { - % 密级、分类号 - {\heiti \zihao{5} \noindent \c__bithesis_label_classification_tl} - \l__bithesis_value_classification_tl\\ - {\heiti \zihao{5} \c__bithesis_label_udc_tl} \l__bithesis_value_udc_tl - } - - \begin{center} - - \vskip \stretch{1} - - {\heiti\zihao{-2} \l__bithesis_value_title_tl} - - \vskip \stretch{1} - - \def\tabcolsep{1pt} - \def\arraystretch{1.5} - - { - \renewcommand{\baselinestretch}{2} - - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\qquad} - } - \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} - - % 如果不是自动计算宽度,且用户没有自定义宽度, - % 则尝试提供一个默认宽度。 - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {45mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {60mm} - } - } - - % 渲染信息。 - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_tl} {\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl}}, - {\c__bithesis_graduate_label_school_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_graduate_label_supervisor_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_tl}}, - {\c__bithesis_graduate_label_chairman_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_tl}}, - {\g__bithesis_const_info_degree_tl} {\l__bithesis_value_degree_tl}, - {\g__bithesis_const_info_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_graduate_label_institute_tl} {\l__bithesis_value_institute_tl}, - {\c__bithesis_graduate_label_defense_date_tl} {\l__bithesis_value_defense_date_tl}, - } - - \heiti\zihao{-3} - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - } - \end{center} - \vskip \stretch{0.5} - \end{titlepage} -} -\cs_new:Npn \__bithesis_make_english_title_page: { - \begin{titlepage} - \begin{center} - - \vspace*{10em} - - { - \zihao{-2} - \textbf{\l__bithesis_value_title_en_tl} - } - - \vskip \stretch{1} - - { - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:~} - } - - \tl_set:Nn \l__bithesis_cover_label_align_tl {l} - \tl_set:Nn \l__bithesis_cover_underline_offset_dim {-5pt} - - % 如果不是自动计算宽度,且用户没有自定义宽度, - % 则尝试提供一个默认宽度。 - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {55mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {85mm} - } - } - - % 渲染信息。 - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_author_en_tl}}, - {\c__bithesis_graduate_label_school_en_tl} {\l__bithesis_value_school_en_tl}, - {\c__bithesis_graduate_label_supervisor_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_en_tl}}, - {\c__bithesis_graduate_label_chairman_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_en_tl}}, - {\c__bithesis_graduate_label_degree_en_tl} {\l__bithesis_value_degree_en_tl}, - {\c__bithesis_graduate_label_major_en_tl} {\l__bithesis_value_major_en_tl}, - {\c__bithesis_graduate_label_institute_en_tl} {\l__bithesis_value_institute_en_tl}, - {\c__bithesis_graduate_label_defense_date_en_tl} {\l__bithesis_value_defense_date_en_tl}, - } - - \zihao{-3} - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - } - - \end{center} - - \vskip \stretch{0.5} - \end{titlepage} -} -\newcommand{\circled}[2][]{\tikz[baseline=(char.base)] - {\node[shape = circle, draw, inner~sep = 1pt] - (char) {\phantom{\ifblank{#1}{#2}{#1}}}; - \node at (char.center) {\makebox[0pt][c]{#2}};}} -\robustify{\circled} -\cs_new:Npn \__bithesis_graduate_originality: - { - % 取消页眉页脚。 - \ctexset { - chapter / pagestyle = plain, - } - - \begin{titlepage} - % 不计算页码。 - \pagenumbering{gobble} - - % 原创性声明部分 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{3} - \c__bithesis_graduate_label_originality_tl - } - \end{center} - - % 本部分字号为四号。 - \zihao{4} - \qquad\c__bithesis_graduate_label_originality_clause_tl - - \vspace{17mm} - - \begin{flushright} - \c__bithesis_graduate_label_originality_author_signature_tl\par - \end{flushright} - - \vspace{16mm} - - % 使用授权声明部分。 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{3} - \c__bithesis_graduate_label_authorization_tl - } - \end{center} - - \qquad\c__bithesis_graduate_label_authorization_clause_tl - - \vspace*{15mm} - - \begin{flushright} - \begin{spacing}{1.65} - \zihao{4} - % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} - \c__bithesis_graduate_label_originality_author_signature_tl\par - \c__bithesis_graduate_label_originality_supervisor_signature_tl\par - \end{spacing} - \end{flushright} - \end{titlepage} - \cleardoublepage - } -\DeclareDocumentCommand \BITSetup { m } - { \keys_set:nn { bithesis } { #1 }} -\DeclareDocumentCommand \BigStar { } - { \ding{72} } - \NewDocumentEnvironment {blindPeerReview} {O{\c_true_bool} +b} - { - \bool_if:nTF {\g__bithesis_blind_mode_bool && #1} {} { - #2 - } - } {} -\RenewDocumentCommand \cleardoublepage { } - { - \clearpage - \bool_if:NT \g__bithesis_twoside_bool - { - \int_if_odd:nF \c@page - { \hbox:n { } \thispagestyle { empty } \newpage } - } - } -\DeclareDocumentCommand \SecretInfo { m o } - { - \IfValueTF {#2} { - \__bithesis_secret_info:nn {#1} {#2} - } { - \__bithesis_secret_info:x {#1} - } - } -\DeclareDocumentCommand \MakeCover {} - { - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \group_begin: - - \int_case:nn {\g__bithesis_thesis_type_int} - { - {1} - { - \begin{titlepage} - \vspace*{16mm} - - \centering - - \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { - \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ - } - - \vspace*{-3mm} - - \zihao{-0}\textbf{\ziju{0.12}\songti{\l__bithesis_style_headline_tl}}\par - - \vspace{16mm} - - \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par - - \vspace{3mm} - - \begin{spacing}{1.2} - \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par - \end{spacing} - - \vspace{15mm} - - \begin{spacing}{1.8} - \begin{center} - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} - } - % if not auto width, try override width - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} - } - } - - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, - {\g__bithesis_const_info_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, - } - - \zihao{3} - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{center} - \end{spacing} - - \vspace*{\fill} - \centering - \zihao{3}\ziju{0.5}\songti{ - \tl_if_empty:NTF \l__bithesis_cover_date_tl { - \today - } { - \l__bithesis_cover_date_tl - } - } - \end{titlepage} - } - {2} - { - \begin{titlepage} - \centering - - \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { - \includegraphics[width=6.87cm]{\l_bit_coverheaderimage_tl}\\ - } - - \vspace{1.2mm} - - \zihao{2}\textbf{\songti{\l__bithesis_style_headline_tl}} - - \vspace{10mm} - - { - - \begin{spacing}{1.8} - - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {\textbf{:}} - \bool_set_false:N \l__bithesis_cover_auto_width_bool - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {115mm} - - \clist_set:Nn \l__bithesis_input_clist { - {\zihao{4}\textbf{外文原文题目}} {\l__bithesis_value_trans_origin_title_tl}, - {\zihao{4}\textbf{中文翻译题目}} {\l__bithesis_value_trans_title_tl}, - } - - \zihao{-3} - \centering - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{spacing} - - } - - \vspace{19mm} - - \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_tl}\par - - \vspace{3mm} - - \begin{spacing}{1.2} - \zihao{3}\selectfont{\textbf{\l__bithesis_value_title_en_tl}}\par - \end{spacing} - - \vspace{19mm} - - \begin{spacing}{1.8} - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} - } - - % 如果不是自动计算宽度,且用户没有自定义宽度, - % 则尝试提供一个默认宽度。 - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {35mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {78mm} - } - } - - \zihao{3} - - % 渲染信息。 - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, - } - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{spacing} - - \vspace*{\fill} - \end{titlepage} - } - {3} { - \begin{titlepage} - \vspace*{16mm} - - \centering - - \tl_if_blank:VTF \l_bit_coverheaderimage_tl {} { - \includegraphics[width=9.87cm]{\l_bit_coverheaderimage_tl}\\ - } - - \vspace*{-3mm} - - \zihao{1}\textbf{\ziju{0.12}\l__bithesis_style_headline_tl}\par - - \vspace{18mm} - - \zihao{2}\textbf{\xihei:n \l__bithesis_value_title_en_tl}\par - - \vspace{10mm} - - \begin{spacing}{1.8} - \begin{center} - \tl_if_empty:NT \l__bithesis_cover_dilimiter_tl { - \tl_set:Nn \l__bithesis_cover_dilimiter_tl {:} - } - - % if not auto width, try override width - \bool_if:NF \l__bithesis_cover_auto_width_bool { - \dim_compare:nNnT {\l__bithesis_cover_label_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_label_max_width_dim {20mm} - } - \dim_compare:nNnT {\l__bithesis_cover_value_max_width_dim} = {0pt} { - \dim_set:Nn \l__bithesis_cover_value_max_width_dim {105mm} - } - } - - \zihao{4} - - \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_label_school_en_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_label_major_en_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_author_en_tl} {\l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_en_tl} {\l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_en_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_en_tl} {\l__bithesis_value_external_supervisor_tl}, - } - - \__bithesis_render_cover_entry:n \l__bithesis_input_clist - - \end{center} - \end{spacing} - - \vspace*{\fill} - \centering - \zihao{3}\ziju{0.5}\songti{ - \tl_if_empty:NTF \l__bithesis_cover_date_tl { - \today - } { - \l__bithesis_cover_date_tl - } - } - \end{titlepage} - } - {4} { - \make_graduate_cover: - } - {5} { - \make_graduate_cover: - } - } - \group_end: - \end{blindPeerReview} - } -\NewDocumentCommand \MakeOriginality {} - { - \group_begin: - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \int_case:nn {\g__bithesis_thesis_type_int} - { - {1} - { - \pagestyle{BIThesis} - \pagenumbering{gobble} - - % 原创性声明部分 - \begin{center} - \vspace*{-2bp} - \__bithesis_same_page: - \chapter*{\heiti\zihao{2}\c__bithesis_bachelor_label_originality_tl} - \end{center}~\par - - % 本部分字号为小三。 - \zihao{-3} - \c__bithesis_bachelor_label_originality_clause_tl - - \vspace{17mm} - - \begin{flushright} - \c__bithesis_bachelor_label_originality_author_signature_tl\par - \end{flushright} - - \vspace{16mm} - - % 使用授权声明部分 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{2} - \c__bithesis_bachelor_label_authorization_tl - } - \end{center}~\par - - \c__bithesis_bachelor_label_authorization_clause_tl - - \vspace*{3mm} - - \begin{flushright} - \begin{spacing}{1.65} - \zihao{-3} - % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm} - \c__bithesis_bachelor_label_originality_author_signature_tl\par - \c__bithesis_bachelor_label_originality_supervisor_signature_tl\par - \end{spacing} - \end{flushright} - - \newpage - } - {3} { - \setstretch{1.26} - % 原创性声明部分 - \begin{center} - \vspace*{-2bp} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{-2} - \c__bithesis_bachelor_english_label_originality_tl - } - \end{center}~\par - - % 本部分字号为小三 - \zihao{-4} - \c__bithesis_bachelor_english_label_originality_clause_tl - - \bigbreak - - Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~Date:\par - - \vspace{6mm} - - % 使用授权声明部分 - \begin{center} - \__bithesis_same_page: - \chapter*{ - \heiti\zihao{-2} - \c__bithesis_bachelor_english_label_authorization_tl - } - \end{center}~\par - - \c__bithesis_bachelor_english_label_authorization_clause_tl - - \bigbreak - Student~(Signature):~ - \dunderline[-1pt]{1pt}{\makebox[18mm + 16bp]{}}~ - \hspace{2mm}Date:\par - Supervisor~(Signature):~ - \dunderline[-1pt]{1pt}{\makebox[18mm]{}}~ - \hspace{2mm}Date:\par - } - {4} {\__bithesis_graduate_originality:} - {5} {\__bithesis_graduate_originality:} - } - % 单独成页 - \clearpage - \end{blindPeerReview} - \group_end: - } -\NewDocumentCommand \MakePaperBack {} - { - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \make_paper_back: - \end{blindPeerReview} - } -\NewDocumentCommand \MakeTitle {} - { - \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] - \__bithesis_make_chinese_title_page: - \__bithesis_make_english_title_page: - \end{blindPeerReview} - } -\DeclareDocumentCommand \MakeTOC {} - { - { - \__bithesis_if_bachelor_thesis:TF { - \renewcommand{\baselinestretch}{1.35} - } { - \renewcommand{\baselinestretch}{1.56} - } - - \__bithesis_if_thesis_english:TF { - \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_en_tl} - } { - \tl_set:Nn \l__bithesis_toc_title_tl {\c__bithesis_label_toc_tl} - } - - % 自定义目录样式 - \cs_set:Npn \contentsname { - \fontsize{16pt}{\baselineskip} - \l__bithesis_unnumchapter_style_cs:n - \l__bithesis_title_font_cs:n - {\l__bithesis_toc_title_tl} - \vspace{-8pt} - } - - % 制作目录 - \tableofcontents - - % 在本科生全英文模板中,添加「目录」本身到目录中。 - \__bithesis_if_thesis_int_type:nT {3} { - \addcontentsline{toc}{chapter}{\c__bithesis_label_toc_en_tl} - } - - % 单独成页 - \clearpage - } - } -\NewDocumentEnvironment {abstract} {} - { - - \cleardoublepage - \setstretch{1.53} - - \__bithesis_if_bachelor_thesis:T { - \begin{center} - \vspace*{-17bp} - \heiti\zihao{-2}\textbf{ - \int_case:nn {\g__bithesis_thesis_type_int} - { - {1} {\l__bithesis_value_title_tl} - {2} {\l__bithesis_value_trans_title_tl} - {3} {\l__bithesis_value_title_tl} - } - } - \end{center} - - \vspace*{2mm} - } - - \ctexset{ - chapter/numbering = false, - } - - \__bithesis_if_bachelor_thesis:T { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - \ctexset{ - chapter/titleformat = {\heiti} - } - } - { - \ctexset{ - chapter/titleformat = {\textmd} - } - } - } - - { - \__bithesis_same_page: - \bool_if:NTF \l__bithesis_add_abstract_to_toc_bool { - \chapter{\c__bithesis_label_abstract_tl} - } { - \chapter*{\c__bithesis_label_abstract_tl} - \currentpdfbookmark{\c__bithesis_label_abstract_tl}{ch:abstract} - } - } - \vspace*{1mm} - \par - } - { - \par - \vspace{4ex} - \noindent - \__bithesis_if_graduate:TF { - % 研究生模板中,“关键词”宋体小四加粗 - % 关键词为宋体小四号字。 - \textbf{\c__bithesis_label_keywords_tl}\l__bithesis_value_keywords_tl\par - } { - % 本科生模板中,关键词为黑体加粗 - \textbf{\heiti \c__bithesis_label_keywords_tl \l__bithesis_value_keywords_tl}\par - } - \newpage - } -\NewDocumentEnvironment {abstractEn} {} - { - \setstretch{1.53} - - \__bithesis_if_bachelor_thesis:T { - \begin{spacing}{0.95} - \centering - \vspace*{-2bp} - - \__bithesis_if_thesis_int_type:nTF {3} { - \arialfamily\zihao{-2}\textbf - \l__bithesis_value_title_en_tl\\ - } { - \heiti\zihao{3}\textbf - \l__bithesis_value_title_en_tl\\ - } - \end{spacing} - \vspace*{10mm} - } - - \ctexset{ - chapter/numbering = false, - } - - \__bithesis_if_bachelor_thesis:TF { - \int_compare:nNnTF {\g__bithesis_thesis_type_int} = {3} - { - \ctexset{ - chapter = { - titleformat = {\heiti\zihao{3}\centering\textbf}, - } - } - } { - \ctexset{ - chapter = { - titleformat = {\heiti\zihao{-3}\centering\textmd}, - } - } - } - } { - \ctexset { - chapter/titleformat = {\heiti\zihao{3}\centering\textbf} - } - } - - { - \__bithesis_same_page: - \bool_if:nTF {\l__bithesis_add_abstract_en_to_toc_bool} { - \chapter{\c__bithesis_label_abstract_en_tl} - } { - \chapter*{\c__bithesis_label_abstract_en_tl} - \currentpdfbookmark{\c__bithesis_label_abstract_en_tl}{ch:abstract:en} - } - } - } - { - \par\vspace{3ex}\noindent - \__bithesis_if_graduate:TF { - % Times New Roman小四号字,行距22磅 - % “Key Words” - % Times New Roman小四号字加粗 - \textbf{\c__bithesis_label_keywords_en_tl} \l__bithesis_value_keywords_en_tl - } { - \textbf{\c__bithesis_label_keywords_en_tl \l__bithesis_value_keywords_en_tl} - } - \newpage - } - -\NewDocumentEnvironment {conclusion} {} - { - \ctexset{ - section/number = \arabic{section} - } - - \__bithesis_if_thesis_english:TF { - \chapter{\c__bithesis_label_conclusion_en_tl} - } { - \chapter{\c__bithesis_label_conclusion_tl} - } - } - {} -\NewDocumentEnvironment {bibprint} {} - { - % 设置参考文献字号为 5 号 - \renewcommand*{\bibfont}{\zihao{5}} - % 设置参考文献各个项目之间的垂直距离为 0 - \setlength{\bibitemsep}{0ex} - \setlength{\bibnamesep}{0ex} - \setlength{\bibinitsep}{0ex} - \__bithesis_if_graduate:TF { - } { - % 「本科生」设置单倍行距 - \renewcommand{\baselinestretch}{1.2} - } - % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 - \setlength{\biblabelsep}{1.7mm} - - \bool_if:NF \l__bithesis_style_bibliography_indent_bool { - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} - } - } - - \__bithesis_if_thesis_english:TF { - \chapter{\c__bithesis_label_reference_en_tl} - } { - \chapter{\c__bithesis_label_reference_tl} - } - } - {} -\NewDocumentEnvironment {appendices} {} - { - % Used in chapter, ToC. - \tl_new:N \l__bithesis_appendix_plain_label_tl - % Used before reference label. - \tl_new:N \l__bithesis_appendix_default_title_tl - - \__bithesis_if_thesis_english:TF { - \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_en_tl} - \tl_set:Nn \l__bithesis_appendix_default_title_tl {\c__bithesis_label_appendix_en_tl} - } { - \tl_set:Nn \l__bithesis_appendix_plain_label_tl {\c__bithesis_label_appendix_prefix_tl} - \tl_set:Nn \l__bithesis_appendix_default_title_tl {\c__bithesis_label_appendix_tl} - } - - \bool_if:NTF \l__bithesis_appendices_chapter_level_bool { - % 附录章节级别 - - % 仅设置 \setcounter{chapter}{0} 时,pdf 目录会索引到正文章节。 - % 因此,需要使用 \appendix 重置计数器,并将附录后面的 - % 几个章节视为特殊的附录页。 - \appendix - - \ctexset{ - chapter/numbering = true, - chapter/name = {}, - chapter/number = \l__bithesis_appendix_plain_label_tl\hspace{1ex}\Alph{chapter}, - section/number = \Alph{chapter}. \arabic{section}, - subsection/number = \Alph{chapter}. \arabic{section}. \arabic{subsection}, - } - - \cs_set:Npn \thechapter { - \Alph{chapter} - } - } { - % 附录节(section)级别 - - % 因为不需要用到 chapter counter, 所以直接加一即可。 - \stepcounter{chapter} - \setcounter{section}{0} - % (与上面方法至少用一个) - % 需要让 section 在 pdf bookmark 中输出字母而不是数字。 - % 详见 hyperref 代码。 - \gdef\theHsection{\Alph{section}} - - % 定义 \thefigure 采用节而不是章 -\cs_set:Npn \thefigure {\theHsection \g__bithesis_label_divide_char_tl\arabic{figure}} - - \ctexset{ - section/number = \l__bithesis_appendix_plain_label_tl\hspace{1ex}\Alph{section}, - subsection/number = \Alph{section}. \arabic{subsection}, - } - - \cs_gset:Npn \thechapter { - \Alph{section} - } - % \gdef \thechapter{\Alph{section}} - - \tl_if_blank:VTF \l__bithesis_appendices_title_tl { - \chapter{\l__bithesis_appendix_default_title_tl} - } { - \chapter*{\l__bithesis_appendices_title_tl} - \stepcounter{chapter} - \tl_if_blank:VTF \l__bithesis_appendix_toc_title_tl { - \addcontentsline{toc}{chapter}{\l__bithesis_appendix_default_title_tl} - } { - \addcontentsline{toc}{chapter}{\l__bithesis_appendix_toc_title_tl} - } - } - } - } - { - } -\NewDocumentEnvironment {acknowledgements} {+b} - { - \begin{blindPeerReview} - % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。 - % 不知为何,需要手动重置 section 计数器。 - \setcounter{section}{0} - \ctexset{ - appendix/numbering = false, - section/number = \arabic{section}, - subsection/number = \arabic{section}. \arabic{subsection}, - subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection}, - } - - \__bithesis_if_thesis_english:TF { - \chapter{\c__bithesis_label_ack_en_tl} - } { - \chapter{\c__bithesis_label_ack_tl} - } - \__bithesis_if_graduate:TF {\fangsong}{} - #1 - \end{blindPeerReview} - } {} -\NewDocumentCommand \Author {O{1} o o} - { - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式 - \IfValueTF {#3} { - #3 - } { - 第\zhnumber{#1}作者 - } - } { - % 普通模式 - \IfValueTF {#2} { - % 覆盖默认的 \author 命令 - #2 - } { - % 默认采用作者姓名 - \l__bithesis_value_author_tl - } - } - } - -\NewDocumentCommand \AuthorEn {O{1} o o} - { - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式 - \IfValueTF {#3} { - #3 - } { - \Ordinalstringnum{#1}~Author - } - } { - % 普通模式 - \IfValueTF {#2} { - % 覆盖默认的 \author 命令 - #2 - } { - % 默认采用作者姓名 - \l__bithesis_value_author_en_tl - } - } - } -\NewDocumentCommand \addpub {m} { - \nocite{#1} - \addtocategory{mypub}{#1} -} - -\NewDocumentCommand \addpubs {m} { - % apply a clist - \clist_map_function:nN {#1} \addpub -} -\NewDocumentCommand \pubsection {m} { - { - % 自增计数器 - \par\stepcounter{pub} - % 设置小标题,暂时没有考虑英文模式 - \noindent - \textbf{ - \heiti{ - \zhnumber{\thepub}、#1 - } - }\par - } -} -\NewDocumentEnvironment {publications} {+b} - { - % 同时设置 omit 以及 blindPeerReview 才能跳过此章节生成。 - \begin{blindPeerReview}[\l__bithesis_publications_omit_bool] - % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。 - % 不知为何,需要手动重置 section 计数器。 - \setcounter{section}{0} - \ctexset{ - appendix/numbering = false, - section/number = \arabic{section}, - subsection/number = \arabic{section}. \arabic{subsection}, - subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection}, - } - % 设置参考文献字号为 5 号 - \renewcommand*{\bibfont}{\zihao{5}} - % 设置参考文献各个项目之间的垂直距离为 0 - \setlength{\bibitemsep}{0ex} - \setlength{\bibnamesep}{0ex} - \setlength{\bibinitsep}{0ex} - % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 - \setlength{\biblabelsep}{1.7mm} - - \bool_if:NF \l__bithesis_style_bibliography_indent_bool { - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} - } - } - - % If in blindPeerReview mode, omit delimiters in author field. - \bool_if:NT \g__bithesis_blind_mode_bool { - % 如果有多个作者,不修改此项的话,作者与标题之间会有逗号。 - \DeclareDelimFormat[bib,biblist]{finalnamedelim}{} - % 如果自己不是第一个作者,不修改此项的话,会在最开始有逗号。 - \DeclareDelimFormat{multinamedelim}{} - % 如果覆盖的是英文作者,不修改此项的话,会在最开始有空格。 - \DeclareDelimFormat{bibnamedelimd}{} - } - - % ===== 上方定义与「参考文献」部分相同 - - % 中文姓名下,此部分不参与输出。 - \cs_set:Npn \mkbibnamegiven ##1 { - \haspartannotation{myself}{ - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式,不输出内容 - } { - % 普通模式 - \textbf{##1} - } - }{ - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式,不输出内容 - } { - % 普通模式 - ##1 - } - } - } - - \cs_set:Npn \mkbibnamefamily ##1 { - \haspartannotation{myself}{ - % 作者为自己 - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式 - \getpartannotation{myself} - } { - % 普通模式 - \textbf{##1} - } - }{ - % 作者不是自己 - \bool_if:NTF \g__bithesis_blind_mode_bool { - % 盲审模式,不输出 - } { - % 普通模式 - ##1 - } - } - } - - \if_cs_exist:N \c@pub { - % 重置计数器 - \setcounter{pub}{0} - } \else: { - % 设置计数器 - \newcounter{pub} - } \fi: - - % 设置参考文献的排序 - \bool_if:NTF \l__bithesis_publications_sorting_bool { - % Sorting by year, name, type. - \newrefcontext[sorting=ynt] - } { - % Do not sort. - \newrefcontext - } - - % 根据 maxbibnames 的设置,覆盖 \blx@maxbibnames 选项,保证所有作者都能显示。 - \cs_set:Npn \blx@maxbibnames { - \l__bithesis_publications_maxbibnames_int - } - - % 根据 minbibnames 的设置,覆盖 \blx@minbibnames 选项,保证所有作者都能显示。 - \cs_set:Npn \blx@minbibnames { - \l__bithesis_publications_minbibnames_int - } - - \chapter{\__bithesis_get_const:N {publications}} - #1 - \end{blindPeerReview} - } - {} -\NewDocumentEnvironment {resume} {+b} - { - \begin{blindPeerReview} - % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。 - % 不知为何,需要手动重置 section 计数器。 - \setcounter{section}{0} - \ctexset{ - appendix/numbering = false, - section/number = \arabic{section}, - subsection/number = \arabic{section}. \arabic{subsection}, - subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection}, - } - \chapter{\__bithesis_get_const:N{resume}} - #1 - \end{blindPeerReview} - } - { - } - -\NewDocumentEnvironment {symbols} {} - { - \bool_if:NTF \l__bithesis_add_symbols_to_toc_bool { - \chapter{\__bithesis_get_const:N {symbols}} - } { - \chapter*{\__bithesis_get_const:N {symbols}} - \currentpdfbookmark{\c__bithesis_label_symbols_tl}{ch:symbols} - } - \zihao{-4} - \begin{itemize}[ - labelwidth=2.5cm, - labelsep=0.5cm, - leftmargin=3cm, - itemindent=0cm, - % 不再在两项之间增加额外的间距(1.5 倍的行间距已经够宽了)(未来可以提供一个接口以供用户手动设置间距) - itemsep=-0.5ex, - ] - \cs_set:Npn \makelabel ##1 {##1\hfil} - } - { - \end{itemize} - - % 单独一页 - \clearpage - } -\endinput -%% -%% End of file `bithesis.cls'.