buptbachelor.bst 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593
  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. {
  1912. new.block
  1913. address
  1914. }
  1915. if$
  1916. }
  1917. FUNCTION {format.month.year} {
  1918. month empty$
  1919. { "" }
  1920. { month " " * }
  1921. if$
  1922. year empty$
  1923. { "There is month but no year in " cite$ * warning$ }
  1924. { year * }
  1925. if$
  1926. }
  1927. FUNCTION {format.year} {
  1928. year empty$
  1929. { "There is month but no year in " cite$ * warning$ }
  1930. { new.block
  1931. year " " *
  1932. }
  1933. if$
  1934. }
  1935. FUNCTION {format.collection.title} {
  1936. booktitle empty$
  1937. { "" }
  1938. { new.block
  1939. language empty$
  1940. {"In "}
  1941. {"见"}
  1942. if$
  1943. booktitle *
  1944. % address empty$
  1945. % { skip$ }
  1946. % { bbl.comma * address * bbl.comma *
  1947. % month empty$
  1948. % { skip$ }
  1949. % { month * }
  1950. % if$
  1951. % year empty$
  1952. % { skip$ }
  1953. % { " " * year * }
  1954. % if$
  1955. % }
  1956. % if$
  1957. }
  1958. if$
  1959. }
  1960. % 图书中析出的文献
  1961. FUNCTION {inbook} {
  1962. start.entry
  1963. author empty$
  1964. { format.editors "author and editor" output.warn }
  1965. { format.authors output.nonnull }
  1966. if$
  1967. format.book.title "title" output.warn
  1968. format.collection.editors "editor" output.warn
  1969. format.collection.title "booktitle" output.warn
  1970. format.translators output % 其他责任人
  1971. format.edition output % 版本项
  1972. format.address.publisher.year output.nonnull % 出版项
  1973. format.pages "pages" output.warn %
  1974. format.url output % URL
  1975. format.note output % 备注项
  1976. fin.entry
  1977. }
  1978. %%%%%%%%%%%%%%%%%
  1979. %% 著录格式: 专利
  1980. %%%%%%%%%%%%%%%%%
  1981. FUNCTION {patent} {
  1982. start.entry
  1983. author empty$
  1984. { format.assignees "assignee" output.warn }
  1985. { format.authors output.nonnull }
  1986. if$
  1987. format.patent.title "title" output.warn
  1988. format.patent.publication output
  1989. format.url output
  1990. format.note output
  1991. fin.entry
  1992. }
  1993. % 电子文献更新或修改日期
  1994. FUNCTION {format.update.date} {
  1995. update empty$
  1996. { "" }
  1997. { output.state mid.sentence =
  1998. { before.all 'output.state := }
  1999. { skip$ }
  2000. if$
  2001. "~(" update * ")" * }
  2002. if$
  2003. }
  2004. %%%%%%%%%%%%%%%%%%%%%
  2005. %% 著录格式: 电子文献
  2006. %%%%%%%%%%%%%%%%%%%%%
  2007. FUNCTION {electronic} {
  2008. start.entry
  2009. author empty$
  2010. { organization "author and organization" output.warn }
  2011. { format.authors output.nonnull }
  2012. if$
  2013. format.book.title output
  2014. format.electronic.publication output
  2015. format.update.date output
  2016. format.reference.date output
  2017. format.url output
  2018. format.note output
  2019. fin.entry
  2020. }
  2021. %%%%%%%%%%%%%%%%%%%%%%%
  2022. %% 著录格式: 连续出版物
  2023. %%%%%%%%%%%%%%%%%%%%%%%
  2024. FUNCTION {periodical} {
  2025. start.entry
  2026. editor empty$
  2027. { format.organization "editors and organization" output.warn }
  2028. { format.editors output.nonnull }
  2029. if$
  2030. format.book.title "title" output.warn
  2031. format.year.volume.number output
  2032. format.address.publisher.year output
  2033. format.url output
  2034. format.note output
  2035. fin.entry
  2036. }
  2037. FUNCTION {format.journal.title} {
  2038. journal empty$
  2039. { "" }
  2040. { new.block journal }
  2041. if$
  2042. }
  2043. % 连续出版物中析出的文献
  2044. FUNCTION {article}
  2045. { start.entry
  2046. format.authors "author" output.warn
  2047. format.book.title "title" output.warn
  2048. format.journal.title "journal" output.warn
  2049. format.volume.number.year.month output
  2050. %format.year.volume.number output
  2051. format.pages "pages" output.warn
  2052. format.reference.date output
  2053. format.url output
  2054. format.note output
  2055. fin.entry
  2056. }
  2057. FUNCTION {booklet}
  2058. { start.entry
  2059. format.authors output
  2060. new.block
  2061. format.title "title" output.warn
  2062. howpublished address new.block.checkb
  2063. howpublished output
  2064. address output
  2065. format.date output
  2066. new.block
  2067. note output
  2068. fin.entry
  2069. }
  2070. FUNCTION {incollection}
  2071. { start.entry
  2072. format.authors "author" output.warn
  2073. new.block
  2074. format.ictitle "title" output.warn
  2075. new.block
  2076. crossref missing$
  2077. { %format.in.ed.booktitle "booktitle" output.warn
  2078. %format.bvolume output
  2079. format.in.ed.booktitle.volume "booktitle" output.warn
  2080. format.number.series output
  2081. format.chapter.pages output
  2082. new.sentence
  2083. % publisher "publisher" output.warn
  2084. % address output
  2085. format.address.publisher.year output
  2086. format.edition output
  2087. format.date ":" * format.pages * output
  2088. %format.date "year" output.warn
  2089. }
  2090. { format.incoll.inproc.crossref output.nonnull
  2091. format.chapter.pages output
  2092. }
  2093. if$
  2094. new.block
  2095. note output
  2096. fin.entry
  2097. }
  2098. % 论文集中析出的文献
  2099. FUNCTION {inproceedings} {
  2100. start.entry
  2101. format.authors "author" output.warn
  2102. format.book.title "title" output.warn
  2103. % format.collection.editors "editor" output.warn
  2104. format.collection.title "booktitle" output.warn
  2105. format.address output
  2106. % format.month.year output
  2107. format.year output
  2108. % format.address.publisher.year output.nonnull % 出版项
  2109. format.pages "pages" output.warn %
  2110. % format.url output % URL
  2111. % format.note output % 备注项
  2112. % format.in.booktitle "booktitle" output.warn
  2113. % %format.bvolume output
  2114. % %format.number.series output
  2115. % %format.pages output
  2116. % address empty$
  2117. % { organization publisher new.sentence.checkb
  2118. % organization output
  2119. % publisher output
  2120. % %format.date "year" output.warn
  2121. % %year output
  2122. % format.date ":" * format.pages * output
  2123. % }
  2124. % { %address output.nonnull
  2125. % format.address.publisher.year output
  2126. % %format.date "year" output.warn
  2127. % % year output
  2128. % format.date ":" * format.pages * output
  2129. % new.sentence
  2130. % organization output
  2131. % %publisher output
  2132. % }
  2133. % if$
  2134. % new.block
  2135. % pages output
  2136. %remove.dots
  2137. % { format.incoll.inproc.crossref output.nonnull
  2138. % format.pages output
  2139. % }
  2140. % if$
  2141. % new.block
  2142. % note output
  2143. fin.entry
  2144. }
  2145. FUNCTION {manual}
  2146. { start.entry
  2147. author empty$
  2148. { organization empty$
  2149. 'skip$
  2150. { organization output.nonnull
  2151. address output
  2152. }
  2153. if$
  2154. }
  2155. { format.authors output.nonnull }
  2156. if$
  2157. new.block
  2158. format.book.title "title" output.warn
  2159. author empty$
  2160. { organization empty$
  2161. { address new.block.checka
  2162. address output
  2163. }
  2164. 'skip$
  2165. if$
  2166. }
  2167. { organization address new.block.checkb
  2168. organization output
  2169. address output
  2170. }
  2171. if$
  2172. format.edition output
  2173. format.date output
  2174. new.block
  2175. note output
  2176. fin.entry
  2177. }
  2178. FUNCTION {thesis.type}
  2179. {
  2180. %"~[D]"
  2181. language empty$
  2182. { "[Dissertation]" }
  2183. { "[学位论文]" }
  2184. if$
  2185. }
  2186. FUNCTION {masterthesis}
  2187. { start.entry
  2188. format.authors "author" add.period$ output.warn
  2189. new.block
  2190. format.title remove.dots " " * thesis.type * output
  2191. new.block
  2192. %format.address.school output
  2193. %address output
  2194. school "school" output.warn
  2195. format.date "year" output.warn
  2196. new.block
  2197. %note output
  2198. fin.entry
  2199. }
  2200. %FUNCTION {phdthesis}
  2201. %{ start.entry
  2202. % format.authors "author" add.period$ output.warn
  2203. %new.block
  2204. %format.title remove.dots " " * thesis.type * output
  2205. %new.block
  2206. %format.address.school output
  2207. %%address output
  2208. %school "school" output.warn
  2209. %format.date "year" output.warn
  2210. %new.block
  2211. %%note output
  2212. %fin.entry
  2213. %}
  2214. FUNCTION {misc}
  2215. { start.entry
  2216. format.authors output
  2217. % title howpublished new.block.checkb
  2218. format.title output
  2219. % howpublished new.block.checka
  2220. % howpublished output
  2221. % format.date output
  2222. format.address output
  2223. format.month.year output
  2224. format.pages "pages" output.warn
  2225. format.url output
  2226. % new.block
  2227. format.note output
  2228. fin.entry
  2229. % empty.misc.check
  2230. }
  2231. FUNCTION {unpublished}
  2232. { start.entry
  2233. format.authors "author" output.warn
  2234. new.block
  2235. format.title "title" output.warn
  2236. new.block
  2237. note "note" output.warn
  2238. format.date output
  2239. fin.entry
  2240. }
  2241. % 专用控制条目 BUPTThesisBSTCTL 用于提供方便的用户设置接口
  2242. FUNCTION {BUPTThesisBSTCTL}{
  2243. is.print.banners.to.terminal
  2244. { "** BUPTThesis BST control entry " quote$ * cite$ *
  2245. quote$ * " detected." *
  2246. top$
  2247. }
  2248. { skip$ }
  2249. if$
  2250. % CTLuse_article_number
  2251. % empty$
  2252. % { skip$ }
  2253. % { CTLuse_article_number
  2254. % yes.no.to.int
  2255. % 'is.use.number.for.article :=
  2256. % }
  2257. % if$
  2258. % CTLuse_paper
  2259. % empty$
  2260. % { skip$ }
  2261. % { CTLuse_paper
  2262. % yes.no.to.int
  2263. % 'is.use.paper :=
  2264. % }
  2265. % if$
  2266. % CTLuse_forced_etal
  2267. % empty$
  2268. % { skip$ }
  2269. % { CTLuse_forced_etal
  2270. % yes.no.to.int
  2271. % 'is.forced.et.al :=
  2272. % }
  2273. % if$
  2274. % 显示作者数目
  2275. CTLmax_names_forced_etal
  2276. empty$
  2277. { skip$ }
  2278. { CTLmax_names_forced_etal
  2279. string.to.integer
  2280. 'max.num.names.before.forced.et.al :=
  2281. }
  2282. if$
  2283. % 论文作者英文姓名
  2284. CTLauthor_name_english
  2285. empty$
  2286. { skip$ }
  2287. { CTLauthor_name_english
  2288. 'author.name.in.english :=
  2289. % #1 'is.for.peer.review :=
  2290. % "CTLauthor_name_english=" author.name.in.english * debug.output
  2291. }
  2292. if$
  2293. % 论文作者中文姓名
  2294. CTLauthor_name_chinese
  2295. empty$
  2296. { skip$ }
  2297. { CTLauthor_name_chinese
  2298. 'author.name.in.chinese :=
  2299. % #1 'is.for.peer.review :=
  2300. % "CTLauthor_name_chinese=" author.name.in.chinese * debug.output
  2301. }
  2302. if$
  2303. CTLfor_peer_review
  2304. empty$
  2305. { skip$ }
  2306. { CTLfor_peer_review
  2307. yes.no.to.int
  2308. 'is.for.peer.review :=
  2309. }
  2310. if$
  2311. % CTLnames_show_etal
  2312. % empty$
  2313. % { skip$ }
  2314. % { CTLnames_show_etal
  2315. % string.to.integer
  2316. % 'num.names.shown.with.forced.et.al :=
  2317. % }
  2318. % if$
  2319. % CTLuse_alt_spacing
  2320. % empty$
  2321. % { skip$ }
  2322. % { CTLuse_alt_spacing
  2323. % yes.no.to.int
  2324. % 'is.use.alt.interword.spacing :=
  2325. % }
  2326. % if$
  2327. % CTLalt_stretch_factor
  2328. % empty$
  2329. % { skip$ }
  2330. % { CTLalt_stretch_factor
  2331. % 'ALTinterwordstretchfactor :=
  2332. % "\renewcommand{\BIBentryALTinterwordstretchfactor}{"
  2333. % ALTinterwordstretchfactor * "}" *
  2334. % write$ newline$
  2335. % }
  2336. % if$
  2337. % CTLdash_repeated_names
  2338. % empty$
  2339. % { skip$ }
  2340. % { CTLdash_repeated_names
  2341. % yes.no.to.int
  2342. % 'is.dash.repeated.names :=
  2343. % }
  2344. % if$
  2345. % CTLname_emph_author_en % 强调显示的作者英文姓名
  2346. % empty$
  2347. % { skip$ } % 若没有给出则跳过
  2348. % { CTLname_emph_author_en
  2349. % 'name.emph.author.en := % 否则更新 name.emph.author.en
  2350. % }
  2351. % if$
  2352. % CTLname_emph_author_zh % 强调显示的作者中文姓名
  2353. % empty$
  2354. % { skip$ } % 若没有给出则跳过
  2355. % { CTLname_emph_author_zh
  2356. % 'name.emph.author.zh := % 否则更新 name.emph.author.zh
  2357. % }
  2358. % if$
  2359. CTLname_format_string % 英文姓名排版格式字符串
  2360. empty$
  2361. { skip$ } % 若没有自定义则跳过
  2362. { CTLname_format_string % 否则更新 name.format.string
  2363. 'name.format.string :=
  2364. }
  2365. if$
  2366. % CTLname_latex_cmd
  2367. % empty$
  2368. % { skip$ }
  2369. % { CTLname_latex_cmd
  2370. % 'name.latex.cmd :=
  2371. % }
  2372. % if$
  2373. % CTLname_url_prefix
  2374. % missing$
  2375. % { skip$ }
  2376. % { CTLname_url_prefix
  2377. % 'name.url.prefix :=
  2378. % }
  2379. % if$
  2380. % num.names.shown.with.forced.et.al max.num.names.before.forced.et.al >
  2381. % { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$
  2382. % max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al :=
  2383. % }
  2384. % { skip$ }
  2385. % if$
  2386. }
  2387. %%%%%%%%%%%%
  2388. %% 条目别名
  2389. %%%%%%%%%%%%
  2390. %FUNCTION {phdthesis} {thesis}
  2391. %FUNCTION {masterthesis} {thesis}
  2392. FUNCTION {conference} {inproceedings}
  2393. FUNCTION {online} {electronic}
  2394. FUNCTION {internet} {electronic}
  2395. FUNCTION {webpage} {electronic}
  2396. FUNCTION {www} {electronic}
  2397. FUNCTION {default.type} {misc}
  2398. %%%%%%%%%%
  2399. %% 主程序
  2400. %%%%%%%%%%
  2401. READ
  2402. EXECUTE {initialize.controls} % 初始化控制变量
  2403. EXECUTE {initialize.status.constants} % 初始化状态常量
  2404. EXECUTE {banner.message} % 显示初始提示信息
  2405. EXECUTE {initialize.longest.label} % 初始化最长的标号
  2406. ITERATE {longest.label.pass} % 处理最长的标号
  2407. EXECUTE {begin.bib} % 开始
  2408. ITERATE {call.type$} %
  2409. EXECUTE {end.bib} % 结束
  2410. EXECUTE {completed.message} % 显示完成提示信息
  2411. %% EOF