Skip to content

Commit 3ed9359

Browse files
YDX-2147483647fky2015
authored andcommitted
chore: 所有latexmkrc统一启用 SyncTeX 并关闭-shell-escape
若要关闭 SyncTeX,运行`latexmk`时可加上参数`-synctex=0`;启用`-shell-escape`也是如此。 Resolves #544
1 parent 49cae71 commit 3ed9359

File tree

15 files changed

+35
-79
lines changed

15 files changed

+35
-79
lines changed

.github/workflows/release.yml

+1-16
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,6 @@ jobs:
5454
undergraduate-thesis-en,
5555
reading-report,
5656
]
57-
include:
58-
- template: graduate-thesis
59-
cls: bithesis
60-
- template: undergraduate-thesis
61-
cls: bithesis
62-
- template: lab-report
63-
cls: bitreport
64-
- template: paper-translation
65-
cls: bithesis
66-
- template: presentation-slide
67-
cls: bitbeamer
68-
- template: undergraduate-thesis-en
69-
cls: bithesis
70-
- template: reading-report
71-
cls: bithesis
7257

7358
steps:
7459
- uses: actions/checkout@v4
@@ -83,7 +68,7 @@ jobs:
8368
- name: Copy manual to the template folder.
8469
run: |
8570
mv bithesis.pdf ./templates/${{ matrix.template }}
86-
mv ${{ matrix.cls }}.cls ./templates/${{ matrix.template }}
71+
make copy-only
8772
- name: Install zip
8873
uses: montudor/action-zip@v1
8974
- name: Zip files under ./${{ matrix.template }}

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@ wiki/.vuepress/dist
285285
bithesis.zip
286286
bithesis
287287

288+
# Generated by `make copy`
289+
/templates/*/latexmkrc
290+
/tests/*/latexmkrc
291+
/handbook/latexmkrc
292+
288293
!templates/*.pdf
289294
overleaf
290295
*.zip

DEVELOPMENT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
如果改动仅仅涉及某个模板,那么相对简单一些:
2929

30-
1. 初次开发前,运行 `make copy`,这会生成 `*.cls` 并更新到 `templates/` 下。
30+
1. 初次开发前,运行 `make copy`,这会生成 `*.cls` 等并更新到 `templates/` 下。
3131
2. 编辑模板。
3232
3. 测试,确保你的改动能够正确编译;并且不会影响到其他效果。
3333

Makefile

+18-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# 以下命令仅保证能在 Linux 或 macOS 环境下执行。
22
# 如果你是 Windows 用户,可以使用 Git Bash 或者 Cygwin 来执行;
33
# 或者可以考虑将此脚本移植为 PowerShell。
4+
5+
# Required for brace expansion
6+
SHELL = /bin/bash
7+
48
PACKAGE = bithesis
59

610
SOURCES = $(PACKAGE).ins $(PACKAGE).dtx
@@ -67,18 +71,21 @@ test: doc copy FORCE_MAKE
6771
regression-test: cls
6872
$(REGRESSION_TEST_COMMAND)
6973

74+
.PHONY: copy-only
75+
copy-only:
76+
cp {bithesis.cls,assets/latexmkrc} $(SCAFFOLDDIR)/undergraduate-thesis
77+
cp {bithesis.cls,assets/latexmkrc} $(SCAFFOLDDIR)/undergraduate-thesis-en
78+
cp {bithesis.cls,assets/latexmkrc} $(SCAFFOLDDIR)/paper-translation
79+
cp {bithesis.cls,assets/latexmkrc} $(SCAFFOLDDIR)/graduate-thesis
80+
cp {bithesis.cls,assets/latexmkrc} $(SCAFFOLDDIR)/reading-report
81+
cp {bithesis.cls,assets/latexmkrc} $(TESTDIR)/doctor-thesis
82+
cp {bithesis.cls,assets/latexmkrc} $(TESTDIR)/autorefs
83+
cp {bithesis.cls,assets/latexmkrc} ./handbook
84+
cp {bitreport.cls,assets/latexmkrc} $(SCAFFOLDDIR)/lab-report
85+
cp {bitbeamer.cls,assets/latexmkrc} $(SCAFFOLDDIR)/presentation-slide
86+
7087
.PHONY: copy
71-
copy: cls
72-
cp bithesis.cls $(SCAFFOLDDIR)/undergraduate-thesis
73-
cp bithesis.cls $(SCAFFOLDDIR)/undergraduate-thesis-en
74-
cp bithesis.cls $(SCAFFOLDDIR)/paper-translation
75-
cp bithesis.cls $(SCAFFOLDDIR)/graduate-thesis
76-
cp bithesis.cls $(SCAFFOLDDIR)/reading-report
77-
cp bithesis.cls $(TESTDIR)/doctor-thesis
78-
cp bithesis.cls $(TESTDIR)/autorefs
79-
cp bithesis.cls ./handbook
80-
cp bitreport.cls $(SCAFFOLDDIR)/lab-report
81-
cp bitbeamer.cls $(SCAFFOLDDIR)/presentation-slide
88+
copy: cls copy-only
8289

8390
# Generate scaffolds for overleaf
8491
.PHONY: overleaf

assets/latexmkrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# https://mirror.ctan.org/support/latexmk/example_rcfiles/xelatex_latexmkrc
2+
$pdf_mode = 5;
3+
$dvi_mode = 0;
4+
$postscript_mode = 0;
5+
6+
# 明确 *.bbl 由其它文件生成,可被删除。(latexmk 未能从 *.fls 检测)
7+
$bibtex_use = 2;
8+
9+
# 启用 SyncTeX
10+
$xelatex = "xelatex -synctex=1 %O %S";

handbook/latexmkrc

-5
This file was deleted.

templates/graduate-thesis/latexmkrc

-5
This file was deleted.

templates/lab-report/latexmkrc

-3
This file was deleted.

templates/paper-translation/latexmkrc

-3
This file was deleted.

templates/presentation-slide/latexmkrc

-3
This file was deleted.

templates/reading-report/latexmkrc

-3
This file was deleted.

templates/undergraduate-thesis-en/latexmkrc

-3
This file was deleted.

templates/undergraduate-thesis/latexmkrc

-3
This file was deleted.

tests/autorefs/latexmkrc

-18
This file was deleted.

tests/doctor-thesis/latexmkrc

-5
This file was deleted.

0 commit comments

Comments
 (0)