summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/njurepo
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-03-20 22:32:18 +0000
committerKarl Berry <karl@freefriends.org>2019-03-20 22:32:18 +0000
commit1a11428af995659092f151b8d354e231a2492ac4 (patch)
treebfe90cabe56acd1296139cff1b84d99f32a70f4c /Master/texmf-dist/source/latex/njurepo
parentd357ecbe479b26ff5873f712e1cbfe779a643752 (diff)
njurepo (20mar19)
git-svn-id: svn://tug.org/texlive/trunk@50492 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/njurepo')
-rw-r--r--Master/texmf-dist/source/latex/njurepo/njurepo.dtx170
1 files changed, 92 insertions, 78 deletions
diff --git a/Master/texmf-dist/source/latex/njurepo/njurepo.dtx b/Master/texmf-dist/source/latex/njurepo/njurepo.dtx
index e9824383e40..a5256d3bab7 100644
--- a/Master/texmf-dist/source/latex/njurepo/njurepo.dtx
+++ b/Master/texmf-dist/source/latex/njurepo/njurepo.dtx
@@ -16,7 +16,7 @@
%
% \iffalse
%<*driver>
-\ProvidesFile{njurepo.dtx}[2019/01/29 1.0.1 Nanjing University Report Template]
+\ProvidesFile{njurepo.dtx}[2019/01/29 1.1.2 Nanjing University Report Template]
\documentclass{ltxdoc}
\usepackage{dtx-style}
\EnableCrossrefs
@@ -72,6 +72,8 @@
% \changes{v1.0.0}{2019/01/22}{Initial version}
% \changes{v1.0.1}{2019/01/29}{Add more ability}
% \changes{v1.1.0}{2019/01/29}{Stable version}
+% \changes{v1.1.1}{2019/02/20}{Fix little bugs}
+% \changes{v1.1.2}{2019/03/20}{Fix some typo and add more predined macro. Polish manual}
%
% \GetFileInfo{\jobname.dtx}
%
@@ -80,7 +82,7 @@
% \IndexPrologue{\section{\indexname}}
% \GlossaryPrologue{\section{\glossaryname}}
-% \title{\bfseries\color{violet}\njurepo: 南京大学本科生范用报告}
+% \title{\bfseries\color{violet}\njurepo: 南京大学本科生泛用报告}
% \author{郑奘巍 \\[5pt]\texttt{zhengzangw@gmail.com}}
% \date{\fileversion\ (\filedate)}
% \maketitle\thispagestyle{empty}
@@ -98,7 +100,7 @@
% \item 本模板的发布遵守 \LaTeX\ Project Public License,使用前请认真阅读协议内
% 容。
% \item \textbf{本模板为作者自己通常使用的报告模板,与南京大学官方没有任何关系}。任何使用该宏包进行实验报告制作时,请\textbf{务必根据课程要求进行写作}。由于使用本模板而引起的作业验收问题,均与本模板作者无关。
-% \item 本模板借鉴\thuthesis{}宏包的大量内容,需要稳定模板的同学也可以选择使用清华大学的\thuthesis{}宏包并自己进行配置。
+% \item 本模板借鉴\thuthesis{}宏包的许多内容,需要稳定模板的同学也可以选择使用清华大学的\thuthesis{}宏包并自己进行配置。
% \item 任何个人或组织以本模板为基础进行修改、扩展而生成的新的专用模板,请严格遵
% 守 \LaTeX\ Project Public License 协议。由于违犯协议而引起的任何纠纷争端均与
% 本模板作者无关。
@@ -115,16 +117,24 @@
% \clearpage
%
% \section{模板介绍}
-% \njurepo\ (\textbf{N}an\textbf{jing} \textbf{U}niversity \LaTeX\ Versatile \textbf{Repo}rt Template)是根据作者用\LaTeX{}制作南京大学课程实验报告的模板文件,可帮助本科生快速的制作实验报告和作业。
+% \njurepo\ (\textbf{N}an\textbf{jing} \textbf{U}niversity \LaTeX\ Versatile \textbf{Repo}rt Template)是为南京大学本科生设计的一个免于配置的作业、实验报告模板。希望它可以使你的作业/实验报告不会因形式上的缺陷导致评分的下降。
+%
+% 该文档格式基于 ctexbook, 主要完成了除了主体内容以外的几乎\textbf{全部}工作。同时,通过使用 Github 版本宏包,你还可以更好的管理自己的 $\LaTeX$ 文档。
+%
% 本文档将尽量完整的介绍模板的使用方法,如有不清楚之处可以参考示例文档或者根据第 3.1 节说明提问,有兴趣者都可以参与完善此手册,也非常欢迎对代码的贡献。
%
% \section{安装}
% \label{sec:installation}
-% \njurepo 开发版需要自行前往github主页:\\
-% https://github.com/zhengzangw/njurepo下载。
+% \subsection{CTAN}
+% 本宏包已被收纳于 CTAN 中,凡安装完整版 Texlive 用户可直接使用:
+% \begin{latex}
+% \usepackage{njurepo}
+% \end{latex}
%
-% \subsection{字体安装}
-% 字体存放在font文件夹中,使用模板前先自行安装。
+% \subsection{Github}
+% 想获得最新版本的 \njurepo 请前往 Github 主页下载:https://github.com/zhengzangw/njurepo
+%
+% 同时,面向 Github 版本的说明主要在 README.md 中,如果使用的是 Github 版本,请阅读 README.md
%
% \subsection{模板的组成}
% 下表列出了\njurepo 的主要文件及其功能介绍:
@@ -140,15 +150,15 @@
% \endlastfoot
% njurepo.ins & \textsc{DocStrip} 驱动文件(开发用) \\
% njurepo.dtx & \textsc{DocStrip} 源文件(开发用)\\\midrule
-% example.pdf & 实例文档\\
-% main.tex & 主文件\\
-% figs/ & 图片路径\\
-% figs/logos/ & 示例文档图片路径\\
-% fonts/ & 字体\\
+% resources/ & 资源路径\\
+% resources/logos/ & 示例文档资源路径\\
% parts/ & 具体内容\\
-% parts/examples & 示例文档具体内容\\
+% parts/examples/ & 示例文档具体内容\\
% ref/ & 参考文献和参考文献样式文件\\
% njurepo.cls & 模板类文件\\
+% Makefile & 自动运行脚本 \\
+% util.py & 实用管理工具 \\
+% README.md & 说明文件 \\
% \textbf{njurepo.pdf} & 用户手册(本文档)\\ \bottomrule
% \end{longtable}
%
@@ -156,27 +166,21 @@
% 使用Makefile或\XeLaTeX 生成模板文件
% \begin{shell}
% make cls
-% xelatex njurepo.dtx # 两句选一句即可
% \end{shell}
+%
% \subsection{生成论文}
% \subsubsection{latexmk}
% latexmk 命令支持全自动生成\LaTeX{}编写的文档,并且支持使用不同的工具链来进行生成,它会自动运行多次工具直到交叉引用都被解决。下面给出了一个用 latexmk 调用 xelatex 生成最终文档的示例:
% \begin{shell}
% latexmk -xelatex main
% \end{shell}
-% \subsubsection{make}
-% \njurepo{}提供了一个Makefile:
-% \begin{shell}
-% make clean
-% make cls # 生成 njurepo.cls
-% make doc # 生成说明文档 njurepo.pdf
-% make main # 生成示例文档main.pdf
-% \end{shell}
+%
% \subsection{升级}
% 在github上下载最新版,运行:
% \begin{shell}
% make cls
% \end{shell}
+%
% 生成新的类文件和配置文件即可。也可以直接拷贝 njurepo.cls,免去上面命令的执行。
%
%
@@ -209,8 +213,9 @@
% \bibliographystyle{ref/numeric} % ref/numeric,ref/author-year,plainnat,IEEEtran
% \bibliography{ref/refs}
% \include{parts/examples/ack}
+% %% 附录
% \begin{appendix}
-% \input{parts/examples/appendix01}
+ % \input{parts/examples/appendix01}
% \end{appendix}
% \end{document}
% \end{latex}
@@ -224,8 +229,8 @@
% 提交的作业如果是电子稿的话,可以使用连续页,即使用\option{any}
% \DescribeOption{wide}
% 是否使用宽页面。如果生成作业的话,宽页面或许好看。
-% \DescribeOption{awesomefont}
-% 是否使用awesomefont图标。
+% \DescribeOption{draft}
+% 是否生成水印。生成的水印为 Draft 表示此文档尚为草稿
%
% \subsection{字体配置}
% \label{sec:font-config}
@@ -256,28 +261,31 @@
% 使用方法为:\cs{command}\oarg{num},其中 command 为字号命令,num 为行距。比
% 如 \cs{xiaosi}[1.5] 表示选择小四字体,行距 1.5 倍。写作指南要求表格中的字体
% 是 \cs{dawu},模板已经设置好了。
-% 对于英文,开发版中smallcaps默认使用了spinweradC字体。可以使用\cs{setmainfont}进行重新定义。
%
% \subsection{封面信息}
% 仿照parts/examples/cover.tex 进行设置
-% \subsection{问求}
-% 为问求特制了一些宏,具体可见parts/examples/problemsolving.tex
% \subsection{表格}
+% \DescribeMacro{\figoptadd}
+% \DescribeMacro{\figoptaddcap}
+% 定义了两个简单的表格命令
% \begin{latex}
-% \figpf{parameter}{filename}
-% \figpfc{parameter}{filename}{caption}
+% \figoptadd{option}{address}
+% \figoptaddcap{option}{address}{caption}
% \end{latex}
% \subsection{图片}
+% \DescribeMacro{\tabncc}
+% \DescribeMacro{\tabnc}
+% 定义了两个简单的图片命令
% \begin{latex}
-% \tabncc{number per row}{content}{caption}
-% \tabnc{number per row}{content}
+% \tabncc{number-of-columns}{content}{caption}
+% \tabnc{number-of-columns}{content}
% \end{latex}
% \subsection{代码}
-%预设了如下的lstlisting环境
+% \njurepo 预设了如下的代码环境
% \begin{longtable}{ccccc}
% \toprule
-% code & codedisplay & cplus & shell & commandshell \\
-% verilog & python & & &\\
+% code & cpseudo & cplus & shell & commandshell \\
+% verilog & python & latex & &\\
% \bottomrule
% \end{longtable}
% \subsection{文字}
@@ -286,14 +294,13 @@
% \magenta{品红色字}
% \CJKunderline{下划线字}
% \end{latex}
-% 更多的预置宏包,可见\ref{sec:loadpkg}
+% 更多关于预置宏包的内容,可见 README.md 以及 \ref{sec:loadpkg}
%
%
% \section{致谢}
-% 感谢以下宏包的作者为本宏包提供了借鉴:
+% 感谢以下宏包的作者,本宏包从中使用了部分代码和借鉴:
% \begin{itemize}
% \item 清华大学\thuthesis https://github.com/xueruini/thuthesis
-% \item 南京大学 NJUBachelor https://github.com/ZLCao/NJUBachelor
% \end{itemize}
%
% \StopEventually{}
@@ -313,7 +320,7 @@
\hyphenation{NJU-repo}
\def\njurepo{\textsc{NJU}\-\textsc{repo}}
\def\thuthesis{\textsc{Thu}\-\textsc{Thesis}}
-\def\version{1.0.1}
+\def\version{1.1.2}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
family=nju,
@@ -325,7 +332,6 @@
\DeclareBoolOption{wide}
\DeclareBoolOption{color}
\DeclareBoolOption{draft}
-\DeclareBoolOption{awesomefont}
\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}}
\ProcessKeyvalOptions*
@@ -364,12 +370,12 @@
% 用于图片的宏包
% \begin{macrocode}
\RequirePackage{graphicx}
-\graphicspath{{figs/}}
-\graphicspath{{figs/logo/}}
+\graphicspath{{resources/}}
+\graphicspath{{resources/logo/}}
\RequirePackage[labelformat=simple]{subcaption}
\RequirePackage{pdfpages}
\includepdfset{fitpaper=true}
-\RequirePackage{tikz,tikzducks}
+\RequirePackage{tikz}
\usetikzlibrary{decorations.pathmorphing,graphs,calc}
\RequirePackage{dirtree}
% \end{macrocode}
@@ -379,18 +385,19 @@
\RequirePackage{longtable}
\RequirePackage{booktabs}
\RequirePackage{multirow}
-\RequirePackage{bbding,stmaryrd}
\RequirePackage{tabularx}
\RequirePackage{diagbox}
\RequirePackage{makecell}
\RequirePackage{float}
% \end{macrocode}
-% 用于数学的宏包
+% 用于符号或数学的宏包
% \begin{macrocode}
\RequirePackage{CJKfntef}
\RequirePackage{amsmath}
\RequirePackage[amsmath, thmmarks, hyperref]{ntheorem}
\RequirePackage{physics}
+\RequirePackage{bbding,stmaryrd}
+%\RequirePackage{fontawesome}
% \end{macrocode}
% 其它宏包
% \begin{macrocode}
@@ -917,10 +924,10 @@
\theoremheaderfont{\normalfont\heiti}
\theoremsymbol{\ensuremath{\square}}
\newtheorem*{proof}{证明}
-\theoremstyle{plain}
\theoremsymbol{}
\theoremseparator{:}
\ifnju@chinese
+ \theoremstyle{plain}
\newcommand\nju@assumption@name{假设}
\newcommand\nju@definition@name{定义}
\newcommand\nju@proposition@name{命题}
@@ -931,10 +938,12 @@
\newcommand\nju@exercise@name{练习}
\newcommand\nju@example@name{例}
\newcommand\nju@remark@name{注释}
- \newcommand\nju@problem@name{问题}
\newcommand\nju@conjecture@name{猜想}
+ \theoremstyle{break}
+ \newcommand\nju@problem@name{问题}
\newcommand\nju@solution@name{解}
\else
+ \theoremstyle{plain}
\newcommand\nju@assumption@name{Assumption}
\newcommand\nju@definition@name{Definition}
\newcommand\nju@proposition@name{Proposition}
@@ -945,24 +954,25 @@
\newcommand\nju@exercise@name{Exercise}
\newcommand\nju@example@name{Example}
\newcommand\nju@remark@name{Remark}
- \newcommand\nju@problem@name{Problem}
\newcommand\nju@conjecture@name{Conjecture}
+ \theoremstyle{break}
+ \newcommand\nju@problem@name{Problem}
\newcommand\nju@solution@name{Solution}
\fi
\theoremheaderfont{\bfseries}
-\newtheorem{assumption}{\nju@assumption@name}[chapter]
-\newtheorem{definition}{\nju@definition@name}[chapter]
-\newtheorem{proposition}{\nju@proposition@name}[chapter]
-\newtheorem{lemma}{\nju@lemma@name}[chapter]
-\newtheorem{theorem}{\nju@theorem@name}[chapter]
-\newtheorem{axiom}{\nju@axiom@name}[chapter]
-\newtheorem{corollary}{\nju@corollary@name}[chapter]
-\newtheorem{exercise}{\nju@exercise@name}[chapter]
-\newtheorem{example}{\nju@example@name}[chapter]
-\newtheorem{remark}{\nju@remark@name}[chapter]
-\newtheorem{problem}{\nju@problem@name}[chapter]
-\newtheorem{conjecture}{\nju@conjecture@name}[chapter]
-\newtheorem{solution}{\nju@solution@name}[chapter]
+\newtheorem{assumption}{\nju@assumption@name}[section]
+\newtheorem{definition}{\nju@definition@name}[section]
+\newtheorem{proposition}{\nju@proposition@name}[section]
+\newtheorem{lemma}{\nju@lemma@name}[section]
+\newtheorem{theorem}{\nju@theorem@name}[section]
+\newtheorem{axiom}{\nju@axiom@name}[section]
+\newtheorem{corollary}{\nju@corollary@name}[section]
+\newtheorem{exercise}{\nju@exercise@name}[section]
+\newtheorem{example}{\nju@example@name}[section]
+\newtheorem{remark}{\nju@remark@name}[section]
+\newtheorem{problem}{\nju@problem@name}[section]
+\newtheorem{conjecture}{\nju@conjecture@name}[section]
+\newtheorem{solution}{\nju@solution@name}[section]
%\RequirePackage{microtype}
\ifnju@chinese
@@ -970,25 +980,20 @@
\else
\newcommand{\promisewords}{I promise this work is done on my own with no plagiarism.}
\fi
-\newcommand{\pshw}{\section*{\scshape Part I\ \ \ Homework}}
-\newcommand{\pscr}{\section*{\scshape Part II\ \ \ Correction}}
-\newcommand{\psfb}{\section*{\scshape Part III\ \ \ Feedback}}
\newcommand{\Hrule}{\noindent\rule{\linewidth}{0.5mm}}
-\ifnju@awesomefont
-\RequirePackage{awesomefont}
-\fi
-
\theorempostwork{\vspace{-0.5cm}\Hrule}
-\newtheorem*{pssolution}{\ifnju@awesomefont\faPencilSquareO\ \fi\nju@solution@name}
+\newtheorem*{csolution}{\PencilRightDown\nju@solution@name}
+\newtheorem*{nsolution}{\PencilRightDown\nju@solution@name}
\RequirePackage[listings]{tcolorbox}
\newtcolorbox{ps@problem}[1]{fonttitle=\bfseries,title=#1,before skip=0.5cm, after skip=-0.5cm}
-\newenvironment{psproblem}[1][]{
- \begin{ps@problem}{\ifnju@awesomefont\faQuestionCircle\ \fi\nju@problem@name\ #1}
+\newenvironment{cproblem}[1][]{
+ \begin{ps@problem}{\Checkmark\ \nju@problem@name\ #1}
}{
\end{ps@problem}
}
-%
+\theoremstyle{plain}
+\newtheorem*{nproblem}{\Checkmark\nju@problem@name}[section]
% \subsubsection{浮动对象}
% \label{sec:float}
% 设置浮动对象和文字之间的距离
@@ -1116,7 +1121,7 @@
%
% 各级标题格式设置。
% \begin{description}
-% \item[chapter] 章序号与章名之间空一个汉字符 黑体三号字,居中书写,单倍行距,段
+% \item[section] 章序号与章名之间空一个汉字符 黑体三号字,居中书写,单倍行距,段
% 前空 24 磅,段后空 18 磅。本科要求:段前段后间距 30/20 pt,行距 20pt。但正文
% 章节 30pt 的话和样例效果不一致。
% \item[section] 一级节标题,例如:\fbox{2.1 实验装置与实验方法}。节标题序号与标
@@ -1468,7 +1473,8 @@
\parbox[b][2.4cm][t]{\textwidth}{%
\rule{1cm}{0cm}}
\vskip0.65cm
- \par\vskip2cm
+ {\includegraphics[width=0.3\textwidth]{njuname0.pdf}}
+ \par\vskip1.5cm
{\xiaochu\heiti\ziju{0.5}\textbf\nju@csubtitle}
\vskip2.2cm\hskip0.8cm
\noindent\heiti\xiaoer\nju@title@pre
@@ -2072,7 +2078,7 @@ every listing line={\textcolor{red}{\small\ttfamily\bfseries \$>}}}
%
% \subsection{快速插入图片或图表}
% \begin{macrocode}
-\newcommand{\figpf}[2]{
+\newcommand{\figoptadd}[2]{
\begin{figure}[H]
\centering
\includegraphics[#1]{figs/#2}
@@ -2080,8 +2086,8 @@ every listing line={\textcolor{red}{\small\ttfamily\bfseries \$>}}}
}
%%%%%%%%%%%%%%%%%%%%
-\newcommand{\figpfc}[3]{
- \begin{figure}[htbp]
+\newcommand{\figoptaddcap}[3]{
+ \begin{figure}[H]
\centering
\includegraphics[#1]{figs/#2}
\caption{#3}
@@ -2150,6 +2156,14 @@ every listing line={\textcolor{red}{\small\ttfamily\bfseries \$>}}}
}
\fi
% \end{macrocode}
+% 补丁
+% \begin{macrocode}
+\renewcommand{\thesection}{\arabic{section}}
+\newcommand{\nchapter}[1]{
+ {\let\clearpage\relax\par\vspace{1cm} \chapter*{\LARGE#1}}
+}
+\newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@}
+% \end{macrocode}
%
% \subsection{自定义代码}
% \begin{macrocode}