├── .gitignore ├── README.org ├── build.bat ├── figures ├── campus.jpg └── nwpu.jpg ├── myrefs.bib ├── nputhesis-sample.pdf ├── nputhesis-sample.tex ├── nputhesis.cls ├── nputhesis.dtx ├── nputhesis.ins └── nputhesis.pdf /.gitignore: -------------------------------------------------------------------------------- 1 | tags 2 | *~ 3 | *.o 4 | *.i 5 | .*project 6 | *.aux 7 | *.log 8 | *.nav 9 | *.out 10 | *.snm 11 | *.toc 12 | *.bbl 13 | *.blg 14 | *.synctex 15 | *.fdb_latexmk 16 | *.xdv 17 | *.fls 18 | *.synctex.gz 19 | *.nlg 20 | *.nlo 21 | *.nls 22 | *.bcf 23 | *.run.xml 24 | *.swp 25 | *.glo 26 | *.gls 27 | *.idx 28 | *.ilg 29 | *.ind 30 | *.hd 31 | 32 | auto 33 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | * 该模板已经不再更新, 推荐使用 [[https://github.com/NWPUMetaphysicsOffice][@NWPUMetaphysicsOffice]] 的 [[https://github.com/NWPUMetaphysicsOffice/Yet-Another-LaTeX-Template-for-NPU-Thesis][Yet-Another-LaTeX-Template-for-NPU-Thesis]] 2 | 3 | 网址 https://github.com/NWPUMetaphysicsOffice/Yet-Another-LaTeX-Template-for-NPU-Thesis 4 | 5 | * NPU 博士、硕士学位论文 \LaTeX 模板 6 | =nputhesis= 是基于\LaTeX 的 =ctexbook= 文类编写的[[https://www.nwpu.edu.cn][西北工业大学]]博士、硕士论文格式文类, 基本实现了[[http://gs.nwpu.edu.cn/info/2021/5046.htm][博士、硕士学位论文撰写规定]]的要求. 7 | 8 | ** \TeX 环境 9 | =sample.tex= 源文件使用 =UTF8= 编码在 =TeXLive 2019= 下使用引擎 =xelatex= 及 =pdflatex= 10 | 编译通过. 其他环境未测试. 11 | 12 | (* 推荐使用新版 =TeXLive= 下的 =xelatex= 进行编译 *) 13 | 14 | ** 如何使用 15 | 1. 如何使用该文类 16 | 在 \TeX 文档开头使用 =nputhesis= 文类即可, 如 17 | =\documentclass[twoside,UTF8,phd,AutoFakeBold]{nputhesis}=. 18 | 19 | 这里使用 =AutoFakeBold= 为外封面的字体加黑. 在 TeXLive 2019 之前的版本中, 20 | 启用该选项将导致 =xelatex= 编译生成的 =pdf= 文件内容复制时显示为乱码, 进而导致查重报告显示为乱码. 21 | 解决方法有以下三种: 22 | 1) 升级 TeXLive 到 2019 版. 23 | 2) 使用 Adobe 字体. 首先自行下载安装 Adobe 字体, 然后在 =tex= 源文件导言区重新定义相关字体, 如 24 | #+BEGIN_SRC tex 25 | \documentclass[twoside, UTF8, phd, dbr, AutoFakeBold]{nputhesis} 26 | % 导言区 27 | \renewcommand{\songti}{\CJKfontspec{Adobe Song Std L}} % adobe 宋体 28 | \renewcommand{\kaishu}{\CJKfontspec{Adobe Kaiti Std R}} % adobe 楷体 29 | \renewcommand{\heiti}{\CJKfontspec{Adobe Heiti Std R}} % adobe 黑体 30 | \renewcommand{\fangsong}{\CJKfontspec{Adobe Fangsong Std R}} % adobe 仿宋 31 | % other command 32 | \begin{document} 33 | 正文 34 | \end{document} 35 | #+END_SRC 36 | 3) 去掉 =AutoFakeBold= 选项. 这样会导致外封面字体不能加黑. 37 | 38 | 2. 如何编译 39 | 推荐使用 `latexmk' 命令进行编译, 编译命令如下 40 | #+BEGIN_SRC shell 41 | latexmk -xelatex -synctex=1 nputhesis-sample.tex 42 | #+END_SRC 43 | 3. 符号表的生成 44 | 由于符号表需要使用外部程序 `makeindex' 辅助生成, 所以我们添加了 `latexmkrc' 文件, 45 | 只要使用上述 `latexmk' 命令符号表可以自动生成, 否则, 需要手动调用 'makeindex' 程序 46 | #+BEGIN_SRC shell 47 | makeindex nputhesis-sample.nlo -s nomencl.ist -o nputhesis-sample.nls -t nputhesis-sample.nlg 48 | #+END_SRC 49 | 50 | *** 文档选项说明 51 | 1. 由于 =nputhesis= 基于 =book= 实现, =book= 文类的选项这里均能是使用, 如 =twoside=. 52 | 2. =nputhesis= 新定义的选项 53 | - =UTF8= : 传递给宏包 =ctexcap=, 用于中文标题处理. 54 | - =phd= : 使用博士论文模板, 默认选项. 55 | - =ma= : 使用硕士论文模板. 56 | - =dbr= : 用于隐藏作者和导师名, 需要使用命令 =\dbr=. 57 | - =blankinfo= : 空白页信息开关, 用于在偶数空白页显示 `This Page Intentionally Left Blank!`, 默认不显示. 58 | 59 | *** 使用的宏包及定义的环境 60 | 该文类内部已包含宏包 =geometry=, =xcolor=, =fancyhdr=, =titletoc=, =caption=, =ulem=, 61 | =amsthm=, =amsmath=, =amsfonts=, =setspace=, =longtable=, =booktabs=, =tabularx=, 62 | =multirow=, =graphicx=, =ctex=, =nomencl=, =multicol=. 63 | 64 | 1. 使用了 =amsthm= 宏包定义了定理格式 =nputheorem= 和 =npuplain=, 并默认启用 =npuplain=. 65 | 在文档中 =\newtheorem{theorem}{定理}[section]= 定义新环境将默认使用格式. 若需更改将 66 | 要定义的定理格式为其他格式, 如 =nputheorem=, 请使用如下命令: 67 | #+BEGIN_SRC tex 68 | \theoremstyle{nputheorem} 69 | \newtheorem{npu-thm}{斜体定理}[section] 70 | #+END_SRC 71 | 那么 =npu-thm= 环境将使用 =nputheorem= 格式. 72 | 2. 符号表生成使用了宏包 =nomencl= . 在需要显示符号表的地方使用命令 =\printnomenclature= 即可, 73 | 模板中符号表在目录后. 添加符号请使用命令 =\nomenclature{}{}=. 74 | 75 | *** 关于参考文献得说明 76 | 推荐使用 =biblatex= 宏包生成参考文献. 若确实需要使用 =bst= 文件生成参考文件, 可以考虑 77 | 使用 [[https://github.com/Haixing-Hu][@Haixing-Hu]] 编写的 `bst' 文件 78 | [[https://github.com/Haixing-Hu/GBT7714-2005-BibTeX-Style][`gbt7741-2005.bst']]. 79 | 80 | ** 其他链接 81 | 1. [[https://github.com/polossk][@polossk]]: [[https://github.com/polossk/LaTeX-Template-For-NPU-Thesis][LaTeX-Template-For-NPU-Thesis]] 82 | 2. [[https://github.com/NPUSCG][@NPUSCG]]: [[https://github.com/NPUSCG/npu-dissertation-proposal][西北工业大学研究生选题报告表 \LaTeX 模板]] 83 | 3. [[https://github.com/Haixing-Hu][@Haixing-Hu]]: [[https://github.com/Haixing-Hu/GBT7714-2005-BibTeX-Style][`gbt7741-2005.bst']]. 84 | 85 | ** License 86 | 87 | MIT License 88 | 89 | Copyright (c) 2020 Yang Zongze (yangzongze@gmail.com) 90 | 91 | Permission is hereby granted, free of charge, to any person obtaining a copy 92 | of this software and associated documentation files (the "Software"), to deal 93 | in the Software without restriction, including without limitation the rights 94 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 95 | copies of the Software, and to permit persons to whom the Software is 96 | furnished to do so, subject to the following conditions: 97 | 98 | The above copyright notice and this permission notice shall be included in all 99 | copies or substantial portions of the Software. 100 | 101 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 102 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 103 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 104 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 105 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 106 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 107 | SOFTWARE. 108 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set flag=%1 4 | set filename=%0 5 | 6 | set tds_dir=nputhesis-tds 7 | set tex_dir=\tex\latex\nputhesis 8 | set doc_dir=\doc\latex\nputhesis 9 | set src_dir=\source\latex\nputhesis 10 | 11 | if %flag%x == x ( 12 | for %%i in (plain, clean) do ( 13 | call:%%i 14 | ) 15 | pause 16 | goto :EOF 17 | ) 18 | 19 | 20 | for %%i in (tds, plain, fast, demo, clean, clean_all, help) do if x%flag% == x%%i ( 21 | call:%%i 22 | goto :EOF 23 | ) 24 | 25 | echo unkonwn option %flag% 26 | goto :EOF 27 | 28 | :help 29 | echo This is the build script for nputhesis 30 | echo USAGE: 31 | echo %filename% [help^|tds^|plain^|clean^|clean_all] 32 | echo Without any parameter, %filename% will run 33 | echo %filename% tds 34 | echo and 35 | echo %filename% clean 36 | goto :EOF 37 | 38 | :tds 39 | call :clean_all 40 | md %tds_dir%%tex_dir% 41 | md %tds_dir%%doc_dir% 42 | md %tds_dir%%src_dir% 43 | call :create_dscfg 44 | call :plain 45 | copy /Y nputhesis.dtx %tds_dir%%src_dir%\nputhesis.dtx 46 | copy /Y nputhesis.pdf %tds_dir%%doc_dir%\nputhesis.pdf 47 | copy /Y %tds_dir%%tex_dir%\nputhesis.cls %tds_dir%%doc_dir%\nputhesis.cls 48 | pushd %tds_dir%%doc_dir% 49 | copy /Y %tds_dir%%tex_dir%\nputhesis.cls nputhesis.cls 50 | call :demo 51 | if exist nputhesis.cls del nputhesis.cls 52 | popd 53 | if exist nputhesis.tds.zip del nputhesis.tds.zip 54 | 7z a nputhesis.tds.zip .\nputhesis-tds\* 55 | 7z l nputhesis.tds.zip 56 | echo ------------------------------------------------------------ 57 | echo "Copy the files in nputhesis.tds.zip to proper destination." 58 | echo "Enjoy it!" 59 | echo ------------------------------------------------------------ 60 | goto :EOF 61 | 62 | :fast 63 | xelatex nputhesis.dtx 64 | latexmk -xelatex nputhesis-sample.tex 65 | goto :EOF 66 | 67 | :plain 68 | call :create_dtxrc 69 | latexmk -xelatex nputhesis.dtx -r dtxrc 70 | call :demo 71 | rem latexmk -c nputhesis.dtx -r dtxrc 72 | goto :EOF 73 | 74 | :demo 75 | call :create_demorc 76 | latexmk -xelatex nputhesis-sample.tex -r demorc 77 | latexmk -c nputhesis-sample.tex -r demorc 78 | del demorc 79 | goto :EOF 80 | 81 | :clean 82 | call :clean_dtx 83 | call :clean_demo 84 | for %%i in ( 85 | docstrip.cfg, 86 | ) do if exist %%i ( del %%i ) 87 | goto :EOF 88 | 89 | :clean_dtx 90 | if exist nputhesis.dtx ( 91 | call :create_dtxrc 92 | latexmk -c nputhesis.dtx -r dtxrc 93 | del dtxrc 94 | ) 95 | goto :EOF 96 | 97 | :clean_demo 98 | if exist nputhesis-sample.tex ( 99 | call :create_demorc 100 | latexmk -c nputhesis-sample.tex -r demorc 101 | del demorc 102 | ) 103 | goto :EOF 104 | 105 | :clean_all 106 | if exist %tds_dir% rmdir /S /Q %tds_dir% 107 | call :clean_dtx 108 | call :clean_demo 109 | for %%i in ( 110 | docstrip.cfg, nputhesis.tds.zip, nputhesis.ins, nputhesis.cls, nputhesis.pdf, 111 | nputhesis-sample.tex, nputhesis-sample.pdf, myrefs.bib, README.org 112 | ) do if exist %%i ( del %%i ) 113 | goto :EOF 114 | 115 | :create_dscfg 116 | call :heredoc dscfg >docstrip.cfg && goto enddscfg 117 | \BaseDirectory{nputhesis-tds} 118 | \UseTDS 119 | :enddscfg 120 | goto :EOF 121 | 122 | :create_dtxrc 123 | call :heredoc dtxrc >dtxrc && goto enddtxrc 124 | @cus_dep_list = (@cus_dep_list, "glo gls 0 makegls"); 125 | sub makegls { 126 | system("makeindex -s gglo.ist -o $_[0].gls $_[0].glo"); } 127 | $makeindex="makeindex -s gind.ist -o %D %S"; 128 | push @generated_exts, 'idx', 'ind', 'glo', 'gls', 'hd', 'xdv'; 129 | :enddtxrc 130 | goto :EOF 131 | 132 | :create_demorc 133 | call :heredoc demorc >demorc && goto demorc 134 | # for nomenclature 135 | add_cus_dep("nlo", "nls", 0, "nlo2nls"); 136 | sub nlo2nls { 137 | system("makeindex $_[0].nlo -s nomencl.ist -o $_[0].nls -t $_[0].nlg"); 138 | } 139 | $clean_ext = "bbl nlg nlo nls xdv run.xml" 140 | :demorc 141 | goto :EOF 142 | 143 | :: https://stackoverflow.com/a/15032476/3627676 144 | 145 | :: ######################################## 146 | :: ## Here's the heredoc processing code ## 147 | :: ######################################## 148 | :heredoc 149 | setlocal enabledelayedexpansion 150 | set go= 151 | for /f "delims=" %%A in ('findstr /n "^" "%~f0"') do ( 152 | set "line=%%A" && set "line=!line:*:=!" 153 | if defined go (if #!line:~1!==#!go::=! (goto :EOF) else echo(!line!) 154 | if "!line:~0,13!"=="call :heredoc" ( 155 | for /f "tokens=3 delims=>^ " %%i in ("!line!") do ( 156 | if #%%i==#%1 ( 157 | for /f "tokens=2 delims=&" %%I in ("!line!") do ( 158 | for /f "tokens=2" %%x in ("%%I") do set "go=%%x" 159 | ) 160 | ) 161 | ) 162 | ) 163 | ) 164 | goto :EOF 165 | -------------------------------------------------------------------------------- /figures/campus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NPUSCG/nputhesis/1bed065a8cf8d02254d3e99a1c8c8f4b61b40552/figures/campus.jpg -------------------------------------------------------------------------------- /figures/nwpu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NPUSCG/nputhesis/1bed065a8cf8d02254d3e99a1c8c8f4b61b40552/figures/nwpu.jpg -------------------------------------------------------------------------------- /myrefs.bib: -------------------------------------------------------------------------------- 1 | %% LaTeX2e file `myrefs.bib' 2 | %% generated by the `filecontents' environment 3 | %% from source `nputhesis-sample' on 2020/06/16. 4 | %% 5 | @Book{Knuth1986, 6 | Title = {The \TeX book}, 7 | Author = {Donald~Ervin Knuth}, 8 | Publisher = {Addison-Wesley}, 9 | Year = {1986} 10 | } 11 | 12 | @Book{Lamport1994, 13 | Title = {A Document Preparation System}, 14 | Author = {Leslie Lamport}, 15 | Publisher = {Addison-Wesley}, 16 | Year = {1994} 17 | } 18 | 19 | @Book{Liu2013, 20 | Title = {\LaTeX 入门}, 21 | Author = {刘海洋}, 22 | Publisher = {电子工业出版社}, 23 | Year = {2013} 24 | } 25 | -------------------------------------------------------------------------------- /nputhesis-sample.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NPUSCG/nputhesis/1bed065a8cf8d02254d3e99a1c8c8f4b61b40552/nputhesis-sample.pdf -------------------------------------------------------------------------------- /nputhesis-sample.tex: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `nputhesis-sample.tex', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% nputhesis.dtx (with options: `sample') 8 | %% Copyright (C) 2020 by Zongze Yang 9 | %% 10 | %% It may be distributed and/or modified under the conditions of the LaTeX 11 | %% Project Public License, either version 1.3b of this license or (at your 12 | %% option) any later version. The latest version of this license is in 13 | %% https://www.latex-project.org/lppl.txt 14 | %% and version 1.3b or later is part of all distributions of LaTeX version 15 | %% 2005/12/01 or later. 16 | \documentclass[twoside, UTF8, phd, AutoFakeBold]{nputhesis} 17 | \usepackage{lipsum} 18 | \usepackage{hyperref} % 可以保证生成的 pdf 显示逻辑页码 19 | \usepackage{filecontents} 20 | \usepackage[backend=biber, 21 | style=gb7714-2015, maxbibnames=3,minbibnames=3, 22 | gbnamefmt=givenahead, 23 | doi=false, 24 | url=false, 25 | ]{biblatex} 26 | \begin{filecontents}{myrefs.bib} 27 | @Book{Knuth1986, 28 | Title = {The \TeX book}, 29 | Author = {Donald~Ervin Knuth}, 30 | Publisher = {Addison-Wesley}, 31 | Year = {1986} 32 | } 33 | 34 | @Book{Lamport1994, 35 | Title = {A Document Preparation System}, 36 | Author = {Leslie Lamport}, 37 | Publisher = {Addison-Wesley}, 38 | Year = {1994} 39 | } 40 | 41 | @Book{Liu2013, 42 | Title = {\LaTeX 入门}, 43 | Author = {刘海洋}, 44 | Publisher = {电子工业出版社}, 45 | Year = {2013} 46 | } 47 | \end{filecontents} 48 | \addbibresource{myrefs.bib} 49 | \schoolno{10699} 50 | \classno{O242} 51 | \secretlevel{公开} 52 | \authorno{0000999999} 53 | \title[\LaTeX\ Template of NPU Thesis]{西工大硕博学位论文 \LaTeX 模板} 54 | \author[\dbr{San Zhang}]{\dbr{张三}} 55 | \major[Philosophy in Mathematics]{数学} 56 | \supervisor[\dbr{Si Li}]{\dbr{李四}} 57 | \applydate[April 2046]{2046~年~4~月} 58 | \support{本文研究得到某某基金(编号:XXXXXXX)资助。} 59 | \begin{document} 60 | \makecover 61 | \frontmatter 62 | 63 | \begin{abstract} 64 | 本模板基本实现了西北工业大学硕博论文格式要求: 封皮, 页眉页脚, 65 | 章节标题格式, 参考文献格式等. 66 | \begin{keywords} 67 | 学位论文, \LaTeX\ 模板, 西工大 68 | \end{keywords} 69 | \end{abstract} 70 | \begin{Abstract} 71 | We implement the class |nputhesis| for the thesis of NWPU. 72 | \begin{Keywords} 73 | Thesis Template, \LaTeX, NPU 74 | \end{Keywords} 75 | \end{Abstract} 76 | 77 | \tableofcontents 78 | \printnomenclature 79 | 80 | \mainmatter 81 | 82 | \chapter{绪论} 83 | \section{\TeX 和 \LaTeX 介绍} 84 | \TeX \parencite{Knuth1986} 和 \LaTeX \cite{Lamport1994, Liu2013}的介绍. 85 | \section{nputhesis 简介} 86 | \chapter{基础知识} 87 | \section{基本命令} 88 | \section{宏包} 89 | 90 | \section{图表} 91 | \begin{table} 92 | \caption{数值误差和收敛阶} 93 | \begin{nputabu}{CCC} 94 | \toprule 95 | $N$ & $L^2$ 误差 & 收敛阶 \\ 96 | \midrule 97 | 4 & 8.1060e-03 & 0.00 \\ 98 | 8 & 2.0489e-03 & 1.98 \\ 99 | 16 & 5.3476e-04 & 1.94 \\ 100 | 32 & 1.5625e-04 & 1.77 \\ 101 | \bottomrule 102 | \end{nputabu} 103 | \end{table} 104 | \backmatter 105 | 106 | \printbibliography % biblatex 输出参考文件方式 107 | 108 | \Appendix % 编号附录 109 | 110 | \Appendix* % 不编号附录 111 | 112 | \Thanks % 致谢 113 | 114 | \Work 115 | \papersection % 以下填写发表论文情况 116 | 117 | \begin{npulist} 118 | \item {\bf \dbr{S. Zhang}}, \dbr{S. Li}. NPU 硕博学位论文 119 | \LaTeX\ 模板[D]. 2019. 120 | \end{npulist} 121 | 122 | \researchsection % 以下填写参加科研情况 123 | \begin{npulist} 124 | \item NPU \LaTeX 模板. 编号: 000000000, 参与. 125 | \end{npulist} 126 | \statement 127 | \end{document} 128 | %% 129 | %% This work consists of the file nputhesis.dtx 130 | %% and the derived files nputhesis.ins, 131 | %% nputhesis.pdf, 132 | %% nputhesis.cls, 133 | %% nputhesis-sample.tex, 134 | %% nputhesis-sample.pdf and 135 | %% README.org 136 | %% 137 | %% 138 | %% End of file `nputhesis-sample.tex'. 139 | -------------------------------------------------------------------------------- /nputhesis.cls: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `nputhesis.cls', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% nputhesis.dtx (with options: `class') 8 | %% Copyright (C) 2020 by Zongze Yang 9 | %% 10 | %% It may be distributed and/or modified under the conditions of the LaTeX 11 | %% Project Public License, either version 1.3b of this license or (at your 12 | %% option) any later version. The latest version of this license is in 13 | %% https://www.latex-project.org/lppl.txt 14 | %% and version 1.3b or later is part of all distributions of LaTeX version 15 | %% 2005/12/01 or later. 16 | \NeedsTeXFormat{LaTeX2e} 17 | \ProvidesClass{nputhesis} 18 | [2020/06/16 v1.0.0 NPU Thesis Template] 19 | \newif\if@npu@phd 20 | \newif\if@npu@blankinfo 21 | \newif\if@npu@dbr % for double-blind review 22 | \def\set@npu@phd{\@npu@phdtrue} 23 | \def\set@npu@ma{\@npu@phdfalse} 24 | \RequirePackage{xkeyval} 25 | \DeclareOptionX{blankinfo}[false]{\csname @npu@blankinfo#1\endcsname} 26 | \DeclareOptionX{thesistype}[phd]{\csname set@npu@#1\endcsname} 27 | \DeclareOptionX{phd}{\@npu@phdtrue} 28 | \DeclareOptionX{ma}{\@npu@phdfalse} 29 | \DeclareOptionX{dbr}[true]{\csname @npu@dbr#1\endcsname} 30 | \DeclareOptionX*{\PassOptionsToClass{\CurrentOption}{ctexbook}} 31 | \ExecuteOptionsX{thesistype=phd} 32 | \ExecuteOptionsX{dbr=false} 33 | \ProcessOptionsX \relax 34 | \LoadClass[heading=true,zihao=-4]{ctexbook} 35 | \RequirePackage{geometry} 36 | \RequirePackage{xcolor} 37 | \RequirePackage{fancyhdr} 38 | \RequirePackage{titletoc} 39 | \RequirePackage{caption} 40 | \RequirePackage{ulem} 41 | \RequirePackage{amsthm} 42 | \RequirePackage{amsmath} 43 | \RequirePackage{amsfonts} 44 | \RequirePackage{setspace} 45 | \RequirePackage{longtable} 46 | \RequirePackage{booktabs} 47 | \RequirePackage{tabularx} 48 | \RequirePackage{multirow} 49 | \RequirePackage{graphicx} 50 | \RequirePackage{ifxetex} 51 | \ifxetex 52 | \setmainfont{Times New Roman} 53 | \fi 54 | \newcommand\@npu@replace[1]{{% 55 | \setlength{\fboxsep}{0pt}% 56 | \colorbox{black}{\phantom{#1}}}} 57 | \newcommand{\dbr}[1]{\if@npu@dbr \@npu@replace{#1}\relax\else #1\fi} 58 | \geometry{paperwidth=210mm,paperheight=297mm,% 59 | left=2.5cm,right=2.5cm,top=2.54cm,bottom=2.54cm} 60 | \topmargin=-10.4mm 61 | \headheight=17pt 62 | \footskip=8mm 63 | \headsep=5mm 64 | \pagestyle{fancy} 65 | \fancyhf{} 66 | \fancyhead[EC]{\songti\zihao{-5}\npu@rightmark} 67 | \fancyhead[OC]{\songti\zihao{-5}\leftmark} 68 | \fancyfoot[C]{\songti\zihao{5}\thepage} 69 | \renewcommand{\headrule}{% 70 | \hrule width\headwidth height2.8pt \vspace{1pt}% 71 | \hrule width\headwidth height0.8pt} 72 | \fancypagestyle{plain}{\thispagestyle{fancy}} 73 | \newcommand{\clearpagestyle}{\clearpage{\pagestyle{empty}\cleardoublepage}} 74 | \ifx\ctexset\undefined 75 | \CTEXsetup[ % name={,}, number={\arabic{chapter}},% use default value 76 | beforeskip={0pt}, afterskip={20pt}]{chapter} 77 | \CTEXsetup[nameformat={\heiti\zihao{3}\bf}]{chapter} 78 | \CTEXsetup[titleformat={\heiti\zihao{3}}]{chapter} 79 | \CTEXsetup[format={\heiti\zihao{4}}]{section} 80 | \CTEXsetup[format={\heiti\zihao{-4}}]{subsection} 81 | \else 82 | \ctexset{ 83 | contentsname = {\npu@contents} 84 | } 85 | % title format of chapter 86 | \ctexset{ 87 | % chapter/name={,}, % use default value in ctex 88 | % chapter/number=\arabic{chapter}, % use default value in ctex 89 | chapter/beforeskip={0pt}, 90 | chapter/afterskip={20pt}, 91 | chapter/format={\heiti\zihao{3}\centering} 92 | } 93 | % title format of section 94 | \ctexset{ 95 | section/name={,}, 96 | % section/beforeskip={2ex plus .5ex minus .1ex}, 97 | % section/afterskip={1ex plus .1ex}, 98 | section/format={\heiti\zihao{4}} 99 | } 100 | % title format of subsection 101 | \ctexset{ 102 | subsection/name={,}, 103 | % subsection/beforeskip={2ex plus .5ex minus .1ex}, 104 | % subsection/afterskip={1ex plus .1ex}, 105 | subsection/format={\heiti\zihao{-4}} 106 | } 107 | \ctexset{ 108 | subsubsection/name={,}, 109 | % subsubsection/beforeskip={1ex plus .3ex minus .1ex}, 110 | % subsubsection/afterskip={.5ex plus .1ex}, 111 | subsubsection/format={\heiti\zihao{-4}} 112 | } 113 | \ctexset{ 114 | paragraph/name={,}, 115 | % paragraph/beforeskip={1ex plus .3ex minus .1ex}, 116 | % paragraph/afterskip={.5ex plus .1ex}, 117 | paragraph/format={\heiti\zihao{-4}} 118 | } 119 | \ctexset{ 120 | subparagraph/name={,}, 121 | % subparagraph/beforeskip={1ex plus .3ex minus .1ex}, 122 | % subparagraph/afterskip={.5ex plus .1ex}, 123 | subparagraph/format={\heiti\zihao{-4}} 124 | } 125 | \fi 126 | \def\@contentfont{\songti\zihao{-4}} 127 | \titlecontents{chapter}[0pt]{\@contentfont} 128 | {\thecontentslabel\hspace{.5em}}{} 129 | {\hspace{.5em}\titlerule*{.}\contentspage} 130 | \titlecontents{section}[15pt]{\@contentfont} 131 | {\thecontentslabel\quad}{} 132 | {\hspace{.5em}\titlerule*{.}\contentspage} 133 | \titlecontents{subsection}[30pt]{\@contentfont} 134 | {\thecontentslabel\quad}{} 135 | {\hspace{.5em}\titlerule*{.}\contentspage} 136 | \def\title{\@ifnextchar[\@@title{\@@title[]}} 137 | \def\author{\@ifnextchar[\@@author{\@@author[]}} 138 | \def\major{\@ifnextchar[\@@major{\@@major[]}} 139 | \def\supervisor{\@ifnextchar[\@@supervisor{\@@supervisor[]}} 140 | \def\applydate{\@ifnextchar[\@@applydate{\@@applydate[]}} 141 | \def\@@title[#1]#2{\def\@title@en{#1}\def\@title{#2}} 142 | \def\@@author[#1]#2{\def\@author@en{#1}\def\@author{#2}} 143 | \def\@@major[#1]#2{\def\@major@en{#1}\def\@major{#2}} 144 | \def\@@supervisor[#1]#2{\def\@supervisor@en{#1}\def\@supervisor{#2}} 145 | \def\@@applydate[#1]#2{\def\@applydate@en{#1}\def\@applydate{#2}} 146 | \def\@title{}\def\@title@en{} 147 | \def\@author{}\def\@author@en{} 148 | \def\@major{}\def\@major@en{} 149 | \def\@supervisor{}\def\@supervisor@en{} 150 | \def\@applydate{}\def\@applydate@en{} 151 | \def\npu@empty{} 152 | \def\schoolno#1{\def\@schoolno{#1}}\def\@schoolno{} 153 | \def\classno#1{\def\@classno{#1}}\def\@classno{} 154 | \def\secretlevel#1{\def\@secretlevel{#1}}\def\@secretlevel{} 155 | \def\authorno#1{\def\@authorno{#1}}\def\@authorno{} 156 | \def\support#1{\def\@support{#1}}\def\@support{} 157 | \if@npu@phd 158 | \def\npu@degreename@en{Doctor} 159 | \else 160 | \def\npu@degreename@en{Master} 161 | \fi 162 | \linespread{1.25} 163 | \renewenvironment{titlepage} 164 | {% 165 | \cleardoublepage 166 | \if@twocolumn 167 | \@restonecoltrue\onecolumn 168 | \else 169 | \@restonecolfalse\newpage 170 | \fi 171 | \thispagestyle{empty}% 172 | % \setcounter{page}\z@ 173 | }% 174 | {\if@restonecol\twocolumn \else \newpage \fi 175 | } 176 | \def\makeoutercover{ 177 | \begin{titlepage} 178 | \bfseries 179 | \linespread{1.25} 180 | \begin{center} 181 | \hfill% default \bf font 182 | \heiti\zihao{5} 183 | \newlength{\max@length} 184 | \settowidth{\max@length}{\npu@schoolno\npu@comma 2000000000} 185 | \newlength{\name@length} 186 | \settowidth{\name@length}{\npu@schoolno} 187 | \begin{minipage}{\max@length} 188 | \vskip.5cm 189 | \renewcommand\arraystretch{1.2} 190 | \begin{tabular}{|c|c|}\hline 191 | \makebox[\name@length][s]{\npu@schoolno} & \@schoolno \\ \hline 192 | \makebox[\name@length][s]{\npu@classno} & \@classno \\ \hline 193 | \makebox[\name@length][s]{\npu@secretlevel}& \@secretlevel \\ \hline 194 | \makebox[\name@length][s]{\npu@authorno} & \@authorno \\ \hline 195 | \end{tabular} 196 | \end{minipage} 197 | \par\vspace{9cm} 198 | \songti\zihao{2} 199 | \begin{minipage}[t]{2cm} 200 | \hfill\npu@title\\ 201 | \end{minipage} 202 | %\hbox to 2.5cm{\hfill \npu@title} 203 | \setbox123=\hbox{ 204 | \begin{minipage}[t]{12cm} 205 | \begin{center} 206 | \heiti\@title 207 | \end{center} 208 | \end{minipage} } 209 | \setbox124=\hbox{ 210 | \begin{minipage}[t]{12cm} 211 | \begin{center} 212 | \uline{\hfill\quad\hfill}\\ 213 | \uline{\hfill\quad\hfill}\\ 214 | \end{center} 215 | \end{minipage} } 216 | \hskip-0.5cm 217 | \copy123\kern-\wd123\box124 218 | \zihao{3} 219 | \par\vspace{2.5\baselineskip} 220 | \begin{minipage}{5cm} 221 | {\kaishu\npu@author} \uline{\hfill\@author\hfill} 222 | \end{minipage} 223 | \par\vspace{2.5\baselineskip} 224 | \settowidth{\name@length}{\npu@applydate} 225 | \begin{minipage}{12.5cm} 226 | \noindent 227 | \makebox[\name@length][s]{\npu@major}% 228 | {\uline{\hfill{\@major}\hfill}} \par 229 | \vspace{0.5\baselineskip} 230 | \makebox[\name@length][s]{\npu@supervisor}% 231 | {\uline{\hfill\@supervisor\hfill}} \par 232 | \vspace{0.5\baselineskip} 233 | \makebox[\name@length][s]{\npu@applydate}% 234 | {\uline{\hfill\@applydate\hfill}} \par 235 | \end{minipage} 236 | \vspace{2\baselineskip} 237 | \end{center} 238 | \end{titlepage} 239 | \clearpagestyle 240 | } 241 | \def\makeinnercover@zh{% 242 | \begin{titlepage} 243 | \linespread{1.25} 244 | \vspace*{2cm} 245 | \begin{center} 246 | \settowidth{\name@length}{\zihao{3}\npu@schoolname} 247 | \divide\name@length by 12 248 | \multiply\name@length by 17 249 | \makebox[\name@length][s]{\zihao{3}\npu@schoolname} 250 | \vskip5mm 251 | \settowidth{\name@length}{\zihao{1}\npu@degree} 252 | \divide\name@length by 12 253 | \multiply\name@length by 17 254 | \makebox[\name@length][s]{\zihao{1}\npu@degree} 255 | \vskip5mm 256 | \centerline{\zihao{4}\npu@degreeclass} 257 | \vskip5cm 258 | \zihao{2} 259 | \begin{minipage}[t]{2.5cm} 260 | \hfil\npu@title\npu@comma 261 | \end{minipage} 262 | \setbox123=\hbox{ 263 | \begin{minipage}[t]{11cm} 264 | \begin{center} 265 | \@title 266 | \end{center} 267 | \end{minipage}} 268 | \setbox124=\hbox{ 269 | \begin{minipage}[t]{11cm} 270 | \begin{center} 271 | \uline{\hfill\quad\hfill}\\ 272 | \uline{\hfill\quad\hfill}\\ 273 | \end{center} 274 | \end{minipage}} 275 | \hskip-1cm 276 | \copy123\kern-\wd123\box124 277 | \par\vspace{4cm} 278 | \zihao{3} 279 | \settowidth{\name@length}{\npu@major} 280 | \begin{minipage}{8cm} 281 | \noindent 282 | \makebox[\name@length][s]{\npu@author}\npu@comma% 283 | \uline{\hfill\@author\hfill} \par 284 | \vspace{0.25\baselineskip} 285 | \makebox[\name@length][s]{\npu@major}\npu@comma% 286 | \uline{\hfill\@major\hfill} \par 287 | \vspace{0.25\baselineskip} 288 | \makebox[\name@length][s]{\npu@supervisor}\npu@comma% 289 | \uline{\hfill\@supervisor\hfill}\par 290 | \vspace{1\baselineskip} 291 | \end{minipage} 292 | \vspace{2\baselineskip} 293 | \par\makebox[30mm]{\@applydate}\hfill 294 | \end{center} 295 | \end{titlepage} 296 | \clearpagestyle 297 | } 298 | \def\makeinnercover@en{% 299 | \begin{titlepage} 300 | \linespread{1.25} 301 | \vspace*{1.5cm} 302 | \zihao{3} 303 | \begin{center} 304 | {\bf 305 | %\Large 306 | \@title@en \\ 307 | \vspace{3\baselineskip} 308 | \zihao{-3} 309 | By\\ 310 | \ifx\@author@en\npu@empty\quad\else\@author@en\fi\\ 311 | \vspace{1\baselineskip} 312 | Under the Supervision of Professor\\ 313 | \ifx\@supervisor@en\npu@empty\quad\else\@supervisor@en\fi\\} 314 | %\Large 315 | \vspace{4\baselineskip} 316 | A Dissertation Submitted to\\ 317 | Northwestern Polytechnical University\\ 318 | \vspace{1\baselineskip} 319 | In Partial Fulfillment of the Requirement\\ 320 | for the Degree of\\ 321 | \npu@degreename@en\ of \@major@en\\ 322 | \vspace{4\baselineskip} 323 | Xi'an, P. R. China\\ 324 | \@applydate@en 325 | \end{center} 326 | \end{titlepage} 327 | \clearpagestyle 328 | } 329 | \def\makecover{% 330 | \pagenumbering{Alph}% 331 | \makeoutercover% 332 | \setcounter{page}\@ne 333 | \pagenumbering{roman}% 334 | \makeinnercover@zh% 335 | \makeinnercover@en% 336 | } 337 | \let\npu@frontmatter\frontmatter 338 | \def\frontmatter{\npu@frontmatter\pagenumbering{Roman}} 339 | \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else 340 | \hbox{} 341 | \vspace*{\fill} 342 | \begin{center}\Large 343 | \if@npu@blankinfo 344 | \textcolor{gray!60}{This Page Intentionally Left Blank!} 345 | \fi 346 | \end{center} 347 | \vspace{\fill} 348 | \thispagestyle{empty} 349 | \newpage 350 | \if@twocolumn\hbox{}\newpage\fi\fi\fi} 351 | \newenvironment{abstract}{% 352 | \chapter{\npu@abstract}%\addcontentsline{toc}{chapter}{\npu@abstract}% 353 | \newenvironment{keywords}{% 354 | \vspace{2\baselineskip}\par\textbf{\npu@keywords\npu@comma}}{} 355 | }{\vfill\zihao{5}\@support} 356 | 357 | \newenvironment{Abstract}{% 358 | \chapter{\npu@Abstract}%\addcontentsline{toc}{chapter}{\npu@Abstract}% 359 | \newenvironment{Keywords}{% 360 | \vspace{2\baselineskip}\par\textbf{\npu@Keywords\npu@comma}}{}}{} 361 | \DeclareCaptionFont{song}{\songti\zihao{5}} 362 | \captionsetup{labelsep=quad, font=song} 363 | \captionsetup[figure]{aboveskip=10pt, belowskip=10pt} 364 | \captionsetup[table]{aboveskip=10pt, belowskip=10pt} 365 | \renewcommand\thetable{\arabic{chapter}-\arabic{table}} 366 | \renewcommand\thefigure{\arabic{chapter}-\arabic{figure}} 367 | \renewcommand\theequation{\arabic{chapter}-\arabic{equation}} 368 | \let\@ldtabular\tabular 369 | \let\end@ldtabular\endtabular 370 | \renewenvironment{tabular}{\zihao{5}\@ldtabular}{\end@ldtabular} 371 | 372 | \newcolumntype{L}{>{\raggedright\arraybackslash}X} 373 | \newcolumntype{R}{>{\raggedleft\arraybackslash}X} 374 | \newcolumntype{C}{>{\centering\arraybackslash}X} 375 | \newenvironment{nputabu}[1][\zihao{5}]% 376 | {\begingroup #1\tabularx{\textwidth}}{\endtabularx\endgroup} 377 | 378 | \newenvironment{npulist}{% 379 | \begingroup\renewcommand{\labelenumi}{[\theenumi].}\enumerate}% 380 | {\endenumerate\endgroup} 381 | \let\npu@chapter\chapter 382 | \def\npu@star@chapter#1{\npu@chapter{#1}} 383 | \def\chapter{\secdef\npu@chapter\npu@star@chapter} 384 | \newcounter{npu@c@appendix} 385 | \setcounter{npu@c@appendix}{0} 386 | \def\npu@star@Appendix{\chapter{\npu@appendix}} 387 | \def\npu@Appendix{\addtocounter{npu@c@appendix}{1}% 388 | \chapter{\npu@appendix\Alph{npu@c@appendix}}} 389 | \def\Appendix{\@ifstar{\npu@star@Appendix}{\npu@Appendix}} 390 | \def\Thanks{\chapter{\npu@thanks}} 391 | \newcommand\Work{\chapter{\npu@work}} 392 | \newcommand\papersection{\section*{\npu@work@paper}} 393 | \newcommand\researchsection{\section*{\npu@work@research}} 394 | \def\statement{ 395 | \begin{titlepage} 396 | \linespread{1.5} 397 | \parskip=7pt 398 | \vspace*{0pt} 399 | \songti\zihao{4} 400 | \centerline{\bf \npu@schoolname} 401 | \centerline{\bf \npu@p@statement} 402 | \songti\zihao{5} 403 | \npu@longp@statement\par 404 | \npu@a@signature\npu@comma\underline{\qquad\qquad\qquad} \hfill 405 | \npu@s@signature\npu@comma\underline{\qquad\qquad\qquad} \par 406 | \hskip 3cm \npu@ymd \hfill\hskip 3cm \npu@ymd 407 | \vspace*{30pt} 408 | \hbox to \hsize{\leaders\hbox to 1em{\hss--\hss}\hfill} 409 | 410 | \vspace*{50pt} 411 | \songti\zihao{4} 412 | \centerline{\bf \npu@schoolname} 413 | \centerline{\bf \npu@c@statement} 414 | \songti\zihao{5} 415 | \npu@longc@statement\par 416 | \hskip5.5cm 417 | \hfill\npu@a@signature\npu@comma\underline{\qquad\qquad\qquad}\par 418 | \hfill\hskip8.5cm \npu@ymd 419 | \end{titlepage}} 420 | \newtheoremstyle{nputheorem}% name 421 | {0pt}% Space above 422 | {0pt}% Space below 423 | {\itshape}% Body font 424 | {}% Indent amount 425 | {\bfseries}% Theorem head font 426 | {}% Punctuation after theorem head 427 | {.5em}% Space after theorem head 428 | {}% Theorem head spec (can be left empty, meaning ‘normal’ ) 429 | 430 | \newtheoremstyle{npuplain}% name 431 | {0pt}% Space above 432 | {0pt}% Space below 433 | {}% Body font 434 | {}% Indent amount 435 | {\bfseries}% Theorem head font 436 | {}% Punctuation after theorem head 437 | {.5em}% Space after theorem head 438 | {}% Theorem head spec (can be left empty, meaning ‘normal’ ) 439 | 440 | \theoremstyle{npuplain} % set default style to npuplain 441 | \RequirePackage{nomencl} % add symbol notation 442 | \RequirePackage{multicol} % for two column notation 443 | \makenomenclature 444 | \renewcommand{\nomname}{\npu@nomname} 445 | 446 | \@ifundefined{chapter} 447 | {\def\wilh@nomsection{section}} 448 | {\def\wilh@nomsection{chapter}} 449 | 450 | \def\thenomenclature{% 451 | % \newlength{\npu@columnsep@save} 452 | % \setlength{\npu@columnsep@save}{\columnsep} 453 | % \setlength{\columnsep}{20pt} 454 | % \begin{multicols}{2}[% 455 | \csname\wilh@nomsection\endcsname*{\nomname} 456 | \if@intoc\addcontentsline{toc}{\wilh@nomsection}{\nomname}\fi 457 | \nompreamble % \raggedcolumns 458 | % ] 459 | \list{}{% 460 | \labelsep=15pt 461 | \labelwidth\nom@tempdim 462 | \leftmargin\labelwidth 463 | \advance\leftmargin\labelsep 464 | \itemsep\nomitemsep 465 | \let\makelabel\nomlabel}% 466 | } 467 | \def\endthenomenclature{% 468 | \endlist 469 | % \end{multicols} 470 | % \setlength{\columnsep}{\npu@columnsep@save} 471 | \nompostamble} 472 | \def\npu@degreename@zh{\if@npu@phd 博士\else 硕士\fi} 473 | \def\npu@comma{~:~} 474 | \def\npu@schoolno{学校代码} 475 | \def\npu@classno{分类号} 476 | \def\npu@secretlevel{密级} 477 | \def\npu@authorno{学号} 478 | \def\npu@title{题目} 479 | \def\npu@author{作者} 480 | \def\npu@major{学科、专业} 481 | \def\npu@supervisor{指导教师} 482 | \def\npu@applydate{申请学位日期} 483 | \def\npu@schoolname{西北工业大学} 484 | \def\npu@degree{\npu@degreename@zh 学位论文} 485 | \def\npu@degreeclass{(学位研究生)} 486 | \def\npu@rightmark{西北工业大学\npu@degreename@zh 学位论文} 487 | \def\npu@Abstract{Abstract} 488 | \def\npu@abstract{摘\quad 要} 489 | \def\npu@Keywords{Key words} 490 | \def\npu@keywords{关键词} 491 | \def\npu@contents{目\quad 录} 492 | \def\npu@nomname{符号表} 493 | \def\npu@appendix{附\quad 录} 494 | \def\npu@thanks{致\quad 谢} 495 | \def\npu@work{攻读\npu@degreename@zh 学位期间发表的学术论文和参加科研情况} 496 | \def\npu@work@paper{发表学术论文} 497 | \def\npu@work@research{参加科研情况} 498 | \def\npu@p@statement{学位论文知识产权声明书} 499 | \def\npu@c@statement{学位论文原创性声明} 500 | \def\npu@ymd{年\qquad 月\qquad 日} 501 | \def\npu@a@signature{学位论文作者签名} 502 | \def\npu@s@signature{指导教师签名} 503 | \long\def\npu@longp@statement{% 504 | 本人完全了解学校有关保护知识产权的规定,即:研究生在校攻读学位期间论文工作的 505 | 知识产权单位属于西北工业大学。学校有权保留并向国家有关部门或机构送交论文的复 506 | 印件和电子版。本人允许论文被查阅和借阅。学校可以将本学位论文的全部或部分内容 507 | 编入有关数据库进行检索,可以采用影印、缩印或扫描等复制手段保存和汇编本学位论 508 | 文。同时本人保证,毕业后结合学位论文研究课题再撰写的文章一律注明作者单位为西 509 | 北工业大学。 510 | \par 保密论文待解密后适用本声明。} 511 | \long\def\npu@longc@statement{% 512 | 秉承学校严谨的学风和优良的科学道德,本人郑重声明:所呈交的学位论文,是本人在 513 | 导师的指导下进行研究工作所取得的成果。尽我所知,除文中已经注明引用的内容和致 514 | 谢的地方外,本论文不包含任何其他个人或集体已经公开发表或撰写过的研究成果,不 515 | 包含本人或其他已申请学位或其他用途使用过的成果。对本文的研究做出重要贡献的个 516 | 人和集体,均已在文中以明确方式表明。 517 | \par 本人学位论文与资料若有不实,愿意承担一切相关的法律责任。} 518 | %% 519 | %% This work consists of the file nputhesis.dtx 520 | %% and the derived files nputhesis.ins, 521 | %% nputhesis.pdf, 522 | %% nputhesis.cls, 523 | %% nputhesis-sample.tex, 524 | %% nputhesis-sample.pdf and 525 | %% README.org 526 | %% 527 | %% 528 | %% End of file `nputhesis.cls'. 529 | -------------------------------------------------------------------------------- /nputhesis.dtx: -------------------------------------------------------------------------------- 1 | % \iffalse meta-comment 2 | % !TeX program = XeLaTeX 3 | % !TeX encoding = UTF-8 4 | % 5 | % Copyright (C) 2020 by Zongze Yang 6 | % 7 | % It may be distributed and/or modified under the 8 | % conditions of the LaTeX Project Public License, either version 1.3b 9 | % of this license or (at your option) any later version. 10 | % The latest version of this license is in 11 | % https://www.latex-project.org/lppl.txt 12 | % and version 1.3b or later is part of all distributions of LaTeX 13 | % version 2005/12/01 or later. 14 | % 15 | %<*internal> 16 | \iffalse 17 | % 18 | %<*readme> 19 | * NPU 博士、硕士学位论文 \LaTeX 模板 20 | =nputhesis= 是基于\LaTeX 的 =ctexbook= 文类编写的[[https://www.nwpu.edu.cn][西北工业大学]]博士、硕士论文格式文类, 基本实现了[[http://gs.nwpu.edu.cn/info/2021/5046.htm][博士、硕士学位论文撰写规定]]的要求. 21 | 22 | ** \TeX 环境 23 | =sample.tex= 源文件使用 =UTF8= 编码在 =TeXLive 2019= 下使用引擎 =xelatex= 及 =pdflatex= 24 | 编译通过. 其他环境未测试. 25 | 26 | (* 推荐使用新版 =TeXLive= 下的 =xelatex= 进行编译 *) 27 | 28 | ** 如何使用 29 | 1. 如何使用该文类 30 | 在 \TeX 文档开头使用 =nputhesis= 文类即可, 如 31 | =\documentclass[twoside,UTF8,phd,AutoFakeBold]{nputhesis}=. 32 | 33 | 这里使用 =AutoFakeBold= 为外封面的字体加黑. 在 TeXLive 2019 之前的版本中, 34 | 启用该选项将导致 =xelatex= 编译生成的 =pdf= 文件内容复制时显示为乱码, 进而导致查重报告显示为乱码. 35 | 解决方法有以下三种: 36 | 1) 升级 TeXLive 到 2019 版. 37 | 2) 使用 Adobe 字体. 首先自行下载安装 Adobe 字体, 然后在 =tex= 源文件导言区重新定义相关字体, 如 38 | #+BEGIN_SRC tex 39 | \documentclass[twoside, UTF8, phd, dbr, AutoFakeBold]{nputhesis} 40 | % 导言区 41 | \renewcommand{\songti}{\CJKfontspec{Adobe Song Std L}} % adobe 宋体 42 | \renewcommand{\kaishu}{\CJKfontspec{Adobe Kaiti Std R}} % adobe 楷体 43 | \renewcommand{\heiti}{\CJKfontspec{Adobe Heiti Std R}} % adobe 黑体 44 | \renewcommand{\fangsong}{\CJKfontspec{Adobe Fangsong Std R}} % adobe 仿宋 45 | % other command 46 | \begin{document} 47 | 正文 48 | \end{document} 49 | #+END_SRC 50 | 3) 去掉 =AutoFakeBold= 选项. 这样会导致外封面字体不能加黑. 51 | 52 | 2. 如何编译 53 | 推荐使用 `latexmk' 命令进行编译, 编译命令如下 54 | #+BEGIN_SRC shell 55 | latexmk -xelatex -synctex=1 nputhesis-sample.tex 56 | #+END_SRC 57 | 3. 符号表的生成 58 | 由于符号表需要使用外部程序 `makeindex' 辅助生成, 所以我们添加了 `latexmkrc' 文件, 59 | 只要使用上述 `latexmk' 命令符号表可以自动生成, 否则, 需要手动调用 'makeindex' 程序 60 | #+BEGIN_SRC shell 61 | makeindex nputhesis-sample.nlo -s nomencl.ist -o nputhesis-sample.nls -t nputhesis-sample.nlg 62 | #+END_SRC 63 | 64 | *** 文档选项说明 65 | 1. 由于 =nputhesis= 基于 =book= 实现, =book= 文类的选项这里均能是使用, 如 =twoside=. 66 | 2. =nputhesis= 新定义的选项 67 | - =UTF8= : 传递给宏包 =ctexcap=, 用于中文标题处理. 68 | - =phd= : 使用博士论文模板, 默认选项. 69 | - =ma= : 使用硕士论文模板. 70 | - =dbr= : 用于隐藏作者和导师名, 需要使用命令 =\dbr=. 71 | - =blankinfo= : 空白页信息开关, 用于在偶数空白页显示 `This Page Intentionally Left Blank!`, 默认不显示. 72 | 73 | *** 使用的宏包及定义的环境 74 | 该文类内部已包含宏包 =geometry=, =xcolor=, =fancyhdr=, =titletoc=, =caption=, =ulem=, 75 | =amsthm=, =amsmath=, =amsfonts=, =setspace=, =longtable=, =booktabs=, =tabularx=, 76 | =multirow=, =graphicx=, =ctex=, =nomencl=, =multicol=. 77 | 78 | 1. 使用了 =amsthm= 宏包定义了定理格式 =nputheorem= 和 =npuplain=, 并默认启用 =npuplain=. 79 | 在文档中 =\newtheorem{theorem}{定理}[section]= 定义新环境将默认使用格式. 若需更改将 80 | 要定义的定理格式为其他格式, 如 =nputheorem=, 请使用如下命令: 81 | #+BEGIN_SRC tex 82 | \theoremstyle{nputheorem} 83 | \newtheorem{npu-thm}{斜体定理}[section] 84 | #+END_SRC 85 | 那么 =npu-thm= 环境将使用 =nputheorem= 格式. 86 | 2. 符号表生成使用了宏包 =nomencl= . 在需要显示符号表的地方使用命令 =\printnomenclature= 即可, 87 | 模板中符号表在目录后. 添加符号请使用命令 =\nomenclature{}{}=. 88 | 89 | *** 关于参考文献得说明 90 | 推荐使用 =biblatex= 宏包生成参考文献. 若确实需要使用 =bst= 文件生成参考文件, 可以考虑 91 | 使用 [[https://github.com/Haixing-Hu][@Haixing-Hu]] 编写的 `bst' 文件 92 | [[https://github.com/Haixing-Hu/GBT7714-2005-BibTeX-Style][`gbt7741-2005.bst']]. 93 | 94 | ** 其他链接 95 | 1. [[https://github.com/polossk][@polossk]]: [[https://github.com/polossk/LaTeX-Template-For-NPU-Thesis][LaTeX-Template-For-NPU-Thesis]] 96 | 2. [[https://github.com/NPUSCG][@NPUSCG]]: [[https://github.com/NPUSCG/npu-dissertation-proposal][西北工业大学研究生选题报告表 \LaTeX 模板]] 97 | 3. [[https://github.com/Haixing-Hu][@Haixing-Hu]]: [[https://github.com/Haixing-Hu/GBT7714-2005-BibTeX-Style][`gbt7741-2005.bst']]. 98 | 99 | ** License 100 | 101 | MIT License 102 | 103 | Copyright (c) 2020 Yang Zongze (yangzongze@gmail.com) 104 | 105 | Permission is hereby granted, free of charge, to any person obtaining a copy 106 | of this software and associated documentation files (the "Software"), to deal 107 | in the Software without restriction, including without limitation the rights 108 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 109 | copies of the Software, and to permit persons to whom the Software is 110 | furnished to do so, subject to the following conditions: 111 | 112 | The above copyright notice and this permission notice shall be included in all 113 | copies or substantial portions of the Software. 114 | 115 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 116 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 117 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 118 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 119 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 120 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 121 | SOFTWARE. 122 | % 123 | %<*internal> 124 | \fi 125 | \def\nameofplainTeX{plain} 126 | \ifx\fmtname\nameofplainTeX\else 127 | \expandafter\begingroup 128 | \fi 129 | % 130 | %<*install> 131 | \input docstrip.tex 132 | \keepsilent 133 | \askforoverwritefalse 134 | \preamble 135 | Copyright (C) 2020 by Zongze Yang 136 | 137 | It may be distributed and/or modified under the conditions of the LaTeX 138 | Project Public License, either version 1.3b of this license or (at your 139 | option) any later version. The latest version of this license is in 140 | https://www.latex-project.org/lppl.txt 141 | and version 1.3b or later is part of all distributions of LaTeX version 142 | 2005/12/01 or later. 143 | \endpreamble 144 | \postamble 145 | 146 | This work consists of the file nputhesis.dtx 147 | and the derived files nputhesis.ins, 148 | nputhesis.pdf, 149 | nputhesis.cls, 150 | nputhesis-sample.tex, 151 | nputhesis-sample.pdf and 152 | README.org 153 | 154 | \endpostamble 155 | 156 | \generate 157 | { 158 | \usedir{tex/latex/nputhesis} 159 | \file{nputhesis.cls} {\from{\jobname.dtx}{class}} 160 | % 161 | %<*internal> 162 | \usedir{source/latex/nputhesis} 163 | \file{\jobname.ins} {\from{\jobname.dtx}{install}} 164 | % 165 | %<*install> 166 | \usedir{doc/latex/nputhesis} 167 | \file{nputhesis-sample.tex} {\from{\jobname.dtx}{sample}} 168 | \nopreamble\nopostamble 169 | \file{README.org} {\from{\jobname.dtx}{readme}} 170 | } 171 | 172 | \Msg{*************************************************************} 173 | \Msg{* *} 174 | \Msg{* To finish the installation you have to move the following *} 175 | \Msg{* files into a directory searched by TeX: *} 176 | \Msg{* *} 177 | \Msg{* \space\space nputhesis.cls *} 178 | \Msg{* *} 179 | \Msg{* To produce the documentation run the files ending with *} 180 | \Msg{* `.dtx' through XeLaTeX. *} 181 | \Msg{* *} 182 | \Msg{* Happy TeXing *} 183 | \Msg{*************************************************************} 184 | 185 | % 186 | %\endbatchfile 187 | %<*internal> 188 | \ifx\fmtname\nameofplainTeX 189 | \expandafter\endbatchfile 190 | \else 191 | \expandafter\endgroup 192 | \fi 193 | % 194 | %<*driver> 195 | \ProvidesFile{nputhesis.dtx} 196 | % 197 | %\NeedsTeXFormat{LaTeX2e} 198 | %\ProvidesClass{nputhesis} 199 | %<*class> 200 | [2020/06/16 v1.0.0 NPU Thesis Template] 201 | % 202 | %<*driver> 203 | \documentclass{ctxdoc} 204 | \usepackage{booktabs} 205 | \EnableCrossrefs 206 | \CodelineIndex 207 | \RecordChanges 208 | \begin{document} 209 | \DocInput{nputhesis.dtx} 210 | \IndexLayout 211 | \PrintChanges 212 | \PrintIndex 213 | \end{document} 214 | % 215 | % \fi 216 | % \changes{v1.0.0}{2020/04/21}{Revise the README file} 217 | % \changes{v1.0.0}{2020/02/18}{Initial version use dtx} 218 | % \changes{v0.6.2}{2020/01/10}{Adjust the skip of the chapter title} 219 | % \changes{v0.6.2}{2020/01/10}{Make the line under the title longer} 220 | % \changes{v0.6.2}{2020/01/10}{Remark: ``AutoFakeBold'' option can be used 221 | % when load this document class to make the font in the cover page as bold 222 | % font} 223 | % \changes{v0.6.1}{2019/12/28}{Delete option workbib} 224 | % \changes{v0.6.1}{2019/12/28}{Replace nputhesis.bst by gbt7714-2005.bst} 225 | % \changes{v0.6.1}{2019/12/28} 226 | % {Modify font size in tabular environment to `zihao{5}'} 227 | % \changes{v0.6.1}{2019/12/28}{Add `nputabu' environment} 228 | % \changes{v0.6.1}{2019/12/28} 229 | % {Add theorem style `npuplain', and set it to default} 230 | % 231 | % \GetFileInfo{nputhesis.dtx} 232 | % 233 | % \DoNotIndex{\newcommmand, \newenvironment} 234 | % 235 | % \title{The \textsf{nputhesis} class\thanks{This document 236 | % corresponds to \textsf{nputhesis}~\fileversion, dated \filedate.}} 237 | % \author{Zongze Yang\\ \texttt{yangzongze@gmail.com}} 238 | % 239 | % \date{\filedate} 240 | % \maketitle 241 | % \tableofcontents 242 | % 243 | % \StopEventually{} 244 | % 245 | % \section{简介} 246 | % 247 | % \section{使用方法} 248 | % \subsection{加载文类} 249 | % 加载 nputhesis 文档类 250 | % \begin{frameverb} 251 | % \documentclass[twoside, UTF8, phd, AutoFakeBold]{nputhesis} 252 | % \end{frameverb} 253 | % 254 | % \changes{v1.0.0}{2020/03/28}{Add comments on the option ``AutoFakeBold'' in the documents} 255 | % { 256 | % \color{red} 这里使用 |AutoFakeBold| 为外封面的字体加黑. 在 TeXLive 2019 之前的版本中, 257 | % 启用该选项将导致 =xelatex= 编译生成的 =pdf= 文件内容复制时显示为乱码, 进而导致查重报告显示为乱码. 258 | % 解决方法有以下三种: 259 | % \begin{itemize} 260 | % \item[1.] 升级 TeXLive 到 2019 版. 261 | % \item[2.] 使用 Adobe 字体. 首先自行下载安装 Adobe 字体, 然后在 |tex| 源文件导言区重新定义相关字体. 262 | % \begin{frameverb} 263 | % \documentclass[twoside, UTF8, phd, dbr, AutoFakeBold]{nputhesis} 264 | % % 导言区 265 | % \renewcommand{\songti}{\CJKfontspec{Adobe Song Std L}} % adobe 宋体 266 | % \renewcommand{\kaishu}{\CJKfontspec{Adobe Kaiti Std R}} % adobe 楷体 267 | % \renewcommand{\heiti}{\CJKfontspec{Adobe Heiti Std R}} % adobe 黑体 268 | % \renewcommand{\fangsong}{\CJKfontspec{Adobe Fangsong Std R}} % adobe 仿宋 269 | % % other command 270 | % \begin{document} 271 | % 正文 272 | % \end{document} 273 | % \end{frameverb} 274 | % \item[3.] 去掉 |AutoFakeBold| 选项. 这样会导致外封面字体不能加黑. 275 | % \end{itemize} 276 | % } 277 | % 278 | % 若需生成盲评版本, 添加选项 |dbr| 即可, 如 279 | % \begin{frameverb} 280 | % \documentclass[twoside, UTF8, phd, dbr, AutoFakeBold]{nputhesis} 281 | % \end{frameverb} 282 | % 关于 |\dbr| 命令的使用请参考 \ref{ss:varset} 节, \ref{ss:refs} 节以及 283 | % \ref{ss:dbr} 节. 284 | % 285 | % \subsection{加载常用宏包} 286 | % \begin{frameverb} 287 | % \usepackage{lipsum} 288 | % \end{frameverb} 289 | % \subsection{参考文献} 290 | % 推荐使用 |biblatex| 处理参考文献. 参考文献格式使用 |gb7714-2015|, 291 | % 其详细信息请参考 https://github.com/hushidong/biblatex-gb7714-2015. 292 | % 宏包 |biblatex-gb7714-2015| 已包含在 TeXLive 和 MikTeX 中. 使用如下 293 | % 命令载入 |biblatex| 宏包即可. 294 | % \begin{frameverb} 295 | % \usepackage[backend=biber, 296 | % style=gb7714-2015, maxbibnames=3,minbibnames=3, 297 | % gbnamefmt=givenahead, 298 | % doi=false, 299 | % url=false, 300 | % % gbpub=false 301 | % ]{biblatex} 302 | % \end{frameverb} 303 | % 上面的选项 |gbnamefmt| 需要使用 v1.0k 以上版本的 |biblatex-gb7714-2015|. 304 | % 如果宏包版本不能满足, 可以注释掉选项 |gbnamefmt=givenahead|. 305 | % 306 | % 然后使用 |addbibresource| 添加参考文献文件 |myrefs.bib|. 307 | % \begin{frameverb} 308 | % \addbibresource{myrefs.bib} 309 | % \end{frameverb} 310 | % \subsection{变量设置}\label{ss:varset} 311 | % 设置学校编号, 分类号, 题目, 姓名等信息 312 | % \begin{frameverb} 313 | % \schoolno{10699} 314 | % \classno{O242} 315 | % \secretlevel{公开} 316 | % \authorno{0000999999} 317 | % \title[\LaTeX\ Template of NPU Thesis]{西工大硕博学位论文 \LaTeX 模板} 318 | % \author[\dbr{San Zhang}]{\dbr{张三}} 319 | % \major[Philosophy in Mathematics]{数学} 320 | % \supervisor[\dbr{Si Li}]{\dbr{李四}} 321 | % \applydate[April 2046]{2046~年~4~月} 322 | % \support{本文研究得到某某基金(编号:XXXXXXX)资助。} 323 | % \end{frameverb} 324 | % \subsection{开始文档} 325 | % 使用 |makecover| 生成封面: 包括外封面和内封面, 然后用 | frontmatter | 326 | % 分割封面和正文部分. 327 | % \begin{frameverb} 328 | % \begin{document} 329 | % \makecover 330 | % \frontmatter 331 | % \end{frameverb} 332 | % \subsection{摘要部分} 333 | % 中文摘要 334 | % \begin{frameverb} 335 | % \begin{abstract} 336 | % 本模板基本实现了西北工业大学硕博论文格式要求: 封皮, 页眉页脚, 337 | % 章节标题格式, 参考文献格式等. 338 | % \begin{keywords} 339 | % 学位论文, \LaTeX\ 模板, 西工大 340 | % \end{keywords} 341 | % \end{abstract} 342 | % \end{frameverb} 343 | % 英文摘要 344 | % \begin{frameverb} 345 | % \begin{Abstract} 346 | % We implement the class |nputhesis| for the thesis of NWPU. 347 | % \begin{Keywords} 348 | % Thesis Template, \LaTeX, NPU 349 | % \end{Keywords} 350 | % \end{Abstract} 351 | % \end{frameverb} 352 | % \subsection{目录和符号表} 353 | % \begin{frameverb} 354 | % \tableofcontents 355 | % \printnomenclature 356 | % \end{frameverb} 357 | % 正文中使用 |\nomenclature{}{}| 向符号表中添加内容. 358 | % \subsection{正文部分} 359 | % 使用 |mainmatter| 开始正文. 360 | % \begin{frameverb} 361 | % \mainmatter 362 | % \end{frameverb} 363 | % 正文结构 364 | % \begin{frameverb} 365 | % \chapter{绪论} 366 | % \section{\TeX 和 \LaTeX 介绍} 367 | % \section{nputhesis 简介} 368 | % \chapter{基础知识} 369 | % \section{基本命令} 370 | % \section{宏包} 371 | % \end{frameverb} 372 | % \subsubsection{图与表} 373 | % \newenvironment{nputabu}[1][\zihao{5}]% 374 | % {\begingroup #1\tabularx{\textwidth}}{\endtabularx\endgroup} 375 | % \newcolumntype{L}{>{\raggedright\arraybackslash}X} 376 | % \newcolumntype{R}{>{\raggedleft\arraybackslash}X} 377 | % \newcolumntype{C}{>{\centering\arraybackslash}X} 378 | % 表格可以使用 nputabu 环境. 列模式除了常规的 |c|, |r| 和 |l| 外, 还可以使用 379 | % `nputhesis.cls` 中定义的列模式 |C|, |R| 和 |L|, 它们表示等列宽模式下的居中, 380 | % 居右和居左. 381 | % 382 | % 如下代码生成的表格见表 \ref{table:result}. 383 | % \begin{frameverb} 384 | % \begin{table} 385 | % \caption{数值误差和收敛阶} 386 | % \begin{nputabu}{CCC} 387 | % \toprule 388 | % $N$ & $L^2$ 误差 & 收敛阶 \\ 389 | % \midrule 390 | % 4 & 8.1060e-03 & 0.00 \\ 391 | % 8 & 2.0489e-03 & 1.98 \\ 392 | % 16 & 5.3476e-04 & 1.94 \\ 393 | % 32 & 1.5625e-04 & 1.77 \\ 394 | % \bottomrule 395 | % \end{nputabu} 396 | % \end{table} 397 | % \end{frameverb} 398 | % \begin{table} 399 | % \caption{数值误差和收敛阶}\label{table:result} 400 | % \begin{nputabu}{CCC} 401 | % \toprule 402 | % $N$ & $L^2$ 误差 & 收敛阶 \\ 403 | % \midrule 404 | % 4 & 8.1060e-03 & 0.00 \\ 405 | % 8 & 2.0489e-03 & 1.98 \\ 406 | % 16 & 5.3476e-04 & 1.94 \\ 407 | % 32 & 1.5625e-04 & 1.77 \\ 408 | % \bottomrule 409 | % \end{nputabu} 410 | % \end{table} 411 | % \subsection{参考文献, 附录等}\label{ss:refs} 412 | % \begin{frameverb} 413 | % \backmatter 414 | % % 以下两种参考文献格式, 根据实际宏包使用情况添加 415 | % \printbibliography % biblatex 输出参考文件方式 416 | % % \bibliographystyle{gbt7714-2005} % 传统输出参考文献方式 417 | % % \bibliography{ref} % 传统输出参考文献方式 418 | % 419 | % % \Appendix % 如果有多个附录, 可重复使用该命令, 自动按字母编号. 420 | % 421 | % \Thanks % 致谢 422 | % 423 | % \Work 424 | % \papersection % 以下填写发表论文情况 425 | % 426 | % \begin{npulist} 427 | % \item {\bf \dbr{S. Zhang}}, \dbr{S. Li}. NPU 硕博学位论文 428 | % \LaTeX\ 模板[D]. 2019. 429 | % \end{npulist} 430 | % 431 | % \researchsection % 以下填写参加科研情况 432 | % \begin{npulist} 433 | % \item NPU \LaTeX 模板. 编号: 000000000, 参与. 434 | % \item NPU \LaTeX 模板. 编号: 000000001, 参与. 435 | % \item NPU \LaTeX 模板. 编号: 000000002, 参与. 436 | % \end{npulist} 437 | % \end{frameverb} 438 | % \subsection{结束文档} 439 | % \begin{frameverb} 440 | % \statement 441 | % \end{document} 442 | % \end{frameverb} 443 | % \subsection{完整的例子}\label{ss:example} 444 | % \begin{macrocode} 445 | %<*sample> 446 | \documentclass[twoside, UTF8, phd, AutoFakeBold]{nputhesis} 447 | \usepackage{lipsum} 448 | \usepackage{hyperref} % 可以保证生成的 pdf 显示逻辑页码 449 | \usepackage{filecontents} 450 | \usepackage[backend=biber, 451 | style=gb7714-2015, maxbibnames=3,minbibnames=3, 452 | gbnamefmt=givenahead, 453 | doi=false, 454 | url=false, 455 | ]{biblatex} 456 | \begin{filecontents}{myrefs.bib} 457 | @Book{Knuth1986, 458 | Title = {The \TeX book}, 459 | Author = {Donald~Ervin Knuth}, 460 | Publisher = {Addison-Wesley}, 461 | Year = {1986} 462 | } 463 | 464 | @Book{Lamport1994, 465 | Title = {A Document Preparation System}, 466 | Author = {Leslie Lamport}, 467 | Publisher = {Addison-Wesley}, 468 | Year = {1994} 469 | } 470 | 471 | @Book{Liu2013, 472 | Title = {\LaTeX 入门}, 473 | Author = {刘海洋}, 474 | Publisher = {电子工业出版社}, 475 | Year = {2013} 476 | } 477 | \end{filecontents} 478 | \addbibresource{myrefs.bib} 479 | \schoolno{10699} 480 | \classno{O242} 481 | \secretlevel{公开} 482 | \authorno{0000999999} 483 | \title[\LaTeX\ Template of NPU Thesis]{西工大硕博学位论文 \LaTeX 模板} 484 | \author[\dbr{San Zhang}]{\dbr{张三}} 485 | \major[Philosophy in Mathematics]{数学} 486 | \supervisor[\dbr{Si Li}]{\dbr{李四}} 487 | \applydate[April 2046]{2046~年~4~月} 488 | \support{本文研究得到某某基金(编号:XXXXXXX)资助。} 489 | \begin{document} 490 | \makecover 491 | \frontmatter 492 | 493 | \begin{abstract} 494 | 本模板基本实现了西北工业大学硕博论文格式要求: 封皮, 页眉页脚, 495 | 章节标题格式, 参考文献格式等. 496 | \begin{keywords} 497 | 学位论文, \LaTeX\ 模板, 西工大 498 | \end{keywords} 499 | \end{abstract} 500 | \begin{Abstract} 501 | We implement the class |nputhesis| for the thesis of NWPU. 502 | \begin{Keywords} 503 | Thesis Template, \LaTeX, NPU 504 | \end{Keywords} 505 | \end{Abstract} 506 | 507 | \tableofcontents 508 | \printnomenclature 509 | 510 | \mainmatter 511 | 512 | \chapter{绪论} 513 | \section{\TeX 和 \LaTeX 介绍} 514 | \TeX \parencite{Knuth1986} 和 \LaTeX \cite{Lamport1994, Liu2013}的介绍. 515 | \section{nputhesis 简介} 516 | \chapter{基础知识} 517 | \section{基本命令} 518 | \section{宏包} 519 | 520 | \section{图表} 521 | \begin{table} 522 | \caption{数值误差和收敛阶} 523 | \begin{nputabu}{CCC} 524 | \toprule 525 | $N$ & $L^2$ 误差 & 收敛阶 \\ 526 | \midrule 527 | 4 & 8.1060e-03 & 0.00 \\ 528 | 8 & 2.0489e-03 & 1.98 \\ 529 | 16 & 5.3476e-04 & 1.94 \\ 530 | 32 & 1.5625e-04 & 1.77 \\ 531 | \bottomrule 532 | \end{nputabu} 533 | \end{table} 534 | \backmatter 535 | 536 | \printbibliography % biblatex 输出参考文件方式 537 | 538 | \Appendix % 编号附录 539 | 540 | \Appendix* % 不编号附录 541 | 542 | \Thanks % 致谢 543 | 544 | \Work 545 | \papersection % 以下填写发表论文情况 546 | 547 | \begin{npulist} 548 | \item {\bf \dbr{S. Zhang}}, \dbr{S. Li}. NPU 硕博学位论文 549 | \LaTeX\ 模板[D]. 2019. 550 | \end{npulist} 551 | 552 | \researchsection % 以下填写参加科研情况 553 | \begin{npulist} 554 | \item NPU \LaTeX 模板. 编号: 000000000, 参与. 555 | \end{npulist} 556 | \statement 557 | \end{document} 558 | % 559 | % \end{macrocode} 560 | % \section{安装} 561 | % 从 |github| 下载的压缩包已所有文件, 直接解压即可使用. 下面介绍从 |dtx| 562 | % 文件生成相关文件的过程. 563 | % \subsection{编译 nputhesis.dtx} 564 | % 运行如下命令即可得到所有文件 565 | % \begin{frameverb} 566 | % xelatex nputhesis.dtx 567 | % \end{frameverb} 568 | % 但是这样生成文档 | nputhesis.pdf | 中没有索引等信息, 因此需要进行多次编译. 569 | % 下面给出生成 |pdf| 文件的两种方式. 570 | % \subsubsection{方法一} 571 | % 进入 |nputhesis.dtx| 所在文件夹, 依次运行下面命令. 572 | % \begin{frameverb} 573 | % xelatex nputhesis.dtx 574 | % makeindex -s gglo.ist -o nputhesis.gls nputhesis.glo 575 | % makeindex -s gind.ist -o nputhesis.ind nputhesis.idx 576 | % xelatex nputhesis.dtx 577 | % xelatex nputhesis.dtx 578 | % del nputhesis.gls nputhesis.glo nputhesis.ind nputhesis.idx 579 | % del nputhesis.ilg nputhesis.aux nputhesis.log nputhesis.toc 580 | % del nputhesis.hd nputhesis.out 581 | % \end{frameverb} 582 | % \subsubsection{方法二} 583 | % 使用 latexmk 进行编译. 首先, 进入 |nputhesis.dtx| 所在文件夹, 584 | % 创建文件 |dtxrc| 内容如下: 585 | % \begin{frameverb} 586 | % @cus_dep_list = (@cus_dep_list, "glo gls 0 makegls"); 587 | % sub makegls { 588 | % system("makeindex -s gglo.ist -o $_[0].gls $_[0].glo"); } 589 | % $makeindex="makeindex -s gind.ist -o %D %S"; 590 | % push @generated_exts, 'idx', 'ind', 'glo', 'gls', 'hd'; 591 | % \end{frameverb} 592 | % 然后在该文件夹运行如下命令即可生成所需文件. 593 | % \begin{frameverb} 594 | % latexmk -xelatex nputhesis.dtx -r dtxrc 595 | % latexmk -c nputhesis.dtx -r dtxrc 596 | % \end{frameverb} 597 | % \subsubsection{方法三} 598 | % 在 Windows 环境下直接运行 |build.bat| 即可. 599 | % \section{代码实现} 600 | % \subsection{文档选项} 601 | % 使用布尔变量实现文档的选项设置 602 | % \begin{macrocode} 603 | %<*class> 604 | \newif\if@npu@phd 605 | \newif\if@npu@blankinfo 606 | \newif\if@npu@dbr % for double-blind review 607 | \def\set@npu@phd{\@npu@phdtrue} 608 | \def\set@npu@ma{\@npu@phdfalse} 609 | % \end{macrocode} 610 | % 使用 |xkeyval| 声明文档选项 611 | % \begin{macrocode} 612 | \RequirePackage{xkeyval} 613 | % \end{macrocode} 614 | % 声明选项 blankinfo, 用于控制是否现实空白页标识信息. 615 | % \begin{macrocode} 616 | \DeclareOptionX{blankinfo}[false]{\csname @npu@blankinfo#1\endcsname} 617 | % \end{macrocode} 618 | % 声明选项 thesistype, 可选参数为 phd 和 ma, 用于选择文档类型 619 | % : 博士论文还是硕士论文. 620 | % \begin{macrocode} 621 | \DeclareOptionX{thesistype}[phd]{\csname set@npu@#1\endcsname} 622 | % \end{macrocode} 623 | % 声明选项 phd 和 ma, 要废齐的选项, 被 thesistype 代替, 请使用 thesistype. 624 | % \begin{macrocode} 625 | \DeclareOptionX{phd}{\@npu@phdtrue} 626 | \DeclareOptionX{ma}{\@npu@phdfalse} 627 | % \end{macrocode} 628 | % 声明选项 dbr, 用于生成盲评版本, 参考 |\dbr|. 629 | % \begin{macrocode} 630 | \DeclareOptionX{dbr}[true]{\csname @npu@dbr#1\endcsname} 631 | % \end{macrocode} 632 | % 该文类基于 book 类实现, 加载book 文类. 633 | % \begin{macrocode} 634 | \DeclareOptionX*{\PassOptionsToClass{\CurrentOption}{ctexbook}} 635 | \ExecuteOptionsX{thesistype=phd} 636 | \ExecuteOptionsX{dbr=false} 637 | \ProcessOptionsX \relax 638 | \LoadClass[heading=true,zihao=-4]{ctexbook} 639 | % \end{macrocode} 640 | % \subsection{使用的宏包} 641 | % 加载需要的宏包 642 | % \begin{macrocode} 643 | \RequirePackage{geometry} 644 | \RequirePackage{xcolor} 645 | \RequirePackage{fancyhdr} 646 | \RequirePackage{titletoc} 647 | \RequirePackage{caption} 648 | \RequirePackage{ulem} 649 | \RequirePackage{amsthm} 650 | \RequirePackage{amsmath} 651 | \RequirePackage{amsfonts} 652 | \RequirePackage{setspace} 653 | \RequirePackage{longtable} 654 | \RequirePackage{booktabs} 655 | \RequirePackage{tabularx} 656 | \RequirePackage{multirow} 657 | \RequirePackage{graphicx} 658 | % \RequirePackage[heading=true,zihao=-4]{ctex} 659 | \RequirePackage{ifxetex} 660 | \ifxetex 661 | \setmainfont{Times New Roman} 662 | \fi 663 | % \end{macrocode} 664 | % \subsection{盲评命令}\label{ss:dbr} 665 | % \changes{v1.0.0}{2020/02/18}{Add option `dbr' for double-blind review} 666 | % 当 |dbr| 选项开启, 即 |dbr=true| 时在文件中 |\dbr| 命令以隐藏作者相关信息, 667 | % 使用命令 |\dbr{张三}| 将会使用黑框代替 `张三' 的显示. 668 | % \begin{macrocode} 669 | \newcommand\@npu@replace[1]{{% 670 | \setlength{\fboxsep}{0pt}% 671 | \colorbox{black}{\phantom{#1}}}} 672 | \newcommand{\dbr}[1]{\if@npu@dbr \@npu@replace{#1}\relax\else #1\fi} 673 | % \end{macrocode} 674 | % \subsection{设置页面版式格式} 675 | % \begin{macrocode} 676 | \geometry{paperwidth=210mm,paperheight=297mm,% 677 | left=2.5cm,right=2.5cm,top=2.54cm,bottom=2.54cm} 678 | \topmargin=-10.4mm 679 | \headheight=17pt 680 | \footskip=8mm 681 | \headsep=5mm 682 | % \end{macrocode} 683 | % 页眉设置 684 | % \begin{macrocode} 685 | \pagestyle{fancy} 686 | % \renewcommand\chaptermark[1]{\markboth{% 687 | % \if@mainmatter% 688 | % %\ifnum\arabic{chapter}>0% 689 | % \arabic{chapter}\quad% 690 | % %\fi% 691 | % \fi#1}{}} 692 | \fancyhf{} 693 | \fancyhead[EC]{\songti\zihao{-5}\npu@rightmark} 694 | \fancyhead[OC]{\songti\zihao{-5}\leftmark} 695 | \fancyfoot[C]{\songti\zihao{5}\thepage} 696 | \renewcommand{\headrule}{% 697 | \hrule width\headwidth height2.8pt \vspace{1pt}% 698 | \hrule width\headwidth height0.8pt} 699 | \fancypagestyle{plain}{\thispagestyle{fancy}} 700 | \newcommand{\clearpagestyle}{\clearpage{\pagestyle{empty}\cleardoublepage}} 701 | % \end{macrocode} 702 | % \subsection{设置默认章节标题格式} 703 | % \begin{macrocode} 704 | \ifx\ctexset\undefined 705 | \CTEXsetup[ % name={,}, number={\arabic{chapter}},% use default value 706 | beforeskip={0pt}, afterskip={20pt}]{chapter} 707 | \CTEXsetup[nameformat={\heiti\zihao{3}\bf}]{chapter} 708 | \CTEXsetup[titleformat={\heiti\zihao{3}}]{chapter} 709 | \CTEXsetup[format={\heiti\zihao{4}}]{section} 710 | \CTEXsetup[format={\heiti\zihao{-4}}]{subsection} 711 | \else 712 | \ctexset{ 713 | contentsname = {\npu@contents} 714 | } 715 | % title format of chapter 716 | \ctexset{ 717 | % chapter/name={,}, % use default value in ctex 718 | % chapter/number=\arabic{chapter}, % use default value in ctex 719 | chapter/beforeskip={0pt}, 720 | chapter/afterskip={20pt}, 721 | chapter/format={\heiti\zihao{3}\centering} 722 | } 723 | % title format of section 724 | \ctexset{ 725 | section/name={,}, 726 | % section/beforeskip={2ex plus .5ex minus .1ex}, 727 | % section/afterskip={1ex plus .1ex}, 728 | section/format={\heiti\zihao{4}} 729 | } 730 | % title format of subsection 731 | \ctexset{ 732 | subsection/name={,}, 733 | % subsection/beforeskip={2ex plus .5ex minus .1ex}, 734 | % subsection/afterskip={1ex plus .1ex}, 735 | subsection/format={\heiti\zihao{-4}} 736 | } 737 | \ctexset{ 738 | subsubsection/name={,}, 739 | % subsubsection/beforeskip={1ex plus .3ex minus .1ex}, 740 | % subsubsection/afterskip={.5ex plus .1ex}, 741 | subsubsection/format={\heiti\zihao{-4}} 742 | } 743 | \ctexset{ 744 | paragraph/name={,}, 745 | % paragraph/beforeskip={1ex plus .3ex minus .1ex}, 746 | % paragraph/afterskip={.5ex plus .1ex}, 747 | paragraph/format={\heiti\zihao{-4}} 748 | } 749 | \ctexset{ 750 | subparagraph/name={,}, 751 | % subparagraph/beforeskip={1ex plus .3ex minus .1ex}, 752 | % subparagraph/afterskip={.5ex plus .1ex}, 753 | subparagraph/format={\heiti\zihao{-4}} 754 | } 755 | \fi 756 | % \end{macrocode} 757 | % \subsection{目录字体设置} 758 | % \begin{macrocode} 759 | \def\@contentfont{\songti\zihao{-4}} 760 | \titlecontents{chapter}[0pt]{\@contentfont} 761 | {\thecontentslabel\hspace{.5em}}{} 762 | {\hspace{.5em}\titlerule*{.}\contentspage} 763 | \titlecontents{section}[15pt]{\@contentfont} 764 | {\thecontentslabel\quad}{} 765 | {\hspace{.5em}\titlerule*{.}\contentspage} 766 | \titlecontents{subsection}[30pt]{\@contentfont} 767 | {\thecontentslabel\quad}{} 768 | {\hspace{.5em}\titlerule*{.}\contentspage} 769 | % \end{macrocode} 770 | % \subsection{变量设置} 771 | % 定义变量, 用于存储包括论文题目, 作者, 导师等信息. 772 | % \begin{macrocode} 773 | \def\title{\@ifnextchar[\@@title{\@@title[]}} 774 | \def\author{\@ifnextchar[\@@author{\@@author[]}} 775 | \def\major{\@ifnextchar[\@@major{\@@major[]}} 776 | \def\supervisor{\@ifnextchar[\@@supervisor{\@@supervisor[]}} 777 | \def\applydate{\@ifnextchar[\@@applydate{\@@applydate[]}} 778 | \def\@@title[#1]#2{\def\@title@en{#1}\def\@title{#2}} 779 | \def\@@author[#1]#2{\def\@author@en{#1}\def\@author{#2}} 780 | \def\@@major[#1]#2{\def\@major@en{#1}\def\@major{#2}} 781 | \def\@@supervisor[#1]#2{\def\@supervisor@en{#1}\def\@supervisor{#2}} 782 | \def\@@applydate[#1]#2{\def\@applydate@en{#1}\def\@applydate{#2}} 783 | \def\@title{}\def\@title@en{} 784 | \def\@author{}\def\@author@en{} 785 | \def\@major{}\def\@major@en{} 786 | \def\@supervisor{}\def\@supervisor@en{} 787 | \def\@applydate{}\def\@applydate@en{} 788 | \def\npu@empty{} 789 | \def\schoolno#1{\def\@schoolno{#1}}\def\@schoolno{} 790 | \def\classno#1{\def\@classno{#1}}\def\@classno{} 791 | \def\secretlevel#1{\def\@secretlevel{#1}}\def\@secretlevel{} 792 | \def\authorno#1{\def\@authorno{#1}}\def\@authorno{} 793 | \def\support#1{\def\@support{#1}}\def\@support{} 794 | \if@npu@phd 795 | \def\npu@degreename@en{Doctor} 796 | \else 797 | \def\npu@degreename@en{Master} 798 | \fi 799 | % \end{macrocode} 800 | % \subsection{设置字体和行距} 801 | % \begin{macrocode} 802 | % \renewcommand{\normalsize}{\zihao{-4}} 803 | \linespread{1.25} 804 | % \end{macrocode} 805 | % \subsection{封面} 806 | % 重新定义 |titlepage| 环境, 取消页码计数器的更改. 807 | % \begin{macrocode} 808 | \renewenvironment{titlepage} 809 | {% 810 | \cleardoublepage 811 | \if@twocolumn 812 | \@restonecoltrue\onecolumn 813 | \else 814 | \@restonecolfalse\newpage 815 | \fi 816 | \thispagestyle{empty}% 817 | % \setcounter{page}\z@ 818 | }% 819 | {\if@restonecol\twocolumn \else \newpage \fi 820 | } 821 | % \end{macrocode} 822 | % 定义外封面 823 | % \begin{macrocode} 824 | \def\makeoutercover{ 825 | \begin{titlepage} 826 | \bfseries 827 | \linespread{1.25} 828 | \begin{center} 829 | \hfill% default \bf font 830 | \heiti\zihao{5} 831 | \newlength{\max@length} 832 | \settowidth{\max@length}{\npu@schoolno\npu@comma 2000000000} 833 | \newlength{\name@length} 834 | \settowidth{\name@length}{\npu@schoolno} 835 | \begin{minipage}{\max@length} 836 | \vskip.5cm 837 | \renewcommand\arraystretch{1.2} 838 | \begin{tabular}{|c|c|}\hline 839 | \makebox[\name@length][s]{\npu@schoolno} & \@schoolno \\ \hline 840 | \makebox[\name@length][s]{\npu@classno} & \@classno \\ \hline 841 | \makebox[\name@length][s]{\npu@secretlevel}& \@secretlevel \\ \hline 842 | \makebox[\name@length][s]{\npu@authorno} & \@authorno \\ \hline 843 | \end{tabular} 844 | \end{minipage} 845 | \par\vspace{9cm} 846 | \songti\zihao{2} 847 | \begin{minipage}[t]{2cm} 848 | \hfill\npu@title\\ 849 | \end{minipage} 850 | %\hbox to 2.5cm{\hfill \npu@title} 851 | \setbox123=\hbox{ 852 | \begin{minipage}[t]{12cm} 853 | \begin{center} 854 | \heiti\@title 855 | \end{center} 856 | \end{minipage} } 857 | \setbox124=\hbox{ 858 | \begin{minipage}[t]{12cm} 859 | \begin{center} 860 | \uline{\hfill\quad\hfill}\\ 861 | \uline{\hfill\quad\hfill}\\ 862 | \end{center} 863 | \end{minipage} } 864 | \hskip-0.5cm 865 | \copy123\kern-\wd123\box124 866 | \zihao{3} 867 | \par\vspace{2.5\baselineskip} 868 | \begin{minipage}{5cm} 869 | {\kaishu\npu@author} \uline{\hfill\@author\hfill} 870 | \end{minipage} 871 | \par\vspace{2.5\baselineskip} 872 | \settowidth{\name@length}{\npu@applydate} 873 | \begin{minipage}{12.5cm} 874 | \noindent 875 | \makebox[\name@length][s]{\npu@major}% 876 | {\uline{\hfill{\@major}\hfill}} \par 877 | \vspace{0.5\baselineskip} 878 | \makebox[\name@length][s]{\npu@supervisor}% 879 | {\uline{\hfill\@supervisor\hfill}} \par 880 | \vspace{0.5\baselineskip} 881 | \makebox[\name@length][s]{\npu@applydate}% 882 | {\uline{\hfill\@applydate\hfill}} \par 883 | \end{minipage} 884 | \vspace{2\baselineskip} 885 | \end{center} 886 | \end{titlepage} 887 | \clearpagestyle 888 | } 889 | % \end{macrocode} 890 | % 定义内封面 891 | % \begin{macrocode} 892 | \def\makeinnercover@zh{% 893 | \begin{titlepage} 894 | \linespread{1.25} 895 | \vspace*{2cm} 896 | \begin{center} 897 | \settowidth{\name@length}{\zihao{3}\npu@schoolname} 898 | \divide\name@length by 12 899 | \multiply\name@length by 17 900 | \makebox[\name@length][s]{\zihao{3}\npu@schoolname} 901 | \vskip5mm 902 | \settowidth{\name@length}{\zihao{1}\npu@degree} 903 | \divide\name@length by 12 904 | \multiply\name@length by 17 905 | \makebox[\name@length][s]{\zihao{1}\npu@degree} 906 | \vskip5mm 907 | \centerline{\zihao{4}\npu@degreeclass} 908 | \vskip5cm 909 | \zihao{2} 910 | \begin{minipage}[t]{2.5cm} 911 | \hfil\npu@title\npu@comma 912 | \end{minipage} 913 | \setbox123=\hbox{ 914 | \begin{minipage}[t]{11cm} 915 | \begin{center} 916 | \@title 917 | \end{center} 918 | \end{minipage}} 919 | \setbox124=\hbox{ 920 | \begin{minipage}[t]{11cm} 921 | \begin{center} 922 | \uline{\hfill\quad\hfill}\\ 923 | \uline{\hfill\quad\hfill}\\ 924 | \end{center} 925 | \end{minipage}} 926 | \hskip-1cm 927 | \copy123\kern-\wd123\box124 928 | \par\vspace{4cm} 929 | \zihao{3} 930 | \settowidth{\name@length}{\npu@major} 931 | \begin{minipage}{8cm} 932 | \noindent 933 | \makebox[\name@length][s]{\npu@author}\npu@comma% 934 | \uline{\hfill\@author\hfill} \par 935 | \vspace{0.25\baselineskip} 936 | \makebox[\name@length][s]{\npu@major}\npu@comma% 937 | \uline{\hfill\@major\hfill} \par 938 | \vspace{0.25\baselineskip} 939 | \makebox[\name@length][s]{\npu@supervisor}\npu@comma% 940 | \uline{\hfill\@supervisor\hfill}\par 941 | \vspace{1\baselineskip} 942 | \end{minipage} 943 | \vspace{2\baselineskip} 944 | \par\makebox[30mm]{\@applydate}\hfill 945 | \end{center} 946 | \end{titlepage} 947 | \clearpagestyle 948 | } 949 | % \end{macrocode} 950 | % 定义英文封面 951 | % \begin{macrocode} 952 | \def\makeinnercover@en{% 953 | \begin{titlepage} 954 | \linespread{1.25} 955 | \vspace*{1.5cm} 956 | \zihao{3} 957 | \begin{center} 958 | {\bf 959 | %\Large 960 | \@title@en \\ 961 | \vspace{3\baselineskip} 962 | \zihao{-3} 963 | By\\ 964 | \ifx\@author@en\npu@empty\quad\else\@author@en\fi\\ 965 | \vspace{1\baselineskip} 966 | Under the Supervision of Professor\\ 967 | \ifx\@supervisor@en\npu@empty\quad\else\@supervisor@en\fi\\} 968 | %\Large 969 | \vspace{4\baselineskip} 970 | A Dissertation Submitted to\\ 971 | Northwestern Polytechnical University\\ 972 | \vspace{1\baselineskip} 973 | In Partial Fulfillment of the Requirement\\ 974 | for the Degree of\\ 975 | \npu@degreename@en\ of \@major@en\\ 976 | \vspace{4\baselineskip} 977 | Xi'an, P. R. China\\ 978 | \@applydate@en 979 | \end{center} 980 | \end{titlepage} 981 | \clearpagestyle 982 | } 983 | % \end{macrocode} 984 | % 整合以上封面为一个命令 makecover 985 | % \begin{macrocode} 986 | % \changes{v1.0.0}{2020/06/12}{Change the logical page number in pdf to avoid the repeation of the numbers} 987 | \def\makecover{% 988 | \pagenumbering{Alph}% 989 | \makeoutercover% 990 | \setcounter{page}\@ne 991 | \pagenumbering{roman}% 992 | \makeinnercover@zh% 993 | \makeinnercover@en% 994 | } 995 | % \end{macrocode} 996 | % 正文之前使用罗马数字编号 997 | % \begin{macrocode} 998 | \let\npu@frontmatter\frontmatter 999 | \def\frontmatter{\npu@frontmatter\pagenumbering{Roman}} 1000 | % \end{macrocode} 1001 | % \subsection{选项 blankinfo 的实现} 1002 | % 重定义 cleardoublepage, 用于实现 blankinfo 选项的功能. 1003 | % \begin{macrocode} 1004 | \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else 1005 | \hbox{} 1006 | \vspace*{\fill} 1007 | \begin{center}\Large 1008 | \if@npu@blankinfo 1009 | \textcolor{gray!60}{This Page Intentionally Left Blank!} 1010 | \fi 1011 | \end{center} 1012 | \vspace{\fill} 1013 | \thispagestyle{empty} 1014 | \newpage 1015 | \if@twocolumn\hbox{}\newpage\fi\fi\fi} 1016 | % \end{macrocode} 1017 | % \subsection{摘要环境} 1018 | % 定义中英文摘要环境 1019 | % \begin{macrocode} 1020 | \newenvironment{abstract}{% 1021 | \chapter{\npu@abstract}%\addcontentsline{toc}{chapter}{\npu@abstract}% 1022 | \newenvironment{keywords}{% 1023 | \vspace{2\baselineskip}\par\textbf{\npu@keywords\npu@comma}}{} 1024 | }{\vfill\zihao{5}\@support} 1025 | 1026 | \newenvironment{Abstract}{% 1027 | \chapter{\npu@Abstract}%\addcontentsline{toc}{chapter}{\npu@Abstract}% 1028 | \newenvironment{Keywords}{% 1029 | \vspace{2\baselineskip}\par\textbf{\npu@Keywords\npu@comma}}{}}{} 1030 | % \end{macrocode} 1031 | % \subsection{图表标题设置} 1032 | % \begin{macrocode} 1033 | \DeclareCaptionFont{song}{\songti\zihao{5}} 1034 | \captionsetup{labelsep=quad, font=song} 1035 | \captionsetup[figure]{aboveskip=10pt, belowskip=10pt} 1036 | \captionsetup[table]{aboveskip=10pt, belowskip=10pt} 1037 | \renewcommand\thetable{\arabic{chapter}-\arabic{table}} 1038 | \renewcommand\thefigure{\arabic{chapter}-\arabic{figure}} 1039 | \renewcommand\theequation{\arabic{chapter}-\arabic{equation}} 1040 | % \end{macrocode} 1041 | % \subsection{表格和列表环境} 1042 | % \begin{macrocode} 1043 | \let\@ldtabular\tabular 1044 | \let\end@ldtabular\endtabular 1045 | \renewenvironment{tabular}{\zihao{5}\@ldtabular}{\end@ldtabular} 1046 | 1047 | % define nputabu environment which will stretch to textwidth 1048 | \newcolumntype{L}{>{\raggedright\arraybackslash}X} 1049 | \newcolumntype{R}{>{\raggedleft\arraybackslash}X} 1050 | \newcolumntype{C}{>{\centering\arraybackslash}X} 1051 | % \changes{v1.0.0}{2020/04/21}{Add begingroup and endgroup in env ``nputabu''} 1052 | \newenvironment{nputabu}[1][\zihao{5}]% 1053 | {\begingroup #1\tabularx{\textwidth}}{\endtabularx\endgroup} 1054 | 1055 | \newenvironment{npulist}{% 1056 | \begingroup\renewcommand{\labelenumi}{[\theenumi].}\enumerate}% 1057 | {\endenumerate\endgroup} 1058 | % \end{macrocode} 1059 | % \subsection{特殊章节设置} 1060 | % 附录自动以英文字母编号 1061 | % \changes{v1.0.0}{2020/03/28}{Fix bug of command ``Appendix''} 1062 | % \begin{macrocode} 1063 | \let\npu@chapter\chapter 1064 | \def\npu@star@chapter#1{\npu@chapter{#1}} 1065 | \def\chapter{\secdef\npu@chapter\npu@star@chapter} 1066 | \newcounter{npu@c@appendix} 1067 | \setcounter{npu@c@appendix}{0} 1068 | \def\npu@star@Appendix{\chapter{\npu@appendix}} 1069 | \def\npu@Appendix{\addtocounter{npu@c@appendix}{1}% 1070 | \chapter{\npu@appendix\Alph{npu@c@appendix}}} 1071 | \def\Appendix{\@ifstar{\npu@star@Appendix}{\npu@Appendix}} 1072 | % \end{macrocode} 1073 | % 致谢章节 1074 | % \begin{macrocode} 1075 | \def\Thanks{\chapter{\npu@thanks}} 1076 | % \end{macrocode} 1077 | % 参加科研工作章节, 设置标题内容 1078 | % \begin{macrocode} 1079 | \newcommand\Work{\chapter{\npu@work}} 1080 | \newcommand\papersection{\section*{\npu@work@paper}} 1081 | \newcommand\researchsection{\section*{\npu@work@research}} 1082 | % \end{macrocode} 1083 | % 声明页 1084 | % \begin{macrocode} 1085 | \def\statement{ 1086 | \begin{titlepage} 1087 | \linespread{1.5} 1088 | \parskip=7pt 1089 | \vspace*{0pt} 1090 | \songti\zihao{4} 1091 | \centerline{\bf \npu@schoolname} 1092 | \centerline{\bf \npu@p@statement} 1093 | \songti\zihao{5} 1094 | \npu@longp@statement\par 1095 | \npu@a@signature\npu@comma\underline{\qquad\qquad\qquad} \hfill 1096 | \npu@s@signature\npu@comma\underline{\qquad\qquad\qquad} \par 1097 | \hskip 3cm \npu@ymd \hfill\hskip 3cm \npu@ymd 1098 | \vspace*{30pt} 1099 | \hbox to \hsize{\leaders\hbox to 1em{\hss--\hss}\hfill} 1100 | 1101 | \vspace*{50pt} 1102 | \songti\zihao{4} 1103 | \centerline{\bf \npu@schoolname} 1104 | \centerline{\bf \npu@c@statement} 1105 | \songti\zihao{5} 1106 | \npu@longc@statement\par 1107 | \hskip5.5cm 1108 | \hfill\npu@a@signature\npu@comma\underline{\qquad\qquad\qquad}\par 1109 | \hfill\hskip8.5cm \npu@ymd 1110 | \end{titlepage}} 1111 | % \end{macrocode} 1112 | % \subsection{默认定理环境} 1113 | % 定义定理环境 1114 | % \begin{macrocode} 1115 | % ref amsthdoc.pdf 1116 | \newtheoremstyle{nputheorem}% name 1117 | {0pt}% Space above 1118 | {0pt}% Space below 1119 | {\itshape}% Body font 1120 | {}% Indent amount 1121 | {\bfseries}% Theorem head font 1122 | {}% Punctuation after theorem head 1123 | {.5em}% Space after theorem head 1124 | {}% Theorem head spec (can be left empty, meaning ‘normal’ ) 1125 | 1126 | \newtheoremstyle{npuplain}% name 1127 | {0pt}% Space above 1128 | {0pt}% Space below 1129 | {}% Body font 1130 | {}% Indent amount 1131 | {\bfseries}% Theorem head font 1132 | {}% Punctuation after theorem head 1133 | {.5em}% Space after theorem head 1134 | {}% Theorem head spec (can be left empty, meaning ‘normal’ ) 1135 | 1136 | \theoremstyle{npuplain} % set default style to npuplain 1137 | % \end{macrocode} 1138 | % \subsection{定义符号表} 1139 | % \begin{macrocode} 1140 | \RequirePackage{nomencl} % add symbol notation 1141 | \RequirePackage{multicol} % for two column notation 1142 | % \AtEndPreamble{\makenomenclature} 1143 | \makenomenclature 1144 | \renewcommand{\nomname}{\npu@nomname} 1145 | 1146 | % code come from @egreg 1147 | % https://tex.stackexchange.com/questions/78764/two-column-nomenclature 1148 | \@ifundefined{chapter} 1149 | {\def\wilh@nomsection{section}} 1150 | {\def\wilh@nomsection{chapter}} 1151 | 1152 | \def\thenomenclature{% 1153 | % \newlength{\npu@columnsep@save} 1154 | % \setlength{\npu@columnsep@save}{\columnsep} 1155 | % \setlength{\columnsep}{20pt} 1156 | % \begin{multicols}{2}[% 1157 | \csname\wilh@nomsection\endcsname*{\nomname} 1158 | \if@intoc\addcontentsline{toc}{\wilh@nomsection}{\nomname}\fi 1159 | \nompreamble % \raggedcolumns 1160 | % ] 1161 | \list{}{% 1162 | \labelsep=15pt 1163 | \labelwidth\nom@tempdim 1164 | \leftmargin\labelwidth 1165 | \advance\leftmargin\labelsep 1166 | \itemsep\nomitemsep 1167 | \let\makelabel\nomlabel}% 1168 | } 1169 | \def\endthenomenclature{% 1170 | \endlist 1171 | % \end{multicols} 1172 | % \setlength{\columnsep}{\npu@columnsep@save} 1173 | \nompostamble} 1174 | % \end{macrocode} 1175 | % \subsection{配置变量} 1176 | % \begin{macrocode} 1177 | \def\npu@degreename@zh{\if@npu@phd 博士\else 硕士\fi} 1178 | \def\npu@comma{~:~} 1179 | \def\npu@schoolno{学校代码} 1180 | \def\npu@classno{分类号} 1181 | \def\npu@secretlevel{密级} 1182 | \def\npu@authorno{学号} 1183 | \def\npu@title{题目} 1184 | \def\npu@author{作者} 1185 | \def\npu@major{学科、专业} 1186 | \def\npu@supervisor{指导教师} 1187 | \def\npu@applydate{申请学位日期} 1188 | \def\npu@schoolname{西北工业大学} 1189 | \def\npu@degree{\npu@degreename@zh 学位论文} 1190 | \def\npu@degreeclass{(学位研究生)} 1191 | \def\npu@rightmark{西北工业大学\npu@degreename@zh 学位论文} 1192 | \def\npu@Abstract{Abstract} 1193 | \def\npu@abstract{摘\quad 要} 1194 | \def\npu@Keywords{Key words} 1195 | \def\npu@keywords{关键词} 1196 | \def\npu@contents{目\quad 录} 1197 | \def\npu@nomname{符号表} 1198 | \def\npu@appendix{附\quad 录} 1199 | \def\npu@thanks{致\quad 谢} 1200 | \def\npu@work{攻读\npu@degreename@zh 学位期间发表的学术论文和参加科研情况} 1201 | \def\npu@work@paper{发表学术论文} 1202 | \def\npu@work@research{参加科研情况} 1203 | \def\npu@p@statement{学位论文知识产权声明书} 1204 | \def\npu@c@statement{学位论文原创性声明} 1205 | \def\npu@ymd{年\qquad 月\qquad 日} 1206 | \def\npu@a@signature{学位论文作者签名} 1207 | \def\npu@s@signature{指导教师签名} 1208 | \long\def\npu@longp@statement{% 1209 | 本人完全了解学校有关保护知识产权的规定,即:研究生在校攻读学位期间论文工作的 1210 | 知识产权单位属于西北工业大学。学校有权保留并向国家有关部门或机构送交论文的复 1211 | 印件和电子版。本人允许论文被查阅和借阅。学校可以将本学位论文的全部或部分内容 1212 | 编入有关数据库进行检索,可以采用影印、缩印或扫描等复制手段保存和汇编本学位论 1213 | 文。同时本人保证,毕业后结合学位论文研究课题再撰写的文章一律注明作者单位为西 1214 | 北工业大学。 1215 | \par 保密论文待解密后适用本声明。} 1216 | \long\def\npu@longc@statement{% 1217 | 秉承学校严谨的学风和优良的科学道德,本人郑重声明:所呈交的学位论文,是本人在 1218 | 导师的指导下进行研究工作所取得的成果。尽我所知,除文中已经注明引用的内容和致 1219 | 谢的地方外,本论文不包含任何其他个人或集体已经公开发表或撰写过的研究成果,不 1220 | 包含本人或其他已申请学位或其他用途使用过的成果。对本文的研究做出重要贡献的个 1221 | 人和集体,均已在文中以明确方式表明。 1222 | \par 本人学位论文与资料若有不实,愿意承担一切相关的法律责任。} 1223 | % 1224 | % \end{macrocode} 1225 | % \Finale 1226 | % 1227 | \endinput 1228 | 1229 | -------------------------------------------------------------------------------- /nputhesis.ins: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `nputhesis.ins', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% nputhesis.dtx (with options: `install') 8 | %% Copyright (C) 2020 by Zongze Yang 9 | %% 10 | %% It may be distributed and/or modified under the conditions of the LaTeX 11 | %% Project Public License, either version 1.3b of this license or (at your 12 | %% option) any later version. The latest version of this license is in 13 | %% https://www.latex-project.org/lppl.txt 14 | %% and version 1.3b or later is part of all distributions of LaTeX version 15 | %% 2005/12/01 or later. 16 | \input docstrip.tex 17 | \keepsilent 18 | \askforoverwritefalse 19 | \preamble 20 | Copyright (C) 2020 by Zongze Yang 21 | 22 | It may be distributed and/or modified under the conditions of the LaTeX 23 | Project Public License, either version 1.3b of this license or (at your 24 | option) any later version. The latest version of this license is in 25 | https://www.latex-project.org/lppl.txt 26 | and version 1.3b or later is part of all distributions of LaTeX version 27 | 2005/12/01 or later. 28 | \endpreamble 29 | \postamble 30 | 31 | This work consists of the file nputhesis.dtx 32 | and the derived files nputhesis.ins, 33 | nputhesis.pdf, 34 | nputhesis.cls, 35 | nputhesis-sample.tex, 36 | nputhesis-sample.pdf and 37 | README.org 38 | 39 | \endpostamble 40 | 41 | \generate 42 | { 43 | \usedir{tex/latex/nputhesis} 44 | \file{nputhesis.cls} {\from{\jobname.dtx}{class}} 45 | \usedir{doc/latex/nputhesis} 46 | \file{nputhesis-sample.tex} {\from{\jobname.dtx}{sample}} 47 | \nopreamble\nopostamble 48 | \file{README.org} {\from{\jobname.dtx}{readme}} 49 | } 50 | 51 | \Msg{*************************************************************} 52 | \Msg{* *} 53 | \Msg{* To finish the installation you have to move the following *} 54 | \Msg{* files into a directory searched by TeX: *} 55 | \Msg{* *} 56 | \Msg{* \space\space nputhesis.cls *} 57 | \Msg{* *} 58 | \Msg{* To produce the documentation run the files ending with *} 59 | \Msg{* `.dtx' through XeLaTeX. *} 60 | \Msg{* *} 61 | \Msg{* Happy TeXing *} 62 | \Msg{*************************************************************} 63 | 64 | \endbatchfile 65 | %% 66 | %% This work consists of the file nputhesis.dtx 67 | %% and the derived files nputhesis.ins, 68 | %% nputhesis.pdf, 69 | %% nputhesis.cls, 70 | %% nputhesis-sample.tex, 71 | %% nputhesis-sample.pdf and 72 | %% README.org 73 | %% 74 | %% 75 | %% End of file `nputhesis.ins'. 76 | -------------------------------------------------------------------------------- /nputhesis.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NPUSCG/nputhesis/1bed065a8cf8d02254d3e99a1c8c8f4b61b40552/nputhesis.pdf --------------------------------------------------------------------------------