Skip to content

Commit

Permalink
Add option space.before.pages
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Mar 7, 2020
1 parent e1b729e commit 5ef7046
Show file tree
Hide file tree
Showing 15 changed files with 143 additions and 54 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
- 新增选项 `only.start.page`
- 增加选项 `title.in.journal`
- 增加选项 `space.before.pages`

## [v2.0] - 2020-03-04
### Changed
Expand Down
9 changes: 8 additions & 1 deletion gbt7714-author-year.bst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ INTEGERS {
italic.jounal
bold.journal.volume
show.missing.address.publisher
space.before.pages
only.start.page
show.url
show.doi
Expand All @@ -60,6 +61,7 @@ FUNCTION {load.config}
#0 'italic.jounal :=
#0 'bold.journal.volume :=
#1 'show.missing.address.publisher :=
#0 'space.before.pages :=
#0 'only.start.page :=
#1 'show.url :=
#1 'show.doi :=
Expand Down Expand Up @@ -1141,7 +1143,12 @@ FUNCTION {format.journal.number}
FUNCTION {format.journal.pages}
{ pages empty$
{ "" }
{ ":\penalty0 " format.pages * }
{ space.before.pages
{ ": " }
{ ":\penalty0 " }
if$
format.pages *
}
if$
}

Expand Down
9 changes: 8 additions & 1 deletion gbt7714-numerical.bst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ INTEGERS {
italic.jounal
bold.journal.volume
show.missing.address.publisher
space.before.pages
only.start.page
show.url
show.doi
Expand All @@ -54,6 +55,7 @@ FUNCTION {load.config}
#0 'italic.jounal :=
#0 'bold.journal.volume :=
#1 'show.missing.address.publisher :=
#0 'space.before.pages :=
#0 'only.start.page :=
#1 'show.url :=
#1 'show.doi :=
Expand Down Expand Up @@ -1130,7 +1132,12 @@ FUNCTION {format.journal.number}
FUNCTION {format.journal.pages}
{ pages empty$
{ "" }
{ ":\penalty0 " format.pages * }
{ space.before.pages
{ ": " }
{ ":\penalty0 " }
if$
format.pages *
}
if$
}

Expand Down
19 changes: 18 additions & 1 deletion gbt7714.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@
% show.medium.type & |#1| & 显示载体类型标识 \\
% italic.jounal & |#0| & 西文期刊名使用斜体 \\
% show.missing.address.publisher & |#1| & 出版项缺失时显示“出版者不详” \\
% space.before.pages & |#0| & 页码前有空白 \\
% only.start.page & |#0| & 只显示起始页码 \\
% show.url & |#1| & 显示 url \\
% show.doi & |#1| & 显示 doi \\
Expand Down Expand Up @@ -788,6 +789,7 @@ INTEGERS {
italic.jounal
bold.journal.volume
show.missing.address.publisher
space.before.pages
only.start.page
show.url
show.doi
Expand Down Expand Up @@ -917,6 +919,16 @@ FUNCTION {load.config}
%
% 页码是否只含起始页:
% \begin{macrocode}
%<*!space-begore-pages&!npr>
#0 'space.before.pages :=
%</!space-begore-pages&!npr>
%<*space-begore-pages|npr>
#1 'space.before.pages :=
%</space-begore-pages|npr>
% \end{macrocode}
%
% 页码前是否有空白:
% \begin{macrocode}
%<*!only-start-page&!npr>
#0 'only.start.page :=
%</!only-start-page&!npr>
Expand Down Expand Up @@ -2570,7 +2582,12 @@ FUNCTION {format.journal.number}
FUNCTION {format.journal.pages}
{ pages empty$
{ "" }
{ ":\penalty0 " format.pages * }
{ space.before.pages
{ ": " }
{ ":\penalty0 " }
if$
format.pages *
}
if$
}
Expand Down
2 changes: 1 addition & 1 deletion test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if [ -z "$1" ]; then
bblfile="$testdir/test.bbl";
stdfile="$testfiledir/$testname.bbl";
if ! diff -q "$bblfile" "$stdfile" > /dev/null 2> /dev/null; then
echo " fails";
echo " differs";
cp -f "$bblfile" "$stdfile";
succuss=false;
fi
Expand Down
76 changes: 35 additions & 41 deletions test/testbst/npr.bbl
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ ROBERSON~J~A, BURNESON~E~G.
\bibitem[袁训来\ 等(2012)袁训来, 陈哲, 肖书海,
et~al.]{yuanxunlai2012lantian}
袁训来, 陈哲, 肖书海, 等.
\newblock 科学通报, 2012, 55\penalty0 (34):\penalty0 3219.
\newblock 科学通报, 2012, 55\penalty0 (34): 3219.

\bibitem[余建斌(2013)]{yujianbin2013women}
余建斌.
Expand All @@ -205,43 +205,40 @@ ROBERSON~J~A, BURNESON~E~G.

\bibitem[李炳穆(2008{\natexlab{a}})]{libingmu2008hanguo}
李炳穆.
\newblock 图书情报工作, 2008, 52\penalty0 (6):\penalty0
6\allowbreak[2013-10-25].
\newblock 图书情报工作, 2008, 52\penalty0 (6): 6\allowbreak[2013-10-25].
\newblock \url{http://www.docin.com/p-400265742.html}.

\bibitem[李幼平\ 等(2010)李幼平 and 王莉]{liyouping2010xunzheng}
李幼平, 王莉.
\newblock 中华移植杂志(电子版), 2010, 4\penalty0 (3):\penalty0
\newblock 中华移植杂志(电子版), 2010, 4\penalty0 (3):
225\allowbreak[2014-06-09].
\newblock \url{http://www.cqvip.com/Read/Read.aspx?id=36658332}.

\bibitem[武丽丽\ 等(2008)武丽丽, 华一新, 张亚军,
et~al.]{wulili2008beidou}
武丽丽, 华一新, 张亚军, 等.
\newblock 测绘科学, 2008, 33\penalty0 (5):\penalty0
8\allowbreak[2009-10-25].
\newblock 测绘科学, 2008, 33\penalty0 (5): 8\allowbreak[2009-10-25].
\newblock \url{http://vip.calis.edu.cn/CSTJ/Sear.dll?OPAC_CreateDetail}.
\newblock DOI: \doi{10.3771/j.issn.1009-2307.2008.05.002}.

\bibitem[Kanamori(1998)]{kanamori1998shaking}
KANAMORI~H.
\newblock Science, 1998, 279\penalty0 (5359):\penalty0 2063.
\newblock Science, 1998, 279\penalty0 (5359): 2063.

\bibitem[Caplan(1993)]{caplan1993cataloging}
CAPLAN~P.
\newblock The public access computer systems review, 1993, 4\penalty0
(2):\penalty0 61.
\newblock The public access computer systems review, 1993, 4\penalty0 (2): 61.

\bibitem[Frese et~al.(2013)Frese, Katus, and Meder]{frese2013next}
FRESE~K~S, KATUS~H~A, MEDER~B.
\newblock Biology, 2013, 2\penalty0 (1):\penalty0 378\allowbreak[2013-03-19].
\newblock Biology, 2013, 2\penalty0 (1): 378\allowbreak[2013-03-19].
\newblock \url{http://www.mdpi.com/2079-7737/2/1/378}.
\newblock DOI: \doi{10.3390/biology2010378}.

\bibitem[Myburg et~al.(2014)Myburg, Grattapaglia, Tuskan,
et~al.]{myburg2014genome}
MYBURG~A~A, GRATTAPAGLIA~D, TUSKAN~G~A, et~al.
\newblock Nature, 2014, 510:\penalty0 356\allowbreak[2014-06-25].
\newblock Nature, 2014, 510: 356\allowbreak[2014-06-25].
\newblock
\url{http://www.nature.com/nature/journal/v510/n7505/pdf/nature13308.pdf}.
\newblock DOI: \doi{10.1038/nature13308}.
Expand Down Expand Up @@ -341,16 +338,15 @@ CHERNIK~B~E.

\bibitem[杨宗英(1996)]{yangzongying1996dianzi}
杨宗英.
\newblock 中国图书馆学报, 1996\penalty0 (2):\penalty0 24.
\newblock 中国图书馆学报, 1996\penalty0 (2): 24.

\bibitem[Dowler(1995)]{dowler1995research}
DOWLER~L.
\newblock Journal of library administration, 1995, 21\penalty0 (1/2):\penalty0
5.
\newblock Journal of library administration, 1995, 21\penalty0 (1/2): 5.

\bibitem[Sunstein(1996)]{sunstein1996social}
SUNSTEIN~C~R.
\newblock Columbia law review, 1996, 96:\penalty0 903\allowbreak[2012-01-26].
\newblock Columbia law review, 1996, 96: 903\allowbreak[2012-01-26].
\newblock
\url{http://www.heinonline.org/HOL/Page?handle=hein.journals/clr96&id=913&collection=journals&index=journals/clr}.

Expand Down Expand Up @@ -384,7 +380,7 @@ MORRI~I.

\bibitem[刘彻东(1998)]{liuchedong1998zhongguo}
刘彻东.
\newblock 中国出版, 1998\penalty0 (5):\penalty0 38.
\newblock 中国出版, 1998\penalty0 (5): 38.

\bibitem[裴丽生(1981)]{peilisheng1981jianghua}
裴丽生.
Expand Down Expand Up @@ -688,51 +684,49 @@ Symposium on Applications of Holography in Mechanics, August 23-25, 1971,

\bibitem[杨洪升(2013)]{yanghongsheng2013siku}
杨洪升.
\newblock 文献, 2013\penalty0 (1):\penalty0 56.
\newblock 文献, 2013\penalty0 (1): 56.

\bibitem[李炳穆(2008{\natexlab{b}})]{libingmu2008hanguo2}
李炳穆.
\newblock 图书情报工作, 2008, 52\penalty0 (6):\penalty0 6.
\newblock 图书情报工作, 2008, 52\penalty0 (6): 6.

\bibitem[于潇\ 等(2012)于潇, 刘义, 柴跃廷,
et~al.]{yuxiao2012hulianwang}
于潇, 刘义, 柴跃廷, 等.
\newblock 清华大学学报(自然科学版), 2012, 52\penalty0 (11):\penalty0
1518.
\newblock 清华大学学报(自然科学版), 2012, 52\penalty0 (11): 1518.

\bibitem[陈建军(20l0)]{chenjianjun20l0cong}
陈建军.
\newblock 国图资源导刊, 20l0, 7\penalty0 (10):\penalty0
93\allowbreak[2013-03-20].
\newblock 国图资源导刊, 20l0, 7\penalty0 (10): 93\allowbreak[2013-03-20].
\newblock \url{http://d.g.wanfangdata.com.cn/Periodical_hunandz201010038.aspx}.
\newblock DOI: \doi{10.3969/j.issn.1672-5603.2010.10.038}.

\bibitem[Des~Marais et~al.(1992)Des~Marais, Strauss, Summons,
et~al.]{desmarais1992carbon}
DES~MARAIS~D~J, STRAUSS~H, SUMMONS~R~E, et~al.
\newblock Nature, 1992, 359:\penalty0 605.
\newblock Nature, 1992, 359: 605.

\bibitem[Saito et~al.(2006)Saito and Miyazaki]{saito2006jadeite}
SAITO~M, MIYAZAKI~K.
\newblock Bulletin of the geological survey of Japan, 2006, 57\penalty0
(5/6):\penalty0 169.
\newblock Bulletin of the geological survey of Japan, 2006, 57\penalty0 (5/6):
169.

\bibitem[Walls et~al.(2013)Walls, Barichivich, and Brown]{walls2013drought}
WALLS~S~C, BARICHIVICH~W~J, BROWN~M~E.
\newblock Biology, 2013, 2\penalty0 (1):\penalty0 399\allowbreak[2013-11-04].
\newblock Biology, 2013, 2\penalty0 (1): 399\allowbreak[2013-11-04].
\newblock \url{http://www.mdpi.com/2079-7737/2/1/399}.
\newblock DOI: \doi{10.3390/biology2010399}.

\bibitem[Franz et~al.(2013)Franz, Danielewicz, Wong, Anderson, and
Boothe]{franz2013phenotypic}
FRANZ~A~K, DANIELEWICZ~M~A, WONG~D~M, et~al.
\newblock ACS Chemical biology, 2013, 8:\penalty0 1053\allowbreak[2014-06-26].
\newblock ACS Chemical biology, 2013, 8: 1053\allowbreak[2014-06-26].
\newblock \url{http://pubs.acs.org/doi/ipdf/10.1021/cb300573r}.

\bibitem[Park et~al.(2010)Park and Tosaka]{park2010metadata}
PARK~J~R, TOSAKA~Y.
\newblock Cataloging \& classification quarterly, 2010, 48\penalty0
(8):\penalty0 696\allowbreak[2013-09-05].
\newblock Cataloging \& classification quarterly, 2010, 48\penalty0 (8):
696\allowbreak[2013-09-05].
\newblock
\url{http://www.tandfonline.com/doi/pdf/10.1080/01639374.2010.508711}.

Expand Down Expand Up @@ -785,24 +779,24 @@ Dublin core metadata element set: version 1.1\allowbreak[EB/OL].
\bibitem[魏志勇\ 等(2006)魏志勇, 臧黎慧, 范我,
et~al.]{weizhiyong2006}
魏志勇, 臧黎慧, 范我, 等.
\newblock 核技术, 2006, 29\penalty0 (9):\penalty0 713.
\newblock 核技术, 2006, 29\penalty0 (9): 713.

\bibitem[陈东风\ 等(2005)陈东风, 勾成, 叶春堂,
et~al.]{chendongfeng2005}
陈东风, 勾成, 叶春堂, 等.
\newblock 核技术, 2005, 28\penalty0 (2):\penalty0 127.
\newblock 核技术, 2005, 28\penalty0 (2): 127.

\bibitem[Oed(2004)]{oed2004}
OED~A.
\newblock Nucl Instr Meth A, 2004, 525\penalty0 (1-2):\penalty0 62.
\newblock Nucl Instr Meth A, 2004, 525\penalty0 (1-2): 62.

\bibitem[Rhodes et~al.(1997)Rhodes, Wardle, Boram, et~al.]{rhodes1997}
RHODES~N~J, WARDLE~A~G, BORAM~A~J, et~al.
\newblock Nucl Instr Meth A, 1997, 392\penalty0 (1-3):\penalty0 315.
\newblock Nucl Instr Meth A, 1997, 392\penalty0 (1-3): 315.

\bibitem[Crow et~al.(2004)Crow, Hodges, and Cooper]{crow2004}
CROW~M~L, HODGES~J~P, COOPER~R~G.
\newblock Nucl Instr Meth A, 2004, 529\penalty0 (1-3):\penalty0 287.
\newblock Nucl Instr Meth A, 2004, 529\penalty0 (1-3): 287.

\bibitem[mis()]{misc}
\allowbreak[EB/OL].
Expand All @@ -815,31 +809,31 @@ Philips data handbook for electron tubes t9\allowbreak[M].
\bibitem[迟少鹏\ 等(2003)迟少鹏, 夏小米, 周莉,
et~al.]{chishaopeng2003}
迟少鹏, 夏小米, 周莉, 等.
\newblock 高能物理与核物理, 2003, 27\penalty0 (3):\penalty0 257.
\newblock 高能物理与核物理, 2003, 27\penalty0 (3): 257.

\bibitem[汪晓莲\ 等(2003)汪晓莲, 许咨宗, 侯云珍,
et~al.]{wangxiaolian2003}
汪晓莲, 许咨宗, 侯云珍, 等.
\newblock 高能物理与核物理, 2003, 27\penalty0 (3):\penalty0 257.
\newblock 高能物理与核物理, 2003, 27\penalty0 (3): 257.

\bibitem[Sackett et~al.(1993)Sackett, Ieki, A, et~al.]{sackett1993}
SACKETT~D, IEKI~K, A~G, et~al.
\newblock Physical Review C, 1993, 48\penalty0 (1):\penalty0 118.
\newblock Physical Review C, 1993, 48\penalty0 (1): 118.

\bibitem[Sackett et~al.(1997)Sackett, Ieki, A, et~al.]{zecher1997}
SACKETT~D, IEKI~K, A~G, et~al.
\newblock Nucl Instr Meth A, 1997, 401\penalty0 (2-3):\penalty0 329.
\newblock Nucl Instr Meth A, 1997, 401\penalty0 (2-3): 329.

\bibitem[薛梦驰(2009)]{xuemengchi2009}
薛梦驰.
\newblock 电信科学, 2009, 7:\penalty0 57.
\newblock 电信科学, 2009, 7: 57.

\bibitem[唐军杰\ 等(2013)唐军杰, 王拓, 张强, et~al.]{tangjunjie2013}
唐军杰, 王拓, 张强, 等.
\newblock 发光学报, 2013, 34\penalty0 (1):\penalty0 78.
\newblock 发光学报, 2013, 34\penalty0 (1): 78.

\bibitem[WU et~al.(2013)WU, TANG, SUN, et~al.]{wuchong2013}
WU~C, TANG~B, SUN~Z, et~al.
\newblock Radiation Measurements, 2013, 58\penalty0 (11):\penalty0 128.
\newblock Radiation Measurements, 2013, 58\penalty0 (11): 128.

\end{thebibliography}
9 changes: 8 additions & 1 deletion variants/2005/gbt7714-2005-author-year.bst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ INTEGERS {
italic.jounal
bold.journal.volume
show.missing.address.publisher
space.before.pages
only.start.page
show.url
show.doi
Expand All @@ -60,6 +61,7 @@ FUNCTION {load.config}
#0 'italic.jounal :=
#0 'bold.journal.volume :=
#1 'show.missing.address.publisher :=
#0 'space.before.pages :=
#0 'only.start.page :=
#1 'show.url :=
#0 'show.doi :=
Expand Down Expand Up @@ -1141,7 +1143,12 @@ FUNCTION {format.journal.number}
FUNCTION {format.journal.pages}
{ pages empty$
{ "" }
{ ":\penalty0 " format.pages * }
{ space.before.pages
{ ": " }
{ ":\penalty0 " }
if$
format.pages *
}
if$
}

Expand Down
Loading

0 comments on commit 5ef7046

Please sign in to comment.