diff --git a/.gitattributes b/.gitattributes index d11fe21..f0048fd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,3 @@ -*.eps linguist-vendored \ No newline at end of file +*.eps linguist-vendored +*.sh text eol=lf +Makefile text eol=lf diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml new file mode 100644 index 0000000..c6eb1b6 --- /dev/null +++ b/.github/workflows/build-deploy.yml @@ -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 }} diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml new file mode 100644 index 0000000..64bbe49 --- /dev/null +++ b/.github/workflows/test-build.yml @@ -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 \ No newline at end of file diff --git a/Thesis/appendix/acknowledgements.tex b/Thesis/appendix/acknowledgements.tex index c5da205..341a448 100644 --- a/Thesis/appendix/acknowledgements.tex +++ b/Thesis/appendix/acknowledgements.tex @@ -1,4 +1,4 @@ -\addcontentsline{toc}{chapter}{致\quad 谢} % 添加到目录中 -\chapter*{致\quad 谢} +\addcontentsline{toc}{chapter}{\texorpdfstring{致\quad 谢}{致谢}} % 添加到目录中 +\chapter*{\texorpdfstring{致\quad 谢}{致谢}} 致谢应以简短的文字对课题研究与论文撰写过程中曾直接给予帮助的人员(例如指导教师)表示谢意。“致谢”两字之间空一个全角空格或两个半角空格,采用不编号章标题样式;内容应采用正文样式。 diff --git a/Thesis/appendix/appendix.tex b/Thesis/appendix/appendix.tex index c58ec80..0a59e5e 100644 --- a/Thesis/appendix/appendix.tex +++ b/Thesis/appendix/appendix.tex @@ -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]等。“附录”两字之间空一个全角空格或两个半角空格,采用不编号章标题样式;内容应采用正文样式。 diff --git a/Thesis/index.html b/Thesis/index.html new file mode 100644 index 0000000..4d39f25 --- /dev/null +++ b/Thesis/index.html @@ -0,0 +1,26 @@ + + + + + + Thesis + + + + +

Your browser does not support PDFs. + Download the PDF.

+
+ + \ No newline at end of file diff --git a/Thesis/setup/package.tex b/Thesis/setup/package.tex index 1b80432..1e3bef0 100644 --- a/Thesis/setup/package.tex +++ b/Thesis/setup/package.tex @@ -30,6 +30,7 @@ %\usepackage{ctex} % 支持中文显示 \usepackage{CJKpunct} % 精细调整中文的标点符号 \usepackage{color} % 支持彩色 +\usepackage{mathtools} \usepackage{amsmath} % AMSLaTeX宏包 用来排出更加漂亮的公式 \usepackage{amssymb} % 数学符号生成命令 \usepackage[below]{placeins} %允许上一个section的浮动图形出现在下一个section的开始部分,还提供\FloatBarrier命令,使所有未处理的浮动图形立即被处理 @@ -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编码作了设置 @@ -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}} @@ -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