buptbachelor.bst 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576
  1. %% BUPTThesis.bst
  2. %%
  3. %% 北京邮电大学研究生学位论文参考文献 BibTeX 样式
  4. %%
  5. %% 项目主页:http://code.google.com/p/buptthesis/
  6. %%
  7. %% 本样式基于 IEEEtran 和 ThuThesis 修改而成,基本满足北京邮电大学研究生论文格式要求
  8. %%
  9. %% 作者:
  10. %% 张煜 (email:dazzlezhang@gmail.com)
  11. %%
  12. %% 更新记录:
  13. %% $LastChangedBy$
  14. %% $LastChangedDate$
  15. %% $LastChangedRevision$
  16. %% 一些设置的缺省值
  17. % 英文姓名排版格式字符串, 按<last name全称>~<first name全程><, Jr.>格式,如果只保留首字母,将重复字母删去其中一个即可
  18. FUNCTION {default.name.format.string} {"{vv~}{ll}{~ff}{, Jj}"}
  19. % 列出的最多作者数目, 即当作者数目超过下列数字时, 超出部分的作者姓名将略去
  20. FUNCTION {default.max.num.names.before.forced.et.al} { #3 }
  21. % 是否为盲审版本, #0 表示盲审将隐去作者信息, #1 表示非盲审
  22. FUNCTION {default.is.for.peer.review} { #0 }
  23. %%%%%%%%%%%%%%
  24. % 一些辅助函数
  25. %%%%%%%%%%%%%%
  26. % #0 不在终端显示开始/完成的提示信息
  27. % #1 显示提示信息
  28. FUNCTION {is.print.banners.to.terminal} {#1}
  29. %%%%%%%%%%%%%%%%
  30. % 版本与提示信息
  31. %%%%%%%%%%%%%%%%
  32. % 版本信息
  33. FUNCTION{bst.file.version} { "0.2" }
  34. FUNCTION{bst.file.date} { "2009/01/25" }
  35. FUNCTION{bst.file.website} {
  36. "http://code.google.com/p/buptthesis/" }
  37. % 开始提示信息
  38. FUNCTION {banner.message}{
  39. is.print.banners.to.terminal
  40. { "-- BUPTThesis.bst version" " " * bst.file.version *
  41. " (" * bst.file.date * ") " * "by Yu Zhang." *
  42. top$
  43. "-- " bst.file.website *
  44. top$
  45. "-- See the " quote$ * "userguide.pdf" * quote$ *
  46. " manual for usage information." *
  47. top$
  48. }
  49. { skip$ }
  50. if$
  51. }
  52. % 完成提示信息
  53. FUNCTION {completed.message} {
  54. is.print.banners.to.terminal
  55. { "" top$ "Done." top$ }
  56. { skip$ }
  57. if$
  58. }
  59. %%%%%%%%%%%%%%%%%%%
  60. %% 预定义的字符串宏
  61. %%%%%%%%%%%%%%%%%%%
  62. % 英文月份
  63. MACRO {jan} {"January"}
  64. MACRO {feb} {"February"}
  65. MACRO {mar} {"March"}
  66. MACRO {apr} {"April"}
  67. MACRO {may} {"May"}
  68. MACRO {jun} {"June"}
  69. MACRO {jul} {"July"}
  70. MACRO {aug} {"August"}
  71. MACRO {sep} {"September"}
  72. MACRO {oct} {"October"}
  73. MACRO {nov} {"November"}
  74. MACRO {dec} {"December"}
  75. %%%%%%%%%%%%
  76. %% 条目定义
  77. %%%%%%%%%%%%
  78. ENTRY { address % 地址
  79. assignee % 标准授权人
  80. author % 作者
  81. booktitle % 专著/论文集名
  82. chapter %
  83. day %
  84. dayfiled %
  85. edition % 版本
  86. editor % 编者
  87. howpublished % 出版形式
  88. esubtype % 电子文献子类
  89. institution %
  90. journal % 期刊
  91. key %
  92. language % 语言
  93. month % 月
  94. monthfiled %
  95. nationality %
  96. newsletter %
  97. note %
  98. number %
  99. number2 %
  100. organization %
  101. pages %
  102. publisher %
  103. refdate %
  104. update % 电子文档更新或修改日期
  105. school %
  106. series %
  107. title %
  108. translator %
  109. type %
  110. volume %
  111. volume2 %
  112. year %
  113. year2 %
  114. yearfiled %
  115. url % URL
  116. pubaddress % 出版地
  117. CTLname_format_string % 作者英文姓名排版格式
  118. CTLmax_names_forced_etal % 强制略去的最大作者数
  119. CTLauthor_name_english % 作者英文姓名
  120. CTLauthor_name_chinese % 作者中文姓名
  121. CTLfor_peer_review % 是否匿名
  122. }
  123. {}
  124. { label }
  125. %%%%%%%%%%%%%
  126. %% 字符串常量
  127. %%%%%%%%%%%%%
  128. % FUNCTION {bbl.anonymous} { language empty$ { "Anon" } { "佚名" } if$ }
  129. FUNCTION {bbl.anonymous} { "" }
  130. FUNCTION {bbl.etal} { language empty$ { "~et~al" } { "~等" } if$ }
  131. FUNCTION {bbl.sine.loco} { language empty$ { "S.~l." } { "出版地不详" } if$ }
  132. FUNCTION {bbl.sine.nomine} { language empty$ { "s.~n." } { "出版者不详" } if$ }
  133. FUNCTION {bbl.comma} { language empty$ { ", " } { "," } if$ }
  134. FUNCTION {bbl.colon} { language empty$ { ": " } { ":" } if$ }
  135. FUNCTION {bbl.period} { language empty$ { "." } { "." } if$ }
  136. FUNCTION {bbl.parallel} { "~//~" }
  137. FUNCTION {bbl.st} { "st" } % 序数词后缀
  138. FUNCTION {bbl.nd} { "nd" } % 序数词后缀
  139. FUNCTION {bbl.rd} { "rd" } % 序数词后缀
  140. FUNCTION {bbl.th} { "th" } % 序数词后缀
  141. FUNCTION {bbl.number} { "第" }
  142. FUNCTION {bbl.author} { "作者" }
  143. %%%%%%%%%%%%
  144. %% 整型变量
  145. %%%%%%%%%%%
  146. INTEGERS { output.state before.all mid.sentence after.title after.sentence url.sentence after.block before.pages }
  147. INTEGERS { number.label longest.label.width multiresult
  148. nameptr namesleft numnames lastnamecapitalized namelength charptr }
  149. INTEGERS { max.num.names.before.forced.et.al }
  150. INTEGERS { is.for.peer.review }
  151. %%%%%%%%%%%%%
  152. %% 字符串变量
  153. %%%%%%%%%%%%%
  154. STRINGS { s
  155. t
  156. longest.label
  157. thename
  158. name.emph.author.en % 强调现实的作者英文姓名
  159. name.emph.author.zh % 强调显示的作者中文姓名
  160. name.format.string % 姓名的格式字符串
  161. author.name.in.english % 作者英文姓名
  162. author.name.in.chinese % 作者中文姓名
  163. }
  164. %%%%%%%%%%%%%%%%%%%%%
  165. %% LaTeX 参考文献代码
  166. %%%%%%%%%%%%%%%%%%%%%
  167. % 输出 .bbl 文件开始
  168. FUNCTION {begin.bib} {
  169. "% Generated by BUPTThesis.bst, version: " bst.file.version *
  170. " (" * bst.file.date * ")" *
  171. write$ newline$ % 输出注释行,说明产生该bbl的bst及版本
  172. preamble$ empty$ % 输出前导
  173. 'skip$
  174. { preamble$ write$ newline$ }
  175. if$
  176. "\begin{thebibliography}{" longest.label * "}" *
  177. write$ newline$ % 输出 \begin{thebiliography}{x}
  178. }
  179. % 输出 .bbl 文件结束部分
  180. FUNCTION {end.bib} {
  181. newline$
  182. "\end{thebibliography}"
  183. write$ newline$
  184. }
  185. %%%%%%%%%%%%
  186. %% 底层函数
  187. %%%%%%%%%%%%
  188. % 控制变量初始化
  189. FUNCTION {initialize.controls} {
  190. default.name.format.string 'name.format.string :=
  191. default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al :=
  192. default.is.for.peer.review 'is.for.peer.review :=
  193. }
  194. % 初始化最长 label
  195. FUNCTION {initialize.longest.label} {
  196. "" 'longest.label :=
  197. #1 'number.label :=
  198. #0 'longest.label.width :=
  199. }
  200. % 最长 label pass
  201. FUNCTION {longest.label.pass}
  202. { number.label int.to.str$ 'label :=
  203. number.label #1 + 'number.label :=
  204. label width$ longest.label.width >
  205. { label 'longest.label :=
  206. label width$ 'longest.label.width :=
  207. }
  208. { skip$ }
  209. if$
  210. }
  211. % 逻辑非: 栈顶元素的逻辑非
  212. FUNCTION {not} {
  213. { #0 }
  214. { #1 }
  215. if$
  216. }
  217. % 逻辑与
  218. FUNCTION {and} {
  219. { skip$ }
  220. { pop$ #0 }
  221. if$
  222. }
  223. % 逻辑或
  224. FUNCTION {or} {
  225. { pop$ #1 }
  226. { skip$ }
  227. if$
  228. }
  229. % 返回 #1 : 栈顶字符是数字"0"~"9"
  230. % 返回 #0 : 其他
  231. FUNCTION {is.num} {
  232. chr.to.int$
  233. duplicate$ "0" chr.to.int$ < not
  234. swap$ "9" chr.to.int$ > not and
  235. }
  236. % 栈顶整数乘以10
  237. FUNCTION {bump.int.mag} {
  238. #0 'multiresult := % 初始化乘运算结果 y <- 0
  239. { duplicate$ #0 > } % 栈顶整数 x = 0 时才停止循环
  240. { #1 - % x <- x - 1
  241. multiresult #10 +
  242. 'multiresult := % y <- y + 10
  243. }
  244. while$
  245. pop$ % 释放 x
  246. multiresult % y 压栈返回
  247. }
  248. % 将栈顶字符("0"~"9")转换为整数(0~9)
  249. FUNCTION {char.to.integer} {
  250. duplicate$
  251. is.num
  252. { chr.to.int$ "0" chr.to.int$ - }
  253. { "noninteger character " quote$ * swap$ * quote$ *
  254. " in integer field of " * cite$ * warning$
  255. #0 % 如果栈定字符不是("0"~"9"), 给出警告返回 0
  256. }
  257. if$
  258. }
  259. % 将栈顶字符串转换为整数
  260. FUNCTION {string.to.integer} {
  261. duplicate$ text.length$ 'namesleft := % namesleft <- 字符串长度
  262. #1 'nameptr := % nameptr <- 1
  263. #0 'numnames := % numnames <- 0
  264. { nameptr namesleft > not } % while( ! ( nameptr > namesleft ) )
  265. { duplicate$ nameptr #1 substring$ % 取第 nameptr 个字符 x
  266. char.to.integer numnames bump.int.mag +
  267. 'numnames := % numnames <- chr2int( x ) + 10 * numnames
  268. nameptr #1 +
  269. 'nameptr := % nameptr <- nameptr + 1
  270. }
  271. while$
  272. pop$ % 释放栈顶元素
  273. numnames % numnames 压栈返回
  274. }
  275. % convert the strings "yes" or "no" to #1 or #0 respectively
  276. FUNCTION {yes.no.to.int}
  277. { "l" change.case$ duplicate$
  278. "yes" =
  279. { pop$ #1 }
  280. { duplicate$ "no" =
  281. { pop$ #0 }
  282. { "unknown boolean " quote$ * swap$ * quote$ *
  283. " in " * cite$ * warning$
  284. #0
  285. }
  286. if$
  287. }
  288. if$
  289. }
  290. % 初始化状态常量
  291. FUNCTION {initialize.status.constants}
  292. { #0 'before.all := % 起始
  293. #1 'mid.sentence := % 句中
  294. #2 'after.sentence := % 句末
  295. #3 'after.block := % 块后
  296. #4 'after.title := %
  297. #5 'before.pages := %
  298. }
  299. FUNCTION {remove.char}
  300. { 't :=
  301. 's :=
  302. ""
  303. { s empty$ not }
  304. { s #1 #1 substring$
  305. s #2 global.max$ substring$ 's :=
  306. duplicate$ t = 'pop$
  307. { * }
  308. if$
  309. }
  310. while$
  311. }
  312. STRINGS {z}
  313. FUNCTION {remove.period}
  314. { 'z :=
  315. ""
  316. { z empty$ not }
  317. { z #1 #1 substring$
  318. z #2 global.max$ substring$ 'z :=
  319. duplicate$ "." = 'pop$
  320. { * }
  321. if$
  322. }
  323. while$
  324. }
  325. FUNCTION {remove.dots} {
  326. duplicate$ "input=" swap$ * warning$
  327. "language=" language * warning$
  328. language empty$
  329. { "." remove.char
  330. duplicate$ "output('.')=" swap$ * warning$ }
  331. { "." remove.char
  332. duplicate$ "output('.')=" swap$ * warning$
  333. "." remove.char
  334. duplicate$ "output('.')=" swap$ * warning$ }
  335. if$
  336. }
  337. FUNCTION {bibinfo.check}
  338. { swap$
  339. duplicate$ missing$
  340. {
  341. pop$ pop$
  342. ""
  343. }
  344. { duplicate$ empty$
  345. {
  346. swap$ pop$
  347. }
  348. { swap$
  349. pop$
  350. }
  351. if$
  352. }
  353. if$
  354. }
  355. %%%%%%%%%%%%
  356. %% 调试例程
  357. %%%%%%%%%%%%
  358. % 默认调试输出函数
  359. FUNCTION {debug.output} {
  360. "[DEBUG] " swap$ * top$
  361. }
  362. % 状态调试输出函数
  363. FUNCTION {debug.output.status} {
  364. "---- output.state="
  365. output.state before.all =
  366. { "before.all" }
  367. { output.state mid.sentence =
  368. { "mid.sentence" }
  369. { output.state after.sentence =
  370. { "after.sentence" }
  371. { output.state url.sentence =
  372. { "url.sentence" }
  373. { output.state before.pages =
  374. { "before.pages" }
  375. { "after.block" }
  376. if$
  377. }
  378. if$
  379. }
  380. if$
  381. }
  382. if$
  383. }
  384. if$
  385. * debug.output
  386. }
  387. FUNCTION {output.year}
  388. { 't :=
  389. number empty$
  390. volume empty$
  391. and
  392. { add.period$ write$ }
  393. { ", " * write$ }
  394. if$
  395. t
  396. }
  397. % STRINGS {z}
  398. % FUNCTION {remove.dots}
  399. % { 'z :=
  400. % ""
  401. % { z empty$ not }
  402. % { z #1 #1 substring$
  403. % z #2 global.max$ substring$ 'z :=
  404. % duplicate$ bbl.period = 'pop$
  405. % { * }
  406. % if$
  407. % }
  408. % while$
  409. % %z
  410. % }
  411. % 对于中文文献, 用全角句点替换英文句点
  412. FUNCTION {replace.half.width.period} {
  413. % % DEBUG
  414. % duplicate$ "-- replace.half.width.period(" swap$ * ")" * debug.output
  415. % % END OF DEBUG
  416. language empty$
  417. { " " * } % 对于英文文献, 在句点后加一空格
  418. { duplicate$ text.length$ 'numnames := % numnames 等于字符串长度
  419. % % DEBUG
  420. % numnames int.to.str$ "---- text.length$=" swap$ * debug.output
  421. % % END OF DEBUG
  422. duplicate$ numnames #1 substring$ "." =
  423. { % % DEBUG
  424. % "---- Found '.' at the end" debug.output
  425. % % END OF DEBUG
  426. numnames #1 -
  427. #1 swap$ substring$
  428. bbl.period *
  429. }
  430. { skip$ }
  431. if$
  432. }
  433. if$
  434. % % DEBUG
  435. % duplicate$ "---- Return=" swap$ * debug.output
  436. % % END OF DEBUG
  437. }
  438. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  439. %% 输出例程: 输出栈顶项并根据需要添加标点符号
  440. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  441. % 非空项输出函数: 用于输出非空项
  442. FUNCTION {output.nonnull} {
  443. % % DEBUG
  444. % duplicate$ "output.nonnull(" swap$ * ")" * debug.output
  445. % debug.output.status
  446. % % END OF DEBUG
  447. swap$
  448. % 根据当前输出状态添加前置标点符号
  449. % before.all 起始, 不添加任何标点符号直接输出
  450. % mid.sentence 句中, 前置逗号输出
  451. % after.sentence 句末, 前置句号输出
  452. % after.block 块后, 前置句号, 后置 \newblock 输出
  453. % after.title
  454. output.state mid.sentence =
  455. { bbl.comma * write$ } % mid.sentence 前置逗号
  456. { output.state after.block =
  457. { add.period$ % 块后, 后置句号
  458. replace.half.width.period % 为中文文献替换句点
  459. write$
  460. newline$
  461. % "\newblock " write$
  462. } % 后置 \newblock 输出
  463. { output.state before.all =
  464. { write$ } % 起始, 不添加任何标点符号直接输出
  465. { output.state after.title =
  466. { bbl.parallel *
  467. write$ }
  468. { output.state before.pages =
  469. { bbl.colon *
  470. write$ }
  471. { add.period$ % 句末, 前置句号输出
  472. replace.half.width.period
  473. write$ } %
  474. if$
  475. }
  476. if$
  477. }
  478. if$
  479. }
  480. if$
  481. mid.sentence 'output.state :=
  482. }
  483. if$
  484. % s
  485. }
  486. % 无警告输出函数
  487. FUNCTION {output} {
  488. duplicate$ empty$
  489. { pop$ } % 若输出项为空, 则舍去空输出项
  490. { output.nonnull } % 否则调用非空输出函数
  491. if$
  492. }
  493. % 警告输出函数: 同 output, 但是对于空项给出警告提示
  494. FUNCTION {output.warn}
  495. { 't :=
  496. duplicate$ empty$
  497. { pop$ "empty " t * " in " * cite$ * warning$ }
  498. { output.nonnull }
  499. if$
  500. }
  501. % 将数字字符串转换成序数词形式字符串(例如: "7" -> "7th")
  502. FUNCTION {num.to.ordinal} {
  503. duplicate$ #-1 #1 substring$ "1" =
  504. { bbl.st * }
  505. { duplicate$ #-1 #1 substring$ "2" =
  506. { bbl.nd * }
  507. { duplicate$ #-1 #1 substring$ "3" =
  508. { bbl.rd * }
  509. { bbl.th * }
  510. if$
  511. }
  512. if$
  513. }
  514. if$
  515. }
  516. % 从字符串中提取前导数字的函数
  517. % 如果栈顶字符串以数字开头(例如: "11th"), 则将字符串用其数字部分(即,"11")
  518. % 替换. 否则, 保持原字符串不变. 用于版本转换函数(convert.edition)
  519. % s 保存提取出的数字, t 保存剩余待扫描的字符串.
  520. FUNCTION {extract.num} {
  521. duplicate$ 't := % t <- 输入字符串
  522. "" 's := % s <- ""
  523. { t empty$ not } % while( t != "" ) {
  524. { t #1 #1 substring$ % tmp <- t[0]
  525. t #2 global.max$ substring$
  526. 't := % t <- t[2:global.max$]
  527. duplicate$ is.num % if( is.num( tmp ) )
  528. { s swap$ * 's := } % s <- s & tmp
  529. { pop$ "" 't := } % else t <- ""
  530. if$ % }
  531. } %
  532. while$ % if( s == "" )
  533. s empty$ % ;
  534. 'skip$ % else
  535. { pop$ s } % return s
  536. if$ %
  537. }
  538. % 将1st~10th单词形式的序数词转换成阿拉伯数字形式
  539. FUNCTION {word.to.num} {
  540. duplicate$ "l" change.case$
  541. 's := % s <- lower( arg )
  542. s "first" = % if ( s == "first" )
  543. { pop$ "1" } % return "1"
  544. { skip$ }
  545. if$
  546. s "second" = % if ( s == "second" )
  547. { pop$ "2" } % return "2"
  548. { skip$ }
  549. if$
  550. s "third" =
  551. { pop$ "3" }
  552. { skip$ }
  553. if$
  554. s "fourth" =
  555. { pop$ "4" }
  556. { skip$ }
  557. if$
  558. s "fifth" =
  559. { pop$ "5" }
  560. { skip$ }
  561. if$
  562. s "sixth" =
  563. { pop$ "6" }
  564. { skip$ }
  565. if$
  566. s "seventh" =
  567. { pop$ "7" }
  568. { skip$ }
  569. if$
  570. s "eighth" =
  571. { pop$ "8" }
  572. { skip$ }
  573. if$
  574. s "ninth" =
  575. { pop$ "9" }
  576. { skip$ }
  577. if$
  578. s "tenth" =
  579. { pop$ "10" }
  580. { skip$ }
  581. if$
  582. }
  583. % 转换字符串形式的序数词为数字形式的序数词
  584. % 例如: 将 "Eleventh" 转换为 "11th"
  585. FUNCTION {convert.edition} {
  586. duplicate$ empty$ 'skip$
  587. { duplicate$ #1 #1 substring$
  588. is.num % if( is.num( arg[1] ) ) {
  589. { extract.num % tmp <- extract.num( arg )
  590. num.to.ordinal % tmp <- num.to.ordinal( tmp )
  591. } % } else {
  592. { word.to.num % tmp <- word.to.num( arg )
  593. duplicate$ #1 #1 substring$
  594. is.num % if( is.num( tmp[1] ) )
  595. { num.to.ordinal } % tmp <- num.to.ordinal( tmp )
  596. { "edition ordinal word "
  597. quote$ * edition * quote$ *
  598. " may be too high (or improper) for conversion" *
  599. " in " * cite$ * warning$ % else output warning
  600. }
  601. if$
  602. }
  603. if$
  604. }
  605. if$
  606. }
  607. FUNCTION {start.entry}
  608. { newline$
  609. "\bibitem{" write$
  610. cite$ write$
  611. "}" write$
  612. newline$
  613. ""
  614. before.all 'output.state :=
  615. }
  616. FUNCTION {fin.entry}
  617. { add.period$
  618. replace.half.width.period
  619. write$
  620. newline$
  621. }
  622. % FUNCTION {fin.entry}
  623. % { duplicate$ empty$
  624. % 'pop$
  625. % 'write$
  626. % if$
  627. % newline$
  628. % }
  629. FUNCTION {new.block}
  630. { output.state before.all =
  631. 'skip$
  632. { after.block 'output.state := }
  633. if$
  634. }
  635. FUNCTION {new.sentence}
  636. { output.state after.block =
  637. 'skip$
  638. { output.state before.all =
  639. 'skip$
  640. { after.sentence 'output.state := }
  641. if$
  642. }
  643. if$
  644. }
  645. FUNCTION {new.block.checka}
  646. { empty$
  647. 'skip$
  648. 'new.block
  649. if$
  650. }
  651. FUNCTION {new.block.checkb}
  652. { empty$
  653. swap$ empty$
  654. and
  655. 'skip$
  656. 'new.block
  657. if$
  658. }
  659. FUNCTION {new.sentence.checka}
  660. { empty$
  661. 'skip$
  662. 'new.sentence
  663. if$
  664. }
  665. FUNCTION {new.sentence.checkb}
  666. { empty$
  667. swap$ empty$
  668. and
  669. 'skip$
  670. 'new.sentence
  671. if$
  672. }
  673. FUNCTION {field.or.null}
  674. { duplicate$ empty$
  675. { pop$ "" }
  676. 'skip$
  677. if$
  678. }
  679. FUNCTION {emphasize}
  680. { duplicate$ empty$
  681. { pop$ "" }
  682. { "{\em " swap$ * "}" * }
  683. if$
  684. }
  685. FUNCTION {format.language}
  686. { language empty$
  687. 'skip$
  688. 'skip$
  689. if$
  690. }
  691. FUNCTION {is.space}
  692. { chr.to.int$
  693. duplicate$ #32 =
  694. { pop$ #1 }
  695. { pop$ #0 }
  696. if$
  697. }
  698. FUNCTION {is.lower.char}
  699. {
  700. chr.to.int$
  701. duplicate$ #96 >
  702. { #123 <
  703. { #1 }
  704. { #0 }
  705. if$
  706. }
  707. { pop$ #0 }
  708. if$
  709. }
  710. % 将last name转换为全大写
  711. FUNCTION {capitalize.last.name} {
  712. "u" change.case$
  713. }
  714. % FUNCTION {capitalize.last.name}
  715. % {
  716. % 'thename := % 输入参数 thename
  717. % thename text.length$
  718. % 'namelength := % namelength := thename 的长度
  719. % #1 'charptr :=
  720. % #0 'lastnamecapitalized :=
  721. % ""
  722. % { charptr #1 - namelength <
  723. % % % debug
  724. % % duplicate$ int.to.str$ "( charptr + #1 > namelength ) == " swap$ * warning$
  725. % % % eod
  726. % }
  727. % {
  728. % % % debug
  729. % % "charptr = " charptr int.to.str$ *
  730. % % ", lastnamecapitalized = " *
  731. % % lastnamecapitalized int.to.str$ * warning$
  732. % % % eod
  733. % lastnamecapitalized #1 =
  734. % { thename charptr namelength charptr - #1 + substring$ *
  735. % namelength #1 + 'charptr :=
  736. % % % debug
  737. % % duplicate$ "top of the stack = " swap$ * warning$
  738. % % % eod
  739. % }
  740. % { thename charptr #1 substring$
  741. % % % debug
  742. % % duplicate$ "the char = " swap$ * warning$
  743. % % % eod
  744. % duplicate$ is.lower.char
  745. % % % debug
  746. % % duplicate$ int.to.str$ "is.lower.char = " swap$ * warning$
  747. % % % eod
  748. % { "u" change.case$ * }
  749. % { duplicate$ is.space
  750. % % % debug
  751. % % duplicate$ int.to.str$ "is.space = " swap$ * warning$
  752. % % % eod
  753. % { #1 'lastnamecapitalized :=
  754. % *
  755. % }
  756. % { *
  757. % }
  758. % if$
  759. % }
  760. % if$
  761. % % % debug
  762. % % duplicate$ "top of the stack = " swap$ * warning$
  763. % % % eod
  764. % charptr #1 + 'charptr :=
  765. % }
  766. % if$
  767. % }
  768. % while$
  769. % }
  770. % 格式化盲审姓名
  771. FUNCTION {format.names.for.peer.review} {
  772. 's := % s := author域
  773. #1 'nameptr := % nameptr 是姓名指针,初始化为 1
  774. s num.names$ 'numnames := % 利用 num.names$ 获得 s 中的作者数量存入 nameptr
  775. numnames 'namesleft := % 未处理的姓名数 namesleft := numnames
  776. % 循环处理所有姓名
  777. { namesleft #0 > } % if namesleft > #0 (还有姓名没有格式化)
  778. { s nameptr % 选择第 nameptr 个姓名
  779. name.format.string % 按 name.format.string 的格式排版
  780. format.name$ % 调用 format.name$
  781. remove.period % 并删除缩写符号'.'
  782. 't := % 格式化后的姓名暂存于 t
  783. language empty$
  784. { author.name.in.english }% 如果是英文文献将 author.name.in.english 压栈
  785. { author.name.in.chinese } % 否则将 author.name.in.chinese 压栈
  786. if$
  787. t = % 用当前的姓名与栈上的姓名做比较
  788. { nameptr int.to.str$ % 将作者序号转化为字符串
  789. "\CJKnumber{" swap$ * "}" * % 使用中文数字
  790. bbl.number swap$ * bbl.author * % 加上``第''和``作者''
  791. % duplicate$ debug.output
  792. }
  793. { skip$ }
  794. if$
  795. nameptr #1 + 'nameptr := % 姓名指针加 1
  796. namesleft #1 - 'namesleft := % 剩余姓名数减 1
  797. }
  798. while$
  799. }
  800. % 格式化非盲审姓名
  801. FUNCTION {format.names.for.non.peer.review} {
  802. % 初始化
  803. 's := % s := author域
  804. #1 'nameptr := % nameptr 是姓名指针,初始化为 1
  805. s num.names$ 'numnames := % 利用 num.names$ 获得 s 中的作者数量存入 nameptr
  806. numnames 'namesleft := % 未处理的姓名数 namesleft := numnames
  807. % 循环处理所有姓名
  808. { namesleft #0 > } % if namesleft > #0 (还有姓名没有格式化)
  809. { s nameptr % 选择第 nameptr 个姓名
  810. name.format.string % 按 name.format.string 的格式排版
  811. format.name$ % 调用 format.name$
  812. % language empty$
  813. % { "u" change.case$ } % 如果不是语言为空, 做大写转换
  814. % { skip$ }
  815. % if$ % <language 判断结束>
  816. remove.period % 并删除缩写符号'.'
  817. 't := % 格式化后的姓名暂存于 t
  818. nameptr #1 >
  819. { nameptr max.num.names.before.forced.et.al #1 + =
  820. { "others" 't := % 如果当前作者的序数已经超出了最大列显作者数
  821. #1 'namesleft := } % 则置未处理姓名数为#1, 以便跳出循环
  822. { bbl.comma * } % 如果作者序数在允许范围内, 则添加逗号
  823. if$ % <et al 判断结束>
  824. namesleft #1 > % 若当前姓名不是最后一个
  825. { t * } % 显示当前姓名
  826. { t "others" = % 若当前姓名是最后一个且后面有略去的姓名
  827. { bbl.etal * } % 添加", et~al"或",等"
  828. { t * } % 如果没有略去姓名,以句点结束
  829. if$ % <others 判断结束>
  830. }
  831. if$ % <namesleft 判断结束>
  832. }
  833. { t } % 如果是第一个作者, 直接将排版后的姓名压栈
  834. if$
  835. nameptr #1 + 'nameptr := % 姓名指针加 1
  836. namesleft #1 - 'namesleft := % 剩余姓名数减 1
  837. }
  838. while$
  839. }
  840. % 格式化姓名
  841. FUNCTION {format.names} {
  842. is.for.peer.review
  843. { format.names.for.peer.review } % 格式化盲审姓名
  844. { format.names.for.non.peer.review } % 格式化非盲审姓名
  845. if$
  846. }
  847. FUNCTION {format.authors}
  848. { author empty$
  849. { bbl.anonymous
  850. "The author in " cite$ * " is missing." * warning$ }
  851. { author format.names }
  852. if$
  853. }
  854. FUNCTION {format.editors}
  855. { editor empty$
  856. { bbl.anonymous
  857. "The editor in " cite$ * " is missing." * warning$
  858. }
  859. { editor format.names }
  860. if$
  861. }
  862. FUNCTION {format.assignees} {
  863. assignee empty$
  864. { "" }
  865. { assignee format.names }
  866. if$
  867. }
  868. % 译者格式
  869. FUNCTION {format.translators}
  870. { translator empty$
  871. { "" } % 无译者
  872. { new.block % 有译者
  873. translator format.names ",译" *
  874. }
  875. if$
  876. }
  877. % 机构格式
  878. FUNCTION {format.institution} {
  879. institution empty$
  880. { "" }
  881. { institution }
  882. if$
  883. }
  884. % 组织格式
  885. FUNCTION {format.organization} {
  886. organization empty$
  887. { "" }
  888. { organization }
  889. if$
  890. }
  891. % 文献类型标志代码/电子文献载体标志代码
  892. FUNCTION {bib.type.designator} {
  893. % % DEBUG
  894. % "bib.type.designator(type:" type$ * debug.output
  895. % " url: " url empty$ { "<N/A>" }{ url } if$ * debug.output
  896. % % END OF DEBUG
  897. % 文献类型标志代码
  898. type$ "book" = type$ "inbook" = or
  899. { "M" }
  900. { type$ "standard" =
  901. { "S" }
  902. { type$ "proceedings" = type$ "conference" = or type$ "inproceedings" = or
  903. { "C" }
  904. { type$ "patent" =
  905. { "P" }
  906. { type$ "phdthesis" = type$ "masterthesis" = or
  907. {language "Chinese" = { "学位论文" } { language empty$ = {"Dissertation"} if$} if$}
  908. { type$ "techreport" =
  909. { "R" }
  910. { type$ "article" = type$ "periodical" = or
  911. { "J" }
  912. { type$ "online" = type$ "webpage" = or type$ "www" = or
  913. { "EB" }
  914. { type$ "electronic" =
  915. { esubtype empty$
  916. { url empty$
  917. { "" }
  918. { "EB" }
  919. if$
  920. }
  921. { esubtype "webpage" =
  922. { "EB" }
  923. { esubtype "database" =
  924. { "DB" }
  925. { esubtype "program" =
  926. { "CP" }
  927. { "" }
  928. if$ % electronics[program]
  929. }
  930. if$ % electronics[database]
  931. }
  932. if$ % electronics[webpage]
  933. }
  934. if$
  935. }
  936. { "" } % 其他
  937. if$ % electronics
  938. }
  939. if$ % online/webpage/www
  940. }
  941. if$ % article/periodical
  942. }
  943. if$ % techreport
  944. }
  945. if$ % phdthesis/mastersthesis
  946. }
  947. if$ % patent
  948. }
  949. if$ % proceedings/inproceedings/conference
  950. }
  951. if$ % standard
  952. }
  953. if$ % book/inbook
  954. % % DEBUG
  955. % duplicate$ " doc.designator: " swap$ * debug.output
  956. % % END OF DEBUG
  957. % 电子文献载体标志代码
  958. duplicate$ "" =
  959. { skip$ }
  960. { "~[" swap$ *
  961. howpublished empty$
  962. { url empty$
  963. { "" }
  964. { "/OL" }
  965. if$
  966. }
  967. { howpublished "online" =
  968. { "/OL" }
  969. { howpublished "magtype" =
  970. { "MT" }
  971. { howpublished "disk" =
  972. { "DK" }
  973. { howpublished "cdrom" =
  974. { "CD" }
  975. { "" }
  976. if$ % cdrom
  977. }
  978. if$ % disk
  979. }
  980. if$ % magitude type
  981. }
  982. if$ % online
  983. }
  984. if$
  985. * "]" *
  986. }
  987. if$
  988. }
  989. FUNCTION {format.title}
  990. { title empty$
  991. { "" }
  992. { new.block
  993. title }
  994. if$
  995. }
  996. % 格式化年月日``YYYY-MM-DD''
  997. FUNCTION {format.year.month.day} {
  998. year empty$
  999. { "YYYY" }
  1000. { year }
  1001. if$
  1002. "-" *
  1003. month empty$
  1004. { "MM" * }
  1005. { month text.length$ #2 <
  1006. { "0" * }
  1007. { skip$ }
  1008. if$
  1009. month *
  1010. }
  1011. if$
  1012. "-" *
  1013. day empty$
  1014. { "DD" * }
  1015. { day text.length$ #2 <
  1016. { "0" * }
  1017. 'skip$
  1018. if$
  1019. day *
  1020. }
  1021. if$
  1022. }
  1023. FUNCTION {format.reference.date} {
  1024. refdate empty$
  1025. { ""
  1026. url empty$
  1027. { skip$ }
  1028. { "The refdate in " cite$ * " is missing." * warning$ }
  1029. if$
  1030. }
  1031. { output.state mid.sentence =
  1032. { before.all 'output.state := }
  1033. { skip$ }
  1034. if$
  1035. "~[" refdate * "]" * }
  1036. if$
  1037. }
  1038. % patent的题名项: 专利题名: 专利国别, 专利号~[文献类型标志]
  1039. FUNCTION {format.patent.title} {
  1040. title empty$ % 专利提名
  1041. { "" }
  1042. { new.block
  1043. title bbl.colon *
  1044. nationality empty$ % 专利国别, 专利号
  1045. { % 专利国别为必备项
  1046. "The nationality in " cite$ * " is missing." * warning$
  1047. }
  1048. { number empty$
  1049. { % 专利号为必选项
  1050. "The number in " cite$ * " is missing." * warning$
  1051. }
  1052. { % 产生``专利国别, 专利号''
  1053. nationality * bbl.comma * number *
  1054. }
  1055. if$
  1056. }
  1057. if$
  1058. % 文献类型标志
  1059. bib.type.designator *
  1060. }
  1061. if$
  1062. }
  1063. % patent的出版项:
  1064. FUNCTION {format.patent.publication} {
  1065. new.block
  1066. format.year.month.day
  1067. % % DEBUG
  1068. % duplicate$ "End of format.patent.publication, top = " swap$ * debug.output
  1069. % % END OF DEBUG
  1070. url empty$
  1071. { skip$ }
  1072. { refdate empty$
  1073. { "The refdate in " cite$ * " is missing." * warning$ }
  1074. { "~[" * refdate * "]" * }
  1075. if$
  1076. }
  1077. if$
  1078. }
  1079. % electronic的主要责任者:
  1080. % author 或 organization
  1081. FUNCTION {format.electronic.authors}
  1082. {
  1083. author empty$
  1084. { organization empty$
  1085. { " " }
  1086. { organization }
  1087. if$
  1088. }
  1089. { format.authors }
  1090. if$
  1091. }
  1092. % electronic的出版项
  1093. FUNCTION {format.electronic.publication} {
  1094. new.block
  1095. % 出版地: 出版者
  1096. address empty$
  1097. { "" }
  1098. { address
  1099. publisher empty$
  1100. { skip$ }
  1101. { bbl.colon * publisher * }
  1102. if$
  1103. }
  1104. if$
  1105. % 出版年
  1106. year empty$
  1107. { skip$ }
  1108. { publisher empty$
  1109. { "" }
  1110. { bbl.comma }
  1111. if$
  1112. * year * }
  1113. if$
  1114. }
  1115. %% article的标题格式
  1116. FUNCTION {format.atitle}
  1117. { title empty$
  1118. { "" }
  1119. { title
  1120. newsletter empty$
  1121. { "~[J" * }
  1122. { newsletter "yes" =
  1123. { "~[N" * }
  1124. { "~[J" * }
  1125. if$
  1126. }
  1127. if$
  1128. url empty$
  1129. { "]" * }
  1130. { "/OL]" * }
  1131. if$
  1132. }
  1133. if$
  1134. }
  1135. %% incollection的标题格式
  1136. FUNCTION {format.ictitle}
  1137. { title empty$
  1138. { "" }
  1139. { title "~[M]~//~" *
  1140. editor format.names *
  1141. }
  1142. if$
  1143. }
  1144. %% inproceedings的标题格式
  1145. FUNCTION {format.iptitle}
  1146. { title empty$
  1147. { "" }
  1148. { title "~[C]~//~" *
  1149. editor format.names *
  1150. }
  1151. if$
  1152. }
  1153. FUNCTION {n.dashify}
  1154. { 't :=
  1155. ""
  1156. { t empty$ not }
  1157. { t #1 #1 substring$ "-" =
  1158. { t #1 #2 substring$ "--" = not
  1159. { "--" *
  1160. t #2 global.max$ substring$ 't :=
  1161. }
  1162. { { t #1 #1 substring$ "-" = }
  1163. { "-" *
  1164. t #2 global.max$ substring$ 't :=
  1165. }
  1166. while$
  1167. }
  1168. if$
  1169. }
  1170. { t #1 #1 substring$ *
  1171. t #2 global.max$ substring$ 't :=
  1172. }
  1173. if$
  1174. }
  1175. while$
  1176. }
  1177. % 年,卷(期)
  1178. FUNCTION {format.year.volume.number} {
  1179. year empty$
  1180. { "" }
  1181. { type$ "periodical" =
  1182. { new.block }
  1183. { mid.sentence 'output.state := }
  1184. if$
  1185. year
  1186. volume empty$
  1187. 'skip$
  1188. { bbl.comma * volume * }
  1189. if$
  1190. number empty$
  1191. 'skip$
  1192. { "~(" * number * ")" * }
  1193. if$
  1194. year2 empty$
  1195. { skip$ }
  1196. { "~--" *
  1197. year2 "now" =
  1198. { skip$ }
  1199. { year2 *
  1200. volume2 empty$
  1201. { skip$ }
  1202. { bbl.comma * volume2 * }
  1203. if$
  1204. number2 empty$
  1205. 'skip$
  1206. { "~(" * number2 * ")" * }
  1207. if$
  1208. }
  1209. if$
  1210. }
  1211. if$
  1212. }
  1213. if$
  1214. % %% DEBUG
  1215. % duplicate$ "format.year.volume.number=" swap$ * debug.output
  1216. % %% END OF DEBUG
  1217. }
  1218. % 卷(期).年,月(for article only)
  1219. FUNCTION {format.volume.number.year.month} {
  1220. add.period$
  1221. year empty$
  1222. { "" }
  1223. {
  1224. volume empty$
  1225. 'skip$
  1226. { "~" * volume * }
  1227. if$
  1228. number empty$
  1229. 'skip$
  1230. { "~(" * number * ")" * }
  1231. if$
  1232. new.block
  1233. year
  1234. month empty$
  1235. 'skip$
  1236. { bbl.comma * month * }
  1237. if$
  1238. }
  1239. if$
  1240. }
  1241. %
  1242. FUNCTION {format.date}
  1243. { year empty$
  1244. { month empty$
  1245. { "" }
  1246. { "there's a month but no year in " cite$ * warning$
  1247. month
  1248. }
  1249. if$
  1250. }
  1251. { month empty$
  1252. { year }
  1253. { month bbl.comma * year * }
  1254. if$
  1255. }
  1256. if$
  1257. }
  1258. function {format.year.year}
  1259. { year empty$
  1260. 'skip$
  1261. { year "--" *
  1262. year2 empty$
  1263. 'skip$
  1264. { year2 "now" =
  1265. 'skip$
  1266. { year2 * }
  1267. if$
  1268. }
  1269. if$
  1270. }
  1271. if$
  1272. }
  1273. % 专著标题格式
  1274. FUNCTION {format.book.title} {
  1275. new.block % 生成一个新的block
  1276. title
  1277. type$ "proceedings" =
  1278. { address empty$
  1279. { skip$ }
  1280. { bbl.comma * address * bbl.comma *
  1281. month empty$
  1282. { skip$ }
  1283. { month * }
  1284. if$
  1285. year empty$
  1286. { skip$ }
  1287. { year * }
  1288. if$
  1289. }
  1290. if$
  1291. }
  1292. { skip$ }
  1293. if$
  1294. bib.type.designator * % 标题 + [文献标志代码/电子文献载体标志代码]
  1295. }
  1296. % 科技报告标题格式
  1297. FUNCTION {format.techreport.title} {
  1298. title empty$
  1299. { "" }
  1300. { new.block % 生成一个新的block
  1301. title % 标题 +
  1302. number empty$ % 编号 +
  1303. { "" }
  1304. { bbl.comma * number }
  1305. if$ *
  1306. bib.type.designator * % [文献标志代码/电子文献载体标志代码]
  1307. }
  1308. if$
  1309. }
  1310. % 连续出版物标题格式
  1311. FUNCTION {format.jtitle}
  1312. { title "~[J" *
  1313. url empty$
  1314. { "]" * }
  1315. { "/OL]" * }
  1316. if$
  1317. }
  1318. % 论文集标题格式
  1319. FUNCTION {format.ptitle.volume}
  1320. { title
  1321. volume empty$
  1322. { "~[C]" }
  1323. { bbl.colon volume * "~[C]" * }
  1324. if$ *
  1325. %emphasize
  1326. }
  1327. FUNCTION {tie.or.space.connect}
  1328. { duplicate$ text.length$ #3 <
  1329. { "~" }
  1330. { " " }
  1331. if$
  1332. swap$ * *
  1333. }
  1334. FUNCTION {either.or.check}
  1335. { empty$
  1336. 'pop$
  1337. { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  1338. if$
  1339. }
  1340. FUNCTION {format.bvolume}
  1341. { volume empty$
  1342. { "" }
  1343. { language empty$
  1344. { "volume" volume tie.or.space.connect }
  1345. { volume }
  1346. if$
  1347. series empty$
  1348. 'skip$
  1349. { " of " * series emphasize * }
  1350. if$
  1351. "volume and number" number either.or.check
  1352. }
  1353. if$
  1354. }
  1355. FUNCTION {format.number.series}
  1356. { volume empty$
  1357. { number empty$
  1358. { series field.or.null }
  1359. { output.state mid.sentence =
  1360. { "number" }
  1361. { "Number" }
  1362. if$
  1363. number tie.or.space.connect
  1364. series empty$
  1365. { "there's a number but no series in " cite$ * warning$ }
  1366. { " in " * series * }
  1367. if$
  1368. }
  1369. if$
  1370. }
  1371. { "" }
  1372. if$
  1373. }
  1374. % 版本项格式
  1375. FUNCTION {format.edition} {
  1376. edition empty$
  1377. { "" }
  1378. { new.block % 版本项按一个block输出
  1379. language empty$ % 英文文献版本号自动转换成数字形式的序数词
  1380. { edition convert.edition
  1381. "l" change.case$ " ed" *
  1382. }
  1383. { edition } % 中文文献版本号直接输出
  1384. if$
  1385. }
  1386. if$
  1387. }
  1388. FUNCTION {format.url}
  1389. { url empty$
  1390. { "" }
  1391. { new.block
  1392. "\url{" url * "}" *
  1393. }
  1394. if$
  1395. }
  1396. FUNCTION {multi.page.check}
  1397. { 't :=
  1398. #0 'multiresult :=
  1399. { multiresult not
  1400. t empty$ not
  1401. and
  1402. }
  1403. { t #1 #1 substring$
  1404. duplicate$ "-" =
  1405. swap$ duplicate$ "," =
  1406. swap$ "+" =
  1407. or or
  1408. { #1 'multiresult := }
  1409. { t #2 global.max$ substring$ 't := }
  1410. if$
  1411. }
  1412. while$
  1413. multiresult
  1414. }
  1415. FUNCTION {format.pages}
  1416. { pages empty$
  1417. { "" }
  1418. { before.pages 'output.state :=
  1419. pages multi.page.check
  1420. { "" pages n.dashify tie.or.space.connect }
  1421. { "" pages tie.or.space.connect }
  1422. if$
  1423. }
  1424. if$
  1425. }
  1426. FUNCTION {format.vol.num.pages}
  1427. { volume field.or.null
  1428. number empty$
  1429. 'skip$
  1430. { "(" number * ")" * *
  1431. volume empty$
  1432. { newsletter empty$
  1433. { "there's a number but no volume in " cite$ * warning$ }
  1434. 'skip$
  1435. if$
  1436. }
  1437. 'skip$
  1438. if$
  1439. }
  1440. if$
  1441. pages empty$
  1442. 'skip$
  1443. { duplicate$ empty$
  1444. { pop$ format.pages }
  1445. { bbl.colon * pages n.dashify * }
  1446. if$
  1447. }
  1448. if$
  1449. % duplicate$ "top of stack = " swap$ * warning$
  1450. url empty$
  1451. 'skip$
  1452. { refdate empty$
  1453. { "there's an url but no refdate in " cite$ * warning$ }
  1454. { %duplicate$ "url and refdate is not empty, top of stack = " swap$ * warning$
  1455. "~[" * refdate * "]" *
  1456. }
  1457. if$
  1458. %duplicate$ "top of stack = " swap$ * warning$
  1459. }
  1460. if$
  1461. }
  1462. FUNCTION {format.chapter.pages}
  1463. { chapter empty$
  1464. { "" }
  1465. { type empty$
  1466. { "chapter" }
  1467. { type "l" change.case$ }
  1468. if$
  1469. chapter tie.or.space.connect
  1470. pages empty$
  1471. 'skip$
  1472. { ", " * format.pages * }
  1473. if$
  1474. }
  1475. if$
  1476. }
  1477. FUNCTION {format.in.booktitle}
  1478. { booktitle empty$
  1479. { "" }
  1480. { editor empty$
  1481. { language empty$
  1482. { " " booktitle * }
  1483. % { "Proceedings of " booktitle * }
  1484. { " " booktitle * }
  1485. if$
  1486. }
  1487. { language empty$
  1488. % { "In: " format.editors * ", Proceedings of " * booktitle * }
  1489. { " " booktitle * }
  1490. { " " booktitle * }
  1491. if$
  1492. }
  1493. if$
  1494. }
  1495. if$
  1496. }
  1497. FUNCTION {format.in.ed.booktitle.volume}
  1498. { booktitle empty$
  1499. { "" }
  1500. { editor empty$
  1501. { language empty$
  1502. % { "Proceedings of " booktitle * }
  1503. { " " booktitle * }
  1504. { " " booktitle * }
  1505. if$
  1506. }
  1507. { language empty$
  1508. %{ "In: " format.editors * ", Proceedings of " * booktitle * }
  1509. { " " booktitle * }
  1510. { " " booktitle * }
  1511. if$
  1512. }
  1513. if$
  1514. %% volume
  1515. volume empty$
  1516. 'skip$
  1517. { language empty$
  1518. { "Vol." * volume * }
  1519. { ":第" * volume * "卷" * }
  1520. if$
  1521. }
  1522. if$
  1523. }
  1524. if$
  1525. }
  1526. FUNCTION {empty.misc.check}
  1527. { author empty$ title empty$ howpublished empty$
  1528. month empty$ year empty$ note empty$
  1529. and and and and and
  1530. { "all relevant fields are empty in " cite$ * warning$ }
  1531. 'skip$
  1532. if$
  1533. }
  1534. FUNCTION {format.thesis.type}
  1535. { type empty$
  1536. 'skip$
  1537. { pop$
  1538. type "t" change.case$
  1539. }
  1540. if$
  1541. }
  1542. FUNCTION {format.tr.number}
  1543. { type empty$
  1544. { "Technical Report" }
  1545. 'type
  1546. if$
  1547. number empty$
  1548. { "t" change.case$ }
  1549. { number tie.or.space.connect }
  1550. if$
  1551. }
  1552. FUNCTION {format.article.crossref}
  1553. { key empty$
  1554. { journal empty$
  1555. { "need key or journal for " cite$ * " to crossref " * crossref *
  1556. warning$
  1557. ""
  1558. }
  1559. { "In {\em " journal * "\/}" * }
  1560. if$
  1561. }
  1562. { "In " key * }
  1563. if$
  1564. " \cite{" * crossref * "}" *
  1565. }
  1566. FUNCTION {format.crossref.editor}
  1567. { editor #1 "{ll }{f{~}}" format.name$
  1568. editor num.names$ duplicate$
  1569. #2 >
  1570. { pop$ " et~al." * }
  1571. { #2 <
  1572. 'skip$
  1573. { editor #2 "{ll }{f{~}}" format.name$ "others" =
  1574. { " et~al." * }
  1575. { " and " * editor #2 "{ll }{f{~}}" format.name$ * }
  1576. if$
  1577. }
  1578. if$
  1579. }
  1580. if$
  1581. }
  1582. FUNCTION {format.book.crossref}
  1583. { volume empty$
  1584. { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  1585. "In "
  1586. }
  1587. { "Volume" volume tie.or.space.connect
  1588. " of " *
  1589. }
  1590. if$
  1591. editor empty$
  1592. editor field.or.null author field.or.null =
  1593. or
  1594. { key empty$
  1595. { series empty$
  1596. { "need editor, key, or series for " cite$ * " to crossref " *
  1597. crossref * warning$
  1598. "" *
  1599. }
  1600. { "{\em " * series * "\/}" * }
  1601. if$
  1602. }
  1603. { key * }
  1604. if$
  1605. }
  1606. { format.crossref.editor * }
  1607. if$
  1608. " \cite{" * crossref * "}" *
  1609. }
  1610. FUNCTION {format.incoll.inproc.crossref}
  1611. { editor empty$
  1612. editor field.or.null author field.or.null =
  1613. or
  1614. { key empty$
  1615. { booktitle empty$
  1616. { "need editor, key, or booktitle for " cite$ * " to crossref " *
  1617. crossref * warning$
  1618. ""
  1619. }
  1620. { "In {\em " booktitle * "\/}" * }
  1621. if$
  1622. }
  1623. { "In " key * }
  1624. if$
  1625. }
  1626. { "In " format.crossref.editor * }
  1627. if$
  1628. " \cite{" * crossref * "}" *
  1629. }
  1630. % 出版地: 出版者
  1631. FUNCTION {format.address.publisher} {
  1632. new.block
  1633. type$ "inproceedings" =
  1634. { pubaddress empty$
  1635. { "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
  1636. publisher empty$
  1637. { "there's neither pubaddress nor publisher in " cite$ * warning$
  1638. "[" * bbl.sine.nomine * "]" * % 无出版者
  1639. }
  1640. { "there's a publisher but no pubaddress in " cite$ * warning$
  1641. publisher * % 有出版者
  1642. }
  1643. if$
  1644. }
  1645. { pubaddress bbl.colon * % 有出版地
  1646. publisher empty$
  1647. { "there's a pubaddress but no publisher in " cite$ * warning$
  1648. "[" * bbl.sine.nomine * "]" * % 无出版者
  1649. }
  1650. { publisher * } % 有出版者
  1651. if$
  1652. }
  1653. if$
  1654. }
  1655. { address empty$
  1656. { "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
  1657. publisher empty$
  1658. { "there's neither address nor publisher in " cite$ * warning$
  1659. "[" * bbl.sine.nomine * "]" * % 无出版者
  1660. }
  1661. { "there's a publisher but no address in " cite$ * warning$
  1662. publisher * % 有出版者
  1663. }
  1664. if$
  1665. }
  1666. { address bbl.colon * % 有出版地
  1667. publisher empty$
  1668. { "there's a address but no publisher in " cite$ * warning$
  1669. "[" * bbl.sine.nomine * "]" * % 无出版者
  1670. }
  1671. { publisher * } % 有出版者
  1672. if$
  1673. }
  1674. if$
  1675. }
  1676. if$
  1677. }
  1678. % 出版地: 出版者, 出版年
  1679. FUNCTION {format.address.publisher.year} {
  1680. % % DEBUG
  1681. % "-- format.address.publisher.year(){" debug.output
  1682. % "-- address =" address * debug.output
  1683. % "-- publisher=" publisher * debug.output
  1684. % "-- year =" year * debug.output
  1685. % % END OF DEBUG
  1686. new.block
  1687. type$ "inproceedings" =
  1688. { pubaddress empty$
  1689. { "" % "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
  1690. publisher empty$
  1691. { "there's neither pubaddress nor publisher in " cite$ * warning$
  1692. "" * % "[" * bbl.sine.nomine * "]" * % 无出版者
  1693. }
  1694. { "there's a publisher but no pubaddress in " cite$ * warning$
  1695. publisher * % 有出版者
  1696. }
  1697. if$
  1698. }
  1699. { publisher empty$
  1700. { "there's a pubaddress but no publisher in " cite$ * warning$
  1701. "" % "[" * bbl.sine.nomine * "]" * % 无出版者
  1702. }
  1703. { pubaddress bbl.colon * % 有出版地
  1704. publisher * } % 有出版者
  1705. if$
  1706. }
  1707. if$
  1708. }
  1709. { address empty$
  1710. { "" % "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
  1711. publisher empty$
  1712. { "there's neither address nor publisher in " cite$ * warning$
  1713. "" * % "[" * bbl.sine.nomine * "]" * % 无出版者
  1714. }
  1715. { "there's a publisher but no address in " cite$ * warning$
  1716. publisher * % 有出版者
  1717. }
  1718. if$
  1719. }
  1720. { publisher empty$
  1721. { "there's a address but no publisher in " cite$ * warning$
  1722. "" % "[" * bbl.sine.nomine * "]" * % 无出版者
  1723. }
  1724. { address bbl.colon * % 有出版地
  1725. publisher * } % 有出版者
  1726. if$
  1727. }
  1728. if$
  1729. }
  1730. if$
  1731. % 出版年
  1732. year empty$
  1733. { "there's no year in " cite$ * warning$ }
  1734. { type$ "inproceedings" =
  1735. { bbl.comma * year * }
  1736. { publisher empty$
  1737. { year * }
  1738. { bbl.comma * year * }
  1739. if$
  1740. }
  1741. if$
  1742. type$ "periodical" =
  1743. { year2 empty$ % 对连续出版物可以排版 year2
  1744. { skip$ }
  1745. { "--" *
  1746. year2 "l" change.case$ "now" =
  1747. { skip$ }
  1748. { year2 * }
  1749. if$
  1750. }
  1751. if$
  1752. }
  1753. { skip$ }
  1754. if$
  1755. }
  1756. if$
  1757. % % DEBUG
  1758. % duplicate$ "-- }=" swap$ * debug.output
  1759. % % END OF DEBUG
  1760. }
  1761. % 出版地: 学校, 出版年
  1762. FUNCTION {format.address.school.year} {
  1763. new.block
  1764. address empty$
  1765. { "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
  1766. school empty$
  1767. { "there's neither address nor school in " cite$ * warning$
  1768. "[" bbl.sine.nomine * "]" * % 无出版者
  1769. }
  1770. { "there's a school but no address in " cite$ * warning$
  1771. school * % 有出版者
  1772. }
  1773. if$
  1774. }
  1775. { address bbl.colon * % 有出版地
  1776. school empty$
  1777. { "there's a address but no school in " cite$ * warning$
  1778. "[" bbl.sine.nomine * "]" * % 无出版者
  1779. }
  1780. { school * } % 有出版者
  1781. if$
  1782. }
  1783. if$
  1784. % 出版年
  1785. year empty$
  1786. { "there's no year in " cite$ * warning$ }
  1787. { bbl.comma * year * }
  1788. if$
  1789. }
  1790. % FUNCTION {format.title.type}
  1791. % { title empty$
  1792. % { type empty$
  1793. % { "" }
  1794. % { "there's a type but no title in " cite$ * warning$
  1795. % type
  1796. % }
  1797. % if$
  1798. % }
  1799. % { type empty$
  1800. % 'title
  1801. % { title bbl.colon * type * }
  1802. % if$
  1803. % }
  1804. % if$
  1805. % }
  1806. FUNCTION {format.note} {
  1807. note empty$
  1808. { new.block "" }
  1809. { url empty$
  1810. { new.block }
  1811. { before.all 'output.state := }
  1812. if$
  1813. note
  1814. }
  1815. if$
  1816. }
  1817. %%%%%%%%%%%%%%%%%
  1818. %% 著录格式: 专著
  1819. %%%%%%%%%%%%%%%%%
  1820. % 普通图书
  1821. FUNCTION {book} {
  1822. start.entry % 开始
  1823. author empty$ % 主要责任者
  1824. { format.editors "author and editor" output.warn }
  1825. { format.authors output.nonnull }
  1826. if$
  1827. format.book.title "title" output.warn % 题名项
  1828. format.translators output % 其他责任者(可选)
  1829. format.edition output % 版本项
  1830. format.address.publisher.year output.nonnull %
  1831. format.reference.date output %
  1832. format.url output % 获取或访问路径
  1833. format.note output % 备注
  1834. fin.entry
  1835. }
  1836. % 标准
  1837. FUNCTION {standard} {
  1838. start.entry
  1839. organization empty$ % 主要责任人
  1840. { format.institution "organization and institution" output.warn }
  1841. { format.organization output.nonnull }
  1842. if$
  1843. format.book.title "title" output.warn % 题名项
  1844. format.translators output % 其他责任人
  1845. format.edition output % 版本项
  1846. format.address.publisher.year output.nonnull % 出版项
  1847. format.url output % URL
  1848. format.note output % 备注项
  1849. fin.entry
  1850. }
  1851. % 学位论文
  1852. FUNCTION {phdthesis} {
  1853. start.entry
  1854. format.authors "author" output.warn
  1855. format.book.title "title" output.warn
  1856. format.address.school.year output
  1857. format.note output
  1858. fin.entry
  1859. }
  1860. % 会议录/论文集
  1861. FUNCTION {proceedings} {
  1862. start.entry
  1863. editor empty$
  1864. { organization empty$
  1865. { format.institution "author, organization institution" output.warn }
  1866. { format.organization output.nonnull }
  1867. if$
  1868. }
  1869. { format.editors output.nonnull }
  1870. if$
  1871. format.book.title "title" output.warn
  1872. format.address.publisher.year output
  1873. format.note output
  1874. fin.entry
  1875. }
  1876. % 科技报告
  1877. FUNCTION {techreport} {
  1878. start.entry
  1879. author empty$
  1880. { organization empty$
  1881. { format.institution
  1882. "author, organization and institution" output.warn }
  1883. { format.organization output.nonnull }
  1884. if$
  1885. }
  1886. { format.authors output.nonnull }
  1887. if$
  1888. format.techreport.title "title" output.warn
  1889. format.address.publisher.year output.nonnull
  1890. format.url output
  1891. format.note output
  1892. fin.entry
  1893. }
  1894. %%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1895. %% 著录格式: 专著中析出的文献
  1896. %%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1897. FUNCTION {format.collection.editors} {
  1898. booktitle empty$
  1899. { "" }
  1900. { after.title 'output.state :=
  1901. format.editors }
  1902. if$
  1903. }
  1904. FUNCTION {format.address} {
  1905. booktitle empty$
  1906. { new.block }
  1907. { mid.sentence 'output.state := }
  1908. if$
  1909. address empty$
  1910. { "" }
  1911. { address }
  1912. if$
  1913. }
  1914. FUNCTION {format.month.year} {
  1915. month empty$
  1916. { "" }
  1917. { month " " * }
  1918. if$
  1919. year empty$
  1920. { "There is month but no year in " cite$ * warning$ }
  1921. { year * }
  1922. if$
  1923. }
  1924. FUNCTION {format.collection.title} {
  1925. booktitle empty$
  1926. { "" }
  1927. { new.block
  1928. "In " booktitle *
  1929. % address empty$
  1930. % { skip$ }
  1931. % { bbl.comma * address * bbl.comma *
  1932. % month empty$
  1933. % { skip$ }
  1934. % { month * }
  1935. % if$
  1936. % year empty$
  1937. % { skip$ }
  1938. % { " " * year * }
  1939. % if$
  1940. % }
  1941. % if$
  1942. }
  1943. if$
  1944. }
  1945. % 图书中析出的文献
  1946. FUNCTION {inbook} {
  1947. start.entry
  1948. author empty$
  1949. { format.editors "author and editor" output.warn }
  1950. { format.authors output.nonnull }
  1951. if$
  1952. format.book.title "title" output.warn
  1953. format.collection.editors "editor" output.warn
  1954. format.collection.title "booktitle" output.warn
  1955. format.translators output % 其他责任人
  1956. format.edition output % 版本项
  1957. format.address.publisher.year output.nonnull % 出版项
  1958. format.pages "pages" output.warn %
  1959. format.url output % URL
  1960. format.note output % 备注项
  1961. fin.entry
  1962. }
  1963. %%%%%%%%%%%%%%%%%
  1964. %% 著录格式: 专利
  1965. %%%%%%%%%%%%%%%%%
  1966. FUNCTION {patent} {
  1967. start.entry
  1968. author empty$
  1969. { format.assignees "assignee" output.warn }
  1970. { format.authors output.nonnull }
  1971. if$
  1972. format.patent.title "title" output.warn
  1973. format.patent.publication output
  1974. format.url output
  1975. format.note output
  1976. fin.entry
  1977. }
  1978. % 电子文献更新或修改日期
  1979. FUNCTION {format.update.date} {
  1980. update empty$
  1981. { "" }
  1982. { output.state mid.sentence =
  1983. { before.all 'output.state := }
  1984. { skip$ }
  1985. if$
  1986. "~(" update * ")" * }
  1987. if$
  1988. }
  1989. %%%%%%%%%%%%%%%%%%%%%
  1990. %% 著录格式: 电子文献
  1991. %%%%%%%%%%%%%%%%%%%%%
  1992. FUNCTION {electronic} {
  1993. start.entry
  1994. author empty$
  1995. { organization "author and organization" output.warn }
  1996. { format.authors output.nonnull }
  1997. if$
  1998. format.book.title output
  1999. format.electronic.publication output
  2000. format.update.date output
  2001. format.reference.date output
  2002. format.url output
  2003. format.note output
  2004. fin.entry
  2005. }
  2006. %%%%%%%%%%%%%%%%%%%%%%%
  2007. %% 著录格式: 连续出版物
  2008. %%%%%%%%%%%%%%%%%%%%%%%
  2009. FUNCTION {periodical} {
  2010. start.entry
  2011. editor empty$
  2012. { format.organization "editors and organization" output.warn }
  2013. { format.editors output.nonnull }
  2014. if$
  2015. format.book.title "title" output.warn
  2016. format.year.volume.number output
  2017. format.address.publisher.year output
  2018. format.url output
  2019. format.note output
  2020. fin.entry
  2021. }
  2022. FUNCTION {format.journal.title} {
  2023. journal empty$
  2024. { "" }
  2025. { new.block journal }
  2026. if$
  2027. }
  2028. % 连续出版物中析出的文献
  2029. FUNCTION {article}
  2030. { start.entry
  2031. format.authors "author" output.warn
  2032. format.book.title "title" output.warn
  2033. format.journal.title "journal" output.warn
  2034. format.volume.number.year.month output
  2035. %format.year.volume.number output
  2036. format.pages "pages" output.warn
  2037. format.reference.date output
  2038. format.url output
  2039. format.note output
  2040. fin.entry
  2041. }
  2042. FUNCTION {booklet}
  2043. { start.entry
  2044. format.authors output
  2045. new.block
  2046. format.title "title" output.warn
  2047. howpublished address new.block.checkb
  2048. howpublished output
  2049. address output
  2050. format.date output
  2051. new.block
  2052. note output
  2053. fin.entry
  2054. }
  2055. FUNCTION {incollection}
  2056. { start.entry
  2057. format.authors "author" output.warn
  2058. new.block
  2059. format.ictitle "title" output.warn
  2060. new.block
  2061. crossref missing$
  2062. { %format.in.ed.booktitle "booktitle" output.warn
  2063. %format.bvolume output
  2064. format.in.ed.booktitle.volume "booktitle" output.warn
  2065. format.number.series output
  2066. format.chapter.pages output
  2067. new.sentence
  2068. % publisher "publisher" output.warn
  2069. % address output
  2070. format.address.publisher.year output
  2071. format.edition output
  2072. format.date ":" * format.pages * output
  2073. %format.date "year" output.warn
  2074. }
  2075. { format.incoll.inproc.crossref output.nonnull
  2076. format.chapter.pages output
  2077. }
  2078. if$
  2079. new.block
  2080. note output
  2081. fin.entry
  2082. }
  2083. % 论文集中析出的文献
  2084. FUNCTION {inproceedings} {
  2085. start.entry
  2086. format.authors "author" output.warn
  2087. format.book.title "title" output.warn
  2088. format.collection.editors "editor" output.warn
  2089. format.collection.title "booktitle" output.warn
  2090. format.address output
  2091. format.month.year output
  2092. % format.address.publisher.year output.nonnull % 出版项
  2093. format.pages "pages" output.warn %
  2094. format.url output % URL
  2095. format.note output % 备注项
  2096. % format.in.booktitle "booktitle" output.warn
  2097. % %format.bvolume output
  2098. % %format.number.series output
  2099. % %format.pages output
  2100. % address empty$
  2101. % { organization publisher new.sentence.checkb
  2102. % organization output
  2103. % publisher output
  2104. % %format.date "year" output.warn
  2105. % %year output
  2106. % format.date ":" * format.pages * output
  2107. % }
  2108. % { %address output.nonnull
  2109. % format.address.publisher.year output
  2110. % %format.date "year" output.warn
  2111. % % year output
  2112. % format.date ":" * format.pages * output
  2113. % new.sentence
  2114. % organization output
  2115. % %publisher output
  2116. % }
  2117. % if$
  2118. % new.block
  2119. % pages output
  2120. %remove.dots
  2121. % { format.incoll.inproc.crossref output.nonnull
  2122. % format.pages output
  2123. % }
  2124. % if$
  2125. % new.block
  2126. % note output
  2127. fin.entry
  2128. }
  2129. FUNCTION {manual}
  2130. { start.entry
  2131. author empty$
  2132. { organization empty$
  2133. 'skip$
  2134. { organization output.nonnull
  2135. address output
  2136. }
  2137. if$
  2138. }
  2139. { format.authors output.nonnull }
  2140. if$
  2141. new.block
  2142. format.book.title "title" output.warn
  2143. author empty$
  2144. { organization empty$
  2145. { address new.block.checka
  2146. address output
  2147. }
  2148. 'skip$
  2149. if$
  2150. }
  2151. { organization address new.block.checkb
  2152. organization output
  2153. address output
  2154. }
  2155. if$
  2156. format.edition output
  2157. format.date output
  2158. new.block
  2159. note output
  2160. fin.entry
  2161. }
  2162. FUNCTION {thesis.type}
  2163. {
  2164. %"~[D]"
  2165. language empty$
  2166. { "[Dissertation]" }
  2167. { "[学位论文]" }
  2168. if$
  2169. }
  2170. FUNCTION {masterthesis}
  2171. { start.entry
  2172. format.authors "author" add.period$ output.warn
  2173. new.block
  2174. format.title remove.dots " " * thesis.type * output
  2175. new.block
  2176. %format.address.school output
  2177. %address output
  2178. school "school" output.warn
  2179. format.date "year" output.warn
  2180. new.block
  2181. %note output
  2182. fin.entry
  2183. }
  2184. %FUNCTION {phdthesis}
  2185. %{ start.entry
  2186. % format.authors "author" add.period$ output.warn
  2187. %new.block
  2188. %format.title remove.dots " " * thesis.type * output
  2189. %new.block
  2190. %format.address.school output
  2191. %%address output
  2192. %school "school" output.warn
  2193. %format.date "year" output.warn
  2194. %new.block
  2195. %%note output
  2196. %fin.entry
  2197. %}
  2198. FUNCTION {misc}
  2199. { start.entry
  2200. format.authors output
  2201. % title howpublished new.block.checkb
  2202. format.title output
  2203. % howpublished new.block.checka
  2204. % howpublished output
  2205. % format.date output
  2206. format.address output
  2207. format.month.year output
  2208. format.pages "pages" output.warn
  2209. format.url output
  2210. % new.block
  2211. format.note output
  2212. fin.entry
  2213. % empty.misc.check
  2214. }
  2215. FUNCTION {unpublished}
  2216. { start.entry
  2217. format.authors "author" output.warn
  2218. new.block
  2219. format.title "title" output.warn
  2220. new.block
  2221. note "note" output.warn
  2222. format.date output
  2223. fin.entry
  2224. }
  2225. % 专用控制条目 BUPTThesisBSTCTL 用于提供方便的用户设置接口
  2226. FUNCTION {BUPTThesisBSTCTL}{
  2227. is.print.banners.to.terminal
  2228. { "** BUPTThesis BST control entry " quote$ * cite$ *
  2229. quote$ * " detected." *
  2230. top$
  2231. }
  2232. { skip$ }
  2233. if$
  2234. % CTLuse_article_number
  2235. % empty$
  2236. % { skip$ }
  2237. % { CTLuse_article_number
  2238. % yes.no.to.int
  2239. % 'is.use.number.for.article :=
  2240. % }
  2241. % if$
  2242. % CTLuse_paper
  2243. % empty$
  2244. % { skip$ }
  2245. % { CTLuse_paper
  2246. % yes.no.to.int
  2247. % 'is.use.paper :=
  2248. % }
  2249. % if$
  2250. % CTLuse_forced_etal
  2251. % empty$
  2252. % { skip$ }
  2253. % { CTLuse_forced_etal
  2254. % yes.no.to.int
  2255. % 'is.forced.et.al :=
  2256. % }
  2257. % if$
  2258. % 显示作者数目
  2259. CTLmax_names_forced_etal
  2260. empty$
  2261. { skip$ }
  2262. { CTLmax_names_forced_etal
  2263. string.to.integer
  2264. 'max.num.names.before.forced.et.al :=
  2265. }
  2266. if$
  2267. % 论文作者英文姓名
  2268. CTLauthor_name_english
  2269. empty$
  2270. { skip$ }
  2271. { CTLauthor_name_english
  2272. 'author.name.in.english :=
  2273. % #1 'is.for.peer.review :=
  2274. % "CTLauthor_name_english=" author.name.in.english * debug.output
  2275. }
  2276. if$
  2277. % 论文作者中文姓名
  2278. CTLauthor_name_chinese
  2279. empty$
  2280. { skip$ }
  2281. { CTLauthor_name_chinese
  2282. 'author.name.in.chinese :=
  2283. % #1 'is.for.peer.review :=
  2284. % "CTLauthor_name_chinese=" author.name.in.chinese * debug.output
  2285. }
  2286. if$
  2287. CTLfor_peer_review
  2288. empty$
  2289. { skip$ }
  2290. { CTLfor_peer_review
  2291. yes.no.to.int
  2292. 'is.for.peer.review :=
  2293. }
  2294. if$
  2295. % CTLnames_show_etal
  2296. % empty$
  2297. % { skip$ }
  2298. % { CTLnames_show_etal
  2299. % string.to.integer
  2300. % 'num.names.shown.with.forced.et.al :=
  2301. % }
  2302. % if$
  2303. % CTLuse_alt_spacing
  2304. % empty$
  2305. % { skip$ }
  2306. % { CTLuse_alt_spacing
  2307. % yes.no.to.int
  2308. % 'is.use.alt.interword.spacing :=
  2309. % }
  2310. % if$
  2311. % CTLalt_stretch_factor
  2312. % empty$
  2313. % { skip$ }
  2314. % { CTLalt_stretch_factor
  2315. % 'ALTinterwordstretchfactor :=
  2316. % "\renewcommand{\BIBentryALTinterwordstretchfactor}{"
  2317. % ALTinterwordstretchfactor * "}" *
  2318. % write$ newline$
  2319. % }
  2320. % if$
  2321. % CTLdash_repeated_names
  2322. % empty$
  2323. % { skip$ }
  2324. % { CTLdash_repeated_names
  2325. % yes.no.to.int
  2326. % 'is.dash.repeated.names :=
  2327. % }
  2328. % if$
  2329. % CTLname_emph_author_en % 强调显示的作者英文姓名
  2330. % empty$
  2331. % { skip$ } % 若没有给出则跳过
  2332. % { CTLname_emph_author_en
  2333. % 'name.emph.author.en := % 否则更新 name.emph.author.en
  2334. % }
  2335. % if$
  2336. % CTLname_emph_author_zh % 强调显示的作者中文姓名
  2337. % empty$
  2338. % { skip$ } % 若没有给出则跳过
  2339. % { CTLname_emph_author_zh
  2340. % 'name.emph.author.zh := % 否则更新 name.emph.author.zh
  2341. % }
  2342. % if$
  2343. CTLname_format_string % 英文姓名排版格式字符串
  2344. empty$
  2345. { skip$ } % 若没有自定义则跳过
  2346. { CTLname_format_string % 否则更新 name.format.string
  2347. 'name.format.string :=
  2348. }
  2349. if$
  2350. % CTLname_latex_cmd
  2351. % empty$
  2352. % { skip$ }
  2353. % { CTLname_latex_cmd
  2354. % 'name.latex.cmd :=
  2355. % }
  2356. % if$
  2357. % CTLname_url_prefix
  2358. % missing$
  2359. % { skip$ }
  2360. % { CTLname_url_prefix
  2361. % 'name.url.prefix :=
  2362. % }
  2363. % if$
  2364. % num.names.shown.with.forced.et.al max.num.names.before.forced.et.al >
  2365. % { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$
  2366. % max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al :=
  2367. % }
  2368. % { skip$ }
  2369. % if$
  2370. }
  2371. %%%%%%%%%%%%
  2372. %% 条目别名
  2373. %%%%%%%%%%%%
  2374. %FUNCTION {phdthesis} {thesis}
  2375. %FUNCTION {masterthesis} {thesis}
  2376. FUNCTION {conference} {inproceedings}
  2377. FUNCTION {online} {electronic}
  2378. FUNCTION {internet} {electronic}
  2379. FUNCTION {webpage} {electronic}
  2380. FUNCTION {www} {electronic}
  2381. FUNCTION {default.type} {misc}
  2382. %%%%%%%%%%
  2383. %% 主程序
  2384. %%%%%%%%%%
  2385. READ
  2386. EXECUTE {initialize.controls} % 初始化控制变量
  2387. EXECUTE {initialize.status.constants} % 初始化状态常量
  2388. EXECUTE {banner.message} % 显示初始提示信息
  2389. EXECUTE {initialize.longest.label} % 初始化最长的标号
  2390. ITERATE {longest.label.pass} % 处理最长的标号
  2391. EXECUTE {begin.bib} % 开始
  2392. ITERATE {call.type$} %
  2393. EXECUTE {end.bib} % 结束
  2394. EXECUTE {completed.message} % 显示完成提示信息
  2395. %% EOF