Loading .github/workflows/verify-compile.yml +4 −1 Changes for .github/workflows/verify-compile.yml: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -46,7 +46,10 @@ jobs: name: Sync to other git service if: github.repository_owner == 'SUSTech-CRA' timeout-minutes: 10 needs: build_latex concurrency: group: sync-job cancel-in-progress: true # needs: build_latex steps: # - name: Push to gitee Loading sustech-setup.tex +5 −8 Changes for sustech-setup.tex: 5 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -104,20 +104,17 @@ % 也可以使用 ntheorem % \usepackage[amsmath,thmmarks,hyperref]{ntheorem} %%%%%% 顺序编码制的文献引用形式 %%%%%% 参考文献编译方式二选一,不要同时开启。 %%%% 选择一 %% 参考文献使用 BibTeX + natbib 宏包 %% 顺序编码制 %%%% 选择一:使用 BibTeX + natbib 宏包 \usepackage[sort&compress]{gbt7714} \citestyle{super} % 全局上标数字模式,中文主体采用 % \citestyle{numbers} % 全局行间数字模式,英文主体采用 \bibliographystyle{sustechthesis-numeric} %%%% 选择二(不兼容本模板,请勿使用) %% 参考文献使用 BibLaTeX 宏包 % \usepackage[backend=biber,style=gb7714-2015]{biblatex} %% 声明 BibLaTeX 的数据库 % \addbibresource{ref/refs.bib} %%%% 选择二:使用 BibLaTeX 宏包(兼容性不佳,不太推荐) % \usepackage[backend=biber,style=gb7714-2015,gbalign=left]{biblatex} % \addbibresource{ref/refs.bib} % 声明 BibLaTeX 的数据库 % 定义所有的图片文件在 figures 子目录下 \graphicspath{{figures/}} Loading sustechthesis-example.tex +1 −1 Changes for sustechthesis-example.tex: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ % 参考文献 \bibliography{ref/refs} % 参考文献使用 BibTeX 编译 % \printbibliography % 参考文献使用 BibLaTeX 编译,(不兼容本模板,请勿使用) % \printbibliography % 参考文献使用 BibLaTeX 编译(兼容性不佳,不太推荐) % 附录 \appendix Loading sustechthesis.dtx +16 −12 Changes for sustechthesis.dtx: 16 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -5154,20 +5154,24 @@ Thesis for the degree of \degree@level@en@noun \ of \thu@degree@domain@en% \DeclareRobustCommand\inlinecite{\parencite} \defbibheading{bibliography}[\bibname]{\thu@chapter*{\bibname}} \newcommand\thu@set@bibliography@format{% \ifthu@degree@bachelor \renewcommand\bibfont{\fontsize{10.5bp}{17bp}\selectfont}% \setlength{\bibitemsep}{6bp \@plus 3bp \@minus 3bp}% \ifthu@main@language@chinese \setlength{\bibhang}{21bp}% \else \setlength{\bibhang}{0.5in}% \fi \else \renewcommand\bibfont{\fontsize{10.5bp}{16bp}\selectfont}% \setlength{\bibitemsep}{3bp \@plus 3bp \@minus 3bp}% \setlength{\biblabelsep}{0.1cm}% \setlength{\bibhang}{21bp}% \fi \setlength{\biblabelsep}{1em}% \setlength{\bibhang}{1em}% %\ifthu@degree@bachelor % \renewcommand\bibfont{\fontsize{10.5bp}{17bp}\selectfont}% % \setlength{\bibitemsep}{6bp \@plus 3bp \@minus 3bp}% % \ifthu@main@language@chinese % \setlength{\bibhang}{21bp}% % \else % \setlength{\bibhang}{0.5in}% % \fi %\else % \renewcommand\bibfont{\fontsize{10.5bp}{16bp}\selectfont}% % \setlength{\bibitemsep}{3bp \@plus 3bp \@minus 3bp}% % \setlength{\biblabelsep}{0.1cm}% % \setlength{\bibhang}{21bp}% %\fi } \thu@set@bibliography@format \thu@option@hook{degree}{\thu@set@bibliography@format} Loading test/test-files.py +36 −0 Changes for test/test-files.py: 36 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -25,6 +25,30 @@ def change_line(filename, old, new): rollback(filename, mode=0) def comment_line(filename, pattern, action): try: rollback(filename, mode=1) with open(filename, "r", encoding="utf-8") as f1: with open(f"{filename}.part", "w", encoding="utf-8") as f2: for line in f1: if re.findall(pattern, line): print(line) if action: line = f"% {line}" else: line = re.sub("^[%\s]+", "", line) f2.write(line) print(line) else: f2.write(line) os.remove(filename) os.rename(f"{filename}.part", filename) except: rollback(filename, mode=2) finally: rollback(filename, mode=0) def rollback(filename, mode): if mode == 1: # running 1 Loading Loading @@ -57,3 +81,15 @@ if __name__ == "__main__": "documentclass.+{sustechthesis}", "documentclass[degree=master,language=english,cjk-font=external]{sustechthesis}" ) elif args.recipe == 3: # biber filename = "sustechthesis-example.tex" comment_line(filename, "bibliography{ref/refs}", True) comment_line(filename, "printbibliography", False) filename = "sustech-setup.tex" comment_line(filename, "{gbt7714}", True) comment_line(filename, "citestyle{super}", True) comment_line(filename, "citestyle{numbers}", True) comment_line(filename, "bibliographystyle{sustechthesis-numeric}", True) comment_line(filename, "{biblatex}", False) comment_line(filename, "addbibresource{ref/refs.bib}", False) Loading
.github/workflows/verify-compile.yml +4 −1 Changes for .github/workflows/verify-compile.yml: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -46,7 +46,10 @@ jobs: name: Sync to other git service if: github.repository_owner == 'SUSTech-CRA' timeout-minutes: 10 needs: build_latex concurrency: group: sync-job cancel-in-progress: true # needs: build_latex steps: # - name: Push to gitee Loading
sustech-setup.tex +5 −8 Changes for sustech-setup.tex: 5 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -104,20 +104,17 @@ % 也可以使用 ntheorem % \usepackage[amsmath,thmmarks,hyperref]{ntheorem} %%%%%% 顺序编码制的文献引用形式 %%%%%% 参考文献编译方式二选一,不要同时开启。 %%%% 选择一 %% 参考文献使用 BibTeX + natbib 宏包 %% 顺序编码制 %%%% 选择一:使用 BibTeX + natbib 宏包 \usepackage[sort&compress]{gbt7714} \citestyle{super} % 全局上标数字模式,中文主体采用 % \citestyle{numbers} % 全局行间数字模式,英文主体采用 \bibliographystyle{sustechthesis-numeric} %%%% 选择二(不兼容本模板,请勿使用) %% 参考文献使用 BibLaTeX 宏包 % \usepackage[backend=biber,style=gb7714-2015]{biblatex} %% 声明 BibLaTeX 的数据库 % \addbibresource{ref/refs.bib} %%%% 选择二:使用 BibLaTeX 宏包(兼容性不佳,不太推荐) % \usepackage[backend=biber,style=gb7714-2015,gbalign=left]{biblatex} % \addbibresource{ref/refs.bib} % 声明 BibLaTeX 的数据库 % 定义所有的图片文件在 figures 子目录下 \graphicspath{{figures/}} Loading
sustechthesis-example.tex +1 −1 Changes for sustechthesis-example.tex: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ % 参考文献 \bibliography{ref/refs} % 参考文献使用 BibTeX 编译 % \printbibliography % 参考文献使用 BibLaTeX 编译,(不兼容本模板,请勿使用) % \printbibliography % 参考文献使用 BibLaTeX 编译(兼容性不佳,不太推荐) % 附录 \appendix Loading
sustechthesis.dtx +16 −12 Changes for sustechthesis.dtx: 16 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -5154,20 +5154,24 @@ Thesis for the degree of \degree@level@en@noun \ of \thu@degree@domain@en% \DeclareRobustCommand\inlinecite{\parencite} \defbibheading{bibliography}[\bibname]{\thu@chapter*{\bibname}} \newcommand\thu@set@bibliography@format{% \ifthu@degree@bachelor \renewcommand\bibfont{\fontsize{10.5bp}{17bp}\selectfont}% \setlength{\bibitemsep}{6bp \@plus 3bp \@minus 3bp}% \ifthu@main@language@chinese \setlength{\bibhang}{21bp}% \else \setlength{\bibhang}{0.5in}% \fi \else \renewcommand\bibfont{\fontsize{10.5bp}{16bp}\selectfont}% \setlength{\bibitemsep}{3bp \@plus 3bp \@minus 3bp}% \setlength{\biblabelsep}{0.1cm}% \setlength{\bibhang}{21bp}% \fi \setlength{\biblabelsep}{1em}% \setlength{\bibhang}{1em}% %\ifthu@degree@bachelor % \renewcommand\bibfont{\fontsize{10.5bp}{17bp}\selectfont}% % \setlength{\bibitemsep}{6bp \@plus 3bp \@minus 3bp}% % \ifthu@main@language@chinese % \setlength{\bibhang}{21bp}% % \else % \setlength{\bibhang}{0.5in}% % \fi %\else % \renewcommand\bibfont{\fontsize{10.5bp}{16bp}\selectfont}% % \setlength{\bibitemsep}{3bp \@plus 3bp \@minus 3bp}% % \setlength{\biblabelsep}{0.1cm}% % \setlength{\bibhang}{21bp}% %\fi } \thu@set@bibliography@format \thu@option@hook{degree}{\thu@set@bibliography@format} Loading
test/test-files.py +36 −0 Changes for test/test-files.py: 36 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -25,6 +25,30 @@ def change_line(filename, old, new): rollback(filename, mode=0) def comment_line(filename, pattern, action): try: rollback(filename, mode=1) with open(filename, "r", encoding="utf-8") as f1: with open(f"{filename}.part", "w", encoding="utf-8") as f2: for line in f1: if re.findall(pattern, line): print(line) if action: line = f"% {line}" else: line = re.sub("^[%\s]+", "", line) f2.write(line) print(line) else: f2.write(line) os.remove(filename) os.rename(f"{filename}.part", filename) except: rollback(filename, mode=2) finally: rollback(filename, mode=0) def rollback(filename, mode): if mode == 1: # running 1 Loading Loading @@ -57,3 +81,15 @@ if __name__ == "__main__": "documentclass.+{sustechthesis}", "documentclass[degree=master,language=english,cjk-font=external]{sustechthesis}" ) elif args.recipe == 3: # biber filename = "sustechthesis-example.tex" comment_line(filename, "bibliography{ref/refs}", True) comment_line(filename, "printbibliography", False) filename = "sustech-setup.tex" comment_line(filename, "{gbt7714}", True) comment_line(filename, "citestyle{super}", True) comment_line(filename, "citestyle{numbers}", True) comment_line(filename, "bibliographystyle{sustechthesis-numeric}", True) comment_line(filename, "{biblatex}", False) comment_line(filename, "addbibresource{ref/refs.bib}", False)