Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
NJUThesis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NJU LUG
NJU LaTeX Templates
NJUThesis
Commits
664ed1ef
Commit
664ed1ef
authored
3 years ago
by
Yu Xiong
Browse files
Options
Downloads
Patches
Plain Diff
docs: 更新dtx
parent
41d9d1ff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
njuthesis.cls
+1
-67
1 addition, 67 deletions
njuthesis.cls
njuthesis.dtx
+349
-69
349 additions, 69 deletions
njuthesis.dtx
with
350 additions
and
136 deletions
njuthesis.cls
+
1
−
67
View file @
664ed1ef
...
...
@@ -39,28 +39,20 @@
{
titlelength .int
_
set:N =
\nju
_
titlelength,
titlelength .initial:n = 1,
secondmentor .bool
_
set:N =
\nju
_
second
_
mentor,
secondmentor .initial:n = false,
nlcover .bool
_
set:N =
\nju
_
nl
_
cover,
nlcover .initial:n = false,
degree .tl
_
set:N =
\nju
_
degree,
degree .initial:n = UG,
degree .initial:n = ug,
type .tl
_
set:N =
\nju
_
type,
type .initial:n = thesis,
systemfont .bool
_
set:N =
\nju
_
systemfont,
systemfont .initial:n = true,
customlatinfont .tl
_
set:N =
\nju
_
customlatinfont,
customlatinfont .initial:n = windows,
customchinesefont .tl
_
set:N =
\nju
_
customchinesefont,
customchinesefont .initial:n = windows,
info .meta:nn =
{
nju / info
}
{
#1
}
}
\keys
_
define:nn
{
nju / info
}
...
...
@@ -70,13 +62,11 @@
TitleB .tl
_
set:N =
\nju
_
title
_
b,
TitleC .tl
_
set:N =
\nju
_
title
_
c,
TitleEN .tl
_
set:N =
\nju
_
title
_
en,
% 年级学号姓名
Grade .tl
_
set:N =
\nju
_
grade,
StudentID .tl
_
set:N =
\nju
_
student
_
id,
StudentName .tl
_
set:N =
\nju
_
student
_
name,
StudentNameEN .tl
_
set:N =
\nju
_
student
_
name
_
en,
% 院系专业方向
Department .tl
_
set:N =
\nju
_
department,
DepartmentEN .tl
_
set:N =
\nju
_
department
_
en,
...
...
@@ -84,22 +74,18 @@
MajorEN .tl
_
set:N =
\nju
_
major
_
en,
Field .tl
_
set:N =
\nju
_
field,
FieldEN .tl
_
set:N =
\nju
_
field
_
en,
% 导师
MentorA .tl
_
set:N =
\nju
_
mentor
_
a,
MentorAEN .tl
_
set:N =
\nju
_
mentor
_
a
_
en,
MentorATitle .tl
_
set:N =
\nju
_
mentor
_
a
_
title,
MentorATitleEN .tl
_
set:N =
\nju
_
mentor
_
a
_
title
_
en,
% 第二导师
MentorB .tl
_
set:N =
\nju
_
mentor
_
b,
MentorBEN .tl
_
set:N =
\nju
_
mentor
_
b
_
en,
MentorBTitle .tl
_
set:N =
\nju
_
mentor
_
b
_
title,
MentorBTitleEN .tl
_
set:N =
\nju
_
mentor
_
b
_
title
_
en,
% 提交日期
SubmitDate .tl
_
set:N =
\nju
_
submit
_
date,
% 答辩
DefendDate .tl
_
set:N =
\nju
_
defend
_
date,
ReviewerChairman .tl
_
set:N =
\nju
_
reviewer
_
chairman,
...
...
@@ -107,7 +93,6 @@
ReviewerB .tl
_
set:N =
\nju
_
reviewer
_
b,
ReviewerC .tl
_
set:N =
\nju
_
reviewer
_
c,
ReviewerD .tl
_
set:N =
\nju
_
reviewer
_
d,
% 国家图书馆封面相关
Classification .tl
_
set:N =
\nju
_
classification,
SecurityLevel .tl
_
set:N =
\nju
_
securitylevel,
...
...
@@ -133,7 +118,6 @@
\RequirePackage
{
setspace
}
\RequirePackage
{
lastpage
}
\RequirePackage
{
emptypage
}
% 清除空白页的页码
\RequirePackage
{
listings
}
% 代码环境
\RequirePackage
{
enumitem
}
% 用于修改列表环境
\RequirePackage
{
caption
}
...
...
@@ -165,10 +149,8 @@
% For windows.
% Shipped with the best `grinning-face-with-sweat' support.
}
\RequirePackage
{
blindtext
}
% 生成用于测试的大段无意义英文文字
\RequirePackage
{
zhlipsum
}
% 生成用于测试的大段无意义中文文字
\RequirePackage
{
amsmath
}
% Must be loaded before unicode-math
\RequirePackage
{
amsthm
}
% Mathematical environments
\RequirePackage
{
mathtools
}
% Mathematical tools to use with amsmath
...
...
@@ -178,12 +160,10 @@
mathtools-colon,
mathtools-overbracket
}
]
{
unicode-math
}
% Math fonts in xetex or luatex
\RequirePackage
{
graphicx
}
\DeclareGraphicsExtensions
{
.pdf,.eps,.jpg,.png
}
\graphicspath
{{
figure/
}}
% 图片路径
\RequirePackage
{
wrapfig
}
% Wrap text around figures
\RequirePackage
[hidelinks,bookmarksnumbered=true]
{
hyperref
}
\RequirePackage
[capitalise,nameinlink,noabbrev]
{
cleveref
}
\NewDocumentCommand\set
_
latin
_
fontset
_
windows
{}{
...
...
@@ -191,13 +171,11 @@
\setsansfont
{
Arial
}
\setmonofont
{
Courier~New
}
[Scale=MatchLowercase]
}
\NewDocumentCommand\set
_
latin
_
fontset
_
macos
{}{
\setmainfont
{
Times~New~Roman
}
\setsansfont
{
Arial
}
\setmonofont
{
Menlo
}
[Scale=MatchLowercase]
}
\NewDocumentCommand\set
_
latin
_
fontset
_
gyre
{}{
\setmainfont
{
texgyretermes
}
[
Extension=.otf,
...
...
@@ -220,7 +198,6 @@
Scale=MatchLowercase,
Ligatures=CommonOff]
}
\NewDocumentCommand\set
_
chinese
_
fontset
_
windows
{}{
\setCJKmainfont
{
SimSun
}
[
AutoFakeBold=2.17,
...
...
@@ -233,7 +210,6 @@
\setCJKfamilyfont
{
zhkai
}{
KaiTi
}
[AutoFakeBold=2.17]
\setCJKfamilyfont
{
zhnewhei
}{
Microsoft~YaHei
}
[BoldFont=Microsoft~YaHei~Bold]
}
\NewDocumentCommand\set
_
chinese
_
fontset
_
macos
{}{
\msg
_
redirect
_
name:nnn
{
fontspec
}
{
no-script
}
{
info
}
% 移除 does not contain script "CJK" 警告
\setCJKmainfont
{
Songti~SC~Light
}
[
...
...
@@ -258,7 +234,6 @@
]
\setCJKfamilyfont
{
zhnewhei
}{
PingFang~SC
}
}
\NewDocumentCommand\set
_
chinese
_
fontset
_
fandol
{}{
\msg
_
redirect
_
name:nnn
{
fontspec
}
{
no-script
}
{
info
}
% 移除 does not contain script "CJK" 警告
\setCJKmainfont
{
FandolSong-Regular
}
[
...
...
@@ -280,7 +255,6 @@
Extension=.otf,
AutoFakeBold=2.17]
}
\NewDocumentCommand\set
_
chinese
_
fontset
_
founder
{}{
% FZSSK 方正书宋(简繁扩展) http://www.foundertype.com/index.php/FontInfo/index/id/151 免费商用
% FZXBSK 方正小标宋(简繁扩展) http://www.foundertype.com/index.php/FontInfo/index/id/164 设计师非商免费
...
...
@@ -311,7 +285,6 @@
Extension=.ttf,
BoldFont=FZYouHK
_
511M]
}
\NewDocumentCommand\set
_
chinese
_
fontset
_
noto
{}{
% 思源宋体 https://www.google.com/get/noto/#serif-hans
\setCJKmainfont
[
...
...
@@ -349,7 +322,6 @@
\setCJKfamilyfont
{
zhfs
}{
方正仿宋简体
}
[AutoFakeBold=2.17]
\setCJKfamilyfont
{
zhkai
}{
方正楷体简体
}
[AutoFakeBold=2.17]
}
\bool
_
if:NTF
\nju
_
systemfont
{
% 检测是否是 Windows
...
...
@@ -392,26 +364,21 @@
{
null
}
{}
}
}
\setmathfont
{
XITSMath-Regular
}
[
BoldFont = XITSMath-Bold,
Extension = .otf]
\NewDocumentCommand\songti
{}{
\CJKfamily
{
zhsong
}}
\NewDocumentCommand\heiti
{}{
\CJKfamily
{
zhhei
}}
\NewDocumentCommand\fangsong
{}{
\CJKfamily
{
zhfs
}}
\NewDocumentCommand\kaishu
{}{
\CJKfamily
{
zhkai
}}
\fancypagestyle
{
njuplain
}{
%
\fancyhead
{}
\fancyfoot
[C]
{
\zihao
{
5
}
\thepage
}
% 页脚居中 五号新罗马体数字
}
\fancypagestyle
{
njuheadings
}{
%
\fancyhead
{}
\fancyfoot
[C]
{
\zihao
{
5
}
\thepage
}
}
\str
_
if
_
eq:NNTF
{
\nju
_
degree
}
{
ug
}
{
% the header line
...
...
@@ -430,7 +397,6 @@
% \AtBeginDocument{\pagestyle{njuplain}} % 无页眉页脚
\AtBeginDocument
{
\pagestyle
{
headings
}}
% 研究生有页眉页脚
}
\ctexset
{
contentsname = 目录,
listfigurename = 插图清单,
...
...
@@ -463,13 +429,11 @@
{
\contentslabel
{
3em
}}
{
\hspace*
{
-4em
}}
{
~
\titlerule*
[0.6pc]
{$
.
$}
~
\contentspage
}
\cs
_
set:Npn
\CTEX
@addtocline #1#2
{
\addcontentsline
{
toc
}
{
#1
}
{
\use
:c
{
CTEX@#1@tocline
}
{
#1
}
{
#2
}
}
}
\cs
_
new:Npn
\nju
_
tocpagestyle:nnn #1 #2 #3
{
\newpage
...
...
@@ -484,7 +448,6 @@
\@
starttoc
{
#3
}
%
\cleardoublepage
}
\tl
_
set:Nn
\tableofcontents
{
\nju
_
tocpagestyle:nnn
{
目
\hspace
{
2em
}
录
}{
\contentsname
}{
toc
}
...
...
@@ -497,7 +460,6 @@
{
\nju
_
tocpagestyle:nnn
{
\listtablename
}{
\listtablename
}{
lot
}
}
\newenvironment
{
preface
}
{
%
\chapter*
{
前言
}
...
...
@@ -508,9 +470,6 @@
\chapter*
{
致谢
}
\addcontentsline
{
toc
}{
chapter
}{
致谢
}
}{}
\ProvidesExplPackage
{
profile/reference
}{
2021-09-11
}{
0.6.0
}{
NJU Thesis bibliography and reference
}
\RequirePackage
[
style=gb7714-2015,
%style=numeric-comp,
...
...
@@ -534,7 +493,6 @@
% gbpub=false, % Uncomment if you do NOT want '[S.l. : s.n.]' in reference entries, GitHub Issue (#47)
% gbnamefmt=lowercase, % Uncomment if you do NOT want uppercase author names in reference entries, GitHub Issue (#23)
]
{
biblatex
}
\AtEveryBibitem
{
\clearfield
{
abstract
}
\clearfield
{
issn
}
...
...
@@ -545,7 +503,6 @@
\clearfield
{
eprint
}
\ifentrytype
{
online
}{}{
\ifentrytype
{
misc
}{}{
\clearfield
{
url
}}}
}
\crefdefaultlabelformat
{
#2#1#3
\,
}
% 默认在名称后面添加空格
\crefname
{
figure
}{
图
}{
图
}
...
...
@@ -558,9 +515,6 @@
\crefformat
{
subsubsection
}{
第~#2#1#3~小节
}
\crefname
{
appendix
}{
附录
}{
附录
}
\ProvidesExplPackage
{
profile/components
}{
2021-09-11
}{
0.6.0
}{
NJU Thesis components configuration
}
\floatsetup
[lstlisting]
{
% Captions for lstlistings
capposition=above,
%
margins=centering,
%
...
...
@@ -576,7 +530,6 @@ capposition=above,%
margins=centering,
%
floatwidth=
\textwidth
%
}
\lstset
{
basicstyle=
\ttfamily\linespread
{
1
}
\small\selectfont
,
keywordstyle=
\bfseries
,
% use bold style for keywords
...
...
@@ -590,12 +543,10 @@ basicstyle=\ttfamily\linespread{1}\small\selectfont,
breaklines=true,
xleftmargin=2em,xrightmargin=2em,
% set the width of the code environment
}
\lstdefinestyle
{
LaTeX
}{
language=TeX,
morekeywords=
{
begin, caption, label, mathrm, frac, toprule, midrule, bottomrule, includegraphics
}
}
\DeclareCaptionFont
{
songticap
}{
\zihao
{
5
}
\bf\songti
}
\captionsetup
{
font=small,
%
...
...
@@ -606,14 +557,12 @@ hypcap=true, % Links point to the top of the figure
aboveskip=6pt,
% Increase the space between the figure and the caption
belowskip=6pt,
% Increase the space between the caption and the table
}
\renewcommand
{
\labelitemi
}{
\tiny
$
\blacktriangleright
$}
\renewcommand
{
\labelitemii
}{
\textbullet
}
\setlist
[itemize]
{
noitemsep
}
\setlist
[enumerate]
{
noitemsep
}
\setlist
[description]
{
noitemsep
}
\declaretheoremstyle
[
%spaceabove=.5\thm@preskip,
%spacebelow=.5\thm@postskip,
...
...
@@ -627,10 +576,8 @@ belowskip=6pt, % Increase the space between the caption and the table
]
{
njuthm
}
\theoremstyle
{
njuthm
}
\let\oldproofname
=
\proofname
\renewcommand*
{
\proofname
}{
\rm\bf\songti
{
\oldproofname
}}
% 修改证明环境标题
\declaretheorem
[
name=算法,
style=njuthm,
...
...
@@ -711,11 +658,7 @@ refname={定理,定理},
Refname=
{
定理,定理
}
,
numberwithin=section,
]
{
theorem
}
\ProvidesExplPackage
{
profile/cover
}{
2021-09-11
}{
0.7.0
}{
NJU Thesis cover design
}
\tl
_
const:Nn
\nju
_
title
{
\nju
_
title
_
a
\nju
_
title
_
b
\nju
_
title
_
c
}
\bool
_
if:NTF
\nju
_
second
_
mentor
{
\tl
_
const:Nn
\nju
_
mentor
_
full
...
...
@@ -739,7 +682,6 @@ numberwithin=section,
\nju
_
mentor
_
a
_
en
\ \nju
_
mentor
_
a
_
title
_
en
}
}
\str
_
if
_
eq:NNTF
{
\nju
_
degree
}
{
ug
}
{
% 本科
...
...
@@ -790,7 +732,6 @@ numberwithin=section,
{
phd
}
{
\tl
_
const:Nn
\nju
_
degree
_
title
{
博士
}
}
}
}
\str
_
if
_
eq:NNTF
{
\nju
_
type
}
{
thesis
}
{
\tl
_
const:Nn
\nju
_
type
_
name
...
...
@@ -800,7 +741,6 @@ numberwithin=section,
\tl
_
const:Nn
\nju
_
type
_
name
{
\nju
_
degree
_
name 毕
\hfill
业
\hfill
设
\hfill
计
}
}
\tl
_
new:N
\nju
_
printcoverinfo
_
ug
\tl
_
set:Nn
\nju
_
printcoverinfo
_
ug
{
...
...
@@ -860,7 +800,6 @@ numberwithin=section,
&
\nju
_
cover
_
underline
_
ug:nn
{
250pt
}{
\nju
_
submit
_
date
}
\\
\end{tabular}
}
\tl
_
new:N
\nju
_
printcoverinfo
_
g
\tl
_
set:Nn
\nju
_
printcoverinfo
_
g
{
...
...
@@ -892,11 +831,9 @@ numberwithin=section,
&
\nju
_
cover
_
underline
_
g:n
{
\nju
_
mentor
_
full
}
\\
\end{tabular}
}
\tl
_
new:N
\nju
_
printcover
_
nl
% 国家图书馆封面
\tl
_
new:N
\nju
_
printcover
_
ug
% 本科封面
\tl
_
new:N
\nju
_
printcover
_
g
% 研究生封面
\bool
_
if:NT
\nju
_
nl
_
cover
{
\tl
_
set:Nn
\nju
_
printcover
_
nl
...
...
@@ -1065,9 +1002,6 @@ numberwithin=section,
\nju
_
printcover
_
g
% 研究生封面
}
}
\ProvidesExplPackage
{
profile/abstract
}{
2021-09-11
}{
0.7.0
}{
NJU Thesis abstract design
}
\str
_
if
_
eq:NNTF
{
\nju
_
degree
}
{
ug
}
{
% 本科摘要环境
...
...
This diff is collapsed.
Click to expand it.
njuthesis.dtx
+
349
−
69
View file @
664ed1ef
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment