|
208 | 208 | ;; 日期格式 |
209 | 209 | (tm-define (bib-format-date x) |
210 | 210 | (:mode bib-gbt7714-2015?) |
211 | | - ;; GBT 7714-2015 仅使用年份,不含月份 |
212 | | - (let* ((y (bib-field x "year"))) |
213 | | - (if (bib-null? y) "" y))) |
| 211 | + ;; 优先使用 date 字段;若没有则回退到 year;返回空字符串表示没有可用的日期信息 |
| 212 | + (let* ((d (bib-field x "date")) |
| 213 | + (y (bib-field x "year")) |
| 214 | + (date-str (if (bib-null? d) y d))) |
| 215 | + (if (bib-null? date-str) |
| 216 | + "" |
| 217 | + `(concat "(" ,date-str ")")))) |
214 | 218 |
|
215 | | -;; 书名格式 |
| 219 | +;; 书名格式 |
216 | 220 | (tm-define (bib-format-in-ed-booktitle x) |
217 | 221 | (:mode bib-gbt7714-2015?) |
218 | 222 | (let* ((b (bib-default-field x "booktitle")) |
|
266 | 270 | (sep (if (< (bib-text-length v) 3) `(nbsp) " "))) |
267 | 271 | `(concat ,(bib-translate "volume") ,sep ,v ,series))))) |
268 | 272 |
|
269 | | -;; 重写技术报告编号格式 |
270 | | -(tm-define (bib-format-tr-number x) |
271 | | - (:mode bib-gbt7714-2015?) |
272 | | - ;; GBT 7714-2015 不要求输出 "Technical Report",只输出报告编号 |
273 | | - (let* ((n (bib-field x "number"))) |
274 | | - (if (bib-null? n) "" n))) |
275 | | - |
276 | 273 | ;; URL/DOI 信息格式 |
277 | 274 | (tm-define (bib-format-url-doi x) |
278 | 275 | (:mode bib-gbt7714-2015?) |
|
509 | 506 | ,(bib-document-type-identifier x "techreport"))) |
510 | 507 | ,(bib-new-block |
511 | 508 | (bib-new-sentence |
512 | | - `(,(bib-format-tr-number x) |
513 | | - ,(bib-format-address-institution x) |
514 | | - ,(let* ((d (bib-field x "date")) |
515 | | - (y (bib-field x "year")) |
516 | | - (date-str (if (bib-null? d) y d))) |
517 | | - (if (bib-null? date-str) "" `(concat "(" ,date-str ")")))))) |
| 509 | + `(,(bib-format-address-institution x) |
| 510 | + ,(bib-format-date x)))) |
518 | 511 | ,(bib-new-block (bib-format-field x "note")) |
519 | 512 | ,(bib-new-block (bib-format-url-doi x)))))) |
0 commit comments