Skip to content

Commit

Permalink
fix bachelor journal in bib
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Apr 16, 2016
1 parent 59fd888 commit ae7c01d
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 35 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
# USTC Thesis

本项目是中国科学技术大学的毕业论文 LaTeX 模板 ustcthesis v2.0
本项目是中国科学技术大学的毕业论文 LaTeX 模板 ustcthesis v2.1

新模板进行了彻底的重写,相对于旧版
[ywgATustcbbs/ustcthesis](https://github.com/ywgATustcbbs/ustcthesis)
有以下主要特性:

* 与最新的 TeX Live 2015 和 ctex 2.x 宏包兼容
* 根据操作系统自动配置字体(Windows, Mac OS X, Ubuntu)
* 设置了符合规范的参考文献的格式
* 设置了符合规范的参考文献的格式(支持 author-year 和 numerical 两种格式)
* 修正了字号的设置错误
* 修正了本科生的页码位置
* 提供了更详细的文档

使用前请注意:

1. **使用模板前应阅读说明文档 `ustcthesis.pdf` 的正文部分**
2. **本模板仅适用于 TeX Live 2015、MacTeX-2015 及以上版本,不对旧版本向下兼容**
3. **旧版 [TeX Live](https://www.tug.org/texlive/)[MacTeX](https://www.tug.org/mactex/)[MikTeX](http://www.miktex.org/) 用户请升级最新版本**
2. **本模板仅适用于最新版 [TeX Live](https://www.tug.org/texlive/)[MacTeX](https://www.tug.org/mactex/)[MikTeX](http://www.miktex.org/),不对旧版本向下兼容**
3. 应使用 `tlmgr` 将各个宏包升级到最新
4. **[CTeX套装](http://www.ctex.org/CTeXDownload) v2.9.2.164 发布于2012年,无法使用此模板,用户请使用旧模板**
5. **CTeX套装即将发布新版本,待测试**


## 下载地址

目前最新的发布版版本号为v2.0.1:

* GitHub Release:https://github.com/ustctug/ustcthesis/releases
* 校内镜像:https://git.ustclug.org/ustctug/ustcthesis/tags

Expand Down Expand Up @@ -84,7 +81,6 @@ Windows用户请参照通用使用说明,暂不提供Windows下的bat脚本。
## 已知问题
- [ ] 暂不支持英文风格
- [ ] 参考文献格式不支持 author-year 式
## 参考规范:
Expand Down
46 changes: 23 additions & 23 deletions chapters/citation.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\chapter{Citation}
\chapter{引用文献标注}

\section{著者-出版年制标注法}

Expand Down Expand Up @@ -28,28 +28,6 @@ \section{著者-出版年制标注法}
\verb|\citep{knuth86a,knuth84}| & \citep{knuth86a,knuth84}\\
\end{tabular}

\section{其他形式的标注}

\noindent
\begin{tabular}{l@{\quad$\Rightarrow$\quad}l}
\verb|\citealt{tlc2}| & \citealt{tlc2}\\
\verb|\citealt*{tlc2}| & \citealt*{tlc2}\\
\verb|\citealp{tlc2}| & \citealp{tlc2}\\
\verb|\citealp*{tlc2}| & \citealp*{tlc2}\\
\verb|\citealp{tlc2,knuth86a}| & \citealp{tlc2,knuth86a}\\
\verb|\citealp[pg.~32]{tlc2}| & \citealp[pg.~32]{tlc2}\\
\verb|\citenum{tlc2}| & \citenum{tlc2}\\
\verb|\citetext{priv.\ comm.}| & \citetext{priv.\ comm.}\\
\end{tabular}

\noindent
\begin{tabular}{l@{\quad$\Rightarrow$\quad}l}
\verb|\citeauthor{tlc2}| & \citeauthor{tlc2}\\
\verb|\citeauthor*{tlc2}| & \citeauthor*{tlc2}\\
\verb|\citeyear{tlc2}| & \citeyear{tlc2}\\
\verb|\citeyearpar{tlc2}| & \citeyearpar{tlc2}\\
\end{tabular}

\section{顺序编码制标注法}

\noindent
Expand Down Expand Up @@ -78,3 +56,25 @@ \section{顺序编码制标注法}
\verb|\citep{knuth86a,knuth84}| & \citep{knuth86a,knuth84}\\
\verb|\cite{knuth86a,knuth84,tlc2}| & \cite{knuth86a,knuth84,tlc2}\\
\end{tabular}

\section{其他形式的标注}

\noindent
\begin{tabular}{l@{\quad$\Rightarrow$\quad}l}
\verb|\citealt{tlc2}| & \citealt{tlc2}\\
\verb|\citealt*{tlc2}| & \citealt*{tlc2}\\
\verb|\citealp{tlc2}| & \citealp{tlc2}\\
\verb|\citealp*{tlc2}| & \citealp*{tlc2}\\
\verb|\citealp{tlc2,knuth86a}| & \citealp{tlc2,knuth86a}\\
\verb|\citealp[pg.~32]{tlc2}| & \citealp[pg.~32]{tlc2}\\
\verb|\citenum{tlc2}| & \citenum{tlc2}\\
\verb|\citetext{priv.\ comm.}| & \citetext{priv.\ comm.}\\
\end{tabular}

\noindent
\begin{tabular}{l@{\quad$\Rightarrow$\quad}l}
\verb|\citeauthor{tlc2}| & \citeauthor{tlc2}\\
\verb|\citeauthor*{tlc2}| & \citeauthor*{tlc2}\\
\verb|\citeyear{tlc2}| & \citeyear{tlc2}\\
\verb|\citeyearpar{tlc2}| & \citeyearpar{tlc2}\\
\end{tabular}
12 changes: 11 additions & 1 deletion ustcauthoryear.bst
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,14 @@ FUNCTION {format.series.volume.title}
if$
}

FUNCTION {format.journal}
{ journal
is.in.chinese
'skip$
{ "\ustcjournal{" swap$ * "}" * }
if$
}

FUNCTION {num.to.ordinal}
{ duplicate$ text.length$ 'charptr :=
duplicate$ charptr #1 substring$ 's :=
Expand Down Expand Up @@ -966,7 +974,7 @@ FUNCTION {article}
}
{ "J" format.mark "" output.after
new.block
journal "journal" output.check
format.journal "journal" output.check
new.block
format.date "year" output.check
format.vol.num.pages output
Expand Down Expand Up @@ -1820,6 +1828,8 @@ FUNCTION {begin.bib}
write$ newline$
"\begin{thebibliography}{" number.label int.to.str$ * "}" *
write$ newline$
"\ifx\ustcjournal\undefined\newcommand\ustcjournal{\relax}\fi"
write$ newline$
"\providecommand{\natexlab}[1]{#1}"
write$ newline$
"\providecommand{\url}[1]{\texttt{#1}}"
Expand Down
12 changes: 11 additions & 1 deletion ustcnumerical.bst
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,14 @@ FUNCTION {format.series.volume.title}
if$
}

FUNCTION {format.journal}
{ journal
is.in.chinese
'skip$
{ "\ustcjournal{" swap$ * "}" * }
if$
}

FUNCTION {num.to.ordinal}
{ duplicate$ text.length$ 'charptr :=
duplicate$ charptr #1 substring$ 's :=
Expand Down Expand Up @@ -965,7 +973,7 @@ FUNCTION {article}
}
{ "J" format.mark "" output.after
new.block
journal "journal" output.check
format.journal "journal" output.check
new.block
format.date "year" output.check
format.vol.num.pages output
Expand Down Expand Up @@ -1683,6 +1691,8 @@ FUNCTION {begin.bib}
write$ newline$
"\begin{thebibliography}{" number.label int.to.str$ * "}" *
write$ newline$
"\ifx\ustcjournal\undefined\newcommand\ustcjournal{\relax}\fi"
write$ newline$
"\providecommand{\natexlab}[1]{#1}"
write$ newline$
"\providecommand{\url}[1]{\texttt{#1}}"
Expand Down
7 changes: 6 additions & 1 deletion ustcthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{ustcthesis}
[2016/03/10 v2.0.1 USTC thesis template]
[2016/04/16 v2.1 USTC thesis template]
\RequirePackage{kvoptions}
\SetupKeyvalOptions{family=ustc@opt, prefix=ustc@opt@, setkeys=\kvsetkeys}
\DeclareBoolOption[false]{doctor}
Expand Down Expand Up @@ -414,6 +414,11 @@
\renewcommand\bibfont{\setfontsize{10.5bp}[20bp]}
\setlength{\bibsep}{0bp}
\setlength{\bibhang}{1em}
\ifustc@opt@bachelor
\newcommand\ustcjournal{\textit}
\else
\newcommand\ustcjournal{\relax}
\fi
\renewenvironment{thebibliography}[1]{%
\if@openright\cleardoublepage\else\clearpage\fi
\@mainmatterfalse
Expand Down
9 changes: 8 additions & 1 deletion ustcthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ LaTeX version 1999/12/01 or later.
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<class>\ProvidesClass{ustcthesis}
%<*class>
[2016/03/10 v2.0.1 USTC thesis template]
[2016/04/16 v2.1 USTC thesis template]
%</class>
%
%<*driver>
Expand Down Expand Up @@ -132,6 +132,8 @@ LaTeX version 1999/12/01 or later.
% Right brace \} Tilde \~}
%
% \changes{v2.0}{2016/02/21}{Initial release.}
% \changes{v2.0.1}{2016/03/10}{Add code and algorithm environments.}
% \changes{v2.1}{2016/04/16}{Support both author-year and numerical bib style.}
%
% \GetFileInfo{ustcthesis.dtx}
%
Expand Down Expand Up @@ -1170,6 +1172,11 @@ LaTeX version 1999/12/01 or later.
\renewcommand\bibfont{\setfontsize{10.5bp}[20bp]}
\setlength{\bibsep}{0bp}
\setlength{\bibhang}{1em}
\ifustc@opt@bachelor
\newcommand\ustcjournal{\textit}
\else
\newcommand\ustcjournal{\relax}
\fi
% \end{macrocode}
% \begin{macro}{\bibliography}
% 由于 \cs{bibliography} 位于正文中,页眉会默认显示“附录 参考文献”,所以修正页面风格;
Expand Down

0 comments on commit ae7c01d

Please sign in to comment.