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
9dc733ea
Commit
9dc733ea
authored
3 years ago
by
Yu Xiong
Browse files
Options
Downloads
Patches
Plain Diff
feat: 使用class选项控制字体
parent
a20d5a55
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
njuthesis.cls
+4
-1
4 additions, 1 deletion
njuthesis.cls
njuthesis.tex
+5
-2
5 additions, 2 deletions
njuthesis.tex
profile/font.sty
+18
-10
18 additions, 10 deletions
profile/font.sty
with
27 additions
and
13 deletions
njuthesis.cls
+
4
−
1
View file @
9dc733ea
...
...
@@ -6,7 +6,8 @@
\SetupKeyvalOptions
{
family=njuthesis,
prefix=
prefix=,
% 故意留空防止出现大量@,但估计要发布CTAN还得加回去
setkeys=
\kvsetkeys
}
\LoadClass
[
...
...
@@ -22,6 +23,8 @@
\DeclareStringOption
[1]
{
TitleLength
}
\DeclareStringOption
[UG]
{
Degree
}
\DeclareStringOption
[thesis]
{
Type
}
\DeclareBoolOption
[true]
{
UseSysFont
}
\DeclareStringOption
[linux]
{
CustomChFont
}
\DeclareStringOption
[linux]
{
CustomEnFont
}
\ProcessKeyvalOptions*\relax
...
...
This diff is collapsed.
Click to expand it.
njuthesis.tex
+
5
−
2
View file @
9dc733ea
...
...
@@ -18,8 +18,11 @@
\documentclass
[
TitleLength=2,
% 选择标题行数,范围是1~3
Degree=UG,
% UG: 本科
Type=thesis
% thesis: 毕业论文,design: 毕业设计
]
{
njuthesis
}
Type=thesis,
% thesis: 毕业论文,design: 毕业设计
% UseSysFont=false,% 自定义字体请反注释此项
% CustomChFont=linux,% 设置中文字符集
% CustomEnFont=linux,% 设置英文字符集
]
{
njuthesis
}
% 输入个人信息
\input
{
coverinfo.tex
}
...
...
This diff is collapsed.
Click to expand it.
profile/font.sty
+
18
−
10
View file @
9dc733ea
...
...
@@ -152,6 +152,7 @@
}
% 根据操作系统选择相应字体
\ifUseSysFont
% 检测是否是 Windows
\sys
_
if
_
platform
_
windows:TF
{
...
...
@@ -171,17 +172,24 @@
\set
_
chinese
_
fontset
_
fandol
}
}
% 选择其他字体,请确保相应字体已安装并自行取消注释
% 使用方正字体
% \set_chinese_fontset_founder
% 使用思源宋体+思源黑体
% \set_chinese_fontset_noto
\else
% 如果用户需要自定义
\str
_
case:nnTF
{
\CustomChFont
}
{
{
windows
}{
\set
_
chinese
_
fontset
_
windows
}
{
macos
}{
\set
_
chinese
_
fontset
_
macos
}
{
linux
}{
\set
_
chinese
_
fontset
_
fandol
}
{
founder
}{
\set
_
chinese
_
fontset
_
founder
}
% 使用方正字体
{
noto
}{
\set
_
chinese
_
fontset
_
noto
}
% 使用思源宋体+思源黑体
}
\str
_
case:nnTF
{
\CustomEnFont
}
{
{
windows
}{
\set
_
latin
_
fontset
_
windows
}
{
macos
}{
\set
_
latin
_
fontset
_
macos
}
{
linux
}{
\set
_
latin
_
fontset
_
gyre
}
}
\fi
% 我是 Linux 用户,但我用 Windows 字体(请您赶快坐到主席台上来)
% \set_latin_fontset_windows
% \set_chinese_fontset_windows
% 选择其他字体,请确保相应字体已安装
% 设置数学字体 (XITS, 或者 STIX, 与 Times New Roman 最为相近)
% \setmathfont{STIXTwoMath-Regular}[Extension = .otf]
...
...
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