Skip to content

Commit

Permalink
"Merge" master and doctor thesis template into one.
Browse files Browse the repository at this point in the history
  • Loading branch information
weijianwen committed Jan 7, 2016
1 parent 5df1b97 commit 9755762
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 85 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ all: $(THESIS).pdf
.PHONY : all clean version cleantest release cleanall

$(THESIS).pdf : $(THESIS).tex $(TEX_DIR)/*.tex $(BIB_DIR)/*.bib *.cls *.cfg Makefile
-latexmk $(LATEXMK_OPT) $~
-latexmk $(LATEXMK_OPT) $(THESIS)

clean :
latexmk -C
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ But, I think the template is still in a *primitive* state, far from a *generally

TODO
------
* Replace bibtex with biber.
* Merge the bachelor, master and Ph.D thesis into one.
* 用中文重写这份README.
* 把学士学位论文模板合并到主干。
* 用中文重写这份README。
* 使用良好的"LaTeX代码风格"改写文档源代码
* 使用 \command{body} 形式调用命令,避免无括号、等号指定;
* 避免在模板中使用 plain TeX 代码;
* 模板和模板讲解分开——模板使用说明放在idx中,模板文件留几个空壳就可以,方便大家填入内容,也能保持模板核心内容简洁。
* Add a ```sjtuthesiscmd.cfg```?
* Move natbib's configuration to other part. \RequirePackage[sort&compress,numbers]{natbib}
* Figure out which parts can be configured in ```sjtuthesis.cfg```
* Replace bibtex with biber。
* 使用```biber```模块替代```bibtex```处理参考文献。

How to use it?
------
Expand Down
28 changes: 19 additions & 9 deletions sjtuthesis.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%%==================================================
%% sjtuthesis.cfg for SJTU Master Thesis
%% sjtuthesis.cfg for SJTU Thesis
%% based on CASthesis.cfg -- http://www.ctex.org/PackageCASthesis
%% Hosted on https://github.com/weijianwen/sjtu-thesis-template-latex
%% SJTU LaTeX Forum https://bbs.sjtu.edu.cn/bbsdoc,board,TeX_LaTeX.html
Expand Down Expand Up @@ -51,7 +51,23 @@
\def\sjtu@value@UDC{}
\def\sjtu@value@serialnumber{}
\def\sjtu@value@school{}
\def\sjtu@value@degree{硕士}
\ifsjtu@bachelor
\def\sjtu@value@degree{学士}
\def\sjtu@value@englishdegree{Bachelor}
\else
\ifsjtu@master
\def\sjtu@value@degree{硕士}
\def\sjtu@value@englishdegree{Master}
\else
\ifsjtu@doctor
\def\sjtu@value@degree{博士}
\def\sjtu@value@englishdegree{Doctor}
\else
\ClassError{sjtuthesis}%
{Unknown value for degree.}{}
\fi
\fi
\fi
\def\sjtu@value@title{~~~~~(论~文~题~目)~~~~~}
\def\sjtu@value@titlemark{\sjtu@value@title}
\def\sjtu@value@author{(作~者~姓~名)}
Expand Down Expand Up @@ -112,7 +128,6 @@
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
, \number\year}
\def\sjtu@value@englishdegree{Master Of Science}
\def\sjtu@value@englishmajor{}


Expand Down Expand Up @@ -148,12 +163,7 @@
%%
\def\sjtu@label@thanks{致\sjtuspace 谢}

%%
%% version value
%%
\def\sjtu@value@templateversion{v0.5.3}

%%
%%%
%% listings name
%%
\def\sjtu@value@listingname{代码}
Expand Down
48 changes: 34 additions & 14 deletions sjtuthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,27 @@
%%==================================================

\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{sjtuthesis.cls}[2012/12/05 v0.5 sjtuthesis document class]
\newif\ifsjtu@typeinfo \sjtu@typeinfotrue
\DeclareOption{notypeinfo}{\sjtu@typeinfofalse}
\ProvidesClass{sjtuthesis}[2014/12/16 v0.9 Shanghai Jiao Tong University Template]
% _DEPLICATE_ \newif\ifsjtu@typeinfo \sjtu@typeinfotrue
% _DEPLICATE_ \DeclareOption{notypeinfo}{\sjtu@typeinfofalse}
\def\version{v0.5.3}
\newif\ifsjtu@bachelor\sjtu@bachelorfalse
\newif\ifsjtu@master\sjtu@masterfalse
\newif\ifsjtu@doctor\sjtu@doctorfalse
\DeclareOption{bachelor}{\sjtu@bachelortrue}
\DeclareOption{master}{\sjtu@mastertrue}
\DeclareOption{doctor}{\sjtu@doctortrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}}
\ProcessOptions
\LoadClass[fancyhdr,fntef,UTF8,adobefonts]{ctexbook}[2005/11/25]
\LoadClass[a4paper,fancyhdr,fntef,UTF8,adobefonts]{ctexbook}
\ifsjtu@bachelor\relax\else
\ifsjtu@master\relax\else
\ifsjtu@doctor\relax\else
\ClassError{sjtuthesis}%
{You have to specify one of thesis options: bachelor, master or doctor.}{}
\fi
\fi
\fi

%% sjtuthesis.cls segments
% 0. Import sjtuthesis.cfg
Expand All @@ -26,10 +41,9 @@
%==========

%% 导入 sjtuthesis.cfg 文件
\AtEndOfPackage{\makeatletter\input{sjtuthesis.cfg}\makeatother}
% _DEPLICATE_ \AtEndOfPackage{\makeatletter\input{sjtuthesis.cfg}\makeatother}
\AtEndOfClass{\input{sjtuthesis.cfg}}

%% 当前模板的版本
\newcommand{\version}{\sjtu@value@templateversion}

%==========
% Segment 1. Import LaTeX packages.
Expand Down Expand Up @@ -80,10 +94,16 @@
\newcommand\myBioarrow[2][]{\ExtendSymbol{\Leftarrow}{=}{\Rightarrow}{#1}{#2}}
\newcommand\myLongEqual[2][]{\ExtendSymbol{=}{=}{=}{#1}{#2}}

% \cleardoublepage -- Clear Double Page
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\thispagestyle{empty}%
\hbox{}\newpage\fi\fi}
\def\cleardoublepage{\clearpage%
\if@twoside%
\ifodd
\c@page%
\else%
\thispagestyle{empty}%
\hbox{}%
\newpage%
\fi%
\fi}

% CJK-LaTeX Logo \CJKLaTeX
\newcommand{\CJKLaTeX}{CJK--\LaTeX}
Expand Down Expand Up @@ -258,9 +278,9 @@
\vskip \stretch{0.5}
\clearpage
\if@twoside
\thispagestyle{empty}
\ifsjtu@typeinfo
\fi
% _DEPLICATE_ \thispagestyle{empty}
% _DEPLICATE_ \ifsjtu@typeinfo
% _DEPLICATE_ \fi
\cleardoublepage
\fi
}
Expand Down
2 changes: 1 addition & 1 deletion tex/ack.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

\begin{thanks}

感谢所有测试和使用交大硕士学位论文 \LaTeX 模板的同学!
感谢所有测试和使用交大学位论文 \LaTeX 模板的同学!

感谢那位最先制作出博士学位论文 \LaTeX 模板的交大物理系同学!

Expand Down
4 changes: 1 addition & 3 deletions tex/id.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
\title{上海交通大学硕士学位论文~\XeTeX/\LaTeX~模板~\version}
\title{上海交通大学学位论文~\XeTeX/\LaTeX~模板~\version}
\author{李\quad{}四}
\advisor{张三教授}
\degree{硕士}
\defenddate{2010年1月16日}
\school{上海交通大学}
\institute{物理系}
Expand All @@ -15,7 +14,6 @@
\englishinstitute{\textsc{Depart of XXX, School of XXX} \\
\textsc{Shanghai Jiao Tong University} \\
\textsc{Shanghai, P.R.China}}
\englishdegree{Master}
\englishmajor{Physics}
\englishdate{Jan. 16th, 2010}

Expand Down
75 changes: 24 additions & 51 deletions thesis.tex
Original file line number Diff line number Diff line change
@@ -1,88 +1,61 @@
%%==================================================
%% diss.tex for SJTU Master Thesis
%% version: 0.3a
%% last update: Dec 5th, 2010
%% thesis.tex
%%==================================================

% 字号选项: c5size 五号(默认) cs4size 小四
% 双面打印(注意字号设置)
\documentclass[cs4size, a4paper, twoside]{sjtuthesis}
% 单面打印(注意字号设置)
% \documentclass[cs4size, a4paper, oneside, openany]{sjtuthesis}

% 双面打印
\documentclass[cs4size,twoside,doctor]{sjtuthesis}
% 单面打印 \documentclass[cs4size,oneside,openany]{sjtuthesis}
% 使用五号字作为正文字体:cs4size -> c5size

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 封面
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% 无编号内容:中英文论文封面、授权页
\include{tex/id}

% 封面
\maketitle

% 英文封面
\makeenglishtitle

% 论文原创性声明和使用授权
\makeDeclareOriginal
\makeDeclareAuthorization

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 前言
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\frontmatter
\frontmatter % 使用罗马数字对前言编号

% 摘要
%% 摘要
\include{tex/abstract}

% 目录
%% 目录、插图目录、表格目录
\tableofcontents
% 插图索引
\listoffigures
\addcontentsline{toc}{chapter}{\listfigurename} %将图索引加入全文目录
% 表格索引
\addcontentsline{toc}{chapter}{\listfigurename} %将插图目录加入全文目录
\listoftables
\addcontentsline{toc}{chapter}{\listtablename} %将表格索引加入全文目录
\addcontentsline{toc}{chapter}{\listtablename} %将表格目录加入全文目录

\include{tex/symbol} % 主要符号、缩略词对照表

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 正文
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mainmatter
\mainmatter % 使用阿拉伯数字对正文编号

%% 各章正文内容
%% 正文内容
\include{tex/chapter01}
\include{tex/chapter02}
\include{tex/chapter03}
\include{tex/conclusion} %% 全文总结

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 附录(章节编号重新计算,使用字母进行编号)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\appendix
\include{tex/conclusion}

% 附录中编号形式是"A-1"的样子
\renewcommand\theequation{\Alph{chapter}--\arabic{equation}}
\appendix % 使用英文字母对附录编号,重新定义附录中的公式、图图表编号样式
\renewcommand\theequation{\Alph{chapter}--\arabic{equation}}
\renewcommand\thefigure{\Alph{chapter}--\arabic{figure}}
\renewcommand\thetable{\Alph{chapter}--\arabic{table}}

\include{tex/app1} % 更新记录
\include{tex/app2} % 麦克斯韦方程
% \include{tex/app3}
%% 附录内容,本科学位论文可以用翻译的文献替代。
\include{tex/app1}
\include{tex/app2}

\backmatter % 文后无编号部分

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 文后(无章节编号)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\backmatter
%% 参考资料
\bibliography{bib/chap1,bib/chap2}

\bibliography{bib/chap1,bib/chap2} % 参考文献
% \include{tex/resume}
%% 致谢、发表论文、参与项目、简历
\include{tex/ack} %% 致谢
\include{tex/pub} %% 发表论文
\include{tex/projects} %% 参与的项目
% \include{tex/resume}

\end{document}

0 comments on commit 9755762

Please sign in to comment.