Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cloustile/njuthesis
  • GGbond/njuthesis
  • caomeng/njuthesis
  • yilye/njuthesis
  • kopanswer/njuthesis
  • Dansen/njuthesis
  • junjimy/njuthesis
  • wuqizuo123/njuthesis
  • zxlll-/njuthesis
  • Michael/njuthesis
  • bcbhfz/njuthesis
  • LingDu/njuthesis
  • jiejiangwu/njuthesis
  • Tilnel/njuthesisundergraduate
  • nju-lug/nju-latex-templates/njuthesis
15 results
Show changes
Commits on Source (380)
Showing
with 1306 additions and 470 deletions
root = true
[*]
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
end_of_line = lf
indent_style = space
[*.{dtx,tex,bib,def}]
indent_size = 2
# 贡献者公约
## 我们的承诺
身为项目成员、贡献者、负责人,我们保证参与此社区的每个人都不受骚扰,不论其年龄、体型、身体条件、民族、性征、性别认同与表现、经验水平、教育程度、社会地位、国籍、相貌、种族、宗教信仰及性取向如何。
我们承诺致力于建设开放、友善、多元、包容、健康的社区环境。
## 我们的准则
有助于促进本社区积极环境的行为包括但不限于:
* 与人为善、推己及人
* 尊重不同的主张、观点和经历
* 积极提出、耐心接受有益批评
* 面对过失,承担责任、认真道歉、从中学习
* 关注社区共同诉求,而非一己私利
不当行为包括但不限于:
* 发布与性有关的言论或图像,以及任何形式的献殷勤或勾引
* 挑衅行为、侮辱或贬损的言论、人身及政治攻击
* 公开或私下骚扰
* 未获明确授权擅自发布他人的资料,如地址、电子邮箱等
* 其他有理由认定为违反职业操守的不当行为
## 落实之义务
社区负责人有责任诠释何谓“妥当行为”,并据此准则,妥善公正地认定与处置不当、威胁、冒犯及有害的行为。
社区负责人有权利和义务删除、编辑、拒绝违背本公约的评论(comment)、提交(commit)、代码、维基(wiki)编辑、问题(issue)等贡献。如有必要,需告知采取措施之理由。
## 适用范围
此行为标准适用于本社区全部场合,以及在其他场合代表本社区的个人。
代表本社区的情形包括但不限于:使用官方电子邮件与社交平台、作为指定代表参与在线或线下活动。
## 贯彻落实
如遇滥用、骚扰等不当行为,请通过 [git+nju-lug-email-3104-issue-@yaoge123.cn](mailto:git+nju-lug-email-3104-issue-@yaoge123.cn) 向纪律检查委员举报。
纪委将迅速审议并调查全部投诉。
社区全体负责人有义务保密举报者信息。
## 指导方针
社区负责人将依据下列方案判断并处置违纪行为:
### 一、督促
**社区影响**:用语不当、举止不符合职业道德或不受社区欢迎。
**处理意见**:由社区负责人予以非公开的书面警告,阐明违纪事由、解释举止如何不妥。或将要求公开道歉。
### 二、警告
**社区影响**:一起或多起事件中的违纪行为。
**处理意见**:警告继续违纪之后果、违纪者在特定时间内禁止与当事人往来、不得擅自与社区执法者往来,禁令涵盖社区内外、社交网络在内的一切联络。如有违反,可致封禁乃至开除。
### 三、封禁
**社区影响**:严重违纪行为,包括屡教不改。
**处理意见**:违纪者在特定时间内禁止与社区的任何往来或公开联络,禁止任何与当事人公开或私下往来,不得擅自与社区执法者往来。如有违反,可致开除。
### 四、开除
**社区影响**:典型违纪行为,例如屡教不改、骚扰某个人、敌对或贬低某个群体。
**处理意见**:无限期禁止违纪者与项目社区的一切公开往来。
## 来源
本行为标准改编自[参与者公约][homepage]2.0版,可在此查阅:[https://www.contributor-covenant.org/zh-cn/version/2/0/code_of_conduct.html][v2.0]
指导方针借鉴自[Mozilla纪检分级][Mozilla CoC]
此行为标准常见问题请洽:[https://www.contributor-covenant.org/faq][FAQ]
另有诸译本:[https://www.contributor-covenant.org/translations][translations]
[homepage]:https://www.contributor-covenant.org
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
name: 报告问题
description: 描述需要修复的问题
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
请使用此模板来报告*模板运行问题*,并尽可能多地提供信息。
- type: checkboxes
id: prerequisites
attributes:
label: 先决条件
options:
- label: |-
我已尝试更新[模板版本](https://github.com/nju-lug/NJUThesis/blob/master/CHANGELOG.md)
required: true
- label: |-
我已检索[模板手册](http://mirrors.ctan.org/macros/unicodetex/latex/njuthesis/njuthesis.pdf)
required: true
- label: |-
我已检索[项目 wiki](https://github.com/nju-lug/NJUThesis/wiki)
required: true
- label: |-
我已确认这个问题没有在[其他 issues](https://github.com/nju-lug/NJUThesis/issues) 中提出过。
required: true
- type: textarea
id: expected_behavior
attributes:
label: 期望的现象
placeholder: 本来应该是什么效果
validations:
required: true
- type: textarea
id: what_happened
attributes:
label: 发生了什么
placeholder: 实际发生了什么偏差,此处不妨拖拽上传截图
validations:
required: true
- type: textarea
id: minimal_working_example
attributes:
label: 最小工作示例
description: |
一段*完整的可供编译*的 LaTeX 代码,用来复现上述问题。这段代码应当从 `\documentclass` 开始,到 `\end{document}` 结束。请删除*所有不会引起该问题的内容*。譬如,对于正文格式出现的问题,不必添加 `\njusetup` `\tableofcontents` 等命令。删除无关内容是一个 debug 的过程,能帮助你我更准确地问题的根源 : D
placeholder: |
\documentclass[]{njuthesis}
...
\end{document}
render: TeX
validations:
required: true
- type: input
id: njuthesis_version
attributes:
label: njuthesis 模板版本
placeholder: v1.0.0
description: 模板版本可以在 `.log` 文件中搜索 `njuthesis` 得到。
validations:
required: true
- type: dropdown
id: source
attributes:
label: 模板获取途径
options:
- <https://tex.nju.edu.cn>
- 使用包管理器从 CTAN 安装
- 通过 GitHub Releases 或镜像站下载
- 从 Git 仓库下载
- type: dropdown
id: operating_system
attributes:
label: 操作系统
options:
- Windows
- macOS
- Linux
- type: input
id: tex_distribution
attributes:
label: TeX 发行版
placeholder: TeX Live 2022 / MiKTeX 22.1
- type: dropdown
id: compiler
attributes:
label: 编译程序
options:
- XeLaTeX
- LuaLaTeX
- type: textarea
id: more_info
attributes:
label: 额外信息
placeholder: 任何你认为有帮助的信息
- type: markdown
attributes:
value: |
-----
在提交这篇 issue 时,您将默认服从我们的[行为准则](https://github.com/nju-lug/NJUThesis/blob/master/.github/CODE_OF_CONDUCT.md)。
name: 请求新功能
description: 提出可以改进的要点
title: "[Feature]: "
labels: ["enhancement"]
body:
- type: checkboxes
id: prerequisites
attributes:
label: 先决条件
options:
- label: |-
我已尝试更新模板版本
required: true
- label: |-
我已检索[模板手册](http://mirrors.ctan.org/macros/unicodetex/latex/njuthesis/njuthesis.pdf)
required: true
- label: |-
我已检索[项目 wiki](https://github.com/nju-lug/NJUThesis/wiki)
required: true
- label: |-
我已确认这个请求没有在[其他 issues](https://github.com/tuna/issues/issues)中提出过。
required: true
- type: textarea
id: inconvenience
attributes:
label: 现有模板的不便之处
placeholder: 你的请求是否来自于使用上有不好的体验?请简要进行描述。
- type: textarea
id: possible_solution
attributes:
label: 提出可能的解决方案
placeholder: 你认为需要采取什么措施,或者你希望改进后将呈现出什么效果。
validations:
required: true
- type: textarea
id: considerations
attributes:
label: 提出考虑过的方案
placeholder: 请描述你进行过的相关尝试。
- type: textarea
id: more_info
attributes:
label: 额外信息
placeholder: 任何你认为有帮助的信息
- type: markdown
attributes:
value: |
在提交这篇 issue 时,我们默认您服从我们的[行为准则](https://github.com/nju-lug/NJUThesis/blob/master/.github/CODE_OF_CONDUCT.md)。
blank_issues_enabled: true
contact_links:
- name: 讨论
url: https://github.com/nju-lug/NJUThesis/discussions/new
about: 使用上的疑惑可以发在论坛哦
name: Build LaTeX document
on:
name: Build
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
jobs:
build_latex:
runs-on: ubuntu-latest
strategy:
matrix:
latex: [xelatex, lualatex]
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Compile to PDF
uses: HermitSun/latex-action@v3
with:
root_file: njuthesis.dtx
latexmk_use_${{ matrix.latex }}: true
args: '-bibtex'
- name: Upload PDF
uses: actions/upload-artifact@v2
with:
name: PDF_${{ matrix.latex }}
path: njuthesis.pdf
env:
CTAN_URL: https://mirrors.rit.edu/CTAN
PACKAGES: latexmk cleveref enumitem footmisc tex-gyre xits biblatex-gb7714-2015 biber
release:
needs: build_latex
jobs:
build-on-ubuntu:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
if: "!startsWith(github.ref, 'refs/tags/v')"
env:
SET_PATH: |
export PATH=/tmp/texlive/bin/x86_64-linux:$PATH
steps:
- name: Set up Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Github Action for LaTeX dtx to cls
uses: FengChendian/latex-dtx2cls-action@v4
with:
root_file: njuthesis.dtx
working_directory: ./
- name: Install TeX Live
run: |
${{ env.SET_PATH }}
wget ${{ env.CTAN_URL }}/systems/texlive/tlnet/install-tl-unx.tar.gz
tar -xzf install-tl-unx.tar.gz
cd install-tl-20* && ./install-tl --profile ../.github/workflows/texlive.profile
- name: Zip Release Source
- name: Install latest njuthesis
run: |
zip -r njuthesis.zip . -x ".git/*" "*.ins" ".github/*" ".gitignore" "*.dtx"
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: PDF_xelatex
- name: Zip CTAN Source
${{ env.SET_PATH }}
tlmgr option repository ${{ env.CTAN_URL }}/systems/texlive/tlnet/
tlmgr install xetex l3build
l3build install
cd scripts
bash download.sh ${{ env.CTAN_URL }}
cd data
wget https://raw.githubusercontent.com/stone-zeng/tl-depend-analysis/data/data/tl-depend.json
cd ..
python3 main.py --pkg "${{ env.PACKAGES }}" --exclude "njuthesis-doc.cls"
tlmgr update --self --all --no-auto-install
- name: Compile test file
run: |
mkdir -p njuthesis/
cp njuthesis.pdf njuthesis/njuthesis.pdf
cp README.md njuthesis/README_ZH_CN.md
cp README_EN.md njuthesis/README.md
cp -r figure/ LICENSE njuthesis.dtx njuthesis/
zip -r njuthesis_ctan.zip njuthesis/
- uses: "marvinpinto/action-automatic-releases@latest"
${{ env.SET_PATH }}
cd test
latexmk -xelatex -halt-on-error test-xetex-undergraduate
xelatex -halt-on-error test-xetex-graduate
xelatex -halt-on-error test-xetex-graduate-nlcover
# latexmk -lualatex -halt-on-error test-luatex
- name: Upload CLS Files
uses: actions/upload-artifact@v4
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
njuthesis.pdf
njuthesis.zip
njuthesis_ctan.zip
name: "njuthesis-cls-${{ github.sha }}"
path: |
build/unpacked/njuthesis.cls
build/unpacked/*.def
name: Release
on:
push:
branches:
- master
tags:
- v*
env:
CTAN_URL: https://mirrors.rit.edu/CTAN
PACKAGES: cm-unicode tex-gyre tex-gyre-math lexend xits natbib makeindex
jobs:
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
env:
SET_PATH: |
export PATH=/tmp/texlive/bin/x86_64-linux:$PATH
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Set Version
run: echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Install TeX Live
run: |
${{ env.SET_PATH }}
wget ${{ env.CTAN_URL }}/systems/texlive/tlnet/install-tl-unx.tar.gz
tar -xzf install-tl-unx.tar.gz
cd install-tl-20* && ./install-tl --profile ../.github/workflows/texlive.profile
- name: Install latest njuthesis
run: |
${{ env.SET_PATH }}
tlmgr option repository ${{ env.CTAN_URL }}/systems/texlive/tlnet/
tlmgr install xetex l3build
l3build install
cd scripts
bash download.sh ${{ env.CTAN_URL }}
cd data
wget https://raw.githubusercontent.com/stone-zeng/tl-depend-analysis/data/data/tl-depend.json
cd ..
python3 main.py --pkg "${{ env.PACKAGES }}" --exclude "njuthesis.cls"
tlmgr update --self --all --no-auto-install
- name: Install latest ctex
run: |
${{ env.SET_PATH }}
git clone https://github.com/CTeX-org/ctex-kit.git
cd ctex-kit/ctex
l3build install
- name: Install fonts
run: |
mkdir fonts
wget https://github.com/adobe-fonts/source-han-serif/raw/release/OTF/SimplifiedChinese/SourceHanSerifSC-SemiBold.otf
wget https://github.com/adobe-fonts/source-han-serif/raw/release/OTF/SimplifiedChinese/SourceHanSerifSC-Bold.otf
wget https://github.com/adobe-fonts/source-han-serif/raw/release/OTF/SimplifiedChinese/SourceHanSerifSC-Heavy.otf
wget https://github.com/be5invis/Iosevka/releases/download/v15.6.3/ttf-iosevka-15.6.3.zip
unzip ttf-iosevka-15.6.3.zip
cp *.otf /usr/share/fonts/
cp iosevka-lightitalic.ttf /usr/share/fonts/
cp iosevka-light.ttf /usr/share/fonts/
cp iosevka-semibold.ttf /usr/share/fonts/
chmod -x /usr/share/fonts/*.otf
chmod -x /usr/share/fonts/*.ttf
fc-cache -fv
- name: Zip CTAN package
run: |
${{ env.SET_PATH }}
l3build ctan
mv njuthesis-ctan.zip njuthesis-ctan-$VERSION.zip
mv njuthesis.pdf njuthesis-$VERSION.pdf
- name: Zip USER package
run: |
${{ env.SET_PATH }}
mv docs/* .
mv build/unpacked/* .
zip -r njuthesis-user-$VERSION.zip *.def njuthesis-sample* njuthesis.cls nju-*.pdf LICENSE CHANGELOG.md README.md
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
files: |
njuthesis-v*.pdf
njuthesis-user-v*.zip
njuthesis-ctan-v*.zip
# From latex3
# https://github.com/latex3/latex3/blob/main/support/texlive.profile
selected_scheme scheme-infraonly
TEXDIR /tmp/texlive
TEXMFSYSCONFIG /tmp/texlive/texmf-config
TEXMFSYSVAR /tmp/texlive/texmf-var
TEXMFLOCAL /tmp/texlive/texmf-local
TEXMFHOME ~/texmf
TEXMFCONFIG ~/.texlive/texmf-config
TEXMFVAR ~/.texlive/texmf-var
option_doc 0
option_src 0
tlpdbopt_autobackup 0
......@@ -12,15 +12,19 @@
*.cb2
.*.lb
## LaTeX class and package
## DocStrip generated file
*.cls
*.def
*.ins
*.sty
!docs/njuthesis-setup.def
# English README
README_EN.md
## Zip file
*.zip
## DocStrip installation file
*.ins
## Fonts
*.ttf
*.otf
## Intermediate documents:
*.hd
......@@ -31,11 +35,18 @@ README_EN.md
# these rules might exclude image files for figures etc.
# *.ps
# *.eps
# *.pdf
## Generated if empty string is given at "Please type another file name for output:"
njuthesis.pdf
njuthesis-sample.pdf
njuthesis*.pdf
test*.pdf
# Folders
build/
release/
support/
scripts/data
TDS/
temp/
mythesis/
__pycache__/
## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
......
{
"latex-workshop.latex.autoBuild.run": "never", // 禁止自动编译
"latex-workshop.latex.recipe.default": "lastUsed", // 使用前一次的编译方法
"latex-workshop.latex.tools": [
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-shell-escape",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "latexmk",
"name": "latexmk-xe",
"command": "latexmk",
"args": [
"-xelatex"
"-xelatex",
"-time",
"-interaction=nonstopmode",
"%DOCFILE%"
]
},
{
"name": "latexmk-lua",
"command": "latexmk",
"args": [
"-lualatex",
"-time",
"-interaction=nonstopmode",
"%DOCFILE%"
]
},
{
......@@ -29,23 +44,17 @@
"name": "lualatex",
"command": "lualatex",
"args": [
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "makedoc",
"command": "latexmk",
"args": [
"-xelatex",
"njuthesis.dtx"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "latexmk 🔃",
"name": "latexmk(xe)",
"tools": [
"latexmk"
"latexmk-xe"
]
},
{
......@@ -54,12 +63,6 @@
"xelatex"
]
},
{
"name": "lualatex",
"tools": [
"lualatex"
]
},
{
"name": "xe->bib->xe->xe",
"tools": [
......@@ -70,10 +73,25 @@
]
},
{
"name": "makedoc",
"name": "latexmk(lua)",
"tools": [
"latexmk-lua"
]
},
{
"name": "lualatex",
"tools": [
"makedoc"
"lualatex"
]
}
},
{
"name": "lua->bib->lua->lua",
"tools": [
"lualatex",
"biber",
"lualatex",
"lualatex"
]
},
]
}
# njuthesis 修订记录
本项目发生的变动均会记录于本文档。
本文档格式来自《[更新日志]》,本项目使用《[语义化版本]》标记版本号。
## [未发布]
### 新增
- 增加 cleveref 的复数引用名称 - [#266]
### 修复
- 修复 macoffice 选项下无法自动加载华文中宋问题 - [#269]
- 感谢 [@liudongmiao]!
- 提供新版 LaTeX2e 下兼容 cleveref 的补丁 - [#263]
### 杂项
- 手册匹配 `codehigh` 更新 - [lvjr/codehigh#12]
## [1.4.2] - 2024-11-08
### 新增
- 图表标题区分单行多行设置
- 软性规定标题和图表本身的位置关系 -[#253]
### 修复
- 修复 `macoffice` 配置的变量命名问题
### 变动
- `tableofcontents/toc-entry` 不再会影响插图清单和表格清单 -[#245]
## [1.4.1] - 2024-04-22
### 新增
- 匹配新版盲审模板 - [#185]
- 作者和导师姓名用占位符代替
- 默认显示学校信息
- 恢复显示摘要页的年级
- 成果列表中仅显示期刊和年份
- `anonymous` 选项不接受输入值
- 盲审模式可选择是否隐藏学校信息 - [#251]
- 新增 `anonymous-mode/no-nju` 选项
### 修复
- 修复成果列表中文姓名加粗的问题 - [#192]
- 修复 LuaLaTeX 下华文中宋的载入问题
- 修复 LuaLaTeX 下的摘要页多余换行 - [#248]
## [1.4.0] - 2024-03-19
### 新增
- 增加 `macoffice` 字体配置 - [#164],[#169]
- 感谢 [@liudongmiao]!
### 修复
- 修复定理类环境在共享计数器时的 `cleveref` 引用名问题 - [#234]
- 将部分 `hyperref` 默认设置项放在导言区前以便用户覆盖
- 修正 `tabularray` 默认标题间距
- 修复本科生诚信承诺书的换行问题
- 修复导师名和职称之间没有空格的问题 - [#243]
- 使用正确的变量类型 - [#240],[#243]
- 感谢 [@muzimuzhi]!
- 匹配 l3doc 的修改 - [CTeX-org/ctex-kit#700], [CTeX-org/ctex-kit#703]
- `draft` 选项不接受输入值
### 杂项
- 跟进 2024 届本科毕业论文规定
- 美化 issue template 样式 - [#241]
- 感谢 [@muzimuzhi]!
## [1.3.2] - 2023-12-05
### 变动
- 调整专业型学位封面的 `info/major` 项填写逻辑 - [#232]
- 感谢 [@liudongmiao]!
### 修复
- 修复双导师命令问题 - [#230]
## [1.3.1] - 2023-11-14
### 新增
- 整合表格环境字体设置 - [#94]
- 可以手动指定华文中宋文件位置 - [#229]
- 匹配 LaTeX3 的 e 型展开修改 - [CTeX-org/ctex-kit#678]
### 修复
- 修复英文标题超长引发的页面元素混乱 - [#217]
- 修复英文标题手动换行与摘要页的冲突 - [#227]
### 杂项
- 将 CI 上传的 PDF 更换为模板格式文件
## [1.3.0] - 2023-06-06
### 新增
- 新增定理类环境共享计数器选项 `theorem/share-counter` - [#207]
- 自动补全研究生专业型学位封面上的专业信息 - [#208]
- 增加 `info/major` 定义方式
### 修复
- 修复批量创建环境时缺少 `\crefname` 的问题 - [#206]
- 修复禁用 `unicode-math` 时仍会配置数学字体的问题 - [#216]
- 修复非研究生类型时调用 `nl-cover` 选项的错误
- 将本科生封面信息恢复至 v1.1 的宋体格式
- 修复研究生出版授权书的打勾机制 - [#223]
### 杂项
- 手册源码部分添加语法高亮
- 手册样式设置拆分为单独的 `njuthesis-doc.cls`
- 默认密级信息修改为“公开” - [#213]
- 使用 [`tl-depend-analysis`] 重构 CI 脚本
- 感谢 [@stone-zeng]!
## [1.2.1] - 2023-05-03
### 修复
- 修复国家图书馆封面学位丢失的学位名称 - [#204]
- 新增研究生中文学位名称选项 `info/degree` - [#200]
- 修复研究生封面上学号下划线长度不足的问题
### 杂项
- 提供紫色版本的校名校徽图片
## [1.2.0] - 2023-05-02
### 新增
- 跟进 2023 年研究生学位论文模板新设计 - [#204]
- 新增研究生英文学位名称选项 `info/degree*` - [#200]
- 新增研究生英文摘要条目内容下划线选项 `abstract/underline` - [#202]
### 修复
- 更正本科生模板封面和承诺书样式
- 盲审模式下隐藏年级和学校名称 - [#181]
- 修复章末参考文献表与成果列表的冲突问题 - [#191]
## [1.1.2] - 2023-01-15
### 修复
- 补回研究生英文摘要页的下划线 - [#166]
- 修复研究生封面上第二导师的显示问题 - [#172]
- 修复 `\njusetname` 的可选参数问题
### 变动
- 本科生模板封面校徽居中 - [#173]
### 杂项
- 跟进 2023 届本科毕业论文规定
- 跟进新版南大 TeX 网站
## [1.1.1] - 2022-12-04
### 修复
- 修复研究生封面上导师信息的居中问题 - [#165]
- 修复 macOS 下 Times New Roman 字体缺失字型的问题 - [#169]
- 感谢 [@AlphaZTX]!
- 修复国家图书馆封面的编译死循环问题 - [#170]
### 杂项
- 手册中暂时撤去关于南大 TeX 网站的内容
## [1.1.0] - 2022-10-23
### 新增
- 盲审模式下不显示致谢
- 新增脚注圈码选项 `footnote/circled``footnote/circled*` - [#129]
- 新增脚注的悬挂缩进选项 `hang` - [#129]
### 修复
- 修复国家图书馆封面的编译错误
- 修复研究生英文封面的学位信息
- 更正盲审模式隐藏的个人信息类别
- 修复 `\le``\ge` 的定义
### 变动
- 脚注默认进行悬挂缩进
### 杂项
- 手册中以黄色突出选项
## [1.0.0] - 2022-08-07
### 新增
- 新增博士后出站报告模板
- 新增数学字体选项 `math-font`
- 新增默认字号选项 `zihao`
- 新增行距选项 `linespread`
- 新增最小化模式选项 `minimal`
- 新增禁用若干内置宏包的选项
- `\njusetup` 提供更多选项输入模式
- 可为目录中的章标题添加引导线 - [#66]
- 新增编号连接符设置 `label-sep` - [#134]
- 适配 `tabularray` 的表格样式设置 - [#134]
- 新增一系列数学符号选项 `math` - [#142]
- 可使用 `\njusetlength` 修改下划线的宽度和偏移 - [#155]
- 可使用 `\njusetformat` 修改本科摘要标签格式 - [#155]
- 为页面对象添加书签属性
### 修复
- 修正元素对象的底部间距设置
### 变动
- 调整 `type``degree` 文档类选项的定义 - [#117]
- 移除毕业设计封面
- `nlcover` 选项更名为 `nl-cover`
- `blind` 选项更名为 `anonymous`
- 调整定理类环境选项 `theorem`
- 摘要、目录、页眉页脚设置项更名
- 调整研究生模板的封面布局 - [#144]
- 移除研究生英文摘要的下划线
- 移除内置的 `mathtools`
- 内部变量与函数重新命名
### 杂项
- 删除手册中的基础教学内容
- 在手册中以不同颜色指示不同模块
## [0.20.0] - 2022-06-10
### 新增
- 日期设置项可以通过留空生成空白的年月日字样 - [#150]
- 自动处理大于四的评审委员会人数 - [#150]
- 可使用 `\njusetformat` 修改页眉页脚样式
- 可使用 `\njusetformat` 修改内置校名校徽颜色
### 修复
- 修复 0.19.0 版本中错误的研究生英文封面日期
- 修复 0.19.0 版本中错误的本科生目录条目样式
- 修复英文关键词列表不整齐的缩进间距
- 更正本科模板部分字样
## [0.19.0] - 2022-05-23
### 新增
- 可使用 `\njusetformat` 修改默认页面样式
- 对封面上的超宽文字进行压缩
- 支持专硕封面的特殊标签格式 - [#147]
- 跟进新版本科生诚信承诺书样式
- 国家图书馆样式更新
- 添加学位授予日期设置项 `info/confer-date` - [#150]
- 添加底部日期设置项 `info/bottom-date`
### 修复
- 图表标题使用粗体 -[#139]
- 修复成果列表与章末参考文献表的冲突 -[#148]
### 变动
- 将国家图书馆封面的标题字样修改为“学位论文”
- 将国家图书馆封面的评审委员会人数分离为单独参数
- 更正研究生模板普通封面上学硕和专硕不同的专业名称字样
### 杂项
- 修正文档笔误 - [#137]
- 感谢 [@note286]!
## [0.18.0] - 2022-05-01
### 新增
- 新增内置定理环境的若干设置项 - [#50]
- 新增脚注设置项 - [#129]
- 编号可使用带圈数字
- 新增盲审模式 - [#130]
### 修复
- 正确生成出版授权书前后的空白页
- 删除出版授权书页的页眉 - [#130]
- 出版授权书内双导师姓名之间添加空格 - [#130]
- 设置4、5级标题的样式
### 变动
- 微调校名校徽尺寸
### 杂项
- 说明手册中补充数学符号格式说明
## [0.17.0] - 2022-04-09
### 新增
- 提供修改固定文本的接口 - [#111]
- 提供修改长度值的接口 - [#121]
- 提供修改默认样式的接口
- 提供研究生的学位论文出版授权书 - [#116]
### 优化
- 优化封面标题的断行方式 - [#121]
- PDF 书签中不显示额外空格
### 杂项
- 说明手册中补充扫描声明页的插入方法 - [#96]
- 说明手册中增加“额外定制”一节
- 说明手册中补充页眉说明 - [#119]
- 说明手册跟进 TeX Live 2022
## [0.16.1] - 2022-03-27
### 修复
- 修复国家图书馆封面的“UDC”名称格式
- 修复研究生摘要标题的断行问题 - [#98], [#105], [#107]
- 提供 `style/abstract-title` 设置项
- 为研究生摘要补上“摘要”小标题字样 - [#99]
## [0.16.0] - 2022-03-19
### 新增
- 将本科生和研究生模板定义分离为单独的 `.def` 文件 - [#46]
- 可以手动指定页眉页脚 - [#85]
- 新增 `style/header` 等若干设置项
### 修复
- 研究生模板的目录、摘要等页面也显示页眉 - [#99]
### 变动
- 取消对 `njuvisual` 宏包的强制依赖
- 简化自动安装脚本
### 杂项
- 说明手册中增加对 JabRef 软件的简介
- 感谢 [@zhoujian9410]!
- 说明手册中增加数学字体样式说明 - [#89], [#92]
- 感谢 [@zepinglee]!
- 说明手册中增加宏包依赖信息
## [0.15.0] - 2022-02-20
### 新增
- 新增符号表页面 `notation` - [#61]
- 可选择是否隐藏特定目录条目
- 新增选项 `style/abstract-in-toc` - [#66]
- 新增选项 `style/toc-in-toc`
- 可使用自定义的参考文献样式 - [#71]
- 修改选项 `bib/style`
- 可传入自定义 `biblatex` 设置
- 新增选项 `bib/option`
- 增加对章末参考文献表的支持 - [#79]
- 感谢 [@hushidong]!
### 修复
- 修复了单面模式下的 `fancyhdr` 宏包警告
- 修复研究生封面上第二导师无法正确显示的问题 - [#64]
### 变动
- 为关键词列表添加悬挂缩进
- 研究生模板页眉样式及内容变动
- 使用小号楷体
- 双面模式下奇数页右侧为节名,偶数页左侧为章名
- 单面模式下页眉同时显示章节名,特殊页面居中显示其名称
- 移除内部调用的宏包
- `url`
### 优化
- 使用 `xtemplate` 重新绘制封面 - [#46]
### 杂项
- 使用 GitHub 表单重构 issue 模板
- 将使用问题引导至项目论坛
## [0.14.0] - 2022-01-16
### 新增
- 新增单双面模式 `oneside``twoside` 选项
- 新增参考文献设置项 `bib`
- 提供设置文献表样式的 `bib/style` 选项 - [#44]
- 提供导入多个文献源的 `bib/resource` 选项
- 新增外观样式设置项 `style`
- 提供更改封面校徽图片的 `style/emblem-img` 选项
- 提供更改封面校名图片的 `style/name-img` 选项
- 新增 Adobe 思源宋体 `cjk-font=source` 选项
### 变动
- 选项名称变更
- 原创性声明页选项更名为 `decl-page`
- 导师姓名职称合并在 `info/supervisor` 填写 - [#60]
- 感谢 [@zepinglee]!
- 标题选项 `info/title` 使用 `\\` 进行手动换行 - [#60]
- 感谢 [@zepinglee]!
- 使用 ISO 格式统一标记提交日期 `info/submit-date`
- 感谢 [@zepinglee]!
- 交付用户的压缩包更名为 `njuthesis-user-v*.zip`
### 移除
- 移除封面个人信息设置项
- `info/supervisor-title`
- `info/supervisor-title*`
- `info/supervisor-ii-title`
- `info/supervisor-ii-title*`
- `info/submit-date*`
- 移除内部调用的宏包
- `hologo`
- `multirow`
- `subcaption`
- `wrapfig`
### 杂项
- 将本模板内嵌入[南大 TeX] 网站
- 编写修订记录
- 修改 GitHub issue 模板,添加行为准则
- 说明手册样式调整
- 封面标题使用粗体
## [0.13.1] - 2021-12-15
<!-- 这个版本有新增功能,本应合并到 v0.14.0 -->
### 新增
- 新增草稿模式 `draft` 选项
- `orig-decl` 选项可绘制本科生诚信承诺书页面
### 变动
- 摘要格式更正
### 杂项
- 在 CTAN 发布压缩包中添加许可证文件
- 在手册中使用南大标准色作为超链接颜色
## [0.13.0] - 2021-12-13
### 修复
- 修正数学字体
- 修复页眉字符重叠的问题
### 变动
- 选项名称变更
- 英文字体选项更名为 `latin-font`
- 中文字体选项更名为 `cjk-font`
- Windows 字库选项更名为 `win`
- macOS 字库选项更名为 `mac`
- 导师信息选项名称变更为:
- `info/supervisor`
- `info/supervisor*`
- `info/supervisor-title`
- `info/supervisor-title*`
- `info/supervisor-ii`
- `info/supervisor-ii*`
- `info/supervisor-ii-title`
- `info/supervisor-ii-title*`
### 优化
- 使用 `ntheorem` 重新定制定理环境
- 使用 `ctex` 提供的命令重新定制目录样式
- 使用 LaTeX3 语法重构封面绘制命令 - [#52]
- 使用 LaTeX3 语法重构摘要绘制命令 - [#52]
### 移除
- 移除封面个人信息设置项
- `info/titlea`
- `info/titleb`
- `info/titlec`
- 移除内部调用的宏包
- `amsthm`
- `listings`
- `microtype`
- `thmtools`
- `tocloft`
## [0.12.0] - 2021-11-30
### 变动
- 将内置的 `njuvisual` 分离为独立宏包 - [#44]
- 隐式加载 `xparse`
### 杂项
- 仿照 `fduthesis` 重新组织仓库的目录结构
### 杂项
- 优化 GitHub Actions 脚本
- 新增自动安装脚本
- 手册封面添加校徽水印
## [0.11.3] - 2021-11-23
### 杂项
- 仓库中提供 TeXstudio 配置文件
## [0.11.1] - 2021-10-23
### 新增
- 对依赖的宏包进行版本检测
## [0.11.0] - 2021-10-01
### 新增
- 新增成果列表命令 `\njupaperlist`
- 将文档信息写入 PDF 元数据
### 变动
- 使用小写字母加连字符的形式重命名个人信息选项
## [0.10.0] - 2021-09-24
### 新增
- 将校名校徽图片内置化
- 使用 `njuvisual.sty` 储存 Tikz 图形
### 修复
- 修复 LuaLaTeX 编译后 PDF 书签不正确的问题 - [#14]
### 变动
## [0.9.0] - 2021-09-15
### 新增
- 使用 DocStrip 合并项目源代码
### 变动
<!-- 以下版本较为陈旧,已被完全重构 -->
## 0.3.0 -> [0.8.4] - 2021-09-12
### 新增
- 以 [NJU Thesis 2021] 为基础构建了初步可用的模板。
- 实现了本科生毕业论文或设计模板
- 实现了研究生学位论文模板
### 杂项
- 通过 GitHub Actions 实现了自动测试和打包发布
- 模板上传至 CTAN
[未发布]: https://github.com/nju-lug/NJUThesis/compare/v1.4.2...HEAD
[1.4.2]: https://github.com/nju-lug/NJUThesis/compare/v1.4.1...v1.4.2
[1.4.1]: https://github.com/nju-lug/NJUThesis/compare/v1.4.0...v1.4.1
[1.4.0]: https://github.com/nju-lug/NJUThesis/compare/v1.3.2...v1.4.0
[1.3.2]: https://github.com/nju-lug/NJUThesis/compare/v1.3.1...v1.3.2
[1.3.1]: https://github.com/nju-lug/NJUThesis/compare/v1.3.0...v1.3.1
[1.3.0]: https://github.com/nju-lug/NJUThesis/compare/v1.2.1...v1.3.0
[1.2.1]: https://github.com/nju-lug/NJUThesis/compare/v1.2.0...v1.2.1
[1.2.0]: https://github.com/nju-lug/NJUThesis/compare/v1.1.2...v1.2.0
[1.1.2]: https://github.com/nju-lug/NJUThesis/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/nju-lug/NJUThesis/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/nju-lug/NJUThesis/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/nju-lug/NJUThesis/compare/v0.20.0...v1.0.0
[0.20.0]: https://github.com/nju-lug/NJUThesis/compare/v0.19.0...v0.20.0
[0.19.0]: https://github.com/nju-lug/NJUThesis/compare/v0.18.0...v0.19.0
[0.18.0]: https://github.com/nju-lug/NJUThesis/compare/v0.17.0...v0.18.0
[0.17.0]: https://github.com/nju-lug/NJUThesis/compare/v0.16.0...v0.17.0
[0.16.1]: https://github.com/nju-lug/NJUThesis/compare/v0.16.0...v0.16.1
[0.16.0]: https://github.com/nju-lug/NJUThesis/compare/v0.15.0...v0.16.0
[0.15.0]: https://github.com/nju-lug/NJUThesis/compare/v0.14.0...v0.15.0
[0.14.0]: https://github.com/nju-lug/NJUThesis/compare/v0.13.1...v0.14.0
[0.13.1]: https://github.com/nju-lug/NJUThesis/compare/v0.13.0...v0.13.1
[0.13.0]: https://github.com/nju-lug/NJUThesis/compare/v0.12.0...v0.13.0
[0.12.0]: https://github.com/nju-lug/NJUThesis/compare/v0.11.3...v0.12.0
[0.11.3]: https://github.com/nju-lug/NJUThesis/compare/v0.11.0...v0.11.3
[0.11.0]: https://github.com/nju-lug/NJUThesis/compare/v0.10.0...v0.11.0
[0.10.0]: https://github.com/nju-lug/NJUThesis/compare/v0.9.0...v0.10.0
[0.9.0]: https://github.com/nju-lug/NJUThesis/compare/v0.8.4...v0.9.0
[0.8.4]: https://github.com/nju-lug/NJUThesis/compare/v0.3.0...v0.8.4
[#14]: https://github.com/nju-lug/NJUThesis/issues/14
[#44]: https://github.com/nju-lug/NJUThesis/issues/44
[#46]: https://github.com/nju-lug/NJUThesis/issues/46
[#50]: https://github.com/nju-lug/NJUThesis/issues/50
[#52]: https://github.com/nju-lug/NJUThesis/issues/52
[#60]: https://github.com/nju-lug/NJUThesis/issues/60
[#61]: https://github.com/nju-lug/NJUThesis/issues/61
[#64]: https://github.com/nju-lug/NJUThesis/issues/64
[#66]: https://github.com/nju-lug/NJUThesis/issues/66
[#71]: https://github.com/nju-lug/NJUThesis/discussions/71
[#79]: https://github.com/nju-lug/NJUThesis/issues/79
[#85]: https://github.com/nju-lug/NJUThesis/discussions/85
[#89]: https://github.com/nju-lug/NJUThesis/discussions/89
[#92]: https://github.com/nju-lug/NJUThesis/issues/92
[#94]: https://github.com/nju-lug/NJUThesis/discussions/94
[#96]: https://github.com/nju-lug/NJUThesis/issues/96
[#98]: https://github.com/nju-lug/NJUThesis/issues/98
[#99]: https://github.com/nju-lug/NJUThesis/discussions/99
[#105]: https://github.com/nju-lug/NJUThesis/discussions/105
[#107]: https://github.com/nju-lug/NJUThesis/issues/107
[#111]: https://github.com/nju-lug/NJUThesis/issues/111
[#116]: https://github.com/nju-lug/NJUThesis/issues/116
[#117]: https://github.com/nju-lug/NJUThesis/issues/117
[#119]: https://github.com/nju-lug/NJUThesis/issues/119
[#121]: https://github.com/nju-lug/NJUThesis/issues/121
[#129]: https://github.com/nju-lug/NJUThesis/issues/129
[#130]: https://github.com/nju-lug/NJUThesis/issues/130
[#131]: https://github.com/nju-lug/NJUThesis/issues/131
[#134]: https://github.com/nju-lug/NJUThesis/discussions/134
[#137]: https://github.com/nju-lug/NJUThesis/issues/137
[#139]: https://github.com/nju-lug/NJUThesis/discussions/139
[#142]: https://github.com/nju-lug/NJUThesis/issues/142
[#144]: https://github.com/nju-lug/NJUThesis/issues/144
[#147]: https://github.com/nju-lug/NJUThesis/discussions/147
[#148]: https://github.com/nju-lug/NJUThesis/issues/148
[#150]: https://github.com/nju-lug/NJUThesis/discussions/150
[#155]: https://github.com/nju-lug/NJUThesis/discussions/155
[#164]: https://github.com/nju-lug/NJUThesis/issues/164
[#165]: https://github.com/nju-lug/NJUThesis/discussions/165
[#166]: https://github.com/nju-lug/NJUThesis/discussions/166
[#169]: https://github.com/nju-lug/NJUThesis/issues/169
[#170]: https://github.com/nju-lug/NJUThesis/issues/170
[#172]: https://github.com/nju-lug/NJUThesis/issues/172
[#173]: https://github.com/nju-lug/NJUThesis/issues/173
[#181]: https://github.com/nju-lug/NJUThesis/issues/181
[#191]: https://github.com/nju-lug/NJUThesis/issues/191
[#192]: https://github.com/nju-lug/NJUThesis/discussions/192
[#200]: https://github.com/nju-lug/NJUThesis/discussions/200
[#202]: https://github.com/nju-lug/NJUThesis/discussions/202
[#204]: https://github.com/nju-lug/NJUThesis/issues/204
[#206]: https://github.com/nju-lug/NJUThesis/issues/206
[#207]: https://github.com/nju-lug/NJUThesis/issues/207
[#208]: https://github.com/nju-lug/NJUThesis/issues/208
[#213]: https://github.com/nju-lug/NJUThesis/issues/213
[#216]: https://github.com/nju-lug/NJUThesis/issues/216
[#217]: https://github.com/nju-lug/NJUThesis/issues/217
[#223]: https://github.com/nju-lug/NJUThesis/issues/223
[#227]: https://github.com/nju-lug/NJUThesis/issues/227
[#229]: https://github.com/nju-lug/NJUThesis/discussions/229
[#230]: https://github.com/nju-lug/NJUThesis/issues/230
[#232]: https://github.com/nju-lug/NJUThesis/issues/232
[#234]: https://github.com/nju-lug/NJUThesis/issues/234
[#243]: https://github.com/nju-lug/NJUThesis/issues/243
[#245]: https://github.com/nju-lug/NJUThesis/discussions/245
[#248]: https://github.com/nju-lug/NJUThesis/issues/248
[#251]: https://github.com/nju-lug/NJUThesis/discussions/251
[#253]: https://github.com/nju-lug/NJUThesis/pull/253
[#263]: https://github.com/nju-lug/NJUThesis/issues/263
[#266]: https://github.com/nju-lug/NJUThesis/discussions/266
[#269]: https://github.com/nju-lug/NJUThesis/pull/269
[CTeX-org/ctex-kit#678]: https://github.com/CTeX-org/ctex-kit/pull/678
[CTeX-org/ctex-kit#700]: https://github.com/CTeX-org/ctex-kit/pull/700
[CTeX-org/ctex-kit#703]: https://github.com/CTeX-org/ctex-kit/pull/703
[lvjr/codehigh#12]: https://github.com/lvjr/codehigh/issues/12
[更新日志]: https://keepachangelog.com/zh-CN/1.0.0/
[语义化版本]: https://semver.org/lang/zh-CN/
[南大 TeX]: https://tex.nju.edu.cn/
[NJU Thesis 2021]: https://github.com/FengChendian/NJUThesis2021
[`tl-depend-analysis`]: https://github.com/stone-zeng/tl-depend-analysis/
[@zepinglee]: https://github.com/zepinglee
[@hushidong]: https://github.com/hushidong
[@zhoujian9410]: https://github.com/zhoujian9410
[@note286]: https://github.com/note286
[@AlphaZTX]: https://github.com/AlphaZTX
[@stone-zeng]: https://github.com/stone-zeng
[@liudongmiao]: https://github.com/liudongmiao
[@muzimuzhi]: https://github.com/muzimuzhi
###############################################################################
#
# Makefile for the user manual of njuthesis
#
# Copyright (C) 2013 Haixing Hu,
# Department of Computer Science and Technology, Nanjing University.
#
# Home Page of the Project: https://github.com/Haixing-Hu/nju-thesis
#
###############################################################################
PROJECT=njuthesis
TEXSOURCE=$(shell ls *.tex)
BIB=njuthesis.bib
.PHONY: all clean
all: $(PROJECT).pdf
$(PROJECT).pdf: $(PROJECT).tex $(BIB) $(TEXSOURCE)
xelatex $(PROJECT).tex
biber $(PROJECT)
xelatex $(PROJECT).tex
xelatex $(PROJECT).tex
###### clean
clean:
-@rm -f \
*.aux \
*.bak \
*.bbl \
*.bcf \
*.blg \
*.dvi \
*.glo \
*.gls \
*.idx \
*.ilg \
*.ind \
*.ist \
*.loe \
*.lof \
*.log \
*.lot \
*.out \
*.ps \
*.run.xml \
*.thm \
*.toc \
The `njuthesis` class
=====================
The `njuthesis` class is intended for typesetting Nanjing University
dissertations with LaTeX, providing support for bachelor, master,
doctoral thesis and postdoctoral report. Compilation of this class
requires either `xelatex` or `lualatex` engine.
Usage
-----
A minimal example of this document class should look like
```LaTeX
\documentclass{njuthesis}
\njusetup{}
\begin{document}
\maketitle
\tableofcontents
\mainmatter
\chapter{Welcome}
Hello \LaTeX{}
\printbibliography
\end{document}
```
Contributing
------------
[Issues](https://github.com/nju-lug/NJUThesis/issues) and
[pull requests](https://github.com/nju-lug/NJUThesis/pulls)
are always welcome.
Wiki
----
Please see [Chinese wiki](https://github.com/nju-lug/NJUThesis/wiki).
License
-------
This work may be distributed and/or modified under the conditions of
the [LaTeX Project Public License](http://www.latex-project.org/lppl.txt),
either version 1.3c of this license or (at your option) any later
version.
-----
Copyright (C) 2021 - 2025 by NJU LUG.
# NJU Thesis
# NJU Thesis: 南京大学学位论文 LaTeX 模板
[![njuthesis](https://img.shields.io/badge/njuthesis-latex-blue)](https://git.nju.edu.cn/nju-lug/nju-latex-templates)
[![overleaf](https://img.shields.io/badge/overleaf-supported-brightgreen)](https://tex.nju.edu.cn)
![build status](https://github.com/nju-lug/NJUThesis/actions/workflows/build.yml/badge.svg)
[![CTAN](https://img.shields.io/ctan/v/njuthesis.svg)](https://www.ctan.org/pkg/njuthesis)
[![GitHub release](https://img.shields.io/github/release/nju-lug/NJUThesis/all.svg)](https://github.com/nju-lug/NJUThesis/releases/latest)
[![overleaf](https://img.shields.io/badge/online_editor-supported-brightgreen)](https://tex.nju.edu.cn/template)
[![nju-git](https://img.shields.io/gitlab/stars/nju-lug/nju-latex-templates/njuthesis?gitlab_url=https%3A%2F%2Fgit.nju.edu.cn&style=social)](https://git.nju.edu.cn/nju-lug/nju-latex-templates/njuthesis)
> 此项目是基于[NJU thesis 2021](https://github.com/FengChendian/NJUThesis2021)的重构版本,目前本科生版本**已经基本重构完成**,硕博论文**正在**根据研究生院的文件重构,但研究生院的规定并不完善,因此部分格式可能会参考本科的,**如果院系另有要求,请自行修改或者提交issue**。
原来的[NJU thesis 2021](https://github.com/FengChendian/NJUThesis2021)模板太过古老并且不支持硕士、博士论文,目前难以维护,因此为了模板的可持续发展,现在将对该项目进行重构,项目挂载于[NJU-LUG](https://github.com/nju-lug)组织仓库下,目前已[发布在CTAN](https://ctan.org/pkg/njuthesis)
相关文档请参见[本项目wiki](https://github.com/nju-lug/NJUThesis/wiki)
`njuthesis` 是制作南京大学本科生毕业论文、研究生学位论文、博士后出站报告的 LaTeX 文档类。本模板基于本科生院的论文撰写规范制作,同时参考研究生院提供的硕士、博士学位材料包,用于生成符合南京大学排版要求和相应的国家标准的学位论文,力求通过 LaTeX3 语法实现清晰的实现逻辑、较高的可定制性以及友好的用户接口。
## 快速开始
从0.9.0版以后,本模板以DocStrip(`.dtx`)格式进行维护,同时在仓库提供`.cls`文件以降低使用门槛
请首先阅读[用户手册](http://mirrors.ctan.org/macros/unicodetex/latex/njuthesis/njuthesis.pdf),其中详尽阐述了模板的特性和使用方法
### 如何使用DocStrip文件
对于普通用户,首要推荐使用下述的**南大 TeX 编译方法**
DocStrip合并了LaTeX源代码和文档,更有利于宏包的发布。要使用该文件,请在当前工作目录下打开终端:
### 南大 TeX 编译
- 输入`xetex njuthesis.dtx`以解出宏包内容
- 输入`latexmk njuthesis.dtx`以生成并查看内置的文档
[南大 TeX](https://tex.nju.edu.cn)[eScience 中心](https://sci.nju.edu.cn)为南大在校师生提供的在线 LaTeX 写作平台,已*安装有本模板的最新版*。注册登录后,只需在**创建新项目**菜单中选择**论文模板**即可开始写作。
请注意,由于文件重名原因,项目中的示例论文模板已被重命名为`njuthesis-sample.tex`
**使用本平台时,请积极备份自己的文稿。**
### 本地编译
1. 推荐[从南大镜像站下载](https://mirror.nju.edu.cn/download/app/TeX%20%E6%8E%92%E7%89%88%E7%B3%BB%E7%BB%9F)并安装TeXLive或者MiKTeX最新版
2. 从release下载包含[模板全部文件](https://github.com/nju-lug/NJUThesis/releases/latest)的压缩包
3. 根据需要更改`njuthesis-sample.tex`文件中的内容
4. 在模板根目录下运行`latexmk -xelatex`编译文件,得到对应的PDF
#### **关于本地编译**
- 模板支持`latexmk``xelatex``lualatex`三种编译方式
- 如果使用`latexmk`,请务必使用完整的命令`latexmk -xelatex`以免产生不必要的问题
- 如果使用`xelatex``lualatex`,需要按照`xelatex/lualatex` -> `biber` -> `xelatex/lualatex` -> `xelatex/lualatex`的顺序编译四次
- 仓库中`.vscode`附带一份VScode的LaTeX WorkShop的配置文件,可根据需要使用
### [南大TeX](https://tex.nju.edu.cn)编译
推荐使用包管理器安装 `njuthesis``njuvisual` 的最新版。
1. 从release下载包含[模板全部文件](https://github.com/nju-lug/NJUThesis/releases/latest)`njuthesis.zip`
2. 登录[南大TeX](https://tex.nju.edu.cn),点击New Project -> Upload Project上传刚刚得到的压缩包,上传后`njuthesis-sample.tex``njuthesis.cls`等文件应在根目录,0.9.0以后的目录结构如下所示:
新手同学不妨直接使用以下流程:
```shell
NJUThesis-master/
├─figure/
│ njulogo.pdf
│ njuname.pdf
│ njuthesis.bib
│ njuthesis.cls
│ njuthesis-sample.tex
```
1. [从南大镜像站下载](https://mirror.nju.edu.cn/download/app/TeX%20%E6%8E%92%E7%89%88%E7%B3%BB%E7%BB%9F)并安装最新的 TeX 发行版,并更新所有宏包
2. 下载包含[模板全部文件](https://github.com/nju-lug/NJUThesis/releases/latest)的压缩包 `njuthesis-user-v*.zip`
3. 根据需要更改 `njuthesis-sample.tex` 文件中的内容
4. 在模板根目录下运行 `latexmk -xelatex` 运行编译,得到对应的 PDF 文件
3. 在南大TeX项目内页面左上角的`Menu`中,将编译器改为`XeLaTeX`
4. 编写TeX文档
### 典型结构
### 其他
```LaTeX
\documentclass{njuthesis}
\njusetup{}
\begin{document}
\maketitle
\tableofcontents
\mainmatter
\chapter{欢迎}
使用 \LaTeX{}
\printbibliography
\end{document}
```
更多内容请参见项目Wiki中的[使用说明](https://github.com/nju-lug/NJUThesis/wiki/%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E)
## 反馈
你也可以下载[Release](https://github.com/nju-lug/NJUThesis/releases/latest)中附带的`njuthesis.pdf`,里面详尽阐述了模板的特性和使用方法。
在你遇到模板问题时,请遵守以下步骤:
## 常见问题
1. 在《[修订记录](https://github.com/nju-lug/NJUThesis/blob/master/CHANGELOG.md)》查看该问题是否已经修复但未发布;
- 若是,则可以使用仓库中的开发版本解决问题
1.[GitHub Issues](https://github.com/nju-lug/NJUThesis/issues)[Discussions](https://github.com/nju-lug/NJUThesis/discussions) 中搜索该问题的关键词;
1. 浏览[本项目 Wiki](https://github.com/nju-lug/NJUThesis/wiki)[用户手册](http://mirrors.ctan.org/macros/unicodetex/latex/njuthesis/njuthesis.pdf)
1. 在你确定这是一个新问题时
- 对于模板 bug、请求新功能、文档笔误等提出[新 issue](https://github.com/nju-lug/NJUThesis/issues/new/choose)
- 对于用法的疑惑、格式上的斟酌等提出[新 discussion](https://github.com/nju-lug/NJUThesis/discussions/new)
- 两个划分不绝对,区别在于 issue 是解决即关闭的
- 如果确实重复了,会打上 duplicate 标签并将你引导至本问题首条提问
请参见[常见问题](https://github.com/nju-lug/NJUThesis/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)
如果导师或院系有额外要求,请一同附上要求原文或格式截图
## 贡献
如果你发现了模板的问题,欢迎在Github中[提交issue](https://github.com/nju-lug/NJUThesis/issues)或者PR
欢迎提交 [PR](https://github.com/nju-lug/NJUThesis/pulls)
## 许可
本模板的发布遵守 LaTeX Project Public License(版本 1.3c 或更高)。
本模板的发布遵守 [LaTeX Project Public License(版本 1.3c 或更高)](https://www.latex-project.org/lppl/lppl-1-3c/)
#!/usr/bin/env texlua
-- Build script for njuthesis.
-- run with `l3build`
module = "njuthesis"
checkengines = {"xetex", "luatex"}
checkopts = "-interaction=batchmode"
textfiles = {"LICENSE", "README*.md", "*.ins"}
ctanreadme = "README-CTAN.md"
sourcefiledir = "source"
sourcefiles = {"*.dtx"}
installfiles = {"*.cls", "*.def"}
typesetexe = "xelatex"
typesetfiles = {"njuthesis.dtx"}
unpackexe = "xetex"
unpackfiles = {"njuthesis.dtx"}
\begin{abstract}
\zhlipsum[76][name=zhufu]
% 中文关键词,每个关键词之间用“;”分开,最后一个关键词不打标点符号
\keywords{我;就是;充数的;关键词}
\end{abstract}
\begin{englishabstract}
\blindtext
% 英文关键词。关键词之间用英文半角逗号隔开,末尾无符号。
\englishkeywords{Dummy; Keywords; Here}
\end{englishabstract}
\begin{acknowledgement}
感谢\href{https://git.nju.edu.cn/nju-lug/lug-introduction}{NJU Linux User Group}
\end{acknowledgement}
\chapter{管理参考文献}
\label{chap:bibliography}
使用\hologo{biber}作为\hologo{BibTeX}后端。相关定义位于\lstinline|profile/reference.sty|。
\section{添加和管理}
默认参考文献存储于主目录下的\lstinline|njuthesis.bib|。如果有其他来源,也可以在\lstinline|njuthesis.tex|中修改以下命令:
\begin{lstlisting}[language=TeX]
\addbibresource{njuthesis.bib}
\end{lstlisting}
\subsection{使用EndNote}
南京大学信息化建设管理服务中心已购买\href{https://itsc.nju.edu.cn/EndNote/list.htm}{EndNote}供全校师生免费试用,最新版为EndNote 20.。
\subsection{使用Zotero}
\href{https://www.zotero.org/}{Zotero}是一款免费的文献管理软件,支持所有桌面平台。
在保持Zotero程序运行的情况下,点击浏览器工具栏的Zotero Connector插件即可自动从网页抓取参考文件信息。
Zotero也有知网插件
\section{文段内引用}
\lstinline|\cite{myref}|
\lstinline|\citesuthor{myref}|
\section{引用格式}
符合GB7714-2015规范
\chapter{配置环境}
下表是目前经过测试的环境。如果有其他可用不可用的环境,欢迎补充。
\begin{table}[ht]
\caption{经过测试的环境}
% \label{tab:1}
\begin{tabular}{ccc}
\toprule
OS & TeX & 测试情况 \\
\midrule
Windows 10 & \hologo{TeX}\,Live 2021 & 通过 \\
Windows 10 & \hologo{MiKTeX} & 通过 \\
Windows 10 & \hologo{TeX}\,Live 2020 & cref存在格式问题 \\
macOS 10.15 & \hologo{TeX}\,Live 2021 & 通过 \\
Ubuntu 20.04 & \hologo{TeX}\,Live 2021 & 通过 \\
南大\hologo{TeX} & \hologo{TeX}\,Live 2021 & 通过 \\
Overleaf & \hologo{TeX}\,Live 2020 & cref存在格式问题 \\
\bottomrule
\end{tabular}
\end{table}
\section{本地编译}
\subsection{安装\hologo{TeX}发行版}
首先需要下载\hologo{TeX}软件发行版,校园网环境中使用\href{https://mirror.nju.edu.cn/download/app/TeX%20%E6%8E%92%E7%89%88%E7%B3%BB%E7%BB%9F}{南大镜像站}可以获得最好的体验。\textbf{推荐使用最新的\hologo{TeX}\,Live 2021或者\hologo{MiKTeX} 21以避免潜在的兼容性问题。}
\begin{itemize}
\item 为了避免不必要的麻烦,请尽可能下载 full 版本,如 texlive-full。简而言之,下载大的那个。
\item 并且,尽可能使用最新版(截至目前是 2021)。2020 及之前版本使用 PDF 格式的图片可能会出现加粗问题。
\end{itemize}
\subsection{选择编辑器}
配置完编译器后,还需要一个\textbf{文本编辑器}作为前端来完成\texttt{.tex}文件内容的写作。
至今仍有相当一部分人认为Windows自带的\textit{记事本}是最好的文本编辑器,但对于本项目而言,在此诚心诚意地推荐你使用\textbf{更现代更美观更多功能}的编辑器,譬如\emph{安装了 LaTeX Workshop 插件 的 \href{https://code.visualstudio.com/}{Visual Studio Code}},来完成论文编写。你也可以根据个人的喜好随便使用其他编辑器,如 TeXworks、TeX Studio 等,顺手就行。
若使用 LaTeX Workshop 插件,本项目在\lstinline|.vscode/|中提供一份简易配置,可以省略初始配置步骤直接使用。
\subsection{编译顺序}
应采用以下命令顺序进行编译,以生成正确的目录、编号和参考文献条目。
\begin{enumerate}
\item \lstinline|xelatex| / \lstinline|lualatex|
\item \lstinline|biber|
\item \lstinline|xelatex| / \lstinline|lualatex|
\item \lstinline|xelatex| / \lstinline|lualatex|
\end{enumerate}
编译产物\footnote{作为化学学生,俺认为用“产物”代替“编译生成的文件”是一个通俗易懂的说法}\lstinline|njuthesis.pdf|,位于主目录下。此外还会生成一系列中间文件,可以选择使用\lstinline|latexmk -c|进行清理。
\section{在线编译}
相信你在接触了本地编译以后,很快就会意识到一些十分显然的事实,譬如\hologo{TeX}编译器安装过程较为漫长,占用空间过大,而且在一部分处理器性能不佳的电脑上需要较长编译时间\footnote{其实这三点都是对广大的Windows用户说的,同一个模板在Linux编译可以节省一半耗时}。拒绝接受这些麻烦的同学不妨尝试本节介绍的在线编译方法。
\subsection{南大\hologo{TeX}平台简介}
\href{https://tex.nju.edu.cn}{南大\hologo{TeX}}基于开源的ShareLaTeX平台\footnote{理论上在\href{https://doc.nju.edu.cn/books/latex}{这个网站}能找到一段平台简介,实际上大家都有意无意地鸽了,下次一定补上。},于2021年3月4日正式上线,面向南京大学全体师生开放,首次使用需凭学校邮箱自助注册账号。
\subsection{操作步骤}
\begin{enumerate}
\item 下载\href{https://github.com/nju-lug/NJUThesisUndergraduate/archive/refs/heads/master.zip}{模板全部文件}
\item 访问\href{https://tex.nju.edu.cn}{南大\hologo{TeX}},点击界面右上方Register,使用\emph{南京大学邮箱}注册账号并登录
\item 点击New Project -> Upload Project上传刚刚得到的zip文件,上传后njuthesis.tex、njuthesis.cls等文件应在根目录,目录结构如\cref{{sec:directory}}所示
\item 在项目页面左上角的Menu中,将编译器改为\hologo{XeLaTeX}或者\hologo{LuaLaTeX}
\item 编写论文
\item 点击Compile按钮进行编译和预览
\item 点击编译按钮右侧第三个按钮下载产物
\end{enumerate}
\subsection{关于Overleaf平台}
由于\href{https://www.overleaf.com/}{Overleaf平台}\hologo{TeX}\,Live版本停留在2020,\texttt{cleveref}包在引用章节时会生成错误的标签,引发格式错误;而南大\hologo{TeX}通过及时更新规避了这一问题。因此\emph{请务必不要使用Overleaf官网进行编译}
\section{字体}
学校论文格式要求使用的字体一般已经预装在各个操作系统,本模板针对不同平台进行了自动检测适配,可以开箱即用。
各个系统的默认字体请参考\cref{tab:defaultfontset}。可以看到,不同系统上使用的字体有所差别,实际输出结果可能存在细微不同, 使用时请注意。例如,在Linux平台或者使用了Ubuntu后端的南大\hologo{TeX}上,宋体加粗效果更明显;另一方面,在Windows平台进行编译的效果更接近Word加粗\footnote{因为SimSun没有原生粗体,通过AutoFakeBold=2.17进行模仿}
% \begin{enumerate}
% \item Ubuntu 下遇到缺失字体 WenQuanYi Zen Hei Mono 或 Times New Roman的问题:
% 安装对应字体即可。使用以下指令下载:
% \begin{lstlisting}
% sudo apt install fonts-wqy-zenhei ttf-mscorefonts-installer
% \end{lstlisting}
% \item macOS 下提示 Package fontspec Warning: Font "STSong" does not contain requested Script "CJK"
% 忽略即可,不影响使用。该警告已被抑制。
% \end{enumerate}
指定字体的相关命令写于\texttt{profile/font.sty}
该文件中也预留有使用方正字体或者思源字体的命令,涉及的字体见\cref{tab:userfontset},可根据个人喜好进行修改选择。
\begin{table}[htbp]
\caption{操作系统预装字体清单}
\label{tab:defaultfontset}
\begin{tabular}{cccc}
\toprule
类型 & Windows & macOS & Linux \\
\midrule
西文衬线 & Times~New~Roman & Times~New~Roman & TeX~Gyre~Termes \\
西文无衬线 & Arial & Arial & TeX~Gyre~Heros \\
西文等宽 & Courier~New & Menlo & TeX~Gyre~Cursor \\
宋体 & SimSun & Songti~SC~Light &FandolSong-Regular \\
黑体 & SimHei & Heiti~SC~Light & FandolHei-Regular \\
仿宋 & FangSong & STFangsong & FandolFang-Regular \\
楷体 & KaiTi & Kaiti~SC & FandolKai-Regular \\
\bottomrule
\end{tabular}
\end{table}
如果 Ubuntu 下遇到缺失字体 Times New Roman 的问题,安装对应字体即可。使用以下指令下载:
\begin{lstlisting}
sudo apt install ttf-mscorefonts-installer
\end{lstlisting}
\begin{table}[htbp]
\caption{预留的自定义中文字体清单}
\label{tab:userfontset}
\begin{tabular}{ccc}
\toprule
类型 & 方正 & 思源 \\
\midrule
宋体 & FZSSK & Noto~Serif~CJK~SC \\
黑体 & FZHTK & Noto~Sans~CJK~SC \\
仿宋 & FZFSK & 方正仿宋简体 \\
楷体 & FZKTK & 方正楷体简体 \\
\bottomrule
\end{tabular}
\end{table}
\subsection{修改字体配置}
本模板提供了若干个字体相关的控制选项,已于\cref{sec:classoptions}初步进行介绍。如果希望覆盖检测系统字体的命令(譬如在Linux编译时使用Windows字体样式),请将
systemfont设置为false,并通过customlatinfont和customchinesefont进行选择。
全部字符集命令如下所示。
\begin{description}
\item[\texttt{\textbackslash set\textunderscore latin\textunderscore fontset\textunderscore windows}] Windows英文字符集
\item[\texttt{\textbackslash set\textunderscore chinese\textunderscore fontset\textunderscore windows}] Windows中文字符集
\item[\texttt{\textbackslash set\textunderscore latin\textunderscore fontset\textunderscore macos}] macOS英文字符集
\item[\texttt{\textbackslash set\textunderscore chinese\textunderscore fontset\textunderscore macos}] macOS中文字符集
\item[\texttt{\textbackslash set\textunderscore latin\textunderscore fontset\textunderscore gyre}] Linux英文字符集
\item[\texttt{\textbackslash set\textunderscore chinese\textunderscore fontset\textunderscore fandol}] Linux中文字符集
\item[\texttt{\textbackslash set\textunderscore chinese\textunderscore fontset\textunderscore founder}] 方正中文字符集
\item[\texttt{\textbackslash set\textunderscore chinese\textunderscore fontset\textunderscore noto}] 思源中文字符集
\end{description}
对于需要进一步自定义的同学,可以将CustomEnFont和CustomZhFont设置为null,自行在导言区设置字体。
\chapter{图片、表格与代码}
\section{图片示例}
所有图片默认存放在主目录下的\texttt{figure/}文件夹内
\begin{figure}[htbp]
\includegraphics[width=0.5\textwidth]{njuname}
\caption{南京大学名称}
\label{fig:njuname}
\end{figure}
你可以使用\lstinline|figure|环境插入图片,如\cref{fig:njuname},代码如下:
\begin{lstlisting}[style=LaTeX]
\begin{figure}
\includegraphics[width=0.5\textwidth]{njuname}
\caption{南京大学名称}
\end{figure}
\end{lstlisting}
\subsection{文字环绕图像}
% wrapfigure后面不能有空行
\begin{wrapfigure}{r}{0cm}
% \label{fig:njulogo}
\includegraphics[width=.15\textwidth]{njulogo}
\caption{校徽}
\end{wrapfigure}
\zhlipsum[3][name=xiangyu]
\section{表格示例}
\begin{table}[htbp]
\caption{经过测试的环境}
\label{tab:testtab}
\begin{tabular}{ccc}
\toprule
OS & TeX & 测试情况 \\
\midrule
Windows 10 & TeXLive 2021 &\\
Windows 10 & MiKTeX &\\
Windows 10 & TeXLive 2020 & ×\footnote{cleveref在引用章节时不能正常工作} \\
Ubuntu 20.04 & TeXLive 2021 &\\
南大TeX & Overleaf &\\
\bottomrule
\end{tabular}
\end{table}
你可以使用\lstinline|table|环境插入标准三线表,如\cref{tab:testtab}所示,代码如下:
\begin{lstlisting}[style=LaTeX]
\begin{table}[htbp]
\caption{经过测试的环境}
\begin{tabular}{ccc}
\toprule
OS & TeX & 测试情况 \\
\midrule
Windows 10 & TeXLive 2021 &\\
Windows 10 & MiKTeX &\\
Windows 10 & TeXLive 2020 & × \\
Ubuntu 20.04 & TeXLive 2021 &\\
南大TeX & Overleaf &\\
\bottomrule
\end{tabular}
\end{table}}
\end{lstlisting}
\section{代码示例}
\subsection{行内代码}
The new command pretty-prints the code. The exclamation marks delimit
the code and can be replaced by any character not in the code;
\lstinline$var i:integer;$ gives the same result.
使用\lstinline!\lstinline|\textit{<Your code>}|!,只要使用在代码中未出现的符号将代码包括在内即可。