Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一些包更新、兼容性改进以及模板bugfix #16

Merged
merged 6 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.eps linguist-vendored
*.eps linguist-vendored
*.sh text eol=lf
Makefile text eol=lf
30 changes: 30 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build LaTeX Document and Deploy
on:
push:
branches:
- master
workflow_dispatch: # allows you to run the workflow manually from the Actions tab

jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Compile LaTeX document
uses: dante-ev/latex-action@latest
with:
working_directory: Thesis
root_file: tjumain.tex
args: -xelatex -latexoption=-file-line-error -latexoption=-interaction=nonstopmode
- name: Create Public Dir
run: mkdir -p public
- name: Copy PDF to Public Dir
run: cp Thesis/tjumain.pdf Thesis/index.html public/
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Test Build LaTeX Document
on: [pull_request]
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Compile LaTeX document
uses: dante-ev/latex-action@latest
with:
working_directory: Thesis
root_file: tjumain.tex
args: -xelatex -latexoption=-file-line-error -latexoption=-interaction=nonstopmode
4 changes: 2 additions & 2 deletions Thesis/appendix/acknowledgements.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\addcontentsline{toc}{chapter}{致\quad 谢} % 添加到目录中
\chapter*{致\quad 谢}
\addcontentsline{toc}{chapter}{\texorpdfstring{致\quad 谢}{致谢}} % 添加到目录中
\chapter*{\texorpdfstring{致\quad 谢}{致谢}}

致谢应以简短的文字对课题研究与论文撰写过程中曾直接给予帮助的人员(例如指导教师)表示谢意。“致谢”两字之间空一个全角空格或两个半角空格,采用不编号章标题样式;内容应采用正文样式。
4 changes: 2 additions & 2 deletions Thesis/appendix/appendix.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

\addcontentsline{toc}{chapter}{附\quad 录}
\addcontentsline{toc}{chapter}{\texorpdfstring{附\quad 录}{附录}}
%\setcounter{page}{1} % 如果需要从该页开始从 1 开始编页,则取消该注释
\chapter*{附\quad 录}
\chapter*{\texorpdfstring{附\quad 录}{附录}}

附录的有无,根据毕业设计(论文)情况而定,内容一般包括正文内不便列出的冗长公式推导、辅助性数学工具、符号说明(含缩写)、计算程序及说明等。附录另起一页。附录依序用大写正体A、B、C、…编序号,如:附录A。附录中的图、表、公式、参考文献等另行编序号,与正文分开,也一律用阿拉伯数字编码,但在数码前冠以附录序码,如:图A01、表B-2、公式(B-3)、文献[A5]等。“附录”两字之间空一个全角空格或两个半角空格,采用不编号章标题样式;内容应采用正文样式。
26 changes: 26 additions & 0 deletions Thesis/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Thesis</title>
<style>
body, html {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
object {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<object data="tjumain.pdf" type="application/pdf">
<p>Your browser does not support PDFs.
<a href="tjumain.pdf">Download the PDF</a>.</p>
</object>
</body>
</html>
27 changes: 17 additions & 10 deletions Thesis/setup/package.tex
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
%\usepackage{ctex} % 支持中文显示
\usepackage{CJKpunct} % 精细调整中文的标点符号
\usepackage{color} % 支持彩色
\usepackage{mathtools}
\usepackage{amsmath} % AMSLaTeX宏包 用来排出更加漂亮的公式
\usepackage{amssymb} % 数学符号生成命令
\usepackage[below]{placeins} %允许上一个section的浮动图形出现在下一个section的开始部分,还提供\FloatBarrier命令,使所有未处理的浮动图形立即被处理
Expand All @@ -39,13 +40,15 @@
\usepackage{tabularx} % 自动设置表格的列宽
% \usepackage{subfigure} % 支持子图 %centerlast 设置最后一行是否居中
\usepackage{ccaption} % 支持子图的中文标题
\usepackage{subfig}
% \usepackage{subfig}
\usepackage{subcaption} % 用于子图和子标题 (subfigure和subfig已经obsolete)
\usepackage[sort&compress,numbers]{natbib} % 支持引用缩写的宏包
\usepackage{enumitem} % 使用enumitem宏包,改变列表项的格式
\usepackage{calc} % 长度可以用+ - * / 进行计算
\usepackage{txfonts} % 字体宏包
\usepackage{newtxtext} % 用newtxtext宏包替代txfonts
% \usepackage{txfonts} % 字体宏包
\usepackage{bm} % 处理数学公式中的黑斜体的宏包
\usepackage[amsmath,thmmarks,hyperref]{ntheorem} % 定理类环境宏包,其中 amsmath 选项用来兼容 AMS LaTeX 的宏包
\usepackage[amsmath,thmmarks,hyperref]{ntheorem} % xxx 定理类环境宏包,其中 amsmath 选项用来兼容 AMS LaTeX 的宏包
\usepackage{CJKnumb} % 提供将阿拉伯数字转换成中文数字的命令
\usepackage{indentfirst} % 首行缩进宏包
\usepackage{CJKutf8} % 用在UTF8编码环境下,它可以自动调用CJK,同时针对UTF8编码作了设置
Expand All @@ -69,13 +72,17 @@
rulesepcolor=\color{red!20!green!20!blue!20}
}
%支持算法环境
\usepackage[boxed,ruled,lined]{algorithm2e}
\usepackage{algorithmic}

% \usepackage[boxed,ruled,lined]{algorithm2e}
% \usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{algorithmicx} % 更好的算法包
\usepackage{algpseudocode}

\usepackage{array}
\renewcommand{\arraystretch}{1.5} % 调整行间距为默认的1.5倍

\usepackage{pdfpages}

\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
\newcolumntype{C}[1]{>{\PreserveBackslash\centering}p{#1}}
\newcolumntype{R}[1]{>{\PreserveBackslash\raggedleft}p{#1}}
Expand All @@ -86,12 +93,12 @@
pdfstartview=FitH,
bookmarksnumbered=true,
bookmarksopen=true,
colorlinks=false,
colorlinks=true, %false,
pdfborder={0 0 1},
citecolor=blue,
linkcolor=red,
citecolor=black, %blue,
linkcolor=black, %red,
anchorcolor=green,
urlcolor=blue,
urlcolor=black, %blue,
breaklinks=true
]{hyperref}
\fi