├── demo ├── 1.png ├── 2.png └── 3.png ├── thesis.pdf ├── figures ├── chapter5 │ ├── fig5-1.png │ └── fig5-2.png └── title │ ├── wudaname-eps-converted-to.pdf │ └── wudaname.eps ├── .gitignore ├── includes ├── 致谢.tex ├── 英文封面.tex ├── 科研成果.tex ├── 创新点.tex ├── 原创性声明.tex ├── 中英文缩略语对照表.tex ├── 授权协议书.tex └── 中英文摘要.tex ├── chapters ├── chapter6.tex ├── chapter3.tex ├── chapter1.tex ├── chapter5.tex ├── chapter4.tex └── chapter2.tex ├── LICENSE ├── README.md ├── bibs └── ref1.bib ├── thesis.tex ├── WHUPhd.cls ├── gbt7714.sty └── gbt7714-numerical.bst /demo/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamywang/whu-thesis-latex-template/HEAD/demo/1.png -------------------------------------------------------------------------------- /demo/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamywang/whu-thesis-latex-template/HEAD/demo/2.png -------------------------------------------------------------------------------- /demo/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamywang/whu-thesis-latex-template/HEAD/demo/3.png -------------------------------------------------------------------------------- /thesis.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamywang/whu-thesis-latex-template/HEAD/thesis.pdf -------------------------------------------------------------------------------- /figures/chapter5/fig5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamywang/whu-thesis-latex-template/HEAD/figures/chapter5/fig5-1.png -------------------------------------------------------------------------------- /figures/chapter5/fig5-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamywang/whu-thesis-latex-template/HEAD/figures/chapter5/fig5-2.png -------------------------------------------------------------------------------- /figures/title/wudaname-eps-converted-to.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamywang/whu-thesis-latex-template/HEAD/figures/title/wudaname-eps-converted-to.pdf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.bbl 2 | *.blg 3 | *.thm 4 | *.toc 5 | *.aux 6 | *.lof 7 | *.log 8 | *.lot 9 | *.out 10 | *.fls 11 | *.xdv 12 | *.fdb_latexmk 13 | *.bcf 14 | *.run.xml 15 | *.synctex.gz -------------------------------------------------------------------------------- /includes/致谢.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Apr 13, 2024 8 | % ----------------------------------------------------------------------------- 9 | 10 | \acknowledgement 11 | -------------------------------------------------------------------------------- /chapters/chapter6.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Apr 13, 2024 9 | % ----------------------------------------------------------------------------- 10 | 11 | \chapter{总结与展望}\label{chap6} 12 | 13 | 总结本文的工作,主要包括以下几个方面。 -------------------------------------------------------------------------------- /includes/英文封面.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Apr 13, 2024 9 | % ----------------------------------------------------------------------------- 10 | 11 | \thispagestyle{empty} 12 | \renewcommand{\baselinestretch}{1.5} %下文的行距 13 | \vspace*{0.5cm} 14 | 15 | \begin{center} 16 | 17 | \zihao{2} \the\Etitle 18 | 19 | \vfill 20 | 21 | \zihao{4} \the\Eauthor 22 | 23 | \end{center} 24 | -------------------------------------------------------------------------------- /includes/科研成果.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Apr 13, 2024 9 | % ----------------------------------------------------------------------------- 10 | 11 | \reseachresult 12 | 13 | \begin{enumerate}[{[}1{]}] 14 | \item 2024 IEEE International Symposium on XX,2024,第一作者 15 | \item IEEE Transactions on XX,2023,第一作者 16 | \item XX学报,2022,第一作者 17 | \item ACM Transactions on XX,2021,第一作者 18 | \end{enumerate} -------------------------------------------------------------------------------- /includes/创新点.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Apr 13, 2024 8 | % ----------------------------------------------------------------------------- 9 | 10 | \chapter*{论文创新点} 11 | \thispagestyle{empty} 12 | 13 | 本文的创新点主要有以下几个方面: 14 | 15 | \begin{itemize} 16 | \item ZeRØ~\cite{ziad2021zero}提出了独特的内存指令和新颖的元数据编码方案来保护代码和数据指针,仅仅只需要微小的微架构变化。ZeRØ在SPEC CPU2017基准上的性能开销为零,VLSI测量显示了低功率和面积开销。 17 | \item No-FAT~\cite{ziad2021no}将内存分配大小(例如malloc大小)作为一个架构特征,来克服传统内存安全方法的许多棘手问题,例如与不安全软件的兼容性和显著的性能下降。No-FAT在SPEC CPU2017基准测试中产生了8\%的开销,VLSI测量显示了低功率和面积开销。 18 | \end{itemize} 19 | -------------------------------------------------------------------------------- /includes/原创性声明.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Apr 13, 2024 9 | % ----------------------------------------------------------------------------- 10 | 11 | \newpage 12 | \vspace*{20pt} 13 | \thispagestyle{empty} 14 | \begin{center}{\zihao{-2}\heiti 论文原创性声明}\end{center} 15 | \par\vspace*{20pt} 16 | \renewcommand{\baselinestretch}{2} 17 | {\zihao{4} 18 | 本人郑重声明:所呈交的学位论文,是本人在导师指导下,独立进行研究工作所取得的研究成果。 19 | 除文中已经标明引用的内容外,本论文不包含任何其他个人或集体已发表或撰写的研究成果。 20 | 对本文的研究做出贡献的个人和集体,均已在文中以明确方式标明。 21 | 本声明的法律结果由本人承担。 22 | 23 | \vskip 2cm 24 | 25 | \hspace*{4cm}学位论文作者(签名):\hspace{4cm} \hfill \\[1cm] 26 | \hspace*{10cm}年 \hfill 月 \hfill 日\hspace{1cm}\hfill\par} 27 | -------------------------------------------------------------------------------- /chapters/chapter3.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Apr 13, 2024 9 | % ----------------------------------------------------------------------------- 10 | 11 | \chapter{内存安全问题研究}\label{chap3} 12 | 13 | 从计算机体系结构的角度来说,内存安全违规(memory safety violation)一般分为两大类: 14 | 15 | (1)时间违规(temporal violation):典型代表为Use-After-Free(UAF)漏洞,即在释放内存后,再次对该内存进行访问。 16 | 17 | (2)空间违规(spatial violation):典型代表为栈溢出(stack overflow)漏洞,即在栈上分配的内存空间不足以存放当前的数据。 18 | 19 | 而面向返回编程(Return-Oriented Programming,ROP)、面向跳转编程(Jump-Oriented Programming,JOP)和面向调用编程(Call-Oriented Programming,COP)都是基于空间违规的攻击手段,本文将从攻击基本原理、现有芯片级对策和思考三个方面来介绍ROP/JOP/COP。 20 | 21 | 而ROP攻击产生的一大原因是因为,现代操作系统为了防止攻击者在栈上发起代码注入漏洞,采用了$W \oplus X$的内存保护机制,即栈上的内存空间只能执行,不能写入。因此,攻击者在栈上发起代码注入漏洞时,只能通过覆盖返回地址来控制程序的执行流程,而这种攻击手段就是ROP。 -------------------------------------------------------------------------------- /includes/中英文缩略语对照表.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Apr 13, 2024 9 | % ----------------------------------------------------------------------------- 10 | 11 | \chapter*{中英文缩略语对照表} 12 | 13 | \begin{center} 14 | \begin{spacing}{1.39} 15 | \renewcommand\arraystretch{1} 16 | \setlength{\tabcolsep}{4pt} 17 | \begin{tabular}{p{0.1\linewidth}p{0.5\linewidth}p{0.3\linewidth}} 18 | BHB & Branch History Buffer & 分支历史缓冲区 \\ 19 | BHI & Branch History Injection & 分支历史注入 \\ 20 | BPU & Branch Prediction Unit & 分支预测单元 \\ 21 | BRB & Branch Retention Buffer & 分支保留缓冲区 \\ 22 | BTB & Branch Target Buffer & 分支目标缓冲区 \\ 23 | CPU & Central Processing Unit & 中央处理器 \\ 24 | CVE & Common Vulnerabilities and Exposures & 通用漏洞披露 \\ 25 | \end{tabular} 26 | \end{spacing} 27 | \end{center} 28 | -------------------------------------------------------------------------------- /chapters/chapter1.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Apr 13, 2024 9 | % ----------------------------------------------------------------------------- 10 | 11 | \chapter{绪论}\label{chap1} 12 | 13 | 2018年1月3日, Google Project Zero团队的Jann Horn等安全研究者公开了两组处理器漏洞, 14 | 即Meltdown漏洞~\cite{Lipp2018meltdown}和Spectre漏洞~\cite{kocher2019spectre}。 15 | 其中Meltdown对应的漏洞编号为CVE-2017-5754(流氓数据缓存加载), 16 | 这种攻击“熔化”了由硬件来实现的安全边界,允许用户级别的应用程序“越界”访问系统级的内存,从而造成数据泄露。 17 | 而Spectre对应的漏洞编号为CVE-2017-5753(边界检查绕过)和CVE-2017-5715(分支目标注入), 18 | 利用分支预测的错误推测,让攻击者有能力触发受害者访问特定的敏感数据,并通过隐蔽信道泄露信息。 19 | 20 | 不管是Meltdown攻击还是Spectre攻击,其本质都是利用现代处理器的优化策略, 21 | 而这些优化策略在发生错误时,并不会造成架构层面(或者说ISA层面)上数据的变化, 22 | 但是由于现代处理器引入了cache、TLB、缓冲区等微架构元素,攻击者仍然有能力通过观测微架构的变化来获取信息。 23 | 而这些利用乱序执行和分支预测等机制,触发处理器执行错误的指令, 24 | 从而造成秘密数据泄露的方式统称为瞬态执行攻击(Transient Execution Attack)~\cite{xiong2021survey}。 25 | -------------------------------------------------------------------------------- /chapters/chapter5.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Apr 13, 2024 9 | % ----------------------------------------------------------------------------- 10 | 11 | \chapter{安全架构设计关键技术研究}\label{chap5} 12 | 13 | \section{ZeRØ安全架构设计} 14 | 15 | ZeRØ~\cite{ziad2021zero}提出了独特的内存指令和新颖的元数据编码方案来保护代码和数据指针,仅仅只需要微小的微架构变化。ZeRØ在SPEC CPU2017基准上的性能开销为零,VLSI测量显示了低功率和面积开销。 16 | 17 | \begin{figure}[h!] 18 | \centering 19 | \includegraphics[width=0.8\linewidth]{fig5-1.png} 20 | \caption{ZeRØ设计框架} 21 | \label{fig5.1} 22 | \end{figure} 23 | 24 | \section{No-FAT安全架构设计} 25 | 26 | No-FAT~\cite{ziad2021no}将内存分配大小(例如malloc大小)作为一个架构特征,来克服传统内存安全方法的许多棘手问题,例如与不安全软件的兼容性和显著的性能下降。No-FAT在SPEC CPU2017基准测试中产生了8\%的开销,VLSI测量显示了低功率和面积开销。 27 | 28 | \begin{figure}[h!] 29 | \centering 30 | \includegraphics[width=0.8\linewidth]{fig5-2.png} 31 | \caption{No-FAT设计框架} 32 | \label{fig5.2} 33 | \end{figure} -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 iamywang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /includes/授权协议书.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Apr 13, 2024 9 | % ----------------------------------------------------------------------------- 10 | 11 | \newpage 12 | \vspace*{20pt} 13 | \thispagestyle{empty} 14 | \begin{center}{\zihao{4}\heiti \bfseries 武汉大学学位论文使用授权协议书}\end{center} 15 | 16 | \vspace*{4pt} 17 | 18 | \begin{center}{\zihao{-5}(一式两份,一份论文作者保存,一份留学校存档)}\end{center} 19 | 20 | \vspace*{4pt} 21 | 22 | 本学位论文作者愿意遵守武汉大学关于保存、使用学位论文的管理办法及规定, 23 | 即:学校有权保存学位论文的印刷本和电子版,并提供文献检索与阅览服务; 24 | 学校可以采用影印、缩印、数字化或其它复制手段保存论文; 25 | 在以教学与科研服务为目的前提下,学校可以在校园网内公布部分或全部内容。 26 | 27 | 一、在本论文提交当年,同意在校园网内以及中国高等教育文献保障系统(CALIS)、高校学位论文系统提供查询及前十六页浏览服务。 28 | 29 | 二、在本论文提交~$\Box$~当年/~$\Box$~一年/~$\Box$~两年/~$\Box$~三年以后, 30 | 同意在校园网内允许读者在线浏览并下载全文,学校可以为存在馆际合作关系的兄弟高校用户提供文献传递服务和交换服务。 31 | (保密论文解密后遵守此规定) 32 | 33 | \vskip 0.8cm 34 | 35 | 论文作者(签名):\raisebox{-1ex}{\underline{\makebox[3.54cm][c]{}}} 36 | \vskip 0.8cm 37 | 38 | 学\qquad 号:\raisebox{-1ex}{\underline{\makebox[5cm][c]{}}} 39 | \vskip 0.8cm 40 | 41 | 学\qquad 院:\raisebox{-1ex}{\underline{\makebox[5cm][c]{}}} 42 | 43 | \vskip 1cm 44 | \begin{flushright} 45 | 日期:\hskip2cm 年\hskip1.2cm 月\hskip1.2cm 日 46 | \end{flushright} 47 | 48 | -------------------------------------------------------------------------------- /chapters/chapter4.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Feb 18, 2025 9 | % ----------------------------------------------------------------------------- 10 | 11 | \chapter{硬件级安全机制研究}\label{chap4} 12 | 13 | \section{Intel CET安全机制分析} 14 | 15 | Intel CET(Control-Flow Enforcement Technology)是Intel新推出的一项新的硬件级对策,其主要目的是防止攻击者通过ROP/JOP/COP等攻击手段来劫持控制流。 16 | 对于ROP攻击的防护,其基本思想与影子栈(shadow stack)类似,即由操作系统在内存中复制一份程序的内存栈或者是仅仅保留控制流跳转地址。然后,这个影子栈无法由正常的store、load指令进行控制,只能通过专门的指令来进行控制。因此,即使攻击者覆盖了软件栈上的返回地址,但是由于影子栈中仍然保存着原始的跳转地址,因此检查失败后会通过抛出异常来终止程序的执行。 17 | 对于JOP/COP攻击的防护,Intel提出一种叫做IBT(Indirect Branch Tracking)的技术,其基本思想是通过编译器在合理的间接跳转中⽤新的指令做标记,然后程序执行时会检查下一条指令是否为新添加的指令(endbr),如果不是则会抛出\#CP异常。 18 | 19 | \section{ARM PAC安全机制分析} 20 | 21 | ARM PAC(Pointer Authentication)是ARMv8.3引入的一项新的硬件级对策,其主要通过对指针进行鉴权来防止攻击者通过ROP/JOP/COP等攻击手段来劫持控制流。 22 | 这种防护方法的基本原理是,利用64位地址空间中暂时空闲的高16位来存放指针的鉴权结果(MAC码),然后在每次指针使用前,都会对指针进行鉴权,如果鉴权失败,则会抛出异常来终止程序的执行。 23 | 24 | \section{相关算法分析} 25 | 26 | \begin{algorithm}[h!] 27 | \zihao{5} 28 | \caption{算法工作流程} 29 | \label{alg4.1} 30 | \KwIn{ 31 | 漏洞类型$rules$, 32 | 漏洞规约$specification$, 33 | 操作集合$operations$ 34 | } 35 | 36 | \KwOut{ 37 | 漏洞列表$list$ 38 | } 39 | 40 | \For{$(i, j, k)$ in $operations$}{ 41 | \If{$(i, j, k)$ in $rules$}{ 42 | $list$.append($specification$) 43 | } 44 | } 45 | \end{algorithm} -------------------------------------------------------------------------------- /chapters/chapter2.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Apr 13, 2024 9 | % ----------------------------------------------------------------------------- 10 | 11 | \chapter{背景知识}\label{chap2} 12 | 13 | 2018年1月3日, Google Project Zero团队的Jann Horn等安全研究者公开了两组处理器漏洞, 14 | 即Meltdown漏洞~\cite{Lipp2018meltdown}和Spectre漏洞~\cite{kocher2019spectre}。 15 | 其中Meltdown对应的漏洞编号为CVE-2017-5754(流氓数据缓存加载), 16 | 这种攻击“熔化”了由硬件来实现的安全边界,允许用户级别的应用程序“越界”访问系统级的内存,从而造成数据泄露。 17 | 而Spectre对应的漏洞编号为CVE-2017-5753(边界检查绕过)和CVE-2017-5715(分支目标注入), 18 | 利用分支预测的错误推测,让攻击者有能力触发受害者访问特定的敏感数据,并通过隐蔽信道泄露信息。 19 | 20 | \begin{table}[!h] 21 | \centering 22 | \small 23 | \caption{中英文缩略语对照表} 24 | \begin{tabular}{|c|c|c|} 25 | \hline 26 | BHB & Branch History Buffer & 分支历史缓冲区 \\ 27 | \hline 28 | BHI & Branch History Injection & 分支历史注入 \\ 29 | \hline 30 | BPU & Branch Prediction Unit & 分支预测单元 \\ 31 | \hline 32 | BRB & Branch Retention Buffer & 分支保留缓冲区 \\ 33 | \hline 34 | BTB & Branch Target Buffer & 分支目标缓冲区 \\ 35 | \hline 36 | CPU & Central Processing Unit & 中央处理器 \\ 37 | \hline 38 | CVE & Common Vulnerabilities and Exposures & 通用漏洞披露 \\ 39 | \hline 40 | \end{tabular} 41 | \end{table} 42 | 43 | 不管是Meltdown攻击还是Spectre攻击,其本质都是利用现代处理器的优化策略, 44 | 而这些优化策略在发生错误时,并不会造成架构层面(或者说ISA层面)上数据的变化, 45 | 但是由于现代处理器引入了cache、TLB、缓冲区等微架构元素,攻击者仍然有能力通过观测微架构的变化来获取信息。 46 | 而这些利用乱序执行和分支预测等机制,触发处理器执行错误的指令, 47 | 从而造成秘密数据泄露的方式统称为瞬态执行攻击(Transient Execution Attack)~\cite{xiong2021survey}。 -------------------------------------------------------------------------------- /includes/中英文摘要.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Apr 13, 2024 9 | % ----------------------------------------------------------------------------- 10 | 11 | % 目录样式 12 | \titlecontents{chapter}[0em]{\bfseries}{\contentspush{\thecontentslabel \quad}}{}{\titlerule*[4pt]{.}\contentspage} 13 | \titlecontents{section}[1em]{}{\contentspush{\thecontentslabel \quad}}{}{\titlerule*[4pt]{.}\contentspage} 14 | \titlecontents{subsection}[2.5em]{}{\contentspush{\thecontentslabel \quad}}{}{\titlerule*[4pt]{.}\contentspage} 15 | \makeatletter 16 | \def\@dotsep{0.5} 17 | \makeatother 18 | 19 | % 中文摘要 20 | \chapter*{\ziju{1}摘要} 21 | \addcontentsline{toc}{chapter}{摘要} 22 | 23 | Intel CET(Control-Flow Enforcement Technology)是Intel新推出的一项新的硬件级对策,其主要目的是防止攻击者通过ROP/JOP/COP等攻击手段来劫持控制流。 24 | 对于ROP攻击的防护,其基本思想与影子栈(shadow stack)类似,即由操作系统在内存中复制一份程序的内存栈或者是仅仅保留控制流跳转地址。然后,这个影子栈无法由正常的store、load指令进行控制,只能通过专门的指令来进行控制。因此,即使攻击者覆盖了软件栈上的返回地址,但是由于影子栈中仍然保存着原始的跳转地址,因此检查失败后会通过抛出异常来终止程序的执行。 25 | 对于JOP/COP攻击的防护,Intel提出一种叫做IBT(Indirect Branch Tracking)的技术,其基本思想是通过编译器在合理的间接跳转中⽤新的指令做标记,然后程序执行时会检查下一条指令是否为新添加的指令(endbr),如果不是则会抛出\#CP异常。 26 | 27 | ARM PAC(Pointer Authentication)是ARMv8.3引入的一项新的硬件级对策,其主要通过对指针进行鉴权来防止攻击者通过ROP/JOP/COP等攻击手段来劫持控制流。 28 | 这种防护方法的基本原理是,利用64位地址空间中暂时空闲的高16位来存放指针的鉴权结果(MAC码),然后在每次指针使用前,都会对指针进行鉴权,如果鉴权失败,则会抛出异常来终止程序的执行。 29 | 30 | \vspace{1em} 31 | 32 | \noindent \heiti 关键词: 33 | \songti 体系结构,硬件安全 34 | 35 | % 英文摘要 36 | \chapter*{\bfseries ABSTRACT} 37 | \addcontentsline{toc}{chapter}{ABSTRACT} 38 | 39 | This is the abstract in English. 40 | 41 | \vspace{1em} 42 | 43 | \noindent \bfseries Key words: 44 | \normalfont Computer Architecture, Hardware Security 45 | 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 武汉大学博士/硕士学位论文Latex模板 2 | 3 | ## 0x00 模板预览 4 | 5 | ![](demo/1.png) 6 | 7 | ![](demo/2.png) 8 | 9 | ![](demo/3.png) 10 | 11 | ## 0x01 简要说明 12 | 13 | 本模板基于黄正华老师的模板制作,主要做出了以下修改: 14 | 15 | 1. 修正了页眉页脚的设置,使得页眉页脚的位置符合要求; 16 | 17 | 2. 修正了目录的设置,使得目录的格式符合要求; 18 | 19 | 3. 修正了参考文献的设置,使得参考文献的格式为国标GBT7714-2015格式,并调整大小写; 20 | 21 | 4. 修改字体设置,使得章节标题字体符合学校文件《武汉大学博士学位论文撰写及印制规格的规定》的要求,包括:标题字体设置为黑体,正文字体设置为宋体,数字以及英文字体设置为Times New Roman(这些原模板均不满足); 22 | 23 | 5. 修改论文封面的上方的下划线为虚线,下方冒号处于“研究生姓名”与名字中间,更接近学校给出的Word模板的格式,不过仍然存在差异; 24 | 25 | (2024年4月将模板进一步更新,包含学术学位、专业学位字样,以及下方包含学号等); 26 | 27 | 6. 新增插图索引、表格索引; 28 | 29 | 7. 新增中英文缩略语对照表、主要符号对照表; 30 | 31 | 8. 调整目录页的页眉,本模板自摘要开始,均包含页眉。 32 | 33 | ## 0x02 插图与参考文献 34 | 35 | 插图: 36 | 37 | - 插图的位置在`figures/chapter1`、...、`figures/chapter6`中,分别表示第1章至第6章的插图(也可以自行修改); 38 | - 详见`WHUPhd.cls`文件第254行: 39 | 40 | ```tex 41 | \graphicspath{{figures/title/}, {figures/chapter1/}, 42 | {figures/chapter2/}, {figures/chapter3/}, 43 | {figures/chapter4/}, {figures/chapter5/}, 44 | {figures/chapter6/}} 45 | ``` 46 | 47 | 参考文献: 48 | 49 | - 参考文献采用bibtex的方式,每章节对应的参考文献位于`bibs/ref1.bib`至`bibs/ref6.bib`(也可以自行修改); 50 | - 详见`thesis.tex`文件第152行: 51 | 52 | ```tex 53 | \bibliography{bibs/ref1} 54 | ``` 55 | 56 | ## 0x03 编译方法 57 | 58 | 本模板使用XeLaTeX进行编译,编译方法为: 59 | 60 | `xeLaTeX -> bibtex -> xeLaTeX -> xeLaTeX` 或 `latexmk -xelatex` 61 | 62 | ## 0x04 论文排版 63 | 64 | 使用本模板生成的论文排版顺序为: 65 | 66 | 1. 中文封面 67 | 68 | 2. 英文封面 69 | 70 | 3. 论文原创性声明 71 | 72 | 4. 论文版权使用授权书 73 | 74 | 5. 论文创新点 75 | 76 | 6. 中文摘要 77 | 78 | 7. 英文摘要 79 | 80 | 8. 目录(间距请自行调整) 81 | 82 | 9. 插图索引(间距请自行调整) 83 | 84 | 10. 表格索引(间距请自行调整) 85 | 86 | 11. 中英文缩略语对照表(间距请自行调整) 87 | 88 | 12. 主要符号对照表(请自行添加并调整间距) 89 | 90 | 13. 正文 91 | 92 | 14. 参考文献 93 | 94 | 15. 致谢 95 | 96 | **提醒:** 97 | 98 | - 如果由于本模板的原因,导致排版与学校要求不符,仍然以学校要求为准; 99 | - 因此,为了确保论文排版符合学校要求,建议最好使用学校提供的Word模板进行排版。 100 | 101 | ## 0x05 问题与联系 102 | 103 | 如果在使用本模板的过程中遇到问题,可以通过以下方式联系我: 104 | 105 | - `GitHub Issues`; 106 | - 邮箱:{wangquancheng@whu.edu.cn}。 107 | 108 | ## 0x06 致谢 109 | 110 | 致谢:http://aff.whu.edu.cn/huangzh/ 111 | -------------------------------------------------------------------------------- /bibs/ref1.bib: -------------------------------------------------------------------------------- 1 | 2 | @inproceedings{kocher2019spectre, 3 | title = {{Spectre Attacks: Exploiting Speculative Execution}}, 4 | author = {Kocher, Paul and Horn, Jann and Fogh, Anders and Genkin, Daniel and Gruss, Daniel and Haas, Werner and Hamburg, Mike and Lipp, Moritz and Mangard, Stefan and Prescher, Thomas and Schwarz, Michael and Yarom, Yuval}, 5 | booktitle = {2019 IEEE Symposium on Security and Privacy (SP)}, 6 | pages = {1--19}, 7 | year = {2019}, 8 | publisher = {IEEE} 9 | } 10 | 11 | @inproceedings{Lipp2018meltdown, 12 | title = {{Meltdown: Reading Kernel Memory from User Space}}, 13 | author = {Moritz Lipp and Michael Schwarz and Daniel Gruss and Thomas Prescher and Werner Haas and Anders Fogh and Jann Horn and Stefan Mangard and Paul Kocher and Daniel Genkin and Yuval Yarom and Mike Hamburg}, 14 | booktitle = {27th USENIX Security Symposium (USENIX Security 18)}, 15 | pages = {973--990}, 16 | year = {2018}, 17 | publisher = {USENIX Association} 18 | } 19 | 20 | @article{xiong2021survey, 21 | title = {{Survey of Transient Execution Attacks and Their Mitigations}}, 22 | author = {Xiong, Wenjie and Szefer, Jakub}, 23 | journal = {ACM Computing Surveys}, 24 | volume = {54}, 25 | number = {3}, 26 | pages = {1--36}, 27 | year = {2021}, 28 | publisher = {ACM} 29 | } 30 | 31 | @inproceedings{ziad2021no, 32 | title = {{No-FAT: Architectural support for low overhead memory safety checks}}, 33 | author = {Ziad, Mohamed Tarek Ibn and Arroyo, Miguel A and Manzhosov, Evgeny and Piersma, Ryan and Sethumadhavan, Simha}, 34 | booktitle = {2021 ACM/IEEE 48th Annual International Symposium on Computer Architecture (ISCA)}, 35 | pages = {916--929}, 36 | year = {2021}, 37 | publisher = {IEEE} 38 | } 39 | 40 | @inproceedings{ziad2021zero, 41 | title = {{ZeR{\O}: Zero-overhead resilient operation under pointer integrity attacks}}, 42 | author = {Ziad, Mohamed Tarek Ibn and Arroyo, Miguel A and Manzhosov, Evgeny and Sethumadhavan, Simha}, 43 | booktitle = {2021 ACM/IEEE 48th Annual International Symposium on Computer Architecture (ISCA)}, 44 | pages = {999--1012}, 45 | year = {2021}, 46 | publisher = {IEEE} 47 | } 48 | 49 | -------------------------------------------------------------------------------- /thesis.tex: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Feb 18, 2025 9 | % ----------------------------------------------------------------------------- 10 | 11 | \documentclass[AutoFakeBold=2]{WHUPhd} 12 | \usepackage{gbt7714} 13 | \usepackage{listings} 14 | \usepackage{multirow} 15 | \usepackage{setspace} 16 | \usepackage{titletoc} 17 | \usepackage{pdfpages} 18 | 19 | \hypersetup{hidelinks} 20 | 21 | \lstset{ 22 | language=C++, 23 | showstringspaces=false, 24 | basicstyle=\small\ttfamily, 25 | rulesepcolor=\color{gray}, 26 | breaklines=true, 27 | keywordstyle=\color{purple}\bfseries, 28 | commentstyle=\color{gray!80!black}, 29 | stringstyle=\color{blue!80!black}, 30 | frame=single, 31 | flexiblecolumns=true, 32 | lineskip={-1pt} 33 | } 34 | 35 | \begin{document} 36 | 37 | % 博士 or 硕士 38 | \DegreeA{博士} 39 | 40 | % 学硕/博 or 专硕/博 41 | \DegreeB{学术} 42 | 43 | % 封面表头信息 44 | \fenleihao{TP309} 45 | \miji{} 46 | \UDC{} 47 | \bianhao{10486} 48 | 49 | % 封面内容 50 | \title{安全计算机体系结构关键技术研究} 51 | \author{张\hfill 三\hfill 三} 52 | \Cstudentid{2\hfill 0\hfill 2\hfill 3\hfill 1\hfill 0\hfill 0\hfill 0\hfill 0\hfill 0\hfill 0\hfill 0\hfill 0} 53 | \Csupervisor{李\hfill 四\hfill \hfill 教\hfill 授} 54 | \Cmajor{网\hfill 络\hfill 空\hfill 间\hfill 安\hfill 全} 55 | \Cspeciality{信\hfill 息\hfill 安\hfill 全} 56 | \date{二〇二五年二月} 57 | 58 | \Etitle{Research on Key Techniques for Security Computer Architecture} 59 | \Eauthor{ZHANG San} 60 | \Esupervisor{Prof.~LI Si} 61 | \Eschoolname{School of Cyber Science and Engineering} 62 | \Edate{Feb 2025} 63 | 64 | \pdfbookmark[0]{封面}{title} 65 | \maketitle 66 | 67 | % 英文封面 68 | \include{includes/英文封面} 69 | 70 | % 原创性声明 71 | \include{includes/原创性声明} 72 | 73 | % 授权协议书 74 | \include{includes/授权协议书} 75 | 76 | % 创新点 77 | \include{includes/创新点} 78 | 79 | % 目录页面样式设置为含有页眉 80 | \pagenumbering{Roman} 81 | \pagestyle{fancy} 82 | \fancyfancy 83 | 84 | % 摘要 85 | \include{includes/中英文摘要} 86 | 87 | % 目录页面样式设置为不含有页眉 88 | % \pagenumbering{Roman} 89 | % \pagestyle{oldplain} 90 | 91 | % 目录样式 92 | \titlecontents{chapter}[0em]{\bfseries}{\contentspush{\thecontentslabel \quad}}{}{\titlerule*[4pt]{.}\contentspage} 93 | \titlecontents{section}[1em]{}{\contentspush{\thecontentslabel \quad}}{}{\titlerule*[4pt]{.}\contentspage} 94 | \titlecontents{subsection}[2.5em]{}{\contentspush{\thecontentslabel \quad}}{}{\titlerule*[4pt]{.}\contentspage} 95 | \makeatletter 96 | \def\@dotsep{0.5} 97 | \makeatother 98 | 99 | % 目录 100 | \pdfbookmark[0]{目录}{toc} 101 | \begin{spacing}{1.39} 102 | \tableofcontents 103 | \end{spacing} 104 | \newpage 105 | 106 | % 插图索引 107 | \renewcommand*{\addvspace}[1]{} 108 | \let\oldnumberline\numberline 109 | \renewcommand{\numberline}{\figurename~\oldnumberline} 110 | \makeatletter 111 | \renewcommand*\l@figure{\@dottedtocline{1}{0em}{2.5em}} 112 | \makeatother 113 | \begin{spacing}{1.39} 114 | \listoffigures 115 | \end{spacing} 116 | \newpage 117 | 118 | % 表格索引 119 | \renewcommand{\numberline}{\tablename~\oldnumberline} 120 | \makeatletter 121 | \renewcommand*\l@table{\@dottedtocline{1}{0em}{2.5em}} 122 | \makeatother 123 | \begin{spacing}{1.39} 124 | \listoftables 125 | \end{spacing} 126 | 127 | % 中英文缩略语对照表 128 | \include{includes/中英文缩略语对照表} 129 | 130 | % 正文样式 131 | \mainmatter 132 | \renewcommand{\baselinestretch}{1.39} 133 | \renewcommand{\arraystretch}{1.39} 134 | \baselineskip=20pt 135 | \pagestyle{fancy} 136 | \fancyfancy 137 | 138 | % 正文 139 | \include{chapters/chapter1} 140 | \include{chapters/chapter2} 141 | \include{chapters/chapter3} 142 | \include{chapters/chapter4} 143 | \include{chapters/chapter5} 144 | \include{chapters/chapter6} 145 | 146 | % 参考文献 147 | \phantomsection 148 | \addcontentsline{toc}{chapter}{参考文献} 149 | \renewcommand{\bibfont}{\zihao{5}} 150 | \setlength{\bibsep}{0pt} 151 | \bibliographystyle{gbt7714-numerical} 152 | \bibliography{bibs/ref1} 153 | 154 | % 科研成果和致谢 155 | \backmatter 156 | \include{includes/科研成果} 157 | \include{includes/致谢} 158 | 159 | \end{document} 160 | -------------------------------------------------------------------------------- /figures/title/wudaname.eps: -------------------------------------------------------------------------------- 1 | %!PS-Adobe-3.0 EPSF-3.0 2 | %%Creator: potrace 1.7, written by Peter Selinger 2001-2005 3 | %%LanguageLevel: 2 4 | %%BoundingBox: 0 0 468 168 5 | %%Pages: 1 6 | %%EndComments 7 | %%Page: 1 1 8 | currentfile /ASCII85Decode filter /LZWDecode filter cvx exec 9 | J.'GRZOs"gA.TUeVISs@bR,/NO(T\_Yh4@J6j[M4)8+mQN'n!XZ\3Wk0/t#m@KDR@U`_@Z+ 10 | VM&=\m[?*),CGm7%EIf1*'*k!MG$G0/f@qP[O^GO\1h)BG;q0JECu/#S"dP4VFeK3X>qqag 11 | Hf\-T7RXUp0s)b'T[T&#POEJ>">L*m>rUSE>!.QsTt#ff>/f/Xk@n;KJ8m[mcUIMkU:kf^T 12 | 9%airqQ\:W@0Y@m:MRh^ED0c4q> 13 | /q$F=3%ECE^H2NXBhD-`Db-TeXFZ338K^312A):J]+O9A][-\-NL+i/UF1^aEkKu35n8'03 14 | -*U_!NbLJ-4fGPliXd`Gb%rl0iir.ZY+mIA0tU4h>d;*t";[2]_qZmJ-Rh%)4fiK6hY=(.@ 15 | `$ElBm\_;":Vfo2n7/.XG@<>o#7_c3+feKqJO,KA`)Fho4p)YZ`$q6)/N> 19 | =EU_9Q>c?J6(1kK0bqXo;^dPE0GoP2Qu&4H/ 20 | ^mRHJQ&[M)e%'a%8bq3BQE$d%@r.`@/*hhe;#M%B\D;E]4Mh56)n^R2L'[:5mF^C@u[FHP> 21 | b-ZpS_M=ecEC*K8(-L4/"(J%M)8Ld%CKK4kBr.?M";tepJr1Oe=L_ka@BIf3PYbCt%9d]^/tUk"I&:PU=Z->N 24 | cSd?A0u%*K"(tG0@BLU"p6if1AN1H$BH,DdOD)r*8gnW,>-ph?I\jOqZgMlADRLL,at=[i< 25 | !sO\Z1q=Gk*l:V(7hch(=a1!?XZ>LJD!SqJ8@k[8M,"CA=A,#OBC)7[UKZM;6Yb;9%n&:=e 26 | O1K36+/49q'=+m@eI38(-4d@:F/NdA]$Ir1MZs,@La55(b_oi^'9;=,a]%](O.gi9A'l&>< 27 | &a_b.*5CHYZnI$QfOG,cPAU+C:%Xgtq1=PJK0F(I52'P1MNTDH8ccB3WB'2\R_U_@Dq67K? 28 | e354:f?Wj8ND$-.JZ<&QjL2J`E`:3E`i8alSbdJh#nnOs9PN[)tmQ8%8)"Zi)89NOO\,0Z<2M6qu9Hp!ZEjQi2.arrIPG09.Lekj4&]43&%dA"'IbAS 30 | tqMQT[9,`(1Pi06N^lFmBb!u#b`!-V2$1E?:JM)o$e=+R**hr6e+s]R$:ln8n(CK0Z9bnF7 31 | ][<8gMLP(2W*V?!o=+)8p,b]YVck3%C2D2s?!8@O)FB;(4lmkWi0ilJ12%6Un7q.;$eNbm%ck1l3!-86:6\6Vb[=C$b)Sk/:QZeD&7(-Y6jk,4W542Q 33 | M3Frp@$!Q[nFGQ[0L,u?,8Z5lGWEctN^H0nD^3#7G6,'3&+C7-"TG4P>3TC\M.LNS[#0q$? 34 | -aZfX>oH`s;0KWF%cZU(rMusWc;dqZ^gsK!BB9`Z2NV>q8gD=V<1K6n3Lo/\;VnE(eh=Js# 35 | 661$+&mpDn\sX'@2WP=FEE(#,T!!4eEm]91NlG\V*aGT&M8/Y4\Rj/bl?bRjDe_XCHO#)C) 36 | .pN-FAoo.4I$HBbc"De_D*"&nrVkWnTKf,)rV#@_IXE"_eB3\&^?O[W_RA^4MTJ8V"V=aMYqQ.c!DbOhImI>*Lei]O1^ph\3F)`HPD3 38 | q6GY-?Nn)qf(Q[lVB.N/Z;4oL"X-OOEc 40 | jW+XR@[@Y;k8e'Am:FcR_Pl/67i3d61enTg_Dm#LQ/!kS>E,,!5&U!lafu 41 | mOWo)PQ/'\'E;b8G%^UKfMCIE<^4-8*R*<-Bbc:-0)`/?NPbp]")P>;_`^"AFBjRVXCK1t@ 42 | lOBh0oQBgDp(n4IT#J+,LF+f81e&doSe/-4Wo[m8YMHVgLj((A@/Es$Kb?WS`\hS4l"&1Y15Nbo: 45 | ;kGUL92Y/``_TDE`(pdpE0p1Xme2^[952kG[0?=bf>/losTc$<)77E[Y.B-b9_542oH5(!m 46 | qfZkB+<*SlM>k/4YBPXKu`UWtplG-3V[+7*)2Sa##_hprt<9Vp%tL+*QiU#&]1@G,e4TC_B 47 | kahOG;b%rn>s#XN;L;7!*L.X+5sJ&O#A/1.VNOOE^?GuO#6XSd]Dh'fqZml_pp(A-E]F[7I 48 | I[`9\U6EmMMs2h>TKI2fVf9m*a]54YHfP9!ZFiO=:(,kM-`p$teFWDu5,_9nqq1uB]Rdd.4 49 | RQ)d>VdbF[CibN0m9-1#E)$.JE>`5-CgH73:/=Mh6nik'p$bnVClhk&Me3]tf(-kChkVRQ@ 50 | QIPsEs"I+/W=>#7R&GoD!GEQ$l"8)BX/*Tlc,fuAYDb?,=Wsms(#-8._F.u]?Vh 51 | hX4ibEC(=p7ON`Eq8uXD0.6"@h$Tn4KUW+Kn:#LWn&u8N^)WFBPK&2$t7t#l\:fe6!.ac,h 52 | NH,p;O7qTin5@k?Je:B#(o#cC=?hM2`)#B4$eAgi\he&fmHW4Jr@V:N 53 | =o'?^f8\/_TEa&_Xk%f@7YS:Z-H9W_(J>Ju'"7g0J4T#AOP"iC/AH[A?H<^[^:h:8G$#iqB 54 | Cnh/!J1%459#Bp!d!)XoAVcXT.3t*HcuK2Hm7G1^bt`%)GZiA.il@(T%*2bqn9*j(;(>+O` 55 | ?=%_+FB&4W^l8_d/7t2;HSpkXXYUC6<;OR@c'i6D2gHH#4g-XBbR=8QuR@W.$h8:qY8'2D? 56 | h5bcPU7IgeNLKVJqPDbo2uP+Kt(WNpZUU$(S"+P62+dFK&MqWQo&=#]L!ld>'bB+O\;'S8o 57 | oNlfk9fb'NH89R\PrF3l=Ol:?558;e&WeObrd27RZn1E@6IAZE=Oq 59 | O7k#bMWG#UcGm;?b6DqJ8?aL!W=MV90-Lad86P>9?>D`2$[c@Fda`!f)eCcQNs:N_7%'rRB 60 | uAC:.mAJ;LgrqK[0X]MZI2Q?N0?u[c:Q*5:Csc@)%2HX-:lq*`9s^e9T%-jU873BY5i2G3p 61 | #HWn#!75l_pRR$RdYBcmDef$EX$ABUn;3K'V46C8tUW>*gS3e<.glNJQ-HRi7%hQ&Q()-hu 62 | u0:aWB;IZd`318\V2 66 | Z&QMO`bsD?F@:D@gY5?AkX&:hW0War*XICdV&LCdo\>WE?ig"Dk!Kksm3eDBrq0+E%g,2cA 67 | U1LGi=lGc+&ZCF1f?U/l[jR*eM!^o@UC8=6-Vf"adLSE-m_T]S67j:%[q+ 68 | %%EOF 69 | -------------------------------------------------------------------------------- /WHUPhd.cls: -------------------------------------------------------------------------------- 1 | % ----------------------------------------------------------------------------- 2 | % Latex Template for Wuhan University Thesis 3 | % 4 | % Ack to Huang Zhenghua (http://aff.whu.edu.cn/huangzh/) 5 | % 6 | % Modified by iamywang 7 | % Date: Jan 29, 2024 8 | % Updated: Feb 18, 2025 9 | % ----------------------------------------------------------------------------- 10 | 11 | \ProvidesClass{WHUPhd} 12 | 13 | \LoadClass[a4paper,zihao=-4,twoside,openany]{ctexbook} 14 | 15 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}} 16 | \ProcessOptions 17 | %------------------------ Page layout ---------------------------------- 18 | \RequirePackage{fancyhdr,hyperref} 19 | \RequirePackage[top=3truecm,bottom=2.9truecm,left=2.8truecm,right=2.5truecm,xetex]{geometry} 20 | 21 | \newtoks\DegreeA 22 | \newtoks\DegreeB 23 | 24 | \newtoks\fenleihao 25 | \newtoks\bianhao 26 | \newtoks\UDC 27 | \newtoks\miji 28 | 29 | \newtoks\Cstudentid 30 | \newtoks\Csupervisor 31 | \newtoks\Cmajor 32 | \newtoks\Cspeciality 33 | 34 | \newtoks\Etitle 35 | \newtoks\Eauthor 36 | \newtoks\Esupervisor 37 | \newtoks\Eschoolname 38 | \newtoks\Edate 39 | 40 | \setCJKfamilyfont{song}{SimSun} 41 | \setCJKfamilyfont{hei}{SimHei} 42 | \setCJKfamilyfont{kai}{KaiTi} 43 | \setCJKfamilyfont{fs}{FangSong} 44 | 45 | \renewcommand{\songti}{\CJKfamily{song}} % 宋体 46 | \renewcommand{\heiti}{\CJKfamily{hei}} % 黑体 47 | \renewcommand{\kaishu}{\CJKfamily{kai}} % 楷体 48 | \renewcommand{\fangsong}{\CJKfamily{fs}} % 仿宋 49 | 50 | \setmainfont{Times New Roman} 51 | \setsansfont{Times New Roman} 52 | \setCJKmainfont{SimSun} 53 | \setCJKsansfont{KaiTi} 54 | 55 | %===============================================页眉设置=====================================================% 56 | \renewcommand{\headrulewidth}{0.5pt} %在页眉下画一个0.5pt宽的分隔线 57 | \renewcommand{\footrulewidth}{0pt} % 在页脚不画分隔线。 58 | 59 | \let\ps@oldplain\ps@plain 60 | 61 | \fancyhf{} %清除以前对页眉页脚的设置 62 | \fancyhead[CE]{\zihao{-5}武汉大学 \the\DegreeA 学位论文} %偶数页页眉居中位置的设置. 不填则为空. 63 | \fancyhead[CO]{\zihao{-5}\@title} %L,C,R 是左中右; O,E 是奇偶. 可以自己组合调整. 64 | \fancyfoot[C]{\zihao{-5}\thepage} %页面下侧的设置. 大括号内置空, 表示什么也不填. 反之, 没有此命令的话, 会在页脚出现页码 65 | \newcommand{\fancyfancy}{\fancypagestyle{plain}{% 66 | \fancyhf{} 67 | \fancyhead[CE]{\zihao{-5}武汉大学 \the\DegreeA 学位论文} %偶数页页眉居中位置的设置. 不填则为空. 68 | \fancyhead[CO]{\zihao{-5}\@title} %L,C,R 是左中右; O,E 是奇偶. 可以自己组合调整. 69 | \fancyfoot[C]{\zihao{-5}\thepage}}} 70 | %%%=== 封面 ===%%% 71 | \def\maketitle{% 72 | \null 73 | \thispagestyle{empty}% 74 | \begin{center}\leavevmode 75 | {\fangsong \zihao{4}% 76 | \begin{tabular}{lp{2cm}p{6cm}lp{2cm}} 77 | \raisebox{-0.5ex}[0pt]{\makebox[1.5cm][s]{分\hfill 类\hfill 号}} & 78 | \raisebox{-0.5ex}[0pt]{\makebox[2cm][c]{\the\fenleihao}} & \hfill & 79 | \raisebox{-0.5ex}[0pt]{\makebox[1.5cm][s]{密\hfill 级}} & 80 | \raisebox{-0.5ex}[0pt]{\makebox[2cm][c]{\the\miji}} \\ 81 | \cdashline{2-2}[1.5pt/0.5pt]\cdashline{5-5}[1.5pt/0.5pt] 82 | \raisebox{-0.5ex}[0pt]{\makebox[1.5cm][s]{U\hfill D\hfill C}} & 83 | \raisebox{-0.5ex}[0pt]{\makebox[2cm][c]{\the\UDC}} & \hfill & 84 | \raisebox{-0.5ex}[0pt]{\makebox[1.5cm][s]{编\hfill 号}} & 85 | \raisebox{-0.5ex}[0pt]{\makebox[2cm][c]{\the\bianhao}} \\ 86 | \cdashline{2-2}[1.5pt/0.5pt]\cdashline{5-5}[1.5pt/0.5pt] 87 | \end{tabular} 88 | } 89 | \par 90 | \vspace*{15mm} %插入空白 91 | {\songti \zihao{2} \ziju{1} %武汉大学 92 | \includegraphics[width=0.4\textwidth]{wudaname.eps}\\ 93 | \bfseries \the\DegreeA 学位论文 \\[8mm] 94 | \ziju{0} \zihao{-2}(\the\DegreeB 学位)}\\ 95 | \vspace{2cm} 96 | {\kaishu \zihao{1} \@title \par}% 97 | % \vspace{4cm} 98 | \vfill\vfill\vfill 99 | {\songti \zihao{4} 100 | \setlength{\tabcolsep}{0pt} 101 | \begin{tabular}{ccc} 102 | \makebox[5cm][s]{研\hfill 究\hfill 生\hfill 姓\hfill 名} & 103 | \makebox[0.7cm][r]{:} & 104 | \makebox[5cm][s]{\@author} \\ 105 | \makebox[5cm][s]{学\hfill 号} & 106 | \makebox[0.7cm][r]{:} & 107 | \makebox[5cm][s]{\the\Cstudentid} \\ 108 | \makebox[5cm][s]{校\hfill 内\hfill 导\hfill 师\hfill 姓\hfill 名、\hfill 职\hfill 称} & 109 | \makebox[0.7cm][r]{:} & 110 | \makebox[5cm][s]{\the\Csupervisor} \\ 111 | \makebox[5cm][s]{学\hfill 科、\hfill 专\hfill 业\hfill 名\hfill 称} & 112 | \makebox[0.7cm][r]{:} & 113 | \makebox[5cm][s]{\the\Cmajor} \\ 114 | \makebox[5cm][s]{研\hfill 究\hfill 方\hfill 向} & 115 | \makebox[0.7cm][r]{:} & 116 | \makebox[5cm][s]{\the\Cspeciality} \\ 117 | \end{tabular} 118 | } 119 | \par 120 | \vspace{25mm} 121 | { 122 | {\heiti \zihao{3} \@date \par}% 123 | } 124 | \end{center}% 125 | \null 126 | } 127 | 128 | %%------------------------常用宏包----------------------------------- 129 | \RequirePackage{amsmath,amssymb}% AMSLaTeX宏包. 130 | \RequirePackage[amsmath,thmmarks]{ntheorem} 131 | \RequirePackage{graphicx} % 图形 132 | \RequirePackage{color,xcolor} %支持彩色 133 | \RequirePackage{cite} % 参考文献引用, 得到形如 [3-7] 的样式. 134 | \RequirePackage{url} 135 | \RequirePackage{enumerate} 136 | \RequirePackage{bookmark} 137 | \RequirePackage{arydshln} 138 | \RequirePackage{colortbl} 139 | \RequirePackage[ruled,linesnumbered,resetcount,algochapter]{algorithm2e} 140 | %%----------------------- Theorems ----------------------------------- 141 | \theoremstyle{plain} 142 | \theoremheaderfont{\heiti} 143 | \theorembodyfont{\songti} \theoremindent0em 144 | \theorempreskip{0pt} 145 | \theorempostskip{0pt} 146 | \theoremnumbering{arabic} 147 | \newtheorem{theorem}{\hspace{2em}定理}[section] 148 | \newtheorem{definition}{\hspace{2em}定义}[section] 149 | \newtheorem{lemma}{\hspace{2em}引理}[section] 150 | \newtheorem{corollary}{\hspace{2em}推论}[section] 151 | \newtheorem{proposition}{\hspace{2em}性质}[section] 152 | \newtheorem{example}{\hspace{2em}例}[section] 153 | \newtheorem{remark}{\hspace{2em}注}[section] 154 | 155 | \theoremstyle{nonumberplain} 156 | \theoremheaderfont{\heiti} 157 | \theorembodyfont{\normalfont \rm \songti} 158 | \theoremindent0em \theoremseparator{\hspace{1em}} 159 | \theoremsymbol{$\square$} 160 | \newtheorem{proof}{\hspace{2em}证明} 161 | 162 | %%%--- Publications ------------------------------- 163 | \newenvironment{publications}[1] 164 | {\renewcommand\bibname{}\begin{thebibliography}{#1}} 165 | {\end{thebibliography}} 166 | 167 | %%%--- \upcite ---------------------------------------- 168 | \newcommand{\upcite}[1]{\textsuperscript{\cite{#1}}} %自定义新命令\upcite, 使参考文献引用以上标出现 169 | 170 | %%%=== suppress extra inter-line spacing in \list environments 171 | \makeatletter \setlength\partopsep{0pt} 172 | \def\@listI{\leftmargin\leftmargini 173 | \parsep 0pt 174 | \topsep \parsep 175 | \itemsep \parsep} 176 | \@listI 177 | \def\@listii {\leftmargin\leftmarginii 178 | \labelwidth\leftmarginii 179 | \advance\labelwidth-\labelsep 180 | \parsep \z@ \@plus\z@ \@minus\z@ 181 | \topsep \parsep 182 | \itemsep \parsep} 183 | \def\@listiii{\leftmargin\leftmarginiii 184 | \labelwidth\leftmarginiii 185 | \advance\labelwidth-\labelsep 186 | \parsep \z@ \@plus\z@ \@minus\z@ 187 | \topsep \parsep 188 | \itemsep \parsep} 189 | \def\@listiv{\leftmargin\leftmarginiv 190 | \labelwidth\leftmarginiv 191 | \advance\labelwidth-\labelsep 192 | \parsep \z@ \@plus\z@ \@minus\z@ 193 | \topsep \parsep 194 | \itemsep \parsep} 195 | \def\@listv{\leftmargin\leftmarginv 196 | \labelwidth\leftmarginv 197 | \advance\labelwidth-\labelsep 198 | \parsep \z@ \@plus\z@ \@minus\z@ 199 | \topsep \parsep 200 | \itemsep \parsep} 201 | \def\@listvi{\leftmargin\leftmarginvi 202 | \labelwidth\leftmarginvi 203 | \advance\labelwidth-\labelsep 204 | \parsep \z@ \@plus\z@ \@minus\z@ 205 | \topsep \parsep 206 | \itemsep \parsep} 207 | % 208 | % Change default margins for \list environments 209 | \setlength\leftmargini {2\ccwd} \setlength\leftmarginii 210 | {\leftmargini} \setlength\leftmarginiii {\leftmargini} 211 | \setlength\leftmarginiv {\leftmargini} \setlength\leftmarginv 212 | {\ccwd} \setlength\leftmarginvi {\ccwd} \setlength\leftmargin 213 | {\leftmargini} \setlength\labelsep {.5\ccwd} 214 | \setlength\labelwidth {\leftmargini} 215 | % 216 | \setlength\listparindent{2\ccwd} 217 | % Change \listparindent to 2\ccwd in \list 218 | \def\list#1#2{\ifnum \@listdepth >5\relax \@toodeep 219 | \else \global\advance\@listdepth\@ne \fi 220 | \rightmargin \z@ \listparindent2\ccwd \itemindent \z@ 221 | \csname @list\romannumeral\the\@listdepth\endcsname 222 | \def\@itemlabel{#1}\let\makelabel\@mklab \@nmbrlistfalse #2\relax 223 | \@trivlist 224 | \parskip\parsep \parindent\listparindent 225 | \advance\linewidth -\rightmargin \advance\linewidth -\leftmargin 226 | \advance\@totalleftmargin \leftmargin 227 | \parshape \@ne \@totalleftmargin \linewidth 228 | \ignorespaces} 229 | 230 | \makeatother 231 | 232 | %%% ---- 章节标题设置 ----- %%%% 233 | \CTEXsetup[nameformat={\normalfont\zihao{-2}\heiti}, 234 | titleformat={\normalfont\zihao{-2}\heiti}, 235 | number={\arabic{chapter}},name={,},afterskip={8pt},beforeskip={-28pt}]{chapter} 236 | \CTEXsetup[format+={\normalfont\zihao{3}\heiti\raggedright},afterskip={2pt},beforeskip={0pt}]{section} 237 | \CTEXsetup[format+={\normalfont\zihao{4}\heiti\raggedright},afterskip={2pt},beforeskip={0pt}]{subsection} 238 | \CTEXsetup[format+={\normalfont\zihao{-4}\heiti\raggedright},afterskip={2pt},beforeskip={0pt}]{subsubsection} 239 | \CTEXoptions[bibname={\zihao{4} \bfseries 参考文献}] 240 | \setcounter{tocdepth}{2} 241 | \setcounter{secnumdepth}{4} 242 | 243 | %--------------------------------------------------- 244 | \renewcommand{\contentsname}{\ziju{1}目录} 245 | \renewcommand{\listfigurename}{插图索引} 246 | \renewcommand{\listtablename}{表格索引} 247 | 248 | \renewcommand{\algorithmcfname}{算法} 249 | \renewcommand{\KwIn}{\textbf{输入:}} 250 | \renewcommand{\KwOut}{\textbf{输出:}} 251 | \SetKwRepeat{Do}{do}{while} 252 | 253 | \renewcommand{\arraystretch}{1.39} 254 | \newcommand\acknowledgement{\backmatter\chapter[致谢]{\ziju{1}致谢}} 255 | \newcommand\reseachresult{\backmatter\chapter{攻博期间发表的科研成果目录}} 256 | 257 | %%%=== 图片路径=== %%% 258 | \RequirePackage[font=small,textfont=sf,labelfont=sf]{caption} 259 | \RequirePackage[list=false,hypcap=true]{subcaption} 260 | \graphicspath{{figures/title/}, {figures/chapter1/}, 261 | {figures/chapter2/}, {figures/chapter3/}, 262 | {figures/chapter4/}, {figures/chapter5/}, 263 | {figures/chapter6/}} 264 | 265 | \allowdisplaybreaks 266 | \endlinechar `\^^M 267 | \endinput 268 | -------------------------------------------------------------------------------- /gbt7714.sty: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `gbt7714.sty', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% gbt7714.dtx (with options: `package') 8 | %% ------------------------------------------------------------------- 9 | %% GB/T 7714 BibTeX Style 10 | %% https://github.com/zepinglee/gbt7714-bibtex-style 11 | %% Version: 2022/10/03 v2.1.5 12 | %% ------------------------------------------------------------------- 13 | %% Copyright (C) 2016--2023 by Zeping Lee 14 | %% ------------------------------------------------------------------- 15 | %% This file may be distributed and/or modified under the 16 | %% conditions of the LaTeX Project Public License, either version 1.3c 17 | %% of this license or (at your option) any later version. 18 | %% The latest version of this license is in 19 | %% https://www.latex-project.org/lppl.txt 20 | %% and version 1.3c or later is part of all distributions of LaTeX 21 | %% version 2008 or later. 22 | %% ------------------------------------------------------------------- 23 | \NeedsTeXFormat{LaTeX2e}[1999/12/01] 24 | \ProvidesPackage{gbt7714} 25 | [2022/10/03 v2.1.5 GB/T 7714 BibTeX Style] 26 | \newif\ifgbt@legacy@interface 27 | \newif\ifgbt@mmxv 28 | \newif\ifgbt@numerical 29 | \newif\ifgbt@super 30 | \newcommand\gbt@obsolete@option[1]{% 31 | \PackageWarning{gbt7714}{The option "#1" is obsolete}% 32 | } 33 | \DeclareOption{2015}{% 34 | \gbt@obsolete@option{2015}% 35 | \gbt@legacy@interfacetrue 36 | \gbt@mmxvtrue 37 | } 38 | \DeclareOption{2005}{% 39 | \gbt@obsolete@option{2005}% 40 | \gbt@legacy@interfacetrue 41 | \gbt@mmxvfalse 42 | } 43 | \DeclareOption{super}{% 44 | \gbt@obsolete@option{super}% 45 | \gbt@legacy@interfacetrue 46 | \gbt@numericaltrue 47 | \gbt@supertrue 48 | } 49 | \DeclareOption{numbers}{% 50 | \gbt@obsolete@option{numbers}% 51 | \gbt@legacy@interfacetrue 52 | \gbt@numericaltrue 53 | \gbt@superfalse 54 | } 55 | \DeclareOption{authoryear}{% 56 | \gbt@obsolete@option{authoryear}% 57 | \gbt@legacy@interfacetrue 58 | \gbt@numericalfalse 59 | } 60 | \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{natbib}} 61 | \ProcessOptions\relax 62 | \RequirePackage{natbib} 63 | \RequirePackage{url} 64 | \def\NAT@cmprs{\@ne} 65 | \renewcommand\newblock{\space} 66 | \newcommand\bibstyle@super{\bibpunct{[}{]}{,}{s}{,}{\textsuperscript{,}}} 67 | \newcommand\bibstyle@numbers{\bibpunct{[}{]}{,}{n}{,}{,}} 68 | \newcommand\bibstyle@authoryear{\bibpunct{(}{)}{;}{a}{,}{,}} 69 | \newcommand\bibstyle@inline{\bibstyle@numbers} 70 | \@namedef{bibstyle@gbt7714-numerical}{\bibstyle@super} 71 | \@namedef{bibstyle@gbt7714-author-year}{\bibstyle@authoryear} 72 | \@namedef{bibstyle@gbt7714-2005-numerical}{\bibstyle@super} 73 | \@namedef{bibstyle@gbt7714-2005-author-year}{\bibstyle@authoryear} 74 | \renewcommand\NAT@citesuper[3]{% 75 | \ifNAT@swa 76 | \if*#2*\else 77 | #2\NAT@spacechar 78 | \fi 79 | % \unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close}% 80 | % \if*#3*\else\NAT@spacechar#3\fi\else #1\fi\endgroup} 81 | \unskip\kern\p@ 82 | \textsuperscript{% 83 | \NAT@@open 84 | #1% 85 | \NAT@@close 86 | \if*#3*\else 87 | #3% 88 | \fi 89 | }% 90 | \kern\p@ 91 | \else 92 | #1% 93 | \fi 94 | \endgroup 95 | } 96 | \renewcommand\NAT@citenum[3]{% 97 | \ifNAT@swa 98 | \NAT@@open 99 | \if*#2*\else 100 | #2\NAT@spacechar 101 | \fi 102 | % #1\if*#3*\else\NAT@cmt#3\fi\NAT@@close\else#1\fi\endgroup} 103 | #1\NAT@@close 104 | \if*#3*\else 105 | \textsuperscript{#3}% 106 | \fi 107 | \else 108 | #1% 109 | \fi 110 | \endgroup 111 | } 112 | \def\NAT@citexnum[#1][#2]#3{% 113 | \NAT@reset@parser 114 | \NAT@sort@cites{#3}% 115 | \NAT@reset@citea 116 | \@cite{\def\NAT@num{-1}\let\NAT@last@yr\relax\let\NAT@nm\@empty 117 | \@for\@citeb:=\NAT@cite@list\do 118 | {\@safe@activestrue 119 | \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}% 120 | \@safe@activesfalse 121 | \@ifundefined{b@\@citeb\@extra@b@citeb}{% 122 | {\reset@font\bfseries?} 123 | \NAT@citeundefined\PackageWarning{natbib}% 124 | {Citation `\@citeb' on page \thepage \space undefined}}% 125 | {\let\NAT@last@num\NAT@num\let\NAT@last@nm\NAT@nm 126 | \NAT@parse{\@citeb}% 127 | \ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{% 128 | \let\NAT@name=\NAT@all@names 129 | \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}% 130 | \fi 131 | \ifNAT@full\let\NAT@nm\NAT@all@names\else 132 | \let\NAT@nm\NAT@name\fi 133 | \ifNAT@swa 134 | \@ifnum{\NAT@ctype>\@ne}{% 135 | \@citea 136 | \NAT@hyper@{\@ifnum{\NAT@ctype=\tw@}{\NAT@test{\NAT@ctype}}{\NAT@alias}}% 137 | }{% 138 | \@ifnum{\NAT@cmprs>\z@}{% 139 | \NAT@ifcat@num\NAT@num 140 | {\let\NAT@nm=\NAT@num}% 141 | {\def\NAT@nm{-2}}% 142 | \NAT@ifcat@num\NAT@last@num 143 | {\@tempcnta=\NAT@last@num\relax}% 144 | {\@tempcnta\m@ne}% 145 | \@ifnum{\NAT@nm=\@tempcnta}{% 146 | \@ifnum{\NAT@merge>\@ne}{}{\NAT@last@yr@mbox}% 147 | }{% 148 | \advance\@tempcnta by\@ne 149 | \@ifnum{\NAT@nm=\@tempcnta}{% 150 | % \ifx\NAT@last@yr\relax 151 | % \def@NAT@last@yr{\@citea}% 152 | % \else 153 | % \def@NAT@last@yr{--\NAT@penalty}% 154 | % \fi 155 | \def@NAT@last@yr{-\NAT@penalty}% 156 | }{% 157 | \NAT@last@yr@mbox 158 | }% 159 | }% 160 | }{% 161 | \@tempswatrue 162 | \@ifnum{\NAT@merge>\@ne}{\@ifnum{\NAT@last@num=\NAT@num\relax}{\@tempswafalse}{}}{}% 163 | \if@tempswa\NAT@citea@mbox\fi 164 | }% 165 | }% 166 | \NAT@def@citea 167 | \else 168 | \ifcase\NAT@ctype 169 | \ifx\NAT@last@nm\NAT@nm \NAT@yrsep\NAT@penalty\NAT@space\else 170 | \@citea \NAT@test{\@ne}\NAT@spacechar\NAT@mbox{\NAT@super@kern\NAT@@open}% 171 | \fi 172 | \if*#1*\else#1\NAT@spacechar\fi 173 | \NAT@mbox{\NAT@hyper@{{\citenumfont{\NAT@num}}}}% 174 | \NAT@def@citea@box 175 | \or 176 | \NAT@hyper@citea@space{\NAT@test{\NAT@ctype}}% 177 | \or 178 | \NAT@hyper@citea@space{\NAT@test{\NAT@ctype}}% 179 | \or 180 | \NAT@hyper@citea@space\NAT@alias 181 | \fi 182 | \fi 183 | }% 184 | }% 185 | \@ifnum{\NAT@cmprs>\z@}{\NAT@last@yr}{}% 186 | \ifNAT@swa\else 187 | % \@ifnum{\NAT@ctype=\z@}{% 188 | % \if*#2*\else\NAT@cmt#2\fi 189 | % }{}% 190 | \NAT@mbox{\NAT@@close}% 191 | \@ifnum{\NAT@ctype=\z@}{% 192 | \if*#2*\else 193 | \textsuperscript{#2}% 194 | \fi 195 | }{}% 196 | \NAT@super@kern 197 | \fi 198 | }{#1}{#2}% 199 | }% 200 | \renewcommand\NAT@cite% 201 | [3]{\ifNAT@swa\NAT@@open\if*#2*\else#2\NAT@spacechar\fi 202 | #1\NAT@@close\if*#3*\else\textsuperscript{#3}\fi\else#1\fi\endgroup} 203 | \def\NAT@citex% 204 | [#1][#2]#3{% 205 | \NAT@reset@parser 206 | \NAT@sort@cites{#3}% 207 | \NAT@reset@citea 208 | \@cite{\let\NAT@nm\@empty\let\NAT@year\@empty 209 | \@for\@citeb:=\NAT@cite@list\do 210 | {\@safe@activestrue 211 | \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}% 212 | \@safe@activesfalse 213 | \@ifundefined{b@\@citeb\@extra@b@citeb}{\@citea% 214 | {\reset@font\bfseries ?}\NAT@citeundefined 215 | \PackageWarning{natbib}% 216 | {Citation `\@citeb' on page \thepage \space undefined}\def\NAT@date{}}% 217 | {\let\NAT@last@nm=\NAT@nm\let\NAT@last@yr=\NAT@year 218 | \NAT@parse{\@citeb}% 219 | \ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{% 220 | \let\NAT@name=\NAT@all@names 221 | \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}% 222 | \fi 223 | \ifNAT@full\let\NAT@nm\NAT@all@names\else 224 | \let\NAT@nm\NAT@name\fi 225 | \ifNAT@swa\ifcase\NAT@ctype 226 | \if\relax\NAT@date\relax 227 | \@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}\NAT@date}% 228 | \else 229 | \ifx\NAT@last@nm\NAT@nm\NAT@yrsep 230 | \ifx\NAT@last@yr\NAT@year 231 | \def\NAT@temp{{?}}% 232 | \ifx\NAT@temp\NAT@exlab\PackageWarningNoLine{natbib}% 233 | {Multiple citation on page \thepage: same authors and 234 | year\MessageBreak without distinguishing extra 235 | letter,\MessageBreak appears as question mark}\fi 236 | \NAT@hyper@{\NAT@exlab}% 237 | \else\unskip\NAT@spacechar 238 | \NAT@hyper@{\NAT@date}% 239 | \fi 240 | \else 241 | \@citea\NAT@hyper@{% 242 | \NAT@nmfmt{\NAT@nm}% 243 | \hyper@natlinkbreak{% 244 | \NAT@aysep\NAT@spacechar}{\@citeb\@extra@b@citeb 245 | }% 246 | \NAT@date 247 | }% 248 | \fi 249 | \fi 250 | \or\@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}}% 251 | \or\@citea\NAT@hyper@{\NAT@date}% 252 | \or\@citea\NAT@hyper@{\NAT@alias}% 253 | \fi \NAT@def@citea 254 | \else 255 | \ifcase\NAT@ctype 256 | \if\relax\NAT@date\relax 257 | \@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}}% 258 | \else 259 | \ifx\NAT@last@nm\NAT@nm\NAT@yrsep 260 | \ifx\NAT@last@yr\NAT@year 261 | \def\NAT@temp{{?}}% 262 | \ifx\NAT@temp\NAT@exlab\PackageWarningNoLine{natbib}% 263 | {Multiple citation on page \thepage: same authors and 264 | year\MessageBreak without distinguishing extra 265 | letter,\MessageBreak appears as question mark}\fi 266 | \NAT@hyper@{\NAT@exlab}% 267 | \else 268 | \unskip\NAT@spacechar 269 | \NAT@hyper@{\NAT@date}% 270 | \fi 271 | \else 272 | \@citea\NAT@hyper@{% 273 | \NAT@nmfmt{\NAT@nm}% 274 | \hyper@natlinkbreak{\NAT@spacechar\NAT@@open\if*#1*\else#1\NAT@spacechar\fi}% 275 | {\@citeb\@extra@b@citeb}% 276 | \NAT@date 277 | }% 278 | \fi 279 | \fi 280 | \or\@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}}% 281 | \or\@citea\NAT@hyper@{\NAT@date}% 282 | \or\@citea\NAT@hyper@{\NAT@alias}% 283 | \fi 284 | \if\relax\NAT@date\relax 285 | \NAT@def@citea 286 | \else 287 | \NAT@def@citea@close 288 | \fi 289 | \fi 290 | }}\ifNAT@swa\else 291 | % \if*#2*\else\NAT@cmt#2\fi 292 | \if\relax\NAT@date\relax\else\NAT@@close\fi 293 | \if*#2*\else\textsuperscript{#2}\fi 294 | \fi}{#1}{#2}} 295 | \renewcommand\@biblabel[1]{[#1]\hfill} 296 | \g@addto@macro\UrlBreaks{% 297 | \do0\do1\do2\do3\do4\do5\do6\do7\do8\do9% 298 | \do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M 299 | \do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X\do\Y\do\Z 300 | \do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l\do\m 301 | \do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z 302 | } 303 | \Urlmuskip=0mu plus 0.1mu 304 | \newif\ifgbt@bib@style@written 305 | \@ifpackageloaded{chapterbib}{}{% 306 | \def\bibliography#1{% 307 | \ifgbt@bib@style@written\else 308 | \bibliographystyle{gbt7714-numerical}% 309 | \fi 310 | \if@filesw 311 | \immediate\write\@auxout{\string\bibdata{\zap@space#1 \@empty}}% 312 | \fi 313 | \@input@{\jobname.bbl}} 314 | \def\bibliographystyle#1{% 315 | \gbt@bib@style@writtentrue 316 | \ifx\@begindocumenthook\@undefined\else 317 | \expandafter\AtBeginDocument 318 | \fi 319 | {\if@filesw 320 | \immediate\write\@auxout{\string\bibstyle{#1}}% 321 | \fi}% 322 | }% 323 | } 324 | \ifgbt@legacy@interface 325 | \ifgbt@numerical 326 | \ifgbt@super\else 327 | \citestyle{numbers} 328 | \fi 329 | \bibliographystyle{gbt7714-numerical} 330 | \else 331 | \bibliographystyle{gbt7714-author-year} 332 | \fi 333 | \fi 334 | -------------------------------------------------------------------------------- /gbt7714-numerical.bst: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `gbt7714-numerical.bst', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% gbt7714.dtx (with options: `2015,numerical') 8 | %% ------------------------------------------------------------------- 9 | %% GB/T 7714 BibTeX Style 10 | %% https://github.com/zepinglee/gbt7714-bibtex-style 11 | %% Version: 2022/10/03 v2.1.5 12 | %% ------------------------------------------------------------------- 13 | %% Copyright (C) 2016--2023 by Zeping Lee 14 | %% ------------------------------------------------------------------- 15 | %% This file may be distributed and/or modified under the 16 | %% conditions of the LaTeX Project Public License, either version 1.3c 17 | %% of this license or (at your option) any later version. 18 | %% The latest version of this license is in 19 | %% https://www.latex-project.org/lppl.txt 20 | %% and version 1.3c or later is part of all distributions of LaTeX 21 | %% version 2008 or later. 22 | %% ------------------------------------------------------------------- 23 | INTEGERS { 24 | citation.et.al.min 25 | citation.et.al.use.first 26 | bibliography.et.al.min 27 | bibliography.et.al.use.first 28 | uppercase.name 29 | terms.in.macro 30 | year.after.author 31 | period.after.author 32 | italic.book.title 33 | sentence.case.title 34 | link.title 35 | title.in.journal 36 | show.patent.country 37 | show.mark 38 | space.before.mark 39 | show.medium.type 40 | short.journal 41 | italic.journal 42 | link.journal 43 | bold.journal.volume 44 | show.missing.address.publisher 45 | space.before.pages 46 | only.start.page 47 | wave.dash.in.pages 48 | show.urldate 49 | show.url 50 | show.doi 51 | show.preprint 52 | show.note 53 | show.english.translation 54 | end.with.period 55 | } 56 | 57 | STRINGS { 58 | component.part.label 59 | } 60 | 61 | FUNCTION {load.config} 62 | { 63 | #2 'citation.et.al.min := 64 | #1 'citation.et.al.use.first := 65 | #4 'bibliography.et.al.min := 66 | #3 'bibliography.et.al.use.first := 67 | #0 'uppercase.name := 68 | #0 'terms.in.macro := 69 | #0 'year.after.author := 70 | #1 'period.after.author := 71 | #0 'italic.book.title := 72 | #1 'sentence.case.title := 73 | #0 'link.title := 74 | #1 'title.in.journal := 75 | #0 'show.patent.country := 76 | #1 'show.mark := 77 | #0 'space.before.mark := 78 | #1 'show.medium.type := 79 | "slash" 'component.part.label := 80 | #0 'short.journal := 81 | #0 'italic.journal := 82 | #0 'link.journal := 83 | #0 'bold.journal.volume := 84 | #0 'show.missing.address.publisher := 85 | #1 'space.before.pages := 86 | #0 'only.start.page := 87 | #0 'wave.dash.in.pages := 88 | #1 'show.urldate := 89 | #1 'show.url := 90 | #1 'show.doi := 91 | #1 'show.preprint := 92 | #0 'show.note := 93 | #0 'show.english.translation := 94 | #1 'end.with.period := 95 | } 96 | 97 | ENTRY 98 | { address 99 | archivePrefix 100 | author 101 | booktitle 102 | date 103 | doi 104 | edition 105 | editor 106 | eprint 107 | eprinttype 108 | entrysubtype 109 | howpublished 110 | institution 111 | journal 112 | journaltitle 113 | key 114 | langid 115 | language 116 | location 117 | mark 118 | medium 119 | note 120 | number 121 | organization 122 | pages 123 | publisher 124 | school 125 | series 126 | shortjournal 127 | title 128 | translation 129 | translator 130 | url 131 | urldate 132 | volume 133 | year 134 | } 135 | { entry.lang entry.is.electronic is.pure.electronic entry.numbered } 136 | { label extra.label sort.label short.label short.list entry.mark entry.url } 137 | 138 | INTEGERS { output.state before.all mid.sentence after.sentence after.block after.slash } 139 | 140 | INTEGERS { lang.zh lang.ja lang.en lang.ru lang.other } 141 | 142 | INTEGERS { charptr len } 143 | 144 | FUNCTION {init.state.consts} 145 | { #0 'before.all := 146 | #1 'mid.sentence := 147 | #2 'after.sentence := 148 | #3 'after.block := 149 | #4 'after.slash := 150 | #3 'lang.zh := 151 | #4 'lang.ja := 152 | #1 'lang.en := 153 | #2 'lang.ru := 154 | #0 'lang.other := 155 | } 156 | 157 | FUNCTION {bbl.anonymous} 158 | { entry.lang lang.zh = 159 | { "佚名" } 160 | { "Anon" } 161 | if$ 162 | } 163 | 164 | FUNCTION {bbl.space} 165 | { entry.lang lang.zh = 166 | { "\ " } 167 | { " " } 168 | if$ 169 | } 170 | 171 | FUNCTION {bbl.and} 172 | { "" } 173 | 174 | FUNCTION {bbl.et.al} 175 | { entry.lang lang.zh = 176 | { "等" } 177 | { entry.lang lang.ja = 178 | { "他" } 179 | { entry.lang lang.ru = 180 | { "идр" } 181 | { "et~al." } 182 | if$ 183 | } 184 | if$ 185 | } 186 | if$ 187 | } 188 | 189 | FUNCTION {citation.and} 190 | { terms.in.macro 191 | { "{\biband}" } 192 | 'bbl.and 193 | if$ 194 | } 195 | 196 | FUNCTION {citation.et.al} 197 | { terms.in.macro 198 | { "{\bibetal}" } 199 | 'bbl.et.al 200 | if$ 201 | } 202 | 203 | FUNCTION {bbl.colon} { ": " } 204 | 205 | FUNCTION {bbl.pages.colon} 206 | { space.before.pages 207 | { ": " } 208 | { ":\allowbreak " } 209 | if$ 210 | } 211 | 212 | FUNCTION {bbl.wide.space} { "\quad " } 213 | 214 | FUNCTION {bbl.slash} { "//\allowbreak " } 215 | 216 | FUNCTION {bbl.sine.loco} 217 | { entry.lang lang.zh = 218 | { "[出版地不详]" } 219 | { "[S.l.]" } 220 | if$ 221 | } 222 | 223 | FUNCTION {bbl.sine.nomine} 224 | { entry.lang lang.zh = 225 | { "[出版者不详]" } 226 | { "[s.n.]" } 227 | if$ 228 | } 229 | 230 | FUNCTION {bbl.sine.loco.sine.nomine} 231 | { entry.lang lang.zh = 232 | { "[出版地不详: 出版者不详]" } 233 | { "[S.l.: s.n.]" } 234 | if$ 235 | } 236 | 237 | FUNCTION {not} 238 | { { #0 } 239 | { #1 } 240 | if$ 241 | } 242 | 243 | FUNCTION {and} 244 | { 'skip$ 245 | { pop$ #0 } 246 | if$ 247 | } 248 | 249 | FUNCTION {or} 250 | { { pop$ #1 } 251 | 'skip$ 252 | if$ 253 | } 254 | 255 | STRINGS { x y } 256 | 257 | FUNCTION {contains} 258 | { 'y := 259 | 'x := 260 | y text.length$ 'len := 261 | x text.length$ len - #1 + 'charptr := 262 | { charptr #0 > 263 | x charptr len substring$ y = not 264 | and 265 | } 266 | { charptr #1 - 'charptr := } 267 | while$ 268 | charptr #0 > 269 | } 270 | 271 | STRINGS { s t } 272 | 273 | FUNCTION {output.nonnull} 274 | { 's := 275 | output.state mid.sentence = 276 | { ", " * write$ } 277 | { output.state after.block = 278 | { add.period$ write$ 279 | newline$ 280 | "\newblock " write$ 281 | } 282 | { output.state before.all = 283 | 'write$ 284 | { output.state after.slash = 285 | { bbl.slash * write$ 286 | newline$ 287 | } 288 | { add.period$ " " * write$ } 289 | if$ 290 | } 291 | if$ 292 | } 293 | if$ 294 | mid.sentence 'output.state := 295 | } 296 | if$ 297 | s 298 | } 299 | 300 | FUNCTION {output} 301 | { duplicate$ empty$ 302 | 'pop$ 303 | 'output.nonnull 304 | if$ 305 | } 306 | 307 | FUNCTION {output.after} 308 | { 't := 309 | duplicate$ empty$ 310 | 'pop$ 311 | { 's := 312 | output.state mid.sentence = 313 | { t * write$ } 314 | { output.state after.block = 315 | { add.period$ write$ 316 | newline$ 317 | "\newblock " write$ 318 | } 319 | { output.state before.all = 320 | 'write$ 321 | { output.state after.slash = 322 | { bbl.slash * write$ } 323 | { add.period$ " " * write$ } 324 | if$ 325 | } 326 | if$ 327 | } 328 | if$ 329 | mid.sentence 'output.state := 330 | } 331 | if$ 332 | s 333 | } 334 | if$ 335 | } 336 | 337 | FUNCTION {output.check} 338 | { 't := 339 | duplicate$ empty$ 340 | { pop$ "empty " t * " in " * cite$ * warning$ } 341 | 'output.nonnull 342 | if$ 343 | } 344 | 345 | FUNCTION {fin.entry} 346 | { end.with.period 347 | 'add.period$ 348 | 'skip$ 349 | if$ 350 | write$ 351 | show.english.translation entry.lang lang.zh = and 352 | { ")" 353 | write$ 354 | } 355 | 'skip$ 356 | if$ 357 | newline$ 358 | } 359 | 360 | FUNCTION {new.block} 361 | { output.state before.all = 362 | 'skip$ 363 | { output.state after.slash = 364 | 'skip$ 365 | { after.block 'output.state := } 366 | if$ 367 | } 368 | if$ 369 | } 370 | 371 | FUNCTION {new.sentence} 372 | { output.state after.block = 373 | 'skip$ 374 | { output.state before.all = 375 | 'skip$ 376 | { output.state after.slash = 377 | 'skip$ 378 | { after.sentence 'output.state := } 379 | if$ 380 | } 381 | if$ 382 | } 383 | if$ 384 | } 385 | 386 | FUNCTION {new.slash} 387 | { output.state before.all = 388 | 'skip$ 389 | { component.part.label "slash" = 390 | { after.slash 'output.state := } 391 | { new.block 392 | component.part.label "in" = 393 | { entry.lang lang.en = 394 | { "In: " output 395 | write$ 396 | "" 397 | before.all 'output.state := 398 | } 399 | 'skip$ 400 | if$ 401 | } 402 | 'skip$ 403 | if$ 404 | } 405 | if$ 406 | } 407 | if$ 408 | } 409 | 410 | FUNCTION {new.block.checka} 411 | { empty$ 412 | 'skip$ 413 | 'new.block 414 | if$ 415 | } 416 | 417 | FUNCTION {new.block.checkb} 418 | { empty$ 419 | swap$ empty$ 420 | and 421 | 'skip$ 422 | 'new.block 423 | if$ 424 | } 425 | 426 | FUNCTION {new.sentence.checka} 427 | { empty$ 428 | 'skip$ 429 | 'new.sentence 430 | if$ 431 | } 432 | 433 | FUNCTION {new.sentence.checkb} 434 | { empty$ 435 | swap$ empty$ 436 | and 437 | 'skip$ 438 | 'new.sentence 439 | if$ 440 | } 441 | 442 | FUNCTION {field.or.null} 443 | { duplicate$ empty$ 444 | { pop$ "" } 445 | 'skip$ 446 | if$ 447 | } 448 | 449 | FUNCTION {emphasize} 450 | { duplicate$ empty$ 451 | { pop$ "" } 452 | { "\emph{" swap$ * "}" * } 453 | if$ 454 | } 455 | 456 | FUNCTION {format.btitle} 457 | { italic.book.title 458 | entry.lang lang.en = and 459 | 'emphasize 460 | 'skip$ 461 | if$ 462 | } 463 | 464 | INTEGERS { byte second.byte } 465 | 466 | INTEGERS { char.lang tmp.lang } 467 | 468 | STRINGS { tmp.str } 469 | 470 | FUNCTION {get.str.lang} 471 | { 'tmp.str := 472 | lang.other 'tmp.lang := 473 | #1 'charptr := 474 | tmp.str text.length$ #1 + 'len := 475 | { charptr len < } 476 | { tmp.str charptr #1 substring$ chr.to.int$ 'byte := 477 | byte #128 < 478 | { charptr #1 + 'charptr := 479 | byte #64 > byte #91 < and byte #96 > byte #123 < and or 480 | { lang.en 'char.lang := } 481 | { lang.other 'char.lang := } 482 | if$ 483 | } 484 | { tmp.str charptr #1 + #1 substring$ chr.to.int$ 'second.byte := 485 | byte #224 < 486 | { charptr #2 + 'charptr := 487 | byte #207 > byte #212 < and 488 | byte #212 = second.byte #176 < and or 489 | { lang.ru 'char.lang := } 490 | { lang.other 'char.lang := } 491 | if$ 492 | } 493 | { byte #240 < 494 | { charptr #3 + 'charptr := 495 | byte #227 > byte #234 < and 496 | { lang.zh 'char.lang := } 497 | { byte #227 = 498 | { second.byte #143 > 499 | { lang.zh 'char.lang := } 500 | { second.byte #128 > second.byte #132 < and 501 | { lang.ja 'char.lang := } 502 | { lang.other 'char.lang := } 503 | if$ 504 | } 505 | if$ 506 | } 507 | { byte #239 = 508 | second.byte #163 > second.byte #172 < and and 509 | { lang.zh 'char.lang := } 510 | { lang.other 'char.lang := } 511 | if$ 512 | } 513 | if$ 514 | } 515 | if$ 516 | } 517 | { charptr #4 + 'charptr := 518 | byte #240 = second.byte #159 > and 519 | { lang.zh 'char.lang := } 520 | { lang.other 'char.lang := } 521 | if$ 522 | } 523 | if$ 524 | } 525 | if$ 526 | } 527 | if$ 528 | char.lang tmp.lang > 529 | { char.lang 'tmp.lang := } 530 | 'skip$ 531 | if$ 532 | } 533 | while$ 534 | tmp.lang 535 | } 536 | 537 | FUNCTION {check.entry.lang} 538 | { author field.or.null 539 | title field.or.null * 540 | get.str.lang 541 | } 542 | 543 | STRINGS { entry.langid } 544 | 545 | FUNCTION {set.entry.lang} 546 | { "" 'entry.langid := 547 | language empty$ not 548 | { language 'entry.langid := } 549 | 'skip$ 550 | if$ 551 | langid empty$ not 552 | { langid 'entry.langid := } 553 | 'skip$ 554 | if$ 555 | entry.langid empty$ 556 | { check.entry.lang } 557 | { entry.langid "english" = entry.langid "american" = or entry.langid "british" = or 558 | { lang.en } 559 | { entry.langid "chinese" = 560 | { lang.zh } 561 | { entry.langid "japanese" = 562 | { lang.ja } 563 | { entry.langid "russian" = 564 | { lang.ru } 565 | { check.entry.lang } 566 | if$ 567 | } 568 | if$ 569 | } 570 | if$ 571 | } 572 | if$ 573 | } 574 | if$ 575 | 'entry.lang := 576 | } 577 | 578 | FUNCTION {set.entry.numbered} 579 | { type$ "patent" = 580 | type$ "standard" = or 581 | type$ "techreport" = or 582 | { #1 'entry.numbered := } 583 | { #0 'entry.numbered := } 584 | if$ 585 | } 586 | 587 | INTEGERS { nameptr namesleft numnames name.lang } 588 | 589 | FUNCTION {format.name} 590 | { "{vv~}{ll}{, jj}{, ff}" format.name$ 't := 591 | t "others" = 592 | { bbl.et.al } 593 | { t get.str.lang 'name.lang := 594 | name.lang lang.en = 595 | { t #1 "{vv~}{ll}{ f{~}}" format.name$ 596 | uppercase.name 597 | { "u" change.case$ } 598 | 'skip$ 599 | if$ 600 | t #1 "{, jj}" format.name$ * 601 | } 602 | { t #1 "{ll}{ff}" format.name$ } 603 | if$ 604 | } 605 | if$ 606 | } 607 | 608 | FUNCTION {format.names} 609 | { 's := 610 | #1 'nameptr := 611 | s num.names$ 'numnames := 612 | "" 613 | numnames 'namesleft := 614 | { namesleft #0 > } 615 | { s nameptr format.name bbl.et.al = 616 | numnames bibliography.et.al.min #1 - > nameptr bibliography.et.al.use.first > and or 617 | { ", " * 618 | bbl.et.al * 619 | #1 'namesleft := 620 | } 621 | { nameptr #1 > 622 | { namesleft #1 = bbl.and "" = not and 623 | { bbl.and * } 624 | { ", " * } 625 | if$ 626 | } 627 | 'skip$ 628 | if$ 629 | s nameptr format.name * 630 | } 631 | if$ 632 | nameptr #1 + 'nameptr := 633 | namesleft #1 - 'namesleft := 634 | } 635 | while$ 636 | } 637 | 638 | FUNCTION {format.key} 639 | { empty$ 640 | { key field.or.null } 641 | { "" } 642 | if$ 643 | } 644 | 645 | FUNCTION {format.authors} 646 | { author empty$ not 647 | { author format.names } 648 | { "empty author in " cite$ * warning$ 649 | "" 650 | } 651 | if$ 652 | } 653 | 654 | FUNCTION {format.editors} 655 | { editor empty$ 656 | { "" } 657 | { editor format.names } 658 | if$ 659 | } 660 | 661 | FUNCTION {format.translators} 662 | { translator empty$ 663 | { "" } 664 | { translator format.names 665 | entry.lang lang.zh = 666 | { translator num.names$ #3 > 667 | { "译" * } 668 | { ", 译" * } 669 | if$ 670 | } 671 | 'skip$ 672 | if$ 673 | } 674 | if$ 675 | } 676 | 677 | FUNCTION {format.full.names} 678 | {'s := 679 | #1 'nameptr := 680 | s num.names$ 'numnames := 681 | numnames 'namesleft := 682 | { namesleft #0 > } 683 | { s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't := 684 | t get.str.lang 'name.lang := 685 | name.lang lang.en = 686 | { t #1 "{vv~}{ll}" format.name$ 't := } 687 | { t #1 "{ll}{ff}" format.name$ 't := } 688 | if$ 689 | nameptr #1 > 690 | { 691 | namesleft #1 > 692 | { ", " * t * } 693 | { 694 | numnames #2 > 695 | { "," * } 696 | 'skip$ 697 | if$ 698 | t "others" = 699 | { " et~al." * } 700 | { " and " * t * } 701 | if$ 702 | } 703 | if$ 704 | } 705 | 't 706 | if$ 707 | nameptr #1 + 'nameptr := 708 | namesleft #1 - 'namesleft := 709 | } 710 | while$ 711 | } 712 | 713 | FUNCTION {author.editor.full} 714 | { author empty$ 715 | { editor empty$ 716 | { "" } 717 | { editor format.full.names } 718 | if$ 719 | } 720 | { author format.full.names } 721 | if$ 722 | } 723 | 724 | FUNCTION {author.full} 725 | { author empty$ 726 | { "" } 727 | { author format.full.names } 728 | if$ 729 | } 730 | 731 | FUNCTION {editor.full} 732 | { editor empty$ 733 | { "" } 734 | { editor format.full.names } 735 | if$ 736 | } 737 | 738 | FUNCTION {make.full.names} 739 | { type$ "book" = 740 | type$ "inbook" = 741 | or 742 | 'author.editor.full 743 | { type$ "collection" = 744 | type$ "proceedings" = 745 | or 746 | 'editor.full 747 | 'author.full 748 | if$ 749 | } 750 | if$ 751 | } 752 | 753 | FUNCTION {output.bibitem} 754 | { newline$ 755 | "\bibitem[" write$ 756 | label ")" * 757 | make.full.names duplicate$ short.list = 758 | { pop$ } 759 | { duplicate$ "]" contains 760 | { "{" swap$ * "}" * } 761 | 'skip$ 762 | if$ 763 | * 764 | } 765 | if$ 766 | "]{" * write$ 767 | cite$ write$ 768 | "}" write$ 769 | newline$ 770 | "" 771 | before.all 'output.state := 772 | } 773 | 774 | FUNCTION {change.sentence.case} 775 | { entry.lang lang.en = 776 | { "t" change.case$ } 777 | 'skip$ 778 | if$ 779 | } 780 | 781 | FUNCTION {add.link} 782 | { url empty$ not 783 | { "\href{" url * "}{" * swap$ * "}" * } 784 | { doi empty$ not 785 | { "\href{https://doi.org/" doi * "}{" * swap$ * "}" * } 786 | 'skip$ 787 | if$ 788 | } 789 | if$ 790 | } 791 | 792 | FUNCTION {format.title} 793 | { title empty$ 794 | { "" } 795 | { title 796 | sentence.case.title 797 | 'change.sentence.case 798 | 'skip$ 799 | if$ 800 | entry.numbered number empty$ not and 801 | { bbl.colon * 802 | type$ "patent" = show.patent.country and 803 | { address empty$ not 804 | { address * ", " * } 805 | { location empty$ not 806 | { location * ", " * } 807 | { entry.lang lang.zh = 808 | { "中国" * ", " * } 809 | 'skip$ 810 | if$ 811 | } 812 | if$ 813 | } 814 | if$ 815 | } 816 | 'skip$ 817 | if$ 818 | number * 819 | } 820 | 'skip$ 821 | if$ 822 | link.title 823 | 'add.link 824 | 'skip$ 825 | if$ 826 | } 827 | if$ 828 | } 829 | 830 | FUNCTION {tie.or.space.connect} 831 | { duplicate$ text.length$ #3 < 832 | { "~" } 833 | { " " } 834 | if$ 835 | swap$ * * 836 | } 837 | 838 | FUNCTION {either.or.check} 839 | { empty$ 840 | 'pop$ 841 | { "can't use both " swap$ * " fields in " * cite$ * warning$ } 842 | if$ 843 | } 844 | 845 | FUNCTION {is.digit} 846 | { duplicate$ empty$ 847 | { pop$ #0 } 848 | { chr.to.int$ 849 | duplicate$ "0" chr.to.int$ < 850 | { pop$ #0 } 851 | { "9" chr.to.int$ > 852 | { #0 } 853 | { #1 } 854 | if$ 855 | } 856 | if$ 857 | } 858 | if$ 859 | } 860 | 861 | FUNCTION {is.number} 862 | { 's := 863 | s empty$ 864 | { #0 } 865 | { s text.length$ 'charptr := 866 | { charptr #0 > 867 | s charptr #1 substring$ is.digit 868 | and 869 | } 870 | { charptr #1 - 'charptr := } 871 | while$ 872 | charptr not 873 | } 874 | if$ 875 | } 876 | 877 | FUNCTION {format.volume} 878 | { volume empty$ not 879 | { volume is.number 880 | { entry.lang lang.zh = 881 | { "第 " volume * " 卷" * } 882 | { "Vol." volume tie.or.space.connect } 883 | if$ 884 | } 885 | { volume } 886 | if$ 887 | } 888 | { "" } 889 | if$ 890 | } 891 | 892 | FUNCTION {format.number} 893 | { number empty$ not 894 | { number is.number 895 | { entry.lang lang.zh = 896 | { "第 " number * " 册" * } 897 | { "No." number tie.or.space.connect } 898 | if$ 899 | } 900 | { number } 901 | if$ 902 | } 903 | { "" } 904 | if$ 905 | } 906 | 907 | FUNCTION {format.volume.number} 908 | { volume empty$ not 909 | { format.volume } 910 | { format.number } 911 | if$ 912 | } 913 | 914 | FUNCTION {format.title.vol.num} 915 | { title 916 | sentence.case.title 917 | 'change.sentence.case 918 | 'skip$ 919 | if$ 920 | entry.numbered 921 | { number empty$ not 922 | { bbl.colon * number * } 923 | 'skip$ 924 | if$ 925 | } 926 | { format.volume.number 's := 927 | s empty$ not 928 | { bbl.colon * s * } 929 | 'skip$ 930 | if$ 931 | } 932 | if$ 933 | } 934 | 935 | FUNCTION {format.series.vol.num.title} 936 | { format.volume.number 's := 937 | series empty$ not 938 | { series 939 | sentence.case.title 940 | 'change.sentence.case 941 | 'skip$ 942 | if$ 943 | entry.numbered 944 | { bbl.wide.space * } 945 | { bbl.colon * 946 | s empty$ not 947 | { s * bbl.wide.space * } 948 | 'skip$ 949 | if$ 950 | } 951 | if$ 952 | title * 953 | sentence.case.title 954 | 'change.sentence.case 955 | 'skip$ 956 | if$ 957 | entry.numbered number empty$ not and 958 | { bbl.colon * number * } 959 | 'skip$ 960 | if$ 961 | } 962 | { format.title.vol.num } 963 | if$ 964 | format.btitle 965 | link.title 966 | 'add.link 967 | 'skip$ 968 | if$ 969 | } 970 | 971 | FUNCTION {format.booktitle.vol.num} 972 | { booktitle 973 | entry.numbered 974 | 'skip$ 975 | { format.volume.number 's := 976 | s empty$ not 977 | { bbl.colon * s * } 978 | 'skip$ 979 | if$ 980 | } 981 | if$ 982 | } 983 | 984 | FUNCTION {format.series.vol.num.booktitle} 985 | { format.volume.number 's := 986 | series empty$ not 987 | { series bbl.colon * 988 | entry.numbered not s empty$ not and 989 | { s * bbl.wide.space * } 990 | 'skip$ 991 | if$ 992 | booktitle * 993 | } 994 | { format.booktitle.vol.num } 995 | if$ 996 | format.btitle 997 | } 998 | 999 | FUNCTION {remove.period} 1000 | { 't := 1001 | "" 's := 1002 | { t empty$ not } 1003 | { t #1 #1 substring$ 'tmp.str := 1004 | tmp.str "." = not 1005 | { s tmp.str * 's := } 1006 | 'skip$ 1007 | if$ 1008 | t #2 global.max$ substring$ 't := 1009 | } 1010 | while$ 1011 | s 1012 | } 1013 | 1014 | FUNCTION {abbreviate} 1015 | { remove.period 1016 | 't := 1017 | t "l" change.case$ 's := 1018 | "" 1019 | s "physical review letters" = 1020 | { "Phys Rev Lett" } 1021 | 'skip$ 1022 | if$ 1023 | 's := 1024 | s empty$ 1025 | { t } 1026 | { pop$ s } 1027 | if$ 1028 | } 1029 | 1030 | FUNCTION {get.journal.title} 1031 | { short.journal 1032 | { shortjournal empty$ not 1033 | { shortjournal } 1034 | { journal empty$ not 1035 | { journal abbreviate } 1036 | { journaltitle empty$ not 1037 | { journaltitle abbreviate } 1038 | { "" } 1039 | if$ 1040 | } 1041 | if$ 1042 | } 1043 | if$ 1044 | } 1045 | { journal empty$ not 1046 | { journal } 1047 | { journaltitle empty$ not 1048 | { journaltitle } 1049 | { shortjournal empty$ not 1050 | { shortjournal } 1051 | { "" } 1052 | if$ 1053 | } 1054 | if$ 1055 | } 1056 | if$ 1057 | } 1058 | if$ 1059 | } 1060 | 1061 | FUNCTION {check.arxiv.preprint} 1062 | { #1 #5 substring$ purify$ "l" change.case$ "arxiv" = 1063 | { #1 } 1064 | { #0 } 1065 | if$ 1066 | } 1067 | 1068 | FUNCTION {format.journal} 1069 | { get.journal.title 1070 | duplicate$ empty$ not 1071 | { italic.journal entry.lang lang.en = and 1072 | 'emphasize 1073 | 'skip$ 1074 | if$ 1075 | link.journal 1076 | 'add.link 1077 | 'skip$ 1078 | if$ 1079 | } 1080 | 'skip$ 1081 | if$ 1082 | } 1083 | 1084 | FUNCTION {set.entry.mark} 1085 | { entry.mark empty$ not 1086 | 'pop$ 1087 | { mark empty$ not 1088 | { pop$ mark 'entry.mark := } 1089 | { 'entry.mark := } 1090 | if$ 1091 | } 1092 | if$ 1093 | } 1094 | 1095 | FUNCTION {format.mark} 1096 | { show.mark 1097 | { entry.mark 1098 | show.medium.type 1099 | { medium empty$ not 1100 | { "/" * medium * } 1101 | { entry.is.electronic 1102 | { "/OL" * } 1103 | 'skip$ 1104 | if$ 1105 | } 1106 | if$ 1107 | } 1108 | 'skip$ 1109 | if$ 1110 | 'entry.mark := 1111 | space.before.mark 1112 | { " " } 1113 | { "\allowbreak" } 1114 | if$ 1115 | "[" * entry.mark * "]" * 1116 | } 1117 | { "" } 1118 | if$ 1119 | } 1120 | 1121 | FUNCTION {num.to.ordinal} 1122 | { duplicate$ text.length$ 'charptr := 1123 | duplicate$ charptr #1 substring$ 's := 1124 | s "1" = 1125 | { "st" * } 1126 | { s "2" = 1127 | { "nd" * } 1128 | { s "3" = 1129 | { "rd" * } 1130 | { "th" * } 1131 | if$ 1132 | } 1133 | if$ 1134 | } 1135 | if$ 1136 | } 1137 | 1138 | FUNCTION {format.edition} 1139 | { edition empty$ 1140 | { "" } 1141 | { edition is.number 1142 | { edition "1" = not 1143 | { entry.lang lang.zh = 1144 | { edition " 版" * } 1145 | { edition num.to.ordinal " ed." * } 1146 | if$ 1147 | } 1148 | 'skip$ 1149 | if$ 1150 | } 1151 | { entry.lang lang.en = 1152 | { edition change.sentence.case 's := 1153 | s "Revised" = s "Revised edition" = or 1154 | { "Rev. ed." } 1155 | { s " ed." * } 1156 | if$ 1157 | } 1158 | { edition } 1159 | if$ 1160 | } 1161 | if$ 1162 | } 1163 | if$ 1164 | } 1165 | 1166 | FUNCTION {format.publisher} 1167 | { publisher empty$ not 1168 | { publisher } 1169 | { school empty$ not 1170 | { school } 1171 | { organization empty$ not 1172 | { organization } 1173 | { institution empty$ not 1174 | { institution } 1175 | { "" } 1176 | if$ 1177 | } 1178 | if$ 1179 | } 1180 | if$ 1181 | } 1182 | if$ 1183 | } 1184 | 1185 | FUNCTION {format.address.publisher} 1186 | { address empty$ not 1187 | { address } 1188 | { location empty$ not 1189 | { location } 1190 | { "" } 1191 | if$ 1192 | } 1193 | if$ 1194 | duplicate$ empty$ not 1195 | { format.publisher empty$ not 1196 | { bbl.colon * format.publisher * } 1197 | { entry.is.electronic not show.missing.address.publisher and 1198 | { bbl.colon * bbl.sine.nomine * } 1199 | 'skip$ 1200 | if$ 1201 | } 1202 | if$ 1203 | } 1204 | { pop$ 1205 | entry.is.electronic not show.missing.address.publisher and 1206 | { format.publisher empty$ not 1207 | { bbl.sine.loco bbl.colon * format.publisher * } 1208 | { bbl.sine.loco.sine.nomine } 1209 | if$ 1210 | } 1211 | { format.publisher empty$ not 1212 | { format.publisher } 1213 | { "" } 1214 | if$ 1215 | } 1216 | if$ 1217 | } 1218 | if$ 1219 | } 1220 | 1221 | FUNCTION {extract.before.dash} 1222 | { duplicate$ empty$ 1223 | { pop$ "" } 1224 | { 's := 1225 | #1 'charptr := 1226 | s text.length$ #1 + 'len := 1227 | { charptr len < 1228 | s charptr #1 substring$ "-" = not 1229 | and 1230 | } 1231 | { charptr #1 + 'charptr := } 1232 | while$ 1233 | s #1 charptr #1 - substring$ 1234 | } 1235 | if$ 1236 | } 1237 | 1238 | FUNCTION {extract.after.dash} 1239 | { duplicate$ empty$ 1240 | { pop$ "" } 1241 | { 's := 1242 | #1 'charptr := 1243 | s text.length$ #1 + 'len := 1244 | { charptr len < 1245 | s charptr #1 substring$ "-" = not 1246 | and 1247 | } 1248 | { charptr #1 + 'charptr := } 1249 | while$ 1250 | { charptr len < 1251 | s charptr #1 substring$ "-" = 1252 | and 1253 | } 1254 | { charptr #1 + 'charptr := } 1255 | while$ 1256 | s charptr global.max$ substring$ 1257 | } 1258 | if$ 1259 | } 1260 | 1261 | FUNCTION {extract.before.slash} 1262 | { duplicate$ empty$ 1263 | { pop$ "" } 1264 | { 's := 1265 | #1 'charptr := 1266 | s text.length$ #1 + 'len := 1267 | { charptr len < 1268 | s charptr #1 substring$ "/" = not 1269 | and 1270 | } 1271 | { charptr #1 + 'charptr := } 1272 | while$ 1273 | s #1 charptr #1 - substring$ 1274 | } 1275 | if$ 1276 | } 1277 | 1278 | FUNCTION {extract.after.slash} 1279 | { duplicate$ empty$ 1280 | { pop$ "" } 1281 | { 's := 1282 | #1 'charptr := 1283 | s text.length$ #1 + 'len := 1284 | { charptr len < 1285 | s charptr #1 substring$ "-" = not 1286 | and 1287 | s charptr #1 substring$ "/" = not 1288 | and 1289 | } 1290 | { charptr #1 + 'charptr := } 1291 | while$ 1292 | { charptr len < 1293 | s charptr #1 substring$ "-" = 1294 | s charptr #1 substring$ "/" = 1295 | or 1296 | and 1297 | } 1298 | { charptr #1 + 'charptr := } 1299 | while$ 1300 | s charptr global.max$ substring$ 1301 | } 1302 | if$ 1303 | } 1304 | 1305 | FUNCTION {format.year} 1306 | { year empty$ not 1307 | { year extract.before.slash extra.label * } 1308 | { date empty$ not 1309 | { date extract.before.dash extra.label * } 1310 | { entry.is.electronic not 1311 | { "empty year in " cite$ * warning$ } 1312 | 'skip$ 1313 | if$ 1314 | urldate empty$ not 1315 | { "[" urldate extract.before.dash * extra.label * "]" * } 1316 | { "" } 1317 | if$ 1318 | } 1319 | if$ 1320 | } 1321 | if$ 1322 | } 1323 | 1324 | FUNCTION {format.periodical.year} 1325 | { year empty$ not 1326 | { year extract.before.slash 1327 | "--" * 1328 | year extract.after.slash 1329 | duplicate$ empty$ 1330 | 'pop$ 1331 | { * } 1332 | if$ 1333 | } 1334 | { date empty$ not 1335 | { date extract.before.dash } 1336 | { "empty year in " cite$ * warning$ 1337 | urldate empty$ not 1338 | { "[" urldate extract.before.dash * "]" * } 1339 | { "" } 1340 | if$ 1341 | } 1342 | if$ 1343 | } 1344 | if$ 1345 | } 1346 | 1347 | FUNCTION {format.date} 1348 | { date empty$ not 1349 | { type$ "patent" = type$ "newspaper" = or 1350 | { date } 1351 | { entrysubtype empty$ not 1352 | { type$ "article" = entrysubtype "newspaper" = and 1353 | { date } 1354 | { format.year } 1355 | if$ 1356 | } 1357 | { format.year } 1358 | if$ 1359 | } 1360 | if$ 1361 | } 1362 | { year empty$ not 1363 | { format.year } 1364 | { "" } 1365 | if$ 1366 | } 1367 | if$ 1368 | } 1369 | 1370 | FUNCTION {format.editdate} 1371 | { date empty$ not 1372 | { "\allowbreak(" date * ")" * } 1373 | { "" } 1374 | if$ 1375 | } 1376 | 1377 | FUNCTION {format.urldate} 1378 | { show.urldate show.url and entry.url empty$ not and 1379 | is.pure.electronic or 1380 | urldate empty$ not and 1381 | { "\allowbreak[" urldate * "]" * } 1382 | { "" } 1383 | if$ 1384 | } 1385 | 1386 | FUNCTION {hyphenate} 1387 | { 't := 1388 | "" 1389 | { t empty$ not } 1390 | { t #1 #1 substring$ "-" = 1391 | { wave.dash.in.pages 1392 | { "~" * } 1393 | { "-" * } 1394 | if$ 1395 | { t #1 #1 substring$ "-" = } 1396 | { t #2 global.max$ substring$ 't := } 1397 | while$ 1398 | } 1399 | { t #1 #1 substring$ * 1400 | t #2 global.max$ substring$ 't := 1401 | } 1402 | if$ 1403 | } 1404 | while$ 1405 | } 1406 | 1407 | FUNCTION {format.pages} 1408 | { pages empty$ 1409 | { "" } 1410 | { pages hyphenate } 1411 | if$ 1412 | } 1413 | 1414 | FUNCTION {format.extracted.pages} 1415 | { pages empty$ 1416 | { "" } 1417 | { pages 1418 | only.start.page 1419 | 'extract.before.dash 1420 | 'hyphenate 1421 | if$ 1422 | } 1423 | if$ 1424 | } 1425 | 1426 | FUNCTION {format.journal.volume} 1427 | { volume empty$ not 1428 | { bold.journal.volume 1429 | { "\textbf{" volume * "}" * } 1430 | { volume } 1431 | if$ 1432 | } 1433 | { "" } 1434 | if$ 1435 | } 1436 | 1437 | FUNCTION {format.journal.number} 1438 | { number empty$ not 1439 | { "\allowbreak (" number * ")" * } 1440 | { "" } 1441 | if$ 1442 | } 1443 | 1444 | FUNCTION {format.journal.pages} 1445 | { pages empty$ 1446 | { "" } 1447 | { format.extracted.pages } 1448 | if$ 1449 | } 1450 | 1451 | FUNCTION {format.periodical.year.volume.number} 1452 | { year empty$ not 1453 | { year extract.before.slash } 1454 | { "empty year in periodical " cite$ * warning$ } 1455 | if$ 1456 | volume empty$ not 1457 | { ", " * volume extract.before.dash * } 1458 | 'skip$ 1459 | if$ 1460 | number empty$ not 1461 | { "\allowbreak (" * number extract.before.dash * ")" * } 1462 | 'skip$ 1463 | if$ 1464 | "--" * 1465 | year extract.after.slash empty$ 1466 | volume extract.after.dash empty$ and 1467 | number extract.after.dash empty$ and not 1468 | { year extract.after.slash empty$ not 1469 | { year extract.after.slash * } 1470 | { year extract.before.slash * } 1471 | if$ 1472 | volume empty$ not 1473 | { ", " * volume extract.after.dash * } 1474 | 'skip$ 1475 | if$ 1476 | number empty$ not 1477 | { "\allowbreak (" * number extract.after.dash * ")" * } 1478 | 'skip$ 1479 | if$ 1480 | } 1481 | 'skip$ 1482 | if$ 1483 | } 1484 | 1485 | FUNCTION {check.url} 1486 | { url empty$ not 1487 | { "\url{" url * "}" * 'entry.url := 1488 | #1 'entry.is.electronic := 1489 | } 1490 | { howpublished empty$ not 1491 | { howpublished #1 #5 substring$ "\url{" = 1492 | { howpublished 'entry.url := 1493 | #1 'entry.is.electronic := 1494 | } 1495 | 'skip$ 1496 | if$ 1497 | } 1498 | { note empty$ not 1499 | { note #1 #5 substring$ "\url{" = 1500 | { note 'entry.url := 1501 | #1 'entry.is.electronic := 1502 | } 1503 | 'skip$ 1504 | if$ 1505 | } 1506 | 'skip$ 1507 | if$ 1508 | } 1509 | if$ 1510 | } 1511 | if$ 1512 | } 1513 | 1514 | FUNCTION {output.url} 1515 | { show.url is.pure.electronic or 1516 | entry.url empty$ not and 1517 | { new.block 1518 | entry.url output 1519 | } 1520 | 'skip$ 1521 | if$ 1522 | } 1523 | 1524 | FUNCTION {check.doi} 1525 | { doi empty$ not 1526 | { #1 'entry.is.electronic := } 1527 | 'skip$ 1528 | if$ 1529 | } 1530 | 1531 | FUNCTION {is.in.url} 1532 | { 's := 1533 | s empty$ 1534 | { #1 } 1535 | { entry.url empty$ 1536 | { #0 } 1537 | { s text.length$ 'len := 1538 | entry.url text.length$ 'charptr := 1539 | { entry.url charptr len substring$ s = not 1540 | charptr #0 > 1541 | and 1542 | } 1543 | { charptr #1 - 'charptr := } 1544 | while$ 1545 | charptr 1546 | } 1547 | if$ 1548 | } 1549 | if$ 1550 | } 1551 | 1552 | FUNCTION {format.doi} 1553 | { "" 1554 | doi empty$ not 1555 | { "" 's := 1556 | doi 't := 1557 | #0 'numnames := 1558 | { t empty$ not} 1559 | { t #1 #1 substring$ 'tmp.str := 1560 | tmp.str "," = tmp.str " " = or t #2 #1 substring$ empty$ or 1561 | { t #2 #1 substring$ empty$ 1562 | { s tmp.str * 's := } 1563 | 'skip$ 1564 | if$ 1565 | s empty$ s is.in.url or 1566 | 'skip$ 1567 | { numnames #1 + 'numnames := 1568 | numnames #1 > 1569 | { ", " * } 1570 | { "DOI: " * } 1571 | if$ 1572 | "\doi{" s * "}" * * 1573 | } 1574 | if$ 1575 | "" 's := 1576 | } 1577 | { s tmp.str * 's := } 1578 | if$ 1579 | t #2 global.max$ substring$ 't := 1580 | } 1581 | while$ 1582 | } 1583 | 'skip$ 1584 | if$ 1585 | } 1586 | 1587 | FUNCTION {output.doi} 1588 | { doi empty$ not show.doi and 1589 | show.english.translation entry.lang lang.zh = and not and 1590 | { new.block 1591 | format.doi output 1592 | } 1593 | 'skip$ 1594 | if$ 1595 | } 1596 | 1597 | FUNCTION {check.electronic} 1598 | { "" 'entry.url := 1599 | #0 'entry.is.electronic := 1600 | 'check.doi 1601 | 'skip$ 1602 | if$ 1603 | 'check.url 1604 | 'skip$ 1605 | if$ 1606 | medium empty$ not 1607 | { medium "MT" = medium "DK" = or medium "CD" = or medium "OL" = or 1608 | { #1 'entry.is.electronic := } 1609 | 'skip$ 1610 | if$ 1611 | } 1612 | 'skip$ 1613 | if$ 1614 | } 1615 | 1616 | FUNCTION {format.eprint} 1617 | { archivePrefix empty$ not 1618 | { archivePrefix } 1619 | { eprinttype empty$ not 1620 | { archivePrefix } 1621 | { "" } 1622 | if$ 1623 | } 1624 | if$ 1625 | 's := 1626 | s empty$ not 1627 | { s ": \eprint{" * 1628 | url empty$ not 1629 | { url } 1630 | { "https://" s "l" change.case$ * ".org/abs/" * eprint * } 1631 | if$ 1632 | * "}{" * 1633 | eprint * "}" * 1634 | } 1635 | { eprint } 1636 | if$ 1637 | } 1638 | 1639 | FUNCTION {output.eprint} 1640 | { show.preprint eprint empty$ not and 1641 | { new.block 1642 | format.eprint output 1643 | } 1644 | 'skip$ 1645 | if$ 1646 | } 1647 | 1648 | FUNCTION {format.note} 1649 | { note empty$ not show.note and 1650 | { note } 1651 | { "" } 1652 | if$ 1653 | } 1654 | 1655 | FUNCTION {output.translation} 1656 | { show.english.translation entry.lang lang.zh = and 1657 | { translation empty$ not 1658 | { translation } 1659 | { "[English translation missing!]" } 1660 | if$ 1661 | " (in Chinese)" * output 1662 | write$ 1663 | format.doi duplicate$ empty$ not 1664 | { newline$ 1665 | write$ 1666 | } 1667 | 'pop$ 1668 | if$ 1669 | " \\" write$ 1670 | newline$ 1671 | "(" write$ 1672 | "" 1673 | before.all 'output.state := 1674 | } 1675 | 'skip$ 1676 | if$ 1677 | } 1678 | 1679 | FUNCTION {empty.misc.check} 1680 | { author empty$ title empty$ 1681 | year empty$ 1682 | and and 1683 | key empty$ not and 1684 | { "all relevant fields are empty in " cite$ * warning$ } 1685 | 'skip$ 1686 | if$ 1687 | } 1688 | 1689 | FUNCTION {monograph} 1690 | { output.bibitem 1691 | output.translation 1692 | author empty$ not 1693 | { format.authors } 1694 | { editor empty$ not 1695 | { format.editors } 1696 | { "empty author and editor in " cite$ * warning$ 1697 | "" 1698 | } 1699 | if$ 1700 | } 1701 | if$ 1702 | output 1703 | year.after.author 1704 | { period.after.author 1705 | 'new.sentence 1706 | 'skip$ 1707 | if$ 1708 | format.year "year" output.check 1709 | } 1710 | 'skip$ 1711 | if$ 1712 | new.block 1713 | format.series.vol.num.title "title" output.check 1714 | "M" set.entry.mark 1715 | format.mark "" output.after 1716 | new.block 1717 | format.translators output 1718 | new.sentence 1719 | format.edition output 1720 | new.block 1721 | format.address.publisher output 1722 | year.after.author not 1723 | { format.year "year" output.check } 1724 | 'skip$ 1725 | if$ 1726 | format.pages bbl.pages.colon output.after 1727 | format.urldate "" output.after 1728 | output.url 1729 | output.doi 1730 | new.block 1731 | format.note output 1732 | fin.entry 1733 | } 1734 | 1735 | FUNCTION {incollection} 1736 | { output.bibitem 1737 | output.translation 1738 | format.authors output 1739 | author format.key output 1740 | year.after.author 1741 | { period.after.author 1742 | 'new.sentence 1743 | 'skip$ 1744 | if$ 1745 | format.year "year" output.check 1746 | } 1747 | 'skip$ 1748 | if$ 1749 | new.block 1750 | format.title "title" output.check 1751 | "M" set.entry.mark 1752 | format.mark "" output.after 1753 | new.block 1754 | format.translators output 1755 | new.slash 1756 | format.editors output 1757 | new.block 1758 | format.series.vol.num.booktitle "booktitle" output.check 1759 | new.block 1760 | format.edition output 1761 | new.block 1762 | format.address.publisher output 1763 | year.after.author not 1764 | { format.year "year" output.check } 1765 | 'skip$ 1766 | if$ 1767 | format.extracted.pages bbl.pages.colon output.after 1768 | format.urldate "" output.after 1769 | output.url 1770 | output.doi 1771 | new.block 1772 | format.note output 1773 | fin.entry 1774 | } 1775 | 1776 | FUNCTION {periodical} 1777 | { output.bibitem 1778 | output.translation 1779 | format.authors output 1780 | author format.key output 1781 | year.after.author 1782 | { period.after.author 1783 | 'new.sentence 1784 | 'skip$ 1785 | if$ 1786 | format.year "year" output.check 1787 | } 1788 | 'skip$ 1789 | if$ 1790 | new.block 1791 | format.title "title" output.check 1792 | "J" set.entry.mark 1793 | format.mark "" output.after 1794 | new.block 1795 | format.periodical.year.volume.number output 1796 | new.block 1797 | format.address.publisher output 1798 | year.after.author not 1799 | { format.periodical.year "year" output.check } 1800 | 'skip$ 1801 | if$ 1802 | format.urldate "" output.after 1803 | output.url 1804 | output.doi 1805 | new.block 1806 | format.note output 1807 | fin.entry 1808 | } 1809 | 1810 | FUNCTION {journal.article} 1811 | { output.bibitem 1812 | output.translation 1813 | format.authors output 1814 | author format.key output 1815 | year.after.author 1816 | { period.after.author 1817 | 'new.sentence 1818 | 'skip$ 1819 | if$ 1820 | format.year "year" output.check 1821 | } 1822 | 'skip$ 1823 | if$ 1824 | new.block 1825 | title.in.journal 1826 | { format.title "title" output.check 1827 | entrysubtype empty$ not 1828 | { 1829 | entrysubtype "newspaper" = 1830 | { "N" set.entry.mark } 1831 | { "J" set.entry.mark } 1832 | if$ 1833 | } 1834 | { "J" set.entry.mark } 1835 | if$ 1836 | format.mark "" output.after 1837 | new.block 1838 | } 1839 | 'skip$ 1840 | if$ 1841 | format.journal "journal" output.check 1842 | year.after.author not 1843 | { format.date "year" output.check } 1844 | 'skip$ 1845 | if$ 1846 | format.journal.volume output 1847 | format.journal.number "" output.after 1848 | format.journal.pages bbl.pages.colon output.after 1849 | format.urldate "" output.after 1850 | output.url 1851 | output.doi 1852 | new.block 1853 | format.note output 1854 | fin.entry 1855 | } 1856 | 1857 | FUNCTION {patent} 1858 | { output.bibitem 1859 | output.translation 1860 | format.authors output 1861 | author format.key output 1862 | year.after.author 1863 | { period.after.author 1864 | 'new.sentence 1865 | 'skip$ 1866 | if$ 1867 | format.year "year" output.check 1868 | } 1869 | 'skip$ 1870 | if$ 1871 | new.block 1872 | format.title "title" output.check 1873 | "P" set.entry.mark 1874 | format.mark "" output.after 1875 | new.block 1876 | format.date "year" output.check 1877 | format.urldate "" output.after 1878 | output.url 1879 | output.doi 1880 | new.block 1881 | format.note output 1882 | fin.entry 1883 | } 1884 | 1885 | FUNCTION {electronic} 1886 | { #1 #1 check.electronic 1887 | #1 'entry.is.electronic := 1888 | #1 'is.pure.electronic := 1889 | output.bibitem 1890 | output.translation 1891 | format.authors output 1892 | author format.key output 1893 | year.after.author 1894 | { period.after.author 1895 | 'new.sentence 1896 | 'skip$ 1897 | if$ 1898 | format.year "year" output.check 1899 | } 1900 | 'skip$ 1901 | if$ 1902 | new.block 1903 | format.series.vol.num.title "title" output.check 1904 | "EB" set.entry.mark 1905 | format.mark "" output.after 1906 | new.block 1907 | format.address.publisher output 1908 | year.after.author not 1909 | { date empty$ 1910 | { format.date output } 1911 | 'skip$ 1912 | if$ 1913 | } 1914 | 'skip$ 1915 | if$ 1916 | format.pages bbl.pages.colon output.after 1917 | format.editdate "" output.after 1918 | format.urldate "" output.after 1919 | output.url 1920 | output.doi 1921 | new.block 1922 | format.note output 1923 | fin.entry 1924 | } 1925 | 1926 | FUNCTION {preprint} 1927 | { output.bibitem 1928 | output.translation 1929 | author empty$ not 1930 | { format.authors } 1931 | { editor empty$ not 1932 | { format.editors } 1933 | { "empty author and editor in " cite$ * warning$ 1934 | "" 1935 | } 1936 | if$ 1937 | } 1938 | if$ 1939 | output 1940 | year.after.author 1941 | { period.after.author 1942 | 'new.sentence 1943 | 'skip$ 1944 | if$ 1945 | format.year "year" output.check 1946 | } 1947 | 'skip$ 1948 | if$ 1949 | new.block 1950 | title.in.journal 1951 | { format.series.vol.num.title "title" output.check 1952 | "A" set.entry.mark 1953 | format.mark "" output.after 1954 | new.block 1955 | } 1956 | 'skip$ 1957 | if$ 1958 | format.translators output 1959 | new.sentence 1960 | format.edition output 1961 | new.block 1962 | year.after.author not 1963 | { date empty$ 1964 | { format.date output } 1965 | 'skip$ 1966 | if$ 1967 | } 1968 | 'skip$ 1969 | if$ 1970 | format.pages bbl.pages.colon output.after 1971 | format.editdate "" output.after 1972 | format.urldate "" output.after 1973 | output.eprint 1974 | output.url 1975 | show.preprint not eprint empty$ or 1976 | 'output.doi 1977 | 'skip$ 1978 | if$ 1979 | new.block 1980 | format.note output 1981 | fin.entry 1982 | } 1983 | 1984 | FUNCTION {misc} 1985 | { get.journal.title 1986 | duplicate$ empty$ not 1987 | { check.arxiv.preprint 1988 | 'preprint 1989 | 'journal.article 1990 | if$ 1991 | } 1992 | { pop$ 1993 | booktitle empty$ not 1994 | 'incollection 1995 | { publisher empty$ not 1996 | 'monograph 1997 | { eprint empty$ not archivePrefix empty$ not or 1998 | 'preprint 1999 | { entry.is.electronic 2000 | 'electronic 2001 | { 2002 | "Z" set.entry.mark 2003 | monograph 2004 | } 2005 | if$ 2006 | } 2007 | if$ 2008 | } 2009 | if$ 2010 | } 2011 | if$ 2012 | } 2013 | if$ 2014 | empty.misc.check 2015 | } 2016 | 2017 | FUNCTION {archive} 2018 | { "A" set.entry.mark 2019 | misc 2020 | } 2021 | 2022 | FUNCTION {article} { misc } 2023 | 2024 | FUNCTION {book} { monograph } 2025 | 2026 | FUNCTION {booklet} { book } 2027 | 2028 | FUNCTION {collection} 2029 | { "G" set.entry.mark 2030 | monograph 2031 | } 2032 | 2033 | FUNCTION {database} 2034 | { "DB" set.entry.mark 2035 | electronic 2036 | } 2037 | 2038 | FUNCTION {dataset} 2039 | { "DS" set.entry.mark 2040 | electronic 2041 | } 2042 | 2043 | FUNCTION {inbook} { book } 2044 | 2045 | FUNCTION {inproceedings} 2046 | { "C" set.entry.mark 2047 | incollection 2048 | } 2049 | 2050 | FUNCTION {conference} { inproceedings } 2051 | 2052 | FUNCTION {legislation} { archive } 2053 | 2054 | FUNCTION {map} 2055 | { "CM" set.entry.mark 2056 | misc 2057 | } 2058 | 2059 | FUNCTION {manual} { monograph } 2060 | 2061 | FUNCTION {mastersthesis} 2062 | { "D" set.entry.mark 2063 | monograph 2064 | } 2065 | 2066 | FUNCTION {newspaper} 2067 | { "N" set.entry.mark 2068 | article 2069 | } 2070 | 2071 | FUNCTION {online} 2072 | { "EB" set.entry.mark 2073 | electronic 2074 | } 2075 | 2076 | FUNCTION {phdthesis} { mastersthesis } 2077 | 2078 | FUNCTION {proceedings} 2079 | { "C" set.entry.mark 2080 | monograph 2081 | } 2082 | 2083 | FUNCTION {software} 2084 | { "CP" set.entry.mark 2085 | electronic 2086 | } 2087 | 2088 | FUNCTION {standard} 2089 | { "S" set.entry.mark 2090 | misc 2091 | } 2092 | 2093 | FUNCTION {techreport} 2094 | { "R" set.entry.mark 2095 | misc 2096 | } 2097 | 2098 | FUNCTION {unpublished} { misc } 2099 | 2100 | FUNCTION {default.type} { misc } 2101 | 2102 | MACRO {jan} {"January"} 2103 | 2104 | MACRO {feb} {"February"} 2105 | 2106 | MACRO {mar} {"March"} 2107 | 2108 | MACRO {apr} {"April"} 2109 | 2110 | MACRO {may} {"May"} 2111 | 2112 | MACRO {jun} {"June"} 2113 | 2114 | MACRO {jul} {"July"} 2115 | 2116 | MACRO {aug} {"August"} 2117 | 2118 | MACRO {sep} {"September"} 2119 | 2120 | MACRO {oct} {"October"} 2121 | 2122 | MACRO {nov} {"November"} 2123 | 2124 | MACRO {dec} {"December"} 2125 | 2126 | MACRO {acmcs} {"ACM Computing Surveys"} 2127 | 2128 | MACRO {acta} {"Acta Informatica"} 2129 | 2130 | MACRO {cacm} {"Communications of the ACM"} 2131 | 2132 | MACRO {ibmjrd} {"IBM Journal of Research and Development"} 2133 | 2134 | MACRO {ibmsj} {"IBM Systems Journal"} 2135 | 2136 | MACRO {ieeese} {"IEEE Transactions on Software Engineering"} 2137 | 2138 | MACRO {ieeetc} {"IEEE Transactions on Computers"} 2139 | 2140 | MACRO {ieeetcad} 2141 | {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} 2142 | 2143 | MACRO {ipl} {"Information Processing Letters"} 2144 | 2145 | MACRO {jacm} {"Journal of the ACM"} 2146 | 2147 | MACRO {jcss} {"Journal of Computer and System Sciences"} 2148 | 2149 | MACRO {scp} {"Science of Computer Programming"} 2150 | 2151 | MACRO {sicomp} {"SIAM Journal on Computing"} 2152 | 2153 | MACRO {tocs} {"ACM Transactions on Computer Systems"} 2154 | 2155 | MACRO {tods} {"ACM Transactions on Database Systems"} 2156 | 2157 | MACRO {tog} {"ACM Transactions on Graphics"} 2158 | 2159 | MACRO {toms} {"ACM Transactions on Mathematical Software"} 2160 | 2161 | MACRO {toois} {"ACM Transactions on Office Information Systems"} 2162 | 2163 | MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} 2164 | 2165 | MACRO {tcs} {"Theoretical Computer Science"} 2166 | 2167 | FUNCTION {sortify} 2168 | { purify$ 2169 | "l" change.case$ 2170 | } 2171 | 2172 | FUNCTION {chop.word} 2173 | { 's := 2174 | 'len := 2175 | s #1 len substring$ = 2176 | { s len #1 + global.max$ substring$ } 2177 | 's 2178 | if$ 2179 | } 2180 | 2181 | FUNCTION {format.lab.name} 2182 | { "{vv~}{ll}{, jj}{, ff}" format.name$ 't := 2183 | t "others" = 2184 | { citation.et.al } 2185 | { t get.str.lang 'name.lang := 2186 | name.lang lang.zh = name.lang lang.ja = or 2187 | { t #1 "{ll}{ff}" format.name$ } 2188 | { t #1 "{vv~}{ll}" format.name$ } 2189 | if$ 2190 | } 2191 | if$ 2192 | } 2193 | 2194 | FUNCTION {format.lab.names} 2195 | { 's := 2196 | s #1 format.lab.name 'short.label := 2197 | #1 'nameptr := 2198 | s num.names$ 'numnames := 2199 | "" 2200 | numnames 'namesleft := 2201 | { namesleft #0 > } 2202 | { s nameptr format.lab.name citation.et.al = 2203 | numnames citation.et.al.min #1 - > nameptr citation.et.al.use.first > and or 2204 | { bbl.space * 2205 | citation.et.al * 2206 | #1 'namesleft := 2207 | } 2208 | { nameptr #1 > 2209 | { namesleft #1 = citation.and "" = not and 2210 | { citation.and * } 2211 | { ", " * } 2212 | if$ 2213 | } 2214 | 'skip$ 2215 | if$ 2216 | s nameptr format.lab.name * 2217 | } 2218 | if$ 2219 | nameptr #1 + 'nameptr := 2220 | namesleft #1 - 'namesleft := 2221 | } 2222 | while$ 2223 | } 2224 | 2225 | FUNCTION {author.key.label} 2226 | { author empty$ 2227 | { key empty$ 2228 | { cite$ #1 #3 substring$ } 2229 | 'key 2230 | if$ 2231 | } 2232 | { author format.lab.names } 2233 | if$ 2234 | } 2235 | 2236 | FUNCTION {author.editor.key.label} 2237 | { author empty$ 2238 | { editor empty$ 2239 | { key empty$ 2240 | { cite$ #1 #3 substring$ } 2241 | 'key 2242 | if$ 2243 | } 2244 | { editor format.lab.names } 2245 | if$ 2246 | } 2247 | { author format.lab.names } 2248 | if$ 2249 | } 2250 | 2251 | FUNCTION {author.key.organization.label} 2252 | { author empty$ 2253 | { key empty$ 2254 | { organization empty$ 2255 | { cite$ #1 #3 substring$ } 2256 | { "The " #4 organization chop.word #3 text.prefix$ } 2257 | if$ 2258 | } 2259 | 'key 2260 | if$ 2261 | } 2262 | { author format.lab.names } 2263 | if$ 2264 | } 2265 | 2266 | FUNCTION {editor.key.organization.label} 2267 | { editor empty$ 2268 | { key empty$ 2269 | { organization empty$ 2270 | { cite$ #1 #3 substring$ } 2271 | { "The " #4 organization chop.word #3 text.prefix$ } 2272 | if$ 2273 | } 2274 | 'key 2275 | if$ 2276 | } 2277 | { editor format.lab.names } 2278 | if$ 2279 | } 2280 | 2281 | FUNCTION {calc.short.authors} 2282 | { "" 'short.label := 2283 | type$ "book" = 2284 | type$ "inbook" = 2285 | or 2286 | 'author.editor.key.label 2287 | { type$ "collection" = 2288 | type$ "proceedings" = 2289 | or 2290 | { editor empty$ not 2291 | 'editor.key.organization.label 2292 | 'author.key.organization.label 2293 | if$ 2294 | } 2295 | 'author.key.label 2296 | if$ 2297 | } 2298 | if$ 2299 | 'short.list := 2300 | short.label empty$ 2301 | { short.list 'short.label := } 2302 | 'skip$ 2303 | if$ 2304 | } 2305 | 2306 | FUNCTION {calc.label} 2307 | { calc.short.authors 2308 | short.list "]" contains 2309 | { "{" short.list * "}" * } 2310 | { short.list } 2311 | if$ 2312 | "(" 2313 | * 2314 | format.year duplicate$ empty$ 2315 | short.list key field.or.null = or 2316 | { pop$ "" } 2317 | 'skip$ 2318 | if$ 2319 | duplicate$ "]" contains 2320 | { "{" swap$ * "}" * } 2321 | 'skip$ 2322 | if$ 2323 | * 2324 | 'label := 2325 | short.label 2326 | "(" 2327 | * 2328 | format.year duplicate$ empty$ 2329 | short.list key field.or.null = or 2330 | { pop$ "" } 2331 | 'skip$ 2332 | if$ 2333 | * 2334 | 'short.label := 2335 | } 2336 | 2337 | INTEGERS { seq.num } 2338 | 2339 | FUNCTION {init.seq} 2340 | { #0 'seq.num :=} 2341 | 2342 | FUNCTION {int.to.fix} 2343 | { "000000000" swap$ int.to.str$ * 2344 | #-1 #10 substring$ 2345 | } 2346 | 2347 | FUNCTION {presort} 2348 | { set.entry.lang 2349 | set.entry.numbered 2350 | show.url show.doi check.electronic 2351 | #0 'is.pure.electronic := 2352 | calc.label 2353 | label sortify 2354 | " " 2355 | * 2356 | seq.num #1 + 'seq.num := 2357 | seq.num int.to.fix 2358 | 'sort.label := 2359 | sort.label * 2360 | #1 entry.max$ substring$ 2361 | 'sort.key$ := 2362 | } 2363 | 2364 | STRINGS { longest.label last.label next.extra last.extra.label } 2365 | 2366 | INTEGERS { longest.label.width number.label } 2367 | 2368 | FUNCTION {initialize.longest.label} 2369 | { "" 'longest.label := 2370 | #0 int.to.chr$ 'last.label := 2371 | "" 'next.extra := 2372 | #0 'longest.label.width := 2373 | #0 'number.label := 2374 | "" 'last.extra.label := 2375 | } 2376 | 2377 | FUNCTION {forward.pass} 2378 | { 2379 | number.label #1 + 'number.label := 2380 | } 2381 | 2382 | FUNCTION {reverse.pass} 2383 | { 2384 | label extra.label * 'label := 2385 | } 2386 | 2387 | FUNCTION {bib.sort.order} 2388 | { sort.label 'sort.key$ := 2389 | } 2390 | 2391 | FUNCTION {begin.bib} 2392 | { preamble$ empty$ 2393 | 'skip$ 2394 | { preamble$ write$ newline$ } 2395 | if$ 2396 | "\begin{thebibliography}{" number.label int.to.str$ * "}" * 2397 | write$ newline$ 2398 | terms.in.macro 2399 | { "\providecommand{\biband}{和}" 2400 | write$ newline$ 2401 | "\providecommand{\bibetal}{等}" 2402 | write$ newline$ 2403 | } 2404 | 'skip$ 2405 | if$ 2406 | "\providecommand{\natexlab}[1]{#1}" 2407 | write$ newline$ 2408 | "\providecommand{\url}[1]{#1}" 2409 | write$ newline$ 2410 | "\expandafter\ifx\csname urlstyle\endcsname\relax\else" 2411 | write$ newline$ 2412 | " \urlstyle{same}\fi" 2413 | write$ newline$ 2414 | "\expandafter\ifx\csname href\endcsname\relax" 2415 | write$ newline$ 2416 | " \DeclareUrlCommand\doi{\urlstyle{rm}}" 2417 | write$ newline$ 2418 | " \def\eprint#1#2{#2}" 2419 | write$ newline$ 2420 | "\else" 2421 | write$ newline$ 2422 | " \def\doi#1{\href{https://doi.org/#1}{\nolinkurl{#1}}}" 2423 | write$ newline$ 2424 | " \let\eprint\href" 2425 | write$ newline$ 2426 | "\fi" 2427 | write$ newline$ 2428 | } 2429 | 2430 | FUNCTION {end.bib} 2431 | { newline$ 2432 | "\end{thebibliography}" write$ newline$ 2433 | } 2434 | 2435 | READ 2436 | 2437 | EXECUTE {init.state.consts} 2438 | 2439 | EXECUTE {load.config} 2440 | 2441 | EXECUTE {init.seq} 2442 | 2443 | ITERATE {presort} 2444 | 2445 | SORT 2446 | 2447 | EXECUTE {initialize.longest.label} 2448 | 2449 | ITERATE {forward.pass} 2450 | 2451 | REVERSE {reverse.pass} 2452 | 2453 | ITERATE {bib.sort.order} 2454 | 2455 | SORT 2456 | 2457 | EXECUTE {begin.bib} 2458 | 2459 | ITERATE {call.type$} 2460 | 2461 | EXECUTE {end.bib} 2462 | --------------------------------------------------------------------------------