Skip to content

Commit

Permalink
Merge branch 'dev' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
weijianwen committed Jan 27, 2017
2 parents d3980b9 + e115509 commit a88bf25
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 69 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ s3 : $(THESIS).pdf
s3cmd put $< s3://sjtuthesis/README.pdf

git :
for b in "0.7.x" "0.8.x" "develop" "develop-0.7" "develop-0.8"; do git co $${b}; git pull gitlab $${b}; done
for b in "0.7.x" "0.8.x" "develop" "develop-0.7" "develop-0.8"; do git co $${b}; git push --tags -f -u gitlab $${b}; git push --tags -f -u github $${b}; git push -f -u gitcafe $${b}; done
git co master; git push gitlab master; git push github master; git push gitcafe master
git push --tags github; git push github;
git push --tags gitlab; git push gitlab;

zip :
git archive --format zip --output thesis.zip master
22 changes: 5 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# 上海交通大学学位论文模板

[English README](README_en-US.md)

这是为撰写上海交通大学学士、硕士或博士论文而准备的 XeLaTeX 模板,非官方出品。生成的学位论文文件参见 [README.pdf][README],详细使用说明参见 [SJTUThesis Wiki](https://github.com/weijianwen/SJTUThesis/wiki),欢迎大家分享使用经验。

## 如何使用
Expand All @@ -12,16 +10,12 @@ SJTUThesis可以在本地编译,也可以在线编译。

#### TeX 发行版

SJTUThesis 需要使用 XeTeX 引擎编译。2014和2015年的 [TeXLive](https://www.tug.org/texlive/)[MacTeX](https://www.tug.org/mactex/) 发行版都能编译此模板。Windows 下的 CTeX(2.9.2) 也能顺利编译此模板。**Windows用户**推荐使用 [Babun](http://babun.github.io/) 作为命令行终端。Babun 已默认安装有这些工具:git(版本控制)、GNUmake(编译控制)、perl(字数统计)。
SJTUThesis 需要使用 XeTeX 引擎编译。2016年的 [TeXLive](https://www.tug.org/texlive/)[MacTeX](https://www.tug.org/mactex/) 发行版都能编译此模板。Windows 下的 CTeX(2.9.2) 也能顺利编译此模板。**Windows用户**推荐使用 [Babun](http://babun.github.io/) 作为命令行终端。Babun 已默认安装有这些工具:git(版本控制)、GNUmake(编译控制)、perl(字数统计)。

#### 字体

中英文分别依赖 Adobe 的四套简体中文字体和 TeX Gyre Termes 西文字体。Tex Gyre Termes 可从 [CTAN](http://www.ctan.org/tex-archive/fonts/tex-gyre/fonts/opentype/public/tex-gyre) 下载四种不同字型。出于版权考虑,需要大家自行解决 AdobeSongStd, AdobeKaitiStd, AdobeHeitiStd, AdobeFangsongStd 四款中文字体的授权问题。

### 在线编译 - ShareLaTeX

[ShareLaTeX](https://www.sharelatex.com/) 是一个优秀的 LaTeX 在线编译站点,可以完成 SJTUThesis 0.8.1 版本的编译。在[SJTUThesis-0.8](https://www.sharelatex.com/project/56701ac8d63cd1d9646a622f)页面将该项目复制到自己的列表中,就可以开始在模版上工作了。更详细的使用说明,请参考[Usage - 使用文档](https://github.com/weijianwen/SJTUThesis/wiki/Usage)

### 获取模板

根据「系统需求」中情形选择适合你系统情况的分支,然后根据情况选择 git 克隆最新版代码或者下载稳定版压缩包。
Expand All @@ -44,12 +38,9 @@ git pull upstream master

SJTUThesis提供了多个稳定版供您使用,这些版本的输出结果具有相近的外观,但依赖不同的TeXLive发行版和参考文献处理程序。

| TeXLive发行版 | 参考文献处理程序 | SJTUThesis版本 |
|---------------|------------------------------|----------------|
| 2015 | biber+biblatex+caspervector | [0.9.4][0.9.4] |
| 2015 | bibtex+GBT7714-2005NLang.bst | [0.7.8][0.7.8] |
| 2014 | biber+biblatex+caspervector | [0.8.8][0.8.8] |
| 2013 | bibtex+GBT7714-2005NLang.bst | [0.7.1][0.7.1] |
| TeXLive发行版 | 参考文献风格 | SJTUThesis版本 |
|---------------|---------------|----------------|
| 2016 | GB7714 | [0.9.5][0.9.5] |

### 编译模板

Expand Down Expand Up @@ -98,7 +89,4 @@ SJTUThesis提供了多个稳定版供您使用,这些版本的输出结果具
上海交通大学校徽图片(`sjtulog.png`)和横幅图片(`sjtubanner.png`)的版权归原作者所有。其他部分使用 [Apache License 2.0](LICENSE) 授权。

[README]: https://s3.amazonaws.com/sjtuthesis/README.pdf
[0.9.4]: https://github.com/weijianwen/SJTUThesis/releases/tag/0.9.4
[0.8.8]: https://github.com/weijianwen/SJTUThesis/releases/tag/0.8.8
[0.7.8]: https://github.com/weijianwen/SJTUThesis/releases/tag/0.7.8
[0.7.1]: https://github.com/weijianwen/SJTUThesis/releases/tag/0.7.1
[0.9.5]: https://github.com/weijianwen/SJTUThesis/releases/tag/0.9.5
39 changes: 15 additions & 24 deletions bib/thesis.bib
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
%# -*- coding: utf-8-unix -*-
@book{Meta_CN,
title = {{电磁超介质及其应用}},
title = {电磁超介质及其应用},
address = {北京},
publisher = {国防工业出版社},
year = {2008},
author = {崔万照 and 马伟 and 邱乐徳 and 张洪太},
language = {chinese}
author = {崔万照 and 马伟 and 邱乐徳 and 张洪太}
}

@book{JohnD,
title = {{Photonic Crystals: Molding the Flow of Light}},
title = {Photonic Crystals: Molding the Flow of Light},
publisher = {Princeton University Press},
year = {2008},
author = {Joannopoulos, J. D. and Johnson, S. G. and Winn, J. N.}
}

@book{IEEE-1363,
author={{IEEE Std 1363-2000}},
title={{IEEE} Standard Specifications for Public-Key Cryptography},
author={IEEE Std 1363-2000},
title={IEEE Standard Specifications for Public-Key Cryptography},
address={New York},
publisher={IEEE},
year={2000}
}

@article{chen2007act,
author = {Chen, H. and Chan, C. T.},
title = {{Acoustic cloaking in three dimensions using acoustic metamaterials}},
title = {Acoustic cloaking in three dimensions using acoustic metamaterials},
journal = {Applied Physics Letters},
year = {2007},
volume = {91},
Expand All @@ -36,7 +35,7 @@ @article{chen2007act

@article{chen2007ewi,
author = {Chen, H. and Wu, B. I. and Zhang, B. and Kong, J. A.},
title = {{Electromagnetic Wave Interactions with a Metamaterial Cloak}},
title = {Electromagnetic Wave Interactions with a Metamaterial Cloak},
journal = {Physical Review Letters},
year = {2007},
volume = {99},
Expand All @@ -55,7 +54,7 @@ @inproceedings{kocher99
volume={1666},
pages={388-397},
publisher={Springer-Verlag},
month={August},
month={9},
year={1999}
}

Expand Down Expand Up @@ -83,7 +82,6 @@ @incollection{zjsw
VOLUME = {2},
SERIES = {新古文观止丛书},
ADDRESS = {武汉},
language = {chinese},
}


Expand All @@ -93,8 +91,7 @@ @inbook{clzs
CHAPTER = {大人物还是讲人情的},
PAGES = {185-207},
PUBLISHER = {人民文学出版社},
YEAR = {2001},
language = {chinese},
YEAR = {2001},
}

@book{tex,
Expand Down Expand Up @@ -156,7 +153,7 @@ @TechReport{NPB2
author = {Alex Woo and David Bailey and Maurice Yarrow and Wijngaart
Wijngaart and Tim Harris and William Saphir},
year = 1995,
month = dec # {~05},
month = 12,
institution = {The Pennsylvania State University CiteSeer Archives},
url = {http://www.nasa.org/}
}
Expand All @@ -180,7 +177,6 @@ @INPROCEEDINGS{cnproceed
address = {西安, 中国},
publisher = {中国古籍出版社},
month = sep,
language = {chinese},
}

@ARTICLE{cnarticle,
Expand All @@ -190,7 +186,6 @@ @ARTICLE{cnarticle
PAGES = {260--266},
VOLUME = 224,
YEAR = 1800,
LANGUAGE = {chinese},
}

@thesis{zhubajie,
Expand All @@ -199,7 +194,6 @@ @thesis{zhubajie
school = {广寒宫大学},
year = 2005,
address = {北京},
language = {chinese},
}

@thesis{shaheshang,
Expand All @@ -208,23 +202,22 @@ @thesis{shaheshang
school = {清华大学},
year = 2005,
address = {北京},
language = {chinese},
}

@thesis{metamori2004,
author = {Ashwin Raju Jeyakumar},
title = {Metamori: A library for Incremental File Checkpointing},
school = {Virgina Tech},
year = 2004,
month = jun # {~21},
month = 7,
address = {Blacksburg},
}

@thesis{FistSystem01,
AUTHOR = {Erez Zadok},
TITLE = {{FiST: A System for Stackable File System Code Generation}},
TITLE = {FiST: A System for Stackable File System Code Generation},
YEAR = 2001,
MONTH = {May},
MONTH = {5},
SCHOOL = {Computer Science Department, Columbia University},
ADDRESS = {USA}
}
Expand All @@ -240,10 +233,9 @@ @INBOOK{ColdSources
}

@phdthesis{bai2008,
title={{信用风险传染模型和信用衍生品的定价}},
title={信用风险传染模型和信用衍生品的定价},
author={白云芬},
year={2008},
language={chinese},
school={上海交通大学},
address={上海},
}
Expand All @@ -258,7 +250,6 @@ @article{xiaoyu2001
modifydate = {2001-12-19},
citedate = {2002-04-15},
url = {http://www.creader.com/news/20011219/200112190019.html},
language = {chinese},
}

% 在线析出文献
Expand All @@ -278,7 +269,7 @@ @book{RManual
Address = {Vienna, Austria},
Author = {{R Core Team}},
Note = {{ISBN} 3-900051-07-0},
Organization = {{R Foundation for Statistical Computing}},
Organization = {R Foundation for Statistical Computing},
title = {R: A Language and Environment for Statistical Computing},
url = {http://www.R-project.org/},
Year = {2012},
Expand Down
8 changes: 4 additions & 4 deletions compile.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ if exist thesis.pdf (

echo Compile...
echo xelatex -no-pdf thesis...
xelatex -no-pdf thesis > nul
xelatex -no-pdf thesis 1> nul
echo biber --debug thesis...
biber --debug thesis > nul
biber --debug thesis 1> nul
echo xelatex thesis...
xelatex thesis > nul
xelatex thesis > nul
xelatex thesis 1> nul
xelatex thesis 1> nul
echo clean files...
del *.aux *.run.xml *.bcf *.log *.xdv *.bbl *.bak *.blg *.out *.thm *.toc *.synctex* *.glg *.glo *.gls *.ist *.idx *.ilg *.ind *.acn *.acr *.lof *.lot *.loa *.alg *.glsdefs >nul 2>nul
cd tex
Expand Down
18 changes: 15 additions & 3 deletions sjtuthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,15 @@
\RequirePackage{graphicx}
\RequirePackage{subfigure}
\RequirePackage{ccaption}
\RequirePackage[backend=biber, style=caspervector,utf8, bibencoding=utf8, sorting=none]{biblatex}
\RequirePackage[backend=biber,style=gb7714-2015]{biblatex}
\DeclareCiteCommand{\citen} %加入一个水平引用函数
{[\usebibmacro{cite:init}%直接添加方括号
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}%
\usebibmacro{postnote}]}
\RequirePackage{xcolor}
\RequirePackage{wasysym}
\RequirePackage{listings}
Expand Down Expand Up @@ -492,12 +500,16 @@
\fi

% 中英文摘要
\newenvironment{abstract}{\chapter*{\sjtu@value@title\vskip 20pt\sjtu@label@abstract}\markboth{\sjtu@label@abstract}{}}{}
\newenvironment{abstract}{\cleardoublepage \pdfbookmark[0]{\sjtu@label@abstract}{abstract}
\chapter*{\sjtu@value@title\vskip 20pt\sjtu@label@abstract}\markboth{\sjtu@label@abstract}{}}{}
\newcommand\keywords[1]{\vspace{2ex}\noindent{\bf\large \sjtu@label@keywords} #1}
\newenvironment{englishabstract}{\chapter*{\sjtu@value@englishtitle\vskip 20pt\bfseries \sjtu@label@englishabstract}\markboth{\sjtu@label@englishabstract}{}}{}
\newenvironment{englishabstract}{\cleardoublepage\pdfbookmark[0]{\sjtu@label@englishabstract}{englishabstract}
\chapter*{\sjtu@value@englishtitle\vskip 20pt\bfseries \sjtu@label@englishabstract}\markboth{\sjtu@label@englishabstract}{}}{}
\newcommand\englishkeywords[1]{\vspace{2ex}\noindent{\bf\large \sjtu@label@englishkeywords} #1}

\renewcommand\tableofcontents{%
\cleardoublepage
\pdfbookmark[0]{\contentsname}{toc}
\chapter*{\contentsname}
\@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
\@starttoc{toc}%
Expand Down
4 changes: 4 additions & 0 deletions tex/app_log.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
\chapter{模板更新记录}
\label{chap:updatelog}

\textbf{2016年12月} v0.9.5发布,改用GB7714-2015参考文献风格。

\textbf{2016年11月} v0.9.4发布,增加算法和流程图。

\textbf{2015年6月19日} v0.9发布,适配ctex 2.x宏包,需要使用TeXLive 2015编译。

\textbf{2015年3月15日} v0.8发布,使用biber/biblatex组合替代 \BibTeX ,带来更强大稳定的参考文献处理能力;添加enumitem宏包增强列表环境控制能力;完善宏包文字描述。
Expand Down
30 changes: 14 additions & 16 deletions tex/example.tex
Original file line number Diff line number Diff line change
Expand Up @@ -293,44 +293,42 @@ \section{参考文献管理}

下面是在Google Scholar上搜索到的一条文献信息,格式是纯文本:

\begin{lstlisting}[caption={从Google Scholar找到的参考文献条目}, label=googlescholar, float, escapeinside="", numbers=none]
\begin{lstlisting}[caption={从Google Scholar找到的参考文献条目}, label=googlescholar, escapeinside="", numbers=none]
@phdthesis{"白2008信用风险传染模型和信用衍生品的定价",
title={{"信用风险传染模型和信用衍生品的定价"}},
title={"信用风险传染模型和信用衍生品的定价"},
author={"白云芬"},
year={2008},
school={"上海交通大学"}
}
\end{lstlisting}

为了方便引用,建议将文献别名改用ASCII表示。
中文文献的处理有别于英文文献,对中文参考文献需要增加“language”域显式说明。
推荐修改后在bib文件中的内容为:

\begin{lstlisting}[caption={修改后的参考文献条目}, label=itemok, float, escapeinside="", numbers=none]
\begin{lstlisting}[caption={修改后的参考文献条目}, label=itemok, escapeinside="", numbers=none]
@phdthesis{bai2008,
title={{"信用风险传染模型和信用衍生品的定价"}},
title={"信用风险传染模型和信用衍生品的定价"},
author={"白云芬"},
year={2008},
language={zh},
date={2008},
address={"上海"},
school={"上海交通大学"}
}
\end{lstlisting}

按照教务处的要求,参考文献外观应符合国标GBT7714的要求\footnote{\url{http://www.cces.net.cn/guild/sites/tmxb/Files/19798_2.pdf}}。
在模板中,表现形式的控制逻辑在GBT7714-2005NLang.bst中实现\footnote{\url{http://bbs.ctex.org/viewthread.php?tid=33571}},是使用{\BibTeX}特有的堆栈式语言实现的\footnote{\url{http://ftp.ctex.org/mirrors/CTAN/info/bibtex/tamethebeast/ttb_en.pdf}}
在模板中,表现形式的控制逻辑通过bibla­tex-gb7714-2015包实现\footnote{\url{https://www.ctan.org/pkg/biblatex-gb7714-2015}},基于{Bib\LaTeX}管理文献。在目前的多数TeX发行版中,可能都没有默认包含biblatex-gb7714-2015,需要手动安装

正文中引用参考文献时,用\verb+\supercite{key1,key2,key3...}+可以产生“上标引用的参考文献”,
\supercite{Meta_CN,chen2007act,DPMG}。
使用\verb+\parencite{key1,key2,key3...}+则可以产生水平引用的参考文献,例如\parencite{JohnD,zhubajie,IEEE-1363}。
请看下面的例子,将会穿插使用水平的和上标的参考文献:关于书的\parencite{Meta_CN,JohnD,IEEE-1363},关于期刊的\supercite{chen2007act,chen2007ewi},
会议论文\parencite{DPMG,kocher99,cnproceed},
硕士学位论文\parencite{zhubajie,metamori2004},博士学位论文\supercite{shaheshang,FistSystem01,bai2008},标准文件\parencite{IEEE-1363},技术报告\supercite{NPB2},电子文献\parencite{xiaoyu2001, CHRISTINE1998},用户手册\parencite{RManual}。
正文中引用参考文献时,用\verb+\cite{key1,key2,key3...}+可以产生“上标引用的参考文献”,
\cite{Meta_CN,chen2007act,DPMG}。
使用\verb+\citen{key1,key2,key3...}+则可以产生水平引用的参考文献,例如\citen{JohnD,zhubajie,IEEE-1363}。
请看下面的例子,将会穿插使用水平的和上标的参考文献:关于书的\citen{Meta_CN,JohnD,IEEE-1363},关于期刊的\cite{chen2007act,chen2007ewi},
会议论文\citen{DPMG,kocher99,cnproceed},
硕士学位论文\citen{zhubajie,metamori2004},博士学位论文\cite{shaheshang,FistSystem01,bai2008},标准文件\citen{IEEE-1363},技术报告\cite{NPB2},电子文献\citen{xiaoyu2001, CHRISTINE1998},用户手册\citen{RManual}。

总结一些注意事项:
\begin{itemize}
\item 参考文献只有在正文中被引用了,才会在最后的参考文献列表中出现;
\item 参考文献“数据库文件”bib是纯文本文件,请使用UTF-8编码,不要使用GBK编码;
\item 参考文献条目中通过language域是否为空判断是否是中文文献;
\item 参考文献条目中默认通过date域输入时间。兼容使用year域时会产生编译warning,可忽略。
\end{itemize}

\section{用listings插入源代码}
Expand Down
8 changes: 6 additions & 2 deletions thesis.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

% 双面打印
\documentclass[doctor, fontset=adobe, openright, twoside]{sjtuthesis}
% \documentclass[bachelor, fontset=adobe, openany, oneside, submit]{sjtuthesis}
% \documentclass[master, adobefonts, review]{sjtuthesis}
% \documentclass[bachelor, fontset=adobe, openany, oneside, submit]{sjtuthesis}
% \documentclass[master, fontset=adobe, review]{sjtuthesis}
% \documentclass[%
% bachelor|master|doctor, % 必选项
% fontset=adobe|windows, % 只测试了adobe
Expand Down Expand Up @@ -35,10 +35,14 @@
\cleardoublepage
\includepdf{pdf/authorization.pdf}
\cleardoublepage
\else
\ifsjtu@review\relax
% exclude the original claim and authorization
\else
\makeDeclareOriginal
\makeDeclareAuthorization
\fi
\fi
\makeatother


Expand Down

0 comments on commit a88bf25

Please sign in to comment.