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
3ddf9609
Commit
3ddf9609
authored
3 years ago
by
Yu Xiong
Browse files
Options
Downloads
Patches
Plain Diff
feat: 给专有命令加上了宏集前缀,简化了自定义字体的表达式
parent
c1cd3bdb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
njuthesis.cls
+8
-8
8 additions, 8 deletions
njuthesis.cls
njuthesis.tex
+7
-7
7 additions, 7 deletions
njuthesis.tex
profile/cover.sty
+3
-3
3 additions, 3 deletions
profile/cover.sty
profile/font.sty
+14
-21
14 additions, 21 deletions
profile/font.sty
with
32 additions
and
39 deletions
njuthesis.cls
+
8
−
8
View file @
3ddf9609
\NeedsTeXFormat
{
LaTeX2e
}
\ProvidesClass
{
njuthesis
}
\ProvidesClass
{
njuthesis
}
[2021/09/10 NJU Thesis Undergraduate LaTeX Template]
\RequirePackage
{
kvoptions
}
\SetupKeyvalOptions
{
family=njuthesis,
prefix=,
% 故意留空防止出现大量@,但估计要发布CTAN还得加回
去
prefix=
nju@
,
% 故意留空防止出现大量@,但估计要发布CTAN还得加回
nju@。
setkeys=
\kvsetkeys
}
...
...
@@ -20,12 +20,12 @@
zihao=-4
]
{
ctexbook
}
[2018/04/01]
\DeclareStringOption
[1]
{
T
itle
L
ength
}
\DeclareStringOption
[UG]
{
D
egree
}
\DeclareStringOption
[thesis]
{
T
ype
}
\DeclareBoolOption
[true]
{
UseSysF
ont
}
\DeclareStringOption
[windows]
{
C
ustom
EnF
ont
}
\DeclareStringOption
[windows]
{
C
ustom
ZhF
ont
}
\DeclareStringOption
[1]
{
t
itle
l
ength
}
\DeclareStringOption
[UG]
{
d
egree
}
\DeclareStringOption
[thesis]
{
t
ype
}
\DeclareBoolOption
[true]
{
systemf
ont
}
\DeclareStringOption
[windows]
{
c
ustom
latinf
ont
}
\DeclareStringOption
[windows]
{
c
ustom
chinesef
ont
}
\ProcessKeyvalOptions*\relax
...
...
This diff is collapsed.
Click to expand it.
njuthesis.tex
+
7
−
7
View file @
3ddf9609
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% NJU Thesis Undergraduate
% 南京大学本科生毕业论文LaTeX模板
% Version 0.4.
0
(2021-09-10)
% Version 0.4.
1
(2021-09-10)
%
% 请关注项目地址以获取最新变化
% https://github.com/nju-lug/NJUThesisUndergraduate
...
...
@@ -16,12 +16,12 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass
[
T
itle
L
ength=2,
% 选择标题行数,范围是1~3
D
egree=UG,
% UG: 本科
T
ype=thesis,
% thesis: 毕业论文,design: 毕业设计
% UseSysF
ont=false,% 自定义字体请反注释此项
% C
ustom
EnF
ont=windows,% 设置英文字符集
% C
ustom
ZhF
ont=windows,% 设置中文字符集
t
itle
l
ength=2,
% 选择标题行数,范围是1~3
% d
egree=UG,% UG: 本科
t
ype=thesis,
% thesis: 毕业论文,design: 毕业设计
systemf
ont=false,
% 自定义字体请反注释此项
c
ustom
latinf
ont=windows,
% 设置英文字符集
c
ustom
chinesef
ont=windows,
% 设置中文字符集
]
{
njuthesis
}
% 输入个人信息
...
...
This diff is collapsed.
Click to expand it.
profile/cover.sty
+
3
−
3
View file @
3ddf9609
...
...
@@ -41,7 +41,7 @@
\coverbox
:n
{
专
\hfill
业
}
&
\cover
_
underline:nn
{
250pt
}{
\songti\Major
}
\\
\int
_
case:nn
{
\
T
itle
L
ength
}
\int
_
case:nn
{
\
nju
@t
itle
l
ength
}
{
{
1
}
{
\coverbox
:n
{
题
\hfill
目
}
...
...
@@ -91,10 +91,10 @@
}
% 判断类型
\str
_
if
_
eq:eeTF
{
\
D
egree
}
{
UG
}
\str
_
if
_
eq:eeTF
{
\
nju
@d
egree
}
{
UG
}
{
\tl
_
const:Nn
\Degreename
{
本
\hfill
科
\hfill
}}{}
\str
_
if
_
eq:eeTF
{
\
T
ype
}
{
thesis
}
\str
_
if
_
eq:eeTF
{
\
nju
@t
ype
}
{
thesis
}
{
\tl
_
const:Nn
\typename
{
\Degreename
毕
\hfill
业
\hfill
论
\hfill
文
}}
{
\tl
_
const:Nn
\typename
{
\Degreename
毕
\hfill
业
\hfill
设
\hfill
计
}}
...
...
This diff is collapsed.
Click to expand it.
profile/font.sty
+
14
−
21
View file @
3ddf9609
...
...
@@ -152,7 +152,7 @@
}
% 根据操作系统选择相应字体
\if
UseSysF
ont
\if
nju
@systemf
ont
% 检测是否是 Windows
\sys
_
if
_
platform
_
windows:TF
{
...
...
@@ -173,29 +173,22 @@
}
}
\else
% 如果用户需要自定义
% tl_case:Nn 只能实现宏和宏之间的比较,不能直接实现字符串和宏的比较,无奈出此下策,希望之后能找到更优雅的写法
\tl
_
const:Nn
\usingwindows
{
windows
}
\tl
_
const:Nn
\usingmacos
{
macos
}
\tl
_
const:Nn
\usingfandol
{
fandol
}
\tl
_
const:Nn
\usinggyre
{
gyre
}
\tl
_
const:Nn
\usingfounder
{
founder
}
\tl
_
const:Nn
\usingnoto
{
noto
}
\tl
_
const:Nn
\usingnull
{
null
}
\tl
_
case:Nn
{
\CustomEnFont
}
% 此处需要使用\str_case_e而不是\str_case使宏展开为字符串
\str
_
case
_
e:nn
{
\nju
@customlatinfont
}
{
\using
windows
{
\set
_
latin
_
fontset
_
windows
}
\using
macos
{
\set
_
latin
_
fontset
_
macos
}
\usinggyre
{
\set
_
latin
_
fontset
_
gyre
}
\using
null
{}
{
windows
}
{
\set
_
latin
_
fontset
_
windows
}
{
macos
}
{
\set
_
latin
_
fontset
_
macos
}
{
gyre
}
{
\set
_
latin
_
fontset
_
gyre
}
{
null
}
{}
}
\
tl
_
case
:Nn
{
\CustomZhF
ont
}
\
str
_
case
_
e:nn
{
\nju
@customchinesef
ont
}
{
\using
windows
{
\set
_
chinese
_
fontset
_
windows
}
\using
macos
{
\set
_
chinese
_
fontset
_
macos
}
\usingfandol
{
\set
_
chinese
_
fontset
_
fandol
}
\using
founder
{
\set
_
chinese
_
fontset
_
founder
}
% 使用方正字体
\usingnoto
{
\set
_
chinese
_
fontset
_
noto
}
% 使用思源宋体+思源黑体
\using
null
{}
{
windows
}
{
\set
_
chinese
_
fontset
_
windows
}
{
macos
}
{
\set
_
chinese
_
fontset
_
macos
}
{
gyre
}
{
\set
_
chinese
_
fontset
_
gyre
}
{
founder
}
{
\set
_
chinese
_
fontset
_
founder
}
{
noto
}
{
\set
_
chinese
_
fontset
_
noto
}
{
null
}
{}
}
\fi
% 我是 Linux 用户,但我用 Windows 字体(请您赶快坐到主席台上来)
...
...
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