├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── documentation.md │ ├── feature_request.md │ └── question.md ├── pull_request_template.md └── workflows │ ├── pr-to-universe.yml │ └── scripts │ ├── typship-login-universe.expect │ └── typship-push-universe.expect ├── .gitignore ├── LICENSE ├── LICENSE-MIT ├── README.md ├── assets ├── citation-style.csl ├── cover.png └── under-cover.png ├── fonts ├── Courier New │ ├── Courier New Bold Italic.ttf │ ├── Courier New Bold.ttf │ ├── Courier New Italic.ttf │ └── Courier New.ttf ├── FangSong.ttf ├── Kaiti.ttf ├── SimHei.ttf ├── SimSun.ttf └── TimesNewRoman │ ├── TimesNewRoman-Bold-Italic.ttf │ ├── TimesNewRoman-Bold.ttf │ ├── TimesNewRoman-Italic.ttf │ └── TimesNewRoman.ttf ├── layouts ├── appendix.typ ├── doc.typ └── mainmatter.typ ├── lib.typ ├── pages ├── abstract.typ ├── acknowledgement.typ ├── bib.typ ├── conclusion.typ ├── cover.typ ├── declare.typ ├── outline.typ └── under-cover.typ ├── style ├── distr.typ ├── enums.typ ├── figures.typ ├── font.typ ├── heading.typ └── uline.typ ├── template ├── data │ ├── heros.csv │ └── nyuv2.csv ├── figures │ ├── cetz.typ │ ├── energy-distribution.png │ ├── fletcher.typ │ └── sign.png ├── ref.bib └── thesis.typ ├── thumbnail.png └── typst.toml /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🐛 Bug Report 3 | about: Create a report to help us improve 4 | title: "[BUG] " 5 | labels: bug 6 | assignees: '' 7 | --- 8 | 9 | ## 1. Bug Description 10 | 11 | 14 | 15 | ## 2. Steps to Reproduce 16 | 17 | 25 | 26 | ## 3. Expected Behavior 27 | 28 | 29 | 30 | ## 4. Screenshots 31 | 32 | 33 | 34 | ## 5. Environment 35 | 36 | 53 | 54 | | Software | Version | 55 | | ------------ | ------- | 56 | | Typst | | 57 | 58 | ## 6. Additional Context 59 | 60 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 📚 Documentation 3 | about: Request or enhancement to current documentations 4 | title: "[DOC] " 5 | labels: documentation 6 | assignees: '' 7 | --- 8 | 9 | ## 1. Suggestions 10 | 11 | 12 | 13 | ## 2. Location 14 | 15 | 16 | 17 | ## 3. Additional Context 18 | 19 | 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 💡 Feature Request 3 | about: Suggest an idea for this project 4 | title: "[FEATURE] " 5 | labels: enhancement 6 | assignees: '' 7 | --- 8 | 9 | ## 1. Feature Description 10 | 11 | 12 | 13 | ## 2. Motivation 14 | 15 | 16 | 17 | ## 3. Possible Implementation 18 | 19 | 20 | 21 | ## 4. Additional Context 22 | 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: ❓ Question 3 | about: Any question to the project 4 | title: "[QUESTION] " 5 | labels: question 6 | assignees: '' 7 | --- 8 | 9 | ## 1. Question Description 10 | 11 | 12 | 13 | ## 2. What I have Tried 14 | 15 | 23 | 24 | - [ ] I have read the documentation 25 | - [ ] I have searched the related issues 26 | - [ ] I have searched the related pull requests 27 | - [ ] I have searched the web 28 | - [ ] I have run the code 29 | 30 | ## 3. Environment 31 | 32 | 49 | 50 | | Software | Version | 51 | | ------------ | ------- | 52 | | Typst | | 53 | 54 | ## 4. Additional Context 55 | 56 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 11 | 12 | ## 1. PR Description 13 | 14 | 17 | 18 | ## 2. Related Issue and PR 19 | 20 | 31 | 32 | ## 3. Test 33 | ### 3.1. Environment 34 | 35 | 52 | 53 | | Software | Version | 54 | | ------------ | ------- | 55 | | Typst | | 56 | 57 | ### 3.2. Steps to Test 58 | 59 | 60 | 61 | ### 3.3. Test Results 62 | 63 | 64 | 65 | ## 4. Additional Context 66 | 67 | -------------------------------------------------------------------------------- /.github/workflows/pr-to-universe.yml: -------------------------------------------------------------------------------- 1 | # Adapted from: 2 | # 1. https://github.com/typst-community/typst-package-template/blob/64726be/.github/workflows/release.yml 3 | # Licensed under The Unlicense 4 | # 2. https://github.com/johannes-wolf/cetz/blob/35c0868/scripts/package 5 | # Licensed under Apache License 2.0 6 | 7 | name: Package and push to registry repo 8 | on: 9 | push: 10 | tags: [ v*.*.* ] 11 | 12 | env: 13 | TYPSHIP_VERSION: 0.4.1 14 | 15 | jobs: 16 | release: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v4 21 | 22 | - name: Install dependencies 23 | run: | 24 | sudo apt-get update 25 | sudo apt-get install -y expect 26 | 27 | - name: Determine and check package metadata 28 | shell: bash 29 | run: | 30 | function read_toml() { 31 | local file="$1" 32 | local key="$2" 33 | # Read a key value pair in the format: = "" stripping surrounding quotes. 34 | perl -lne "print \"\$1\" if /^${key}\\s*=\\s*\"(.*)\"/" < "$file" 35 | } 36 | 37 | PKG_NAME="$(read_toml "./typst.toml" "name")" 38 | PKG_VERSION="$(read_toml "./typst.toml" "version")" 39 | 40 | echo "PKG_NAME=${PKG_NAME}" >> "${GITHUB_ENV}" 41 | echo "PKG_VERSION=${PKG_VERSION}" >> "${GITHUB_ENV}" 42 | if [[ "${GITHUB_REF_NAME}" != "v${PKG_VERSION}" ]]; then 43 | echo "package version ${PKG_VERSION} does not match release tag ${GITHUB_REF_NAME}" >&2 44 | exit 1 45 | fi 46 | 47 | - name: Release package 48 | shell: bash 49 | run: | 50 | sed -i "1s|../lib.typ|@preview/${PKG_NAME}:${PKG_VERSION}|" ./template/thesis.typ 51 | rm -rf ./fonts 52 | pushd /tmp 53 | wget https://github.com/sjfhsjfh/typship/releases/download/v${{ env.TYPSHIP_VERSION }}/typship-x86_64-unknown-linux-gnu.tar.xz 54 | tar -xf /tmp/typship-x86_64-unknown-linux-gnu.tar.xz 55 | cp /tmp/typship-x86_64-unknown-linux-gnu/typship /usr/local/bin 56 | popd 57 | printf "${{ secrets.TYPST_PACKAGES_TOKEN }}" | typship login universe 58 | expect ./.github/workflows/scripts/typship-login-universe.expect "${{ secrets.TYPST_PACKAGES_TOKEN }}" 59 | expect ./.github/workflows/scripts/typship-push-universe.expect 60 | -------------------------------------------------------------------------------- /.github/workflows/scripts/typship-login-universe.expect: -------------------------------------------------------------------------------- 1 | set token [lindex $argv 0] 2 | spawn typship login universe 3 | expect "token:" 4 | send "$token\r" 5 | expect eof -------------------------------------------------------------------------------- /.github/workflows/scripts/typship-push-universe.expect: -------------------------------------------------------------------------------- 1 | spawn typship publish universe 2 | 3 | expect { 4 | "\[packages\]" 5 | } 6 | send "\n" 7 | expect { 8 | "\[y/N\]" 9 | } 10 | send "y\n" 11 | 12 | while {1} { 13 | expect { 14 | -ex "PR created" { exit 0} 15 | 16 | -ex "ERROR" { 17 | puts "Error occurred" 18 | exit 1 19 | } 20 | 21 | eof { 22 | puts "EOF reached without matched target string" 23 | exit 1 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | 3 | # Created by https://www.toptal.com/developers/gitignore/api/macos,linux,windows 4 | # Edit at https://www.toptal.com/developers/gitignore?templates=macos,linux,windows 5 | 6 | ### Linux ### 7 | *~ 8 | 9 | # temporary files which can be created if a process still has a handle open of a deleted file 10 | .fuse_hidden* 11 | 12 | # KDE directory preferences 13 | .directory 14 | 15 | # Linux trash folder which might appear on any partition or disk 16 | .Trash-* 17 | 18 | # .nfs files are created when an open file is removed but is still being accessed 19 | .nfs* 20 | 21 | ### macOS ### 22 | # General 23 | .DS_Store 24 | .AppleDouble 25 | .LSOverride 26 | 27 | # Icon must end with two \r 28 | Icon 29 | 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | .com.apple.timemachine.donotpresent 42 | 43 | # Directories potentially created on remote AFP share 44 | .AppleDB 45 | .AppleDesktop 46 | Network Trash Folder 47 | Temporary Items 48 | .apdisk 49 | 50 | ### macOS Patch ### 51 | # iCloud generated files 52 | *.icloud 53 | 54 | ### Windows ### 55 | # Windows thumbnail cache files 56 | Thumbs.db 57 | Thumbs.db:encryptable 58 | ehthumbs.db 59 | ehthumbs_vista.db 60 | 61 | # Dump file 62 | *.stackdump 63 | 64 | # Folder config file 65 | [Dd]esktop.ini 66 | 67 | # Recycle Bin used on file shares 68 | $RECYCLE.BIN/ 69 | 70 | # Windows Installer files 71 | *.cab 72 | *.msi 73 | *.msix 74 | *.msm 75 | *.msp 76 | 77 | # Windows shortcuts 78 | *.lnk 79 | 80 | # End of https://www.toptal.com/developers/gitignore/api/macos,linux,windows -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2025 SHUOSC 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024-2025 tzhTaylor 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 上海大学本科生毕业论文 Typst 模板 - 上海大学开源社区版 (SHUOSC) 2 | 3 | 由上交的模板修改而来: [typst-sjtu-thesis-master](https://github.com/tzhTaylor/typst-sjtu-thesis-master) 4 | 5 | 这是上海大学本科生学位论文的 Typst 模板,它能够简洁、快速、持续生成 PDF 格式的毕业论文,它基于本科生院官方提供的模板进行开发。基于本科生院提供的 [word 模板](https://cj.shu.edu.cn/DataInterface/上海大学本科毕业论文(设计)撰写格式模板.pdf) 进行开发。 6 | 7 | ## 1. 使用方法 8 | 9 | ### 1.1. (推荐) VSCode 本地编辑 + 使用 Typst Universe 模板库 10 | 11 | 1. 在 VS Code 中安装 [Tinymist Typst](https://marketplace.visualstudio.com/items?itemName=myriad-dreamin.tinymist) 插件,负责语法高亮, 错误检查和 PDF 预览。 12 | 13 | 2. 分别执行以下命令: 14 | - 按下 `Ctrl + Shift + P`(Windows) / `Command + Shift + P`(MacOS) 打开命令界面 15 | - 输入 `Typst: Initialize a New Typst Project based on a Template` 并点击 16 | - 输入 `@preview/shuosc-shu-bachelor-thesis` 并回车 17 | - 选择一个空的目录 18 | 19 | 3. 最后用 VS Code 打开指定的目录,打开 `thesis.typ` 文件,按下 `Ctrl + K V`(Windows) / `Command + K V`(MacOS) 或者是点击右上角的按钮进行实时编辑和预览。 20 | 21 | ### 1.2. (开发者) VSCode 本地编辑 + 使用 GitHub 仓库 22 | 23 | 1. 在 VS Code 中安装 [Tinymist Typst](https://marketplace.visualstudio.com/items?itemName=myriad-dreamin.tinymist) 插件,负责语法高亮, 错误检查和 PDF 预览。 24 | 25 | 2. 运行命令 `git clone git@github.com:shuosc/SHU-Bachelor-Thesis-Typst.git`,克隆本仓库到本地。 26 | 27 | 3. 最后用 VS Code 打开目录,打开 `template/thesis.typ` 文件,按下 `Ctrl + K V`(Windows) / `Command + K V`(MacOS) 或者是点击右上角的按钮进行实时编辑和预览。 28 | 29 | ### 1.3. Web APP 在线编辑 30 | 31 | Typst 提供了官方的 Web App,支持像 Overleaf 一样在线编辑。 32 | 33 | 实际上,我们只需要在 [Web App](https://typst.app/) 中的 `Start from template` 里选择 `shuosc-shu-bachelor-thesis`,即可在线创建模板并使用。 34 | 35 | **但是 Web App 并没有安装本地 Windows 或 MacOS 所拥有的字体,所以字体上可能存在差异,所以推荐本地编辑!** 36 | 37 | **你需要手动上传 fonts 目录下的字体文件到项目中(任意位置均可),否则会导致字体显示错误!** 38 | 39 | ## 2. 更新 40 | 仓库会持续优化模板并上传至Typst Universe 模板库,请按照如下步骤进行更新: 41 | 1. 点击仓库右侧Releases中最新的版本号获取发布信息 42 | 2. 将自己的`thesis.typ`文档第一行的版本号修改为最新的版本号 43 | 3. 按照发布信息对自己的`thesis.typ`进行修改 44 | 45 | 如果跨版本升级报错,请逐级升级至最新版,当然你也可以直接拉取一个新的模板并将内容自行复制到新模板中。 46 | 47 | ## 3. License 48 | 49 | 本项目采用 Apache 许可证(详见[LICENSE](./LICENSE)) 和 MIT 许可证(third-party, 详见[LICENSE-MIT](./LICENSE-MIT))。 50 | 51 | 图片 `assets/cover.png` `assets/under-cover.png`:由上海大学提供,版权归上海大学所有,仅限本毕业设计使用。 52 | 53 | This project is licensed under the Apache License (see [LICENSE](./LICENSE)) and MIT License (third-party, see [LICENSE-MIT](./LICENSE-MIT)). 54 | 55 | The images `assets/cover.png` and `assets/under-cover.png` are provided by Shanghai University, and the copyright is owned by Shanghai University. They are for use only in this graduation project. -------------------------------------------------------------------------------- /assets/citation-style.csl: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /assets/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/assets/cover.png -------------------------------------------------------------------------------- /assets/under-cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/assets/under-cover.png -------------------------------------------------------------------------------- /fonts/Courier New/Courier New Bold Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/fonts/Courier New/Courier New Bold Italic.ttf -------------------------------------------------------------------------------- /fonts/Courier New/Courier New Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/fonts/Courier New/Courier New Bold.ttf -------------------------------------------------------------------------------- /fonts/Courier New/Courier New Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/fonts/Courier New/Courier New Italic.ttf -------------------------------------------------------------------------------- /fonts/Courier New/Courier New.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/fonts/Courier New/Courier New.ttf -------------------------------------------------------------------------------- /fonts/FangSong.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/fonts/FangSong.ttf -------------------------------------------------------------------------------- /fonts/Kaiti.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/fonts/Kaiti.ttf -------------------------------------------------------------------------------- /fonts/SimHei.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/fonts/SimHei.ttf -------------------------------------------------------------------------------- /fonts/SimSun.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/fonts/SimSun.ttf -------------------------------------------------------------------------------- /fonts/TimesNewRoman/TimesNewRoman-Bold-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/fonts/TimesNewRoman/TimesNewRoman-Bold-Italic.ttf -------------------------------------------------------------------------------- /fonts/TimesNewRoman/TimesNewRoman-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/fonts/TimesNewRoman/TimesNewRoman-Bold.ttf -------------------------------------------------------------------------------- /fonts/TimesNewRoman/TimesNewRoman-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/fonts/TimesNewRoman/TimesNewRoman-Italic.ttf -------------------------------------------------------------------------------- /fonts/TimesNewRoman/TimesNewRoman.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/fonts/TimesNewRoman/TimesNewRoman.ttf -------------------------------------------------------------------------------- /layouts/appendix.typ: -------------------------------------------------------------------------------- 1 | #import "../style/heading.typ": appendix-first-heading 2 | #import "../style/figures.typ": figures 3 | #let appendix( 4 | body, 5 | ) = { 6 | show: appendix-first-heading 7 | show: figures.with(appendix: true) 8 | show heading.where(level: 2): set heading(outlined: false) 9 | show heading.where(level: 3): set heading(outlined: false) 10 | set par( 11 | first-line-indent: (amount: 2em, all: true), 12 | leading: 20pt - 1em, 13 | spacing: 20pt - 1em, 14 | justify: true, 15 | ) 16 | body 17 | } 18 | -------------------------------------------------------------------------------- /layouts/doc.typ: -------------------------------------------------------------------------------- 1 | #import "../style/font.typ": ziti, zihao 2 | #import "../style/figures.typ": figures, preset 3 | #import "../style/enums.typ": enums 4 | #import "@preview/cuti:0.3.0": show-cn-fakebold 5 | 6 | // 文稿设置,可以进行一些像页面边距这类的全局设置 7 | #let doc( 8 | info: (:), 9 | fallback: false, 10 | it, 11 | ) = context { 12 | set page( 13 | margin: (top: 2.8cm, bottom: 2.5cm, left: 3cm, right: 2.5cm), 14 | header: context { 15 | box( 16 | width: 100%, 17 | stroke: (bottom: 0.5pt), 18 | inset: (bottom: 4pt), 19 | text( 20 | "上海大学本科毕业论文(设计)", 21 | font: ziti.songti.get(), 22 | size: zihao.wuhao, 23 | top-edge: 0.8em, 24 | bottom-edge: -0.2em, 25 | ), 26 | ) 27 | }, 28 | header-ascent: 0.6cm, 29 | ) 30 | 31 | set text( 32 | font: ziti.songti.get(), 33 | size: zihao.xiaosi, 34 | top-edge: 0.8em, 35 | bottom-edge: -0.2em, 36 | fallback: fallback, 37 | ) 38 | set par( 39 | first-line-indent: (amount: 2em, all: true), 40 | spacing: 0.3em, 41 | leading: 0.3em, 42 | ) 43 | 44 | show raw: it => context { 45 | set text(font: ziti.dengkuan.get()) 46 | if it.block == true { 47 | set par( 48 | first-line-indent: (amount: 0em, all: true), 49 | spacing: 0.3em, 50 | leading: 0.3em, 51 | ) 52 | it 53 | } else { 54 | it 55 | } 56 | } 57 | 58 | show ref.where(form: "page"): set ref(supplement: [页]) 59 | 60 | show: preset 61 | show: figures 62 | show: enums 63 | show: show-cn-fakebold 64 | 65 | set document( 66 | title: info.title, 67 | author: info.name, 68 | ) 69 | 70 | it 71 | } 72 | -------------------------------------------------------------------------------- /layouts/mainmatter.typ: -------------------------------------------------------------------------------- 1 | #import "../style/font.typ": ziti, zihao 2 | #import "../style/heading.typ": main-heading 3 | #import "../style/figures.typ": figures 4 | 5 | #let mainmatter( 6 | math-level: 2, 7 | body, 8 | ) = context { 9 | set page(numbering: "1") 10 | counter(page).update(1) 11 | show: main-heading 12 | show: figures.with(math-level: math-level) 13 | set text(font: ziti.songti.get(), size: zihao.xiaosi) 14 | set par( 15 | first-line-indent: (amount: 2em, all: true), 16 | leading: 23pt - 1em, 17 | spacing: 23pt - 1em, 18 | justify: true, 19 | ) 20 | body 21 | } 22 | -------------------------------------------------------------------------------- /lib.typ: -------------------------------------------------------------------------------- 1 | #import "style/font.typ": ziti, zihao 2 | #import "layouts/doc.typ": doc 3 | #import "layouts/mainmatter.typ": mainmatter 4 | #import "layouts/appendix.typ": appendix 5 | #import "pages/cover.typ": cover-page 6 | #import "pages/declare.typ": declare-page 7 | #import "pages/abstract.typ": abstract-page 8 | #import "pages/outline.typ": outline-page 9 | #import "pages/bib.typ": bibliography-page, citex 10 | #import "pages/acknowledgement.typ": acknowledgement-page 11 | #import "pages/conclusion.typ": conclusion-page 12 | #import "pages/under-cover.typ": under-cover-page 13 | #import "style/figures.typ": algox, tablex, imagex, subimagex 14 | 15 | #let documentclass( 16 | info: (:), 17 | title-line-length: 260pt, 18 | font-fallback: true, 19 | math-level: 2, 20 | outline-compact: true, 21 | citation: (:), 22 | fonts: (:), 23 | ) = { 24 | info = ( 25 | ( 26 | title: "[论文题目]", 27 | school: "[学院]", 28 | major: "[专业]", 29 | student_id: "[学号]", 30 | name: "[姓名]", 31 | supervisor: "[指导老师]", 32 | date: "[起讫日期]", 33 | ) 34 | + info 35 | ) 36 | citation = ( 37 | ( 38 | func: bibliography("template/ref.bib"), 39 | full: false, 40 | sup: true, 41 | ) 42 | + citation 43 | ) 44 | fonts = (fallback: true) + fonts 45 | let fallback = fonts.fallback 46 | fonts.remove("fallback") 47 | 48 | return ( 49 | info: info, 50 | doc: (..args) => doc( 51 | info: info + args.named().at("info", default: (:)), 52 | fallback: fallback, 53 | ..args, 54 | ), 55 | conclusion: (..args) => conclusion-page(..args), 56 | mainmatter: (..args) => mainmatter(math-level: math-level, ..args), 57 | appendix: (..args) => appendix(..args), 58 | cover: (..args) => cover-page( 59 | info: info + args.named().at("info", default: (:)), 60 | title-line-length: title-line-length, 61 | ..args, 62 | ), 63 | declare: (..args) => declare-page( 64 | info: info + args.named().at("info", default: (:)), 65 | ..args, 66 | ), 67 | abstract: (..args) => abstract-page(..args), 68 | outline: (..args) => outline-page( 69 | compact: outline-compact, 70 | ..args, 71 | ), 72 | bib: (..args) => bibliography-page( 73 | bibfunc: citation.func, 74 | full: citation.full, 75 | sup: citation.sup, 76 | ..args, 77 | ), 78 | acknowledgement: (..args) => acknowledgement-page( 79 | info: info + args.named().at("info", default: (:)), 80 | ..args, 81 | ), 82 | under-cover: (..args) => under-cover-page(..args), 83 | fonts: { 84 | for (key, value) in fonts { 85 | context ziti.at(key).update(value + ziti.at(key).get()) 86 | } 87 | }, 88 | ) 89 | } 90 | -------------------------------------------------------------------------------- /pages/abstract.typ: -------------------------------------------------------------------------------- 1 | #import "../style/font.typ": ziti, zihao 2 | #import "../style/heading.typ": none-heading 3 | 4 | #let abstract-page( 5 | keywords: (), 6 | keywords-en: (), 7 | body, 8 | body-en, 9 | ) = context { 10 | show: none-heading 11 | set page(numbering: "I") 12 | counter(page).update(1) 13 | set text(font: ziti.songti.get(), size: zihao.xiaosi) 14 | set par(spacing: 20pt - 1em, leading: 20pt - 1em, justify: true) 15 | 16 | heading(level: 1)[摘#h(1em)要] 17 | body 18 | v(1em) 19 | par(first-line-indent: 0em)[ 20 | *关键词:*#(("",) + keywords.intersperse(";")).sum() 21 | ] 22 | pagebreak(weak: true) 23 | 24 | heading(level: 1)[ABSTRACT] 25 | body-en 26 | v(1em) 27 | par(first-line-indent: 0em)[ 28 | *Keywords:* #(("",) + keywords-en.intersperse("; ")).sum() 29 | ] 30 | pagebreak(weak: true) 31 | } 32 | 33 | -------------------------------------------------------------------------------- /pages/acknowledgement.typ: -------------------------------------------------------------------------------- 1 | #import "../style/heading.typ": none-heading 2 | #import "../style/font.typ": ziti, zihao 3 | 4 | #let acknowledgement-page( 5 | info: (:), 6 | date: none, 7 | location: "上海大学", 8 | body, 9 | ) = context { 10 | pagebreak(weak: true) 11 | show: none-heading 12 | heading(level: 1)[致#h(1em)谢] 13 | set text(font: ziti.songti.get(), size: zihao.xiaosi) 14 | set par(first-line-indent: 2em, leading: 23pt - 1em, spacing: 23pt - 1em, justify: true) 15 | body 16 | linebreak() 17 | set align(right) 18 | info.name 19 | set align(right) 20 | location 21 | set align(right) 22 | if date == none { 23 | datetime.today().display("[year]年[month]月[day]日") 24 | } else { 25 | date 26 | } 27 | pagebreak(weak: true) 28 | } 29 | -------------------------------------------------------------------------------- /pages/bib.typ: -------------------------------------------------------------------------------- 1 | #import "../style/heading.typ": none-heading 2 | 3 | // Copied from https://raw.githubusercontent.com/tzhTaylor/modern-sjtu-thesis/refs/heads/main/utils/bilingual-bibliography.typ 4 | // I don't know what's going on in here. 5 | #let multilan = it => { 6 | // Please fill in the remaining mapping table here 7 | let mapping = ( 8 | ( 9 | //"等": "et al", 10 | "卷": "Vol.", 11 | "册": "Bk.", 12 | // "译": ", tran", 13 | // "等译": "et al. tran", 14 | // 注: 请见下方译者数量判断部分。 15 | ) 16 | ) 17 | 18 | let to-string(content) = { 19 | if content.has("text") { 20 | content.text 21 | } else if content.has("children") { 22 | content.children.map(to-string).join("") 23 | } else if content.has("child") { 24 | to-string(content.child) 25 | } else if content.has("body") { 26 | to-string(content.body) 27 | } else if content == [ ] { 28 | " " 29 | } 30 | } 31 | 32 | show grid.cell.where(x: 1): it => { 33 | // 后续的操作是对 string 进行的。 34 | let ittext = to-string(it) 35 | // 判断是否为中文文献:去除特定词组后,仍有至少两个连续汉字。 36 | let pureittext = ittext.replace(regex("[等卷册和版本章期页篇译间者(不详)]"), "") 37 | if pureittext.find(regex("\p{sc=Hani}{2,}")) != none { 38 | // 新增功能:将带有“标准”两个字的一行中的 [Z] 替换为 [S] 39 | ittext = ittext.replace( 40 | regex("标准.*\[Z\]"), 41 | itt => { 42 | itt.text.replace(regex("\[Z\]"), "[S]") 43 | }, 44 | ) 45 | ittext 46 | } else { 47 | // 若不是中文文献,进行替换 48 | // 第xxx卷、第xxx册的情况:变为 Vol. XXX 或 Bk. XXX。 49 | let reptext = ittext 50 | reptext = reptext.replace( 51 | regex("(第\s?)?\d+\s?[卷册]"), 52 | itt => { 53 | if itt.text.contains("卷") { 54 | "Vol. " 55 | } else { 56 | "Bk. " 57 | } 58 | itt.text.find(regex("\d+")) 59 | }, 60 | ) 61 | 62 | // 第xxx版/第xxx本的情况:变为 1st ed 格式。 63 | reptext = reptext.replace( 64 | regex("(第\s?)?\d+\s?[版本]"), 65 | itt => { 66 | let num = itt.text.find(regex("\d+")) 67 | num 68 | if num.clusters().len() == 2 and num.clusters().first() == "1" { 69 | "th" 70 | } else { 71 | ( 72 | "1": "st", 73 | "2": "nd", 74 | "3": "rd", 75 | ).at(num.clusters().last(), default: "th") 76 | } 77 | " ed" 78 | }, 79 | ) 80 | 81 | // 译者数量判断:单数时需要用 trans,复数时需要用 tran 。 82 | /* 83 | 注: 84 | 1. 目前判断译者数量的方法非常草率:有逗号就是多个作者。但是在部分 GB/T 7714-2015 方言中,姓名中可以含有逗号。如果使用的 CSL 是姓名中含有逗号的版本,请将 bilingual-bibliography 的 allow-comma-in-name 参数设为 true。 85 | 2. 在 GB/T 7714-2015 原文中有 `等译`(P15 10.1.3 小节 示例 1-[1] 等),但未给出相应的英文缩写翻译。CSL 社区库内的 GB/T 7714-2015 会使用 `等, 译` 和 `et al., tran` 的写法。为使中英文与标准原文写法一致,本小工具会译作 `et al. tran`。若需要添加逗号,请将 bilingual-bibliography 的 extra-comma-before-et-al-trans 参数设为 true。 86 | 3. GB/T 7714-2015 P8 7.2 小节规定:“译”前需加逗号。因此单个作者的情形,“译” 会被替换为 ", trans"。与“等”并用时的情况请见上一条注。 87 | 如果工作不正常,可以考虑换为简单关键词替换,即注释这段情况,取消 13 行 mapping 内 `译` 条目的注释。 88 | */ 89 | reptext = reptext.replace( 90 | regex("\].+?译"), 91 | itt => { 92 | // 我想让上面这一行匹配变成非贪婪的,但加问号后没啥效果? 93 | let comma-in-itt = itt.text.replace(regex(",?\s?译"), "").matches(",") 94 | if ( 95 | type(comma-in-itt) == array 96 | and comma-in-itt.len() 97 | >= ( 98 | if allow-comma-in-name { 2 } else { 1 } 99 | ) 100 | ) { 101 | if extra-comma-before-et-al-trans { 102 | itt.text.replace(regex(",?\s?译"), ", tran") 103 | } else { 104 | itt.text.replace(regex(",?\s?译"), " tran") 105 | } 106 | } else { 107 | itt.text.replace(regex(",?\s?译"), ", trans") 108 | } 109 | }, 110 | ) 111 | 112 | // `等` 特殊处理:`等`后方接内容也需要译作 `et al.`,如 `等译` 需要翻译为 `et al. trans` 113 | reptext = reptext.replace( 114 | regex("等."), 115 | itt => { 116 | "et al." 117 | // 如果原文就是 `等.`,则仅需简单替换,不需要额外处理 118 | // 如果原文 `等` 后没有跟随英文标点,则需要补充一个空格 119 | if not itt.text.last() in (".", ",", ";", ":", "[", "]", "/", "\\", "<", ">", "?", "(", ")", " ", "\"", "'") { 120 | " " 121 | } 122 | // 原文有英文句号时不需要重复句号,否则需要将匹配到的最后一个字符吐回来 123 | if not itt.text.last() == "." { 124 | itt.text.last() 125 | } 126 | }, 127 | ) 128 | 129 | // 其他情况:直接替换 130 | reptext = reptext.replace( 131 | regex("\p{sc=Hani}+"), 132 | itt => { 133 | mapping.at(itt.text, default: itt.text) 134 | // 注意:若替换功能工作良好,应该不会出现 `default` 情形 135 | }, 136 | ) 137 | reptext 138 | } 139 | } 140 | it 141 | } 142 | 143 | #let bibliography-page( 144 | bibfunc: none, 145 | full: true, 146 | sup: true, 147 | ) = { 148 | pagebreak(weak: true) 149 | show: none-heading 150 | set bibliography( 151 | title: "参考文献", 152 | // 复制自: https://github.com/citation-style-language/styles/blob/master/china-national-standard-gb-t-7714-2015-numeric.csl 153 | // 根据学校的模板,移除了427行的vertical-align="sup" 154 | style: if sup { "gb-7714-2015-numeric" } else { "../assets/citation-style.csl" }, 155 | full: full, 156 | ) 157 | 158 | show selector(bibliography): it => { 159 | show regex("\[\d+\]"): num => context { 160 | let text = num.text 161 | text + h(1.27cm - measure(text).width) 162 | } 163 | set par(justify: true) 164 | it 165 | } 166 | 167 | show: multilan 168 | set text(lang: "zh") 169 | 170 | bibfunc 171 | pagebreak(weak: true) 172 | } 173 | 174 | #let citex( 175 | key, 176 | form: "normal", 177 | style: none, 178 | sup: none, 179 | ) = { 180 | let style = { 181 | if style == none { 182 | if sup == none { 183 | none 184 | } else if sup == true { 185 | "gb-7714-2015-numeric" 186 | } else { 187 | "../assets/citation-style.csl" 188 | } 189 | } else { 190 | style 191 | } 192 | } 193 | if style == none { 194 | return cite(key, form: form) 195 | } else { 196 | return cite(key, form: form, style: style) 197 | } 198 | } 199 | 200 | -------------------------------------------------------------------------------- /pages/conclusion.typ: -------------------------------------------------------------------------------- 1 | #import "../style/heading.typ": none-heading 2 | 3 | #let conclusion-page( 4 | body, 5 | ) = { 6 | show: none-heading 7 | heading(level: 1)[结论] 8 | body 9 | pagebreak(weak: true) 10 | } 11 | 12 | -------------------------------------------------------------------------------- /pages/cover.typ: -------------------------------------------------------------------------------- 1 | #import "../style/font.typ": ziti, zihao 2 | #import "../style/distr.typ": distr 3 | #import "../style/uline.typ": uline 4 | 5 | #let cover-page( 6 | info: (:), 7 | title-line-length: 260pt, 8 | ) = context { 9 | set page( 10 | background: scale(107.8%, origin: top + center)[#image("../assets/cover.png")], 11 | header: none, 12 | ) 13 | set par(first-line-indent: 2em, spacing: 0em, leading: 0em) 14 | 15 | align( 16 | center, 17 | text(font: ziti.songti.get(), size: zihao.chuhao, stroke: 0.2pt)[ 18 | #v(2.8em) 19 | 本科毕业论文(设计) 20 | ], 21 | ) 22 | align( 23 | center, 24 | text(font: ziti.songti.get(), size: zihao.xiaoer)[ 25 | #v(1.3em) 26 | UNDERGRADUATE#h(1em)THESIS (PROJECT) 27 | #v(5em) 28 | ], 29 | ) 30 | 31 | let colon = ":" 32 | set text( 33 | font: ziti.songti.get(), 34 | size: 16pt, 35 | ) 36 | let info-key(zh) = distr(zh, w: 4em) 37 | let info-value(zh) = uline(260pt, zh) 38 | let first = info.title.codepoints() 39 | let second = () 40 | let length = first.len() 41 | for i in range(length) { 42 | let first_size = measure( 43 | text( 44 | font: ziti.songti.get(), 45 | size: 16pt, 46 | first.reduce((s, it) => s + str(it)), 47 | ), 48 | ).width 49 | if first_size <= calc.min(260pt, title-line-length) { 50 | first = first.reduce((s, it) => s + str(it)) 51 | second = second.reduce((s, it) => str(it) + s) 52 | break 53 | } 54 | second.push(first.pop()) 55 | } 56 | table( 57 | align: center + horizon, 58 | stroke: none, 59 | columns: (auto, auto, auto), 60 | column-gutter: (-0.3em, 0.3em), 61 | inset: (right: 0em, top: 0.45em, bottom: 0.45em), 62 | info-key("题目"), colon, info-value(first), 63 | ..if second != none { 64 | ([#v(1em)], [], info-value(second)) 65 | }, 66 | [#v(1em)], [], [], 67 | info-key("学院"), colon, info-value(info.school), 68 | info-key("专业"), colon, info-value(info.major), 69 | info-key("学号"), colon, info-value(info.student_id), 70 | info-key("学生姓名"), colon, info-value(info.name), 71 | info-key("指导教师"), colon, info-value(info.supervisor), 72 | info-key("起讫日期"), colon, info-value(info.date), 73 | ) 74 | } 75 | -------------------------------------------------------------------------------- /pages/declare.typ: -------------------------------------------------------------------------------- 1 | #import "../style/font.typ": ziti, zihao 2 | #import "../style/distr.typ": distr 3 | #import "../style/uline.typ": uline 4 | 5 | #let declare-page( 6 | info: (:), 7 | author_sign: none, 8 | supervisor_sign: none, 9 | date: none, 10 | ) = context { 11 | set text(font: ziti.songti.get(), size: zihao.xiaosi) 12 | v(-1.1em) 13 | align(center)[ 14 | #table( 15 | stroke: 0pt, 16 | inset: (x: 0em, y: 0.6em), 17 | columns: (60%, 30%), 18 | align: left, 19 | [姓#h(2em)名:#info.name], [学#h(2em)号:#info.student_id], 20 | table.cell(colspan: 2)[论文题目:#info.title] 21 | )] 22 | v(1.3em) 23 | align(center)[ 24 | #set text(font: ziti.songti.get(), size: zihao.erhao, stroke: 0.4pt) 25 | #v(1.5 * 1.3em) 26 | 原#h(0.5em)创#h(0.5em)性#h(0.5em)声#h(0.5em)明 27 | ] 28 | [ 29 | #set text(font: ziti.songti.get(), size: zihao.sihao) 30 | #set par(justify: true, leading: 1.5 * 1.3em - 1em + 5pt, spacing: 1.5 * 1.3em - 1em + 5pt) 31 | #v(1.5 * 1.3em) 32 | 本人声明:所呈交的论文是本人在指导教师指导下进行的研究工作。除了文中特别加以标注和致谢的地方外,论文中不包含其他人已发表或撰写过的研究成果。参与同一工作的其他同志对本研究所做的任何贡献均已在论文中作了明确的说明并表示了谢意。 33 | #linebreak() 34 | #linebreak() 35 | 36 | 签 名:#uline(5.5em, place(center+bottom,author_sign)) 37 | 日 期:#uline( 38 | 5.5em, 39 | if date == none { datetime.today().display("[year].[month].[day]") } else { date }, 40 | ) 41 | #linebreak() 42 | #linebreak() 43 | ] 44 | align(center)[ 45 | #set text(font: ziti.songti.get(), size: zihao.erhao, stroke: 0.4pt) 46 | 本论文使用授权说明 47 | ] 48 | [ 49 | #set text(font: ziti.songti.get(), size: zihao.sihao) 50 | #set par(justify: true, leading: 1.5 * 1.3em - 1em + 6pt, spacing: 1.5 * 1.3em - 1em + 6pt) 51 | #v(1.5 * 1.3em) 52 | 本人完全了解上海大学有关保留、使用学位论文的规定,即:学校有权保留论文及送交论文复印件,允许论文被查阅和借阅;学校可以公布论文的全部或部分内容。#linebreak() 53 | 54 | #text(stroke: 0.4pt)[(保密的论文在解密后应遵守此规定)] #linebreak() #linebreak() 55 | 56 | 签 名:#uline(5.5em, place(center+bottom, author_sign)) 57 | 指导教师签名:#uline(5.5em, place(center+bottom,supervisor_sign)) 58 | 日 期:#uline(5.5em, if date == none { datetime.today().display("[year].[month].[day]") } else { date }) 59 | ] 60 | 61 | pagebreak(weak: true) 62 | } 63 | -------------------------------------------------------------------------------- /pages/outline.typ: -------------------------------------------------------------------------------- 1 | #import "../style/font.typ": ziti, zihao 2 | 3 | #let outline-page( 4 | info: (:), 5 | compact: false, 6 | ) = context { 7 | show outline.entry: it => context { 8 | if it.level == 1 { 9 | set text(font: ziti.heiti.get(), size: 14pt) 10 | if not compact { v(0.5em) } 11 | if it.element.supplement == [正文] { 12 | set text(weight: "bold") 13 | it 14 | } else { 15 | it 16 | } 17 | if not compact { v(0.5em) } 18 | } else if it.level == 2 { 19 | if not compact { v(0.3em) } 20 | set text(font: ziti.songti.get(), size: 12pt) 21 | it 22 | } else { 23 | if not compact { v(0.3em) } 24 | set text(font: ziti.songti.get(), size: 11pt) 25 | it 26 | } 27 | } 28 | show outline: it => { 29 | show heading: set align(center) 30 | show heading: set text(font: ziti.heiti.get(), size: 18pt, weight: "bold") 31 | it 32 | } 33 | 34 | v(15pt) 35 | context outline( 36 | title: [目#h(1em)录], 37 | indent: 1em, 38 | depth: 3, 39 | ) 40 | 41 | pagebreak(weak: true) 42 | } 43 | -------------------------------------------------------------------------------- /pages/under-cover.typ: -------------------------------------------------------------------------------- 1 | #let under-cover-page() = { 2 | set page( 3 | header: none, 4 | background: image("../assets/under-cover.png", width: 100%), 5 | numbering: none, 6 | ) 7 | pagebreak() 8 | } 9 | -------------------------------------------------------------------------------- /style/distr.typ: -------------------------------------------------------------------------------- 1 | #let distr(s, w: auto) = { 2 | block( 3 | width: w, 4 | stack( 5 | dir: ltr, 6 | ..s.clusters().map(x => [#x]).intersperse(1fr), 7 | ), 8 | ) 9 | } 10 | 11 | -------------------------------------------------------------------------------- /style/enums.typ: -------------------------------------------------------------------------------- 1 | #import "font.typ": ziti, zihao 2 | #import "@preview/numbly:0.1.0": numbly 3 | #let enums( 4 | body, 5 | ) = { 6 | set enum( 7 | numbering: numbly("({1})"), 8 | indent: 2em, 9 | full: true, 10 | ) 11 | body 12 | } 13 | -------------------------------------------------------------------------------- /style/figures.typ: -------------------------------------------------------------------------------- 1 | #import "@preview/i-figured:0.2.4" 2 | #import "font.typ": ziti, zihao 3 | #let preset( 4 | body, 5 | ) = { 6 | show ref: it => { 7 | if it.element != none and it.element.func() == figure and it.element.kind == "subimage_" { 8 | let q = query(figure.where(outlined: true).before(it.target)).last() 9 | ref(q.label) 10 | } 11 | it 12 | } 13 | body 14 | } 15 | 16 | #let figures( 17 | appendix: false, 18 | math-level: 2, 19 | body, 20 | ) = context { 21 | show figure: set align(center) 22 | show table: set align(center) 23 | 24 | show heading: i-figured.reset-counters.with( 25 | extra-kinds: ("image", "table", "algorithm"), 26 | equations: false, 27 | ) 28 | show heading: it => { 29 | if it.level <= math-level { 30 | counter(math.equation).update(0) 31 | } 32 | it 33 | } 34 | show figure: i-figured.show-figure.with( 35 | extra-prefixes: ( 36 | image: "img:", 37 | algorithm: "algo:", 38 | ), 39 | numbering: if not appendix { "1.1" } else { "A1" }, 40 | ) 41 | show math.equation: i-figured.show-equation.with( 42 | numbering: if not appendix { "(1.1)" } else { "(A1)" }, 43 | level: if not appendix { math-level } else { 1 }, 44 | ) 45 | set math.equation(supplement: [公式]) 46 | 47 | set figure.caption(separator: [#h(1em)]) 48 | show figure.caption: set text(font: ziti.heiti.get(), size: zihao.xiaosi, weight: "bold") 49 | 50 | show figure.where(kind: "subimage"): it => { 51 | if it.kind == "subimage" { 52 | let q = query(figure.where(outlined: true).before(it.location())).last() 53 | [ 54 | #figure( 55 | it.body, 56 | caption: it.counter.display("(a)") + if it.caption != none { " " + it.caption.body }, 57 | kind: it.kind + "_", 58 | supplement: it.supplement, 59 | outlined: it.outlined, 60 | numbering: "(a)", 61 | )#label(str(q.label) + ":" + str(it.label)) 62 | ] 63 | } 64 | } 65 | 66 | show figure.where(kind: "subimage_"): it => { 67 | let q = query(selector(figure).before(it.location())).last() 68 | if (q.kind == "image") { 69 | it.counter.update(0) 70 | } 71 | it 72 | } 73 | 74 | body 75 | } 76 | 77 | #let tablex( 78 | ..body, 79 | header: (), 80 | alignment: auto, 81 | column-gutter: auto, 82 | columns: auto, 83 | fill: none, 84 | gutter: auto, 85 | inset: 0% + 5pt, 86 | row-gutter: auto, 87 | rows: auto, 88 | stroke: 1pt + black, 89 | caption: auto, 90 | breakable: true, 91 | label-name: "", 92 | ) = context { 93 | set figure.caption(position: top) 94 | show table: set text(size: zihao.wuhao, weight: "regular") 95 | set table(stroke: none) 96 | let prefix = "tablex-none-label" 97 | let none-label = state(prefix, 0) 98 | let label-name = label-name 99 | if label-name == "" { 100 | let id = int(none-label.get()) 101 | label-name = str("~" + prefix + "-" + str(id)) 102 | none-label.update(id + 1) 103 | } 104 | let nxt = state("tablex" + label-name, false) 105 | let new-label = label(label-name) 106 | let head-label = label("tbl:" + label-name) 107 | [ 108 | #show figure: set block(breakable: breakable) 109 | #figure( 110 | table( 111 | columns: columns, 112 | align: alignment, 113 | table.header( 114 | table.cell( 115 | colspan: if type(columns) == int { columns } else { columns.len() }, 116 | { 117 | context if nxt.get() { 118 | set align(left) 119 | set text(font: ziti.heiti.get(), size: zihao.xiaosi, weight: "bold") 120 | [续#ref(head-label)] 121 | } else { 122 | v(-0.9em) 123 | nxt.update(true) 124 | } 125 | }, 126 | ), 127 | table.hline(), 128 | ..header, 129 | table.hline(stroke: 0.5pt), 130 | ), 131 | ..body, 132 | table.hline() 133 | ), 134 | caption: caption, 135 | kind: "table", 136 | supplement: [表], 137 | )#new-label 138 | ] 139 | } 140 | 141 | #let algox( 142 | content, 143 | caption: none, 144 | label-name: "", 145 | breakable: true, 146 | ) = context { 147 | let prefix = "algox-none-label" 148 | let none-label = state(prefix, 0) 149 | let label-name = label-name 150 | if label-name == "" { 151 | let id = int(none-label.get()) 152 | label-name = str("~" + prefix + "-" + str(id)) 153 | none-label.update(id + 1) 154 | } 155 | let new-label = label(label-name) 156 | let head-label = label("algo:" + label-name) 157 | let nxt = state("algox" + label-name, false) 158 | set par(leading: 23pt - 1em, spacing: 23pt - 1em) 159 | [ 160 | 161 | #figure( 162 | [], 163 | kind: "algorithm", 164 | supplement: [算法], 165 | )#new-label 166 | #v(-1.5em) 167 | ] 168 | set table(stroke: none) 169 | show figure: set block(breakable: breakable) 170 | 171 | figure( 172 | table( 173 | columns: 1fr, 174 | align: left, 175 | table.header( 176 | table.cell( 177 | colspan: 1, 178 | { 179 | context if nxt.get() { 180 | set align(left) 181 | set text(font: ziti.heiti.get(), size: zihao.xiaosi, weight: "bold") 182 | [续#ref(head-label)] 183 | } else { 184 | set align(left) 185 | set text(font: ziti.heiti.get(), size: zihao.xiaosi, weight: "bold") 186 | line(start: (-5pt, 0pt), length: 100% + 10pt) 187 | v(-0.5em) 188 | [ 189 | #set par(first-line-indent: 0em) 190 | #ref(head-label)#h(1em)#caption 191 | ] 192 | nxt.update(true) 193 | } 194 | }, 195 | ), 196 | table.hline(), 197 | ), 198 | content, 199 | table.hline() 200 | ), 201 | ) 202 | } 203 | 204 | #let subimagex( 205 | body, 206 | caption: none, 207 | label-name: "", 208 | ) = context { 209 | let prefix = "subimagex-none-label" 210 | let none-label = state(prefix, 0) 211 | let label-name = label-name 212 | if label-name == "" { 213 | let id = int(none-label.get()) 214 | label-name = str("~" + prefix + "-" + str(id)) 215 | none-label.update(id + 1) 216 | } 217 | let new-label = label(label-name) 218 | [ 219 | #figure( 220 | body, 221 | caption: caption, 222 | kind: "subimage", 223 | supplement: none, 224 | numbering: "(a)", 225 | outlined: false, 226 | )#new-label 227 | ] 228 | } 229 | 230 | #let imagex( 231 | ..body, 232 | caption: auto, 233 | columns: auto, 234 | label-name: "", 235 | placement: none, 236 | ) = context { 237 | let prefix = "imagex-none-label" 238 | let none-label = state(prefix, 0) 239 | let label-name = label-name 240 | if label-name == "" { 241 | let id = int(none-label.get()) 242 | label-name = str("~" + prefix + "-" + str(id)) 243 | none-label.update(id + 1) 244 | } 245 | let new-label = label(label-name) 246 | [ 247 | #figure( 248 | grid(..body, columns: columns, row-gutter: 1em), 249 | caption: caption, 250 | kind: "image", 251 | supplement: [图], 252 | placement: placement, 253 | )#new-label 254 | ] 255 | } 256 | -------------------------------------------------------------------------------- /style/font.typ: -------------------------------------------------------------------------------- 1 | #let zihao = ( 2 | chuhao: 42pt, 3 | xiaochu: 36pt, 4 | yihao: 26pt, 5 | xiaoyi: 24pt, 6 | erhao: 22pt, 7 | xiaoer: 18pt, 8 | sanhao: 16pt, 9 | xiaosan: 15pt, 10 | sihao: 14pt, 11 | zhongsi: 13pt, 12 | xiaosi: 12pt, 13 | wuhao: 10.5pt, 14 | xiaowu: 9pt, 15 | liuhao: 7.5pt, 16 | xiaoliu: 6.5pt, 17 | qihao: 5.5pt, 18 | xiaoqi: 5pt, 19 | ) 20 | 21 | #let ziti = ( 22 | // 宋体,属于「有衬线字体」,一般可以等同于英文中的 Serif Font 23 | // 这一行分别是「新罗马体(有衬线英文字体)」、「宋体(Windows)」、「宋体(MacOS)」、「华文宋体」 24 | songti: state( 25 | "songti", 26 | ( 27 | (name: "Times New Roman", covers: "latin-in-cjk"), 28 | "SimSun", 29 | "Songti SC", 30 | "STSongti", 31 | ), 32 | ), 33 | // 黑体,属于「无衬线字体」,一般可以等同于英文中的 Sans Serif Font 34 | // 这一行分别是「新罗马体(有衬线英文字体)」、「黑体(Windows)」、「黑体(MacOS)」、「华文黑体」 35 | heiti: state( 36 | "heiti", 37 | ( 38 | (name: "Times New Roman", covers: "latin-in-cjk"), 39 | "SimHei", 40 | "Heiti SC", 41 | "STHeiti", 42 | ), 43 | ), 44 | // 楷体 45 | // 这一行分别是「新罗马体(有衬线英文字体)」、「锴体(Windows)」、「楷体(MacOS)」、「华文黑体」、「方正楷体」 46 | kaiti: state( 47 | "kaiti", 48 | ( 49 | (name: "Times New Roman", covers: "latin-in-cjk"), 50 | "KaiTi", 51 | "Kaiti SC", 52 | "STKaiti", 53 | "KaiTi_GB2312", 54 | ), 55 | ), 56 | // 仿宋 57 | // 这一行分别是「新罗马体(有衬线英文字体)」、「方正仿宋」、「仿宋(Windows)」、「仿宋(MacOS)」、「华文仿宋」 58 | fangsong: state( 59 | "fangsong", 60 | ( 61 | (name: "Times New Roman", covers: "latin-in-cjk"), 62 | "FangSong_GB2312", 63 | "FangSong", 64 | "FangSong SC", 65 | "STFangSong", 66 | ), 67 | ), 68 | // 等宽字体,用于代码块环境,一般可以等同于英文中的 Monospaced Font 69 | // 这一行分别是「Courier New(等宽英文字体)」、「Menlo(MacOS 等宽英文字体)」、「黑体(Windows)」、「黑体(MacOS)」、「华文黑体」 70 | dengkuan: state( 71 | "dengkuan", 72 | ( 73 | (name: "Courier New", covers: "latin-in-cjk"), 74 | (name: "Menlo", covers: "latin-in-cjk"), 75 | "SimHei", 76 | "Heiti SC", 77 | "STHeiti", 78 | ), 79 | ), 80 | ) 81 | -------------------------------------------------------------------------------- /style/heading.typ: -------------------------------------------------------------------------------- 1 | #import "font.typ": ziti, zihao 2 | #import "@preview/numbly:0.1.0": numbly 3 | 4 | #let none-heading(body) = { 5 | show heading.where(level: 1): set align(center) 6 | set heading( 7 | numbering: none, 8 | supplement: none, 9 | ) 10 | show heading.where(level: 1): it => { 11 | set text( 12 | font: ziti.heiti.get(), 13 | weight: "regular", 14 | size: zihao.xiaoer, 15 | ) 16 | v(15pt) 17 | it.body 18 | v(15pt) 19 | } 20 | pagebreak(weak: true) 21 | body 22 | } 23 | 24 | #let main-heading( 25 | body, 26 | ) = { 27 | set heading( 28 | numbering: numbly( 29 | "{1}", 30 | "{1}.{2}", 31 | "{1}.{2}.{3}", 32 | "{1}.{2}.{3}.{4}", 33 | ), 34 | supplement: "正文", 35 | ) 36 | show heading: it => { 37 | set text(font: ziti.heiti.get()) 38 | set par(first-line-indent: 0em, spacing: 0em) 39 | if it.level == 1 { 40 | set align(center) 41 | set text(weight: "bold", size: zihao.xiaoer, stroke: 0.4pt) 42 | pagebreak(weak: true) 43 | v(15pt) 44 | counter(heading).display() + h(0.5em) + it.body 45 | v(15pt) 46 | } else if it.level == 2 { 47 | set text(weight: "regular", size: zihao.sihao) 48 | v(0.8em) 49 | counter(heading).display() + h(0.5em) + it.body 50 | v(0.8em) 51 | } else { 52 | set text(weight: "regular", size: zihao.xiaosi) 53 | v(0.5em) 54 | counter(heading).display() + h(0.5em) + it.body 55 | } 56 | } 57 | body 58 | } 59 | 60 | #let appendix-first-heading( 61 | body, 62 | ) = { 63 | set heading( 64 | numbering: numbly( 65 | "附录{1:A} ", 66 | "附{1:A}{2} ", 67 | "附{1:A}{2}.{3} ", 68 | "附{1:A}{2}.{3}.{4} ", 69 | ), 70 | supplement: none, 71 | ) 72 | counter(heading).update(0) 73 | show heading.where(level: 1): set align(center) 74 | show heading: it => { 75 | set text(font: ziti.heiti.get()) 76 | set par(first-line-indent: 0em, spacing: 0em) 77 | if it.level == 1 { 78 | set text(weight: "bold", size: zihao.xiaoer) 79 | pagebreak(weak: true) 80 | v(15pt) 81 | counter(heading).display() + h(0.5em) + it.body 82 | v(15pt) 83 | } else if it.level == 2 { 84 | set text(weight: "regular", size: zihao.sihao) 85 | v(0.8em) 86 | counter(heading).display() + h(0.5em) + it.body 87 | v(0.8em) 88 | } else { 89 | set text(weight: "regular", size: zihao.xiaosi) 90 | v(0.5em) 91 | counter(heading).display() + h(0.5em) + it.body 92 | } 93 | } 94 | body 95 | } 96 | -------------------------------------------------------------------------------- /style/uline.typ: -------------------------------------------------------------------------------- 1 | #let uline(width, body) = box( 2 | align(center)[#body], 3 | width: width, 4 | stroke: (bottom: 0.5pt), 5 | outset: (bottom: 3pt), 6 | ) 7 | -------------------------------------------------------------------------------- /template/data/heros.csv: -------------------------------------------------------------------------------- 1 | 2 | eruid,description 3 | batman,uses technology 4 | superman,flies through the air 5 | spiderman,uses a web 6 | ghostrider, rides a motorcycle -------------------------------------------------------------------------------- /template/data/nyuv2.csv: -------------------------------------------------------------------------------- 1 | Method,IoU,ceiling,floor,wall,window,chair,bed,sofa,table,tvs,furniture,objects,mIoU 2 | LMSCNet,33.93,\,88.41,4.63,0.25,3.94,32.03,15.44,6.57,0.02,14.51,4.39,15.88 3 | AICNet,30.03,7.58,82.97,9.15,0.05,6.93,35.87,22.92,11.11,0.71,15.90,6.45,18.15 4 | 3DSketch,38.64,8.53,90.45,9.94,5.67,10.64,42.29,29.21,13.88,9.38,23.83,8.19,22.91 5 | MonoScene,42.51,8.89,93.50,12.06,12.57,13.72,48.19,36.11,15.13,15.22,27.96,12.94,26.94 6 | NDC-Scene,44.17,12.02,93.51,13.11,13.77,15.83,49.57,39.87,17.17,24.57,31.00,14.96,29.03 7 | ISO,47.11,14.21,93.47,15.89,15.14,18.35,50.01,40.82,18.25,25.90,34.08,17.67,31.25 8 | -------------------------------------------------------------------------------- /template/figures/cetz.typ: -------------------------------------------------------------------------------- 1 | #import "@preview/cetz:0.3.4": canvas, draw 2 | 3 | #let camera_model(size) = { 4 | set text(1em * size) 5 | import draw: * 6 | canvas( 7 | length: 5em, 8 | { 9 | set-style(stroke: 0.1em) 10 | ortho( 11 | x: 180deg + 35.26deg, 12 | y: 225deg, 13 | z: 0deg, 14 | sorted: false, 15 | { 16 | on-xy({ 17 | rect((-2, 1), (2, -1), stroke: blue) 18 | let o = (0, 0) 19 | circle(o, radius: 0.2, stroke: blue) 20 | line(o, (2.5, 0), mark: (end: "stealth")) 21 | content((), $x$, anchor: "east") 22 | line(o, (0, 1.5), mark: (end: "stealth")) 23 | content((), $y$, anchor: "west") 24 | 25 | content((-0.6, 0), [光心$O$], angle: 30deg) 26 | content((0, -1.2), [相机], angle: 30deg) 27 | }) 28 | 29 | on-xy( 30 | { 31 | rect((-2.1, 1.1), (2.1, -1.1), stroke: blue) 32 | rect((0.6, 0.6), (-0.6, -0.6), stroke: 0em, fill: gray) 33 | for i in range(13) { 34 | line((-1.5, 0.6 - 0.1 * i), (1.5, 0.6 - 0.1 * i), stroke: blue + 0.03em) 35 | line((0.6 - 0.1 * i, 0.8), (0.6 - 0.1 * i, -0.8), stroke: blue + 0.03em) 36 | } 37 | let o = (0, 0) 38 | line(o, (3, 0), mark: (end: "stealth")) 39 | content((), $x'$, anchor: "east") 40 | line(o, (0, 1.5), mark: (end: "stealth")) 41 | content((), $y'$, anchor: "west") 42 | 43 | content((-0.2, 0), $O'$, angle: 30deg) 44 | content((0, -1.3), [物理成像平面], angle: 30deg) 45 | content((0, -0.8), [像素平面], angle: 30deg) 46 | }, 47 | z: -3, 48 | ) 49 | line((0, 0, 0), (0, 0, 4), mark: (end: "stealth")) 50 | content((), $z$, anchor: "west") 51 | line((0, 0, 0), (0, 0, -3), stroke: (dash: "dashed")) 52 | content(((0, 0, 0), 50%, (0, 0, -3)), [焦距$f$], angle: -30deg, anchor: "north-west") 53 | 54 | line((-0.6, 0.1, 3), (0, 0, 0), (0.6, 0.1, -3), stroke: red) 55 | circle((0.6, 0.1, -3), radius: 0.05, stroke: red, fill: red) 56 | content((0.6, 0.3, -3), $P'$) 57 | circle((-0.6, 0.1, 3), radius: 0.05, stroke: red, fill: red) 58 | content((-0.6, 0.3, 3), $P$) 59 | }, 60 | ) 61 | }, 62 | ) 63 | } -------------------------------------------------------------------------------- /template/figures/energy-distribution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/template/figures/energy-distribution.png -------------------------------------------------------------------------------- /template/figures/fletcher.typ: -------------------------------------------------------------------------------- 1 | #import "@preview/fletcher:0.5.8" as fletcher: diagram, node, edge 2 | #import fletcher.shapes: rect 3 | 4 | #let resnet_block(size) = { 5 | set text(1em * size) 6 | diagram( 7 | node-stroke: 0.05em, 8 | node((0, 0.2)), 9 | edge("-|>", [$x$]), 10 | node((0, 1), [weight layer], shape: rect, corner-radius: 0.3em), 11 | edge("-|>", [Relu]), 12 | node((0, 2), [weight layer], shape: rect, corner-radius: 0.3em), 13 | edge("-|>"), 14 | node((0, 2.65), [+], radius: 0.5em, inset: 0em), 15 | edge((0, 3), "-|>", [Relu]), 16 | edge((0, 0.5), "r,d,d", (1, 2.65), (0, 2.65), "-|>"), 17 | 18 | node((-0.7, 1.5), [$f(x)$], stroke: none), 19 | node((-0.7, 2.65), [$f(x)+x$], stroke: none), 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /template/figures/sign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/template/figures/sign.png -------------------------------------------------------------------------------- /template/ref.bib: -------------------------------------------------------------------------------- 1 | @misc{liu_survey_2024, 2 | title = {A {Survey} of {NL2SQL} with {Large} {Language} {Models}: {Where} are we, and where are we going?}, 3 | shorttitle = {A {Survey} of {NL2SQL} with {Large} {Language} {Models}}, 4 | url = {http://arxiv.org/abs/2408.05109}, 5 | doi = {10.48550/arXiv.2408.05109}, 6 | abstract = {Translating users' natural language queries (NL) into SQL queries (i.e., NL2SQL) can significantly reduce barriers to accessing relational databases and support various commercial applications. The performance of NL2SQL has been greatly enhanced with the emergence of Large Language Models (LLMs). In this survey, we provide a comprehensive review of NL2SQL techniques powered by LLMs, covering its entire lifecycle from the following four aspects: (1) Model: NL2SQL translation techniques that tackle not only NL ambiguity and under-specification, but also properly map NL with database schema and instances; (2) Data: From the collection of training data, data synthesis due to training data scarcity, to NL2SQL benchmarks; (3) Evaluation: Evaluating NL2SQL methods from multiple angles using different metrics and granularities; and (4) Error Analysis: analyzing NL2SQL errors to find the root cause and guiding NL2SQL models to evolve. Moreover, we provide a rule of thumb for developing NL2SQL solutions. Finally, we discuss the research challenges and open problems of NL2SQL in the LLMs era.}, 7 | language = {en-US}, 8 | urldate = {2024-09-04}, 9 | publisher = {arXiv}, 10 | author = {Liu, Xinyu and Shen, Shuyu and Li, Boyan and Ma, Peixian and Jiang, Runzhi and Luo, Yuyu and Zhang, Yuxin and Fan, Ju and Li, Guoliang and Tang, Nan}, 11 | month = aug, 12 | year = {2024}, 13 | note = {arXiv:2408.05109 [cs] 14 | TLDR: A comprehensive review of NL2SQL techniques powered by LLMs, covering its entire lifecycle from the following four aspects: model, data, evaluation, research challenges and open problems of NL2SQL in the LLMs era, and a rule of thumb for developing NL2SQL solutions.}, 15 | keywords = {Computer Science - Databases}, 16 | file = {arXiv Fulltext PDF:/Users/tangzhihao/Zotero/storage/RJZJHCXX/Liu 等 - 2024 - A Survey of NL2SQL with Large Language Models Where are we, and where are we going.pdf:application/pdf;arXiv.org Snapshot:/Users/tangzhihao/Zotero/storage/43RPL8N6/2408.html:text/html}, 17 | } 18 | 19 | 20 | @misc{pourreza_dts-sql_2024, 21 | title = {{DTS}-{SQL}: {Decomposed} {Text}-to-{SQL} with {Small} {Large} {Language} {Models}}, 22 | shorttitle = {{DTS}-{SQL}}, 23 | url = {http://arxiv.org/abs/2402.01117}, 24 | doi = {10.48550/arXiv.2402.01117}, 25 | abstract = {Leading models for the text-to-SQL task heavily rely on proprietary Large Language Models (LLMs), posing concerns over data privacy. Closing the performance gap between small open-source models and large proprietary models is crucial to mitigate this reliance. To this end, we introduce a novel two-stage fine-tuning approach that decomposes the task into two simpler tasks. Through comprehensive evaluation on two large cross-domain datasets and two small LLMs, we show that this approach improves execution accuracy by 3 to 7 percent, effectively aligning the performance of open-source models with their proprietary counterparts.}, 26 | language = {en-US}, 27 | urldate = {2024-03-21}, 28 | publisher = {arXiv}, 29 | author = {Pourreza, Mohammadreza and Rafiei, Davood}, 30 | month = feb, 31 | year = {2024}, 32 | note = {arXiv:2402.01117 [cs] 33 | TLDR: A novel two-stage fine-tuning approach is introduced that decomposes the text-to-SQL task into two simpler tasks and improves execution accuracy by 3 to 7 percent, effectively aligning the performance of open-source models with their proprietary counterparts.}, 34 | keywords = {Computer Science - Computation and Language, Computer Science - Databases, Computer Science - Human-Computer Interaction}, 35 | file = {arXiv Fulltext PDF:/Users/tangzhihao/Zotero/storage/4Z7LYHWA/Pourreza和Rafiei - 2024 - DTS-SQL Decomposed Text-to-SQL with Small Large Language Models.pdf:application/pdf;arXiv.org Snapshot:/Users/tangzhihao/Zotero/storage/22LH2UT6/2402.html:text/html}, 36 | } 37 | 38 | @book{test, 39 | author = {测试作者1 and 测试作者2 and 测试作者3 and 测试作者4}, 40 | title = {测试书籍}, 41 | year = {2021}, 42 | publisher = {测试出版社}, 43 | edition = {1}, 44 | } 45 | 46 | -------------------------------------------------------------------------------- /template/thesis.typ: -------------------------------------------------------------------------------- 1 | #import "../lib.typ": documentclass, algox, tablex, citex, imagex, subimagex 2 | 3 | #let ( 4 | info, 5 | doc, 6 | cover, 7 | declare, 8 | appendix, 9 | outline, 10 | mainmatter, 11 | conclusion, 12 | abstract, 13 | bib, 14 | acknowledgement, 15 | under-cover, 16 | fonts, 17 | ) = documentclass( 18 | info: ( 19 | title: "基于Typst的上海大学毕业论文模板", 20 | school: "计算机工程与科学", 21 | major: "计算机科学与技术", 22 | student_id: "21123456", 23 | name: "张三", 24 | supervisor: "李四教授", 25 | date: "2048年2月31日起5月32日止", 26 | ), 27 | fonts: ( 28 | fallback: false, // 为true时字体缺失时使用系统默认,不显示豆腐块 29 | // 模版内置了一定的字体调用顺序,但可能与系统的不一致,出现这种情况是先在Tinyminst->Tool->Fonts的字体库中找到字体名称,然后在下面填入即可 30 | // 可以配置的字体有:songti, heiti, kaiti, fangsong, dengkuan 31 | // 正文为songti,标题为heiti,代码为dengkuan 32 | // 下面是使用示例: 33 | songti: ( 34 | (name: "Times New Roman", covers: "latin-in-cjk"), // 先指定英文字体 35 | "簡宋", // 中文字体 36 | ), 37 | ), 38 | title-line-length: 260pt, // 如果题目换行不好看,可以在这里适当修改换行的长度 39 | math-level: 2, // 选择公式编号层级 40 | outline-compact: false, // true目录是紧凑的形式;false按照学校的方式 41 | citation: ( 42 | func: bibliography("ref.bib"), // 参考文献源文件,主流的论文网站(谷歌学术,知网等)都会提供bibtex格式的参考文献 43 | full: false, // false表示只显示已引用的文献,不显示未引用的文献;true表示显示所有文献 44 | sup: true, // true表示行内标注默认为上角标;false表示行内标注默认占据整行 45 | ), 46 | ) 47 | 48 | // 设置文档格式 49 | #fonts 50 | #show: doc 51 | 52 | // 显示封面 53 | #cover() 54 | 55 | // 显示声明 56 | #declare( 57 | author_sign: image("figures/sign.png"), // 学生签名 58 | supervisor_sign: image("figures/sign.png"), // 教师签名 59 | date: none, // 日期为空则默认为当天 60 | ) 61 | 62 | #abstract( 63 | keywords: ("学位论文", "论文格式", "规范化", "模板"), 64 | keywords-en: ("dissertation", "dissertation format", "standardization", "template"), 65 | )[ 66 | 摘要的内容需作者简要介绍本论文的主要内容主要为本人所完成的工作和创新点。 67 | 68 | …… 69 | 70 | (注:标题黑体小二号,正文宋体小四,行距20磅) 71 | ][ 72 | The content of the abstract requires the author to briefly introduce the main content of this paper, mainly for my work and innovation. 73 | 74 | ……. 75 | 76 | (Times New Roman,小四号,行距20磅) 77 | ] 78 | 79 | // 显示目录 80 | #outline() 81 | 82 | // 设置文档主体的格式 83 | #show: mainmatter 84 | 85 | = 章节一 86 | 87 | == 引言 88 | 89 | 学位论文...... 90 | 91 | === 三级标题 92 | 93 | ...... 94 | 95 | ==== 四级标题 96 | 97 | ...... 98 | 99 | == 本文研究主要内容 100 | 101 | 本文...... 102 | 103 | == 本文研究意义 104 | 105 | 本文...... 106 | 107 | == 本章小结 108 | 109 | 本文...... 110 | 111 | = 格式要求 112 | 113 | 114 | 正文各章节应拟标题,每章结束后应另起一页。标题要简明扼要,不应使用标点符号。各章、节、条的层次,可以按照“1……、1.1……、1.1.1……”标识,条以下具体款项的层次依次按照“1.1.1.1”或“(1)”、“①”等标识。各学院根据实际情况,可自行规定层次格式,但学院之内建议格式统一,以清晰无误为准。 115 | 116 | 正文是毕业论文的主体和核心部分,不同学科专业和不同的选题可以有不同的写作方式。正文一般包括以下几个方面。 117 | 118 | == 引言或背景 119 | 引言是论文正文的开端,引言应包括毕业论文选题的背景、目的和意义;对国内外研究现状和相关领域中已有的研究成果的简要评述;介绍本项研究工作研究设想、研究方法或实验设计、理论依据或实验基础;涉及范围和预期结果等。要求言简意赅,注意不要与摘要雷同或成为摘要的注解。 120 | 121 | == 主体 122 | 论文主体是毕业论文的主要部分,必须言之成理,论据可靠,严格遵循本学科国际通行的学术规范。在写作上要注意结构合理、层次分明、重点突出,章节标题、公式图表符号必须规范统一。论文主体的内容根据不同学科有不同的特点,一般应包括以下几个方面: 123 | + 毕业设计(论文)总体方案或选题的论证; 124 | + 毕业设计(论文)各部分的设计实现,包括实验数据的获取、数据可行性及有效性的处理与分析、各部分的设计计算等; 125 | + 对研究内容及成果的客观阐述,包括理论依据、创新见解、创造性成果及其改进与实际应用价值等; 126 | + 论文主体的所有数据必须真实可靠,自然科学论文应推理正确、结论清晰;人文和社会学科的论文应把握论点正确、论证充分、论据可靠,恰当运用系统分析和比较研究的方法进行模型或方案设计,注重实证研究和案例分析,根据分析结果提出建议和改进措施等。 127 | 128 | == 结论 129 | 结论是毕业论文的总结,是整篇论文的归宿。应精炼、准确、完整。着重阐述自己的创造性成果及其在本研究领域中的意义、作用,还可进一步提出需要讨论的问题和建议。 130 | 131 | = 图表格式 132 | 133 | == 图格式 134 | === 单张图片 135 | #imagex( 136 | image("figures/energy-distribution.png", width: 70%), 137 | caption: [示例图片], 138 | label-name: "image1", 139 | placement: none, // 默认 none, 即图片会强制显示在当前位置; 还可以设置为 auto, top, bottom, 分别表示自动、顶部、底部 (推荐使用 auto) 140 | ) 141 | 142 | === 多个子图 143 | #imagex( 144 | subimagex( 145 | image("figures/energy-distribution.png", width: 70%), 146 | caption: "子图a", 147 | label-name: "sub1", 148 | ), 149 | subimagex(image("figures/energy-distribution.png", width: 70%)), 150 | subimagex(image("figures/energy-distribution.png", width: 70%)), 151 | subimagex(image("figures/energy-distribution.png", width: 70%)), 152 | columns: 2, 153 | caption: [示例子图], 154 | label-name: "image2", 155 | placement: none, // 默认 none, 即图片会强制显示在当前位置; 还可以设置为 auto, top, bottom, 分别表示自动、顶部、底部 (推荐使用 auto) 156 | ) 157 | 158 | #pagebreak() 159 | 160 | == 表格格式 161 | 162 | 表格可以在换页的时候自然断开并显示“续表xxxx”,如果需要令表显示在整页中,请将表中的`breakable`设置为`false`。 163 | 164 | #tablex( 165 | ..for i in range(5) { 166 | ([250], [88], [5900], [1.65]) 167 | }, 168 | header: ( 169 | [感应频率 #linebreak() (kHz)], 170 | [感应发生器功率 #linebreak() (%×80kW)], 171 | [工件移动速度 #linebreak() (mm/min)], 172 | [感应圈与零件间隙 #linebreak() (mm)], 173 | ), 174 | columns: (1fr, 1fr, 1fr, 1fr), 175 | caption: [示例表格], 176 | label-name: "table1", 177 | breakable: true, 178 | ) 179 | 180 | == 公式格式 181 | 182 | $ 1 / mu nabla^2 Alpha - j omega sigma Alpha - nabla(1 / mu) times (nabla times Alpha) + J_0 = 0 $ 183 | 184 | #h(-2em)其中$mu$是材料的磁导率,$sigma$是材料的电导率,$omega$是电磁波的角频率,$Alpha$是电磁场的矢量位,$J_0$是电流密度。使用```typst #h(-2em)```取消这一行前面的缩进。 185 | 186 | #pagebreak() 187 | 188 | == 算法格式 189 | 算法和表格一样也是换页的时候自然断开并显示“续算法xxxx”。 190 | #[ 191 | #import "@preview/lovelace:0.2.0": * 192 | #algox( 193 | label-name: "algorithm", 194 | caption: [欧几里得辗转相除], 195 | breakable: true, 196 | pseudocode( 197 | no-number, 198 | [#h(-1.25em) *input:* integers $a$ and $b$], 199 | no-number, 200 | [#h(-1.25em) *output:* greatest common divisor of $a$ and $b$], 201 | [*while* $a != b$ *do*], 202 | ind, 203 | [*if* $a > b$ *then*], 204 | ind, 205 | $a <- a - b$, 206 | ded, 207 | [*else*], 208 | ind, 209 | $b <- b - a$, 210 | ded, 211 | [*end*], 212 | ded, 213 | [*end*], 214 | [*return* $a$], 215 | ), 216 | ) 217 | ] 218 | 219 | 也可以直接插入代码: 220 | #algox( 221 | caption: [欧几里得辗转相除C++实现], 222 | [ 223 | ```cpp 224 | #include 225 | using namespace std; 226 | int gcd(int a, int b) { 227 | while (a != b) { 228 | if (a > b) a -= b; 229 | else b -= a; 230 | } 231 | return a; 232 | } 233 | ``` 234 | ], 235 | ) 236 | 237 | = 引用格式 238 | 239 | == 常规引用 240 | 241 | #tablex( 242 | header: ( 243 | [引用对象], 244 | [效果], 245 | [原始代码], 246 | ), 247 | [表格], 248 | [我要引用@tbl:table1], 249 | [```typst 我要引用@tbl:table```], 250 | table.cell( 251 | rowspan: 2, 252 | align: horizon, 253 | )[图片], 254 | [我要引用@img:image1], 255 | [```typst 我要引用@img:image1```], 256 | [我要引用@img:image2:sub1], 257 | [```typst 我要引用@img:subfigures1:test```], 258 | [算法], 259 | [我要引用@algo:algorithm], 260 | [```typst 我要引用@algo:algorithm```], 261 | [公式], 262 | [我要引用@eqt:equation], 263 | [```typst 我要引用@eqt:equation```], 264 | columns: (1fr, 1fr, 1fr), 265 | caption: [常规引用示例表], 266 | ) 267 | 268 | 另一种函数引用方法: ```typst #ref()``` 269 | 270 | == 章节引用 271 | 272 | 我要引用@main_test:```typst 我要引用@main_test ``` 273 | 274 | 我要引用#ref():```typst 我要引用#ref()``` 275 | 276 | == 页面引用 277 | 请注意#ref(, form: "page") 的```typst #bib```函数,它会因为`citation.full`参数变化而发生变化。 278 | 279 | #pagebreak() 280 | 281 | == 文献引用 282 | 283 | #tablex( 284 | header: ( 285 | [引用对象], 286 | [效果], 287 | [原始代码], 288 | ), 289 | [句子末尾引用], 290 | [Typst很厉害@liu_survey_2024], 291 | [```typst Typst很厉害@liu_survey_2024```], 292 | 293 | [句子末尾引用], 294 | [Typst很厉害#citex()], 295 | [```typst Typst很厉害#citex()```], 296 | 297 | [句子内部引用], 298 | [文献#citex(, sup: false)说Typst很厉害], 299 | text(0.7em)[```typst 文献#citex(,sup:false) 说Typst很厉害```], 300 | 301 | table.hline(stroke: 0.2pt), 302 | 303 | [用别的格式的引用(自行查阅参数)], 304 | [#citex(, style: "future-science", form: "prose")\ 这些人说的], 305 | text(0.8em)[```typst #citex(,style: "future-science", form:"prose") 306 | \ 这些人说的```], 307 | 308 | alignment: left + horizon, 309 | columns: (1fr, 1.5fr, 2fr), 310 | caption: [文献引用示例表], 311 | label-name: "table2", 312 | ) 313 | 314 | 当`citation`中的`sup`为`true`的时候,所有的不标注`sup`的引用默认不为右上标;当`citation`中的`sup`为`true`的时候,所有的不标注`sup`的引用默认为右上标。 315 | 316 | 使用别的格式时`sup`失效。 317 | 318 | = 高级格式 319 | 320 | == 数据表格 321 | 322 | 无论是LaTex还是Word,将大量的数据制作成表格往往是一个非常复杂的过程。更何况这些实验数据日后可能还会变更,那么又要对表格的部分内容进行调整(比如加粗数据最大的那一项),这里给出一个制作数据表格的快捷方法,大致的流程是: 323 | + 将数据保存为CSV格式(Excel等均支持该格式); 324 | + 使用Typst读取; 325 | + 排版并处理数据。 326 | #ref()是一个简单的例子: 327 | 328 | #{ 329 | // 读取文件,分隔符可以为分号 330 | let result = csv("data/heros.csv", delimiter: ",") 331 | 332 | // 获取列数 333 | let m = result.at(0).len() 334 | 335 | // 获取表头 336 | let head = result.at(0) 337 | 338 | // 获取数据部分 339 | let data = result.slice(1) 340 | 341 | tablex( 342 | ..data.flatten(), // 将数据展平 343 | header: head, // 显示表头 344 | columns: m, // 设置列数 345 | caption: [超级英雄能力表], 346 | label-name: "data1", 347 | ) 348 | } 349 | 350 | #ref()是一个更复杂的例子: 351 | 352 | #let colors = ( 353 | rgb(214, 38, 40, 255), 354 | rgb(43, 160, 43, 255), 355 | rgb(158, 216, 229, 255), 356 | rgb(114, 158, 206, 255), 357 | rgb(204, 204, 91, 255), 358 | rgb(255, 186, 119, 255), 359 | rgb(147, 102, 188, 255), 360 | rgb(30, 119, 181, 255), 361 | rgb(188, 188, 33, 255), 362 | rgb(255, 127, 12, 255), 363 | rgb(196, 175, 214, 255), 364 | ) 365 | 366 | #{ 367 | let results = csv("data/nyuv2.csv", delimiter: ",") 368 | let m = results.at(0).len() 369 | let head = results.at(0) 370 | 371 | // 将中间的标签旋转90度 372 | for y in range(m - 3) { 373 | head.at(y + 2) = rotate( 374 | 90deg, 375 | stack(dir: ltr, box(fill: colors.at(y), inset: 4pt), head.at(y + 2)), 376 | reflow: true, 377 | ) 378 | } 379 | let data = results.slice(1) 380 | 381 | // 将数据中的最大项找出并加粗 382 | for y in range(1, m) { 383 | // 去除非数据元素 384 | let col_num = data.map(row => row.at(y)).filter(it => it.contains(regex("\d"))) 385 | 386 | // 找出最大值 387 | let max_val = col_num.map(float).reduce(calc.max) 388 | 389 | // 加粗最大值 390 | data = data.map(row => { 391 | let item = row.at(y) 392 | if item.contains(regex("\d")) and float(item) == max_val { 393 | row.at(y) = [#strong(item)] 394 | } 395 | row 396 | }) 397 | } 398 | tablex( 399 | table.vline(x: 2, stroke: 0.2pt), 400 | table.vline(x: m - 1, stroke: 0.2pt), 401 | ..data.flatten(), 402 | header: head, 403 | columns: (15%, 7%, ..(auto,) * 11, 8%), 404 | caption: [主流模型在NYUv2数据集下的性能表现], 405 | label-name: "data2", 406 | ) 407 | } 408 | #pagebreak() 409 | 410 | == 流程图绘制 411 | 412 | 使用#link("https://typst.app/universe/package/fletcher", underline([Fletcher]))可以绘制流程图,点击横线处链接查看使用文档。 413 | 414 | #import "figures/fletcher.typ" 415 | #imagex( 416 | fletcher.resnet_block(100%), 417 | caption: [残差块], 418 | label-name: "residual", 419 | ) 420 | 421 | == 复杂图形绘制 422 | 423 | Fletcher是基于#link("https://typst.app/universe/package/cetz", underline([CeTZ]))的,CeTZ可以绘制更复杂的图形,点击横线处链接查看使用文档。 424 | 425 | #import "figures/cetz.typ" 426 | #imagex( 427 | cetz.camera_model(70%), 428 | caption: [相机针孔成像模型], 429 | label-name: "camera_model", 430 | ) 431 | #pagebreak() 432 | 433 | == LaTex公式 434 | 如果你不习惯Typst的公式,可以使用#link("https://typst.app/universe/package/mitex", underline([MiTex])),点击横线处链接查看使用文档。 435 | 436 | #import "@preview/mitex:0.2.5": * 437 | 438 | 行内公式如下:#mi("x") 或 #mi[y]。 439 | 440 | 块级公式如#ref(): 441 | #mitex(` 442 | \newcommand{\f}[2]{#1f(#2)} 443 | \f\relax{x} = \int_{-\infty}^\infty 444 | \f\hat\xi\,e^{2 \pi i \xi x} 445 | \,d\xi 446 | `) 447 | 448 | // 显示结论 449 | #conclusion[ 450 | 结论是毕业论文的总结,是整篇论文的归宿。应精炼、准确、完整。着重阐述自己的创造性成果及其在本研究领域中的意义、作用,还可进一步提出需要讨论的问题和建议。 451 | ] 452 | 453 | // 显示参考文献 454 | #bib() 455 | 456 | 457 | 458 | // 设置附录文档格式 459 | #show: appendix 460 | 461 | = 附录格式 462 | 463 | 464 | 论文附录依次用大写字母“附录A、附录B、附录C……”表示,附录内的分级序号可采用“附A1、附A1.1、附A1.1.1”等表示,图、表、公式均依此类推为“图A1、表A1、式(A1)”等。包含以下内容: 465 | 466 | (1)代码、图表、标准、手册等数据; 467 | 468 | (2)未发表过的一手文献; 469 | 470 | (3)公式推导与证明、调查表等; 471 | 472 | (4)辅助性教学工具或表格; 473 | 474 | (5)其他需要展示或说明的内容 475 | 476 | …… 477 | 478 | (标题黑体小二号,内容Times New Roman/宋体,小四号,行距20磅) 479 | 480 | // 显示感谢 481 | #acknowledgement( 482 | location: "上海大学", 483 | date: none, // 日期为空则默认为当天 484 | )[ 485 | 表达真情实感即可。 486 | 487 | (致谢部分切勿照搬,本部分内容也在论文查重范围之内) 488 | 489 | (格式:宋体,Times New Roman小四号字,两边对齐,首行缩进2个字符,行距23磅,字符间距为“标准”) 490 | 491 | ] 492 | 493 | // 显示封底 494 | #under-cover() 495 | -------------------------------------------------------------------------------- /thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuosc/SHU-Bachelor-Thesis-Typst/8b8406f4e9766724231f1ab0938e5c56cd917253/thumbnail.png -------------------------------------------------------------------------------- /typst.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "shuosc-shu-bachelor-thesis" 3 | version = "0.3.0" 4 | entrypoint = "lib.typ" 5 | authors = ["shuosc"] 6 | license = "Apache-2.0" 7 | description = "上海大学本科生毕业论文 Typst 模板 - 上海大学开源社区版 (SHUOSC)" 8 | repository = "https://github.com/shuosc/SHU-Bachelor-Thesis-Typst" 9 | keywords = ["Shanghai University", "Bachelor", "Thesis"] 10 | categories = ["thesis"] 11 | exclude = [] 12 | 13 | [template] 14 | path = "template" 15 | entrypoint = "thesis.typ" 16 | thumbnail = "thumbnail.png" 17 | --------------------------------------------------------------------------------