From 00659712a03046615d9fe541309090b607d3ccfd Mon Sep 17 00:00:00 2001 From: FengChendian Date: Sat, 18 Dec 2021 20:54:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84XITS=20Math=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chore: 增加测试文件夹 --- njurepo.dtx | 67 +- njurepo.ins | 55 -- parts/examples/abstract.tex | 2 +- parts/examples/ack.tex | 2 +- parts/examples/appendix01.tex | 32 +- parts/examples/cover.tex | 2 +- test/chapter/abstract.tex | 49 + test/chapter/ack.tex | 12 + test/chapter/appendix01.tex | 265 +++++ test/chapter/chap01.tex | 573 +++++++++++ test/chapter/cover.tex | 42 + test/chapter/denotation.tex | 57 ++ test/chapter/numeric.bst | 1748 +++++++++++++++++++++++++++++++++ test/chapter/refs.bib | 230 +++++ test/test.tex | 22 + 15 files changed, 3073 insertions(+), 85 deletions(-) delete mode 100644 njurepo.ins create mode 100644 test/chapter/abstract.tex create mode 100644 test/chapter/ack.tex create mode 100644 test/chapter/appendix01.tex create mode 100644 test/chapter/chap01.tex create mode 100644 test/chapter/cover.tex create mode 100644 test/chapter/denotation.tex create mode 100644 test/chapter/numeric.bst create mode 100644 test/chapter/refs.bib create mode 100644 test/test.tex diff --git a/njurepo.dtx b/njurepo.dtx index 9ea8644..7ab416f 100644 --- a/njurepo.dtx +++ b/njurepo.dtx @@ -16,6 +16,53 @@ % % \iffalse %<*driver> +% +%<*batchfile> +\input docstrip +\keepsilent + +\usedir{tex/latex/njurepo} + +\preamble + +This is a generated file. + +Copyright (C) 2019 by Zangwei Zheng + +This file may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3c +of this license or (at your option) any later version. +The latest version of this license is in: + http://www.latex-project.org/lppl.txt +and version 1.3c or later is part of all distributions of LaTeX +version 2005/12/01 or later. + +\endpreamble +\askforoverwritefalse +\generate{\file{\jobname.cls}{\from{\jobname.dtx}{cls}} + \file{dtx-style.sty}{\from{\jobname.dtx}{dtx-style}} + } + +\obeyspaces +\Msg{*************************************************************} +\Msg{* *} +\Msg{* To finish the installation you have to move the following *} +\Msg{* files into a directory searched by TeX: *} +\Msg{* *} +\Msg{* njurepo.cls *} +\Msg{* njurepo.cfg *} +\Msg{* *} +\Msg{* To produce the documentation run the file njurepo.dtx *} +\Msg{* through LaTeX. *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{* *} +\Msg{*************************************************************} + +\endbatchfile + +% +% \ProvidesFile{njurepo.dtx}[2019/03/20 1.1.3 Nanjing University Report Template] \documentclass{ltxdoc} \usepackage{dtx-style} @@ -101,7 +148,7 @@ % \item 本模板的发布遵守 \LaTeX\ Project Public License,使用前请认真阅读协议内 % 容。 % \item \textbf{本模板为作者自己通常使用的报告模板,与南京大学官方没有任何关系}。任何使用该宏包进行实验报告制作时,请\textbf{务必根据课程要求进行写作}。由于使用本模板而引起的作业验收问题,均与本模板作者无关。 -% \item 本模板借鉴\thuthesis{}宏包的许多内容,需要稳定模板的同学也可以选择使用清华大学的\thuthesis{}宏包并自己进行配置。 +% \item 本模板借鉴\njuthesis{}宏包的许多内容,需要稳定模板的同学也可以选择使用南京大学的\njuthesis{}宏包并自己进行配置。 % \item 任何个人或组织以本模板为基础进行修改、扩展而生成的新的专用模板,请严格遵 % 守 \LaTeX\ Project Public License 协议。由于违犯协议而引起的任何纠纷争端均与 % 本模板作者无关。 @@ -301,7 +348,7 @@ % \section{致谢} % 感谢以下宏包的作者,本宏包从中使用了部分代码和借鉴: % \begin{itemize} -% \item 清华大学\thuthesis https://github.com/xueruini/thuthesis +% \item 南京大学\njuthesis https://github.com/xueruini/njuthesis % \end{itemize} % % \StopEventually{} @@ -320,7 +367,7 @@ % \begin{macrocode} \hyphenation{NJU-repo} \def\njurepo{\textsc{NJU}\-\textsc{repo}} -\def\thuthesis{\textsc{Thu}\-\textsc{Thesis}} +\def\njuthesis{\textsc{Thu}\-\textsc{Thesis}} \def\version{1.1.3} \RequirePackage{kvoptions} \SetupKeyvalOptions{ @@ -379,6 +426,7 @@ \includepdfset{fitpaper=true} \RequirePackage{tikz} \usetikzlibrary{decorations.pathmorphing,graphs,calc} +\RequirePackage{njuvisual} \RequirePackage{dirtree} \RequirePackage{qtree} % \end{macrocode} @@ -449,7 +497,7 @@ % \end{macrocode} % % \subsection{页面设置} -% 使用了thuthesis的非本科生默认配置。 +% 使用了njuthesis的非本科生默认配置。 % \begin{macrocode} \RequirePackage{geometry} \ifnju@wide @@ -570,15 +618,10 @@ \IfFontExistsTF{XITSMath-Regular.otf}{ \setmathfont[range={\partial,\lbrace,\rbrace}]{XITSMath-Regular.otf} }{ - \setmathfont[range={\partial,\lbrace,\rbrace}]{xits-math.otf} + \setmathfont[range={\partial,\lbrace,\rbrace}]{XITS Math} } }{ - \setmathfont[ - Extension = .otf, - BoldFont = *bold, - StylisticSet = 8, - ]{xits-math} - \setmathfont[range={cal,bfcal},StylisticSet=1]{xits-math.otf} + \setmathfont{XITS Math} } % \end{macrocode} % @@ -2335,7 +2378,7 @@ every listing line={\textcolor{red}{\small\ttfamily\bfseries \$>}}} \color{magenta}{\bfseries #1}\emph{#2}}} \def\njurepo{\textsc{NJU}\-\textsc{repo}} -\def\thuthesis{\textsc{Thu}\-\textsc{Thesis}} +\def\njuthesis{\textsc{NJU}\-\textsc{Thesis}} % % \end{macrocode} % \fi diff --git a/njurepo.ins b/njurepo.ins deleted file mode 100644 index 9bfe048..0000000 --- a/njurepo.ins +++ /dev/null @@ -1,55 +0,0 @@ -%% -%% Copyright (C) 2019 by Zangwei Zheng -%% -%% This file may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3c -%% of this license or (at your option) any later version. -%% The latest version of this license is in: -%% http://www.latex-project.org/lppl.txt -%% and version 1.3c or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. -%% -%% This work has the LPPL maintenance status `maintained'. - -\input docstrip -\keepsilent - -\usedir{tex/latex/njurepo} - -\preamble - -This is a generated file. - -Copyright (C) 2019 by Zangwei Zheng - -This file may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either version 1.3c -of this license or (at your option) any later version. -The latest version of this license is in: - http://www.latex-project.org/lppl.txt -and version 1.3c or later is part of all distributions of LaTeX -version 2005/12/01 or later. - -\endpreamble -\askforoverwritefalse -\generate{\file{\jobname.cls}{\from{\jobname.dtx}{cls}} - \file{dtx-style.sty}{\from{\jobname.dtx}{dtx-style}} - } - -\obeyspaces -\Msg{*************************************************************} -\Msg{* *} -\Msg{* To finish the installation you have to move the following *} -\Msg{* files into a directory searched by TeX: *} -\Msg{* *} -\Msg{* njurepo.cls *} -\Msg{* njurepo.cfg *} -\Msg{* *} -\Msg{* To produce the documentation run the file njurepo.dtx *} -\Msg{* through LaTeX. *} -\Msg{* *} -\Msg{* Happy TeXing! *} -\Msg{* *} -\Msg{*************************************************************} - -\endbatchfile \ No newline at end of file diff --git a/parts/examples/abstract.tex b/parts/examples/abstract.tex index d8ec833..4b4dec7 100644 --- a/parts/examples/abstract.tex +++ b/parts/examples/abstract.tex @@ -8,7 +8,7 @@ 论文摘要的书写应力求精确、简明。切忌写成对论文书写内容进行提要的形式,尤其要避 免“第 1 章……;第 2 章……;……”这种或类似的陈述方式。 - 本文介绍清华大学论文模板 \thuthesis{} 的使用方法。本模板符合学校的本科、硕士、 + 本文介绍南京大学论文模板 \njuthesis{} 的使用方法。本模板符合学校的本科、硕士、 博士论文格式要求。 本文的创新点主要有: diff --git a/parts/examples/ack.tex b/parts/examples/ack.tex index fee8e5f..e9dff0b 100755 --- a/parts/examples/ack.tex +++ b/parts/examples/ack.tex @@ -8,5 +8,5 @@ 胜感激。感谢 xx 实验室主任 xx 教授,以及实验室全体老师和同学们的热情帮助和支 持!本课题承蒙国家自然科学基金资助,特此致谢。 - 感谢 \LaTeX 和 thuthesis\cite{thuthesis},帮我节省了不少时间。 + 感谢 \LaTeX 和 njuthesis\cite{njuthesis},帮我节省了不少时间。 \end{acknowledgement} diff --git a/parts/examples/appendix01.tex b/parts/examples/appendix01.tex index 836ca9a..a99af86 100755 --- a/parts/examples/appendix01.tex +++ b/parts/examples/appendix01.tex @@ -106,7 +106,7 @@ \subsection{Linear Programming} \multirow{2}{2em}{50\%}& \multirow{2}{1.2in}{Max. Connectivity}\\\cline{1-3} \multicolumn{2}{|c|}{Inet-2.1} & 6000 & & & &\\\hline - \multirow{2}{1.5cm}{Xue} & Rui & Ni &\multicolumn{4}{c|}{\multirow{2}*{\thuthesis}}\\\cline{2-3} + \multirow{2}{1.5cm}{Xue} & Rui & Ni &\multicolumn{4}{c|}{\multirow{2}*{\njuthesis}}\\\cline{2-3} & \multicolumn{2}{c|}{ABCDEF} &\multicolumn{4}{c|}{} \\\hline \end{tabular} \end{table} @@ -126,13 +126,14 @@ \subsection{Nonlinear Programming} A large number of classical optimization methods have been developed to treat special-structural nonlinear programming based on the mathematical theory concerned with analyzing the structure of problems. -\begin{figure}[h] - \centering - \includegraphics{njulogo0.pdf} - \caption*{Figure~1\quad This is an example for manually numbered figure, - which would not appear in the list of figures} - \label{tab:badfigure2} -\end{figure} +\njuemblem{!}{3cm} +% \begin{figure}[h] +% \centering +% \includegraphics{njulogo0.pdf} +% \caption*{Figure~1\quad This is an example for manually numbered figure, +% which would not appear in the list of figures} +% \label{tab:badfigure2} +% \end{figure} Now we consider a nonlinear programming which is confronted solely with maximizing a real-valued function with domain $\Real^n$. Whether derivatives are @@ -215,7 +216,7 @@ \subsection{线性规划} \multirow{2}{2em}{50\%}& \multirow{2}{1.2in}{Max. Connectivity}\\\cline{1-3} \multicolumn{2}{|c|}{Inet-2.1} & 6000 & & & &\\\hline - \multirow{2}{1.5cm}{Xue} & Rui & Ni &\multicolumn{4}{c|}{\multirow{2}*{\thuthesis}}\\\cline{2-3} + \multirow{2}{1.5cm}{Xue} & Rui & Ni &\multicolumn{4}{c|}{\multirow{2}*{\njuthesis}}\\\cline{2-3} & \multicolumn{2}{c|}{ABCDEF} &\multicolumn{4}{c|}{} \\\hline \end{tabular} \end{table} @@ -237,12 +238,13 @@ \subsection{非线性规划} 国入保,万民苦之。孔子谓柳下季曰:“夫为人父者,必能诏其子;为人兄者,必能教其弟。 若父不能诏其子,兄不能教其弟,则无贵父子兄弟之亲矣。今先生,世之才士也,弟为盗 跖,为天下害,而弗能教也,丘窃为先生羞之。丘请为先生往说之。” -\begin{figure}[h] - \centering - \includegraphics{njulogo0.pdf} - \caption*{图~1\hskip1em 这是手动编号但不出现索引中的图片的例子} - \label{tab:badfigure3} -\end{figure} +\njuemblem{!}{3cm} +% \begin{figure}[h] +% \centering +% \includegraphics{njulogo0.pdf} +% \caption*{图~1\hskip1em 这是手动编号但不出现索引中的图片的例子} +% \label{tab:badfigure3} +% \end{figure} 柳下季曰:“先生言为人父者必能诏其子,为人兄者必能教其弟,若子不听父之诏,弟不受 兄之教,虽今先生之辩,将奈之何哉?且跖之为人也,心如涌泉,意如飘风,强足以距敌, diff --git a/parts/examples/cover.tex b/parts/examples/cover.tex index a30188e..894df55 100755 --- a/parts/examples/cover.tex +++ b/parts/examples/cover.tex @@ -8,7 +8,7 @@ %========= % 中文信息 %========= - ctitle={清华大学学位论文 \LaTeX\ 模板\\使用示例文档}, + ctitle={南京大学学位论文 \LaTeX\ 模板\\使用示例文档}, csubtitle={通用报告模板}, cdegree={工学硕士}, cdepartment={计算机科学与技术系}, diff --git a/test/chapter/abstract.tex b/test/chapter/abstract.tex new file mode 100644 index 0000000..b434420 --- /dev/null +++ b/test/chapter/abstract.tex @@ -0,0 +1,49 @@ +% 定义中英文摘要和关键字 +\begin{cabstract} + 论文的摘要是对论文研究内容和成果的高度概括。摘要应对论文所研究的问题及其研究目 + 的进行描述,对研究方法和过程进行简单介绍,对研究成果和所得结论进行概括。摘要应 + 具有独立性和自明性,其内容应包含与论文全文同等量的主要信息。使读者即使不阅读全 + 文,通过摘要就能了解论文的总体内容和主要成果。 + + 论文摘要的书写应力求精确、简明。切忌写成对论文书写内容进行提要的形式,尤其要避 + 免“第 1 章……;第 2 章……;……”这种或类似的陈述方式。 + + 本文介绍清华大学论文模板 \njuthesis{} 的使用方法。本模板符合学校的本科、硕士、 + 博士论文格式要求。 + + 本文的创新点主要有: + \begin{itemize} + \item 用例子来解释模板的使用方法; + \item 用废话来填充无关紧要的部分; + \item 一边学习摸索一边编写新代码。 + \end{itemize} + + 关键词是为了文献标引工作、用以表示全文主要内容信息的单词或术语。关键词不超过 5 + 个,每个关键词中间用分号分隔。(模板作者注:关键词分隔符不用考虑,模板会自动处 + 理。英文关键词同理。) + \end{cabstract} + + \ckeywords{\TeX, \LaTeX, CJK, 模板, 论文} + + \begin{eabstract} + An abstract of a dissertation is a summary and extraction of research work + and contributions. Included in an abstract should be description of research + topic and research objective, brief introduction to methodology and research + process, and summarization of conclusion and contributions of the + research. An abstract should be characterized by independence and clarity and + carry identical information with the dissertation. It should be such that the + general idea and major contributions of the dissertation are conveyed without + reading the dissertation. + + An abstract should be concise and to the point. It is a misunderstanding to + make an abstract an outline of the dissertation and words ``the first + chapter'', ``the second chapter'' and the like should be avoided in the + abstract. + + Key words are terms used in a dissertation for indexing, reflecting core + information of the dissertation. An abstract may contain a maximum of 5 key + words, with semi-colons used in between to separate one another. + \end{eabstract} + + \ekeywords{\TeX, \LaTeX, CJK, template, thesis} + \ No newline at end of file diff --git a/test/chapter/ack.tex b/test/chapter/ack.tex new file mode 100644 index 0000000..e9dff0b --- /dev/null +++ b/test/chapter/ack.tex @@ -0,0 +1,12 @@ +% 如果使用声明扫描页,将可选参数指定为扫描后的 PDF 文件名,例如: +% \begin{acknowledgement}[scan-statement.pdf] +\begin{acknowledgement} + 衷心感谢导师 xxx 教授和物理系 xxx 副教授对本人的精心指导。他们的言传身教将使 + 我终生受益。 + + 在美国麻省理工学院化学系进行九个月的合作研究期间,承蒙 xxx 教授热心指导与帮助,不 + 胜感激。感谢 xx 实验室主任 xx 教授,以及实验室全体老师和同学们的热情帮助和支 + 持!本课题承蒙国家自然科学基金资助,特此致谢。 + + 感谢 \LaTeX 和 njuthesis\cite{njuthesis},帮我节省了不少时间。 +\end{acknowledgement} diff --git a/test/chapter/appendix01.tex b/test/chapter/appendix01.tex new file mode 100644 index 0000000..a99af86 --- /dev/null +++ b/test/chapter/appendix01.tex @@ -0,0 +1,265 @@ +\chapter{外文资料原文} +\label{cha:engorg} + +\title{The title of the English paper} + +\textbf{Abstract:} As one of the most widely used techniques in operations +research, \emph{ mathematical programming} is defined as a means of maximizing a +quantity known as \emph{bjective function}, subject to a set of constraints +represented by equations and inequalities. Some known subtopics of mathematical +programming are linear programming, nonlinear programming, multiobjective +programming, goal programming, dynamic programming, and multilevel +programming$^{[1]}$. + +It is impossible to cover in a single chapter every concept of mathematical +programming. This chapter introduces only the basic concepts and techniques of +mathematical programming such that readers gain an understanding of them +throughout the book$^{[2,3]}$. + + +\section{Single-Objective Programming} +The general form of single-objective programming (SOP) is written +as follows, +\begin{equation}\tag*{(123)} % 如果附录中的公式不想让它出现在公式索引中,那就请 + % 用 \tag*{xxxx} +\left\{\begin{array}{l} +\max \,\,f(x)\\[0.1 cm] +\mbox{subject to:} \\ [0.1 cm] +\qquad g_j(x)\le 0,\quad j=1,2,\cdots,p +\end{array}\right. +\end{equation} +which maximizes a real-valued function $f$ of +$x=(x_1,x_2,\cdots,x_n)$ subject to a set of constraints. + +\newcommand\Real{\mathbf{R}} +\newtheorem{mpdef}{Definition}[chapter] +\begin{mpdef} +In SOP, we call $x$ a decision vector, and +$x_1,x_2,\cdots,x_n$ decision variables. The function +$f$ is called the objective function. The set +\begin{equation}\tag*{(456)} % 这里同理,其它不再一一指定。 +S=\left\{x\in\Real^n\bigm|g_j(x)\le 0,\,j=1,2,\cdots,p\right\} +\end{equation} +is called the feasible set. An element $x$ in $S$ is called a +feasible solution. +\end{mpdef} + +\newtheorem{mpdefop}[mpdef]{Definition} +\begin{mpdefop} +A feasible solution $x^*$ is called the optimal +solution of SOP if and only if +\begin{equation} +f(x^*)\ge f(x) +\end{equation} +for any feasible solution $x$. +\end{mpdefop} + +One of the outstanding contributions to mathematical programming was known as +the Kuhn-Tucker conditions\ref{eq:ktc}. In order to introduce them, let us give +some definitions. An inequality constraint $g_j(x)\le 0$ is said to be active at +a point $x^*$ if $g_j(x^*)=0$. A point $x^*$ satisfying $g_j(x^*)\le 0$ is said +to be regular if the gradient vectors $\nabla g_j(x)$ of all active constraints +are linearly independent. + +Let $x^*$ be a regular point of the constraints of SOP and assume that all the +functions $f(x)$ and $g_j(x),j=1,2,\cdots,p$ are differentiable. If $x^*$ is a +local optimal solution, then there exist Lagrange multipliers +$\lambda_j,j=1,2,\cdots,p$ such that the following Kuhn-Tucker conditions hold, +\begin{equation} +\label{eq:ktc} +\left\{\begin{array}{l} + \nabla f(x^*)-\sum\limits_{j=1}^p\lambda_j\nabla g_j(x^*)=0\\[0.3cm] + \lambda_jg_j(x^*)=0,\quad j=1,2,\cdots,p\\[0.2cm] + \lambda_j\ge 0,\quad j=1,2,\cdots,p. +\end{array}\right. +\end{equation} +If all the functions $f(x)$ and $g_j(x),j=1,2,\cdots,p$ are convex and +differentiable, and the point $x^*$ satisfies the Kuhn-Tucker conditions +(\ref{eq:ktc}), then it has been proved that the point $x^*$ is a global optimal +solution of SOP. + +\subsection{Linear Programming} +\label{sec:lp} + +If the functions $f(x),g_j(x),j=1,2,\cdots,p$ are all linear, then SOP is called +a {\em linear programming}. + +The feasible set of linear is always convex. A point $x$ is called an extreme +point of convex set $S$ if $x\in S$ and $x$ cannot be expressed as a convex +combination of two points in $S$. It has been shown that the optimal solution to +linear programming corresponds to an extreme point of its feasible set provided +that the feasible set $S$ is bounded. This fact is the basis of the {\em simplex + algorithm} which was developed by Dantzig as a very efficient method for +solving linear programming. +\begin{table}[ht] +\centering + \centering + \caption*{Table~1\hskip1em This is an example for manually numbered table, which + would not appear in the list of tables} + \label{tab:badtabular2} + \begin{tabular}[c]{|m{1.5cm}|c|c|c|c|c|c|}\hline + \multicolumn{2}{|c|}{Network Topology} & \# of nodes & + \multicolumn{3}{c|}{\# of clients} & Server \\\hline + GT-ITM & Waxman Transit-Stub & 600 & + \multirow{2}{2em}{2\%}& + \multirow{2}{2em}{10\%}& + \multirow{2}{2em}{50\%}& + \multirow{2}{1.2in}{Max. Connectivity}\\\cline{1-3} + \multicolumn{2}{|c|}{Inet-2.1} & 6000 & & & &\\\hline + \multirow{2}{1.5cm}{Xue} & Rui & Ni &\multicolumn{4}{c|}{\multirow{2}*{\njuthesis}}\\\cline{2-3} + & \multicolumn{2}{c|}{ABCDEF} &\multicolumn{4}{c|}{} \\\hline +\end{tabular} +\end{table} + +Roughly speaking, the simplex algorithm examines only the extreme points of the +feasible set, rather than all feasible points. At first, the simplex algorithm +selects an extreme point as the initial point. The successive extreme point is +selected so as to improve the objective function value. The procedure is +repeated until no improvement in objective function value can be made. The last +extreme point is the optimal solution. + +\subsection{Nonlinear Programming} + +If at least one of the functions $f(x),g_j(x),j=1,2,\cdots,p$ is nonlinear, then +SOP is called a {\em nonlinear programming}. + +A large number of classical optimization methods have been developed to treat +special-structural nonlinear programming based on the mathematical theory +concerned with analyzing the structure of problems. +\njuemblem{!}{3cm} +% \begin{figure}[h] +% \centering +% \includegraphics{njulogo0.pdf} +% \caption*{Figure~1\quad This is an example for manually numbered figure, +% which would not appear in the list of figures} +% \label{tab:badfigure2} +% \end{figure} + +Now we consider a nonlinear programming which is confronted solely with +maximizing a real-valued function with domain $\Real^n$. Whether derivatives are +available or not, the usual strategy is first to select a point in $\Real^n$ which +is thought to be the most likely place where the maximum exists. If there is no +information available on which to base such a selection, a point is chosen at +random. From this first point an attempt is made to construct a sequence of +points, each of which yields an improved objective function value over its +predecessor. The next point to be added to the sequence is chosen by analyzing +the behavior of the function at the previous points. This construction continues +until some termination criterion is met. Methods based upon this strategy are +called {\em ascent methods}, which can be classified as {\em direct methods}, +{\em gradient methods}, and {\em Hessian methods} according to the information +about the behavior of objective function $f$. Direct methods require only that +the function can be evaluated at each point. Gradient methods require the +evaluation of first derivatives of $f$. Hessian methods require the evaluation +of second derivatives. In fact, there is no superior method for all +problems. The efficiency of a method is very much dependent upon the objective +function. + +\subsection{Integer Programming} + +{\em Integer programming} is a special mathematical programming in which all of +the variables are assumed to be only integer values. When there are not only +integer variables but also conventional continuous variables, we call it {\em + mixed integer programming}. If all the variables are assumed either 0 or 1, +then the problem is termed a {\em zero-one programming}. Although integer +programming can be solved by an {\em exhaustive enumeration} theoretically, it +is impractical to solve realistically sized integer programming problems. The +most successful algorithm so far found to solve integer programming is called +the {\em branch-and-bound enumeration} developed by Balas (1965) and Dakin +(1965). The other technique to integer programming is the {\em cutting plane + method} developed by Gomory (1959). + +\hfill\textit{Uncertain Programming\/}\quad(\textsl{BaoDing Liu, 2006.2}) + +\section*{References} +\noindent{\itshape NOTE: These references are only for demonstration. They are + not real citations in the original text.} + +\begin{translationbib} +\item Donald E. Knuth. The \TeX book. Addison-Wesley, 1984. ISBN: 0-201-13448-9 +\item Paul W. Abrahams, Karl Berry and Kathryn A. Hargreaves. \TeX\ for the + Impatient. Addison-Wesley, 1990. ISBN: 0-201-51375-7 +\item David Salomon. The advanced \TeX book. New York : Springer, 1995. ISBN:0-387-94556-3 +\end{translationbib} + +\chapter{外文资料的调研阅读报告或书面翻译} + +\title{英文资料的中文标题} + +{\heiti 摘要:} 本章为外文资料翻译内容。如果有摘要可以直接写上来,这部分好像没有 +明确的规定。 + +\section{单目标规划} +北冥有鱼,其名为鲲。鲲之大,不知其几千里也。化而为鸟,其名为鹏。鹏之背,不知其几 +千里也。怒而飞,其翼若垂天之云。是鸟也,海运则将徙于南冥。南冥者,天池也。 +\begin{equation}\tag*{(123)} + p(y|\mathbf{x}) = \frac{p(\mathbf{x},y)}{p(\mathbf{x})}= +\frac{p(\mathbf{x}|y)p(y)}{p(\mathbf{x})} +\end{equation} + +吾生也有涯,而知也无涯。以有涯随无涯,殆已!已而为知者,殆而已矣!为善无近名,为 +恶无近刑,缘督以为经,可以保身,可以全生,可以养亲,可以尽年。 + +\subsection{线性规划} +庖丁为文惠君解牛,手之所触,肩之所倚,足之所履,膝之所倚,砉然响然,奏刀騞然,莫 +不中音,合于桑林之舞,乃中经首之会。 +\begin{table}[ht] +\centering + \centering + \caption*{表~1\hskip1em 这是手动编号但不出现在索引中的一个表格例子} + \label{tab:badtabular3} + \begin{tabular}[c]{|m{1.5cm}|c|c|c|c|c|c|}\hline + \multicolumn{2}{|c|}{Network Topology} & \# of nodes & + \multicolumn{3}{c|}{\# of clients} & Server \\\hline + GT-ITM & Waxman Transit-Stub & 600 & + \multirow{2}{2em}{2\%}& + \multirow{2}{2em}{10\%}& + \multirow{2}{2em}{50\%}& + \multirow{2}{1.2in}{Max. Connectivity}\\\cline{1-3} + \multicolumn{2}{|c|}{Inet-2.1} & 6000 & & & &\\\hline + \multirow{2}{1.5cm}{Xue} & Rui & Ni &\multicolumn{4}{c|}{\multirow{2}*{\njuthesis}}\\\cline{2-3} + & \multicolumn{2}{c|}{ABCDEF} &\multicolumn{4}{c|}{} \\\hline +\end{tabular} +\end{table} + +文惠君曰:“嘻,善哉!技盖至此乎?”庖丁释刀对曰:“臣之所好者道也,进乎技矣。始臣之 +解牛之时,所见无非全牛者;三年之后,未尝见全牛也;方今之时,臣以神遇而不以目视, +官知止而神欲行。依乎天理,批大郤,导大窾,因其固然。技经肯綮之未尝,而况大坬乎! +良庖岁更刀,割也;族庖月更刀,折也;今臣之刀十九年矣,所解数千牛矣,而刀刃若新发 +于硎。彼节者有间而刀刃者无厚,以无厚入有间,恢恢乎其于游刃必有余地矣。是以十九年 +而刀刃若新发于硎。虽然,每至于族,吾见其难为,怵然为戒,视为止,行为迟,动刀甚微, +謋然已解,如土委地。提刀而立,为之而四顾,为之踌躇满志,善刀而藏之。” + +文惠君曰:“善哉!吾闻庖丁之言,得养生焉。” + + +\subsection{非线性规划} +孔子与柳下季为友,柳下季之弟名曰盗跖。盗跖从卒九千人,横行天下,侵暴诸侯。穴室枢 +户,驱人牛马,取人妇女。贪得忘亲,不顾父母兄弟,不祭先祖。所过之邑,大国守城,小 +国入保,万民苦之。孔子谓柳下季曰:“夫为人父者,必能诏其子;为人兄者,必能教其弟。 +若父不能诏其子,兄不能教其弟,则无贵父子兄弟之亲矣。今先生,世之才士也,弟为盗 +跖,为天下害,而弗能教也,丘窃为先生羞之。丘请为先生往说之。” +\njuemblem{!}{3cm} +% \begin{figure}[h] +% \centering +% \includegraphics{njulogo0.pdf} +% \caption*{图~1\hskip1em 这是手动编号但不出现索引中的图片的例子} +% \label{tab:badfigure3} +% \end{figure} + +柳下季曰:“先生言为人父者必能诏其子,为人兄者必能教其弟,若子不听父之诏,弟不受 +兄之教,虽今先生之辩,将奈之何哉?且跖之为人也,心如涌泉,意如飘风,强足以距敌, +辩足以饰非。顺其心则喜,逆其心则怒,易辱人以言。先生必无往。” + +孔子不听,颜回为驭,子贡为右,往见盗跖。 + +\subsection{整数规划} +盗跖乃方休卒徒大山之阳,脍人肝而餔之。孔子下车而前,见谒者曰:“鲁人孔丘,闻将军 +高义,敬再拜谒者。”谒者入通。盗跖闻之大怒,目如明星,发上指冠,曰:“此夫鲁国之 +巧伪人孔丘非邪?为我告之:尔作言造语,妄称文、武,冠枝木之冠,带死牛之胁,多辞缪 +说,不耕而食,不织而衣,摇唇鼓舌,擅生是非,以迷天下之主,使天下学士不反其本,妄 +作孝弟,而侥幸于封侯富贵者也。子之罪大极重,疾走归!不然,我将以子肝益昼餔之膳。” + + +\chapter{其它附录} +前面两个附录主要是给本科生做例子。其它附录的内容可以放到这里,当然如果你愿意,可 +以把这部分也放到独立的文件中,然后将其 \cs{input} 到主文件中。 diff --git a/test/chapter/chap01.tex b/test/chapter/chap01.tex new file mode 100644 index 0000000..0017954 --- /dev/null +++ b/test/chapter/chap01.tex @@ -0,0 +1,573 @@ +\chapter{带 English 的标题} +\label{cha:intro} + +这是 NJUrepo 的示例文档,基本上覆盖了模板中所有格式的设置。建议大家在使用模板之前,除了阅读《NJUrepo用户手册》,这个示例文档也最好能看一看。 + +小老鼠偷吃热凉粉;短长虫环绕矮高粱\footnote{韩愈(768-824),字退之,河南河阳( + 今河南孟县)人,自称郡望昌黎,世称韩昌黎。幼孤贫刻苦好学,德宗贞元八年进士。曾 + 任监察御史,因上疏请免关中赋役,贬为阳山县令。后随宰相裴度平定淮西迁刑部侍郎, + 又因上表谏迎佛骨,贬潮州刺史。做过吏部侍郎,死谥文公,故世称韩吏部、韩文公。是 + 唐代古文运动领袖,与柳宗元合称韩柳。诗力求险怪新奇,雄浑重气势。}。 + + +\section{封面相关} +封面的例子请参看 \texttt{cover.tex}。主要符号表参看 \texttt{denotation.tex},附录和 +个人简历分别参看 \texttt{appendix01.tex} 和 \texttt{resume.tex}。里面的命令都很直 +观,一看即会\footnote{你说还是看不懂?怎么会呢?}。 + +\section{字体命令} +\label{sec:first} + +苏轼(1037-1101),北宋文学家、书画家。字子瞻,号东坡居士,眉州眉山(今属四川)人 +。苏洵子。嘉佑进士。神宗时曾任祠部员外郎,因反对王安石新法而求外职,任杭州通判, +知密州、徐州、湖州。后以作诗“谤讪朝廷”罪贬黄州。哲宗时任翰林学士,曾出知杭州、 +颖州等,官至礼部尚书。后又贬谪惠州、儋州。北还后第二年病死常州。南宋时追谥文忠。 +与父洵弟辙,合称“三苏”。在政治上属于旧党,但也有改革弊政的要求。其文汪洋恣肆, +明白畅达,为“唐宋八大家”之一。 其诗清新豪健,善用夸张比喻,在艺术表现方面独具 +风格。少数诗篇也能反映民间疾苦,指责统治者的奢侈骄纵。词开豪放一派,对后代很有影 +响。《念奴娇·赤壁怀古》、《水调歌头·丙辰中秋》传诵甚广。 + +{\kaishu 坡仙擅长行书、楷书,取法李邕、徐浩、颜真卿、杨凝式,而能自创新意。用笔丰腴 + 跌宕,有天真烂漫之趣。与蔡襄、黄庭坚、米芾并称“宋四家”。能画竹,学文同,也喜 + 作枯木怪石。论画主张“神似”,认为“论画以形似,见与儿童邻”;高度评价“诗中有 + 画,画中有诗”的艺术造诣。诗文有《东坡七集》等。存世书迹有《答谢民师论文帖》、 + 《祭黄几道文》、《前赤壁赋》、《黄州寒食诗帖》等。 画迹有《枯木怪石图》、《 + 竹石图》等。} + +{\fangsong 易与天地准,故能弥纶天地之道。仰以观於天文,俯以察於地理,是故知幽明之故。原 + 始反终,故知死生之说。精气为物,游魂为变,是故知鬼神之情状。与天地相似,故不违。 + 知周乎万物,而道济天下,故不过。旁行而不流,乐天知命,故不忧。安土敦乎仁,故 + 能爱。范围天地之化而不过,曲成万物而不遗,通乎昼夜之道而知,故神无方而易无体。} + +% 非本科生一般用不到幼圆与隶书字体。需要的同学请查看 ctex 文档。 +{\ifcsname youyuan\endcsname\youyuan\else[无 \cs{youyuan} 字体。]\fi 有天地,然后 + 万物生焉。盈天地之间者,唯万物,故受之以屯;屯者盈也,屯者物之始生也。物生必蒙, + 故受之以蒙;蒙者蒙也,物之穉也。物穉不可不养也,故受之以需;需者饮食之道也。饮 + 食必有讼,故受之以讼。讼必有众起,故受之以师;师者众也。众必有所比,故受之以比; + 比者比也。比必有所畜也,故受之以小畜。物畜然后有礼,故受之以履。} + +{\heiti 履而泰,然后安,故受之以泰;泰者通也。物不可以终通,故受之以否。物不可以终 + 否,故受之以同人。与人同者,物必归焉,故受之以大有。有大者不可以盈,故受之以谦。 + 有大而能谦,必豫,故受之以豫。豫必有随,故受之以随。以喜随人者,必有事,故受 + 之以蛊;蛊者事也。} + +{\ifcsname lishu\endcsname\lishu\else[无 \cs{lishu} 字体。]\fi 有事而后可大,故受 + 之以临;临者大也。物大然后可观,故受之以观。可观而后有所合,故受之以噬嗑;嗑者 + 合也。物不可以苟合而已,故受之以贲;贲者饰也。致饰然后亨,则尽矣,故受之以剥; + 剥者剥也。物不可以终尽,剥穷上反下,故受之以复。复则不妄矣,故受之以无妄。} + +{\songti 有无妄然后可畜,故受之以大畜。物畜然后可养,故受之以颐;颐者养也。不养则不 + 可动,故受之以大过。物不可以终过,故受之以坎;坎者陷也。陷必有所丽,故受之以 + 离;离者丽也。} + +\section{表格样本} +\label{chap1:sample:table} + +\subsection{基本表格} +\label{sec:basictable} + +模板中关于表格的宏包有三个:\pkg{booktabs}、\pkg{array} 和 \pkg{longtabular},命 +令有一个 \cs{hlinewd}。三线表可以用 \pkg{booktabs} 提供 +的 \cs{toprule}、\cs{midrule} 和 \cs{bottomrule}。它们与 \pkg{longtable} 能很好的 +配合使用。如果表格比较简单的话可以直接用命令 \cs{hlinewd}\marg{width} 控制。 +\begin{table}[htb] + \centering + \begin{minipage}[t]{0.8\linewidth} % 如果想在表格中使用脚注,minipage是个不错的办法 + \caption[模板文件]{模板文件。如果表格的标题很长,那么在表格索引中就会很不美 + 观,所以要像 chapter 那样在前面用中括号写一个简短的标题。这个标题会出现在索 + 引中。} + \label{tab:template-files} + \begin{tabularx}{\linewidth}{lX} + \toprule[1.5pt] + {\heiti 文件名} & {\heiti 描述} \\\midrule[1pt] + thuthesis.ins & \LaTeX{} 安装文件,\textsc{DocStrip}\footnote{表格中的脚注} \\ + thuthesis.dtx & 所有的一切都在这里面\footnote{再来一个}。\\ + thuthesis.cls & 模板类文件。\\ + thuthesis.cfg & 模板配置文。cls 和 cfg 由前两个文件生成。\\ + thuthesis-numeric.bst & 参考文献 BIB\TeX\ 样式文件。\\ + thuthesis-author-year.bst & 参考文献 BIB\TeX\ 样式文件。\\ + thuthesis.sty & 常用的包和命令写在这里,减轻主文件的负担。\\ + \bottomrule[1.5pt] + \end{tabularx} + \end{minipage} +\end{table} + +首先来看一个最简单的表格。表 \ref{tab:template-files} 列举了本模板主要文件及其功 +能。请大家注意三线表中各条线对应的命令。这个例子还展示了如何在表格中正确使用脚注。 +由于 \LaTeX{} 本身不支持在表格中使用 \cs{footnote},所以我们不得不将表格放在 +小页中,而且最好将表格的宽度设置为小页的宽度,这样脚注看起来才更美观。 + +\subsection{复杂表格} +\label{sec:complicatedtable} + +我们经常会在表格下方标注数据来源,或者对表格里面的条目进行解释。前面的脚注是一种 +不错的方法,如果不喜欢脚注,可以在表格后面写注释,比如表~\ref{tab:tabexamp1}。 +\begin{table}[htbp] + \centering + \caption{复杂表格示例 1。这个引用 \cite{tex} 不会导致编号混乱。} + \label{tab:tabexamp1} + \begin{minipage}[t]{0.8\textwidth} + \begin{tabularx}{\linewidth}{|l|X|X|X|X|} + \hline + \multirow{2}*{\diagbox[width=5em]{x}{y}} & \multicolumn{2}{c|}{First Half} & \multicolumn{2}{c|}{Second Half}\\\cline{2-5} + & 1st Qtr &2nd Qtr&3rd Qtr&4th Qtr \\ \hline + East$^{*}$ & 20.4& 27.4& 90& 20.4 \\ + West$^{**}$ & 30.6 & 38.6 & 34.6 & 31.6 \\ \hline + \end{tabularx}\\[2pt] + \footnotesize 注:数据来源《NJUrepo{} 使用手册》。\\ + *:东部\\ + **:西部 + \end{minipage} +\end{table} + +此外,表~\ref{tab:tabexamp1} 同时还演示了另外两个功能:1)通过 \pkg{tabularx} 的 + \texttt{|X|} 扩展实现表格自动放大;2)通过命令 \cs{diagbox} 在表头部分 +插入反斜线。 + +为了使我们的例子更接近实际情况,我会在必要的时候插入一些“无关”文字,以免太多图 +表同时出现,导致排版效果不太理想。第一个出场的当然是我的最爱:风流潇洒、骏马绝尘、 +健笔凌云的{\heiti 李太白}了。 + +李白,字太白,陇西成纪人。凉武昭王暠九世孙。或曰山东人,或曰蜀人。白少有逸才,志 +气宏放,飘然有超世之心。初隐岷山,益州长史苏颋见而异之,曰:“是子天才英特,可比 +相如。”天宝初,至长安,往见贺知章。知章见其文,叹曰:“子谪仙人也。”言于明皇, +召见金銮殿,奏颂一篇。帝赐食,亲为调羹,有诏供奉翰林。白犹与酒徒饮于市,帝坐沉香 +亭子,意有所感,欲得白为乐章,召入,而白已醉。左右以水颒面,稍解,援笔成文,婉丽 +精切。帝爱其才,数宴见。白常侍帝,醉,使高力士脱靴。力士素贵,耻之,摘其诗以激杨 +贵妃。帝欲官白,妃辄沮止。白自知不为亲近所容,恳求还山。帝赐金放还。乃浪迹江湖, +终日沉饮。永王璘都督江陵,辟为僚佐。璘谋乱,兵败,白坐长流夜郎,会赦得还。族人阳 +冰为当涂令,白往依之。代宗立,以左拾遗召,而白已卒。文宗时,诏以白歌诗、裴旻剑舞、 +张旭草书为三绝云。集三十卷。今编诗二十五卷。\hfill —— 《全唐诗》诗人小传 + +浮动体的并排放置一般有两种情况:1)二者没有关系,为两个独立的浮动体;2)二者隶属 +于同一个浮动体。对表格来说并排表格既可以像图~\ref{tab:parallel1}、 +图~\ref{tab:parallel2} 使用小页环境,也可以如图~\ref{tab:subtable} 使用子表格来做。 +图的例子参见第~\ref{sec:multifig} 节。 + +\begin{table}[htbp] +\noindent\begin{minipage}{0.5\textwidth} +\centering +\caption{第一个并排子表格} +\label{tab:parallel1} +\begin{tabular}{p{2cm}p{2cm}} +\toprule[1.5pt] +111 & 222 \\\midrule[1pt] +222 & 333 \\\bottomrule[1.5pt] +\end{tabular} +\end{minipage}% +\begin{minipage}{0.5\textwidth} +\centering +\caption{第二个并排子表格} +\label{tab:parallel2} +\begin{tabular}{p{2cm}p{2cm}} +\toprule[1.5pt] +111 & 222 \\\midrule[1pt] +222 & 333 \\\bottomrule[1.5pt] +\end{tabular} +\end{minipage} +\end{table} + +然后就是忧国忧民,诗家楷模杜工部了。杜甫,字子美,其先襄阳人,曾祖依艺为巩令,因 +居巩。甫天宝初应进士,不第。后献《三大礼赋》,明皇奇之,召试文章,授京兆府兵曹参 +军。安禄山陷京师,肃宗即位灵武,甫自贼中遁赴行在,拜左拾遗。以论救房琯,出为华州 +司功参军。关辅饥乱,寓居同州同谷县,身自负薪采梠,餔糒不给。久之,召补京兆府功曹, +道阻不赴。严武镇成都,奏为参谋、检校工部员外郎,赐绯。武与甫世旧,待遇甚厚。乃于 +成都浣花里种竹植树,枕江结庐,纵酒啸歌其中。武卒,甫无所依,乃之东蜀就高適。既至 +而適卒。是岁,蜀帅相攻杀,蜀大扰。甫携家避乱荆楚,扁舟下峡,未维舟而江陵亦乱。乃 +溯沿湘流,游衡山,寓居耒阳。卒年五十九。元和中,归葬偃师首阳山,元稹志其墓。天宝 +间,甫与李白齐名,时称李杜。然元稹之言曰:“李白壮浪纵恣,摆去拘束,诚亦差肩子美 +矣。至若铺陈终始,排比声韵,大或千言,次犹数百,词气豪迈,而风调清深,属对律切, +而脱弃凡近,则李尚不能历其藩翰,况堂奥乎。”白居易亦云:“杜诗贯穿古今, 尽工尽 +善,殆过于李。”元、白之论如此。盖其出处劳佚,喜乐悲愤,好贤恶恶,一见之于诗。而 +又以忠君忧国、伤时念乱为本旨。读其诗可以知其世,故当时谓之“诗史”。旧集诗文共六 +十卷,今编诗十九卷。 + +\begin{table}[htbp] +\centering +\caption{并排子表格} +\label{tab:subtable} +\subcaptionbox{第一个子表格} +{ +\begin{tabular}{p{2cm}p{2cm}} +\toprule[1.5pt] +111 & 222 \\\midrule[1pt] +222 & 333 \\\bottomrule[1.5pt] +\end{tabular} +} +\hskip2cm +\subcaptionbox{第二个子表格} +{ +\begin{tabular}{p{2cm}p{2cm}} +\toprule[1.5pt] +111 & 222 \\\midrule[1pt] +222 & 333 \\\bottomrule[1.5pt] +\end{tabular} +} +\end{table} + +不可否认 \LaTeX{} 的表格功能没有想象中的那么强大,不过只要足够认真,足够细致, +同样可以排出来非常复杂非常漂亮的表格。请参看表~\ref{tab:tabexamp2}。 +\begin{table}[htbp] + \centering\dawu[1.3] + \caption{复杂表格示例 2} + \label{tab:tabexamp2} + \begin{tabular}[c]{|m{1.5cm}|c|c|c|c|c|c|}\hline + \multicolumn{2}{|c|}{Network Topology} & \# of nodes & + \multicolumn{3}{c|}{\# of clients} & Server \\\hline + GT-ITM & Waxman Transit-Stub & 600 & + \multirow{2}{1em}{2\%}& + \multirow{2}{1.5em}{10\%}& + \multirow{2}{1.5em}{50\%}& + \multirow{2}{1.2in}{Max. Connectivity}\\\cline{1-3} + \multicolumn{2}{|c|}{Inet-2.1} & 6000 & & & &\\\hline + \multirow{2}{1.5cm}{Xue} & Rui & Ni &\multicolumn{4}{c|}{\multirow{2}*{NJUrepo}}\\\cline{2-3} + & \multicolumn{2}{c|}{ABCDEF} &\multicolumn{4}{c|}{} \\\hline +\end{tabular} +\end{table} + +最后就是清新飘逸、文约意赅、空谷绝响的王大侠了。王维,字摩诘,河东人。工书画,与 +弟缙俱有俊才。开元九年,进士擢第,调太乐丞。坐累为济州司仓参军,历右拾遗、监察御 +史、左补阙、库部郎中,拜吏部郎中。天宝末,为给事中。安禄山陷两都,维为贼所得,服 +药阳喑,拘于菩提寺。禄山宴凝碧池,维潜赋诗悲悼,闻于行在。贼平,陷贼官三等定罪, +特原之,责授太子中允,迁中庶子、中书舍人。复拜给事中,转尚书右丞。维以诗名盛于开 +元、天宝间,宁薛诸王驸马豪贵之门,无不拂席迎之。得宋之问辋川别墅,山水绝胜,与道 +友裴迪,浮舟往来,弹琴赋诗,啸咏终日。笃于奉佛,晚年长斋禅诵。一日,忽索笔作书 +数纸,别弟缙及平生亲故,舍笔而卒。赠秘书监。宝应中,代宗问缙:“朕常于诸王坐闻维 +乐章,今存几何?”缙集诗六卷,文四卷,表上之。敕答云,卿伯氏位列先朝,名高希代。 +抗行周雅,长揖楚辞。诗家者流,时论归美。克成编录,叹息良深。殷璠谓维诗词秀调雅, +意新理惬。在泉成珠,著壁成绘。苏轼亦云:“维诗中有画,画中有诗也。”今编诗四卷。 + +要想用好论文模板还是得提前学习一些 \TeX/\LaTeX{}的相关知识,具备一些基本能力,掌 +握一些常见技巧,否则一旦遇到问题还真是比较麻烦。我们见过很多这样的同学,一直以来 +都是使用 Word 等字处理工具,以为 \LaTeX{}模板的用法也应该类似,所以就沿袭同样的思 +路来对待这种所见非所得的排版工具,结果被折腾的焦头烂额,疲惫不堪。 + +如果您要排版的表格长度超过一页,那么推荐使用 \pkg{longtable} 或者 \pkg{supertabular} +宏包,模板对 \pkg{longtable} 进行了相应的设置,所以用起来可能简单一些。 +表~\ref{tab:performance} 就是 \pkg{longtable} 的简单示例。 +\begin{longtable}[c]{c*{6}{r}} +\caption{实验数据}\label{tab:performance}\\ +\toprule[1.5pt] + 测试程序 & \multicolumn{1}{c}{正常运行} & \multicolumn{1}{c}{同步} & \multicolumn{1}{c}{检查点} & \multicolumn{1}{c}{卷回恢复} +& \multicolumn{1}{c}{进程迁移} & \multicolumn{1}{c}{检查点} \\ +& \multicolumn{1}{c}{时间 (s)}& \multicolumn{1}{c}{时间 (s)}& +\multicolumn{1}{c}{时间 (s)}& \multicolumn{1}{c}{时间 (s)}& \multicolumn{1}{c}{ + 时间 (s)}& 文件(KB)\\\midrule[1pt] +\endfirsthead +\multicolumn{7}{c}{续表~\thetable\hskip1em 实验数据}\\ +\toprule[1.5pt] + 测试程序 & \multicolumn{1}{c}{正常运行} & \multicolumn{1}{c}{同步} & \multicolumn{1}{c}{检查点} & \multicolumn{1}{c}{卷回恢复} +& \multicolumn{1}{c}{进程迁移} & \multicolumn{1}{c}{检查点} \\ +& \multicolumn{1}{c}{时间 (s)}& \multicolumn{1}{c}{时间 (s)}& +\multicolumn{1}{c}{时间 (s)}& \multicolumn{1}{c}{时间 (s)}& \multicolumn{1}{c}{ + 时间 (s)}& 文件(KB)\\\midrule[1pt] +\endhead +\hline +\multicolumn{7}{r}{续下页} +\endfoot +\endlastfoot +CG.A.2 & 23.05 & 0.002 & 0.116 & 0.035 & 0.589 & 32491 \\ +CG.A.4 & 15.06 & 0.003 & 0.067 & 0.021 & 0.351 & 18211 \\ +CG.A.8 & 13.38 & 0.004 & 0.072 & 0.023 & 0.210 & 9890 \\ +CG.B.2 & 867.45 & 0.002 & 0.864 & 0.232 & 3.256 & 228562 \\ +CG.B.4 & 501.61 & 0.003 & 0.438 & 0.136 & 2.075 & 123862 \\ +CG.B.8 & 384.65 & 0.004 & 0.457 & 0.108 & 1.235 & 63777 \\ +MG.A.2 & 112.27 & 0.002 & 0.846 & 0.237 & 3.930 & 236473 \\ +MG.A.4 & 59.84 & 0.003 & 0.442 & 0.128 & 2.070 & 123875 \\ +MG.A.8 & 31.38 & 0.003 & 0.476 & 0.114 & 1.041 & 60627 \\ +MG.B.2 & 526.28 & 0.002 & 0.821 & 0.238 & 4.176 & 236635 \\ +MG.B.4 & 280.11 & 0.003 & 0.432 & 0.130 & 1.706 & 123793 \\ +MG.B.8 & 148.29 & 0.003 & 0.442 & 0.116 & 0.893 & 60600 \\ +LU.A.2 & 2116.54 & 0.002 & 0.110 & 0.030 & 0.532 & 28754 \\ +LU.A.4 & 1102.50 & 0.002 & 0.069 & 0.017 & 0.255 & 14915 \\ +LU.A.8 & 574.47 & 0.003 & 0.067 & 0.016 & 0.192 & 8655 \\ +LU.B.2 & 9712.87 & 0.002 & 0.357 & 0.104 & 1.734 & 101975 \\ +LU.B.4 & 4757.80 & 0.003 & 0.190 & 0.056 & 0.808 & 53522 \\ +LU.B.8 & 2444.05 & 0.004 & 0.222 & 0.057 & 0.548 & 30134 \\ +EP.A.2 & 123.81 & 0.002 & 0.010 & 0.003 & 0.074 & 1834 \\ +EP.A.4 & 61.92 & 0.003 & 0.011 & 0.004 & 0.073 & 1743 \\ +EP.A.8 & 31.06 & 0.004 & 0.017 & 0.005 & 0.073 & 1661 \\ +EP.B.2 & 495.49 & 0.001 & 0.009 & 0.003 & 0.196 & 2011 \\ +EP.B.4 & 247.69 & 0.002 & 0.012 & 0.004 & 0.122 & 1663 \\ +EP.B.8 & 126.74 & 0.003 & 0.017 & 0.005 & 0.083 & 1656 \\ +\bottomrule[1.5pt] +\end{longtable} + +\subsection{其它} +\label{sec:tableother} +如果不想让某个表格或者图片出现在索引里面,请使用命令 \cs{caption*}。 +这个命令不会给表格编号,也就是出来的只有标题文字而没有“表~XX”,“图~XX”,否则 +索引里面序号不连续就显得不伦不类,这也是 \LaTeX{} 里星号命令默认的规则。 + +有这种需求的多是本科同学的英文资料翻译部分,如果觉得附录中英文原文中的表格和图 +片显示成“表”和“图”不协调的话,一个很好的办法就是用 \cs{caption*},参数 +随便自己写,比如不守规矩的表~1.111 和图~1.111 能满足这种特殊需要(可以参看附录部 +分)。 +\begin{table}[ht] + \begin{minipage}{0.4\linewidth} + \centering + \caption*{表~1.111\quad 这是一个手动编号,不出现在索引中的表格。} + \label{tab:badtabular} + \framebox(150,50)[c]{NJUrepo} + \end{minipage}% + \hfill% + \begin{minipage}{0.4\linewidth} + \centering + \caption*{Figure~1.111\quad 这是一个手动编号,不出现在索引中的图。} + \label{tab:badfigure} + \framebox(150,50)[c]{薛瑞尼} + \end{minipage} +\end{table} + +如果的确想让它编号,但又不想让它出现在索引中的话,目前模板上不支持。 + +最后,虽然大家不一定会独立使用小页,但是关于小页中的脚注还是有必要提一下。请看下 +面的例子。 + +\begin{minipage}[t]{\linewidth-2\parindent} + 柳宗元,字子厚(773-819),河东(今永济县)人\footnote{山西永济水饺。},是唐代 + 杰出的文学家,哲学家,同时也是一位政治改革家。与韩愈共同倡导唐代古文运动,并称 + 韩柳\footnote{唐宋八大家之首二位。}。 +\end{minipage} + +唐朝安史之乱后,宦官专权,藩镇割据,土地兼并日渐严重,社会生产破坏严重,民不聊生。柳宗 +元对这种社会现实极为不满,他积极参加了王叔文领导的“永济革新”,并成为这一 +运动的中坚人物。他们革除弊政,打击权奸,触犯了宦官和官僚贵族利益,在他们的联合反 +扑下,改革失败了,柳宗元被贬为永州司马。 + +\section{定理环境} +\label{sec:theorem} + +给大家演示一下各种和证明有关的环境: + +\begin{assumption} +待月西厢下,迎风户半开;隔墙花影动,疑是玉人来。 +\begin{align} + \label{eq:eqnxmp} + c & = a^2 - b^2 \\ + & = (a+b)(a-b) +\end{align} +\end{assumption} + +千辛万苦,历尽艰难,得有今日。然相从数千里,未曾哀戚。今将渡江,方图百年欢笑,如 +何反起悲伤?(引自《杜十娘怒沉百宝箱》) + +\begin{definition} +子曰:「道千乘之国,敬事而信,节用而爱人,使民以时。」 +\end{definition} + +千古第一定义!问世间、情为何物,只教生死相许?天南地北双飞客,老翅几回寒暑。欢乐趣,离别苦,就中更有痴儿女。 +君应有语,渺万里层云,千山暮雪,只影向谁去? + +横汾路,寂寞当年箫鼓,荒烟依旧平楚。招魂楚些何嗟及,山鬼暗谛风雨。天也妒,未信与,莺儿燕子俱黄土。 +千秋万古,为留待骚人,狂歌痛饮,来访雁丘处。 + +\begin{proposition} + 曾子曰:「吾日三省吾身 —— 为人谋而不忠乎?与朋友交而不信乎?传不习乎?」 +\end{proposition} + +多么凄美的命题啊!其日牛马嘶,新妇入青庐,奄奄黄昏后,寂寂人定初,我命绝今日, +魂去尸长留,揽裙脱丝履,举身赴清池,府吏闻此事,心知长别离,徘徊庭树下,自挂东南 +枝。 + +\begin{remark} +天不言自高,水不言自流。 +\begin{gather*} +\begin{split} +\varphi(x,z) +&=z-\gamma_{10}x-\gamma_{mn}x^mz^n\\ +&=z-Mr^{-1}x-Mr^{-(m+n)}x^mz^n +\end{split}\\[6pt] +\begin{align} \zeta^0&=(\xi^0)^2,\\ +\zeta^1 &=\xi^0\xi^1,\\ +\zeta^2 &=(\xi^1)^2, +\end{align} +\end{gather*} +\end{remark} + +天尊地卑,乾坤定矣。卑高以陈,贵贱位矣。 动静有常,刚柔断矣。方以类聚,物以群分, +吉凶生矣。在天成象,在地成形,变化见矣。鼓之以雷霆,润之以风雨,日月运行,一寒一 +暑,乾道成男,坤道成女。乾知大始,坤作成物。乾以易知,坤以简能。易则易知,简则易 +从。易知则有亲,易从则有功。有亲则可久,有功则可大。可久则贤人之德,可大则贤人之 +业。易简,而天下矣之理矣;天下之理得,而成位乎其中矣。 + +\begin{axiom} +两点间直线段距离最短。 +\begin{align} +x&\equiv y+1\pmod{m^2}\\ +x&\equiv y+1\mod{m^2}\\ +x&\equiv y+1\pod{m^2} +\end{align} +\end{axiom} + +《彖曰》:大哉乾元,万物资始,乃统天。云行雨施,品物流形。大明始终,六位时成,时 +乘六龙以御天。乾道变化,各正性命,保合大和,乃利贞。首出庶物,万国咸宁。 + +《象曰》:天行健,君子以自强不息。潜龙勿用,阳在下也。见龙再田,德施普也。终日乾 +乾,反复道也。或跃在渊,进无咎也。飞龙在天,大人造也。亢龙有悔,盈不可久也。用九, +天德不可为首也。    + +\newcommand\dif{\mathop{}\!\mathrm{d}} +\begin{lemma} +《猫和老鼠》是我最爱看的动画片。 +\begin{multline*}%\tag*{[a]} % 这个不出现在索引中 +\int_a^b\biggl\{\int_a^b[f(x)^2g(y)^2+f(y)^2g(x)^2] + -2f(x)g(x)f(y)g(y)\dif x\biggr\}\dif y \\ + =\int_a^b\biggl\{g(y)^2\int_a^bf^2+f(y)^2 + \int_a^b g^2-2f(y)g(y)\int_a^b fg\biggr\}\dif y +\end{multline*} +\end{lemma} + +行行重行行,与君生别离。相去万余里,各在天一涯。道路阻且长,会面安可知。胡马依北 +风,越鸟巢南枝。相去日已远,衣带日已缓。浮云蔽白日,游子不顾返。思君令人老,岁月 +忽已晚。 弃捐勿复道,努力加餐饭。 + +\begin{theorem}\label{the:theorem1} +犯我强汉者,虽远必诛\hfill —— 陈汤(汉) +\end{theorem} +\begin{subequations} +\begin{align} +y & = 1 \\ +y & = 0 +\end{align} +\end{subequations} +道可道,非常道。名可名,非常名。无名天地之始;有名万物之母。故常无,欲以观其妙; +常有,欲以观其徼。此两者,同出而异名,同谓之玄。玄之又玄,众妙之门。上善若水。水 +善利万物而不争,处众人之所恶,故几于道。曲则全,枉则直,洼则盈,敝则新,少则多, +多则惑。人法地,地法天,天法道,道法自然。知人者智,自知者明。胜人者有力,自胜 +者强。知足者富。强行者有志。不失其所者久。死而不亡者寿。 + +\begin{proof} +燕赵古称多感慨悲歌之士。董生举进士,连不得志于有司,怀抱利器,郁郁适兹土,吾 +知其必有合也。董生勉乎哉? + +夫以子之不遇时,苟慕义强仁者,皆爱惜焉,矧燕、赵之士出乎其性者哉!然吾尝闻 +风俗与化移易,吾恶知其今不异于古所云邪?聊以吾子之行卜之也。董生勉乎哉? + +吾因子有所感矣。为我吊望诸君之墓,而观于其市,复有昔时屠狗者乎?为我谢 +曰:“明天子在上,可以出而仕矣!” \hfill —— 韩愈《送董邵南序》 +\end{proof} + +\begin{corollary} + 四川话配音的《猫和老鼠》是世界上最好看最好听最有趣的动画片。 +\begin{alignat}{3} +V_i & =v_i - q_i v_j, & \qquad X_i & = x_i - q_i x_j, + & \qquad U_i & = u_i, + \qquad \text{for $i\ne j$;}\label{eq:B}\\ +V_j & = v_j, & \qquad X_j & = x_j, + & \qquad U_j & u_j + \sum_{i\ne j} q_i u_i. +\end{alignat} +\end{corollary} + +迢迢牵牛星,皎皎河汉女。 +纤纤擢素手,札札弄机杼。 +终日不成章,泣涕零如雨。 +河汉清且浅,相去复几许。 +盈盈一水间,脉脉不得语。 + +\begin{example} + 大家来看这个例子。 +\begin{equation} +\label{ktc} +\left\{\begin{array}{l} +\nabla f({\mbox{\boldmath $x$}}^*)-\sum\limits_{j=1}^p\lambda_j\nabla g_j({\mbox{\boldmath $x$}}^*)=0\\[0.3cm] +\lambda_jg_j({\mbox{\boldmath $x$}}^*)=0,\quad j=1,2,\cdots,p\\[0.2cm] +\lambda_j\ge 0,\quad j=1,2,\cdots,p. +\end{array}\right. +\end{equation} +\end{example} + +\begin{exercise} + 请列出 Andrew S. Tanenbaum 和 W. Richard Stevens 的所有著作。 +\end{exercise} + +\begin{conjecture} \textit{Poincare Conjecture} If in a closed three-dimensional + space, any closed curves can shrink to a point continuously, this space can be + deformed to a sphere. +\end{conjecture} + +\begin{problem} + 回答还是不回答,是个问题。 +\end{problem} + +如何引用定理~\ref{the:theorem1} 呢?加上 \cs{label} 使用 \cs{ref} 即可。妾发 +初覆额,折花门前剧。郎骑竹马来,绕床弄青梅。同居长干里,两小无嫌猜。 十四为君妇, +羞颜未尝开。低头向暗壁,千唤不一回。十五始展眉,愿同尘与灰。常存抱柱信,岂上望夫 +台。 十六君远行,瞿塘滟滪堆。五月不可触,猿声天上哀。门前迟行迹,一一生绿苔。苔深 +不能扫,落叶秋风早。八月蝴蝶来,双飞西园草。感此伤妾心,坐愁红颜老。 + +\section{参考文献} +\label{sec:bib} +当然参考文献可以直接写 \cs{bibitem},虽然费点功夫,但是好控制,各种格式可以自己随意改 +写。 + +本模板推荐使用 BIB\TeX,分别提供数字引用(\texttt{thuthesis-numeric.bst})和作 +者年份引用(\texttt{thuthesis-author-year.bst})样式,基本符合学校的参考文献格式 +(如专利等引用未加详细测试)。看看这个例子,关于书的~\cite{tex, companion, + ColdSources},还有这些~\cite{Krasnogor2004e, clzs, zjsw},关于杂志 +的~\cite{ELIDRISSI94, MELLINGER96, SHELL02},硕士论文~\cite{zhubajie, + metamori2004},博士论文~\cite{shaheshang, FistSystem01},标准文 +件~\cite{IEEE-1363},会议论文~\cite{DPMG,kocher99},技术报告~\cite{NPB2},电子文 +献~\cite{chuban2001,oclc2000}。 +若使用著者-出版年制,中文参考文献~\cite{cnarticle}应增加 +\texttt{key=\{pinyin\}} 字段,以便正确进行排序~\cite{cnproceed}。 +另外,如果对参考文献有不如意的地方,请手动修改 \texttt{bbl} 文件。 + +有时候不想要上标,那么可以这样~\inlinecite{shaheshang},这个非常重要。 + +有时候一些参考文献没有纸质出处,需要标注 URL。缺省情况下,URL 不会在连字符处断行, +这可能使得用连字符代替空格的网址分行很难看。如果需要,可以将模板类文件中 +\begin{verbatim} +\RequirePackage{hyperref} +\end{verbatim} +一行改为: +\begin{verbatim} +\PassOptionsToPackage{hyphens}{url} +\RequirePackage{hyperref} +\end{verbatim} +使得连字符处可以断行。更多设置可以参考 \texttt{url} 宏包文档。 + +\section{公式} +\label{sec:equation} +\renewcommand\vec{\symbf} +\newcommand\mat{\symbf} +贝叶斯公式如式~(\ref{equ:chap1:bayes}),其中 $p(y|\vec{x})$ 为后验; +$p(\vec{x})$ 为先验;分母 $p(\vec{x})$ 为归一化因子。 +\begin{equation} +\label{equ:chap1:bayes} +p(y|\vec{x}) = \frac{p(\vec{x},y)}{p(\vec{x})}= +\frac{p(\vec{x}|y)p(y)}{p(\vec{x})} +\end{equation} + +论文里面公式越多,\TeX{} 就越 happy。再看一个 \pkg{amsmath} 的例子: +\newcommand{\envert}[1]{\left\lvert#1\right\rvert} +\begin{equation}\label{detK2} +\det\mat{K}(t=1,t_1,\dots,t_n)=\sum_{I\in\vec{n}}(-1)^{\envert{I}} +\prod_{i\in I}t_i\prod_{j\in I}(D_j+\lambda_jt_j)\det\vec{A} +^{(\lambda)}(\overline{I}|\overline{I})=0. +\end{equation} + +前面定理示例部分列举了很多公式环境,可以说把常见的情况都覆盖了,大家在写公式的时 +候一定要好好看 \pkg{amsmath} 的文档,并参考模板中的用法: +\begin{multline*}%\tag{[b]} % 这个出现在索引中的 +\int_a^b\biggl\{\int_a^b[f(x)^2g(y)^2+f(y)^2g(x)^2] + -2f(x)g(x)f(y)g(y)\dif x\biggr\}\dif y \\ + =\int_a^b\biggl\{g(y)^2\int_a^bf^2+f(y)^2 + \int_a^b g^2-2f(y)g(y)\int_a^b fg\biggr\}\dif y +\end{multline*} + +其实还可以看看这个多级规划: +\begin{equation}\label{bilevel} +\left\{\begin{array}{l} +\max\limits_{{\mbox{\footnotesize\boldmath $x$}}} F(x,y_1^*,y_2^*,\cdots,y_m^*)\\[0.2cm] +\mbox{subject to:}\\[0.1cm] +\qquad G(x)\le 0\\[0.1cm] +\qquad(y_1^*,y_2^*,\cdots,y_m^*)\mbox{ solves problems }(i=1,2,\cdots,m)\\[0.1cm] +\qquad\left\{\begin{array}{l} + \max\limits_{{\mbox{\footnotesize\boldmath $y_i$}}}f_i(x,y_1,y_2,\cdots,y_m)\\[0.2cm] + \mbox{subject to:}\\[0.1cm] + \qquad g_i(x,y_1,y_2,\cdots,y_m)\le 0. + \end{array}\right. +\end{array}\right. +\end{equation} +这些跟规划相关的公式都来自于刘宝碇老师《不确定规划》的课件。 diff --git a/test/chapter/cover.tex b/test/chapter/cover.tex new file mode 100644 index 0000000..3cf5088 --- /dev/null +++ b/test/chapter/cover.tex @@ -0,0 +1,42 @@ +\njusetup{ + %****************************** + % 注意: + % 1. 配置里面不要出现空行 + % 2. 不需要的配置信息可以删除 + %****************************** + % + %========= + % 中文信息 + %========= + ctitle={清华大学学位论文 \LaTeX\ 模板\\使用示例文档}, + csubtitle={通用报告模板}, + cdegree={工学硕士}, + cdepartment={计算机科学与技术系}, + cmajor={计算机科学与技术}, + cauthor={薛瑞尼}, + stdid={12345678}, + csupervisor={郑纬民教授}, + cassosupervisor={陈文光教授}, % 副指导老师 + ccosupervisor={某某某教授}, % 联合指导老师 + % 日期自动使用当前时间,若需指定按如下方式修改: + % cdate={超新星纪元}, + % + %========= + % 英文信息 + %========= + etitle={An Introduction to \LaTeX{} Thesis Template of Nanjing University v\version}, + esubtitle={subtile here}, + %esubsubtitle={Sub}, + edegree={Doctor of Engineering}, + emajor={Computer Science and Technology}, + eauthor={Xue Ruini}, + esupervisor={Professor Zheng Weimin}, + eassosupervisor={Chen Wenguang}, + % 日期自动生成,若需指定按如下方式修改: + % edate={December, 2005} + % + % 关键词用“英文逗号”分割 + ckeywords={\TeX, \LaTeX, CJK, 模板, 论文}, + ekeywords={\TeX, \LaTeX, CJK, template, thesis} +} + diff --git a/test/chapter/denotation.tex b/test/chapter/denotation.tex new file mode 100644 index 0000000..46d4172 --- /dev/null +++ b/test/chapter/denotation.tex @@ -0,0 +1,57 @@ +\begin{denotation}[3cm] +\item[HPC] 高性能计算 (High Performance Computing) +\item[cluster] 集群 +\item[Itanium] 安腾 +\item[SMP] 对称多处理 +\item[API] 应用程序编程接口 +\item[PI] 聚酰亚胺 +\item[MPI] 聚酰亚胺模型化合物,N-苯基邻苯酰亚胺 +\item[PBI] 聚苯并咪唑 +\item[MPBI] 聚苯并咪唑模型化合物,N-苯基苯并咪唑 +\item[PY] 聚吡咙 +\item[PMDA-BDA] 均苯四酸二酐与联苯四胺合成的聚吡咙薄膜 +\item[$\Delta G$] 活化自由能 (Activation Free Energy) +\item[$\chi$] 传输系数 (Transmission Coefficient) +\item[$E$] 能量 +\item[$m$] 质量 +\item[$c$] 光速 +\item[$P$] 概率 +\item[$T$] 时间 +\item[$v$] 速度 +\item[劝学] 君子曰:学不可以已。青,取之于蓝,而青于蓝;冰,水为之,而寒于水。木 + 直中绳。輮以为轮,其曲中规。虽有槁暴,不复挺者,輮使之然也。故木受绳则直,金就 + 砺则利,君子博学而日参省乎己,则知明而行无过矣。吾尝终日而思矣,不如须臾之所学 + 也;吾尝跂而望矣,不如登高之博见也。登高而招,臂非加长也,而见者远;顺风而呼, + 声非加疾也,而闻者彰。假舆马者,非利足也,而致千里;假舟楫者,非能水也,而绝江 + 河,君子生非异也,善假于物也。积土成山,风雨兴焉;积水成渊,蛟龙生焉;积善成德, + 而神明自得,圣心备焉。故不积跬步,无以至千里;不积小流,无以成江海。骐骥一跃, + 不能十步;驽马十驾,功在不舍。锲而舍之,朽木不折;锲而不舍,金石可镂。蚓无爪牙 + 之利,筋骨之强,上食埃土,下饮黄泉,用心一也。蟹六跪而二螯,非蛇鳝之穴无可寄托 + 者,用心躁也。—— 荀况 +\end{denotation} + + + +% % 也可以使用 nomencl 宏包: + +% \printnomenclature[3cm] + +% \nomenclature{HPC}{高性能计算 (High Performance Computing)} +% \nomenclature{cluster}{集群} +% \nomenclature{Itanium}{安腾} +% \nomenclature{SMP}{对称多处理} +% \nomenclature{API}{应用程序编程接口} +% \nomenclature{PI}{聚酰亚胺} +% \nomenclature{MPI}{聚酰亚胺模型化合物,N-苯基邻苯酰亚胺} +% \nomenclature{PBI}{聚苯并咪唑} +% \nomenclature{MPBI}{聚苯并咪唑模型化合物,N-苯基苯并咪唑} +% \nomenclature{PY}{聚吡咙} +% \nomenclature{PMDA-BDA}{均苯四酸二酐与联苯四胺合成的聚吡咙薄膜} +% \nomenclature{$\Delta G$}{活化自由能 (Activation Free Energy)} +% \nomenclature{$\chi$}{传输系数 (Transmission Coefficient)} +% \nomenclature{$E$}{能量} +% \nomenclature{$m$}{质量} +% \nomenclature{$c$}{光速} +% \nomenclature{$P$}{概率} +% \nomenclature{$T$}{时间} +% \nomenclature{$v$}{速度} diff --git a/test/chapter/numeric.bst b/test/chapter/numeric.bst new file mode 100644 index 0000000..22b56d6 --- /dev/null +++ b/test/chapter/numeric.bst @@ -0,0 +1,1748 @@ +%% +%% This is file `gbt7714-unsrt.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% gbt7714.dtx (with options: `numerical') +%% Version: 2018/05/26 v1.1 +%% +%% Copyright (C) 2016-2018 by Zeping Lee +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% https://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +INTEGERS { + uppercase.name + max.num.authors + period.between.author.year + sentence.case.title + print.mark + italic.jounal + print.missing.address.publisher + print.url + print.doi + print.note +} + +FUNCTION {init.options} +{ + #0 'uppercase.name := + #3 'max.num.authors := + #1 'period.between.author.year := + #1 'sentence.case.title := + #1 'print.mark := + #0 'italic.jounal := + #1 'print.missing.address.publisher := + #1 'print.url := + #0 'print.doi := + #0 'print.note := +} + +ENTRY + { address + author + booktitle + date + doi + edition + editor + howpublished + institution + journal + key + language + mark + medium + note + number + organization + pages + publisher + school + series + title + translator + url + urldate + volume + year + } + { entry.lang is.electronic } + { label extra.label sort.label short.list entry.mark entry.url } + +INTEGERS { output.state before.all mid.sentence after.sentence after.block after.slash } + +INTEGERS { lang.zh lang.ja lang.en lang.ru lang.other } + +INTEGERS { charptr len } + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := + #4 'after.slash := + #3 'lang.zh := + #4 'lang.ja := + #1 'lang.en := + #2 'lang.ru := + #0 'lang.other := +} + +FUNCTION {bbl.space} { "\ " } + +FUNCTION {bbl.wide.space} { bbl.space } + +FUNCTION {bbl.colon} { ": " } + +FUNCTION {bbl.slash} { "//\allowbreak{}" } + +FUNCTION {bbl.et.al} +{ lang.zh entry.lang = + { "等"} + { lang.ja entry.lang = + { "他"} + { lang.ru entry.lang = + { "идр" } + { "et~al." } + if$ + } + if$ + } + if$ +} + +FUNCTION {bbl.anonymous} +{ lang.zh entry.lang = + { "佚名" } + { "Anon" } + if$ +} + +FUNCTION {bbl.sine.loco} +{ lang.zh entry.lang = + { "[出版地不详]" } + { "[S.l.]" } + if$ +} + +FUNCTION {bbl.sine.nomine} +{ lang.zh entry.lang = + { "[出版者不详]" } + { "[s.n.]" } + if$ +} + +FUNCTION {bbl.sine.loco.sine.nomine} +{ lang.zh entry.lang = + { "[出版地不详: 出版者不详]" } + { "[S.l.: s.n.]" } + if$ +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +STRINGS { s t } + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { output.state after.slash = + { bbl.slash * write$ } + { add.period$ " " * write$ } + if$ + } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.after} +{ 't := + duplicate$ empty$ + 'pop$ + { 's := + output.state mid.sentence = + { t * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { output.state after.slash = + { bbl.slash * write$ } + { add.period$ " " * write$ } + if$ + } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s + } + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {fin.entry} +{ type$ "book" = + type$ "inbook" = or + type$ "incollection" = or + type$ "collection" = or + 'skip$ + 'add.period$ + if$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { output.state after.slash = + 'skip$ + { after.block 'output.state := } + if$ + } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { output.state after.slash = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ + } + if$ +} + +FUNCTION {new.slash} +{ output.state before.all = + 'skip$ + { after.slash 'output.state := } + if$ +} + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {italicize} +{ duplicate$ empty$ + { pop$ "" } + { "\textit{" swap$ * "}" * } + if$ +} + +INTEGERS { byte second.byte } + +INTEGERS { char.lang tmp.lang } + +STRINGS { tmp.str } + +FUNCTION {get.str.lang} +{ 'tmp.str := + lang.other 'tmp.lang := + #1 'charptr := + tmp.str text.length$ #1 + 'len := + { charptr len < } + { tmp.str charptr #1 substring$ chr.to.int$ 'byte := + byte #128 < + { charptr #1 + 'charptr := + byte #64 > byte #91 < and byte #96 > byte #123 < and or + { lang.en 'char.lang := } + { lang.other 'char.lang := } + if$ + } + { tmp.str charptr #1 + #1 substring$ chr.to.int$ 'second.byte := + byte #224 < + { charptr #2 + 'charptr := + byte #207 > byte #212 < and + byte #212 = second.byte #176 < and or + { lang.ru 'char.lang := } + { lang.other 'char.lang := } + if$ + } + { byte #240 < + { charptr #3 + 'charptr := + byte #227 > byte #234 < and + { lang.zh 'char.lang := } + { byte #227 = + { second.byte #143 > + { lang.zh 'char.lang := } + { second.byte #128 > second.byte #132 < and + { lang.ja 'char.lang := } + { lang.other 'char.lang := } + if$ + } + if$ + } + { byte #239 = + second.byte #163 > second.byte #172 < and and + { lang.zh 'char.lang := } + { lang.other 'char.lang := } + if$ + } + if$ + } + if$ + } + { charptr #4 + 'charptr := + byte #240 = second.byte #159 > and + { lang.zh 'char.lang := } + { lang.other 'char.lang := } + if$ + } + if$ + } + if$ + } + if$ + char.lang tmp.lang > + { char.lang 'tmp.lang := } + 'skip$ + if$ + } + while$ + tmp.lang +} + +FUNCTION {check.entry.lang} +{ author field.or.null + title field.or.null * + get.str.lang +} + +FUNCTION {set.entry.lang} +{ language empty$ + { check.entry.lang } + { language "english" = language "american" = or language "british" = or + { lang.en } + { language "chinese" = + { lang.zh } + { language "japanese" = + { lang.ja } + { language "russian" = + { lang.ru } + { check.entry.lang } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + 'entry.lang := +} + +INTEGERS { nameptr namesleft numnames name.lang } + +FUNCTION {format.names} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't := + nameptr max.num.authors #1 + = + { bbl.et.al + #1 'namesleft := + } + { t "others" = + { bbl.et.al } + { t get.str.lang 'name.lang := + name.lang lang.en = + { t #1 "{vv~}{ll}{~f{~}}" format.name$ + uppercase.name + { "u" change.case$ } + 'skip$ + if$ + t #1 "{, jj}" format.name$ * + } + { t #1 "{ll}{ff}" format.name$ } + if$ + } + if$ + } + if$ + nameptr #1 > + { ", " swap$ * * } + 'skip$ + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author empty$ + { "" } + { author format.names } + if$ +} + +FUNCTION {format.editors} +{ editor empty$ + { "" } + { editor format.names } + if$ +} + +FUNCTION {format.translators} +{ translator empty$ + { "" } + { translator format.names + lang.zh entry.lang = + { translator num.names$ #3 > + { "译" * } + { ", 译" * } + if$ + } + 'skip$ + if$ + } + if$ +} + +FUNCTION {format.full.names} +{'s := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't := + t get.str.lang 'name.lang := + name.lang lang.en = + { t #1 "{vv~}{ll}" format.name$ 't := } + { t #1 "{ll}{ff}" format.name$ 't := } + if$ + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { " et~al." * } + { " and " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {author.editor.full} +{ author empty$ + { editor empty$ + { "" } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.full} +{ author empty$ + { "" } + { author format.full.names } + if$ +} + +FUNCTION {editor.full} +{ editor empty$ + { "" } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.full + { type$ "collection" = + type$ "proceedings" = + or + 'editor.full + 'author.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { title + entry.lang lang.en = sentence.case.title and + { "t" change.case$ } + 'skip$ + if$ + } + if$ +} + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {is.digit} +{ duplicate$ empty$ + { pop$ #0 } + { chr.to.int$ + duplicate$ "0" chr.to.int$ < + { pop$ #0 } + { "9" chr.to.int$ > + { #0 } + { #1 } + if$ + } + if$ + } + if$ +} + +FUNCTION {is.number} +{ 's := + s empty$ + { #0 } + { s text.length$ 'charptr := + { charptr #0 > + s charptr #1 substring$ is.digit + and + } + { charptr #1 - 'charptr := } + while$ + charptr not + } + if$ +} + +FUNCTION {format.volume} +{ volume empty$ + { "" } + { lang.zh entry.lang = + { "第 " volume * " 卷" * } + { "volume" volume tie.or.space.connect } + if$ + } + if$ +} + +FUNCTION {format.number} +{ number empty$ + { "" } + { lang.zh entry.lang = + { "第 " number * " 册" * } + { "number" number tie.or.space.connect } + if$ + } + if$ +} + +FUNCTION {format.volume.number} +{ volume empty$ not + { format.volume } + { format.number } + if$ +} + +FUNCTION {format.series.vol.num.title} +{ format.volume.number 's := + series empty$ not + { series bbl.colon * + s empty$ not + { s * bbl.wide.space * } + 'skip$ + if$ + title * + } + { title + s empty$ not + { bbl.colon * s * } + 'skip$ + if$ + } + if$ + entry.lang lang.en = sentence.case.title and + { "t" change.case$ } + 'skip$ + if$ +} + +FUNCTION {format.series.vol.num.booktitle} +{ format.volume.number 's := + series empty$ not + { series bbl.colon * + s empty$ not + { s * bbl.wide.space * } + 'skip$ + if$ + booktitle * + } + { booktitle + s empty$ not + { bbl.colon * s * } + 'skip$ + if$ + } + if$ +} + +FUNCTION {format.journal} +{ journal + italic.jounal + 'italicize + 'skip$ + if$ +} + +FUNCTION {set.entry.mark} +{ entry.mark empty$ not + 'pop$ + { mark empty$ not + { pop$ mark 'entry.mark := } + { 'entry.mark := } + if$ + } + if$ +} + +FUNCTION {format.mark} +{ print.mark + { medium empty$ not + { entry.mark "/" * medium * 'entry.mark := } + { is.electronic + { entry.mark "/OL" * 'entry.mark := } + 'skip$ + if$ + } + if$ + "\allowbreak[" entry.mark * "]" * + } + { "" } + if$ +} + +FUNCTION {num.to.ordinal} +{ duplicate$ text.length$ 'charptr := + duplicate$ charptr #1 substring$ 's := + s "1" = + { "st" * } + { s "2" = + { "nd" * } + { s "3" = + { "rd" * } + { "th" * } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { edition is.number + { lang.zh entry.lang = + { edition " 版" * } + { edition num.to.ordinal " ed." * } + if$ + } + { entry.lang lang.en = + { edition "t" change.case$ 's := + s "Revised" = s "Revised edition" = or + { "Rev. ed." } + { s " ed." *} + if$ + } + { edition } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.publisher} +{ publisher empty$ not + { publisher } + { school empty$ not + { school } + { organization empty$ not + { organization } + { institution empty$ not + { institution } + { "" } + if$ + } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.address.publisher} +{ address empty$ not + { address + format.publisher empty$ not + { bbl.colon * format.publisher * } + { is.electronic not print.missing.address.publisher and + { bbl.colon * bbl.sine.nomine * } + 'skip$ + if$ + } + if$ + } + { is.electronic not print.missing.address.publisher and + { format.publisher empty$ not + { bbl.sine.loco bbl.colon * format.publisher * } + { bbl.sine.loco.sine.nomine } + if$ + } + { format.publisher empty$ not + { format.publisher } + { "" } + if$ + } + if$ + } + if$ +} + +FUNCTION {extract.before.dash} +{ duplicate$ empty$ + { pop$ "" } + { 's := + #1 'charptr := + s text.length$ #1 + 'len := + { charptr len < + s charptr #1 substring$ "-" = not + and + } + { charptr #1 + 'charptr := } + while$ + s #1 charptr #1 - substring$ + } + if$ +} + +FUNCTION {extract.after.dash} +{ duplicate$ empty$ + { pop$ "" } + { 's := + #1 'charptr := + s text.length$ #1 + 'len := + { charptr len < + s charptr #1 substring$ "-" = not + and + } + { charptr #1 + 'charptr := } + while$ + { charptr len < + s charptr #1 substring$ "-" = + and + } + { charptr #1 + 'charptr := } + while$ + s charptr global.max$ substring$ + } + if$ +} + +FUNCTION {contains.dash} +{ duplicate$ empty$ + { pop$ #0 } + { 's := + { s empty$ not + s #1 #1 substring$ "-" = not + and + } + { s #2 global.max$ substring$ 's := } + while$ + s empty$ not + } + if$ +} + +FUNCTION {format.year} +{ year empty$ not + { year extract.before.dash } + { date empty$ not + { date extract.before.dash } + { "empty year in " cite$ * warning$ + "" + } + if$ + } + if$ + extra.label * +} + +FUNCTION {format.date} +{ type$ "patent" = type$ "newspaper" = or + date empty$ not and + { date } + { year } + if$ +} + +FUNCTION {format.editdate} +{ date empty$ not + { "\allowbreak(" date * ")" * } + { "" } + if$ +} + +FUNCTION {format.urldate} +{ urldate empty$ not is.electronic and + { "\allowbreak[" urldate * "]" * } + { "" } + if$ +} + +FUNCTION {hyphenate} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { "-" * + { t #1 #1 substring$ "-" = } + { t #2 global.max$ substring$ 't := } + while$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {format.pages} +{ pages empty$ + { "" } + { pages hyphenate } + if$ +} + +FUNCTION {format.journal.number} +{ number empty$ not + { "\penalty0 (" number * ")" * } + { "" } + if$ +} + +FUNCTION {format.journal.pages} +{ pages empty$ + { "" } + { ":\penalty0 " pages hyphenate * } + if$ +} + +FUNCTION {format.periodical.year.volume.number} +{ year empty$ not + { year extract.before.dash } + { "No year in periodical " cite$ * warning$ } + if$ + volume empty$ not + { ", " * volume extract.before.dash * } + 'skip$ + if$ + number empty$ not + { "\penalty0 (" * number extract.before.dash * ")" * } + 'skip$ + if$ + year contains.dash + { "--" * + year extract.after.dash empty$ + volume extract.after.dash empty$ and + number extract.after.dash empty$ and not + { year extract.after.dash empty$ not + { year extract.after.dash * } + { year extract.before.dash * } + if$ + volume empty$ not + { ", " * volume extract.after.dash * } + 'skip$ + if$ + number empty$ not + { "\penalty0 (" * number extract.after.dash * ")" * } + 'skip$ + if$ + } + 'skip$ + if$ + } + 'skip$ + if$ +} + +FUNCTION {check.url} +{ url empty$ not + { "\url{" url * "}" * 'entry.url := + #1 'is.electronic := + } + { howpublished empty$ not + { howpublished #1 #5 substring$ "\url{" = + { howpublished 'entry.url := + #1 'is.electronic := + } + 'skip$ + if$ + } + { note empty$ not + { note #1 #5 substring$ "\url{" = + { note 'entry.url := + #1 'is.electronic := + } + 'skip$ + if$ + } + 'skip$ + if$ + } + if$ + } + if$ +} + +FUNCTION {format.url} +{ entry.url empty$ not + { new.block entry.url } + { "" } + if$ +} + +FUNCTION {check.doi} +{ doi empty$ not + { #1 'is.electronic := } + 'skip$ + if$ +} + +FUNCTION {is.in.url} +{ 's := + s empty$ + { #1 } + { entry.url empty$ + { #0 } + { s text.length$ 'len := + entry.url text.length$ 'charptr := + { entry.url charptr len substring$ s = not + charptr #0 > + and + } + { charptr #1 - 'charptr := } + while$ + charptr + } + if$ + } + if$ +} + +FUNCTION {format.doi} +{ "" + doi empty$ not print.doi and + { "" 's := + doi 't := + #0 'numnames := + { t empty$ not} + { t #1 #1 substring$ 'tmp.str := + tmp.str "," = tmp.str " " = or t #2 #1 substring$ empty$ or + { t #2 #1 substring$ empty$ + { s tmp.str * 's := } + 'skip$ + if$ + s empty$ s is.in.url or + 'skip$ + { numnames #1 + 'numnames := + numnames #1 > + { ", " * } + { "DOI: " * } + if$ + "\doi{" s * "}" * * + } + if$ + "" 's := + } + { s tmp.str * 's := } + if$ + t #2 global.max$ substring$ 't := + } + while$ + 's := + s empty$ not + { new.block s } + { "" } + if$ + } + 'skip$ + if$ +} + +FUNCTION {check.electronic} +{ "" 'entry.url := + #0 'is.electronic := + 'check.doi + 'skip$ + if$ + 'check.url + 'skip$ + if$ + medium empty$ not + { medium "MT" = medium "DK" = or medium "CD" = or medium "OL" = or + { #1 'is.electronic := } + 'skip$ + if$ + } + 'skip$ + if$ +} + +FUNCTION {format.note} +{ note empty$ not print.note and + { note } + { "" } + if$ +} + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ + year empty$ + and and + key empty$ not and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + +FUNCTION {monograph} +{ output.bibitem + author empty$ not + { format.authors } + { editor empty$ not + { format.editors } + { "" } + if$ + } + if$ + output + new.block + format.series.vol.num.title "title" output.check + "M" set.entry.mark + format.mark "" output.after + new.block + format.translators output + new.sentence + format.edition output + new.block + format.address.publisher output + format.year "year" output.check + format.pages bbl.colon output.after + format.urldate "" output.after + format.url output + format.doi output + new.block + format.note output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + "M" set.entry.mark + format.mark "" output.after + new.block + format.translators output + new.slash + format.editors output + new.block + format.series.vol.num.booktitle "booktitle" output.check + new.block + format.edition output + new.block + format.address.publisher output + format.year "year" output.check + format.pages bbl.colon output.after + format.urldate "" output.after + format.url output + format.doi output + new.block + format.note output + fin.entry +} + +FUNCTION {periodical} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + "J" set.entry.mark + format.mark "" output.after + new.block + format.periodical.year.volume.number output + new.block + format.address.publisher output + format.date "year" output.check + format.urldate "" output.after + format.url output + format.doi output + new.block + format.note output + fin.entry +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + "J" set.entry.mark + format.mark "" output.after + new.block + format.journal "journal" output.check + format.date "year" output.check + volume output + format.journal.number "" output.after + format.journal.pages "" output.after + format.urldate "" output.after + format.url output + format.doi output + new.block + format.note output + fin.entry +} + +FUNCTION {patent} +{ output.bibitem + format.authors output + author format.key output + new.block + format.title + number empty$ not + { bbl.colon * number * } + 'skip$ + if$ + "title" output.check + "P" set.entry.mark + format.mark "" output.after + new.block + format.date "year" output.check + format.urldate "" output.after + format.url output + format.doi output + new.block + format.note output + fin.entry +} + +FUNCTION {electronic} +{ #1 #1 check.electronic + #1 'is.electronic := + output.bibitem + format.authors output + author format.key output + new.block + format.series.vol.num.title "title" output.check + "EB" set.entry.mark + format.mark "" output.after + new.block + format.address.publisher output + date empty$ + { format.date output } + 'skip$ + if$ + format.pages bbl.colon output.after + format.editdate "" output.after + format.urldate "" output.after + format.url output + format.doi output + new.block + format.note output + fin.entry +} + +FUNCTION {misc} +{ journal empty$ not + 'article + { booktitle empty$ not + 'incollection + { publisher empty$ not + 'monograph + { url empty$ not doi empty$ not or + 'electronic + { "Z" set.entry.mark + monograph + } + if$ + } + if$ + } + if$ + } + if$ + empty.misc.check +} + +FUNCTION {archive} +{ "A" set.entry.mark + misc +} + +FUNCTION {book} { monograph } + +FUNCTION {booklet} { book } + +FUNCTION {collection} +{ "G" set.entry.mark + monograph +} + +FUNCTION {database} +{ "DB" set.entry.mark + electronic +} + +FUNCTION {dataset} +{ "DS" set.entry.mark + electronic +} + +FUNCTION {inbook} { book } + +FUNCTION {inproceedings} +{ "C" set.entry.mark + incollection +} + +FUNCTION {conference} { inproceedings } + +FUNCTION {map} +{ "CM" set.entry.mark + misc +} + +FUNCTION {manual} { monograph } + +FUNCTION {mastersthesis} +{ lang.zh entry.lang = + { "\thumasterbib{}" } + { "D" } + if$ + set.entry.mark + monograph +} + +FUNCTION {newspaper} +{ "N" set.entry.mark + article +} + +FUNCTION {online} +{ "EB" set.entry.mark + electronic +} + +FUNCTION {phdthesis} +{ lang.zh entry.lang = + { "\thuphdbib{}" } + { "D" } + if$ + set.entry.mark + monograph +} + +FUNCTION {proceedings} +{ "C" set.entry.mark + monograph +} + +FUNCTION {software} +{ "CP" set.entry.mark + electronic +} + +FUNCTION {standard} +{ "S" set.entry.mark + misc +} + +FUNCTION {techreport} +{ "R" set.entry.mark + misc +} + +FUNCTION {unpublished} +{ "Z" set.entry.mark + misc +} + +FUNCTION {default.type} { misc } + +MACRO {jan} {"January"} + +MACRO {feb} {"February"} + +MACRO {mar} {"March"} + +MACRO {apr} {"April"} + +MACRO {may} {"May"} + +MACRO {jun} {"June"} + +MACRO {jul} {"July"} + +MACRO {aug} {"August"} + +MACRO {sep} {"September"} + +MACRO {oct} {"October"} + +MACRO {nov} {"November"} + +MACRO {dec} {"December"} + +MACRO {acmcs} {"ACM Computing Surveys"} + +MACRO {acta} {"Acta Informatica"} + +MACRO {cacm} {"Communications of the ACM"} + +MACRO {ibmjrd} {"IBM Journal of Research and Development"} + +MACRO {ibmsj} {"IBM Systems Journal"} + +MACRO {ieeese} {"IEEE Transactions on Software Engineering"} + +MACRO {ieeetc} {"IEEE Transactions on Computers"} + +MACRO {ieeetcad} + {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} + +MACRO {ipl} {"Information Processing Letters"} + +MACRO {jacm} {"Journal of the ACM"} + +MACRO {jcss} {"Journal of Computer and System Sciences"} + +MACRO {scp} {"Science of Computer Programming"} + +MACRO {sicomp} {"SIAM Journal on Computing"} + +MACRO {tocs} {"ACM Transactions on Computer Systems"} + +MACRO {tods} {"ACM Transactions on Database Systems"} + +MACRO {tog} {"ACM Transactions on Graphics"} + +MACRO {toms} {"ACM Transactions on Mathematical Software"} + +MACRO {toois} {"ACM Transactions on Office Information Systems"} + +MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} + +MACRO {tcs} {"Theoretical Computer Science"} + +READ + +EXECUTE {init.state.consts} + +EXECUTE {init.options} + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + +FUNCTION {format.lab.names} +{ 's := + s #1 "{vv~}{ll}{, jj}{, ff}" format.name$ 't := + t get.str.lang 'name.lang := + name.lang lang.en = + { t #1 "{vv~}{ll}" format.name$} + { t #1 "{ll}{ff}" format.name$} + if$ + s num.names$ #1 > + { bbl.space * bbl.et.al * } + 'skip$ + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.key.organization.label} +{ author empty$ + { key empty$ + { organization empty$ + { cite$ #1 #3 substring$ } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.organization.label} +{ editor empty$ + { key empty$ + { organization empty$ + { cite$ #1 #3 substring$ } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "collection" = + type$ "proceedings" = + or + { editor empty$ not + 'editor.key.organization.label + 'author.key.organization.label + if$ + } + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + format.year duplicate$ empty$ + short.list key field.or.null = or + { pop$ "" } + 'skip$ + if$ + * + 'label := +} + +INTEGERS { seq.num } + +FUNCTION {init.seq} +{ #0 'seq.num :=} + +EXECUTE {init.seq} + +FUNCTION {int.to.fix} +{ "000000000" swap$ int.to.str$ * + #-1 #10 substring$ +} + +FUNCTION {presort} +{ set.entry.lang + print.url print.doi check.electronic + calc.label + label sortify + " " + * + seq.num #1 + 'seq.num := + seq.num int.to.fix + 'sort.label := + sort.label * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} + +SORT + +STRINGS { longest.label last.label next.extra } + +INTEGERS { longest.label.width last.extra.num number.label } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'longest.label.width := + #0 'last.extra.num := + #0 'number.label := +} + +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} + +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + 'skip$ + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := +} + +EXECUTE {initialize.longest.label} + +ITERATE {forward.pass} + +REVERSE {reverse.pass} + +FUNCTION {bib.sort.order} +{ sort.label 'sort.key$ := +} + +ITERATE {bib.sort.order} + +SORT + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\providecommand{\natexlab}[1]{#1}" + write$ newline$ + "\providecommand\thumasterbib{D}" + write$ newline$ + "\providecommand\thuphdbib{D}" + write$ newline$ + print.url print.doi or + { "\providecommand{\url}[1]{#1}" + write$ newline$ + "\expandafter\ifx\csname urlstyle\endcsname\relax\relax\else" + write$ newline$ + " \urlstyle{same}\fi" + write$ newline$ + } + 'skip$ + if$ + print.doi + { "\providecommand{\href}[2]{\url{#2}}" + write$ newline$ + "\providecommand{\doi}[1]{\href{https://doi.org/#1}{#1}}" + write$ newline$ + } + 'skip$ + if$ +} + +EXECUTE {begin.bib} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} diff --git a/test/chapter/refs.bib b/test/chapter/refs.bib new file mode 100644 index 0000000..8b4c3bb --- /dev/null +++ b/test/chapter/refs.bib @@ -0,0 +1,230 @@ +@book{IEEE-1363, + author = {{IEEE Std 1363-2000}}, + title = {{IEEE} Standard Specifications for Public-Key Cryptography}, + address = {New York}, + publisher = {IEEE}, + year = 2000 +} + +@inproceedings{kocher99, + author = {C. Kocher and J. Jaffe and B. Jun}, + title = {Differential Power Analysis}, + editor = {M. Wiener}, + booktitle = {Advances in Cryptology ({CRYPTO}~'99)}, + series = {Lecture Notes in Computer Science}, + volume = 1666, + pages = {388-397}, + publisher = {Springer-Verlag}, + address = {Germany}, + month = {August}, + year = 1999 +} + +@incollection{Krasnogor2004e, + author = {N. Krasnogor}, + title = {Towards robust memetic algorithms}, + booktitle = {Recent Advances in Memetic Algorithms}, + publisher = {Springer Berlin Heidelberg}, + year = 2004, + pages = {185-207}, + editor = {W.E. Hart and N. Krasnogor and J.E. Smith}, + volume = 166, + series = {Studies in Fuzziness and Soft Computing}, + address = {New York}, +} + +@incollection{zjsw, + author = {班固}, + title = {苏武传}, + booktitle = {传记散文英华}, + publisher = {湖北人民出版社}, + year = 1998, + pages = {65-69}, + editor = {郑在瀛 and 汪超宏 and 周文复}, + volume = 2, + series = {新古文观止丛书}, + address = {武汉}, + language = "chinese", +} + +@inbook{clzs, + author = {阎真}, + title = {沧浪之水}, + chapter = {大人物还是讲人情的}, + pages = {185-207}, + publisher = {人民文学出版社}, + address = {北京}, + year = 2001, + language = "chinese", +} + +@book{tex, + author = "Donald E. Knuth", + title = "The {\TeX} Book", + publisher = "Addison-Wesley Publishing Company", + address = "Reading, MA", + year = 1989, + edition = "15th", +} + +@book{companion, + author = "Michel Goosens and Frank Mittelbach and Alexander Samarin", + title = "The {\LaTeX} Companion", + publisher = "Addison-Wesley Publishing Company", + address = "Reading, MA", + PAGES = "112--125", + year = 1994, +} + +@article{ELIDRISSI94, + author = "{Chafik El Idrissi}, M. and {Roney}, A. and {Frigon}, C. and + {Larzilli{\`e}re}, M.", + title = "Measurements of total kinetic-energy released to the {$N=2$} + dissociation limit of {H}$_2$ --- evidence of the dissociation + of very high vibrational {R}ydberg states of {H}$_2$ by + doubly-excited states", + journal = "Chemical Physics Letters", + pages = "260-266", + volume = 224, + number = 10, + year = 1994, +} + +@article{MELLINGER96, + author = "Mellinger, A. and Vidal, C. R. and Jungen, Ch.", + title = "Laser reduced fluorescence study of the carbon-monoxide nd + triplet {R}ydberg series-experimental results and multichannel + quantum-defect analysis", + journal = "J. Chem. Phys.", + pages = "8913-8921", + volume = 104, + number = 5, + year = 1996, +} + +@article{SHELL02, + author = "Michael Shell", + title = "How to Use the {IEEEtran \LaTeX} Class", + journal = "Journal of {\LaTeX} Class Files", + year = 2002, + volume = 12, + number = 4, + pages = "100--120" +} + +@TechReport{NPB2, + title = {The {NAS} Parallel Benchmarks 2.0}, + author = {Alex Woo and David Bailey and Maurice Yarrow and Wijngaart + Wijngaart and Tim Harris and William Saphir}, + year = 1995, + month = dec # "~05", + institution = "The Pennsylvania State University CiteSeer Archives", + url = "http://www.nasa.org/" +} + +@inproceedings{DPMG, + author = {Kim, Sangbum and Woo, Namyoon and Yeom, Heon Y. and Park, + Taesoon and Park, Hyoungwoo}, + title = {Design and {I}mplementation of {D}ynamic {P}rocess + {M}anagement for {G}rid-enabled {MPICH}}, + booktitle = {the 10th European PVM/MPI Users' Group Conference}, + editor = {Jack Dongarra and Domenico Laforenza and Salvatore Orlando}, + publisher = {Springer-Verlag}, + year = 2003, + address = {Venice, Italy}, + month = sep, +} + +@inproceedings{cnproceed, + author = {王重阳 and 黄药师 and 欧阳峰 and 洪七公 and 段皇帝}, + publisher = {金大庸}, + title = {武林高手从入门到精通}, + booktitle = {第~$N$~次华山论剑}, + year = 2006, + address = {西安, 中国}, + month = sep, + language = "chinese", +} + +@article{cnarticle, + author = "贾宝玉 and 林黛玉 and 薛宝钗 and 贾探春", + title = "论刘姥姥食量大如牛之现实意义", + journal = "红楼梦杂谈", + pages = "260--266", + volume = 224, + year = 1800, + language = "chinese", +} + +@mastersthesis{zhubajie, + author = {猪八戒}, + title = {论流体食物的持久保存}, + school = {广寒宫大学}, + year = 2005, + address = {北京}, + language = "chinese", +} + +@phdthesis{shaheshang, + author = {沙和尚}, + title = {论流沙河的综合治理}, + school = {清华大学}, + year = 2005, + address = {北京}, + language = "chinese", +} + +@mastersthesis{metamori2004, + author = {Ashwin Raju Jeyakumar}, + title = {Metamori: A library for Incremental File Checkpointing}, + school = {Virgina Tech}, + year = 2004, + month = jun # "~21", + address = {Blacksburg}, +} + +@phdthesis{FistSystem01, + author = "Erez Zadok", + title = "{FiST: A System for Stackable File System Code Generation}", + year = 2001, + month = "May", + school = "Computer Science Department, Columbia University", + address = "USA" +} + +@inbook{ColdSources, + author = {P. Gr{\"o}ning and L. Nilsson and P. Ruffieux and R. + Clergereaux and O. Gr{\"o}ning}, + title = {Encyclopedia of Nanoscience and Nanotechnology}, + pages = {547--579}, + publisher = {American Scientific Publishers}, + year = 2004, + volume = 1, + address = {USA}, +} + +@online{chuban2001, + author = {萧钰}, + title = {出版业信息化迈入快车道}, + modifydate = {2001-12-19}, + citedate = {2002-04-15}, + url = {http://www.creader.com/news/200112190019.htm}, + language = "chinese", +} + +@online{oclc2000, + author = {{Online Computer Library Center, Inc.}}, + title = {History of {OCLC}}, + citedate = {2000-01-08}, + url = {http://www.oclc.org/about/history/default.htm}, +} + + +@online{thuthesis, + author = {薛瑞尼}, + title = {\thuthesis: 清华大学学位论文模板}, + citedate = {2017-12-02}, + url = {https://github.com/xueruini/thuthesis}, + language = "chinese", + year = 2017, +} diff --git a/test/test.tex b/test/test.tex new file mode 100644 index 0000000..2cf8767 --- /dev/null +++ b/test/test.tex @@ -0,0 +1,22 @@ +\documentclass[language=english]{njurepo} +\begin{document} +\frontmatter +\input{chapter/cover} + \input{chapter/abstract} + \maketitlepage % 封面 + \makeabstract % 摘要 + \tableofcontents % 目录 + \input{chapter/denotation} % 中英对照表 +\mainmatter + \input{chapter/chap01} % 主体内容 +\backmatter + \listoffigures % 图索引 + \listoftables % 表格索引 + \listofequations % 公式索引 + \bibliographystyle{chapter/numeric} % 参考文献样式 ref/numeric,ref/author-year,plainnat,IEEEtran + \bibliography{chapter/refs} % 参考文献 + \include{chapter/ack} % 致谢 + \begin{appendix} % 附录 + \input{chapter/appendix01} + \end{appendix} +\end{document} \ No newline at end of file