Skip to content

Commit

Permalink
use dash between two numerical citations
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Mar 29, 2018
1 parent aac37bc commit c81a14f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Travis build](https://travis-ci.org/ustctug/ustcthesis.svg?branch=master)](https://travis-ci.org/ustctug/ustcthesis)
[![GitHub release](https://img.shields.io/github/release/ustctug/ustcthesis/all.svg)](https://github.com/ustctug/ustcthesis/releases/latest)
[![Github downloads](https://img.shields.io/github/downloads/ustctug/ustcthesis/total.svg)](https://github.com/ustctug/ustcthesis/releases)
[![GitHub commits](https://img.shields.io/github/commits-since/ustctug/ustcthesis/v3.0.2.svg)](https://github.com/ustctug/ustcthesis/commits/master)
[![GitHub commits](https://img.shields.io/github/commits-since/ustctug/ustcthesis/v3.0.3.svg)](https://github.com/ustctug/ustcthesis/commits/master)

本项目是中国科学技术大学的学位论文 LaTeX 模板 ustcthesis,按照最新版的
[研究生学位论文撰写手册](http://gradschool.ustc.edu.cn/ylb/material/xw/wdxz/32.pdf)
Expand Down
13 changes: 11 additions & 2 deletions 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}
[2018/03/16 v3.0.2 USTC thesis template]
[2018/03/16 v3.0.3 USTC thesis template]
\newif\if@ustc@doctor
\newif\if@ustc@master
\newif\if@ustc@bachelor
Expand Down Expand Up @@ -743,7 +743,7 @@
\bibliographystyle{ustcauthoryear}%
\fi
\fi
\patchcmd\NAT@citexnum{%
\patchcmd{\NAT@citexnum}{%
\@ifnum{\NAT@ctype=\z@}{%
\if*#2*\else\NAT@cmt#2\fi
}{}%
Expand Down Expand Up @@ -771,6 +771,15 @@
\renewcommand\NAT@cite%
[3]{\ifNAT@swa\NAT@@open\if*#2*\else#2\NAT@spacechar\fi
#1\NAT@@close\if*#3*\else\textsuperscript{#3}\fi\else#1\fi\endgroup}
\patchcmd{\NAT@citexnum}{%
\ifx\NAT@last@yr\relax
\def@NAT@last@yr{\@citea}%
\else
\def@NAT@last@yr{--\NAT@penalty}%
\fi
}{%
\def@NAT@last@yr{--\NAT@penalty}%
}{}{}
\renewcommand\bibfont{\setfontsize{10.5bp}[20bp]}
\setlength{\bibsep}{\z@}
\setlength{\bibhang}{2\ccwd}
Expand Down
19 changes: 16 additions & 3 deletions ustcthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ LaTeX version 1999/12/01 or later.
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<class>\ProvidesClass{ustcthesis}
%<*class>
[2018/03/16 v3.0.2 USTC thesis template]
[2018/03/16 v3.0.3 USTC thesis template]
%</class>
%
%<*driver>
Expand Down Expand Up @@ -1640,7 +1640,7 @@ LaTeX version 1999/12/01 or later.
% 定义接口切换引用文献的标注法,可用 \cs{citestyle} 调用 \opt{super} 、
% \opt{authoryear} 或 \opt{numbers}。
% \changes{v3.0}{2017/07/01}{允许文献序号作为叙述文字的一部分}
% \changes{v3.0.2}{2017/03/16}{修正著者-出版年式参考文献引用的顺序}
% \changes{v3.0.2}{2017/03/16}{著者-出版年式文献引用不再排序}
% \begin{macrocode}
\if@ustc@numerical
\PassOptionsToPackage{sort&compress}{natbib}
Expand Down Expand Up @@ -1699,7 +1699,7 @@ LaTeX version 1999/12/01 or later.
% 下面修改 \pkg{natbib} 的引用格式,主要是将页码写在上标位置。
% Numerical 模式的 \cs{citet} 的页码:
% \begin{macrocode}
\patchcmd\NAT@citexnum{%
\patchcmd{\NAT@citexnum}{%
\@ifnum{\NAT@ctype=\z@}{%
\if*#2*\else\NAT@cmt#2\fi
}{}%
Expand Down Expand Up @@ -1741,6 +1741,19 @@ LaTeX version 1999/12/01 or later.
#1\NAT@@close\if*#3*\else\textsuperscript{#3}\fi\else#1\fi\endgroup}
% \end{macrocode}
%
% \changes{v3.0.3}{2018/03/29}{顺序编码制连续两个文献引用之间使用连接号}
% \begin{macrocode}
\patchcmd{\NAT@citexnum}{%
\ifx\NAT@last@yr\relax
\def@NAT@last@yr{\@citea}%
\else
\def@NAT@last@yr{--\NAT@penalty}%
\fi
}{%
\def@NAT@last@yr{--\NAT@penalty}%
}{}{}
% \end{macrocode}
%
% 参考文献列表宋体10.5磅,行距20磅,续行缩进两字
% \begin{macrocode}
\renewcommand\bibfont{\setfontsize{10.5bp}[20bp]}
Expand Down

0 comments on commit c81a14f

Please sign in to comment.