Skip to content

Commit 877806a

Browse files
committed
editor格式修复
1 parent f5f38fd commit 877806a

File tree

1 file changed

+17
-25
lines changed

1 file changed

+17
-25
lines changed

TeXmacs/plugins/latex/progs/bibtex/gbt7714-2015-author-year.scm

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
;; 获取作者字段(优先使用author,如果没有则使用editor)
6262
(define (gbt-get-author-field x)
63+
;; editor和author同逻辑:优先使用author,没有author才使用editor
6364
(let ((author-field (bib-field x "author"))
6465
(editor-field (bib-field x "editor")))
6566
(cond
@@ -69,17 +70,8 @@
6970

7071
;; 为作者字符串添加后缀(如果是editor)
7172
(define (gbt-add-suffix author-str field-type chinese? count)
72-
(cond
73-
((equal? field-type 'author) author-str) ;; author不加后缀
74-
((equal? field-type 'editor)
75-
(if chinese?
76-
(if (= count 1)
77-
`(concat ,author-str " (<#7F16>)") ;; (编)
78-
`(concat ,author-str " (<#4E3B><#7F16>)")) ;; (主编)
79-
(if (= count 1)
80-
`(concat ,author-str " (ed.)")
81-
`(concat ,author-str " (eds.)"))))
82-
(else author-str)))
73+
;; editor和author同逻辑:都不加后缀
74+
author-str)
8375

8476
;; 获取作者字符串(用于natbib-triple的author字段 - 完整格式,用于参考文献表)
8577
(tm-define (gbt-get-author-string x)
@@ -490,8 +482,8 @@
490482
,(bib-new-block
491483
(bib-new-sentence
492484
`(,(bib-format-field x "journal")
493-
,(bib-format-vol-num-pages x)))
494-
,(bib-new-block (bib-format-url-doi x)))))))
485+
,(bib-format-vol-num-pages x))))
486+
,(bib-new-block (bib-format-url-doi x))))))
495487

496488
;; 重写图书格式以添加文献类型标识符 [M]
497489
(tm-define (bib-format-book n x)
@@ -515,7 +507,7 @@
515507
(bib-new-sentence
516508
`(,(bib-format-number-series x)
517509
,(bib-format-address-institution x))))
518-
,(bib-new-block (bib-format-url-doi x))))))
510+
,(bib-new-block (bib-format-url-doi x)))))))
519511

520512
;; 重写析出图书格式以添加文献类型标识符 [M]
521513
(tm-define (bib-format-inbook n x)
@@ -571,7 +563,7 @@
571563
(bib-new-sentence
572564
`(,(bib-format-number-series x)
573565
,(bib-format-address-institution x))))
574-
,(bib-new-block (bib-format-url-doi x))))))
566+
,(bib-new-block (bib-format-url-doi x)))))))
575567

576568
;; 重写会议论文格式以添加文献类型标识符 [C]
577569
(tm-define (bib-format-inproceedings n x)
@@ -635,7 +627,7 @@
635627
(let ((address-institution (bib-format-address-institution x)))
636628
(if (equal? address-institution "") '() `(,address-institution)))
637629
`(,(bib-format-address-institution x)))))
638-
,(bib-new-block (bib-format-url-doi x))))))
630+
,(bib-new-block (bib-format-url-doi x)))))))
639631

640632
;; 重写博士论文格式以添加文献类型标识符 [D]
641633
(tm-define (bib-format-phdthesis n x)
@@ -750,13 +742,13 @@
750742
(tm-define (bib-format-electronic n x)
751743
(:mode bib-gbt7714-2015-author-year?)
752744
`(concat
753-
,(bib-format-bibitem n x)
754-
,(bib-label (list-ref x 2))
755-
,(bib-new-list-spc
756-
`(,(bib-new-block
757-
`(concat ,(bib-format-field-preserve-case x "title")
758-
,(bib-document-type-identifier x "electronic")))
759-
,(bib-new-block (bib-format-url-doi x))))))
745+
,(bib-format-bibitem n x)
746+
,(bib-label (list-ref x 2))
747+
,(bib-new-list-spc
748+
`(,(bib-new-block
749+
`(concat ,(bib-format-field-preserve-case x "title")
750+
,(bib-document-type-identifier x "electronic")))
751+
,(bib-new-block (bib-format-url-doi x))))))
760752

761753
;; 重写在线网页格式以添加文献类型标识符 [EB]
762754
(tm-define (bib-format-online n x)
@@ -795,7 +787,7 @@
795787
(bib-new-sentence
796788
`(,(bib-format-field x "journal")
797789
,date-pages-str)))
798-
,(bib-new-block (bib-format-url-doi x))))))
790+
,(bib-new-block (bib-format-url-doi x)))))))
799791

800792
;; 重写汇编格式以添加文献类型标识符 [G]
801793
(tm-define (bib-format-collection n x)
@@ -915,7 +907,7 @@
915907
,(bib-new-block
916908
(bib-new-sentence
917909
`(,(bib-format-address-institution x))))
918-
,(bib-new-block (bib-format-url-doi x))))))
910+
,(bib-new-block (bib-format-url-doi x)))))))
919911

920912
;; 重写数据集格式以添加文献类型标识符 [DS]
921913
(tm-define (bib-format-dataset n x)

0 commit comments

Comments
 (0)