Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复了论文短标题无法正常显示的错误 #32

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
*.hd
*.cmds
dtx-style.sty
njuthesis.cfg
njuthesis.cls
njuthesis.pdf
sample.pdf
*.acn
*.acr
*.alg
*.aux
*.bbl
*.blg
*.cmds
*.dvi
*.fdb_latexmk
*.fls
*.glg
*.glo
*.gls
*.hd
*.idx
*.ilg
*.ind
Expand All @@ -29,8 +35,9 @@
*.snm
*.synctex.gz
*.toc
*.vrb
*.xdy
*.tdo
*.thm
*.vrb
*.xdv
*.xdy
.DS_Store
47 changes: 17 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,23 @@
###############################################################################

PACKAGE=njuthesis
BST_FILE=gbt7714-2005.bst
BST_URL=https://raw.githubusercontent.com/Haixing-Hu/GBT7714-2005-BibTeX-Style/master/gbt7714-2005.bst
SOURCES=$(PACKAGE).dtx $(PACKAGE).ins
CLS=$(PACKAGE).cls $(PACKAGE).cfg dtx-style.sty
SAMPLE=sample
SAMPLECONTENTS=$(SAMPLE).tex
SAMPLEBIB=$(SAMPLE).bib
INSTITUTE_LOGO=njulogo.eps
INSTITUTE_NAME=njuname.eps
TEXMFLOCAL=$(shell get_texmf_dir.sh)
INSTITUTE_LOGO=njulogo.pdf
INSTITUTE_NAME=njuname.pdf

.PHONY: all clean cls doc sample

all: bst cls doc sample

###### update bst file
bst: $(BST_FILE)

$(BST_FILE):
curl $(BST_URL) -o $(BST_FILE)
all: cls doc sample

###### generate cls/cfg
cls: $(CLS)

$(CLS): $(SOURCES)
latex $(PACKAGE).ins
xelatex $(PACKAGE).ins

###### generate doc

Expand All @@ -51,26 +42,14 @@ $(PACKAGE).pdf: $(CLS)

sample: $(SAMPLE).pdf

$(SAMPLE).pdf: $(CLS) $(INSTITUTE_LOGO) $(INSTITUTE_NAME) $(BST_FILE) $(SAMPLE).tex $(SAMPLEBIB)
xelatex $(SAMPLE).tex
bibtex $(SAMPLE)
xelatex $(SAMPLE).tex
xelatex $(SAMPLE).tex

###### install

install: $(SOURCE) $(CLS) $(INSTITUTE_LOGO) $(INSTITUTE_NAME) $(BST_FILE) $(PACKAGE).pdf $(SAMPLE).pdf
mkdir -p $(TEXMFLOCAL)/tex/latex/njuthesis
cp -rvf $(SOURCES) $(CLS) $(INSTITUTE_LOGO) $(INSTITUTE_NAME) $(TEXMFLOCAL)/tex/latex/njuthesis/
mkdir -p $(TEXMFLOCAL)/doc/latex/njuthesis
cp -rvf $(PACKAGE).pdf $(SAMPLE).pdf $(TEXMFLOCAL)/doc/latex/njuthesis/
mkdir -p $(TEXMFLOCAL)/bibtex/bst
cp -rvf $(BST_FILE) $(TEXMFLOCAL)/bibtex/bst/
texhash
$(SAMPLE).pdf: $(CLS) $(INSTITUTE_LOGO) $(INSTITUTE_NAME) $(SAMPLE).tex $(SAMPLEBIB)
latexmk -xelatex -synctex=1 $(SAMPLE).tex

###### clean

clean:
latexmk -c $(SAMPLE).tex
latexmk -c $(PACKAGE).dtx
-@rm -f \
*.aux \
*.bak \
Expand All @@ -86,12 +65,20 @@ clean:
*.log \
*.out \
*.ps \
*.synctex \
*.synctex.gz \
*.thm \
*.toc \
*.lof \
*.lot \
*.loe \
*.sty \
*.hd \
*.xdv

cleanall: clean
-@rm -f \
$(SAMPLE).pdf \
$(PACKAGE).pdf \
*.cfg \
*.cls \
*.sty
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
# NJU-Thesis

## Overleaf 模板

[Overleaf](https://www.overleaf.com) 可以提供免费的在线 LaTeX 文档编辑编译服务,本项目已在 Overleaf 上传[模板](https://www.overleaf.com/latex/templates/nan-jing-da-xue-yan-jiu-sheng-bi-ye-lun-wen-mo-ban/mddmfkgsnhxq
)。经测试,编译毕业论文体量的文档速度还不错,支持双向跳转,支持版本历史管理,唯一的问题是 PDF 文件的预览速度略慢。Overleaf 关于 LaTeX 以及平台本身也提供非常详细的[文档](https://www.overleaf.com/learn)。有兴趣的同学可以尝试。

注意:菜单里请设置编译器为 XeLaTeX,并对主文档做必要设置。

## 定制说明

这是在 [Haixing Hu](http://haixing-hu.github.io/nju-thesis/) 原项目基础上的个人定制模板,需要原版的可查看项目的 origin 分支。除了对原项目的一些 bug 做了修复,也根据个人审美和一些统一性要求对模板作出改动,包括:

* 修复了论文短标题无法正常显示的错误;
* 版面设计:
1. 添加中英文摘要纸到目录;
1. 中英文摘要纸字样双下划线;
1. 中英文摘要纸自动去掉多余的空行;
1. 修改标点符号处理方式为全角;
1. 计算了等效 Word 1.5 倍行距的缩放系数;
* 字体字号:
1. 修改了底层中文宏包支持为 ctex;
1. 修正了公式内数字不是 Times 字体的错误;
1. 默认改用 Fandol 开源字体,使得宋体加粗不必用黑体代替,可跨平台使用;
1. 修改了各字号的字体大小,不再对磅 (Word) 和 pt (TeX) 进行换算;
1. 修改页眉中文字体为楷书;
* 字段信息:
1. 使用新的南大官方高清 logo 替换了原 logo;
1. 封面和授权书表格信息字段修改;
1. 修改了生成 pdf 文件的主题字段;
1. 使用长论文标题时,也可以正确生成 pdf 文件标题信息;
* 修改 `Makefile` 文件,解决了 win 平台部分 texlive 版本可能无法正确编译 `.ins` 的问题。

本版本仅保留最必要的文件,所有可由其他命令生成的文件均不默认提供,因此使用前需自行编译顺便测试编译环境。Windows 用户执行 `RUNME.bat` 文件即可,Linux 和 Mac 用户则需要用到 `make` 工具:

```sh
$ cd njuthesis
# 清理以前执行make生成的旧文件
$ make clean
# 生成 njuthesis.cls 和 njuthesis.cfg
$ make cls
# 生成文档类手册
$ make doc
# 生成样例文档
$ make sample
```

*********

本项目提供了一个用于排版南京大学学位论文的XeLaTeX模板。该模板严格遵循南京大学学术委员会对学位论文的排版格式要求以及相应的国家标准规范,可帮助南京大学的同学们方便地排版出漂亮的学位论文。

目前该模板支持排版博士、硕士和学士的学位论文。
Expand Down
21 changes: 21 additions & 0 deletions RUNME.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
:: UTF-8
chcp 65001
@ echo off
:: 运行安装程序
xelatex njuthesis.ins
:: 生成手册
xelatex njuthesis.dtx
makeindex -s gind.ist -o njuthesis.ind njuthesis.idx
xelatex njuthesis.dtx
xelatex njuthesis.dtx
:: 生成示例文档
xelatex sample.tex
bibtex sample
xelatex sample.tex
xelatex sample.tex
:: 删除辅助文件
del *.aux *.bak *.bbl *.blg *.dvi *.glo *.gls *.idx *.ilg *.ind *.ist ^
*.log *.out *.ps *.thm *.toc *.lof *.lot *.loe *.hd
cls
echo 恭喜!您已生成其他的基本文件和说明文档,这说明您的写作环境没有问题!
pause
2 changes: 0 additions & 2 deletions TODO

This file was deleted.

Loading