Skip to content

Commit

Permalink
chore: 所有latexmkrc统一启用 SyncTeX 并关闭-shell-escape
Browse files Browse the repository at this point in the history
若要关闭 SyncTeX,运行`latexmk`时可加上参数`-synctex=0`;启用`-shell-escape`也是如此。

Resolves #544
  • Loading branch information
YDX-2147483647 committed Jul 22, 2024
1 parent 49cae71 commit dacd823
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 79 deletions.
17 changes: 1 addition & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,6 @@ jobs:
undergraduate-thesis-en,
reading-report,
]
include:
- template: graduate-thesis
cls: bithesis
- template: undergraduate-thesis
cls: bithesis
- template: lab-report
cls: bitreport
- template: paper-translation
cls: bithesis
- template: presentation-slide
cls: bitbeamer
- template: undergraduate-thesis-en
cls: bithesis
- template: reading-report
cls: bithesis

steps:
- uses: actions/checkout@v4
Expand All @@ -83,7 +68,7 @@ jobs:
- name: Copy manual to the template folder.
run: |
mv bithesis.pdf ./templates/${{ matrix.template }}
mv ${{ matrix.cls }}.cls ./templates/${{ matrix.template }}
make copy-only
- name: Install zip
uses: montudor/action-zip@v1
- name: Zip files under ./${{ matrix.template }}
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ wiki/.vuepress/dist
bithesis.zip
bithesis

# Generated by `make copy`
/templates/*/latexmkrc
/tests/*/latexmkrc
/handbook/latexmkrc

!templates/*.pdf
overleaf
*.zip
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

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

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

Expand Down
29 changes: 18 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# 以下命令仅保证能在 Linux 或 macOS 环境下执行。
# 如果你是 Windows 用户,可以使用 Git Bash 或者 Cygwin 来执行;
# 或者可以考虑将此脚本移植为 PowerShell。

# Required for brace expansion
SHELL = /bin/bash

PACKAGE = bithesis

SOURCES = $(PACKAGE).ins $(PACKAGE).dtx
Expand Down Expand Up @@ -67,18 +71,21 @@ test: doc copy FORCE_MAKE
regression-test: cls
$(REGRESSION_TEST_COMMAND)

.PHONY: copy-only
copy-only:
cp {bithesis.cls,assets/latexmkrc} $(SCAFFOLDDIR)/undergraduate-thesis
cp {bithesis.cls,assets/latexmkrc} $(SCAFFOLDDIR)/undergraduate-thesis-en
cp {bithesis.cls,assets/latexmkrc} $(SCAFFOLDDIR)/paper-translation
cp {bithesis.cls,assets/latexmkrc} $(SCAFFOLDDIR)/graduate-thesis
cp {bithesis.cls,assets/latexmkrc} $(SCAFFOLDDIR)/reading-report
cp {bithesis.cls,assets/latexmkrc} $(TESTDIR)/doctor-thesis
cp {bithesis.cls,assets/latexmkrc} $(TESTDIR)/autorefs
cp {bithesis.cls,assets/latexmkrc} ./handbook
cp {bitreport.cls,assets/latexmkrc} $(SCAFFOLDDIR)/lab-report
cp {bitbeamer.cls,assets/latexmkrc} $(SCAFFOLDDIR)/presentation-slide

.PHONY: copy
copy: cls
cp bithesis.cls $(SCAFFOLDDIR)/undergraduate-thesis
cp bithesis.cls $(SCAFFOLDDIR)/undergraduate-thesis-en
cp bithesis.cls $(SCAFFOLDDIR)/paper-translation
cp bithesis.cls $(SCAFFOLDDIR)/graduate-thesis
cp bithesis.cls $(SCAFFOLDDIR)/reading-report
cp bithesis.cls $(TESTDIR)/doctor-thesis
cp bithesis.cls $(TESTDIR)/autorefs
cp bithesis.cls ./handbook
cp bitreport.cls $(SCAFFOLDDIR)/lab-report
cp bitbeamer.cls $(SCAFFOLDDIR)/presentation-slide
copy: cls copy-only

# Generate scaffolds for overleaf
.PHONY: overleaf
Expand Down
10 changes: 10 additions & 0 deletions assets/latexmkrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://mirror.ctan.org/support/latexmk/example_rcfiles/xelatex_latexmkrc
$pdf_mode = 5;
$dvi_mode = 0;
$postscript_mode = 0;

# 明确 *.bbl 由其它文件生成,可被删除。(latexmk 未能从 *.fls 检测)
$bibtex_use = 2;

# 启用 SyncTeX
$xelatex = "xelatex -synctex=1 %O %S";
5 changes: 0 additions & 5 deletions handbook/latexmkrc

This file was deleted.

5 changes: 0 additions & 5 deletions templates/graduate-thesis/latexmkrc

This file was deleted.

3 changes: 0 additions & 3 deletions templates/lab-report/latexmkrc

This file was deleted.

3 changes: 0 additions & 3 deletions templates/paper-translation/latexmkrc

This file was deleted.

3 changes: 0 additions & 3 deletions templates/presentation-slide/latexmkrc

This file was deleted.

3 changes: 0 additions & 3 deletions templates/reading-report/latexmkrc

This file was deleted.

3 changes: 0 additions & 3 deletions templates/undergraduate-thesis-en/latexmkrc

This file was deleted.

3 changes: 0 additions & 3 deletions templates/undergraduate-thesis/latexmkrc

This file was deleted.

18 changes: 0 additions & 18 deletions tests/autorefs/latexmkrc

This file was deleted.

5 changes: 0 additions & 5 deletions tests/doctor-thesis/latexmkrc

This file was deleted.

0 comments on commit dacd823

Please sign in to comment.