Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: 修复错误的XITS Math名称;chore: 增加测试文件夹 #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 55 additions & 12 deletions njurepo.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>

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

%</batchfile>
%
\ProvidesFile{njurepo.dtx}[2019/03/20 1.1.3 Nanjing University Report Template]
\documentclass{ltxdoc}
\usepackage{dtx-style}
Expand Down Expand Up @@ -101,7 +148,7 @@
% \item 本模板的发布遵守 \LaTeX\ Project Public License,使用前请认真阅读协议内
% 容。
% \item \textbf{本模板为作者自己通常使用的报告模板,与南京大学官方没有任何关系}。任何使用该宏包进行实验报告制作时,请\textbf{务必根据课程要求进行写作}。由于使用本模板而引起的作业验收问题,均与本模板作者无关。
% \item 本模板借鉴\thuthesis{}宏包的许多内容,需要稳定模板的同学也可以选择使用清华大学的\thuthesis{}宏包并自己进行配置。
% \item 本模板借鉴\njuthesis{}宏包的许多内容,需要稳定模板的同学也可以选择使用南京大学的\njuthesis{}宏包并自己进行配置。
% \item 任何个人或组织以本模板为基础进行修改、扩展而生成的新的专用模板,请严格遵
% 守 \LaTeX\ Project Public License 协议。由于违犯协议而引起的任何纠纷争端均与
% 本模板作者无关。
Expand Down Expand Up @@ -301,7 +348,7 @@
% \section{致谢}
% 感谢以下宏包的作者,本宏包从中使用了部分代码和借鉴:
% \begin{itemize}
% \item 清华大学\thuthesis https://github.com/xueruini/thuthesis
% \item 南京大学\njuthesis https://github.com/xueruini/njuthesis
% \end{itemize}
%
% \StopEventually{}
Expand All @@ -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{
Expand Down Expand Up @@ -379,6 +426,7 @@
\includepdfset{fitpaper=true}
\RequirePackage{tikz}
\usetikzlibrary{decorations.pathmorphing,graphs,calc}
\RequirePackage{njuvisual}
\RequirePackage{dirtree}
\RequirePackage{qtree}
% \end{macrocode}
Expand Down Expand Up @@ -449,7 +497,7 @@
% \end{macrocode}
%
% \subsection{页面设置}
% 使用了thuthesis的非本科生默认配置
% 使用了njuthesis的非本科生默认配置
% \begin{macrocode}
\RequirePackage{geometry}
\ifnju@wide
Expand Down Expand Up @@ -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}
%
Expand Down Expand Up @@ -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}}
%</dtx-style>
% \end{macrocode}
% \fi
Expand Down
55 changes: 0 additions & 55 deletions njurepo.ins

This file was deleted.

2 changes: 1 addition & 1 deletion parts/examples/abstract.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
论文摘要的书写应力求精确、简明。切忌写成对论文书写内容进行提要的形式,尤其要避
免“第 1 章……;第 2 章……;……”这种或类似的陈述方式。

本文介绍清华大学论文模板 \thuthesis{} 的使用方法。本模板符合学校的本科、硕士、
本文介绍南京大学论文模板 \njuthesis{} 的使用方法。本模板符合学校的本科、硕士、
博士论文格式要求。

本文的创新点主要有:
Expand Down
2 changes: 1 addition & 1 deletion parts/examples/ack.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
胜感激。感谢 xx 实验室主任 xx 教授,以及实验室全体老师和同学们的热情帮助和支
持!本课题承蒙国家自然科学基金资助,特此致谢。

感谢 \LaTeX 和 thuthesis\cite{thuthesis},帮我节省了不少时间。
感谢 \LaTeX 和 njuthesis\cite{njuthesis},帮我节省了不少时间。
\end{acknowledgement}
32 changes: 17 additions & 15 deletions parts/examples/appendix01.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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}

柳下季曰:“先生言为人父者必能诏其子,为人兄者必能教其弟,若子不听父之诏,弟不受
兄之教,虽今先生之辩,将奈之何哉?且跖之为人也,心如涌泉,意如飘风,强足以距敌,
Expand Down
2 changes: 1 addition & 1 deletion parts/examples/cover.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
%=========
% 中文信息
%=========
ctitle={清华大学学位论文 \LaTeX\ 模板\\使用示例文档},
ctitle={南京大学学位论文 \LaTeX\ 模板\\使用示例文档},
csubtitle={通用报告模板},
cdegree={工学硕士},
cdepartment={计算机科学与技术系},
Expand Down
49 changes: 49 additions & 0 deletions test/chapter/abstract.tex
Original file line number Diff line number Diff line change
@@ -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}

12 changes: 12 additions & 0 deletions test/chapter/ack.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
% 如果使用声明扫描页,将可选参数指定为扫描后的 PDF 文件名,例如:
% \begin{acknowledgement}[scan-statement.pdf]
\begin{acknowledgement}
衷心感谢导师 xxx 教授和物理系 xxx 副教授对本人的精心指导。他们的言传身教将使
我终生受益。

在美国麻省理工学院化学系进行九个月的合作研究期间,承蒙 xxx 教授热心指导与帮助,不
胜感激。感谢 xx 实验室主任 xx 教授,以及实验室全体老师和同学们的热情帮助和支
持!本课题承蒙国家自然科学基金资助,特此致谢。

感谢 \LaTeX 和 njuthesis\cite{njuthesis},帮我节省了不少时间。
\end{acknowledgement}
Loading