buptbachelor.bst 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542
  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}{~f}{, 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$ "mastersthesis" = or
  907. { "D" }
  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. %
  1219. FUNCTION {format.date}
  1220. { year empty$
  1221. { month empty$
  1222. { "" }
  1223. { "there's a month but no year in " cite$ * warning$
  1224. month
  1225. }
  1226. if$
  1227. }
  1228. { month empty$
  1229. { year }
  1230. { month bbl.comma * year * }
  1231. if$
  1232. }
  1233. if$
  1234. }
  1235. function {format.year.year}
  1236. { year empty$
  1237. 'skip$
  1238. { year "--" *
  1239. year2 empty$
  1240. 'skip$
  1241. { year2 "now" =
  1242. 'skip$
  1243. { year2 * }
  1244. if$
  1245. }
  1246. if$
  1247. }
  1248. if$
  1249. }
  1250. % 专著标题格式
  1251. FUNCTION {format.book.title} {
  1252. new.block % 生成一个新的block
  1253. title
  1254. type$ "proceedings" =
  1255. { address empty$
  1256. { skip$ }
  1257. { bbl.comma * address * bbl.comma *
  1258. month empty$
  1259. { skip$ }
  1260. { month * }
  1261. if$
  1262. year empty$
  1263. { skip$ }
  1264. { year * }
  1265. if$
  1266. }
  1267. if$
  1268. }
  1269. { skip$ }
  1270. if$
  1271. bib.type.designator * % 标题 + [文献标志代码/电子文献载体标志代码]
  1272. }
  1273. % 科技报告标题格式
  1274. FUNCTION {format.techreport.title} {
  1275. title empty$
  1276. { "" }
  1277. { new.block % 生成一个新的block
  1278. title % 标题 +
  1279. number empty$ % 编号 +
  1280. { "" }
  1281. { bbl.comma * number }
  1282. if$ *
  1283. bib.type.designator * % [文献标志代码/电子文献载体标志代码]
  1284. }
  1285. if$
  1286. }
  1287. % 连续出版物标题格式
  1288. FUNCTION {format.jtitle}
  1289. { title "~[J" *
  1290. url empty$
  1291. { "]" * }
  1292. { "/OL]" * }
  1293. if$
  1294. }
  1295. % 论文集标题格式
  1296. FUNCTION {format.ptitle.volume}
  1297. { title
  1298. volume empty$
  1299. { "~[C]" }
  1300. { bbl.colon volume * "~[C]" * }
  1301. if$ *
  1302. %emphasize
  1303. }
  1304. FUNCTION {tie.or.space.connect}
  1305. { duplicate$ text.length$ #3 <
  1306. { "~" }
  1307. { " " }
  1308. if$
  1309. swap$ * *
  1310. }
  1311. FUNCTION {either.or.check}
  1312. { empty$
  1313. 'pop$
  1314. { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  1315. if$
  1316. }
  1317. FUNCTION {format.bvolume}
  1318. { volume empty$
  1319. { "" }
  1320. { language empty$
  1321. { "volume" volume tie.or.space.connect }
  1322. { volume }
  1323. if$
  1324. series empty$
  1325. 'skip$
  1326. { " of " * series emphasize * }
  1327. if$
  1328. "volume and number" number either.or.check
  1329. }
  1330. if$
  1331. }
  1332. FUNCTION {format.number.series}
  1333. { volume empty$
  1334. { number empty$
  1335. { series field.or.null }
  1336. { output.state mid.sentence =
  1337. { "number" }
  1338. { "Number" }
  1339. if$
  1340. number tie.or.space.connect
  1341. series empty$
  1342. { "there's a number but no series in " cite$ * warning$ }
  1343. { " in " * series * }
  1344. if$
  1345. }
  1346. if$
  1347. }
  1348. { "" }
  1349. if$
  1350. }
  1351. % 版本项格式
  1352. FUNCTION {format.edition} {
  1353. edition empty$
  1354. { "" }
  1355. { new.block % 版本项按一个block输出
  1356. language empty$ % 英文文献版本号自动转换成数字形式的序数词
  1357. { edition convert.edition
  1358. "l" change.case$ " ed" *
  1359. }
  1360. { edition } % 中文文献版本号直接输出
  1361. if$
  1362. }
  1363. if$
  1364. }
  1365. FUNCTION {format.url}
  1366. { url empty$
  1367. { "" }
  1368. { new.block
  1369. "\url{" url * "}" *
  1370. }
  1371. if$
  1372. }
  1373. FUNCTION {multi.page.check}
  1374. { 't :=
  1375. #0 'multiresult :=
  1376. { multiresult not
  1377. t empty$ not
  1378. and
  1379. }
  1380. { t #1 #1 substring$
  1381. duplicate$ "-" =
  1382. swap$ duplicate$ "," =
  1383. swap$ "+" =
  1384. or or
  1385. { #1 'multiresult := }
  1386. { t #2 global.max$ substring$ 't := }
  1387. if$
  1388. }
  1389. while$
  1390. multiresult
  1391. }
  1392. FUNCTION {format.pages}
  1393. { pages empty$
  1394. { "" }
  1395. { before.pages 'output.state :=
  1396. pages multi.page.check
  1397. { "" pages n.dashify tie.or.space.connect }
  1398. { "" pages tie.or.space.connect }
  1399. if$
  1400. }
  1401. if$
  1402. }
  1403. FUNCTION {format.vol.num.pages}
  1404. { volume field.or.null
  1405. number empty$
  1406. 'skip$
  1407. { "(" number * ")" * *
  1408. volume empty$
  1409. { newsletter empty$
  1410. { "there's a number but no volume in " cite$ * warning$ }
  1411. 'skip$
  1412. if$
  1413. }
  1414. 'skip$
  1415. if$
  1416. }
  1417. if$
  1418. pages empty$
  1419. 'skip$
  1420. { duplicate$ empty$
  1421. { pop$ format.pages }
  1422. { bbl.colon * pages n.dashify * }
  1423. if$
  1424. }
  1425. if$
  1426. % duplicate$ "top of stack = " swap$ * warning$
  1427. url empty$
  1428. 'skip$
  1429. { refdate empty$
  1430. { "there's an url but no refdate in " cite$ * warning$ }
  1431. { %duplicate$ "url and refdate is not empty, top of stack = " swap$ * warning$
  1432. "~[" * refdate * "]" *
  1433. }
  1434. if$
  1435. %duplicate$ "top of stack = " swap$ * warning$
  1436. }
  1437. if$
  1438. }
  1439. FUNCTION {format.chapter.pages}
  1440. { chapter empty$
  1441. { "" }
  1442. { type empty$
  1443. { "chapter" }
  1444. { type "l" change.case$ }
  1445. if$
  1446. chapter tie.or.space.connect
  1447. pages empty$
  1448. 'skip$
  1449. { ", " * format.pages * }
  1450. if$
  1451. }
  1452. if$
  1453. }
  1454. FUNCTION {format.in.booktitle}
  1455. { booktitle empty$
  1456. { "" }
  1457. { editor empty$
  1458. { language empty$
  1459. { " " booktitle * }
  1460. % { "Proceedings of " booktitle * }
  1461. { " " booktitle * }
  1462. if$
  1463. }
  1464. { language empty$
  1465. % { "In: " format.editors * ", Proceedings of " * booktitle * }
  1466. { " " booktitle * }
  1467. { " " booktitle * }
  1468. if$
  1469. }
  1470. if$
  1471. }
  1472. if$
  1473. }
  1474. FUNCTION {format.in.ed.booktitle.volume}
  1475. { booktitle empty$
  1476. { "" }
  1477. { editor empty$
  1478. { language empty$
  1479. % { "Proceedings of " booktitle * }
  1480. { " " booktitle * }
  1481. { " " booktitle * }
  1482. if$
  1483. }
  1484. { language empty$
  1485. %{ "In: " format.editors * ", Proceedings of " * booktitle * }
  1486. { " " booktitle * }
  1487. { " " booktitle * }
  1488. if$
  1489. }
  1490. if$
  1491. %% volume
  1492. volume empty$
  1493. 'skip$
  1494. { language empty$
  1495. { "Vol." * volume * }
  1496. { ":第" * volume * "卷" * }
  1497. if$
  1498. }
  1499. if$
  1500. }
  1501. if$
  1502. }
  1503. FUNCTION {empty.misc.check}
  1504. { author empty$ title empty$ howpublished empty$
  1505. month empty$ year empty$ note empty$
  1506. and and and and and
  1507. { "all relevant fields are empty in " cite$ * warning$ }
  1508. 'skip$
  1509. if$
  1510. }
  1511. FUNCTION {format.thesis.type}
  1512. { type empty$
  1513. 'skip$
  1514. { pop$
  1515. type "t" change.case$
  1516. }
  1517. if$
  1518. }
  1519. FUNCTION {format.tr.number}
  1520. { type empty$
  1521. { "Technical Report" }
  1522. 'type
  1523. if$
  1524. number empty$
  1525. { "t" change.case$ }
  1526. { number tie.or.space.connect }
  1527. if$
  1528. }
  1529. FUNCTION {format.article.crossref}
  1530. { key empty$
  1531. { journal empty$
  1532. { "need key or journal for " cite$ * " to crossref " * crossref *
  1533. warning$
  1534. ""
  1535. }
  1536. { "In {\em " journal * "\/}" * }
  1537. if$
  1538. }
  1539. { "In " key * }
  1540. if$
  1541. " \cite{" * crossref * "}" *
  1542. }
  1543. FUNCTION {format.crossref.editor}
  1544. { editor #1 "{ll }{f{~}}" format.name$
  1545. editor num.names$ duplicate$
  1546. #2 >
  1547. { pop$ " et~al." * }
  1548. { #2 <
  1549. 'skip$
  1550. { editor #2 "{ll }{f{~}}" format.name$ "others" =
  1551. { " et~al." * }
  1552. { " and " * editor #2 "{ll }{f{~}}" format.name$ * }
  1553. if$
  1554. }
  1555. if$
  1556. }
  1557. if$
  1558. }
  1559. FUNCTION {format.book.crossref}
  1560. { volume empty$
  1561. { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  1562. "In "
  1563. }
  1564. { "Volume" volume tie.or.space.connect
  1565. " of " *
  1566. }
  1567. if$
  1568. editor empty$
  1569. editor field.or.null author field.or.null =
  1570. or
  1571. { key empty$
  1572. { series empty$
  1573. { "need editor, key, or series for " cite$ * " to crossref " *
  1574. crossref * warning$
  1575. "" *
  1576. }
  1577. { "{\em " * series * "\/}" * }
  1578. if$
  1579. }
  1580. { key * }
  1581. if$
  1582. }
  1583. { format.crossref.editor * }
  1584. if$
  1585. " \cite{" * crossref * "}" *
  1586. }
  1587. FUNCTION {format.incoll.inproc.crossref}
  1588. { editor empty$
  1589. editor field.or.null author field.or.null =
  1590. or
  1591. { key empty$
  1592. { booktitle empty$
  1593. { "need editor, key, or booktitle for " cite$ * " to crossref " *
  1594. crossref * warning$
  1595. ""
  1596. }
  1597. { "In {\em " booktitle * "\/}" * }
  1598. if$
  1599. }
  1600. { "In " key * }
  1601. if$
  1602. }
  1603. { "In " format.crossref.editor * }
  1604. if$
  1605. " \cite{" * crossref * "}" *
  1606. }
  1607. % 出版地: 出版者
  1608. FUNCTION {format.address.publisher} {
  1609. new.block
  1610. type$ "inproceedings" =
  1611. { pubaddress empty$
  1612. { "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
  1613. publisher empty$
  1614. { "there's neither pubaddress nor publisher in " cite$ * warning$
  1615. "[" * bbl.sine.nomine * "]" * % 无出版者
  1616. }
  1617. { "there's a publisher but no pubaddress in " cite$ * warning$
  1618. publisher * % 有出版者
  1619. }
  1620. if$
  1621. }
  1622. { pubaddress bbl.colon * % 有出版地
  1623. publisher empty$
  1624. { "there's a pubaddress but no publisher in " cite$ * warning$
  1625. "[" * bbl.sine.nomine * "]" * % 无出版者
  1626. }
  1627. { publisher * } % 有出版者
  1628. if$
  1629. }
  1630. if$
  1631. }
  1632. { address empty$
  1633. { "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
  1634. publisher empty$
  1635. { "there's neither address nor publisher in " cite$ * warning$
  1636. "[" * bbl.sine.nomine * "]" * % 无出版者
  1637. }
  1638. { "there's a publisher but no address in " cite$ * warning$
  1639. publisher * % 有出版者
  1640. }
  1641. if$
  1642. }
  1643. { address bbl.colon * % 有出版地
  1644. publisher empty$
  1645. { "there's a address but no publisher in " cite$ * warning$
  1646. "[" * bbl.sine.nomine * "]" * % 无出版者
  1647. }
  1648. { publisher * } % 有出版者
  1649. if$
  1650. }
  1651. if$
  1652. }
  1653. if$
  1654. }
  1655. % 出版地: 出版者, 出版年
  1656. FUNCTION {format.address.publisher.year} {
  1657. % % DEBUG
  1658. % "-- format.address.publisher.year(){" debug.output
  1659. % "-- address =" address * debug.output
  1660. % "-- publisher=" publisher * debug.output
  1661. % "-- year =" year * debug.output
  1662. % % END OF DEBUG
  1663. new.block
  1664. type$ "inproceedings" =
  1665. { pubaddress empty$
  1666. { "" % "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
  1667. publisher empty$
  1668. { "there's neither pubaddress nor publisher in " cite$ * warning$
  1669. "" * % "[" * bbl.sine.nomine * "]" * % 无出版者
  1670. }
  1671. { "there's a publisher but no pubaddress in " cite$ * warning$
  1672. publisher * % 有出版者
  1673. }
  1674. if$
  1675. }
  1676. { publisher empty$
  1677. { "there's a pubaddress but no publisher in " cite$ * warning$
  1678. "" % "[" * bbl.sine.nomine * "]" * % 无出版者
  1679. }
  1680. { pubaddress bbl.colon * % 有出版地
  1681. publisher * } % 有出版者
  1682. if$
  1683. }
  1684. if$
  1685. }
  1686. { address empty$
  1687. { "" % "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
  1688. publisher empty$
  1689. { "there's neither address nor publisher in " cite$ * warning$
  1690. "" * % "[" * bbl.sine.nomine * "]" * % 无出版者
  1691. }
  1692. { "there's a publisher but no address in " cite$ * warning$
  1693. publisher * % 有出版者
  1694. }
  1695. if$
  1696. }
  1697. { publisher empty$
  1698. { "there's a address but no publisher in " cite$ * warning$
  1699. "" % "[" * bbl.sine.nomine * "]" * % 无出版者
  1700. }
  1701. { address bbl.colon * % 有出版地
  1702. publisher * } % 有出版者
  1703. if$
  1704. }
  1705. if$
  1706. }
  1707. if$
  1708. % 出版年
  1709. year empty$
  1710. { "there's no year in " cite$ * warning$ }
  1711. { type$ "inproceedings" =
  1712. { bbl.comma * year * }
  1713. { publisher empty$
  1714. { year * }
  1715. { bbl.comma * year * }
  1716. if$
  1717. }
  1718. if$
  1719. type$ "periodical" =
  1720. { year2 empty$ % 对连续出版物可以排版 year2
  1721. { skip$ }
  1722. { "--" *
  1723. year2 "l" change.case$ "now" =
  1724. { skip$ }
  1725. { year2 * }
  1726. if$
  1727. }
  1728. if$
  1729. }
  1730. { skip$ }
  1731. if$
  1732. }
  1733. if$
  1734. % % DEBUG
  1735. % duplicate$ "-- }=" swap$ * debug.output
  1736. % % END OF DEBUG
  1737. }
  1738. % 出版地: 学校, 出版年
  1739. FUNCTION {format.address.school.year} {
  1740. new.block
  1741. address empty$
  1742. { "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
  1743. school empty$
  1744. { "there's neither address nor school in " cite$ * warning$
  1745. "[" bbl.sine.nomine * "]" * % 无出版者
  1746. }
  1747. { "there's a school but no address in " cite$ * warning$
  1748. school * % 有出版者
  1749. }
  1750. if$
  1751. }
  1752. { address bbl.colon * % 有出版地
  1753. school empty$
  1754. { "there's a address but no school in " cite$ * warning$
  1755. "[" bbl.sine.nomine * "]" * % 无出版者
  1756. }
  1757. { school * } % 有出版者
  1758. if$
  1759. }
  1760. if$
  1761. % 出版年
  1762. year empty$
  1763. { "there's no year in " cite$ * warning$ }
  1764. { bbl.comma * year * }
  1765. if$
  1766. }
  1767. % FUNCTION {format.title.type}
  1768. % { title empty$
  1769. % { type empty$
  1770. % { "" }
  1771. % { "there's a type but no title in " cite$ * warning$
  1772. % type
  1773. % }
  1774. % if$
  1775. % }
  1776. % { type empty$
  1777. % 'title
  1778. % { title bbl.colon * type * }
  1779. % if$
  1780. % }
  1781. % if$
  1782. % }
  1783. FUNCTION {format.note} {
  1784. note empty$
  1785. { new.block "" }
  1786. { url empty$
  1787. { new.block }
  1788. { before.all 'output.state := }
  1789. if$
  1790. note }
  1791. if$
  1792. }
  1793. %%%%%%%%%%%%%%%%%
  1794. %% 著录格式: 专著
  1795. %%%%%%%%%%%%%%%%%
  1796. % 普通图书
  1797. FUNCTION {book} {
  1798. start.entry % 开始
  1799. author empty$ % 主要责任者
  1800. { format.editors "author and editor" output.warn }
  1801. { format.authors output.nonnull }
  1802. if$
  1803. format.book.title "title" output.warn % 题名项
  1804. format.translators output % 其他责任者(可选)
  1805. format.edition output % 版本项
  1806. format.address.publisher.year output.nonnull %
  1807. format.reference.date output %
  1808. format.url output % 获取或访问路径
  1809. format.note output % 备注
  1810. fin.entry
  1811. }
  1812. % 标准
  1813. FUNCTION {standard} {
  1814. start.entry
  1815. organization empty$ % 主要责任人
  1816. { format.institution "organization and institution" output.warn }
  1817. { format.organization output.nonnull }
  1818. if$
  1819. format.book.title "title" output.warn % 题名项
  1820. format.translators output % 其他责任人
  1821. format.edition output % 版本项
  1822. format.address.publisher.year output.nonnull % 出版项
  1823. format.url output % URL
  1824. format.note output % 备注项
  1825. fin.entry
  1826. }
  1827. % 学位论文
  1828. FUNCTION {phdthesis} {
  1829. start.entry
  1830. format.authors "author" output.warn
  1831. format.book.title "title" output.warn
  1832. format.address.school.year output
  1833. format.note output
  1834. fin.entry
  1835. }
  1836. % 会议录/论文集
  1837. FUNCTION {proceedings} {
  1838. start.entry
  1839. editor empty$
  1840. { organization empty$
  1841. { format.institution "author, organization institution" output.warn }
  1842. { format.organization output.nonnull }
  1843. if$
  1844. }
  1845. { format.editors output.nonnull }
  1846. if$
  1847. format.book.title "title" output.warn
  1848. format.address.publisher.year output
  1849. format.note output
  1850. fin.entry
  1851. }
  1852. % 科技报告
  1853. FUNCTION {techreport} {
  1854. start.entry
  1855. author empty$
  1856. { organization empty$
  1857. { format.institution
  1858. "author, organization and institution" output.warn }
  1859. { format.organization output.nonnull }
  1860. if$
  1861. }
  1862. { format.authors output.nonnull }
  1863. if$
  1864. format.techreport.title "title" output.warn
  1865. format.address.publisher.year output.nonnull
  1866. format.url output
  1867. format.note output
  1868. fin.entry
  1869. }
  1870. %%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1871. %% 著录格式: 专著中析出的文献
  1872. %%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1873. FUNCTION {format.collection.editors} {
  1874. booktitle empty$
  1875. { "" }
  1876. { after.title 'output.state :=
  1877. format.editors }
  1878. if$
  1879. }
  1880. FUNCTION {format.address} {
  1881. booktitle empty$
  1882. { new.block }
  1883. { mid.sentence 'output.state := }
  1884. if$
  1885. address empty$
  1886. { "" }
  1887. { address }
  1888. if$
  1889. }
  1890. FUNCTION {format.month.year} {
  1891. month empty$
  1892. { "" }
  1893. { month " " * }
  1894. if$
  1895. year empty$
  1896. { "There is month but no year in " cite$ * warning$ }
  1897. { year * }
  1898. if$
  1899. }
  1900. FUNCTION {format.collection.title} {
  1901. booktitle empty$
  1902. { "" }
  1903. { new.block
  1904. "In " booktitle *
  1905. % address empty$
  1906. % { skip$ }
  1907. % { bbl.comma * address * bbl.comma *
  1908. % month empty$
  1909. % { skip$ }
  1910. % { month * }
  1911. % if$
  1912. % year empty$
  1913. % { skip$ }
  1914. % { " " * year * }
  1915. % if$
  1916. % }
  1917. % if$
  1918. }
  1919. if$
  1920. }
  1921. % 图书中析出的文献
  1922. FUNCTION {inbook} {
  1923. start.entry
  1924. author empty$
  1925. { format.editors "author and editor" output.warn }
  1926. { format.authors output.nonnull }
  1927. if$
  1928. format.book.title "title" output.warn
  1929. format.collection.editors "editor" output.warn
  1930. format.collection.title "booktitle" output.warn
  1931. format.translators output % 其他责任人
  1932. format.edition output % 版本项
  1933. format.address.publisher.year output.nonnull % 出版项
  1934. format.pages "pages" output.warn %
  1935. format.url output % URL
  1936. format.note output % 备注项
  1937. fin.entry
  1938. }
  1939. %%%%%%%%%%%%%%%%%
  1940. %% 著录格式: 专利
  1941. %%%%%%%%%%%%%%%%%
  1942. FUNCTION {patent} {
  1943. start.entry
  1944. author empty$
  1945. { format.assignees "assignee" output.warn }
  1946. { format.authors output.nonnull }
  1947. if$
  1948. format.patent.title "title" output.warn
  1949. format.patent.publication output
  1950. format.url output
  1951. format.note output
  1952. fin.entry
  1953. }
  1954. % 电子文献更新或修改日期
  1955. FUNCTION {format.update.date} {
  1956. update empty$
  1957. { "" }
  1958. { output.state mid.sentence =
  1959. { before.all 'output.state := }
  1960. { skip$ }
  1961. if$
  1962. "~(" update * ")" * }
  1963. if$
  1964. }
  1965. %%%%%%%%%%%%%%%%%%%%%
  1966. %% 著录格式: 电子文献
  1967. %%%%%%%%%%%%%%%%%%%%%
  1968. FUNCTION {electronic} {
  1969. start.entry
  1970. author empty$
  1971. { organization "author and organization" output.warn }
  1972. { format.authors output.nonnull }
  1973. if$
  1974. format.book.title output
  1975. format.electronic.publication output
  1976. format.update.date output
  1977. format.reference.date output
  1978. format.url output
  1979. format.note output
  1980. fin.entry
  1981. }
  1982. %%%%%%%%%%%%%%%%%%%%%%%
  1983. %% 著录格式: 连续出版物
  1984. %%%%%%%%%%%%%%%%%%%%%%%
  1985. FUNCTION {periodical} {
  1986. start.entry
  1987. editor empty$
  1988. { format.organization "editors and organization" output.warn }
  1989. { format.editors output.nonnull }
  1990. if$
  1991. format.book.title "title" output.warn
  1992. format.year.volume.number output
  1993. format.address.publisher.year output
  1994. format.url output
  1995. format.note output
  1996. fin.entry
  1997. }
  1998. FUNCTION {format.journal.title} {
  1999. journal empty$
  2000. { "" }
  2001. { new.block journal }
  2002. if$
  2003. }
  2004. % 连续出版物中析出的文献
  2005. FUNCTION {article}
  2006. { start.entry
  2007. format.authors "author" output.warn
  2008. format.book.title "title" output.warn
  2009. format.journal.title "journal" output.warn
  2010. format.year.volume.number output
  2011. format.pages "pages" output.warn
  2012. format.reference.date output
  2013. format.url output
  2014. format.note output
  2015. fin.entry
  2016. }
  2017. FUNCTION {booklet}
  2018. { start.entry
  2019. format.authors output
  2020. new.block
  2021. format.title "title" output.warn
  2022. howpublished address new.block.checkb
  2023. howpublished output
  2024. address output
  2025. format.date output
  2026. new.block
  2027. note output
  2028. fin.entry
  2029. }
  2030. FUNCTION {incollection}
  2031. { start.entry
  2032. format.authors "author" output.warn
  2033. new.block
  2034. format.ictitle "title" output.warn
  2035. new.block
  2036. crossref missing$
  2037. { %format.in.ed.booktitle "booktitle" output.warn
  2038. %format.bvolume output
  2039. format.in.ed.booktitle.volume "booktitle" output.warn
  2040. format.number.series output
  2041. format.chapter.pages output
  2042. new.sentence
  2043. % publisher "publisher" output.warn
  2044. % address output
  2045. format.address.publisher.year output
  2046. format.edition output
  2047. format.date ":" * format.pages * output
  2048. %format.date "year" output.warn
  2049. }
  2050. { format.incoll.inproc.crossref output.nonnull
  2051. format.chapter.pages output
  2052. }
  2053. if$
  2054. new.block
  2055. note output
  2056. fin.entry
  2057. }
  2058. % 论文集中析出的文献
  2059. FUNCTION {inproceedings} {
  2060. start.entry
  2061. format.authors "author" output.warn
  2062. format.book.title "title" output.warn
  2063. format.collection.editors "editor" output.warn
  2064. format.collection.title "booktitle" output.warn
  2065. format.address output
  2066. format.month.year output
  2067. % format.address.publisher.year output.nonnull % 出版项
  2068. format.pages "pages" output.warn %
  2069. format.url output % URL
  2070. format.note output % 备注项
  2071. % format.in.booktitle "booktitle" output.warn
  2072. % %format.bvolume output
  2073. % %format.number.series output
  2074. % %format.pages output
  2075. % address empty$
  2076. % { organization publisher new.sentence.checkb
  2077. % organization output
  2078. % publisher output
  2079. % %format.date "year" output.warn
  2080. % %year output
  2081. % format.date ":" * format.pages * output
  2082. % }
  2083. % { %address output.nonnull
  2084. % format.address.publisher.year output
  2085. % %format.date "year" output.warn
  2086. % % year output
  2087. % format.date ":" * format.pages * output
  2088. % new.sentence
  2089. % organization output
  2090. % %publisher output
  2091. % }
  2092. % if$
  2093. % new.block
  2094. % pages output
  2095. %remove.dots
  2096. % { format.incoll.inproc.crossref output.nonnull
  2097. % format.pages output
  2098. % }
  2099. % if$
  2100. % new.block
  2101. % note output
  2102. fin.entry
  2103. }
  2104. FUNCTION {manual}
  2105. { start.entry
  2106. author empty$
  2107. { organization empty$
  2108. 'skip$
  2109. { organization output.nonnull
  2110. address output
  2111. }
  2112. if$
  2113. }
  2114. { format.authors output.nonnull }
  2115. if$
  2116. new.block
  2117. format.book.title "title" output.warn
  2118. author empty$
  2119. { organization empty$
  2120. { address new.block.checka
  2121. address output
  2122. }
  2123. 'skip$
  2124. if$
  2125. }
  2126. { organization address new.block.checkb
  2127. organization output
  2128. address output
  2129. }
  2130. if$
  2131. format.edition output
  2132. format.date output
  2133. new.block
  2134. note output
  2135. fin.entry
  2136. }
  2137. % FUNCTION {masterthesis.type}
  2138. % { "~[D]"
  2139. % % language empty$
  2140. % % { "[Master Thesis]" }
  2141. % % { "[硕士学位论文]" }
  2142. % % if$
  2143. % }
  2144. % FUNCTION {mastersthesis}
  2145. % { start.entry
  2146. % format.authors "author" add.period$ output.warn
  2147. % new.block
  2148. % format.title remove.dots " " * masterthesis.type * output
  2149. % new.block
  2150. % format.address.school output
  2151. % %address output
  2152. % %school "school" output.warn
  2153. % format.date "year" output.warn
  2154. % new.block
  2155. % note output
  2156. % fin.entry
  2157. % }
  2158. FUNCTION {misc}
  2159. { start.entry
  2160. format.authors output
  2161. % title howpublished new.block.checkb
  2162. format.title output
  2163. % howpublished new.block.checka
  2164. % howpublished output
  2165. % format.date output
  2166. format.address output
  2167. format.month.year output
  2168. format.pages "pages" output.warn
  2169. format.url output
  2170. % new.block
  2171. format.note output
  2172. fin.entry
  2173. % empty.misc.check
  2174. }
  2175. FUNCTION {phdthesis.type}
  2176. { "~[D]"
  2177. % language empty$
  2178. % { "[PhD Thesis]" }
  2179. % { "[博士学位论文]" }
  2180. % if$
  2181. }
  2182. FUNCTION {unpublished}
  2183. { start.entry
  2184. format.authors "author" output.warn
  2185. new.block
  2186. format.title "title" output.warn
  2187. new.block
  2188. note "note" output.warn
  2189. format.date output
  2190. fin.entry
  2191. }
  2192. % 专用控制条目 BUPTThesisBSTCTL 用于提供方便的用户设置接口
  2193. FUNCTION {BUPTThesisBSTCTL}{
  2194. is.print.banners.to.terminal
  2195. { "** BUPTThesis BST control entry " quote$ * cite$ *
  2196. quote$ * " detected." *
  2197. top$
  2198. }
  2199. { skip$ }
  2200. if$
  2201. % CTLuse_article_number
  2202. % empty$
  2203. % { skip$ }
  2204. % { CTLuse_article_number
  2205. % yes.no.to.int
  2206. % 'is.use.number.for.article :=
  2207. % }
  2208. % if$
  2209. % CTLuse_paper
  2210. % empty$
  2211. % { skip$ }
  2212. % { CTLuse_paper
  2213. % yes.no.to.int
  2214. % 'is.use.paper :=
  2215. % }
  2216. % if$
  2217. % CTLuse_forced_etal
  2218. % empty$
  2219. % { skip$ }
  2220. % { CTLuse_forced_etal
  2221. % yes.no.to.int
  2222. % 'is.forced.et.al :=
  2223. % }
  2224. % if$
  2225. % 显示作者数目
  2226. CTLmax_names_forced_etal
  2227. empty$
  2228. { skip$ }
  2229. { CTLmax_names_forced_etal
  2230. string.to.integer
  2231. 'max.num.names.before.forced.et.al :=
  2232. }
  2233. if$
  2234. % 论文作者英文姓名
  2235. CTLauthor_name_english
  2236. empty$
  2237. { skip$ }
  2238. { CTLauthor_name_english
  2239. 'author.name.in.english :=
  2240. % #1 'is.for.peer.review :=
  2241. % "CTLauthor_name_english=" author.name.in.english * debug.output
  2242. }
  2243. if$
  2244. % 论文作者中文姓名
  2245. CTLauthor_name_chinese
  2246. empty$
  2247. { skip$ }
  2248. { CTLauthor_name_chinese
  2249. 'author.name.in.chinese :=
  2250. % #1 'is.for.peer.review :=
  2251. % "CTLauthor_name_chinese=" author.name.in.chinese * debug.output
  2252. }
  2253. if$
  2254. CTLfor_peer_review
  2255. empty$
  2256. { skip$ }
  2257. { CTLfor_peer_review
  2258. yes.no.to.int
  2259. 'is.for.peer.review :=
  2260. }
  2261. if$
  2262. % CTLnames_show_etal
  2263. % empty$
  2264. % { skip$ }
  2265. % { CTLnames_show_etal
  2266. % string.to.integer
  2267. % 'num.names.shown.with.forced.et.al :=
  2268. % }
  2269. % if$
  2270. % CTLuse_alt_spacing
  2271. % empty$
  2272. % { skip$ }
  2273. % { CTLuse_alt_spacing
  2274. % yes.no.to.int
  2275. % 'is.use.alt.interword.spacing :=
  2276. % }
  2277. % if$
  2278. % CTLalt_stretch_factor
  2279. % empty$
  2280. % { skip$ }
  2281. % { CTLalt_stretch_factor
  2282. % 'ALTinterwordstretchfactor :=
  2283. % "\renewcommand{\BIBentryALTinterwordstretchfactor}{"
  2284. % ALTinterwordstretchfactor * "}" *
  2285. % write$ newline$
  2286. % }
  2287. % if$
  2288. % CTLdash_repeated_names
  2289. % empty$
  2290. % { skip$ }
  2291. % { CTLdash_repeated_names
  2292. % yes.no.to.int
  2293. % 'is.dash.repeated.names :=
  2294. % }
  2295. % if$
  2296. % CTLname_emph_author_en % 强调显示的作者英文姓名
  2297. % empty$
  2298. % { skip$ } % 若没有给出则跳过
  2299. % { CTLname_emph_author_en
  2300. % 'name.emph.author.en := % 否则更新 name.emph.author.en
  2301. % }
  2302. % if$
  2303. % CTLname_emph_author_zh % 强调显示的作者中文姓名
  2304. % empty$
  2305. % { skip$ } % 若没有给出则跳过
  2306. % { CTLname_emph_author_zh
  2307. % 'name.emph.author.zh := % 否则更新 name.emph.author.zh
  2308. % }
  2309. % if$
  2310. CTLname_format_string % 英文姓名排版格式字符串
  2311. empty$
  2312. { skip$ } % 若没有自定义则跳过
  2313. { CTLname_format_string % 否则更新 name.format.string
  2314. 'name.format.string :=
  2315. }
  2316. if$
  2317. % CTLname_latex_cmd
  2318. % empty$
  2319. % { skip$ }
  2320. % { CTLname_latex_cmd
  2321. % 'name.latex.cmd :=
  2322. % }
  2323. % if$
  2324. % CTLname_url_prefix
  2325. % missing$
  2326. % { skip$ }
  2327. % { CTLname_url_prefix
  2328. % 'name.url.prefix :=
  2329. % }
  2330. % if$
  2331. % num.names.shown.with.forced.et.al max.num.names.before.forced.et.al >
  2332. % { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$
  2333. % max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al :=
  2334. % }
  2335. % { skip$ }
  2336. % if$
  2337. }
  2338. %%%%%%%%%%%%
  2339. %% 条目别名
  2340. %%%%%%%%%%%%
  2341. FUNCTION {mastersthesis} {phdthesis}
  2342. FUNCTION {conference} {inproceedings}
  2343. FUNCTION {online} {electronic}
  2344. FUNCTION {internet} {electronic}
  2345. FUNCTION {webpage} {electronic}
  2346. FUNCTION {www} {electronic}
  2347. FUNCTION {default.type} {misc}
  2348. %%%%%%%%%%
  2349. %% 主程序
  2350. %%%%%%%%%%
  2351. READ
  2352. EXECUTE {initialize.controls} % 初始化控制变量
  2353. EXECUTE {initialize.status.constants} % 初始化状态常量
  2354. EXECUTE {banner.message} % 显示初始提示信息
  2355. EXECUTE {initialize.longest.label} % 初始化最长的标号
  2356. ITERATE {longest.label.pass} % 处理最长的标号
  2357. EXECUTE {begin.bib} % 开始
  2358. ITERATE {call.type$} %
  2359. EXECUTE {end.bib} % 结束
  2360. EXECUTE {completed.message} % 显示完成提示信息
  2361. %% EOF