1313
1414 例:改进` ref.bib ` 中的示例,在 ` main.tex ` 中补充注释。
1515
16- - 修改 ` bithesis.dtx ` 文件
16+ - 修改 ` bithesis* .dtx ` 文件
1717
1818 例:添加新命令,更改 ` \BITSetup ` 选项。
1919
2020- 修改其他文件。
2121
2222> [ !TIP]
2323>
24- > 运行 Makefile 需要 [ 安装 fd] ( https://github.com/sharkdp/fd/#installation ) ,通常下载可执行文件即可。此外 Windows 开发者若遇到问题,请参考[ 后文] ( #Windows ) 。
24+ > 运行 justfile(及 Makefile)需要安装 [ just ] ( https://just.systems/man/en/pre-built-binaries.html ) 和 [ fd] ( https://github.com/sharkdp/fd/#installation ) ,通常下载可执行文件即可。此外 Windows 开发者若遇到问题,请参考[ 后文] ( #Windows ) 。
2525
2626### 修改 ` templates/ ` 中某个模板
2727
2828如果改动仅仅涉及某个模板,那么相对简单一些:
2929
30- 1 . 初次开发前,运行 ` make copy` ,这会生成 ` *.cls ` 等并更新到 ` templates/ ` 下。
30+ 1 . 初次开发前,运行 ` just copy` ,这会生成 ` *.cls ` 等并更新到 ` templates/ ` 下。
31312 . 编辑模板。
32323 . 测试,确保你的改动能够正确编译;并且不会影响到其他效果。
3333
34- ### 修改 ` bithesis.dtx ` 文件
34+ ### 修改 ` bithesis* .dtx ` 文件
3535
36- 1 . 编辑 ` bithesis.dtx ` 。
37- 2 . 运行 ` make copy` ,这会生成新的 ` *.cls ` 并更新到 ` templates/ ` 下。
38- 3 . 更新文档(` bithesis-doc.tex ` 以及 ` bithesis.dtx ` 中的注释),然后运行 ` make doc` 编译出手册` bithesis.pdf ` 。
36+ 1 . 编辑 ` src/ bithesis* .dtx` 。
37+ 2 . 运行 ` just copy` ,这会生成新的 ` *.cls ` 并更新到 ` templates/ ` 下。
38+ 3 . 更新文档(` src/ bithesis-doc.tex` 以及 ` src/ bithesis* .dtx` 中的注释),然后运行 ` just doc` 编译出手册` src/ bithesis.pdf` 。
39394 . 测试,确保你的改动不会影响到其他功能。
4040
4141> [ !TIP]
4242>
43- > 如果要添加新命令,可以先在 ` templates/ ` 中具体实现,再拷贝到 ` bithesis.dtx ` 。
43+ > 如果要添加新命令,可以先在 ` templates/ ` 中具体实现,再拷贝到 ` bithesis* .dtx ` 。
4444
4545> [ !NOTE]
46- >
46+ >
4747> 文档有两部分。
4848>
4949> - ` bithesis-doc.tex ` 面向最终使用者,对应手册` bithesis.pdf ` 大部分内容。
50- > - ` bithesis.dtx ` 中的注释面向开发者。
50+ > - ` bithesis* .dtx ` 中的注释面向开发者。
5151>
5252> <details >
5353> <summary >注释中为何有 LaTeX 代码?</summary >
5454>
55- > ` bithesis.dtx ` 最顶层的注释包含 LaTeX 代码,可输出为手册结尾「实现细节」一节;不过默认不输出,一般也无需单独检查输出结果。
55+ > ` bithesis* .dtx ` 最顶层的注释包含 LaTeX 代码,可输出为手册结尾「实现细节」一节;不过默认不输出,一般也无需单独检查输出结果。
5656>
57- > 如需输出,请如下编辑` bithesis.dtx ` (` \jobname ` 的值是` bithesis ` ,` \filename ` 的值是` bithesis.dtx ` ),然后照常编译手册。
57+ > 如需输出,请如下编辑` src/ bithesis.dtx` (` \jobname ` 的值是` bithesis ` ,` \filename ` 的值是` bithesis.dtx ` ),然后照常编译手册。
5858>
5959> ``` diff
6060> \begin{document}
6161> - \DocInput{\jobname-doc.tex}
62- > + \DocInput{\jobname-doc.tex,\filename}
62+ > + \DocInput{\jobname-doc.tex,\filename,bithesis-thesis.dtx,bithesis-thesis-exports.dtx,bithesis-report.dtx,bithesis-beamer.dtx,bithesis-doc-style.dtx,bithesis-finale.dtx }
6363> ```
6464>
6565> 相关功能的文档位于 [DocStrip](https://texdoc.org/serve/docstrip/0) 和 [l3doc](https://texdoc.org/serve/l3doc/0)。
9393- 关于模板,[fduthesis 项目代码](https://github.com/stone-zeng/fduthesis)有很多最佳实践,可以参考。
9494- 样式部分则应参考[研究生院](https://grd.bit.edu.cn/xwgz/xwgz2/wjxz_xwgz/)和教务部的相关文件和通知。
9595
96- # # Makefile 的进一步介绍
96+ # # justfile 的进一步介绍
97+
98+ 运行`just --list`可查看所有命令。
99+
100+ ```shell
101+ $ just --list
102+ Available recipes:
103+ list # List available recipes
104+ …
105+
106+ [build]
107+ copy # Copy necessary files to templates/*/ and relevant directories
108+ doc # Build bithesis.pdf
109+ …
110+
111+ [dev]
112+ regression-test *ARGS # Run regression tests (run with `--help` for help)
113+ …
114+
115+ [release]
116+ pkg # Build bithesis.zip for submission to CTAN (mainly for CI)
117+ …
118+ ```
97119
98120### Windows
99121
100- Makefile 主要针对 Linux 和 macOS 开发者;Windows 开发者要确保至少有:
122+ justfile 主要针对 Linux 和 macOS 开发者;Windows 开发者要确保至少有:
101123
102124- GNU make——可按 [ ScoopInstaller/Main: ` make.json ` ] ( https://github.com/ScoopInstaller/Main/blob/master/bucket/make.json ) 中的 ` url ` 下载。
103125- GNU coreutils——可使用内置了 coreutils 的 Git Bash 或 Cygwin,或者[ 安装 uutils-coreutils] ( https://uutils.github.io/coreutils/docs/installation.html#windows ) 。
@@ -106,20 +128,17 @@ Makefile 主要针对 Linux 和 macOS 开发者;Windows 开发者要确保至
106128
107129### 辅助命令
108130
109- 我们常常需要实时预览代码编译的效果,而 LaTeX 本身没有提供实时编译的功能,导致我们要来回运行 `make copy`、`latexmk`。
110-
111- 为此 Makefile 提供了一些辅助命令,以 `dev-`开头,可以帮助你自动化以上流程。
131+ 我们常常需要实时预览代码编译的效果,而 LaTeX 本身没有提供实时编译的功能,导致我们要来回运行 ` just copy ` 、` latexmk ` 。
112132
113- 或者你可以使用类似 `rg --files | entr make copy` 以及 `rg --files | entr latexmk` 来达到
114- 「代码修改后立即重新编译」的效果。
133+ 其实可以使用类似 ` rg --files | entr just copy ` 以及 ` rg --files | entr latexmk ` 来达到「代码修改后立即重新编译」的效果。
115134
116135(这些命令未必适用于 Windows,可能要手动用 [ watchexec] ( https://watchexec.github.io/ ) 等替代。)
117136
118137### 单元测试和回归测试
119138
120- 运行 `make test` 将对所有的模板进行编译测试(同样被用于 GitHub Actions)。
139+ 运行 ` just test` 将对所有的模板进行编译测试(同样被用于 GitHub Actions)。
121140
122- 运行 `make regression-test` 进行回归测试,该命令将比较目前已发布的最新版本和本地版本生成的 PDF 的差异。更多使用方式见 `make regression-test args=' --help' `。
141+ 运行 ` just regression-test` 进行回归测试,该命令将比较目前已发布的最新版本和本地版本生成的 PDF 的差异。更多使用方式见 ` just regression-test --help` 。
123142
124143使用前请确保已经安装下面这些依赖。
125144
@@ -129,22 +148,8 @@ Makefile 主要针对 Linux 和 macOS 开发者;Windows 开发者要确保至
129148
130149### 打包
131150
132- - `make overleaf version=X.X.X` 可以生成上传 overleaf 所需要的 zip 文件。
133- - `make pkg` 可以生成上传 CTAN 所需要的 zip 文件。若已有手册而不想重新编译,可 `make pkg-only`。(同样被用于 GitHub Actions)
134- - `make grad version=X.X.X` 可以生成用作研究生院官网附件的 zip 文件。
135-
136- # ## 上传 Overleaf 与更新
137-
138- > [!NOTE]
139- > Overleaf 链接已利用 [`overleaf.com/docs` API](https://www.overleaf.com/devs) 自动指向最新发布版,不再需要手动更新。
140-
141- 首先运行 `make overleaf` 打包文件。
142-
143- 1. 打开 Overleaf,点击左上角 `New Projects > Upload Projects` ,然后上传 zip 文件。
144- 2. 点击 `Menu > Compiler` 选择 `XeLaTeX`,然后重新编译。
145- 3. 修改项目名称,以便于区分。(我一般加上 `BIThesis-`)
146- 4. 点击 `Share > Turn on link sharing`,复制 read 权限的链接。
147- 5. 在 [`BIThesis-wiki` 项目的 `wiki/guide/preface.md`](https://github.com/BITNP/BIThesis-wiki/blob/main/wiki/guide/preface.md) 中,更新链接。
151+ - ` just pkg ` 可以生成上传 CTAN 所需要的 zip 文件。若已有手册而不想重新编译,可 ` just pkg-only ` 。(同样被用于 GitHub Actions)
152+ - ` just grad X.X.X ` 可以生成用作研究生院官网附件的 zip 文件。
148153
149154## Release 工作流
150155
@@ -155,3 +160,5 @@ Makefile 主要针对 Linux 和 macOS 开发者;Windows 开发者要确保至
155160![ Release Workflow] ( ./assets/release_workflow.png )
156161
157162上周展示了完整工作流,其中大部分已自动化,只需要手动触发。
163+
164+ - Overleaf 链接已利用 [ ` overleaf.com/docs ` API] ( https://www.overleaf.com/devs ) 自动指向最新发布版,不再需要手动更新。
0 commit comments