From 60003e82b9b5fa7a441e8c66077167401849fc8e Mon Sep 17 00:00:00 2001 From: DansYU Date: Sun, 23 Jun 2019 13:03:45 +0800 Subject: [PATCH] =?UTF-8?q?LaTeX=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E3=80=81bib=E6=96=87=E4=BB=B6=E3=80=81=E7=B1=BB=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/example.bib | 3876 ++++++++++++++++++++++++++++++++++++ config/gb7714-2015-gbk.def | 27 + config/gb7714-2015.bbx | 3462 ++++++++++++++++++++++++++++++++ config/gb7714-2015.cbx | 279 +++ config/gb7714-2015ay.bbx | 3787 +++++++++++++++++++++++++++++++++++ config/gb7714-2015ay.cbx | 271 +++ config/gb7714-2015ms.bbx | 2710 +++++++++++++++++++++++++ config/gb7714-2015ms.cbx | 190 ++ config/gb7714-2015mx.bbx | 3302 ++++++++++++++++++++++++++++++ config/gb7714-2015mx.cbx | 466 +++++ config/seuthesiY.cls | 701 +++++++ config/seuthesix.cfg | 168 +- 12 files changed, 19155 insertions(+), 84 deletions(-) create mode 100644 config/example.bib create mode 100644 config/gb7714-2015-gbk.def create mode 100644 config/gb7714-2015.bbx create mode 100644 config/gb7714-2015.cbx create mode 100644 config/gb7714-2015ay.bbx create mode 100644 config/gb7714-2015ay.cbx create mode 100644 config/gb7714-2015ms.bbx create mode 100644 config/gb7714-2015ms.cbx create mode 100644 config/gb7714-2015mx.bbx create mode 100644 config/gb7714-2015mx.cbx create mode 100644 config/seuthesiY.cls diff --git a/config/example.bib b/config/example.bib new file mode 100644 index 0000000..62bfa8a --- /dev/null +++ b/config/example.bib @@ -0,0 +1,3876 @@ +% Encoding: UTF-8 + +@Article{liu_statistical_2017, + author = {Liu, Wenjing and Xu, Liang}, + title = {Statistical analysis of ionospheric {TEC} anomalies before global {M} w ≥ 7.0 earthquakes using data of {CODE} {GIM}}, + journal = {Journal of Seismology}, + year = {2017}, + volume = {21}, + number = {4}, + pages = {759--775}, + month = jul, + issn = {1383-4649, 1573-157X}, + comment = {需要加到看的文献}, + doi = {10.1007/s10950-016-9634-0}, + language = {en}, + url = {http://link.springer.com/10.1007/s10950-016-9634-0}, + urldate = {2019-03-20TZ}, +} + + +@PhdThesis{zhouGPS2015, + langid = {中文;}, + title = {GPS电离层反演与地震—电离层效应研究}, + url = {http://kns.cnki.net/KCMS/detail/detail.aspx?dbcode=CDFD&dbname=CDFDLAST2017&filename=1016018396.nh&uid=WEEvREcwSlJHSldRa1FhdkJkVG1BSEZkQmUwd29sZVN4NWJBMktkOGw1WT0=$9A4hF_YAuvQ5obgVAqNKPCYcEjKensW4IQMovwHtwkF4VYPoHbKxJw!!&v=MDEyODZZUzdEaDFUM3FUcldNMUZyQ1VSTE9mWXVkckZ5M2dVcnpOVkYyNkdMTzVGdExGcVpFYlBJUjhlWDFMdXg=}, + institution = {{武汉大学}}, + type={[博士学位论文]}, + urldate = {2019-05-14}, + date = {2015}, + keywords = {Ionosphere,数据同化,Data assimilation,电离层,Tomography,层析,GPS,地震—电离层效应,Seismic-ionospheric effects}, + author = {周, 义炎} +} + +@Mastersthesis{余勇1998--, + title = {劲性混凝土柱抗震性能的试验研究}, + author = {余勇}, + school = {东南大学土木工程学院}, + year = {1998}, + type={[硕士学位论文]}, + location = {南京}, +} + +@Other{易仕和,2013, + Entryset = {易仕和2013--,Yi2013--} +} + +@book{李时珍--, +author={李时珍} +} + +@book{乔纳斯--, +author={乔纳斯} +} + +@Book{昂温1988--, + Author = {昂温, S.}, +} + +@Book{GPS1988--, + Title = {外国出版史}, + Author = {{昂温, G} and {昂温, P S}}, + Publisher = {中国书籍出版社}, + Translator = {陈生诤}, + Year = {1988}, + Location = {北京} +} + +@Book{丸山敏秋--, + Author = {丸山敏秋}, +} + +@Book{凯西尔--, + Author = {凯西尔}, +} + +@book{Einstein--, + author = {Einstein, Albert} +} + +@book{Williams-ellis--, + author = {Williams-ellis, Amabel} +} + +@book{morgan--, + author = {De Morgan, Augustus} +} + +@book{lijianning--a, + author = {{LI Jiangning}} +} + +@book{lijianning--b, + author = {Li, Jiang Ning} +} + +@book{钱学森--, + author = {钱学森 and 刘再复} +} + +@book{李四光--, + author = {李四光 and 华罗庚 and 茅以升} +} + +@book{印森林--, + author = {印森林 and 吴胜和 and 李俊飞 and 冯文杰} +} + +@book{fordham--, + author = {Evenst W. Fordham and Amiad Ali and David A. Truner and John R. Charters} +} + +@Article{anon1981-628, + title = {Coffee drinking and cancer of the pancreas}, + journal = {Br Med J}, + year = {1981}, + volume = {283}, + number = {6292}, + pages = {628} +} + +@book{中国科学院物理研究所--, + author = {{中国科学院物理研究所}} +} + +@book{贵州省土穰普查办公室--, + author = {{贵州省土穰普查办公室}} +} + +@book{AmericanChemicalSociety--, + author = {{American Chemical Society}} +} + + +@book{StanfordUniversity--, + author = {{Stanford University. Department of Civil Eng ineering}} +} + + +@book{王夫之的诠释--, + title = {王夫之“乾坤并建”的诠释面向} +} + +@book{张子正蒙注--, + title = {张子正蒙注} +} + +@book{化学动力学和反应器原理--, + title = {化学动力学和反应器原理} +} + +@book{袖珍神学--, + title = {袖珍神学,或,简明基督教词典} +} + +@article{北京师范大学学报--, + Journaltitle = {北京师范大学学报(自然科学版)} +} + +@book{Gasesinsea--, + title = {Gases in sea ice 1975-1979} +} + +@article{jmath--, + Journaltitle = {J Math \& Phys} +} + +@book{为人民服务--, + title = {为人民服务;纪念白求恩;愚公移山} +} + +@book{编者1964--, + title = {为人民服务;纪念白求恩;愚公移山}, + address= {北京}, + publisher={人民出版社}, + date ={1964}, + pages= {1-3;7-11;31-35} +} + +@book{大趋势--, + title = {大趋势} +} + +@book{地壳运动--, + title = {地壳运动假说:从大陆漂移到板块构造} +} + +@book{三松堂--, + title = {三松堂全集:第4卷} +} + +@book{世界出版业--, + title = {世界出版业:美国卷} +} + +@book{ECL集成电路--, + title = {ECL集成电路:原理与设计} +} + +@book{中国科学技术史--, + title = {中国科学技术史:第2卷~~~~科学思想史} +} + +@article{商鞅战秋菊--, + title = {商鞅战秋菊:法治转型的一个思想实验} +} + +@article{中国科学--, + title = {中国科学:D辑~~~~地球科学} +} + +@Standard{信息与文献--, + title = {信息与文献---都柏林核心元数据元素集:GB/T 25100—2010} +} + +@Standard{全国信息与文献标准化技术委员会2010-2-3, + author = {全国信息与文献标准化技术委员会}, + title = {信息与文献\ \ \ \ 都柏林核心元数据元素集: GB/T 25100—2010}, + year = {2010}, + address = {北京}, + pages = {2--3}, + publisher = {中国标准出版社}, +} + +@report{中子反射--, + title = {中子反射数据分析技术:CNIC-01887} +} + +@article{AsianPacificjournal--, + Journaltitle = {Asian Pacific journal of eancer prevention: e-only} +} + + +@book{egbookeda--, + title = {中文书}, + edition={3} +} + +@book{egbookedb--, + title = {中文书}, + edition={新1版} +} + +@book{egbookedc--, + title = {中文书}, + edition={明刻本} +} + +@book{egbookedd--, + title = {english book}, + edition={5} +} + +@book{egbookede--, + title = {english book}, + edition={Rev. ed.} +} + +@book{egbookpuba--, + title = {中文书}, + date = {2013}, + address = {北京}, + publisher = {人民出版社}, +} + +@book{egbookpubb--, + title = {english book}, + date = {2012}, + address = {New York}, + publisher = {Academic Press}, +} + +@book{egbookpubaddressa--, + title = {english book}, + address = {Cambridge, Eng.}, + publisher = {Academic Press}, +} + +@book{egbookpubaddressb--, + title = {english book}, + address = {Cambridge, Mass.}, + publisher = {Academic Press}, +} + +@book{egbookpubaddressc--, + title = {中文书}, + date = {2013}, + address = {北京 and 上海}, + publisher = {科学出版社}, +} + +@book{egbookpubaddressd--, + title = {english book}, + date = {2000}, + address = {London and Boston and Durban and Syngapore and Sydney and Toronto and Wellington}, + publisher = {Butterworths}, +} + +@book{egbookpubaddresse--, + title = {中文书}, + date = {1990}, + publisher = {三户图书刊行社}, +} + +@book{egbookpubaddressf--, + title = {english book}, + date = {1975}, + publisher = {MacMillan}, +} + +@online{egbookpubaddressg--, + date = {2011}, + pages ={105}, + url={http://lib.myilibrary.com/Open.aspx?id=312377}, + urldate={2014-06-16}, + publisher = {Open University Press}, +} + + + +@book{egbookpubpublishera--, + title = {中文书}, + address = {北京}, + publisher = {中国标准出版社}, +} + +@book{egbookpubpublisherb--, + title = {english book}, + address = {Cambridge}, + publisher = {Elsevier Science Publishers}, +} + +@book{egbookpubpublisherc--, + title = {english book}, + address = {Cambridge}, + publisher = {IRRI}, +} + +@book{egbookpubpublisherd--, + title = {english book}, + address = {Chicago}, + publisher = {ALA and CLA}, + date ={1978} +} + +@book{egbookpubpublishere--, + title = {中文书}, + address = {哈尔滨}, + date ={2013} +} + +@book{egbookpubpublisherf--, + title = {english book}, + address = {Salt Lake City}, + date ={1964} +} + + +@book{egbookpubdatea--, + title = {中文书}, + year ={1947(民国三十六年)} +} + +@book{egbookpubdateb--, + title = {中文书}, + year ={1705(康熙四十四年)} +} + +@newspaper{egbookpubdatec--, + title = {中文书}, + date ={2013-01-08} +} + +@book{egbookpubdated--, + title = {中文书}, + year ={c1988} +} + +@book{egbookpubdatee--, + title = {中文书}, + year ={1985印刷} +} + +@book{egbookpubdatef--, + title = {中文书}, + year ={[1936]} +} + + +@online{egbookpubdateg--, + title = {english book}, + date = {2012-05-03}, + urldate={2013-11-12}, +} + +@Book{曹凌2011-19-, + author = {曹凌}, + title = {中国佛教疑伪经综录}, + year = {2011}, + publisher = {上海古籍出版社}, + address = {上海}, + pages ={19} +} + +@Book{钱学森2001--, + author = {钱学森}, + title = {创建系统学}, + year = {2001}, + publisher = {山西科学技术出版社}, + address = {太原}, + pages ={序2-3} +} + +@Book{冯友兰2008--, + author = {冯友兰}, + title = {冯友兰自选集}, + year = {2008}, + publisher = {北京大学出版社}, + address = {北京}, + edition ={2}, + pages ={第1版自序} +} + +@inbook{李约瑟1991--, + author = {李约瑟}, + title = {题词}, + bookauthor = {苏克福 and 管成学 and 邓明鲁}, + booktitle = {苏颂与《本草图经》研究}, + year = {1991}, + publisher = {长春出版社}, + address = {长春}, + pages = {扉页} +} + +@ARTICLE{DUBAR2013--, + author = {DUBAR, K L. AND MITCHELL, D A.}, + title = {Revealing nature's synthetic potential through the study of ribosomal natural product biosynthesis}, + Journaltitle = {ACS chemical biology}, + DATE = {2013}, + VOLUME = {8}, + pages = {473-487}, + url = {http://pubs.acs.org/doi/pdfplus/10.1021/cb3005325}, + urldate = {2013-10-16} +} + +@Book{周鲁卫2011--, + author = {周鲁卫}, + title = {软物质物理导论}, + year = {2011}, + publisher = {复旦大学出版社}, + address = {上海}, + pages = {1} +} + +@ARTICLE{常森2013--, + author = {常森}, + title = {《五行》学说与《荀子》}, + Journaltitle = {北京大学学报(哲学社会科学版)}, + DATE = {2013}, + VOLUME = {50}, + number = {1}, + pages = {75}, +} + +@Book{RUDDOCK2009--, + author = {RUDDOCK, L.}, + title = {Economics for the modern built environment}, + year = {2009}, + publisher = {Taylor & Francis}, + address = {London}, + pages = {12}, + url = {http://lib.mylib.com}, + urldate = {2010-06-15}, +} + +@book{kereanrefa, + AUTHOR = {김세훈 and others}, + TITLE = { 도서판및특서진흥업 개정안 연구}, + DATE = {2003}, + address={서울}, + PAGES = {15}, + publisher = {한국운화관팡정책연구원}, +} +%%김세훈, 외. 도서판및특서진흥업 개정안 연구〔M〕, 서울; 한국운화관팡정책연구원,2003: 15. + + +@book{kereanrefb, + AUTHOR = {이냉목 }, + TITLE = { 도서관꺾규총람: 세 1 권}, + DATE = {2005}, + address={서울}, + PAGES = {67-68}, + publisher = {구미무역 출판부}, +} +%%이냉목 도서관꺾규총람: 세 1 권[M〕. 서울: 구미무역 출판부,2005: 67-68. +%% + +@Book{李炳穆2005--, + author = {李炳穆}, + title = {图书馆法柜总览:第1卷}, + year = {2005}, + publisher = {九美贸易出版部}, + address = {首尔}, + pages = {67-68} +} + + +@article{kereanrefc, + DATE = {2007}, + volume={48}, + number={7}, + PAGES = {11-12}, + journaltitle={ 圖書館文化}, + TITLE = {도서관 정보정책위원회 설립식 및 도서관 정보정책기획단신성}, +} +%%도서관 정보정책위원회 설립식 및 도서관 정보정책기획단신성. 圖書館文化,2007 ,48(7): 11-12. + +@ARTICLE{图书馆信息政策委员会2007--, + title = {图书馆信息政策委员会成立仪式与图书馆信息政策规划团}, + Journaltitle = {图书馆文化}, + DATE = {2007}, + VOLUME = {48}, + number = {7}, + pages = {11-12}, +} + +@book{japaneserefc, + AUTHOR = {図書館用語辞典編集委員会}, + TITLE = { 最新図書館用語大辞典}, + DATE = {2004}, + address={東京}, + PAGES = {154}, + publisher = {柏書房株式会社}, +} +%% +%%図書館用語辞典編集委員会.最新図書館用語大辞典[M].東京:柏書房株式会社,2004:154. +%% + +@article{russianrefc, + author={Кочекоs, А Я}, + TITLE = {Молибден-медно-эолотопорфиооое месторождение Рябиноосе}, + DATE = {1993}, + number={7}, + PAGES = {50-58}, + journaltitle={ Отечестsенная гелогия} +} +%%Кочекоs А Я. Молибден-медно-эолотопорфиооое месторождение Рябиноосе[J/ОL]. ,1993(7):50-58 + +@ARTICLE{熊平2005--, + author = {熊平 and 吴颉}, + title = {从交易费用的角度谈如何构建药品流通的良性机制}, + Journaltitle = {中国物价}, + DATE = {2005}, + number = {8}, + pages = {42-45}, +} + +@ARTICLE{xiong2005--, + author = {Xiong, Ping and Wu, Xie}, + title = {Discussion on how to construct benign medicine circulantion mechanism fromtranaction cosperspective}, + Journaltitle = {China price}, + DATE = {2005}, + number = {8}, + pages = {42-45}, +} + +@ARTICLE{上海市食品药品监督管理局课题组2008--, + author = {上海市食品药品监督管理局课题组}, + title = {互联网药品经营现状和监管机制的研究}, + Journaltitle = {上海食品药品监管情报研究}, + DATE = {2008}, + number = {1}, + pages = {8-11}, +} + +@ARTICLE{Rgsfda2008--, + author = {{Research Group of Shanghai Food and Drug Administration}}, + title = {A study on online pharmaceutical operating situation and supervision mechanism}, + Journaltitle = {Shanghai food and drug information research}, + DATE = {2008}, + number = {1}, + pages = {8-11}, +} + + +@PhdThesis{刘乃安2000-17-18, + author = {刘乃安}, + title = {生物质材料热解失重动力学及其分析方法研究}, + year = {2000}, + pages = {17--18}, + doi = {10.7666/d.y351065}, + url = {http://wenku.baidu.com/link?url=GJDJxb4lxBUXnIPmq1XoEGSIr1H8TMLbidW_LjlYu33tpt707u62rKliypU_FBGUmox7ovPNaVIVBALAMd5yfwuKUUOAGYuB7cuZ-BYEhXa}, + urldate = {2014-08-29}, + address = {安徽}, + school = {中国科学技术大学}, +} + +@book{Deverell2013-21-22, + author = {Deverell, William and Igler, David}, + title = {A Companion to {California} History}, + year = {2013}, + date = {2013-11-15}, + pages = {21--22}, + doi = {10.1002/9781444305036.ch2}, + url = {http://onlinelibrary.wiley.com/doi/10.1002/9781444305036.ch2/summary}, + urldate = {2014-06-24}, + address = {New York}, + school = {John Wiley \& Sons}, +} + +@inbook{姚中秋2009--, + author = {姚中秋}, + title = {作为一种制度变迁模式的“转型”}, + bookauthor = {罗卫东 and 姚中秋}, + booktitle = {中国转型的理论分析:奥地利学派的视角}, + year = {2009}, + publisher = {浙江大学出版社}, + address = {杭州}, + pages = {44} +} + +@inbook{姚中秋2008--, + author = {姚中秋}, + title = {一种制度变迁模式}, + bookauthor = {罗, 卫东 and 姚, 中秋}, + booktitle = {中国转型的理论分析}, + year = {2008}, + publisher = {浙江大学出版社}, + address = {杭州}, + pages = {44} +} + + +@ARTICLE{关立哲2014--, + author = {关立哲 and 韩纪富 and 张晨延}, + title = {科技期刊编辑审读中要注重比较思维的科学运用}, + Journaltitle = {编辑学报}, + DATE = {2014}, + VOLUME = {26}, + number = {2}, + pages = {144-146} +} + +@ARTICLE{TENOPIR1987--, + author = {TENOPIR, C.}, + title = {Online databases, quality control}, + Journaltitle = {Library journal}, + DATE = {1987}, + VOLUME = {113}, + number = {2}, + pages = {124-125} +} + +@ARTICLE{egdatevolnumpagea--, + title = {article of journal}, + DATE = {2001}, + VOLUME = {1}, + number = {1}, + pages = {5-6} +} + +@ARTICLE{egdatevolnumpageb--, + title = {article of journal}, + DATE = {2014}, + VOLUME = {510}, + pages = {356-363} +} + +@ARTICLE{egdatevolnumpagec--, + title = {article of journal}, + DATE = {2010}, + number = {6}, + pages = {23} +} + +@ARTICLE{egdatevolnumpaged--, + title = {article of journal}, + DATE = {2012}, + VOLUME = {22}, + number = {增刊2}, + pages = {81-86} +} + +@ARTICLE{egdatevolnumpagee--, + title = {article of journal}, + DATE = {2001}, + number = {9/10}, + pages = {36-39} +} + +@ARTICLE{egdatevolnumpagef--, + title = {article of journal}, + year = {2011, 33(2):20-25;2011, 33(3):26-30}, +} + +@newspaper{egdatevolnumpageg--, + title = {article of journal}, + date = {2013-03-16}, + number = {1} +} + + +@Book{尼葛洛庞帝1996--, + author = {尼葛洛庞帝}, + title = {数字化生存}, + year = {1996}, + translator = {胡泳 and 范海燕}, + publisher = {海南出版社}, + address = {海口}, +} + +@Book{汪冰1997-16-16, + author = {汪冰}, + title = {电子图书馆理论与实践研究}, + year = {1997}, + publisher = {北京图书馆出版社}, + pages = {16}, + address = {北京}, +} + +@Article{杨宗英1996-24-29, + author = {杨宗英}, + title = {电子图书馆的现实模型}, + journal = {中国图书馆学报}, + year = {1996}, + number = {2}, + pages = {24--29}, +} + +@Book{Baker1995--, + author = {Baker, S K and Jackson, M E}, + title = {The future of resource sharing}, + year = {1995}, + publisher = {The Haworth Press}, + address = {New York}, +} + +@Book{Chernik1982--, + author = {Chernik, B E}, + title = {Introduction to library services for library technicians}, + year = {1982}, + publisher = {Libraries Unlimited, Inc.}, + address = {Littleton, Colo.}, +} + + +@Article{Dowler1995-5-26, + author = {Dowler, L}, + title = {The research university’s dilemma: resource sharing and research in a transinstitutional environment}, + journal = {Journal of library administration}, + year = {1995}, + volume = {21}, + number = {1/2}, + pages = {5--26}, +} + + +@Inproceedings{ref-replace-char, + Title = {Cognitive Radio and Cooperative Strategies for Power Saving in Multi-Standard Wireless Devices}, + Address = {Florence, Italy}, + Author = {Rodriguez, J. and P. Marques and A. Radwan and K. Moessner and R. Tafazolli and others}, + Booktitle = {Future % Network \& Mobile # Summit 2010}, + Date = {June 2010} +} + +@Online{olnoauthorcn, + Title = {如何在LaTeX写作中管理参考文献?}, + Date = {2016-08-12}, + Url = {http://www.latexstudio.net/archives/7131} +} + +@Online{Allianceurlonly, + Url = {www.wimedia.org} +} + +@Online{olnoauthoren, + Title = {Dublin Core metadata element set: version 1.1}, + Url = {http://dublincore.org}, + Urldate = {2014-06-11}, + Year = {2012-06-14} +} + +@Article{王临慧2010-147, + author = {王临慧 and others}, + title = {天津方言的源流关系刍议}, + journal = {山西师范大学学报(社会科学版)}, + year = {2010}, + volume = {37}, + number = {4}, + pages = {147}, +} + + +@InProceedings{王临慧2010-138, + author = {王临慧}, + title = {从几组声母的演变看天津方言形成的自然条件和历史条件}, + bookauthor= {曹志耘}, + booktitle = {汉语方言的地理语言学研究:首届中国地理语言学国际学术研讨会论文集}, + year = {2010}, + publisher = {北京语言大学出版社}, + pages = {138}, + address = {北京}, +} + +@Book{王夫之1845--, + Title = {宋论}, + Author = {王夫之}, + Edition = {刻本}, + Publisher = {曾氏}, + Year = {1845(清同治四年)}, + Location = {金陵} +} + +@Book{汪昂1881--, + Title = {增订本草备要:四卷}, + Address = {京都}, + Author = {汪昂}, + Edition = {刻本}, + Publisher = {老二酉堂}, + Year = {1881(清光绪七年)}, + Location = {京都} +} + +@Periodical{AAAS1883--, + Title = {Science}, + Date = {1883}, + Editor = {{American Association for the Advancement of Science}}, + Number = {1}, + Volume = {1}, + Location = {Washington, D.C.}, + Publisher = {American Association for the Advancement of Science} +} + +@Book{汪昂1912--, + Title = {(增补)本草备要}, + Author = {汪昂}, + Edition = {石印本}, + Publisher = {同文书局}, + Year = {1912}, + Location = {上海} +} + +@Periodical{中国地质学会1936--, + Title = {地质评论}, + Date = {1936}, + Editor = {中国地质学会}, + Number = {1}, + Volume = {1}, + Location = {北京}, + Publisher = {地质出版社} +} + + +@Book{1962-50-50, + Title = {康熙字典:已集上:水部}, + Address = {北京}, + Edition = {同文书局影印本}, + Pages = {50}, + Publisher = {中华书局}, + Year = {1962} +} + +@Proceedings{ROSENTHALL1963--, + Title = {Proceedings of the Fifth Canadian Mathematical Congress, University of Montreal, 1961}, + Date = {1963}, + Publisher = {University of Toronto Press}, + Editor = {E M ROSENTHALL}, + Location = {Toronto} +} + +@Thesis{CALMS1965--, + Title = {Infrared spectroscopic studies on solid oxygen}, + Author = {R B CALMS}, + Date = {1965}, + Institution = {Univ. of California}, + Location = {Berkeley} +} + +@Report{WHO1970--, + Title = {Factors regulating the immune response}, + Author = {{World Health Organization}}, + Date = {1970}, + Institution = {WHO}, + Location = {Geneva}, + Titleaddon = {report of WHO Scientific Group} +} + +@Inproceedings{FOURNEY1971-17-38, + Title = {Advances in holographic photoelasticity}, + Author = {M E FOURNEY}, + Booktitle = {Symposium on Applications of Holography in Mechanics, August 23-25, 1971, University of Southern California, Los Angeles, California}, + year = {c1971}, + Pages = {17-38}, + Publisher = {ASME}, + Location = {New York} +} + +@Inproceedings{FOURNEY1971-17-38a, + Title = {Advances in holographic photoelasticity}, + Author = {M E FOURNEY}, + Bookauthor = {{American Society of Mechanical Engineers.Applied Mechanics Division}}, + Booktitle = {Symposium on Applications of Holography in Mechanics, August 23-25, 1971. University of Southern California, Los Angeles, California}, + Date = {1971}, + Pages = {17-38}, + Publisher = {ASME}, + Location = {New York} +} + +@TechReport{Humphrey1971--, + Title = {The sonic throat method and real gas one-dimensional flow: an application to air and nitrogen}, + Author = {Humphrey, Richard L. and Wagner, Jerry L.}, + Year = {1971}, + Number = {730029}, + Type = {AD} +} + +@Book{CRANE1972--, + Title = {Invisible college}, + Author = {D. Crane}, + Date = {1972}, + Publisher = {Univ. of Chicago Press}, + Location = {Chicago} +} + + + +@Article{KENNEDY1975-311-386, + Title = {Morphology and genesis of nodular chalks and hardgrounds in the Upper + Cretacesous of southern England}, + Author = {W. J. KENNEDY and R. E. GARRISON}, + Date = {1975}, + Journaltitle = {Sedimentology}, + Pages = {311-386}, + Volume = {22} +} + +@Article{KENNEDY1975-339-360, + Title = {Morphology and genesis of nodular phosphates in the cenomanian of South-east England}, + Author = {W. J. KENNEDY and R. E. GARRISON}, + Date = {1975}, + Journaltitle = {Lethaia}, + Pages = {339-360}, + Volume = {8} +} + +@Inbook{1977-49-49, + Title = {宋史卷三:本纪第三}, + Address = {北京}, + Booktitle = {宋史:第1册}, + Pages = {49}, + Publisher = {中华书局}, + Year = {1977} +} + +@Book{IFLAI1977--, + Title = {Names of persons: national usages for entry in catalogues}, + Author = {{International Federation of Library Association and Institutions}}, + Edition = {3}, + Publisher = {IFLA International Office for UBC}, + Year = {1977}, + Location = {London} +} + + +@InProceedings{张忠智1997-33-34, + author = {张忠智}, + title = {科技书刊的总编(主编)的角色要求}, + booktitle = {中国科学技术期刊编辑学会建会十周年学术研讨会论文汇编}, + year = {1997}, + editor = {中国科学技术期刊编辑学会}, + publisher = {中国科学技术期刊编辑学会学术委员会}, + pages = {33--34}, + address = {北京}, +} + +@Book{中国社会科学院语言研究所词典编辑室1996--, + author = {中国社会科学院语言研究所词典编辑室}, + title = {现代汉语词典}, + year = {1996}, + edition = {修订本}, + publisher = {商务印书馆}, + address = {北京}, +} + + +@Article{刘彻东1998-38-39, + Title = {中国的青年刊物}, + Author = {刘彻东}, + Date = {1998}, + Journaltitle = {中国出版}, + Number = {5}, + Pages = {38-39}, + Titleaddon = {个性特色为本} +} + +@InProceedings{裴丽生1981-2-10, + author = {裴丽生}, + title = {在中国科协学术期刊编辑工作经验交流会上的讲话}, + booktitle = {中国科协学术期刊编辑工作经验交流会资料选}, + year = {1981}, + editor = {中国科学技术协会}, + publisher = {中国科学技术协会学会工作部}, + pages = {2--10}, + address = {北京}, +} + + +@Article{亚洲地质图编目组1978-194-208, + Title = {亚洲地层与地质历史概述}, + Author = {亚洲地质图编目组}, + Date = {1978}, + Journaltitle = {地质学报}, + Pages = {194-208}, + Volume = {3} +} + +@Inbook{BUSECK1980-117-211, + Title = {Subsolidus phenomena in pyroxenes}, + Author = {P R BUSECK and NORD, Jr., G L and D R VEBLEN}, + Bookauthor = {CT PREWITT}, + Booktitle = {Pyroxense}, + year = {c1980}, + Pages = {117-211}, + Publisher = {Mineralogical Society of America}, + Location = {Washington, D.C.} +} + +@Inbook{陈晋镳1980-56-114, + Title = {蓟县震旦亚界研究}, + Author = {陈晋镳 and 张惠民 and 朱士兴 and others}, + Bookauthor = {中国地质科学院天津地质矿产研究所}, + Booktitle = {中国震旦亚界}, + Pages = {56-114}, + Publisher = {天津科学出版社}, + Location = {天津}, + Year = {1980} +} + +@Article{Sunstein1996-903-903, + author = {Sunstein, Cass R.}, + title = {Social Norms and Social Roles}, + journal = {Columbia law review}, + year = {1996}, + volume = {96}, + pages = {903}, + url = {http://www.heinonline.org/HOL/Page?handle=hein.journals/clr96&id=913&collection=journals&index=journals/clr}, + urldate = {2012-01-26}, +} + +@Book{罗杰斯2011-15-16, + author = {罗杰斯}, + title = {西方文明史: 问题与源头}, + year = {2011}, + translator = {潘惠霞 and 魏婧 and 杨艳 and others}, + publisher = {东北财经大学出版社}, + pages = {15--16}, + address = {大连}, +} + +@Book{陈登原2000-29-29, + author = {陈登原}, + title = {国史旧闻: 第1卷}, + year = {2000}, + publisher = {中华书局}, + pages = {29}, + address = {北京}, +} + +@Book{哈里森沃尔德伦2012-235-236, + author = {哈里森·沃尔德伦}, + title = {经济数学与金融数学}, + year = {2012}, + translator = {谢远涛}, + publisher = {中国人民大学出版社}, + pages = {235--236}, + address = {北京}, +} + +@Book{北京市政协民族和宗教委员会2012-112-112, + author = {北京市政协民族和宗教委员会 and 北京联合大学民族与宗教研究所}, + title = {历代王朝与民族宗教}, + year = {2012}, + publisher = {民族出版社}, + pages = {112}, + address = {北京}, +} + + +@Book{徐光宪2010--, + author = {徐光宪 and 王祥云}, + title = {物质结构}, + year = {2010}, + publisher = {科学出版社}, + address = {北京}, +} + +@Book{顾炎武1992--, + author = {顾炎武}, + title = {昌平山水记:京东考古录}, + year = {1992}, + publisher = {北京古籍出版社}, + address = {北京}, +} + +@Book{王夫之1865--, + author = {王夫之}, + title = {宋论}, + year = {1865(清同治四年)}, + edition = {刻本}, + publisher = {湘乡曾国荃}, + address = {金陵}, +} + +@Proceedings{牛志明2012--, + title = {综合湿地管理国际研讨会论文集}, + year = {2012}, + editor = {牛志明 and 斯温兰德 and 雷光春}, + publisher = {海洋出版社}, + address = {北京}, +} + +@Archive{中国第一历史档案馆2001--, + author = {中国第一历史档案馆 and 辽宁省档案馆}, + title = {中国明朝档案总汇}, + year = {2001}, + address = {桂林}, + publisher = {广西师范大学出版社}, +} + +@PhdThesis{杨保军2012--, + author = {杨保军}, + title = {新闻道德论}, + year = {2010}, + url = {http://apabi.lib.pku.edu.cn/usp/pku/pub.mvc?pid=book.detail&metaid=m.20101104-BPO-889-1023&cult=CN}, + urldate = {2012-11-01}, + address = {北京}, + publisher = {中国人民大学出版社}, +} + +@Book{赵学功2001--, + author = {赵学功}, + title = {当代美国外交}, + year = {2001}, + publisher = {社会科学文献出版社}, + url = {http://www.cadal.zju.edu.cn/book/trySinglePage/33023884/1}, + urldate = {2014-06-11}, + address = {北京}, +} + +@Book{同济大学土木工程防灾国家重点实验室2011-5-6, + author = {同济大学土木工程防灾国家重点实验室}, + title = {汶川地震灾害研究}, + year = {2011}, + publisher = {同济大学出版社}, + pages = {5--6}, + url = {http://apabi.lib.pku.edu.cn/usp/pku/pub.mvc?pid=book.detail&metaid=m.20120406-YPT-889-0010}, + urldate = {2013-05-09}, + address = {上海}, +} + +@Book{中国造纸学会2003--, + author = {中国造纸学会}, + title = {中国造纸年鉴: 2003}, + year = {2003}, + publisher = {中国轻工业出版社}, + url = {http://www.cadal.zju.edu.cn/book/view/25010080}, + urldate = {2014-04-25}, + address = {北京}, +} + + +@Proceedings{Yufin2000--, + title = {Geoecology and computers: proceedings of the {Third International Conference on Advances of Computer Methods in Geotechnical and Geoenvironmental Engineering, Moscow, Russia, February 1--4, 2000}}, + year = {2000}, + editor = {Yufin, Sergey A}, + publisher = {A. A. Balkema}, + address = {Rotterdam}, +} + +@Book{Baldock2011-105-105, + author = {Baldock, Peter}, + title = {Developing early childhood services: past, present and future}, + year = {2011}, + publisher = {Open University Press}, + pages = {105}, + url = {http://lib.myilibrary.com/Open.aspx?id=312377}, + urldate = {2012-11-27}, +} + +@Book{Fan2013-25-26, + author = {Fan, Xuetong and Sommers, Christopher H.}, + title = {Food irradiation research and technology}, + year = {2013}, + edition = {2}, + publisher = {Blackwell Publishing}, + pages = {25--26}, + url = {http://onlinelibrary.wiley.com/doi/10.1002/9781118422557.ch2/summary}, + urldate = {2014-06-26}, + address = {Ames, Iowa}, +} + + +@Inbook{王夫之2011-1109-1109, + title = {周易外传:卷 5}, + booktitle = {船山全书}, + year = {2011}, + editor = {王夫之}, + number = {6}, + publisher = {岳麓书社}, + pages = {1109}, + address = {长沙}, +} + +@Inbook{程根伟1999-32-36, + author = {程根伟}, + title = {1998 年长江洪水的成因与减灾对策}, + booktitle = {长江流域洪涝灾害与科技对策}, + year = {1999}, + editor = {许厚泽 and 赵其国}, + publisher = {科学出版社}, + pages = {32--36}, + address = {北京}, +} + +@Inbook{陈晋镳1980-56-114a, + author = {陈晋镳 and 张惠民 and 朱士兴 and 赵震 and 王振刚}, + title = {蓟县震旦亚界研究}, + booktitle = {中国震旦亚界}, + year = {1980}, + editor = {中国地质科学院天津地质矿产研究所}, + publisher = {天津科学技术出版社}, + pages = {56--114}, + address = {天津}, +} + +@Inbook{马克思2013-302-302, + author = {马克思}, + title = {政治经济学批判}, + booktitle = {马克思恩格斯全集}, + year = {2013}, + editor = {马克思 and 恩格斯}, + volume = {35}, + publisher = {人民出版社}, + pages = {302}, + address = {北京}, +} + + + + + +@InProceedings{贾东琴2011-45-52, + author = {贾东琴 and 柯平}, + title = {面向数字素养的高校图书馆数字服务体系研究}, + booktitle = {中国图书馆学会年会论文集: 2011年卷}, + year = {2011}, + editor = {中国图书馆学会}, + publisher = {国家图书馆出版社}, + pages = {45--52}, + address = {北京}, +} + +@Inbook{Weinstein1974-745-772, + author = {Weinstein, L and Swertz, M N}, + title = {Pathogenic properties of invading microorganism}, + booktitle = {Pathologic physiology: mechanisms of disease}, + year = {1974}, + editor = {Sodeman, Jr., William A and Sodeman, William A}, + publisher = {Saunders}, + pages = {745--772}, + address = {Philadelphia}, +} + +@InBOOK{Roberson2011-1-36, + author = {Roberson, J. Alan and Burneson, Eric G.}, + title = {Drinking water standards, regulations and goals}, + booktitle = {Water quality \& treatment: a handbook on drinking water}, + year = {2011}, + editor = {{American Water Works Association}}, + edition = {6}, + publisher = {McGraw-Hill}, + pages = {1.1--1.36}, + url = {http://lib.myilibrary.com/Open.aspx?id=291430}, + urldate = {2012-12-10}, + address = {New York}, +} + +@Periodical{中华医学会湖北分会1984----, + title = {临床内科杂志}, + year = {1984}, + volume = {1}, + number = {1}, + address = {武汉}, + author = {中华医学会湖北分会}, + publisher = {中华医学会湖北分会}, +} + +@Periodical{中国图书馆学会1957--1990--, + title = {图书馆学通讯}, + year = {1957/1990}, + number = {1-4}, + address = {北京}, + author = {中国图书馆学会}, + publisher = {北京图书馆}, +} + +@Periodical{中国图书馆学会1957--, + Title = {图书馆学通信}, + Address = {北京}, + Date = {1957/1990}, + Editor = {中国图书馆学会}, + Institution = {北京图书馆}, + Number = {1-4} +} + +@Periodical{中国图书馆学会1957a--, + Title = {图书馆学通信}, + Date = {1957/1990}, + Editor = {中国图书馆学会}, + Institution = {北京图书馆}, + Number = {1-4} +} + +@Periodical{中国图书馆学会1957b--, + Title = {图书馆学通信}, + Address = {北京}, + Date = {1957/1990}, + Editor = {中国图书馆学会}, + Number = {1-4} +} + +@Periodical{中国图书馆学会1957c--, + Title = {图书馆学通信}, + Date = {1957/1990}, + Editor = {中国图书馆学会}, + Number = {1-4} +} + +@Periodical{AAAS1883----, + title = {Science}, + year = {1883}, + volume = {1}, + number = {1}, + address = {Washington, D.C.}, + author = {{American Association for the Advancement of Science}}, + publisher = {American Association for the Advancement of Science}, +} + + +@Article{袁训来2012-3219-3219, + author = {袁训来 and 陈哲 and 肖书海 and others}, + title = {蓝田生物群: 一个认识多细胞生物起源和早期演化的新窗口}, + journal = {科学通报}, + year = {2012}, + volume = {55}, + number = {34}, + pages = {3219}, +} + +@Newspaper{余建斌2013--, + author = {余建斌}, + date = {2013-01-12}, + journal = {人民日报}, + number = {2}, + title = {我们的科技一直在追赶: 访中国工程院院长周济}, + url = {http://paper.people.com.cn/rmrb/html/2013-01/12/nw.D110000renmrb_20130112_5-02.htm}, + urldate = {2013-03-20}, + year = {2013}, +} + +@Article{李炳穆2008-6-12, + author = {李炳穆}, + title = {韩国图书馆法}, + journal = {图书情报工作}, + year = {2008}, + volume = {52}, + number = {6}, + pages = {6--12}, + url = {http://www.docin.com/p-400265742.html}, + urldate = {2013-10-25}, +} + +@Article{李幼平2010-225-228, + author = {李幼平 and 王莉}, + title = {循证医学研究方法: 附视频}, + journal = {中华移植杂志(电子版)}, + year = {2010}, + volume = {4}, + number = {3}, + pages = {225--228}, + url = {http://www.cqvip.com/Read/Read.aspx?id=36658332}, + urldate = {2014-06-09}, +} + +@Article{武丽丽2008-8-9, + author = {武丽丽 and 华一新 and 张亚军 and others}, + title = {“北斗一号”监控管理网设计与实现}, + journal = {测绘科学}, + year = {2008}, + volume = {33}, + number = {5}, + pages = {8--9}, + doi = {10.3771/j.issn.1009-2307.2008.05.002}, + url = {http://vip.calis.edu.cn/CSTJ/Sear.dll?OPAC_CreateDetail}, + urldate = {2009-10-25}, +} + +@Article{Kanamori1998-2063-2063, + author = {Kanamori, H}, + title = {Shaking without quaking}, + journal = {Science}, + year = {1998}, + volume = {279}, + number = {5359}, + pages = {2063}, +} + +@Article{Caplan1993-61-66, + author = {Caplan, P}, + title = {Cataloging internet resources}, + journal = {The public access computer systems review}, + year = {1993}, + volume = {4}, + number = {2}, + pages = {61--66}, +} + +@Article{Frese2013-378-398, + author = {Frese, Karen S. and Katus, Hugo A. and Meder, Benjamin}, + title = {Next-generation sequencing: from understanding biology to personalized medicine}, + journal = {Biology}, + year = {2013}, + volume = {2}, + number = {1}, + pages = {378--398}, + doi = {10.3390/biology2010378}, + url = {http://www.mdpi.com/2079-7737/2/1/378}, + urldate = {2013-03-19}, +} + +@Article{Myburg2014-356-362, + author = {Myburg, Alexander A. and Grattapaglia, Dario and Tuskan, Gerald A. and others}, + title = {The genome of Eucalyptus grandis}, + journal = {Nature}, + year = {2014}, + date = {2014-06-19}, + volume = {510}, + pages = {356--362}, + doi = {10.1038/nature13308}, + url = {http://www.nature.com/nature/journal/v510/n7505/pdf/nature13308.pdf}, + urldate = {2014-06-25}, +} + +@Patent{邓一刚2006--, + author = {邓一刚}, + title = {全智能节电器}, + number = {200610171314.3}, + year = {2006}, + date = {2006-12-13}, +} + +@Patent{西安电子科技大学2002--, + author = {西安电子科技大学}, + title = {光折变自适应光外差探测方法}, + number = {01128777.2}, + year = {2002}, + date = {2002-03-06}, + url = {http://211.152.9.47/sipoasp/zljs/hyjs-yx-new.asp?recid=01128777.2&leixin=0}, + urldate = {2002-05-28}, +} + +@Patent{Tachibana2005--, + author = {Tachibana, Ryuki and Shimizu, Shuhichi and Kobayshi, Seiji and Nakamura, Taiga}, + title = {Electronic watermarking method and system}, + number = {US6915001}, + year = {2005}, + date = {2005-07-05}, + url = {http://www.google.co.in/patents/US6915001}, + urldate = {2013-11-11}, +} + +@TechReport{中国互联网络信息中心2012--, + author = {中国互联网络信息中心}, + title = {第 29 次中国互联网络发展现状统计报告}, + year = {2012}, + date = {2012-01-16}, + url = {http://www.cnnic.net.cn/hlwfzyj/hlwxzbg/201201/P020120709345264469680}, + urldate = {2013-03-26}, +} + +@Archive{北京市人民政府办公厅2005--, + author = {北京市人民政府办公厅}, + title = {关于转发北京市企业投资项目核准暂行实施办法的通知: 京政办发[2005]37号}, + year = {2005}, + date = {2005-07-12}, + url = {http://china.findlaw.cn/fagui/p_1/39934.html}, + urldate = {2011-07-12}, +} + +@Online{Bawden2008--, + author = {Bawden, D}, + title = {Origins and Concepts of Digital Literacy}, + date = {2008-05-04}, + url = {http://www.soi.city.ac.uk/~dbawden/digital%20literacy%20chapter.pdf}, + urldate = {2013-03-08}, + year = {2008}, +} + +@Online{OCLC--, + author = {{Online Computer Library Center, Inc}}, + title = {About {OCLC}: History of Cooperation}, + url = {http://www.oclc.org/about/cooperation.en.html}, + urldate = {2012-03-27}, +} + +@Online{Hopkinson2009--, + author = {Hopkinson, A}, + title = {{UNIMARC} and Metadata: Dublin Core}, + date = {2009-04-22}, + url = {http://archive.ifla.org/IV/ifla64/138-161e.htm}, + urldate = {2013-03-27}, + year = {2009}, +} + +@PhdThesis{刘乃安2000-17-18a, + author = {刘乃安}, + title = {生物质材料热解失重动力学及其分析方法研究}, + year = {2000}, + pages = {17--18}, + doi = {10.7666/d.y351065}, + url = {http://wenku.baidu.com/link?url=GJDJxb4lxBUXnIPmq1XoEGSIr1H8TMLbidW_LjlYu33tpt707u62rKliypU_FBGUmox7ovPNaVIVBALAMd5yfwuKUUOAGYuB7cuZ-BYEhXa}, + urldate = {2014-08-29}, + address = {安徽}, + school = {中国科学技术大学}, +} + +@PhdThesis{Deverell2013-21-22a, + author = {Deverell, William and Igler, David}, + title = {A Companion to {California} History}, + year = {2013}, + date = {2013-11-15}, + pages = {21--22}, + doi = {10.1002/9781444305036.ch2}, + url = {http://onlinelibrary.wiley.com/doi/10.1002/9781444305036.ch2/summary}, + urldate = {2014-06-24}, + address = {New York}, + school = {John Wiley \& Sons}, +} + +@Book{Morri2010--, + author = {Morri, I}, + title = {Why the West Rules for Now: the Patterns of History, and What They Reveal about the Future}, + year = {2010}, + publisher = {{Farrar, Straus and Giroux}}, + address = {New York}, +} + + +@Article{STIEG1981-549-560, + Title = {The information needs of historians}, + Author = {M. F. STIEG}, + Date = {1981}, + Journaltitle = {College and Research Libraries}, + Number = {6}, + Pages = {549-560}, + Volume = {42} +} + + + +@Article{Milstein1982-436-446, + Title = {The effect of multiple-tone interfering signals on a direct sequence spread spectrum communication system}, + Author = {Milstein, L. B. and Davidovici,S. and Schilling,D. L.}, + Journal = {IEEE Trans. Commun.}, + Number = {3}, + Pages = {436-446}, + Volume = {30}, + Year = {1982} +} + +@Book{顾炎武1982--, + Title = {昌平山水记}, + Author = {顾炎武}, + Publisher = {北京古籍出版社}, + Year = {1982}, + Location = {北京}, + Titleaddon = {东京考古录} +} + +@Inbook{马克思1982-505-505, + Title = {关于《工资、价格和利润》的报告札记}, + Author = {马克思}, + Bookauthor = {马克思 and 恩格斯}, + Booktitle = {马克思恩格斯全集}, + Pages = {505}, + Publisher = {人民出版社}, + Booktitleaddon = {第44卷}, + Location = {北京}, + Year = {1982} +} + +@Article{HEWITT1984-205-218, + Title = {Technical services in 1983}, + Author = {J A HEWITT}, + Date = {1984}, + Journaltitle = {Library Resource Services}, + Number = {3}, + Pages = {205-218}, + Volume = {28} +} + +@Article{McEliece1984-44-53, + Title = {Channels with block interference}, + Author = {McEliece, R. J. and Stark, W. E.}, + Journal = {IEEE Trans. Inf. Theory}, + Number = {1}, + Pages = {44-53}, + Volume = {30}, + Year = {1984} +} + +@Article{陶仁骥1984-527-527, + Title = {密码学与数学}, + Author = {陶仁骥}, + Date = {1984}, + Journaltitle = {自然杂志}, + Number = {7}, + Pages = {527}, + Volume = {7} +} + +@Periodical{中华医学会湖北分会1984--, + Title = {临床内科杂志}, + Address = {武汉}, + Date = {1984}, + Editor = {中华医学会湖北分会}, + Institution = {中华医学会湖北分会}, + Number = {1}, + Volume = {1} +} + +@Incollection{韩吉人1985-90-99, + Title = {论职工教育的特点}, + Author = {韩吉人}, + Booktitle = {职工教育研究论文集}, + Date = {1985}, + Publisher = {人民教育出版社}, + Pages = {90-99}, + Bookauthor = {中国职工教育研究会}, + Location = {北京} +} + +@Collection{中国职工教育研究会1985--, + Title = {职工教育研究论文集}, + Author = {中国职工教育研究会}, + Location = {北京}, + Publisher = {人民教育出版社}, + Year = {1985} +} + +@Standard{全国文献工作标准化委员会第七分委员会1986--, + Title = {GB/T 5795--1986 中国标准书号}, + Author = {全国文献工作标准化委员会第七分委员会}, + Note = {standard}, + Year = {1986}, + Location = {北京}, + Publisher = {中国标准出版社} +} + +@Inbook{1988-590-590, + Title = {卷39 乞致任第一}, + Address = {北京}, + Booktitle = {苏魏公文集:下册}, + Pages = {590}, + Publisher = {中华书局}, + Year = {1988} +} + + + +@Standard{国家标准局信息分类编码研究所1988-59-92, + Title = {世界各国和地区名称代码 GB/T 2659-1986}, + Author = {国家标准局信息分类编码研究所}, + Date = {1988}, + Note = {standard}, + Bookauthor = {全国文献工作标准化技术委员会}, + Booktitle = {文献工作国家标准汇编}, + Booktitleaddon = {3}, + Location = {北京}, + Pages = {59-92}, + Publisher = {中国标准出版社} +} + +@Online{1989--, + Title = {PACS-L:the public-access computer systems forum}, + Date = {1989}, + Publisher = {Tex: University of Houston Libraries}, + Url = {http://info.lib.uh.edu/pacsl.html}, + Urldate = {1995-05-17}, + Location = {Houston} +} + +@Patent{姜锡洲1989--, + Title = {一种温热外敷药制备方案}, + Author = {姜锡洲}, + Date = {1989-07-26}, + Number = {88105607.3}, + Titleaddon = {中国} +} + +@Report{DTFHA1990--, + Title = {Guidelines for handling excavated acid-producing materials: PB 91-194001}, + Author = {{U.S. Department of Transportation Federal Highway Administration}}, + Institution = {U.S. Department of Commerce National Information Service}, + Location = {Springfield}, + Year = {1990} +} + +@Book{PIGGOT1990--, + Title = {The cataloguer's way through AACR2: from document receipt to document retrieval}, + Author = {T. M. PIGGOT}, + Publisher = {The Library Association}, + Year = {1990}, + Location = {London} +} + +@Article{DESMARAIS1992-605-609, + Title = {Carbon isotope evidence for the stepwise oxidation of the Proterozoic environment}, + Author = {DES MARAIS, D J and H STRAUSS and R E SUMMONS and others}, + Date = {1992}, + Journaltitle = {Nature}, + Pages = {605-609}, + Volume = {359} +} + +@Article{Holtzman1992-243-247, + Title = {On using perturbation analysis to do sensitivity analysis: derivatives versus differences}, + Author = {Holtzman, J. M.}, + Journal = {IEEE Trans. Autom. Control}, + Number = {2}, + Pages = {243-247}, + Volume = {37}, + Year = {1992} +} + +@Article{CAPLAN1993-61-66a, + Title = {Cataloging internet resources}, + Author = {P CAPLAN}, + Date = {1993}, + Journaltitle = {The public Access Computer Systems Review}, + Number = {2}, + Pages = {61-66}, + Volume = {4} +} + +@Book{广西壮族自治区林业厅1993--, + Title = {广西自然保护区}, + Author = {广西壮族自治区林业厅}, + Date = {1993}, + Publisher = {中国林业出版社}, + Location = {北京} +} + +@Patent{刘加林1993--, + Title = {多功能一次性压舌板}, + Author = {刘加林}, + Date = {1993-04-14}, + Number = {92214985.2}, + Location = {中国} +} + +@Book{OBRIEN1994--, + Title = {Introduction to information systems}, + Author = {J A O'BRIEN}, + Date = {1994}, + Edition = {7}, + Publisher = {Irwin}, + Location = {Burr Ridge, III} +} + +@Book{辛希孟1994--, + Title = {信息技术与信息服务国际研讨会论文集}, + Author = {辛希孟}, + Publisher = {中国社会科学出版社}, + Year = {1994}, + Location = {北京}, + Titleaddon = {A集} +} + +@Article{Andersen1995-42-49, + Title = {Propagation measurements and models for wireless communications channels}, + Author = {Andersen, J. B. and Rappaport, T. S. and Yoshida, S.}, + Journal = {IEEE Commun. Mag.}, + Number = {1}, + Pages = {42-49}, + Volume = {33}, + Year = {1995} +} + +@Book{CRAWFPRD1995--, + Title = {Future libraries: dreams, maddness, \& reality}, + Author = {W CRAWFPRD and M GORMAN}, + Date = {1995}, + Publisher = {American Library Association}, + Location = {Chicago} +} + +@Book{赵凯华1995--, + Title = {{新概念物理教程}}, + Address = {北京}, + Author = {赵凯华 and 罗蔚茵}, + Publisher = {高等教育出版社}, + Year = {1995} +} + +@Inbook{MARTIN1996-85-96, + Title = {Control of electronic resources in Australia}, + Author = {G MARTIN}, + Bookauthor = {L W PATTLE and B J COX}, + Booktitle = {Electronic resources}, + Date = {1996}, + Pages = {85-96}, + Publisher = {The Haworth Press}, + Booktitleaddon = {selection and bibliographic control}, + Location = {New York} +} + +@Book{国家环境保护局科技标准司1996-2-3, + Title = {土壤环境质量标准: GB 15616-1995}, + Address = {北京}, + Author = {国家环境保护局科技标准司}, + Note = {standard}, + Pages = {2-3}, + Publisher = {中国标准出版社}, + Url = {http://wenku.baidu.com}, + Urldate = {2013-10-14}, + Year = {1996} +} + + + +@Inbook{钟文发1996-468-471, + Title = {非线性规划在可燃毒物配置中的应用}, + Author = {钟文发}, + Bookauthor = {赵玮}, + Booktitle = {运筹学的理论和应用}, + Pages = {468-471}, + Publisher = {西安电子科技大学出版社}, + Booktitleon = {中国运筹学会第五届大会讨论文集}, + Location = {西安}, + Year = {1996} +} + +@Inproceedings{Nemec1997-209-214, + Title = {Force control of redundant robots}, + Author = {B Nemec}, + Booktitle = {Processings of Symposium on Robot Control}, + Pages = {209-214}, + Country = {Nantes France}, + Year = {1997} +} + + + +@Article{Andrisano1998-1383-1401, + Title = {Millimeter waves for short-range multimedia communication systems}, + Author = {Andrisano, O. and Tralli, V. and Verdone, R.}, + Journal = {Proc. IEEE}, + Number = {7}, + Pages = {1383-1401}, + Volume = {86}, + Year = {1998} +} + +@Article{Chiani1998-2998-3008, + Title = {Error probability for block codes over channels with block interference}, + Author = {Chiani, M.}, + Journal = {IEEE Trans. Inf. Theory}, + Number = {7}, + Pages = {2998-3008}, + Volume = {44}, + Year = {1998} +} + +@Article{CHRISTINE1998-331-332, + Title = {Plant physiology:plant biology in the Genome Era}, + Author = {M CHRISTINE}, + Date = {1998}, + Journaltitle = {Science}, + Pages = {331-332}, + Volume = {281}, + Url = {http://www.sciencemag.org/cgi/collection/anatmorp}, + Urldate = {1998-09-23} +} + +@Article{KANAMORI1998-2063-2064, + Title = {Shaking without quaking}, + Author = {H KANAMORI}, + Date = {1998}, + Journaltitle = {Science}, + Number = {5359}, + Pages = {2063-2064}, + Volume = {279} +} + +@Inbook{白书农1998-146-163, + Title = {植物开花研究}, + Author = {白书农}, + Bookauthor = {李承森}, + Booktitle = {植物科学进展}, + Pages = {146-163}, + Publisher = {高等教育出版社}, + Location = {北京}, + Year = {1998} +} + +@Book{蒋有绪1998--, + Title = {中国森林群落分类及其群落学特征 and \XeLaTeX{}}, + Address = {北京}, + Author = {蒋有绪 and 郭泉水 and 马娟 and others}, + Publisher = {科学出版社}, + Year = {1998} +} + + + +@Article{鲁明羽1998-290-295, + Title = {关于数据库系统数据词典的重要作用}, + Author = {鲁明羽 and 李纲民}, + Journal = {烟台大学学报自然科学与工程版}, + Number = {4}, + Pages = {290-295}, + Volume = {11}, + Year = {1998} +} + +@Mastersthesis{张志祥1998--, + Title = {间断动力系统的随机扰动及其在守恒律方程中的应用}, + Author = {张志祥}, + Date = {1998}, + Institution = {北京大学数学学院}, + Location = {北京} +} + +@Book{赵耀东1998--, + Title = {新时代的工业工程师}, + Author = {赵耀东}, + Publisher = {天下文化出版社}, + Url = {http://www.ie.nthu.edu.tw/info/ie.newie.htm(Big5)}, + Urldate = {1998-09-26}, + Year = {1998}, + Location = {台北} +} + +@Article{高光明1998-60-65, + Title = {信号情报接收机的发展现状及趋势}, + Author = {高光明}, + Journal = {电讯技术}, + Number = {2}, + Pages = {60-65}, + Volume = {38}, + Month = {4}, + Year = {1998} +} + +@Article{Dardari1999-1709-1721, + Title = {High-speed indoor wireless communications at 60 GHz with coded OFDM}, + Author = {Dardari, D. and Tralli,V.}, + Journal = {IEEE Trans. Commun.}, + Number = {11}, + Pages = {1709-1721}, + Volume = {47}, + Year = {1999} +} + +@InBook{程根伟1999-32-36a, + author = {程根伟}, + title = {1998年长江洪水的成因与减灾对策}, + booktitle = {长江流域洪涝灾害与科技对策}, + year = {1999}, + bookauthor = {许厚泽 and 赵其国}, + publisher = {科学出版社}, + location = {北京}, + pages = {32-36}, +} + +@Article{江向东1999-4-4, + Title = {互联网环境下的信息处理与图书管理系统解决方案}, + Author = {江向东}, + Date = {1999}, + Journaltitle = {情报学报}, + Number = {2}, + Pages = {4}, + Volume = {18}, + Url = {http://www.chinainfo.gov.cn/periodical/qbxb/qbxb99/qbxb990203}, + Urldate = {2000-01-18} +} + +@Article{李晓东1999-101-106, + Title = {气候学研究的若干理论问题}, + Author = {李晓东 and 张庆红 and 叶瑾琳}, + Date = {1999}, + Journaltitle = {北京大学学报}, + Number = {1}, + Pages = {101-106}, + Volume = {35}, + Journaltitleaddon = {自然科学版} +} + +@Article{梁振兴1999-24-32, + Title = {美军一体化{C\textsuperscript{4}ISR}系统的发展研究}, + Author = {梁振兴}, + Journal = {电子展望与决策}, + Pages = {24-32}, + Year = {1999} +} + +@Article{刘武1999-2481-2488, + Title = {元谋人牙齿测量数据的统计分析及其在分类研究上的意义}, + Author = {刘武 and 郑良 and 姜础}, + Date = {1999}, + Journaltitle = {科学通报}, + Number = {23}, + Pages = {2481-2488}, + Volume = {44} +} + +@Article{莫少强1999-1-6, + Title = {数字式中文全球文献格式的设计与研究}, + Author = {莫少强}, + Date = {1999}, + Journaltitle = {情报学报}, + Number = {4}, + Pages = {1-6}, + Volume = {18}, + Url = {http://periodical.wanfangdata.com.cn/periodical/qbxb/qbxb99/qbxb9904/990407.htm}, + Urldate = {2001-07-08} +} + +@Book{唐绪军1999-117-121, + Title = {报业经济与报业经营}, + Author = {唐绪军}, + Date = {1999}, + Pages = {117-121}, + Publisher = {新华出版社}, + Location = {北京} +} + +@Proceedings{中国力学学会1999--, + Title = {第3届全国实验流体力学学术会议论文集}, + Address = {天津}, + Year = {1999}, + Editor = {中国力学学会} +} + +@Article{杨友烈1999-60-65, + Title = {DII COE的基本概念和技术特征}, + Author = {杨友烈}, + Journal = {军事通信技术}, + Pages = {60-65}, + Volume = {72}, + Month = {12}, + Year = {1999} +} + +@Proceedings{GANZHA2000--, + Title = {Computer algebra in scientific computing:CASC 2000:proceedings of the Third +Workshop on Computer Algebra in Scientific Computing, Samarkand, October 5-9, 2000}, + Date = {2000}, + Publisher = {Springer}, + Editor = {V G GANZHA and E W MAYR and E V VOROZHTSOV}, + Location = {Berlin} +} + +@Book{Gradshteyn2000--, + Title = {Tables of Integrals, Series, and Products}, + Address = {San Diego}, + Author = {Gradshteyn, I. S. and Ryzhik,I. M.}, + Edition = {Sixth Edition}, + Publisher = {CA: Academic Press, Inc.}, + Year = {2000} +} + +@Book{Parsons2000--, + Title = {The Mobile Radio Propagation Channel}, + Address = {Hoboken}, + Author = {Parsons, J. D.}, + Edition = {2}, + Publisher = {John Wiley and Sons}, + Year = {2000} +} + +@Book{Parsons2000a--, + Title = {The Mobile Radio Propagation Channel}, + Address = {Hoboken}, + Author = {PARSONS}, + Edition = {2}, + Publisher = {John Wiley and Sons}, + Year = {2000} +} + +@Book{Parsons2000b--, + Title = {The Mobile Radio Propagation Channel}, + Address = {Hoboken}, + Author = {Parsons}, + Edition = {2}, + Publisher = {John Wiley and Sons}, + Year = {2000} +} + +@Book{Parsons2000noauthor--, + Title = {The Mobile Radio Propagation Channel}, + Address = {Hoboken}, + Edition = {2}, + Publisher = {John Wiley and Sons}, + Year = {2000} +} + +@Book{Parsons2000noloc--, + Title = {The Mobile Radio Propagation Channel}, + Author = {Parsons, J. D.}, + Edition = {2}, + Publisher = {John Wiley and Sons}, + Year = {2000} +} + +@Book{Parsons2000nopub--, + Title = {The Mobile Radio Propagation Channel}, + Address = {Hoboken}, + Author = {Parsons, J. D.}, + Edition = {2}, + Year = {2000} +} + +@Book{Parsons2000nopubpages--, + Title = {The Mobile Radio Propagation Channel}, + Address = {Hoboken}, + Author = {Parsons, J. D.}, + Edition = {2}, + Pages = {15-20}, + Year = {2000} +} + +@Book{YUFIN2000--a, + Title = {Geoecology and computers}, + Author = {S. A. YUFIN}, + Publisher = {A. A. Balkema}, + Year = {2000}, + Location = {Rotterdam}, + Titleaddon = {proceedings of the Third International Conference on Advances of + Computer Methods in Geotechnical and Geoenvironmental + Engineering, Moscow, Russia, February 1-4, 2000} +} + +@Article{李炳穆2000-5-8, + Title = {理想的图书管理员和信息专家的素养与形象}, + Author = {李炳穆}, + Date = {2000}, + Journaltitle = {图书情报工作}, + Number = {2}, + Pages = {5-8} +} + +@Book{孙玉文2000--, + Title = {汉语变调构词研究}, + Author = {孙玉文}, + Publisher = {北京大学出版社}, + Year = {2000}, + Location = {北京} +} + +@Article{傅刚2000--, + Title = {大风沙过后的思考}, + Author = {傅刚 and 赵承 and 李佳路}, + Date = {2000-04-12}, + Journaltitle = {北京青年报}, + Note = {news}, + Url = {http://www.bjyouth.com.cn/Bqb/20000412/GB/4216%5ED0412B1401.htm}, + Urldate = {2005-09-28} +}% Number = {14}, + +@Newspaper{张田勤2000--, + Title = {犯罪DNA库与生命伦理学计划}, + Author = {张田勤}, + Date = {2000-11-12}, + Journaltitle = {大众科技报}, + Note = {news}, + Number = {7} +} + +@Article{丁文祥2000--, + Title = {数字革命与竞争国际化}, + Author = {丁文祥}, + Date = {2000-11-20}, + Journaltitle = {中国青年报}, + Number = {15}, + Note = {news} +} + +@Book{booknoauthor, + Title = {出版集团研究}, + Date = {2001}, + Pages = {179-193}, + Publisher = {中国书籍出版社}, + Location = {北京} +} + +@Book{booknolocation, + Title = {出版集团研究}, + Author = {余敏}, + Date = {2001}, + Pages = {179-193}, + Publisher = {中国书籍出版社} +} + +@Book{booknopages, + Title = {出版集团研究}, + Author = {余敏}, + Date = {2001}, + Publisher = {中国书籍出版社}, + Url = {www.bla~bla.org}, + Location = {北京} +} + +@Book{booknopublisher, + Title = {出版集团研究}, + Author = {余敏}, + Date = {2001}, + Location = {北京} +} + +@Book{booknopublisherpage, + Title = {出版集团研究}, + Author = {余敏}, + Date = {2001}, + Pages = {20-30}, + Location = {北京} +} + +@Article{Moeneclaey2001-497-505, + Title = {Sensitivity of multiple-access techniques to narrowband interference}, + Author = {Moeneclaey, M. and Bladel,M. V. and Sari,H.}, + Journal = {IEEE Trans. Commun.}, + Number = {3}, + Pages = {497-505}, + Volume = {49}, + Year = {2001} +} + +@Book{PEEBLES2001--, + Title = {Probability, random variable and random signal principles}, + Author = {PEEBLES, Jr., P Z}, + Edition = {4}, + Publisher = {McGraw Hill}, + Year = {2001}, + Location = {New York} +} + +@Book{Peebles2001-100-100, + Title = {Probability, random variable, and random signal Principles and \LaTeX{}}, + Address = {New York}, + Author = {von Peebles, Jr., P. Z.}, + Edition = {4}, + Pages = {100}, + Publisher = {McGraw-Hill}, + Year = {2001} +} + +@Inproceedings{Piazzo2001--, + Title = {UWB EM compatibility and coexistence issues}, + Address = {Rome, Italy}, + Author = {Piazzo, L.}, + Booktitle = {Proc. 1st Int. Workshop on Networking with UWB}, + Year = {2001} +} + +@Book{ROOD2001--, + Title = {Logic and structured design for computer programmers}, + Author = {H J ROOD}, + Date = {2001}, + Edition = {3}, + Publisher = {Brooks/Cole-Thomson Learning} +} + +@Book{Simon2001--, + Title = {Spread Spectrum Communications Handbook}, + Address = {New York City}, + Author = {Simon, M. K. and Omura,J. K. and Scholtz,R. A. and Levitt,B. K.}, + Publisher = {McGraw-Hill, Inc.}, + Year = {2001} +} + +@Book{Stueber2001--, + Title = {Principles of Mobile Communication}, + Address = {Norwell}, + Author = {Stuber, G. L.}, + Edition = {Second Edition}, + Publisher = {MA: Kluwer Academic Publishers}, + Year = {2001} +} + +@Book{余敏2001-179-193, + Title = {出版集团研究}, + Author = {余敏}, + Date = {2001}, + Pages = {179-193}, + Publisher = {中国书籍出版社}, + Location = {北京} +} + +@Book{余敏2001-179-193a, + Title = {出版集团研究}, + Author = {余敏}, + Date = {2001}, + Edition = {3}, + Pages = {179-193}, + Publisher = {中国书籍出版社}, + Location = {北京} +} + +@Book{余敏2001-179-193b, + Title = {出版集团研究}, + Author = {余敏}, + Date = {2001}, + Edition = {2}, + Pages = {179-193}, + Publisher = {中国书籍出版社}, + Location = {北京} +} + +@Book{余敏2001-179-193c, + Title = {出版集团研究}, + Author = {余敏}, + Date = {2001}, + Pages = {179-193}, + Publisher = {中国书籍出版社}, + Url = {http://www.baidu.com}, + Urldate = {2001-08-04}, + Location = {北京} +} + +@Book{赵学功2001--a, + author = {赵学功}, + title = {当代美国外交}, + year = {2001}, + publisher = {社会科学文献出版社}, + url = {http://www.baidu.com}, + urldate = {2014-06-11}, +} + +@Manual{中国第一历史档案馆2001--a, + author = {中国第一历史档案馆 and 辽宁省档案馆}, + title = {中国明朝档案总汇}, + year = {2001}, + organization = {广西师范大学出版社}, + address = {桂林}, +} + +@Article{郜宪林2001-114-116, + Title = {DII COE研究与分析}, + Author = {郜宪林}, + Journal = {计算机工程与应用}, + Number = {19}, + Pages = {114-116}, + Year = {2001} +} + +@Patent{河北绿洲生态环境科技有限公司2001--, + Title = {一种荒漠化地区生态植被综合培育种植方法}, + Author = {河北绿洲生态环境科技有限公司}, + Date = {2001-10-24}, + Number = {01129210.5}, + Url = {http://211.152.9.47/sipoasp/zlijs/hyjs-yx-new.asp?recid=01129210.5&leixin}, + Urldate = {2002-05-28} +} + +@Article{陈金成2001-1861-1864, + Title = {一种开放式体系结构经济型数控装置的研制}, + Author = {陈金成 and 杨海威 and 钟廷修}, + Journal = {上海交通大学学报}, + Number = {12}, + Pages = {1861-1864}, + Volume = {35}, + Month = {12}, + Year = {2001} +} + +@Www{萧钰2001--, + Title = {出版业信息化迈入快车道}, + Author = {萧钰}, + Url = {http://www.creader.com/news/20011219/200112190019.html}, + Urldate = {2002-04-15}, + Date = {2001-12-19} +} + +@Inproceedings{Choi2002-1075-1080, + Title = {Performance analysis of ultra-wideband spread-spectrum communications in narrowband interference}, + Address = {Anaheim, CA}, + Author = {Choi, J. D. and Stark,W. E.}, + Booktitle = {Proc. IEEE Military Commun. Conf. (MILCOM)}, + Pages = {1075-1080}, + Volume = {2}, + Year = {2002} +} + +@Inproceedings{Dardari2002-201-206, + Title = {Simple and accurate models for error probability evaluation of IEEE802.11 DS-SS physical interface in the presence of Bluetooth interference}, + Address = {Taipei}, + Author = {Dardari, D. and Pasolini,G.}, + Booktitle = {Proc. IEEE Global Telecommun. Conf. (GLOBECOM)}, + Pages = {201-206}, + Volume = {1}, + Year = {2002} +} + +@Inproceedings{Foerster2002-1931-1935, + Title = {Interference modeling of pulse-based UWB waveforms on narrowband systems}, + Address = {Birmingham, AL}, + Author = {Foerster, J. R.}, + Booktitle = {Proc. IEEE Veh. Technol. Conf.}, + Pages = {1931-1935}, + Volume = {4}, + Year = {2002} +} + +@Inproceedings{Fontana2002-309-313, + Title = {An insight into UWB interference from a shot noise perspective}, + Address = {Baltimore, MD}, + Author = {Fontana, R. J.}, + Booktitle = {Proc. of IEEE Conference on Ultrawideband Systems and Technologies (UWBST)}, + Pages = {309-313}, + Year = {2002} +} + +@Article{Haemaelaeinen2002-1712-1721, + Title = {On the UWB system coexistence with GSM900, UMTS/WCDMA, and GPS}, + Author = {Hamalainen, M. M. and Hovinen,V. and Tesi,R. and Iinatti,J. H. J. and Latvaaho, M.}, + Journal = {IEEE J. Sel. Areas Commun.}, + Number = {9}, + Pages = {1712-1721}, + Volume = {20}, + Year = {2002} +} + +@Article{Zhao2002-1684-1691, + Title = {Performance of ultra-wideband communications in the presence of interference}, + Author = {Zhao, L. and Haimovich,A. M.}, + Journal = {IEEEJ. Sel. Areas Commun.}, + Number = {9}, + Pages = {1684-1691}, + Volume = {20}, + Year = {2002} +} + +@Inproceedings{汪学军2002-22-25, + Title = {中国农业转基因生物研发进展与安全管理}, + Address = {北京}, + Author = {汪学军}, + Bookauthor = {国家环境保护总局生物安全管理办公室}, + Booktitle = {中国国家生物安全框架实施国际合作项目研讨会论文集}, + Pages = {22-25}, + Publisher = {中国环境科学出版社}, + Year = {2002} +} + +@Book{张伯伟2002--, + Title = {全唐五代诗格会考}, + Address = {南京}, + Author = {张伯伟}, + Pages = {288}, + Publisher = {江苏古籍出版社}, + Year = {2002} +} + +@Patent{西安电子科技大学2002--a, + author = {西安电子科技大学}, + title = {光折变自适应光外差探测方法}, + number = {01128777.2}, + date = {2002-03-06}, + url = {http://211.152.9.47/sipoasp/zljs/hyjs-yx-new.asp?recid=01128777.2&leixin=0}, + urldate = {2002-05-28}, +} + +@Patent{TACHIBANA2002--, + Title = {Electronic watermarking method and system}, + Author = {R TACHIBANA and S SHIMIZU and S KOBAYSHI and others}, + Date = {2002-04-25}, + Number = {US6915001}, + Url = {http://patftuspto.gov/netacgi/nph-Parser?Seetl=PTO2&Sect2=HITOFF&=1&u=/netahhml/search-bool.html&r=1&f=G&1=50&col=AND&d=ptxt&sl=`Electronic+watermarking+method+system'.TTL.&OS=TTL/}, + Urldate = {2002-05-28} +} + +@Patent{KOSEKI2002--, + Title = {Compiler}, + Author = {A KOSEKI and H MOMOSE and M KAWAHITO and others}, + Date = {2002-05-25}, + Number = {US828402}, + Url = {http://FF&p=1&u=netahtml/PTO/search-bool.html&r=5&f=G&l=50&col=AND&d=PG01&sl=IBM.AS.&0S=AN/IBM&RS=AN/IBM}, + Urldate = {2002-05-28} +} + +@Article{Chiani2003-840-845, + Title = {New exponential bounds and approximations for the computation of error probability in fading channels}, + Author = {Chiani, M. and Dardari, D. and Simon, M. K.}, + Journal = {IEEE Trans. Wireless Commun.}, + Number = {4}, + Pages = {840-845}, + Volume = {2}, + Year = {2003} +} + +@Inproceedings{Firoozbakhsh2003-473-477, + Title = {Analysis of IEEE 802.11a interference on UWB systems}, + Address = {Oulu, Finland}, + Author = {Firoozbakhsh, B. and Pratt,T. G. and Jayant,N.}, + Booktitle = {Proc. of IEEE Conference on Ultrawideband Systems and Technologies (UWBST)}, + Pages = {473-477}, + Year = {2003} +} + +@Electronic{OMG2003--, + Title = {Unified Modeling Language: Superstructure}, + Author = {{omg Inc.}}, + Url = {http://www.omg.org}, + Year = {2003} +} + +@Thesis{吴云芳2003--, + Title = {面向中文信息处理的现代汉语并列结构研究}, + Address = {北京}, + Author = {吴云芳}, + Institution = {北京大学}, + Url = {http://thesis.lib.pku.edu.cn/dlib/List.asp?lang=gb&type=Reader&DocGroupID=4&DoclD=6328}, + Urldate = {2013-10-14}, + Year = {2003} +} + +@Thesis{吴云芳2003a--, + Title = {面向中文信息处理的现代汉语并列结构研究}, + Address = {北京}, + Author = {吴云芳}, + Url = {http://thesis.lib.pku.edu.cn}, + Urldate = {2013-10-14}, + Year = {2003} +} + +@Thesis{吴云芳2003b--, + Title = {面向中文信息处理的现代汉语并列结构研究}, + Author = {吴云芳}, + Institution = {北京大学}, + Url = {http://thesis.lib.pku.edu.cn}, + Urldate = {2013-10-14}, + Year = {2003} +} + +@Thesis{吴云芳2003c--, + Title = {面向中文信息处理的现代汉语并列结构研究}, + Author = {吴云芳}, + Url = {http://thesis.lib.pku.edu.cn}, + Urldate = {2013-10-14}, + Year = {2003} +} + +@Article{Chiani2004-1312-1318, + Title = {Further results on convolutional code search for blockfading channels}, + Author = {M. Chiani and A. Conti and V. Tralli}, + Journal = {IEEE Trans. Inf. Theory}, + Number = {6}, + Pages = {1312-1318}, + Volume = {50}, + Year = {2004} +} + +@Article{Chiani2004-1312-1318a, + Title = {Further results on convolutional code search for blockfading channels-a}, + Author = {M. Chiani and A. Conti and V. Tralli}, + Pages = {1312-1318}, + Year = {2004} +} + +@Article{Chiani2004-1312-1318b, + Title = {Further results on convolutional code search for blockfading channels-b}, + Author = {M. Chiani and A. Conti and V. Tralli}, + Pages = {1312-1318}, + Year = {2004} +} + +@Article{Coulson2004-2277-2287, + Title = {Narrowband interference in pilot symbol assisted OFDM systems}, + Author = {Coulson, A. J.}, + Journal = {IEEE Trans. Wireless Commun.}, + Number = {6}, + Pages = {2277-2287}, + Volume = {3}, + Year = {2004} +} + +@Article{Dardari2004-1557-1567, + Title = {Layered video transmission on adaptive OFDM wireless systems}, + Author = {Dardari, D. and Martini,M. G. and Mazzotti, M. and Chiani,M.}, + Journal = {EURASIP Journal on Wireless Communications and Networking}, + Number = {10}, + Pages = {1557-1567}, + Year = {2004} +} + +@Book{Kopka2004--, + Title = {A Guide to LATEX and Electronic Publishing}, + Address = {Harlow, England}, + Author = {Helmut Kopka and Patrick W. Daly}, + Date = {2004}, + Edition = {4}, + Publisher = {Addison-Wesley} +} + +@Conference{Li2004-21-24, + Title = {Practical approaches to channel estimation and interference suppression for OFDM based UWB communications}, + Author = {Li, Y. and Molisch,A. F. and Zhang,J.}, + Booktitle = {Proc. of the IEEE 6th Circ. and Syst., Symp. on Emerging Technologies: Frontiers of Mobile and Wireless Communication}, + Pages = {21-24}, + Volume = {1}, + Year = {2004} +} + +@Book{Lin2004--, + Title = {Error Control Coding}, + Address = {Englewood Cliffs}, + Author = {Lin, S. and Daniel Costello,J.}, + Edition = {Second Edition}, + Publisher = {NJ:Prentice Hall}, + Year = {2004} +} + +@Book{Mittelbach2004--, + Title = {The LaTeX Companion}, + Address = {Boston}, + Author = {Frank Mittelbach and Michel Goossens and Johannes Braams and David Carlisle and Chris Rowley}, + Edition = {Second Edition}, + Publisher = {Addison-Wesley}, + Year = {2004} +} + +@Book{Simon2004--, + Title = {Digital Communication over Fading Channels}, + Address = {Hoboken}, + Author = {Simon, M. K. and Alouini,M. S.}, + Publisher = {NJ: Wiley-IEEE Press}, + Year = {2004} +} + +@PhdThesis{张若凌2004--, + Title = {高超声速非平衡流动的计算和实验研究}, + Author = {张若凌}, + School = {中国空气动力研究与发展中心}, + Year = {2004}, + Location = {绵阳} +} + +@Book{Miroslav2004--, + Title = {信号处理滤波器设计-基于matlab和mathematica的设计方法}, + Address = {北京}, + Author = {Miroslav, D. L. and Dejan, V. T. and Brian, L. E.}, + Publisher = {电子工业出版社}, + Translator = {朱义胜 and 董辉}, + Year = {2004}, + Month = {1} +} + +@Book{Miroslav2003--, + Title = {信号处理滤波器设计方法}, + Address = {北京}, + Author = {Miroslav, D. L. and Dejan, V. T.}, + Publisher = {电子工业出版社}, + Translator = {朱义胜 and 董辉}, + Year = {2003}, + Month = {1} +} + +@Article{Giorgetti2005-1037-1042, + Title = {The impact of OFDM interference on TH-PPM/BPAM transmission systems}, + Author = {Giorgetti, A. and Dardari,D.}, + Journal = {Proc. IEEE Veh. Technol. Conf.}, + Pages = {1037-1042}, + Volume = {2}, + Year = {2005} +} + +@Article{Giorgetti2005-2139-2149, + Title = {The effect of narrowband interference on wideband wireless communication systems}, + Author = {Giorgetti, A. and Chiani, M. and Win, M. Z.}, + Journal = {IEEE Trans. Commun.}, + Number = {12}, + Pages = {2139-2149}, + Volume = {53}, + Year = {2005} +} + +@Article{Giorgetti2005-384-389, + Title = {Influence of fading on the Gaussian approximation for BPSK and QPSK with asynchronous cochannel interference}, + Author = {Giorgetti, A. and Chiani,M.}, + Journal = {IEEE Trans. Wireless Commun.}, + Number = {2}, + Pages = {384-389}, + Volume = {4}, + Year = {2005} +} + +@Inproceedings{Giorgetti2005-794-798, + Title = {Coexistence of UWB and narrowband systems in Nakagami/Rice channels}, + Address = {Aalborg, Denmark}, + Author = {Giorgetti, A.}, + Booktitle = {Proc. Int. Symp. on Wireless Personal Multimedia Commun. (WPMC)}, + Pages = {794-798}, + Year = {2005} +} + +@Book{Reed2005--, + Title = {An Introduction to Ultrawideband Communication Systems}, + Address = {Upper Saddle River}, + Author = {Reed, J. H.}, + Publisher = {NJ: Prentice Hall}, + Year = {2005} +} + +@Book{樊昌信2005--, + Title = {通信原理教程}, + Address = {北京}, + Author = {樊昌信}, + Publisher = {电子工业出版社}, + Year = {2005} +} + +@Article{Coulson2006-2484-2492, + Title = {Bit error rate performance of OFDM in narrowband interference with excision filtering}, + Author = {Coulson, A. J.}, + Journal = {IEEE Trans. Wireless Commun.}, + Number = {9}, + Pages = {2484-2492}, + Volume = {5}, + Year = {2006} +} + +@Inproceedings{Giorgetti2006--, + Title = {Coexistence issues in cognitive radios based on ultra-wide bandwidth systems}, + Address = {Mykonos, Greece}, + Author = {Giorgetti, A. and Chiani, M. and Dardari,D.}, + Booktitle = {Proc. IEEE Int. Conf. on Cognitive Radio Oriented Wireless Net. and Comm. (CROWNCOM)}, + Year = {2006} +} + +@Article{Hu2006-1720-1724, + Title = {Performance of an ultra-wideband communication system in the presence of narrowband BPSK-and QPSK-modulated OFDM interference}, + Author = {Hu, B. and Beaulieu,N. C.}, + Journal = {IEEE Trans. Commun.}, + Number = {10}, + Pages = {1720-1724}, + Volume = {54}, + Year = {2006} +} + +@Article{Molisch2006-3151-3166, + Title = {A comprehensive standardized model for ultrawideband propagation channels}, + Author = {Molisch, A. F. and Cassioli, D. and Chong, C. C. and Emami, S. and Fort, A.}, + Journal = {IEEE Trans. Antennas Propag.}, + Number = {11}, + Pages = {3151-3166}, + Volume = {54}, + Year = {2006} +} + +@Article{Saito2006-169-176, + Title = {jadeite-bearing metagabbro in serpentinite m\'elange of the ``kurosegawa belt" in Izumi Town,Yatsushiro city, kumamoto prefecture, central kyushu}, + Author = {Saito, M. and Miyazaki, k.}, + Journal = {bulletin of geological survey of japan}, + Number = {5/6}, + Pages = {169-176}, + Volume = {57}, + Year = {2006} +} + +@Book{郭文彬2006--, + Title = {通信原理--基于Matlab的计算机仿真}, + Address = {北京}, + Author = {郭文彬 and 桑林}, + Publisher = {北京邮电大学出版社}, + Year = {2006} +} + +@Book{蔡敏2006--, + Title = {UML基础和Rose建模教程}, + Address = {北京}, + Author = {蔡敏 and 徐慧慧 and 黄柄强}, + Publisher = {人民邮电出版社}, + Year = {2006}, + Month = {1} +} + +@Article{Nasri2007-4090-4100, + Title = {Analysis of narrowband communication systems impaired by MB-OFDM UWB interference}, + Author = {Nasri, A. and Schober, R. and Lampe, L.}, + Journal = {IEEE Trans. Wireless Commun.}, + Number = {11}, + Pages = {4090-4100}, + Volume = {6}, + Year = {2007} +} + +@Book{Proakis2007--, + Title = {Digital signal processing: Principles,algorithms, and applications}, + Address = {北京}, + Author = {Proakis, J. G. AND Manolakis, D. G.}, + Edition = {第4版}, + Publisher = {电子工业出版社}, + Year = {2007} +} + +@Article{Quek2007-2126-2139, + Title = {Unified analysis of UWB transmitted-reference schemes in the presence of narrowband interference}, + Author = {Quek, T. Q. S. and Win,M. Z. and Dardari,D.}, + Journal = {IEEE Trans. Wireless Commun.}, + Number = {6}, + Pages = {2126-2139}, + Volume = {6}, + Year = {2007} +} + +@Article{Shi2007-1118-1128, + Title = {Impact of narrowband interference on OFDM-UWB receivers: Analysis and mitigation}, + Author = {Shi, K. and Zhou,Y. and Kelleci,B. and Fischer, T. W. and Serpedin, E.E. and Ilker Karsilayan, A.}, + Journal = {IEEE Trans.Signal Process.}, + Number = {3}, + Pages = {1118-1128}, + Volume = {55}, + Year = {2007} +} + +@Article{Snow2007-1736-1746, + Title = {Error rate analysis for coded multicarrier systems over quasistatic fading channels}, + Author = {Snow, C. and Lampe, L. and Schober,R.}, + Journal = {IEEE Trans. Commun.}, + Number = {9}, + Pages = {1736-1746}, + Volume = {55}, + Year = {2007} +} + +@Book{全国广播电视标准化技术委员会2007-1-1, + Title = {广播电视音像资料编目规范:第2部分~ 广播资料:GY/T202.2-2007}, + Address = {北京}, + Author = {全国广播电视标准化技术委员会}, + Note = {standard}, + Pages = {1}, + Publisher = {国家广播电影电视局广播电视规划院}, + Year = {2007} +} + +@Article{张敏莉2007-500-503, + Title = {超声速短化喷管的设计和试验研究}, + Author = {张敏莉 and 易仕和 and 赵玉新}, + Journal = {空气动力学报}, + Number = {4}, + Pages = {500-503}, + Volume = {25}, + Year = {2007} +} + +@Book{庄钊文2007--, + Title = {军用目标雷达散射截面预估与测量}, + Address = {北京}, + Author = {庄钊文 and 袁乃昌 and 莫锦军 and 刘少斌}, + Publisher = {科学出版社}, + Year = {2007} +} + +@Article{刘晨2007-400-404, + Title = {体系对抗仿真模型形式规范研究}, + Author = {刘晨 and 王维平 and 朱一凡}, + Journal = {系统仿真学报}, + Number = {2}, + Pages = {400-404}, + Volume = {19}, + Month = {1}, + Year = {2007} +} + +@Manual{吴凌云2007--, + Title = {CTEX FAQ}, + Author = {吴凌云}, + Version = {version 0.4}, + Month = {1}, + Subtitle = {常见问题集}, + Year = {2007} +} + +@Article{articlemorenames, + Title = {Cooperation enforcement and learning for optimizing packet forwarding in autonomous wireless networks}, + Author = {Pandana, C. and Han, Z. and Liu, K.J.R. and others}, + Journal = {Wireless Communications, IEEE Transactions on}, + Number = {8}, + Pages = {3150--3163}, + Volume = {7}, + Publisher = {IEEE}, + Year = {2008} +} + +@Inproceedings{Nasri2008-3616-3621, + Title = {Performance Evaluation of BICM-OFDM Systems Impaired by UWB Interference}, + Address = {Beijing, China}, + Author = {Nasri, A. and Schober,R. and Lampe,L.}, + Booktitle = {Proc. IEEE Int. Conf. on Commun.}, + Pages = {3616-3621}, + Year = {2008} +} + +@Book{2009-155-155, + Title = {师伏堂日记:第4册}, + Address = {北京}, + Pages = {155}, + Publisher = {北京图书馆出版社}, + Year = {2009} +} + +@Article{Chiani2009-231-254, + Title = {Coexistence between UWB and narrow-band wireless communication systems}, + Author = {Chiani, M. and Giorgetti, A.}, + Journal = {Proc. IEEE, Special Issue on UWB Technology and Emerging Applications}, + Number = {2}, + Pages = {231-254}, + Volume = {97}, + Year = {2009} +} + +@Article{Pinto2009-1268-1282, + Title = {A stochastic geometry approach to coexistence in heterogeneous wireless networks}, + Author = {Pinto, P. and Giorgetti,A. and Win,M. Z. and Chiani,M.}, + Journal = {IEEE J. Sel. Areas Commun., Special Issue on Stochastic Geometry and Random Graphs for Wireless Networks}, + Number = {7}, + Pages = {1268-1282}, + Volume = {27}, + Year = {2009} +} + +@Book{罗斯基2009--, + Title = {战前中国经济的增长}, + Address = {杭州}, + Author = {罗斯基}, + Publisher = {浙江大学出版社}, + Translator = {唐巧天 and 毛立坤 and 姜修宪}, + Year = {2009} +} + +@Book{陈希孺2009--, + Title = {概率论与数理统计}, + Address = {合肥}, + Author = {陈希孺}, + Publisher = {中国科学技术大学出版社}, + Year = {2009}, + Month = {2} +} + +@Book{李云霞2009--, + Title = {光电对抗原理与应用}, + Address = {西安}, + Author = {李云霞 and 蒙文 and 马丽华 and 赵尚弘}, + Date = {2009-02}, + Publisher = {西安电子科技大学出版社} +} + +@Article{卢秋红2009-247-251, + Title = {基于开放式架构的反恐排爆机器人关键技术分析}, + Author = {卢秋红 and 蒋金鹏 and 付西光}, + Journal = {上海电机学院学报}, + Number = {3}, + Pages = {247-251}, + Volume = {12}, + Month = {9}, + Year = {2009} +} + +@Article{张庆杰2009-30-33, + Title = {支持无人机互操作的多数据链互连网关设计}, + Author = {张庆杰 and 王林 and 朱华勇 and 沈林成}, + Journal = {计算机工程}, + Number = {20}, + Pages = {30-33}, + Volume = {35}, + Month = {10}, + Year = {2009} +} + +@Article{Park2010-696-715, + Title = {metadata quality Control in Digital repositories and collections: criteria, semantics, and mechanisms}, + Author = {Park, J R and tosaka, Y.}, + Journal = {Cataloging \& classification quarterly}, + Number = {8}, + Pages = {696-715}, + Volume = {48}, + Url = {http://www.tandfonline.com}, + Urldate = {2013-09-05}, + Year = {2010} +} + +@Article{陈建军2010-93-93, + Title = {从数字地球到智慧地球}, + Author = {陈建军}, + Journal = {国图资源导刊}, + Number = {10}, + Pages = {93}, + Volume = {7}, + Doi = {10.3969/j.issn.1672-5603.2010.10.038}, + Url = {http://d.g.wanfangdata.com.cn}, + Urldate = {2013-03-20}, + Year = {2010} +} + +@Article{储大同2010-721-724, + Title = {恶性肿瘤个体化治疗靶向药物的临床表现}, + Author = {储大同}, + Journal = {中华肿瘤杂志}, + Number = {10}, + Pages = {721-724}, + Volume = {32}, + Url = {http://www.sohu.com}, + Urldate = {2014-06-25}, + Year = {2010} +} + +@book{weiner2010-38, + Title = {Microarchaeology: beyond the visible archaeological record}, + Author = {Weiner, S}, + Address = {Cambridge, Eng.}, + Date = {2010}, + Publisher = {Cambridge University Press Textbooks}, + Url = {http://lib.MYLIB.COM/OPEN.aspx?id=253897}, + Urldate = {2013-10-14}, + pages = {38} +} + +@Article{储大同2010-721-724m, + Title = {恶性肿瘤个体化治疗靶向药物的临床表现}, + Author = {储大同}, + Journal = {中华肿瘤杂志}, + Number = {9/10}, + Pages = {721-724}, + Volume = {32}, + Doi = {10.7666/d.y351065}, + Url = {http://www.sohu.com}, + Urldate = {2014-06-25}, + Year = {2010} +} + +@Book{候文顺2010-119-119, + Title = {高分子物理:高分子材料分析、选择与改性}, + Address = {北京}, + Author = {候文顺}, + Pages = {119}, + Publisher = {化学工业出版社}, + Url = {http://apabi.lib.pku.edu.cn}, + Urldate = {2012-11-27}, + Year = {2010} +} + +@Book{胡承正2010-112-112, + Title = {理论物理概论:上}, + Address = {武汉}, + Author = {胡承正 and 周详 and 缪灵}, + Pages = {112}, + Publisher = {武汉大学出版社}, + Year = {2010} +} + +@Book{美国妇产科医师学会2010-38-39, + Title = {新生儿脑病和脑性瘫痪发病机制与病理生理}, + Address = {北京}, + Author = {美国妇产科医师学会}, + Pages = {38-39}, + Publisher = {人民卫生出版社}, + Translator = {段涛 and 杨慧霞}, + Year = {2010} +} + +@Book{全国信息文献标准化技术委员会2010-3-3, + Title = {文献著录:第4部分~ 非书资料:GB/T3792.4-2009}, + Address = {北京}, + Author = {全国信息文献标准化技术委员会}, + Note = {standard}, + Pages = {3}, + Publisher = {中国标准出版社}, + Year = {2010} +} + +@Article{伍江华2010-70-74, + Title = {C4ISR互操作框架及信息关系模型研究}, + Author = {伍江华 and 潘小群}, + Journal = {舰船电子工程}, + Number = {1}, + Pages = {70-74}, + Volume = {30}, + Year = {2010} +} + +@Book{王雪松2010--, + Title = {现代雷达电子战系统建模与仿真}, + Address = {北京}, + Author = {王雪松 and 肖顺平 and 冯德军 and 赵锋}, + Date = {2010-03}, + Publisher = {电子工业出版社} +} + +@Book{Ross2010--, + Title = {概率论基础教程}, + Address = {北京}, + Author = {Ross, S. M.}, + Edition = {第8版}, + Publisher = {人民邮电出版社}, + Translator = {郑忠国 and 詹从赞}, + Year = {2010}, + Month = {4} +} + +@Book{陈志杰2006--, + Title = {LaTeX 入门与提高}, + Address = {北京}, + Author = {陈志杰 and 赵书钦 and 李树钧 and 万福永}, + Edition = {第二版}, + Publisher = {高等教育出版社}, + Year = {2010}, + Month = {5} +} + +@Manual{Umeki2010--, + Title = {The geometry package}, + Author = {Hideo Umeki}, + Version = {v5.6}, + Month = {09}, + Year = {2010} +} + +@Report{Calkin2011-8-9, + Title = {a comparative risk assessment framework for wildland fire management: the 2010 cohesive strategy Science report: RMRS-GTR-262}, + Author = {Calkin, D and Ager, a. and Thompson, m.}, + Pages = {8-9}, + Year = {2011} +} + +@Book{Praetzellis2011-13-13, + Title = {death by theory : a tale of mystery and archaeological theory}, + Author = {Praetzellis, A.}, + Edition = {Rev. ed.}, + Pages = {13}, + Publisher = {Rowman \& Littlefield Publishing Group, Inc.}, + Url = {http://lib.myilibrary.com}, + Urldate = {2012-07-26}, + Year = {2011} +} + +@Proceedings{陈志勇2011--, + Title = {中国财税文化价值研究:“中国财税文化国际学术研讨会”论文集}, + Address = {北京}, + Author = {陈志勇}, + Publisher = {经济科学出版社}, + Url = {http://apabi.lib.pku.edu.cn}, + Urldate = {2013-10-14}, + Year = {2011} +} + +@InProceedings{贾东琴2011-45-52a, + author = {贾东琴 and 柯平}, + title = {面向数字素养的高校图书馆数字服务体系研究}, + booktitle = {中国图书馆学会年会论文集:2011年卷}, + year = {2011}, + publisher = {国家图书馆出版社}, + pages = {45-52}, + address = {北京}, + bookauthor = {中国图书馆学会}, +} + +@Inbook{楼梦麟2011-11-12, + Title = {汶川地震基岩地震动特征分析}, + Address = {上海}, + Author = {楼梦麟 and 杨燕}, + Bookauthor = {同济大学土木工程防灾国家重点实验室}, + Booktitle = {汶川地震震害研究}, + Pages = {{011-012}}, + Publisher = {同济大学出版社}, + Url = {http://apabi.lib.pku.edu.cn}, + Urldate = {2013-05-09}, + Year = {2011} +} + +@Thesis{马欢2011-27-27, + Title = {人类活动影响下海河流域典型区水循环变化分析}, + Address = {北京}, + Author = {马欢}, + Institution = {清华大学}, + Pages = {27}, + Url = {http://www.cnki.net/kcms/detail/detail.aspx?dbcode=CDFD&QueryID=.O&CurRec=11&dbname=CDFDLAST2013&.filename=1012035905.nh&uid=WEEvRE­wSIJHSldTTGJhYIJRaEhGUXFQWVB6SGZXeisxdmVhV3Zy2kpoUnozeDElbOpaMONmMjZiQ3p4TUdmcw= }, + Urldate = {2013-10-14}, + Year = {2011} +} + +@InBook{2011-1109-1109, + title = {周易外传:卷5}, + booktitle = {船山全书:第6册}, + year = {2011}, + bookauthor = {王夫之}, + publisher = {岳麓书社}, + location = {长沙}, + pages = {1109}, +} + +@Book{胡伟2011--, + Title = {LaTeX2$\varepsilon$完全学习手册}, + Address = {北京}, + Author = {胡伟}, + Publisher = {清华大学出版社}, + Year = {2011}, + Month = {1} +} + +@Manual{Oetiker2011--, + Title = {The Not So Short Introduction to \LaTeXe{}}, + Author = {Tobias Oetiker and Hubert Partl and Irene Hyna and Elisabeth Schleg}, + Month = {4}, + Year = {2011} +} + +@Article{陈高峰2011-230-232, + Title = {基于开放式框架的交叉开发环境设计与实现}, + Author = {陈高峰}, + Journal = {煤炭技术}, + Number = {6}, + Pages = {230-232}, + Volume = {30}, + Month = {6}, + Year = {2011} +} + +@Manual{Robertson2011--, + Title = {The ccaption package}, + Author = {Will Robertson and Peter Wilson and Herries Press}, + Version = {v3.2c}, + Month = {8}, + Year = {2011} +} + +@Article{谭跃进2011-441-445, + Title = {体系工程的研究与发展}, + Author = {谭跃进 and 赵青松}, + Journal = {中国电子科学研究院学报}, + Number = {5}, + Pages = {441-445}, + Volume = {6}, + Month = {10}, + Year = {2011} +} + +@Manual{Sommerfeldt2011--, + Title = {Customizing captions of floating environments}, + Author = {Axel Sommerfeldt}, + Url = {http://sourceforge.net/projects/latex-caption/}, + Month = {11}, + Year = {2011} +} + +@Article{张晓琴2011--, + Title = {有重复组合公式的几种证明方法}, + Author = {张晓琴 and 王顺勇}, + Journal = {大学数学}, + Number = {6}, + Volume = {27}, + Month = {12}, + Year = {2011} +} + +@Book{Kinchy2012-50-50, + Title = {Seeds, Sciences, and struggle : the global politics of transgenic crops}, + Address = {Cambridge,Mass.}, + Author = {Kinchy, A.}, + Pages = {50}, + Publisher = {MIT Press}, + Url = {http://lib.myilibary.com}, + Urldate = {2013-07-14}, + Year = {2012} +} + +@Book{库恩2012--, + Title = {科学革命的结构:第4版}, + Address = {北京}, + Author = {库恩}, + Edition = {2}, + Publisher = {北京大学出版社}, + Translator = {金吾伦 and 胡新和}, + Year = {2012} +} + +@Proceedings{雷光春2012--, + Title = {综合湿地管理:综合湿地管理国际研讨会论文集}, + Address = {北京}, + Author = {雷光春}, + Publisher = {海洋出版社}, + Year = {2012} +} + +@Article{于潇2012-1518-1523, + Title = {互联网药品可信交易环境中主体资质审核备案模式}, + Author = {于潇 and 刘义 and 柴跃廷 and others}, + Journal = {清华大学学报(自然科学版)}, + Number = {11}, + Pages = {1518-1523}, + Volume = {52}, + Year = {2012} +} + +@Article{于潇2011-15-23, + Title = {互联网药品可信交易环境中主体资质审核备案模式}, + Author = {于, 潇 and 刘, 义 and 柴, 跃廷 and others}, + Journal = {清华大学学报}, + Number = {11}, + Pages = {15-23}, + Volume = {52}, + Year = {2011} +} + +@Proceedings{中国社会科学院台湾史研究中心2012--, + Title = {台湾光复六十五周年暨抗战史实学术研讨会论文集}, + Address = {北京}, + Publisher = {九州出版社}, + Year = {2012}, + Editor = {中国社会科学院台湾史研究中心} +} + +@Book{埃伯哈德$ullet$蔡德勒等2012--, + Title = {数学指南-实用数学手册}, + Address = {北京}, + Author = {埃伯哈德$\bullet$蔡德勒等}, + Publisher = {科学出版社}, + Translator = {李文林等}, + Year = {2012}, + Month = {1} +} + +@Book{廖平2012--, + Title = {导弹突防中的电子对抗技术}, + Address = {北京}, + Author = {廖平 and 姜勤波}, + Date = {2012-01}, + Publisher = {国防工业出版社} +} + +@Patent{张凯军2012-04-05--, + Title = {轨道火车及高速轨道火车紧急安全制动辅助装置}, + Author = {张凯军}, + Number = {201220158825.2}, + Year = {2012-04-05} +} + +@Online{李强2012-05-03--, + Title = {化解医患矛盾需釜底抽薪}, + Author = {李强}, + Url = {http://wenku.baidu.com}, + Urldate = {2013-03-25}, + Year = {2012-05-03} +} + +@Online{Dublin2012-06-14--, + Title = {Dublin core metadata element set: version 1.1}, + Url = {http://dublincore.org}, + Urldate = {2014-06-11}, + Year = {2012-06-14} +} + +@Book{胡广书2012--, + Title = {数字信号处理—理论、算法与实现}, + Address = {北京}, + Author = {胡广书}, + Edition = {第三版}, + Publisher = {清华大学出版社}, + Year = {2012}, + Month = {10} +} + +@Article{Franz2013-1053-1062, + Title = {Phenotypic screening with oleaginous microalgae reveals modulators of lipid productivity}, + Author = {Franz,A.K. AND DANIELEWICZ, M. A. AND WONG, D. M. AND OTHERS}, + Journal = {ACS chemical biology}, + Pages = {1053-1062}, + Volume = {8}, + Url = {http://pubs.acs.org}, + Urldate = {2014-06-26}, + Year = {2013} +} + +@Article{Walls2013-399-418, + Title = {drought, deluge and declines: the impact of precipition extremes on amphibians in a changing climate}, + Author = {Walls, S C and barichivich, W. J. and BROWN, m. e.}, + Journal = {Biology}, + Number = {1}, + Pages = {399-418}, + Volume = {2}, + Url = {http://www.mdpi.com}, + Urldate = {2013-11-04}, + Year = {2013}, + doi = {10.3390/biology2010399} +} + +@Article{Zhang2007-500-503, + Title = {The design and experimental investigations of supersonic length shorted nozzle}, + Author = {Zhang, Min-li and Yi, Shi-he and Zhao, Yu-xin}, + Journal = {ACTA AERODYNAMICA SINICA}, + Number = {4}, + Pages = {500-503}, + Volume = {25}, + Year = {2007} +} + +@Book{Yi2013--, + Title = {Supersonic and hypersonic nozzle design}, + Address = {Beijing}, + Author = {Yi, Shi he and Zhao, Yu xin and He, Lin and Zhang, Min li}, + Publisher = {National Defense Industry Press}, + Year = {2013} +} + +@Book{LIAO2012--, + Title = {Electronic countermeasure techniques for missile penetration}, + Address = {Beijing}, + Author = {LIAO, ping and JIANG, qin bo}, + Publisher = {National Defense Industry Press}, + Year = {2013} +} + +@Book{LIU2003--, + Title = {Introduction of Ballistic Misille Techniques}, + Address = {Beijing}, + Author = {LIU, shi Qiu}, + Publisher = {China Astronautic Publishing House}, + Year = {2003} +} + +@InBook{马克思2013-302-302a, + author = {马克思}, + title = {政治经济学批判}, + booktitle = {马克思恩格斯全集:第35卷}, + year = {2013}, + bookauthor = {马克思 and 恩格斯}, + publisher = {人民出版社}, + pages = {302}, + address = {北京}, +} + +@Article{杨洪升2013-56-75, + Title = {四库馆私家抄校书考略}, + Author = {杨洪升}, + Journal = {文献}, + Number = {1}, + Pages = {56-75}, + Year = {2013} +} + +@Book{易仕和2013--, + Title = {超声速和高超声速喷管设计}, + Address = {北京}, + Author = {易仕和 and 赵玉新 and 何霖 and 张敏莉}, + Publisher = {国防工业出版社}, + Year = {2013} +} + +@Article{詹广平2013-8-10, + Title = {美海军宙斯盾系统开放式体系结构研究}, + Author = {詹广平}, + Journal = {舰船电子工程}, + Number = {11}, + Pages = {8-10}, + Volume = {33}, + Year = {2013} +} + +@Book{中国企业投资协会2013--, + Title = {投资台湾:大陆企业赴台投资指南}, + Address = {北京}, + Author = {中国企业投资协会 and 台湾并购与私募股权协会 and 汇盈国际投资集团}, + Publisher = {九州出版社}, + Year = {2013} +} + +@Article{周学武2013-49-52, + Title = {数据链技术的发展及其在空面导弹中的应用}, + Author = {周学武 and 邹敏怀 and 张邦楚 and 黄剑斌 and 刘涛}, + Journal = {教练机}, + Number = {2}, + Pages = {49-52}, + Year = {2013} +} + +@Book{Poisel2013--, + Title = {通信电子战原理}, + Address = {北京}, + Author = {Poisel, Richard A.}, + Edition = {2版}, + Pages = {23--26}, + Publisher = {电子工业出版社}, + Translator = {聂皞 and 王振华 and 陈少昌 and 吴利民}, + Url = {http://www.baidu.com}, + Urldate = {2013-08-01}, + Year = {2013}, + Month = {1} +} + +@Article{王雪峥2013-249-254, + Title = {基于DoDAF的靶场体系结构设计}, + Author = {王雪峥 and 许雪梅}, + Journal = {系统工程理论与实践}, + Number = {1}, + Pages = {249-254}, + Volume = {33}, + Month = {1}, + Year = {2013} +} + +@Book{阎毅2013--, + Title = {软件无线电与认知无线电概论}, + Address = {北京}, + Author = {阎毅 and 贺鹏飞}, + Publisher = {电子工业出版社}, + Year = {2013}, + Month = {1} +} + +@Article{刘裕国2013-01-12--, + Title = {雾霾来袭,如何突围}, + Author = {刘裕国 and 杨柳 and 张洋 and OTHERS}, + Journal = {人民日报}, + Note = {news}, + Url = {http://paper.people.com.cn}, + Urldate = {2013-11-06}, + Year = {2013-01-12} +} + +@Report{中华人民共和国国务院新闻办公室2013-04-16--, + Title = {国防白皮书:中国武装力量的多样化运用}, + Author = {中华人民共和国国务院新闻办公室}, + Url = {http://www.mod.gov.cn}, + Urldate = {2014-06-11}, + Year = {2013}, + date = {2013-04-16} +} + +@Book{刘海洋2013--, + Title = {LaTeX 入门}, + Address = {北京}, + Author = {刘海洋}, + Publisher = {电子工业出版社}, + Year = {2013}, + Month = {6} +} + +@Unpublished{包太雷2013--, + Title = {LaTeX Notes}, + Author = {包太雷}, + Edition = {第二版}, + Month = {9}, + Subtitle = {雷太赫排版系统简介}, + Year = {2013} +} + +@Report{汤万金2013-09-30--, + Title = {人体安全重要技术标准研制最终报告: 7178999X}, + Author = {汤万金 and 杨跃翔 and 刘文 and others}, + Url = {http://www.nstrs.org.cn}, + Urldate = {2014-06-24}, + date = {2013-09-30}, + Year = {2013} +} + +@Manual{Lehman2013--, + Title = {The biblatex Package}, + Author = {Philipp Lehman and Philip Kime and Audrey Boruvka and Joseph Wright}, + Version = {version 2.8a}, + Month = {11}, + Subtitle = {Programmable Bibliographies and Citations}, + Year = {2013} +} + +@Proceedings{Babu2014--, + Title = {Proceedings of the second international conference on soft computing for problem solving, December 28-30, 2012}, + Address = {New Delhi}, + Publisher = {Springer}, + Year = {2014}, + Editor = {Babu, B. V. and NAGAR, A. K. AND DEEP, K. and others} +} + +@Book{同济大学数学系2014--, + Title = {高等数学}, + Address = {北京}, + Author = {同济大学数学系}, + Publisher = {高等教育出版社}, + Year = {2014}, + Month = {7} +} + +@Book{杨林2015--, + Title = {面向对象软件工程与UML实践教程}, + Address = {北京}, + Author = {杨林 and 叶亚琴 and 方芳}, + Publisher = {科学出版社}, + Year = {2015}, + Month = {1} +} + +@Manual{Braams2015--, + Title = {The \LaTeXe{} Sources}, + Author = {Johannes Braams and David Carlisle and Alan Jeffrey and Leslie Lamport and Frank Mittelbach and Chris Rowley and Rainer Sch¨opf}, + Date = {2015-01-01} +} + +@Manual{Lehman2015, + Title = {The Biblatex Package: Programmable Bibliographies and Citations}, + Author = {Philipp Lehman and Philip Kime and Audrey Boruvka and Joseph Wright}, + Date = {2015-04-20}, + Version = {3.0} +} + +@Book{中华人民共和国国家质量监督检验检疫总局2015, + Title = {中华人民共和国国家标准 GB/T 7714-2015 信息与文献 参考文献著录规则}, + Author = {中华人民共和国国家质量监督检验检疫总局 and 中国国家标准化管理委员会}, + Date = {2015-05-15}, + Note = {standard} +} + +@Article{高翔2015-26-31, + Title = {复杂航电架构的开放式系统标准研究}, + Author = {高翔 and 李辰}, + Journal = {航空电子技术}, + Number = {2}, + Pages = {26-31}, + Volume = {46}, + Month = {6}, + Year = {2015} +} + +@Manual{Mittelbach2015--, + Title = {An environment for multicolumn output}, + Author = {Frank Mittelbach}, + Month = {12}, + Year = {2015} +} + +@Manual{Berry2016--, + Title = {TEX Live 指南—2016}, + Author = {Karl Berry}, + Date = {2016-06} +} + +@Manual{胡振震2016, + Title = {符合 GB7714-2015 标准的 biblatex 参考文献样式文件}, + Author = {胡振震}, + Date = {2016-07-01}, + Url = {https://ctan.org/pkg/biblatex-gb7714-2015}, + Urldate = {2018-04-23} +} + +@Online{Alliance--, + Title = {WiMedia Alliance}, + Url = {www.wimedia.org} +} + +@Book{booknodate, + Title = {出版集团研究}, + Author = {余敏}, + Pages = {179-193}, + Publisher = {中国书籍出版社}, + Location = {北京} +} + +@Book{booknopublishernoyear, + Title = {出版集团研究}, + Author = {余敏}, + Location = {北京} +} + +@Online{Commonwealth--, + Title = {Pennsylvania library laws}, + Author = {{Commonwealth libraries bureau of library development.Pennsylvania department of education office}}, + Url = {http://www.racc.edu}, + Urldate = {2013-03-24} +} + +@Report{Eggrers--, + Title = {One-dimensional flows of an imperfect diatomic gas}, + Author = {Eggrers, A. J.}, + Number = {959}, + Type = {NACA report} +} + +@Online{HOPKINSON--, + Title = {UNIMARC and metadata: Dublin Core}, + Author = {A HOPKINSON}, + Url = {http://www.rfla.org/IV/rfla64/13801613.htm}, + Urldate = {1999-12-08} +} + +@Online{JabRef中文手册--, + Title = {JabRef中文手册}, + Url = {http://blog.csdn.net/zd0303/article/details/7676807} +} + +@Online{JabRefManual--, + Title = {JabRef Manual}, + Url = {http://blog.csdn.net/zd0303/article/details/7676807} +} + +@Online{OCLC--a, + author = {{Online Computer Library Center, Inc.}}, + title = {History of OCLC}, + url = {http://www.oclc.org/about/history/default.htm}, + urldate = {2000-01-08}, +} + +@Book{Parsons2000nodate--, + Title = {The Mobile Radio Propagation Channel}, + Address = {Hoboken}, + Author = {Parsons, J. D.}, + Edition = {2}, + Publisher = {John Wiley and Sons} +} + +@Book{Parsons2000nopubnoyear--, + Title = {The Mobile Radio Propagation Channel}, + Address = {Hoboken}, + Author = {Parsons, J. D.}, + Edition = {2} +} + +@Book{standardinfoiso158, + Title = {Information and documentation-the Dublin core metadata element set:ISO 15836:2009}, + Note = {standard}, + Url = {http://www.iso.org}, + Urldate = {2013-03-24} +} + +@Book{鸟哥--, + Title = {鸟哥的linux私房菜}, + Author = {鸟哥}, + Edition = {3}, + Publisher = {人民邮电出版社} +} + +@Online{olqa2016--, + Title = {求助beamerposter制作海报时参考文献样式的问题}, + Date = {2016}, + Url = {http://bbs.ctex.org/forum.php?mod=viewthread&tid=153061&page=1&extra=#pid544787} +} + +@Online{北京交通大学研究生公众号2016--, + Title = {新学期定个小目标—学会在LaTeX中管理参考文献}, + Author = {北京交通大学研究生公众号}, + Date = {2016-09-17}, + Url = {http://www.latexstudio.net/archives/7488} +} + +@Online{olref2016--, + Title = {如何在LaTeX写作中管理参考文献?}, + Date = {2016-08-12}, + Url = {http://www.latexstudio.net/archives/7131} +} + +@Online{文献助手2016--, + Title = {参考文献格式搜索神器上线了}, + Author = {文献助手}, + Date = {2016-09-21}, + Url = {http://www.latexstudio.net/archives/7560} +} + +@Book{IFLAI1977b--, + Title = {Names of persons: national usages for entry in catalogues}, + Author = {{International Federation of Library Association and Institutions} and {FCC} and {FBI} and {CIA}}, + Edition = {3}, + Publisher = {IFLA International Office for UBC}, + Year = {1977}, + Location = {London} +} + +@Inproceedings{r27-BenHadjAlaya-FekiA.2008-1-5, + Title = {Interference cartography for hierarchical dynamic spectrum access}, + Address = {Chicago, IL}, + Author = {{Ben Hadj Alaya-Feki A.} and B. Sayrac and S. Ben Jemaa and E. Moulines}, + Booktitle = {Proc. IEEE Symp. on New Frontiers in Dynamic Spectrum Access Networks (DySPAN)}, + Date = {2008-10}, + Pages = {1-5} +} + +@Book{中国企业投资协会2014--, + Title = {投资台湾:大陆企业赴台投资指南}, + Address = {北京}, + Author = {{中国企业投资协会} and 台湾并购与私募股权协会 and 汇盈国际投资集团 and 国际投资集团}, + Publisher = {九州出版社}, + Year = {2014} +} + +@Book{中国企业投资协会2015--, + Title = {投资台湾:大陆企业赴台投资指南}, + Address = {北京}, + Author = {中国企业投资协会 and 台湾并购与私募股权协会 and 汇盈国际投资集团 and 国际投资集团}, + Publisher = {九州出版社}, + Year = {2015} +} + +@Manual{Tantau2015--, + Title = {The beamer class -- User Guide for version 3.36}, + Author = {Till Tantau and Joseph Wright and Vedran Miletić}, + Date = {2015-03-08}, + Url = {http://bitbucket.org/rivanvx/beamer} +} + +@Manual{Oetiker--, + Title = {一份不太简短的LATEX2ε介绍}, + Author = {Tobias Oetiker and Hubert Partl and Irene Hyna and Elisabeth Schlegl}, + Date = {2017-03}, + Translator = {ChinaTEX论坛}, + Url = {https://ctan.org/pkg/lshort-zh-cn}, + Urldate = {2018-04-23}, + Version = {5.10} +} + +@Manual{Daly2010--, + Title = {Natural Sciences Citations and References (package natbib)}, + Author = {Patrick W. Daly}, + Date = {2010-09-13}, + Url = {https://ctan.org/pkg/natbib}, + Urldate = {2018-04-27}, + Version = {8.31b} +} + +@Manual{Arseneau2010--, + Title = {chapterbib multiple bibliographies in LATEX}, + Author = {Donald Arseneau}, + Date = {2010-09-05}, + Url = {https://ctan.org/pkg/chapterbib}, + Urldate = {2018-04-23} +} + +@Manual{Shell2013--, + Title = {Mciteplus: Enhanced Multicitations}, + Author = {Michael Shell}, + Date = {2013-09-13}, + Url = {https://ctan.org/pkg/mciteplus}, + Urldate = {2018-04-23}, + Version = {1.2} +} + +@Online{Hansen2008--, + Title = {The multibib Package}, + Author = {Thorsten Hansen}, + Date = {2008-12-10}, + Url = {https://www.ctan.org/pkg/multibib}, + Urldate = {2018-05-04}, + Version = {v1.4} +} + +@Online{Seindal1994--, + Title = {Inline bibliography style}, + Author = {René Seindal}, + Date = {1994-12-06}, + Url = {https://www.ctan.org/pkg/inlinebib}, + Urldate = {2018-05-04} +} + +@Book{booknopubitems, + Title = {出版集团研究}, + Author = {余敏}, + Date = {2001}, + Pages = {50-63} +} + +@Comment{jabref-meta: databaseType:biblatex;} + +@Comment{jabref-entrytype: Newspaper: req[] opt[]} diff --git a/config/gb7714-2015-gbk.def b/config/gb7714-2015-gbk.def new file mode 100644 index 0000000..7884216 --- /dev/null +++ b/config/gb7714-2015-gbk.def @@ -0,0 +1,27 @@ +%% +%% --------------------------------------------------------------- +%% biblatex-gb7714-2015 --- A biblatex implementation of the +%% GBT7714-2015 bibliography style, GBK supported file +%% Maintained by huzhenzhen +%% E-mail: hzzmail@163.com +%% Released under the LaTeX Project Public License v1.3c or later +%% --------------------------------------------------------------- +%% + + \def\str@bibliography{ο} + \def\str@references{ο} + \def\str@bytranslator{} + \def\str@andotherscn{} + \def\str@backrefpage{ҳ} + \def\str@backrefpages{ҳ} + \def\str@noaddress{ز} + \def\str@nopublisher{߲} + \def\str@edition{} + \def\str@volumecn{} + \def\str@numbercn{} + \def\str@serialcn{} + \def\str@sameentry{ͬ} + \def\str@incn{} + \def\str@mathesiscn{˶ʿѧλ} + \def\str@phdthesiscn{ʿѧλ} + \def\str@editorcn{} diff --git a/config/gb7714-2015.bbx b/config/gb7714-2015.bbx new file mode 100644 index 0000000..303149e --- /dev/null +++ b/config/gb7714-2015.bbx @@ -0,0 +1,3462 @@ +%% +%% --------------------------------------------------------------- +%% biblatex-gb7714-2015 --- A biblatex implementation of the +%% GBT7714-2015 bibliography style,numerical sequence +%% Maintained by huzhenzhen +%% E-mail: hzzmail@163.com +%% Released under the LaTeX Project Public License v1.3c or later +%% --------------------------------------------------------------- +%% + +% +% 版本和时间信息 +% +\def\versionofgbtstyle{2019/03/28 v1.0r} +\def\versionofbiblatex{\abx@version} +\ProvidesFile{gb7714-2015.bbx}[\versionofgbtstyle biblatex bibliography style] +%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 + +%===================================================================== +% 加载标准样式 +%===================================================================== +\RequireBibliographyStyle{numeric-comp} +\RequirePackage{xstring}%解决texlive2015的biblatex3.0不加载xstring包的问题 + + +%===================================================================== +% 功能函数 +%===================================================================== + % + % biblatex版本判断 + % 20180405,v1.0k,为兼容biblatexv3.11增加toggle:iftlnine,HU zhenzhen + % 20181020,v1.0n,为不再使用xstring宏包做的修改,hzz + % + % 原理方法:当版本继续更新时,增加一个新的toggle用以处理新的旧版,最新版和未判断出来的版本永远用iftlatest + \providetoggle{iftlfive}\togglefalse{iftlfive} %处理biblatex3.2之前版本,时间2016-03-01前 + \providetoggle{iftlsix}\togglefalse{iftlsix} %处理biblatex3.3开始改变姓名机制后版本,时间2016-03-01及以后 + \providetoggle{iftlseven}\togglefalse{iftlseven}%处理biblatex3.7的兼容性,时间2016-12-01后 + \providetoggle{iftleight}\togglefalse{iftleight}%处理biblatex3.8到3.9的兼容性,时间2017-11-01后到2017-12-01前 + \providetoggle{iftlnine}\togglefalse{iftlnine} %处理biblatex10的兼容性,时间2017-12-01后 + \providetoggle{iftlatest}\toggletrue{iftlatest} %假设是最新版biblatex + + \@ifpackagelater{biblatex}{2014/04/01}{ + \@ifpackagelater{biblatex}{2016/03/01}{ + \@ifpackagelater{biblatex}{2016/12/01}{ + \@ifpackagelater{biblatex}{2017/11/01}{ + \@ifpackagelater{biblatex}{2017/12/01}{ + \@ifpackagelater{biblatex}{2018/02/19}{} + {\toggletrue{iftlnine}\togglefalse{iftlatest}}} + {\toggletrue{iftleight}\togglefalse{iftlatest}}} + {\toggletrue{iftlseven}\togglefalse{iftlatest}}} + {\toggletrue{iftlsix}\togglefalse{iftlatest}}} + {\toggletrue{iftlfive}\togglefalse{iftlatest}}} + {\PackageError{biblatex}{Outdated 'biblatex' package} + {Please update biblatex, This is a fatal error.}} + + \newcommand\defversion[2]{\csdef{codeversion#1#2}}%定义不同版本的命令 + \newcommand\switchversion[2]{\csuse{codeversion#1#2}}%使用不同版本的命令 + + % + % 判断CJK字符的函数,用于判断作者等信息是否由中文字符构成 + % v1.0k,20180509,hzz + % + % 原理方法:用biber中的perl方法代替。因为利用tex函数对字符判断时,当字符在宏 + % 中时,基于`的方法无法解决GBK编码的问题,基于CJKsymbol的方法无法解决utf-8 + % 编码用xelatex编译的问题。 + % + % 原理是:利用perl正则将中文标识记录到域中, + % 然后利用\iffieldundef和\iffieldequalstr进行判断 + \providetoggle{ifCJKforgbt} + \def\testCJKfirst#1{% + \iffieldundef{#1}{\togglefalse{ifCJKforgbt}}{% + \iffieldequalstr{#1}{chinese}{\toggletrue{ifCJKforgbt}}{\togglefalse{ifCJKforgbt}}}} + + % + % 2个卷的解析函数,用于连续出版物 + % + % 原理方法: 范围起止间隔符号还是用-,而不是与date相同的/,因为有合期期刊的问题,需要用到/符号 + \newcommand{\multivolparser}[1]{% + \IfSubStr{#1}{-}% + {\StrBefore{#1}{-}[\multivolfirst]\StrBehind{#1}{-}[\multivolsecond]}% + {\def\multivolfirst{#1}\def\multivolsecond{}}% + } + + + % + % 2个期的解析函数,用于连续出版物 + % + \newcommand{\multinumberparser}[1]{% + \IfSubStr{#1}{-}% + {\StrBefore{#1}{-}[\multinumberfirst]\StrBehind{#1}{-}[\multinumbersecond]}% + {\def\multinumberfirst{#1}\def\multinumbersecond{}}% + } + + % 对没有分隔符环境命令的低版本biblatex做增补,避免报错 + % + \iftoggle{iftlfive}{ + + \def\blx@inf@delimdeclare#1#2{% + \blx@info{Delimiter '#1' in context '#2' already defined, overwriting}} + + \def\blx@warn@delimuse#1#2{% + \blx@warning{Delimiter '#1' in context '#2' undefined}} + % Delimiter interface + + % []{}{} + \newrobustcmd*{\DeclareDelimFormat}{% + \@ifstar + {\blx@declaredelimclear} + {\blx@declaredelim}} + + \newrobustcmd*{\blx@declaredelimclear}[3][]{% + \ifcsvoid{blx@declaredelimcontexts@#2} + {} + {\def\do##1{\csundef{blx@printdelim@##1@#2}}% + \dolistcsloop{blx@declaredelimcontexts@#2}}% + \cslet{blx@declaredelimcontexts@#2}\@empty + \ifblank{#1} + {\blx@declaredelim{#2}{#3}} + {\blx@declaredelim[#1]{#2}{#3}}} + + \newrobustcmd*{\blx@declaredelim}[3][]{% + \ifblank{#1} + {\blx@declaredelim@i{}{}{#2}{#3}} + {\def\do##1{% + \listcsadd{blx@declaredelimcontexts@#2}{##1}% + \blx@declaredelim@i{blx@printdelim@##1@}{##1}{#2}{#3}}% + \docsvlist{#1}}}% + + \def\blx@declaredelim@i#1#2#3#4{% + \def\do@i##1{% + \ifcsdef{#1##1} + {\blx@inf@delimdeclare{##1}{#2}} + {}% + \csdef{#1##1}{#4}}% + \forcsvlist{\do@i}{#3}} + + % *[]{}{} + \newrobustcmd*{\DeclareDelimAlias}{% + \@ifstar + {\blx@declaredelimalias} + {\blx@declaredelimaliasauto}} + + \newrobustcmd*{\blx@declaredelimalias}[3][]{% + \ifblank{#1} + {\blx@declaredelimalias@i{}{#2}{#3}} + {\def\do##1{% + \blx@declaredelimalias@i{blx@printdelim@##1@}{#2}{#3}}% + \docsvlist{#1}}} + + \newrobustcmd*{\blx@declaredelimaliasauto}[2]{% + \blx@declaredelimalias@i{}{#1}{#2}% + \ifcsvoid{blx@declaredelimcontexts@#2} + {} + {\def\do##1{% + \blx@declaredelimalias@i{blx@printdelim@##1@}{#1}{#2}}% + \dolistcsloop{blx@declaredelimcontexts@#2}}} + + \def\blx@declaredelimalias@i#1#2#3{% + \ifcsdef{#1#2} + {\blx@inf@delimdeclare{#2}{#1}} + {}% + \csdef{#1#2}{\csuse{#1#3}}} + + \def\blx@delimcontext{none} + \newcommand*{\printdelim}[2][]{% + \ifblank{#1} + {\ifcsdef{blx@printdelim@\blx@delimcontext @#2} + {\csuse{blx@printdelim@\blx@delimcontext @#2}} + {\ifcsdef{#2}% fall back on legacy macros + {\csuse{#2}} + {\blx@warn@delimuse{#2}{*}}}} + {\ifcsdef{blx@printdelim@#1@#2} + {\csuse{blx@printdelim@#1@#2}} + {\blx@warn@delimuse{#2}{#1}}}} + + \newcommand*{\delimcontext}[1]{% + \edef\blx@delimcontext{\blx@delimcontextalias{#1}}} + + \def\blx@delimcontextalias#1{% + \ifcsdef{blx@delimcontextalias@#1} + {\csuse{blx@delimcontextalias@#1}} + {#1}} + + \newcommand*{\DeclareDelimcontextAlias}[2]{% + \csgdef{blx@delimcontextalias@#1}{#2}} + }{} + + +%===================================================================== +% 数据模型定义 +%===================================================================== + %定义类型和载体标识,从gb内容看载体基本属于介质。 + %为与lee zeping的bst的样式统一,使用mark和medium这两域名 + %为单个条目的姓名格式控制增加nameformat和namefmtid两个域 + %为缩略信息文献表增加了shortbooktitle域 + %为多语言排序增加了lansortorder域 + \DeclareDatamodelFields[type=field,datatype=literal]{mark,medium,nameformat} + \DeclareDatamodelFields[type=field,datatype=integer]{namefmtid} + \DeclareDatamodelFields[type=field,datatype=literal]{shortbooktitle} + \DeclareDatamodelFields[type=field,datatype=literal]{lansortorder} + + + +%===================================================================== +% 设置宏包选项 +%===================================================================== + % + % 增加一个控制是否输出annotation域的选项,该域可以用于在文献条目后面输出一些注释信息 + % 20190509,v1,0s,hzz + \newtoggle{bbx:gbannote} + \DeclareBibliographyOption{gbannote}[false]{%biblatex低版本 + \settoggle{bbx:gbannote}{#1}} + \ExecuteBibliographyOptions{gbannote} + % + %用于在文献条目后面输出注释信息的宏 + %FieldFormat{annotation}用于设置注释信息的格式 + \DeclareFieldFormat{annotation}{% + \printtext{\addspace(#1)}% + } + \renewbibmacro*{annotation}{% + \iftoggle{bbx:gbannote}% + {\iffieldundef{annotation}% + {\printfile[annotation]{\bibannotationprefix\thefield{entrykey}.tex}}% + {\printfield{annotation}}}% + {}% + } + + % + % 增加一个控制是否输出type域的选项 + % 20190212,v1,0q,hzz + \newtoggle{bbx:gbfieldtype} + \DeclareBibliographyOption{gbfieldtype}[false]{%biblatex低版本 + \settoggle{bbx:gbfieldtype}{#1}} + \ExecuteBibliographyOptions{gbfieldtype} + + % + % 增加一个控制是否根据页码重设脚注数字标号的选项 + % 20190422,v1,0r,hzz + \newtoggle{bbx:gbfnperpage} + \DeclareBibliographyOption{gbfnperpage}[false]{% + \settoggle{bbx:gbfnperpage}{#1}} + \ExecuteBibliographyOptions{gbfnperpage} + + + % + % 增加一个选项,用于控制是否实现GB/T 7714-2015标准的脚注文献表 + % 20190203,v1.0p,hzz + % 原理方法:默认做patch,文献引用带圈上标数字表示,脚注中的文献用带圈非上标数字做标签 + % 当前面的脚注中已经存在当前文献,那么当前文献内容不再输出而用同(4)这样的方式 + % 需要注意的是由于小页环境和表格中的脚注本身的问题,可能会有一些问题 + \DeclareBibliographyOption{gbfootbib}[false]{% + \ifstrequal{#1}{false}{}{\execgbfootbib}} + \ExecuteBibliographyOptions{gbfootbib} + + %% + \newlength{\footbibmargin} + \newlength{\footbiblabelsep} + \setlength{\footbibmargin}{1em}%脚注的段落左侧缩进距离 + \setlength{\footbiblabelsep}{0.5em}%脚注中标记号与脚注段落的间距 + \def\execgbfootbib% + {% + %开启引用跟踪计数器,为使用\ifciteseen等测试命令 + \ExecuteBibliographyOptions{citetracker=true} + % + %利用footmisc宏包来实现脚注文献的悬挂对齐 + \AtEndPreamble{ + \@ifclassloaded{beamer}{}{ + %beamer类因为其特殊性,为避免冲突不调footmisc。 + %同时footmisc与hyperref宏包也不兼容,所以使用footmisc时会破坏脚注的超链接 + %如果要实现超链接可以将下句注释掉,这里留着主要是实现悬挂对齐。 + %\PassOptionsToPackage{perpage,hang}{footmisc}% + %\RequirePackage{footmisc}% + + %重新实现脚注的根据单页重设脚注号码 + %重新实现脚注的悬挂对齐问题,不再使用footmisc,直接从latex核心代码和hyperref代码进行修改 + %v1.0q 20190317 hzz + %v1.0r 20190422 hzz 根据gbfnperpage选项设置 + \iftoggle{bbx:gbfnperpage}% + {\@addtoreset{footnote}{page}}{}%重设计数器 + +\@ifpackageloaded{hyperref}{%加载hyperref则对\H@@footnotetext做重定义 + \long\def\H@@footnotetext##1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \leftskip \footbibmargin%增加的左侧缩进 + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox% + }% + \color@endgroup}}% + + \long\def\H@@mpfootnotetext##1{% + \global\setbox\@mpfootins\vbox{% + \unvbox\@mpfootins + \reset@font\footnotesize + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel + {\csname p@mpfootnote\endcsname\@thefnmark}% + \leftskip \footbibmargin%增加的左侧缩进 + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox}% + \color@endgroup}} + }{%否则对latex核心代码中的\@footnotetext做重定义 + \long\def\@footnotetext##1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \leftskip \footbibmargin%增加的左侧缩进 + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox% + }% + \color@endgroup}}% + + \long\def\@mpfootnotetext##1{% + \global\setbox\@mpfootins\vbox{% + \unvbox\@mpfootins + \reset@font\footnotesize + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel + {\csname p@mpfootnote\endcsname\@thefnmark}% + \leftskip \footbibmargin%增加的左侧缩进 + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox}% + \color@endgroup}} + } + + \long\def\@makefntext##1{%增加了脚注标记与正文的间隔 + \parindent 1em\noindent \hb@xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1} + + } + + % + %使脚注标记加圈并设置数字的字体为tiny,不使用修改thefootnote的方式 + \def\@makefnmark{\hbox{\@textsuperscript{\textcircled{\tiny\@thefnmark}}}} + %做patch使得脚注内容中的脚注数字标签不上标 + \pretocmd{\@makefntext}{% + \def\@makefnmark{% + \hbox{\textcircled{\tiny\@thefnmark}}% + }% + }{}{} + } + + % + %判断当前文献是否已经引用过且是做的footfullcite(即已经作为脚注输出文献内容) + %记录首次输出时的脚注号码,用于后面再次引用该文献时的输出,比如同(4)。 + %v1.0q 20190309 区分使脚注标注适应minipage中的情况 + \newbibmacro*{citesavefn}{% + \ifciteseen%当被引用过为true + {\ifcsdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}%当已经定义过脚注序号信息 + {\csgdef{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{% + \str@sameentry\gdef\@thefnmark{\csuse{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}}% + \@makefnmark% + }}% + {\csxdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{% + \ifcsstring{@mpfn}{mpfootnote}{\@alph\c@mpfootnote}{\thefootnote}% + }}% + }% + {\csxdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{% + \ifcsstring{@mpfn}{mpfootnote}{\@alph\c@mpfootnote}{\thefootnote}% + %判断在minipage中比较麻烦,这里使用\@mpfn的定义进行判断 + }}% + } + + % + %重定义\footfullcite使完成gb7714-2015的脚注文献要求 + \DeclareCiteCommand{\footfullcite}[\mkbibfootnote]% + {\defcounter{maxnames}{\blx@maxbibnames}%局部定义maxnames和minnames计数器 + \defcounter{minnames}{\blx@minbibnames}%使footfullcite内的作者输出与正文文献表中的一致。 + \usebibmacro{prenote}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}{\setunit{\addcolon\addspace}\printfield{postnote}}}%与ay样式不同,由于已修改postnote域格式,直接用printfield + }% + {\usebibmacro{citesavefn}% + \ifcsdef{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}% + {\csuse{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}}%\nopunct + {\usedriver{\DeclareNameAlias{sortname}{default}}{\thefield{entrytype}}}% + }% + {\multicitedelim}% + {\usebibmacro{postnote}} + + } + + % + % 增加一个选项,用于控制gb7714的使用范围,即英文文献和中文文献使用不同的样式 + % 20180814,v1.0m,hzz + % 原理方法: + % 只为兼容性考虑不做任何处理 + \DeclareBibliographyOption{gbstyle}[true]{%biblatex低版本 + } + + % + % 增加一个控制是否输出文献类型和载体标识的选项 + % + % 原理方法: + % 对于biblatex3.4以上版本DeclareBibliographyOption命令中的[datatype]如果是boolean,那么是可以省略的 + % 所以用老版本的不用[datatype]的命令可以兼容所有biblatex版本 + \newtoggle{bbx:gbtype} + %\DeclareBibliographyOption[boolean]{gbtype}[true]{%biblatex高版本 + \DeclareBibliographyOption{gbtype}[true]{%biblatex低版本 + \settoggle{bbx:gbtype}{#1}} + \ExecuteBibliographyOptions{gbtype} + + % + % 增加一个源文件编码选择选项,当true时可以使用GBK编码。 + % v1.0k, 2018.05.08, by hzz + % + % 原理方法:将需要输出的中文字符串用命令形式表示存储,采用utf8编码时采用bbx文档 + % 内的定义即是utf8编码的中文字符串,但tex源文件是gbk编码时,利用gb7714-2015-gbk.def + % 文档内的gbk编码的字符串覆盖。这种覆盖只能在宏包末尾加载时成功实现,所以使用 + % AtEndOfPackage。该解决思路源自biblatex-caspervector宏包。 + % 另外注意: + % gbk编码的tex文档,利用pdflatex/latex能正确编译,利用xelatex能编译,但中文显示乱码 + % 在源文档前面增加 XeTeX 原语:\XeTeXinputencoding "GBK" 后,显示正常 + % utf-8编码的tex文档,利用xelatex能正确编译,而pdflatex/latex不能编译。 + \newtoggle{bbx:codegbk} + \DeclareBibliographyOption{gbcodegbk}[false]{% + \settoggle{bbx:codegbk}{#1}} + \ExecuteBibliographyOptions{gbcodegbk} + + \def\str@bibliography{参考文献} + \def\str@references{参考文献} + \def\str@bytranslator{译} + \def\str@andotherscn{等} + \def\str@backrefpage{引用页} + \def\str@backrefpages{引用页} + \def\str@noaddress{出版地不详} + \def\str@nopublisher{出版者不详} + \def\str@edition{版} + \def\str@volumecn{卷} + \def\str@numbercn{册} + \def\str@serialcn{第} + \def\str@sameentry{同} + \def\str@incn{见} + \def\str@mathesiscn{硕士学位论文} + \def\str@phdthesiscn{博士学位论文} + \def\str@editorcn{主编} + + \AtEndOfPackage{% + \iftoggle{bbx:codegbk}{% + \ExecuteBibliographyOptions{texencoding = GBK} + \input{gb7714-2015-gbk.def} + }{}} + + % + % 增加一个严格按GB/T 7714-2015给出著录格式控制域的输出的选项 + % v1.0k, 2018.05.08, by hzz + % + % 原理方法: + % 默认设置该选项为真,进而不输出GB/T 7714-2015中没有的域的信息 + % 这样可以避免因为bib文件带有多余的域的信息的输出,比如因为bibtex样式 + % 可能需要用于中英文判断的language域的信息。 + \newtoggle{bbx:gbstrict} + \DeclareBibliographyOption{gbstrict}[true]{% + \settoggle{bbx:gbstrict}{#1}} + \ExecuteBibliographyOptions{gbstrict} + + % + % 增加一个控制标题域超链接设置的选项 + % v1.0k, 2018.05.24, by hzz + % + % 原理方法: + % 利用标题域格式来实现,默认设置该选项为false,不做超链接。 + % 设置为true,则标题设置超链接 + \newtoggle{bbx:titlelink} + \DeclareBibliographyOption{gbtitlelink}[false]{% + \settoggle{bbx:titlelink}{#1}} + \ExecuteBibliographyOptions{gbtitlelink} + + % + % 增加一个控制参考文献标题是否能够被ctex宏包设置的选项 + % v1.0l, 2018.07.02, by hzz + % + % 原理方法: + % 重定义biblatex的宏,去除使用本地化字符串的方式,是的可以利用ctexset进行设置 + \newtoggle{bbx:ctexset} + \DeclareBibliographyOption{gbctexset}[true]{% + \settoggle{bbx:ctexset}{#1}} + \ExecuteBibliographyOptions{gbctexset} + + \AtEndOfPackage{% + \iftoggle{bbx:ctexset}{% + \def\blx@defbibstrings#1#2{% + \def\do##1{\csundef{abx@lstr@##1}\csundef{abx@sstr@##1}}% + \abx@dostrings + \csuse{abx@strings@#1}% + \setkeys{blx@lbx}{#2}% + \let\do\blx@defbibstrings@i + \csxdef{abx@strings@#1}{\abx@dostrings}% + } + }{}} + + + + % + % 增加一个恢复域格式为标准样式的控制选项 + % v1.0k, 2018.05.15, by hzz + % + % 原理方法: + % 默认设置该选项为false,采用国标要求的域格式输出相关域 + % 当设置该选项为true时,则重新利用标准样式的域格式输出相关的域 + \newtoggle{bbx:gbfieldstd} + \DeclareBibliographyOption{gbfieldstd}[false]{% + \settoggle{bbx:gbfieldstd}{#1}% + \ifstrequal{#1}{false}{}{\execgbfdfmtstd}% + } + \ExecuteBibliographyOptions{gbfieldstd} + + % + % 增加一个出版项自动处理控制选项,当true时使用出版者不详等信息补充缺失的出版信息。 + % + \newtoggle{bbx:gbpub} + \DeclareBibliographyOption{gbpub}[true]{% + %\settoggle{bbx:gbpub}{#1} %或采用下面这一句 + \ifstrequal{#1}{false}{\togglefalse{bbx:gbpub}}{\toggletrue{bbx:gbpub}}} + \ExecuteBibliographyOptions{gbpub} + + % + % 增加控制析出文献来源前的标点符号//输出的选项 + % v1.0k, 2018.04.20,added in by hzz + \newtoggle{bbx:gbpunctin} + \DeclareBibliographyOption{gbpunctin}[true]{% + \settoggle{bbx:gbpunctin}{#1}} + \ExecuteBibliographyOptions{gbpunctin} + + + % + % 增加一个处理佚名或noauthor的控制选项 + % + % 原理方法:在顺序编码制中不需要使用,为与作者年制的兼容性考虑,这里也增加避免报错 + \DeclareBibliographyOption{gbnoauthor}[true]{}% + + + % + % 选项设置 + % + \ExecuteBibliographyOptions{ + sorting=none, + useprefix=true, %名字的信息包括前缀 + date = year, %日期仅写到年 + maxbibnames = 3,%设置名字最大数量 + minbibnames = 3, %设置缩减后的名字最小数量 + maxitems = 1,%设置列表最大数量 + minitems = 1, %设置缩减后的列表最小数量 + isbn=false, + } + + % + %为日期相关选项增加选项值gb7714-2015 + % + \csdef{mkdaterangegb7714-2015}#1{% + \begingroup + \blx@metadateinfo{#1}% + \iffieldundef{#1year} + {} + {\printtext[#1date]{% + \blx@gbdate{#1}{}}}% + \endgroup} + + \newrobustcmd*{\blx@gbdate}[3][]{% + \dateeraprintpre{#2#3year}% + \blx@imc@forcezerosy{\thefield{#2#3year}}\ifblank{#1}{}{\printfield{#1}}% + \iffieldundef{#2#3month}{}{\hyphen\blx@imc@forcezerosmdt{\thefield{#2#3month}}}% + \iffieldundef{#2#3day}{}{\hyphen\blx@imc@forcezerosmdt{\thefield{#2#3day}}}} + + + %为姓名格式选择增加的计数器 + \newcounter{gbnamefmtcase} + \def\thegbnamefmtcase{\the\c@gbnamefmtcase} + %为数字标签格式选择增加的计数器/命令 + \newcommand{\mkgbnumlabel}[1]{\mkbibbrackets{#1}} + \def\gbbiblabelopt@bracket{\renewcommand{\mkgbnumlabel}[1]{\mkbibbrackets{##1}}} + \def\gbbiblabelopt@parens{\renewcommand{\mkgbnumlabel}[1]{\mkbibparens{##1}}} + \def\gbbiblabelopt@dot{\renewcommand{\mkgbnumlabel}[1]{##1\adddot}} + \def\gbbiblabelopt@plain{\renewcommand{\mkgbnumlabel}[1]{##1}} + \def\gbbiblabelopt@box{\renewcommand{\mkgbnumlabel}[1]{\framebox{##1}}} + \def\gbbiblabelopt@circle{\renewcommand{\mkgbnumlabel}[1]{\textcircled{##1}}} + %为文献表中数字标签对齐方式选择增加的计数器/命令 + \newcounter{gbalignlabel} + \def\thegbalignlabel{\the\c@gbalignlabel} + %为引用标签标注/文献表中本地化字符串中英文选择增加的计数器/命令 + \newcounter{gbcitelocalcase} + \newcounter{gbbiblocalcase} + \def\thegbcitelocalcase{\the\c@gbcitelocalcase} + \def\thegbbiblocalcase{\the\c@gbbiblocalcase} + +\@ifpackagelater{biblatex}{2016/03/27} + { % 针对biblatex>=3.3版本的选项设置 + % 增加不同语言排序的切换选项 + % numeric样式,不使用该选项,这里给出仅为兼容性考虑 + % v1.0q,20190307,hzz + % + \DeclareBibliographyOption[string]{gblanorder}[chineseahead]{} + + % + % 增加本地化字符串的中英文切换选项 + % gbcitelocal指标注中的本地化字符串 + % gbbiblocal 指文献表中的本地化字符串 + % gblocal 指设置文献表和标注中的本地化字符串 + % v1.0o,20190103,hzz + % + \DeclareBibliographyOption[string]{gbcitelocal}[gb7714-2015]{% + \ifstrequal{#1}{gb7714-2015}{\setcounter{gbcitelocalcase}{0}}{}% + \ifstrequal{#1}{chinese}{\setcounter{gbcitelocalcase}{1}}{}% + \ifstrequal{#1}{english}{\setcounter{gbcitelocalcase}{2}}{}% + } + \ExecuteBibliographyOptions{gbcitelocal} + + \DeclareBibliographyOption[string]{gbbiblocal}[gb7714-2015]{% + \ifstrequal{#1}{gb7714-2015}{\setcounter{gbbiblocalcase}{0}}{}% + \ifstrequal{#1}{chinese}{\setcounter{gbbiblocalcase}{1}}{}% + \ifstrequal{#1}{english}{\setcounter{gbbiblocalcase}{2}}{}% + } + \ExecuteBibliographyOptions{gbbiblocal} + + \DeclareBibliographyOption[string]{gblocal}[gb7714-2015]{% + \ExecuteBibliographyOptions{gbbiblocal=#1}% + \ExecuteBibliographyOptions{gbcitelocal=#1}% + } + %\ExecuteBibliographyOptions{gblocal} %默认值已经通过两个相关选项设置 + + % + % 增加序号标签格式处理选项 + % v1.0l,20180623,hzz + % + \DeclareBibliographyOption[string]{gbbiblabel}[bracket]{% + \csuse{gbbiblabelopt@#1} + } + \ExecuteBibliographyOptions{gbbiblabel} + + % + % 增加姓名大小写格式处理选项 + % + \DeclareBibliographyOption[string]{gbnamefmt}[uppercase]{% + \ifstrequal{#1}{uppercase}{\setcounter{gbnamefmtcase}{0}}{}% + \ifstrequal{#1}{lowercase}{\setcounter{gbnamefmtcase}{1}}{}% + \ifstrequal{#1}{givenahead}{\setcounter{gbnamefmtcase}{2}}{}%given-family + \ifstrequal{#1}{familyahead}{\setcounter{gbnamefmtcase}{3}}{} + \ifstrequal{#1}{pinyin}{\setcounter{gbnamefmtcase}{4}}{}%family-given + \ifstrequal{#1}{reverseorder}{\setcounter{gbnamefmtcase}{5}}{}%family-given/given-family + } + \ExecuteBibliographyOptions{gbnamefmt} + + % + % 增加标签对齐选项 + % + % right是默认的右对齐,left是左对齐,gb7714-2015是项对齐方式 + \DeclareBibliographyOption[string]{gbalign}[right]{% + \ifstrequal{#1}{right}{\setcounter{gbalignlabel}{0}}{} + \ifstrequal{#1}{left}{\setcounter{gbalignlabel}{1}}{} + \ifstrequal{#1}{center}{\setcounter{gbalignlabel}{2}}{} + \ifstrequal{#1}{gb7714-2015}{\setaligngbstyle}{} + } + } + {% 针对biblatex<3.3版本的选项设置 + % 增加不同语言排序的切换选项 + % numeric样式,不使用该选项,这里给出仅为兼容性考虑 + % v1.0q,20190307,hzz + % + \DeclareBibliographyOption{gblanorder}[chineseahead]{} + + % + % 增加序号标签格式处理选项 + % v1.0l,20180623,hzz + % + \DeclareBibliographyOption{gbbiblabel}[bracket]{% + \csuse{gbbiblabelopt@#1} + } + \ExecuteBibliographyOptions{gbbiblabel} + + % + % 增加姓名大小写格式处理选项 + % + \DeclareBibliographyOption{gbnamefmt}[uppercase]{% + \ifstrequal{#1}{uppercase}{\setcounter{gbnamefmtcase}{0}}{}% + \ifstrequal{#1}{lowercase}{\setcounter{gbnamefmtcase}{1}}{}% + \ifstrequal{#1}{givenahead}{\setcounter{gbnamefmtcase}{2}}{}%given-family + \ifstrequal{#1}{familyahead}{\setcounter{gbnamefmtcase}{3}}{} + \ifstrequal{#1}{pinyin}{\setcounter{gbnamefmtcase}{4}}{}%family-given + \ifstrequal{#1}{reverseorder}{\setcounter{gbnamefmtcase}{5}}{}%family-given/given-family + } + \ExecuteBibliographyOptions{gbnamefmt} + + % + % 增加标签对齐选项 + % + % 原理方法:right是默认的右对齐,left是左对齐,gb7714-2015无效,仍然为右对齐模式, + % 因为在这种biblatex低版本中,舍弃了list类环境后,会出错。 + % 注意:texlive2015中的3.0版中的DeclareBibliographyOption选项没有类型说明 + \DeclareBibliographyOption{gbalign}[right]{% + \ifstrequal{#1}{right}{\setcounter{gbalignlabel}{0}}{} + \ifstrequal{#1}{left}{\setcounter{gbalignlabel}{1}}{} + \ifstrequal{#1}{center}{\setcounter{gbalignlabel}{2}}{} + \ifstrequal{#1}{gb7714-2015}{}{} + } + } + + +% +% 针对biblatex<3.3版本的选项设置,比如texlive2015中的3.0版 +% +\defversion{3.0}{opt}{ + \ExecuteBibliographyOptions{ + firstinits=true, %名字有缩写,参考3.1.2.3 Internal + } +} +% +% 针对3.3<=biblatex<3.5版本的选项设置,比如texlive2016中的3.4版 +% +\defversion{3.4}{opt}{ + \ExecuteBibliographyOptions{ + giveninits=true, %名字有缩写,参考3.1.2.3 Internal + } +} +% +% 针对3.7<=biblatex<=3.9版本的选项设置,比如texlive2017中的3.7版 +% +\defversion{3.7}{opt}{ + \ExecuteBibliographyOptions{ + giveninits=true, + urldate =edtf, %iso8601 + eventdate =edtf, + } +} +% +% 针对3.10<=biblatex版本的选项设置,比如texlive2018中的3.11版 +% +\defversion{3.10}{opt}{ + \ExecuteBibliographyOptions{ + giveninits=true, + urldate =gb7714-2015, %iso,iso8601,edtf + eventdate =gb7714-2015, + } +} + +% +% 根据biblatex版本信息,选择选项设置 +% +% 原理方法:如下这种选择机制能自动兼容更新的版本,但对于老版本 +% 必须要把情况列全。 +\iftoggle{iftlfive}{\switchversion{3.0}{opt}}{}%biblatex<=3.2 +\iftoggle{iftlsix}{\switchversion{3.4}{opt}}{}%3.3<=biblatex<=3.6 +\iftoggle{iftlseven}{\switchversion{3.7}{opt}}{}%biblatex=3.7 +\iftoggle{iftleight}{\switchversion{3.7}{opt}}{}%3.8<=biblatex<=3.9 +\iftoggle{iftlnine}{\switchversion{3.10}{opt}}{}%biblatex=3.10 +\iftoggle{iftlatest}{\switchversion{3.10}{opt}}{}%biblatex最新3.11 + + +%===================================================================== +% 设置本地化字符串 +%===================================================================== + % + % 新建当地化字符串,用来记录“等”字符、“和”字符 + % + \NewBibliographyString{andotherscn} + \NewBibliographyString{andothersincitecn} + \NewBibliographyString{andothersincite} + \NewBibliographyString{andcn} + \NewBibliographyString{andothersjp} + \NewBibliographyString{andotherskr} + \NewBibliographyString{andjp} + \NewBibliographyString{andkr} + \NewBibliographyString{andincitecn} + \NewBibliographyString{andincite} + \NewBibliographyString{volumecn} + \NewBibliographyString{numbercn} + \NewBibliographyString{serialcn} + \NewBibliographyString{incn} + \NewBibliographyString{mathesiscn} + \NewBibliographyString{phdthesiscn} + \NewBibliographyString{editorcn} + \NewBibliographyString{editorscn} + + + + % + % 修改一些当地化字符串 + % + % 原理方法:直接利用当地化格式english修改出一些中文的格式,具体修改内容参考english.lbx文件 + % 当然也可以增加比如上面定义的andotherscn + % 注意:在lbx文件和bbx文件中定义本地字符串的不同语法,两个参数和一个参数的区别 + + \DefineBibliographyStrings{english}{ + bibliography = {\str@bibliography}, + references = {\str@references}, + bytranslator= {\str@bytranslator},%\addperiod,%将trans. by 改成 译\addcomma\ + and = {\addcomma},%将第2和3人名间的and符号改成逗号,用\finalnamedelim命令也可以定义,参见3.9.1节 + andcn = {\addcomma},%and本地化字符串的中文对应词 + andincitecn = {\addcomma},%将标注中的分开,便于与文献表中的区分 + andincite = {\addcomma}, + %andothers = {et al.},%将超过3个人名的省略,et al.改成为 等 + andotherscn = {\str@andotherscn},%将超过3个人名的省略,et al.改成为 等 + andothersincitecn={\str@andotherscn},%将标注中的分开,便于与文献表中的区分 + andothersincite={et al\adddot}, + backrefpage = {\str@backrefpage:}, + backrefpages = {\str@backrefpages:}, + in={in\intitlepunct}, + volumecn={\str@volumecn}, + numbercn={\str@numbercn}, + serialcn={\str@serialcn}, + andothersjp={他}, + andotherskr={외}, + andjp={和}, + andkr={和}, + incn={\str@incn\addcolon\addspace}, + mathesiscn={\str@mathesiscn}, + phdthesiscn={\str@phdthesiscn}, + editorscn={\str@editorcn}, + editorcn={\str@editorcn}, +} + + % + % 增加两个命令用于临时的局部的修改本地化字符串 + % 其中\setlocalbibstring修改缩写字符串,setlocalbiblstring修改长字符串 + % 注意使用时因为是局部修改,因此要将其与需要修改的引用命令放在一个编组符号内 + % v1.0t,hzz,20190525 + \newcommand{\setlocalbibstring}[2]{% + \csdef{abx@sstr@#1}{#2}} + \newcommand{\setlocalbiblstring}[2]{% + \csdef{abx@lstr@#1}{#2}} + +%===================================================================== +% 动态数据修改 +%===================================================================== +% +% 各层次的数据映射和动态修改 +% +% 原理方法: +% 1. 进行语言包括中英文判断,并设置和记录,比如记录到userf,usere中 +% 2. 增加文献标识符如[M],[J]等,对一些容易混淆的域进行设置以增强兼容性 +% 3. \DeclareSourcemap命令对于biblatex3.11以下版本只能出现一次,3.11版开始支持多个 +% 4. \DeclarestyleSourcemap在biblatex v3.7版开始可以支持出现多次 +% 5. 把作者和译者信息准确的记录到userf,usere中,用于后面判断是否是cjk字符。 +% 注意:这里用userf,usere而不是namee,namef,是因为只有把name列表转成域,才能有效读取姓名中的字符, +% 如果用namee,namef,name信息会自动解析,所以就不能为cjk判断提供需要的信息 +% +% 不同的文献类型使用相同的驱动输出可以有5种方法: +% 1. 是数据源层的映射,将其它类型转换为某一要使用驱动的类型 +% 2. 是样式层映射,也是将其它类型转换为某一要使用驱动的类型 +% 3. 是驱动层映射,也是将其它类型转换为某一要使用驱动的类型 +% 4. 定义驱动类型别名DeclareBibliographyAlias,将其它类型定义为某一要使用驱动的类型的别名 +% 驱动别名定义本质上是做了驱动层映射 +% 5. 直接定义不同的类型的驱动,但驱动内容相同。 +% +% 关于数据映射和驱动使用的考虑如下: +% 1. 为避免利用biber输出bib文件时的数据变动,尽量不在数据源层映射做类型转换 +% 2. 为减少代码量,尽量少做内容相同的不同类型驱动 +% 3. 因此类型相关的处理主要在样式层映射、驱动层映射、驱动别名 +% 4. 由于biblatex默认做的驱动别名处理可能增加一些信息比如masterthesis转thesis时增加的type +% 可以在样式层映射做某些需要避免这种默认处置的转换 +% 5. 当没有避免默认行为的需求时,全部采用驱动别名的方式处理,等价于驱动层的映射 +% +% 文献类型和驱动考虑如下: +% 1. 连续出版物及析出文献有其特殊性,因此考虑两类periodical和article +% newpaper映射为article,并以note域做区分特殊处理 +% 2. 专著和专著中的析出文献是主要的类型,因此考虑book和inbook +% standard映射为book或inbook,并以note域做区分特殊处理 +% collection和proceedings基本与book类似,因此做book驱动别名处理 +% incollection和inproceedings基本与inbook类似,因此做inbook驱动别名处理 +% 3. 专利类型有其特殊性,考虑patent类型 +% 4. 电子资源类型有其特殊性,考虑online类型 +% 5. 报告类型与book有点类似,出版项处理与book一样,但有时又要有修改和更新日期 +% 因此考虑用一种类型来输出,使用report类型 +% 6. 手册/学位论文等类型与book有点类似,但对于出版项处理时,有缺省时,直接省略, +% 同时有version和edition的区别,因此考虑用一种类型来输出,使用manual类型 +% 7. 包括报告,学位论文在内的其它所有的类型,都做一个判断,当没有出版项时, +% 且存在网址信息时,将其转换为online类型输出,否则都做为manual类型输出。 +% 8. 备选类型misc当存在网址时直接转换为online,由于howpublished域可用于描述 +% 更多的信息,因此不存在网址时,独立做一个备选格式 +% 9. 出版项主要以如下方式处理: +% (a) location+institution+date 仅用于连续出版物 +% (b)publisher+location+date 用于需要完整输出出版项的类型,比如book,collection,proceedings,in*,report +% (c)institution+location+date 用于出版项缺失时不输出的类型,包括manual,thesis,archive等其他类型 +% (d)printlist{insitution} 用于电子资源,仅输出出版者或组织,为数据映射方便,本来默认的organization域转换为用insitution输出。 +% (e) 不输出,主要用于连续出版物析出的文献 +% 10. 日期以如下方式处理: +% date 由于存在biblatex选项,因此通过选项控制,数据源为date解析数据或year +% urldate 由于存在biblatex选项,因此通过选项控制,输出到日,且用[]包围,数据源为urldate +% newsdate 用于公告日期,公开日期或新闻日期,输出到日,但无包围符号,数据源为date +% modifydate 用于更新或修改日期,输出到日,且用()包围,数据源为date或enddate或eventdate + + +\DeclareSourcemap{ +\maps[datatype=bibtex]{% + \map{%当没有作者时将editor转成author + \pernottype{inbook}%因为in系列中editor可能用来表示bookauthor,所以排除 + \pernottype{inproceedings} + \pernottype{incollection} + \pernottype{periodical}%因为peridical直接使用editor,所以排除 + %注意notfield在低版本biblatex中没有 + %\step[notfield=author,final]%当author不存在,将editor复制给author + \step[fieldsource=editor,fieldtarget=author]%并删除editor + } + \map{%当没有作者时将translator转成author + \pernottype{inbook} + \pernottype{inproceedings} + \pernottype{incollection} + %\step[notfield=author,final]%当author不存在,将translator复制给author + \step[fieldsource=translator,fieldtarget=author]%并删除translator + } + \map{%让address和location同步,biblatex中address是location的别名 + %因此输出的时候只有location信息,但处理过程中是可以存在address的。 + %\step[notfield=address,final] + \step[fieldsource=location,final] + \step[fieldset=address,origfieldval] + } + \map{%让address和location同步 + %\step[notfield=location,final] + \step[fieldsource=address,final] + \step[fieldset=location,origfieldval] + } + \map{%处理在bib文件用mark标记文献类型标识符的情况 + \step[fieldsource=mark,final] + \step[fieldset=usera, origfieldval] + } + \map{%处理在bib文件中直接给出文献的姓名格式为lowercase的情况 + \step[fieldsource=nameformat,match=lowercase,final] + \step[fieldset=namefmtid,fieldvalue={1}] + } + \map{%处理在bib文件中直接给出文献的姓名格式为givenahead的情况 + \step[fieldsource=nameformat,match=givenahead,final] + \step[fieldset=namefmtid,fieldvalue={2}] + } + \map{%处理在bib文件中直接给出文献的姓名格式为familyahead的情况 + \step[fieldsource=nameformat,match=familyahead,final] + \step[fieldset=namefmtid,fieldvalue={3}] + } + \map{%处理在bib文件中直接给出文献的姓名格式为pinyin的情况 + \step[fieldsource=nameformat,match=pinyin,final] + \step[fieldset=namefmtid,fieldvalue={4}] + } + \map{%根据article确定文献类型标识符 + \pertype{article} + \step[fieldset=usera, fieldvalue={J}] + } + \map{%根据periodical确定文献类型标识符 + \pertype{periodical} + \step[fieldset=usera, fieldvalue={J}] + \step[fieldsource=author] %有时会把author和editor混淆,处理后使用editor + \step[fieldset=editor, origfieldval] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%根据增加一个新闻报纸的类型newspaper确定文献类型标识符 + \pertype{newspaper} + \step[fieldset=usera, fieldvalue={N}] + \step[fieldset=note, fieldvalue=news]%因为没有专门的驱动,记录note方便映射为article后判断 + } + \map{%对应增加的一个数据库类型database确定文献类型标识符 + \pertype{database} + \step[fieldset=usera, fieldvalue={DB}] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个数据集类型dataset确定文献类型标识符 + \pertype{dataset} + \step[fieldset=usera, fieldvalue={DS}]% + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个软件类型software确定文献类型标识符 + \pertype{software} + \step[fieldset=usera, fieldvalue={CP}] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个舆图类型map确定文献类型标识符 + \pertype{map} + \step[fieldset=usera, fieldvalue={CM}]% + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个档案类型archive确定文献类型标识符 + \pertype{archive} + \step[fieldset=usera, fieldvalue={A}] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%因为misc类型本身就是没有类型,而不像其它文献有明确的类型,所以 + %当misc类型带有网址时,直接将其转换为online类型 + \pertype{misc} + \step[fieldsource=url,final] + \step[typesource=misc,typetarget=online] + } + \map{%对应增加的一个备选类型misc确定文献类型标识符 + \pertype{misc} + \step[fieldset=usera, fieldvalue={Z}]% + } + \map{ + \pertype{book} + \pertype{inbook} + \step[fieldset=usera, fieldvalue={M}] + \step[fieldsource=version] %有时会把version和edition混淆,处理后直接用edition + \step[fieldset=edition, origfieldval] + } + \map{%兼容老的standard类型,确定文献类型标识符 + \pertype{standard} + \step[fieldset=usera, fieldvalue={S}] + \step[fieldset=note, fieldvalue=standard]%因为没有专门的驱动,记录note方便映射为book和inbook后判断 + } + \map{ + \pertype{patent} + \step[fieldset=usera, fieldvalue={P}] + } + \map{ + \pertype{inproceedings} + \pertype{conference}%兼容老的conference类型 + \step[fieldset=usera, fieldvalue={C}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{proceedings} + \step[fieldset=usera, fieldvalue={C}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{incollection} + \step[fieldset=usera, fieldvalue={G}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{collection} + \step[fieldset=usera, fieldvalue={G}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{report} + \pertype{techreport}%兼容老的techreport类型 + \step[fieldset=usera, fieldvalue={R}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{thesis} + \pertype{mastersthesis}%兼容老的mastersthesis和phdthesis类型 + \pertype{phdthesis} + \step[fieldset=usera, fieldvalue={D}] + \step[fieldsource=publisher]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{ + \pertype{online} + \pertype{electronic}%兼容老的electronic类型 + \pertype{www}%兼容老的www类型 + \step[fieldset=usera, fieldvalue={EB}] + \step[fieldsource=publisher]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval]%因为online的出版项处理类似手册 + \step[fieldsource=organization]%有时会把organization和institution混淆,处理后使用institution,以增强兼容性 + \step[fieldset=institution, origfieldval] + } + \map{ + \pertype{manual} + \step[fieldset=usera, fieldvalue={A}] + \step[fieldsource=edition]%有时会把version和edition混淆,处理后使用version + \step[fieldset=version, origfieldval] + \step[fieldsource=publisher]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + \step[fieldsource=organization]%有时会把organization和institution混淆,处理后使用institution,以增强兼容性 + \step[fieldset=institution, origfieldval] + } + \map{ + \pertype{unpublished} + \step[fieldset=usera, fieldvalue={Z}] + } + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={author}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={editor}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={translator}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={bookauthor}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map{%处理一些用year表示date的情况 + %这样处理将会设置date域,并使得labeldatesource变为空,因为date的前缀为空(如果是urldate,那么labeldatesource就是url)。 + %同时date域会被biblatex自动解析为year,month,day,并且覆盖原来的year信息 + \step[fieldsource=year] + \step[fieldset=date, origfieldval] + } + \map{%将entrykey放入keywords中用于后期使用 + \step[fieldsource=entrykey] + \step[fieldset=keywords, origfieldval] + } + \map{%文献题名的中文判断,将信息保存到userd中,避免因为标签生成原因导致title域被清除而产生问题 + \step[fieldsource=title, match=\regexp{[\x{2FF0}-\x{9FA5}]},final]% + \step[fieldset=userd, fieldvalue={chinese}] + } + \map{\step[fieldsource=title,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userd,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=title,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userd,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=title,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userd,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=title,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userd,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userd,且存在title域的默认设置为英文 + \step[fieldsource=title,final] + \step[fieldset=userd,fieldvalue={english}] + } + \map{%作者的中文判断 + \step[fieldsource=author, match=\regexp{[\x{2FF0}-\x{9FA5}]},final] + \step[fieldset=userf, fieldvalue={chinese}] + } + \map{\step[fieldsource=author,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userf,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=author,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userf,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=author,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userf,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=author,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userf,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userf,且存在author域的默认设置为英文 + \step[fieldsource=author,final] + \step[fieldset=userf,fieldvalue={english}] + } + \map{%译者的中文判断 + \step[fieldsource=translator, match=\regexp{[\x{2FF0}-\x{9FA5}]},final] + \step[fieldset=usere, fieldvalue={chinese}] + } + \map{\step[fieldsource=translator,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=usere,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=translator,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=usere,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=translator,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=usere,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=translator,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=usere,fieldvalue={korean}]%韩语 + } + \map{%将没有设置usere,且存在translator域的默认设置为英文 + \step[fieldsource=translator,final] + \step[fieldset=usere,fieldvalue={english}] + } + \map{%编者的中文判断 + \step[fieldsource=editor, match=\regexp{[\x{2FF0}-\x{9FA5}]},final]%直接匹配cjk字符,unicode编码位置从2FF0到9FA5 + \step[fieldset=userc, fieldvalue={chinese}] + } + \map{\step[fieldsource=editor,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userc,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=editor,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userc,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=editor,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userc,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=editor,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userc,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userc,且存在editor域的默认设置为英文 + \step[fieldsource=editor,final] + \step[fieldset=userc,fieldvalue={english}] + } + \map{%编者的中文判断 + \step[fieldsource=bookauthor, match=\regexp{[\x{2FF0}-\x{9FA5}]},final]%直接匹配cjk字符,unicode编码位置从2FF0到9FA5 + \step[fieldset=userb, fieldvalue={chinese}] + } + \map{\step[fieldsource=bookauthor,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userb,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=bookauthor,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userb,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=bookauthor,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userb,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=bookauthor,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userb,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userc,且存在editor域的默认设置为英文 + \step[fieldsource=bookauthor,final] + \step[fieldset=userb,fieldvalue={english}] + } + \map{\step[fieldsource=userd,final]%userd存在则用根据标题的语言设定language + \step[fieldset=language,origfieldval]%本身language存在则不设定 + } + \map{\step[fieldsource=userf,final]%userd不存在,而userf存在则根据author的语言设定language + \step[fieldset=language,origfieldval] + }%如果没有作者和标题,那么剩下的最可能有意义的只有网址了,而网址通常是英文的,因此不用再进一步对其它域进行判断了。 + \map{%将没有设置的language设置成en,即认为不是中文的就是英文的。 + \step[fieldset=language,fieldvalue={english}] + } + \map{%一条文献的语言已经设定在language域中,由于出版项相关宏中使用userd判断, + %所以将一条文献的主体语言设定到userd中,本身前面userd已经设定,但没有处理无标题的情况, + %这里的处理等价于没有标题时,利用作者的语言设定userd,再没有作者,则默认用英文设定userd + \step[fieldsource=language] + \step[fieldset=userd,origfieldval] + } + \map{%当文献给出language域时,设置文献要使用的本地化字符串的语言 + \step[fieldsource=language,match=\regexp{(e|E)(n|N)(g|G)(l|L)(i|I)(s|S)(h|H)},final] + \step[fieldset=langid,fieldvalue={english}] + } + \map{ + \step[fieldsource=language,match=\regexp{(r|R)(u|U)(s|S)(s|S)(i|I)(a|A)(n|N)},final] + \step[fieldset=langid,fieldvalue={russian}] + } + \map{% + \step[fieldsource=language,match=\regexp{(f|F)(r|R)(e|E)(n|N)(c|C)(h|H)},final] + \step[fieldset=langid,fieldvalue={french}] + } + \map{% + \step[fieldsource=language,match=\regexp{(c|C)(h|H)(i|I)(n|N)(e|E)(s|S)(e|E)},final]%中日韩语目前都用english, + \step[fieldset=langid,fieldvalue={english}] + } + \map{% + \step[fieldsource=language,match=\regexp{(j|J)(a|A)(p|P)(a|A)(n|N)(e|E)(s|S)(e|E)},final]%中日韩语目前都用english, + \step[fieldset=langid,fieldvalue={english}] + } + \map{% + \step[fieldsource=language,match=\regexp{(k|K)(o|O)(r|R)(e|E)(a|A)(n|N)},final]%中日韩语目前都用english, + \step[fieldset=langid,fieldvalue={english}] + } +} +} + + +% +% 修改输入的参考文献数据,样式层的操作 +% +% 原理方法:因为biblatex3.0版的map不使用foreach选项,所以需要一个一个写,以处理特殊字符 +\defversion{3.0}{map}{ + \DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map{%尝试未定义数据模型的standard类型映射为其他类型book或inbook, + %standard类型在blx-dm中有出现,但仅定义了类型,域和约束等都没有定义 + %因为可能要映射两种类型,所以不能在驱动层处理,因为要做判断 + \step[fieldsource=booktitle,final]%当存在booktitle域是映射为inbook + \step[typesource=standard, typetarget=inbook, final] + } + \map{%剩下的全部映射为book + \step[typesource=standard, typetarget=book, final] + } +% \map{%先于标准样式的driver层映射,以取消type设置 +% \step[typesource=mastersthesis, typetarget=thesis, final] +% %\step[fieldset=type, fieldvalue=mathesis] +% } +% \map{%先于标准样式的driver层映射,以取消type设置 +% \step[typesource=phdthesis, typetarget=thesis, final] +% %\step[fieldset=type, fieldvalue=phdthesis] +% } + \map{%先于标准样式的driver层映射,以取消type设置 + \step[typesource=techreport, typetarget=report, final] + %\step[fieldset=type, fieldvalue=techreport] + } + \map{% + \pertype{report} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=report,typetarget=online] + \step[fieldset=note,fieldvalue={report}] + } + \map{% + \pertype{thesis} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=thesis,typetarget=online] + } + \map{% + \pertype{manual} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=manual,typetarget=online] + } + \map{% + \pertype{unpublished} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=unpublished,typetarget=online] + } + \map{% + \pertype{database} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=databasetypetarget=online] + } + \map{% + \pertype{dataset} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=dataset,typetarget=online] + } + \map{% + \pertype{software} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=software,typetarget=online] + } + \map{% + \pertype{map} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=map,typetarget=online] + } + \map{% + \pertype{archive} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=archive,typetarget=online] + } + \map[overwrite]{%这里还必须有overwrite,注意不同版本存在差异,比如texlive2015变16后biber有变化(20161207修改正确) + \step[fieldsource=note, final]%将note域信息复制给keywords,用于输出时容易区分标准和报纸 + \step[fieldset=keywords, fieldvalue={,}, append] + \step[fieldset=keywords, origfieldval, append] + } + \map[overwrite]{%title,booktitle,journaltitle,journal,publisher,address,location,institution,organization + \step[fieldsource={title}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={booktitle}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={journaltitle}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={journal}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={publisher}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={address}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={location}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={institution}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={booktitle}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}] + } + \map[overwrite]{ + \step[fieldsource={booktitle}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}] + } + } + } +} + +% +% 修改输入的参考文献数据,样式层的操作 +% +% 原理方法:biblatex3.4以上版本 +\defversion{3.4}{map}{ + \DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map{%尝试未定义数据模型的standard类型映射为其他类型book或inbook, + %standard类型在blx-dm中有出现,但仅定义了类型,域和约束等都没有定义 + %因为可能要映射两种类型,所以不能在驱动层处理,因为要做判断 + \step[fieldsource=booktitle,final]%当存在booktitle域是映射为inbook + \step[typesource=standard, typetarget=inbook, final] + } + \map{%剩下的全部映射为book + \step[typesource=standard, typetarget=book, final] + } +% \map{%先于标准样式的driver层映射,以取消type设置 +% \step[typesource=mastersthesis, typetarget=thesis, final] +% %\step[fieldset=type, fieldvalue=mathesis] +% } +% \map{%先于标准样式的driver层映射,以取消type设置 +% \step[typesource=phdthesis, typetarget=thesis, final] +% %\step[fieldset=type, fieldvalue=phdthesis] +% } + \map{%先于标准样式的driver层映射,以取消type设置 + \step[typesource=techreport, typetarget=report, final] + %\step[fieldset=type, fieldvalue=techreport] + } + \map{% + \pertype{report} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=report,typetarget=online] + \step[fieldset=note,fieldvalue={report}] + } + \map{% + \pertype{thesis} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=thesis,typetarget=online] + } + \map{% + \pertype{manual} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=manual,typetarget=online] + } + \map{% + \pertype{unpublished} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=unpublished,typetarget=online] + } + \map{% + \pertype{database} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=databasetypetarget=online] + } + \map{% + \pertype{dataset} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=dataset,typetarget=online] + } + \map{% + \pertype{software} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=software,typetarget=online] + } + \map{% + \pertype{map} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=map,typetarget=online] + } + \map{% + \pertype{archive} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=archive,typetarget=online] + } + \map[overwrite]{%这里还必须有overwrite,注意不同版本存在差异,比如texlive2015变16后biber有变化(20161207修改正确) + \step[fieldsource=note, final]%将note域信息复制给keywords,用于输出时容易区分标准和报纸 + \step[fieldset=keywords, fieldvalue={,}, append] + \step[fieldset=keywords, origfieldval, append] + } + \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{ + \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}] + } + \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{ + \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}] + } + \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,% + address,location,institution,organization}]{ + \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + } + } +} + +\iftoggle{iftlfive}% + {\switchversion{3.0}{map}}%%当采用biblatex<=3.2版本时 + {\switchversion{3.4}{map}}%%当采用3.3<=biblatex版本时 + +% +%驱动别名等价于驱动层映射 +% +\DeclareBibliographyAlias{newspaper}{article}% +\DeclareBibliographyAlias{inproceedings}{inbook}%会议论文文献类型驱动 +\DeclareBibliographyAlias{conference}{inbook}%会议论文文献类型驱动 +\DeclareBibliographyAlias{incollection}{inbook}%文集中析出文献类型驱动 +\DeclareBibliographyAlias{collection}{book}%%文集类型驱动 +\DeclareBibliographyAlias{proceedings}{book}%会议论文集文献类型驱动 +\DeclareBibliographyAlias{thesis}{manual}%学位论文驱动 +\DeclareBibliographyAlias{unpublished}{manual}%其它类型驱动 +\DeclareBibliographyAlias{database}{manual} +\DeclareBibliographyAlias{dataset}{manual} +\DeclareBibliographyAlias{software}{manual} +\DeclareBibliographyAlias{map}{manual} +\DeclareBibliographyAlias{archive}{manual} + + + +%===================================================================== +% 参考文献表环境 +%===================================================================== +% +% 列表格式 +% +% 增加一个\bibitemindent尺寸用于控制list环境的itemindent +% v1.0l,20180615,hzz +\setlength{\bibhang}{\biblabelsep}% +\newlength{\bibitemindent} +\setlength{\bibitemindent}{0pt} + + +\defbibenvironment{bibliography} + {\list + {\printtext[labelnumberwidth]{% + \printfield{labelprefix}% + \printfield{labelnumber}}} + {\setlength{\labelwidth}{\labelnumberwidth}% + \setlength{\labelsep}{\biblabelsep}% + \setlength{\leftmargin}{\bibhang}% + \addtolength{\leftmargin}{\labelnumberwidth}% + \setlength{\itemindent}{\bibitemindent}% + \setlength{\itemsep}{\bibitemsep}% + \setlength{\parsep}{\bibparsep}}% + \renewcommand*{\makelabel}[1]{\hss##1}} + {\endlist} + {\item} + +% +% 顺序编码制-标签对齐方式处理 +% +% 原理方法:利用选项提供的计数器数值做选择 +% 左对齐,右对齐为list环境下的处理,此时list环境的\labelwidth只能设置一个,是最宽标签的宽度 +% 项对齐则是在段落环境下做的处理。 +% 左对齐时,参考文献各项内容对齐,序号标签与参考文献项内容的间距可变 +% 右对齐时,参考文献各项内容对齐,序号标签与参考文献项内容的间距相等,标签与页边距离可变 +% 项对齐时,序号标签贴在页边,序号标签与参考文献项内容的间距相等 +% 修改序号标签格式为: +% \DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}} %源来自numeric.BBX +% \DeclareFieldFormat{labelnumberwidth}{\ttfamily\mkbibbrackets{#1}\hfill} +\DeclareFieldFormat{labelnumberwidth}{% +\ifcase\value{gbalignlabel}%右对齐,整个标签为右对齐 + \mkgbnumlabel{#1}% +\or%左对齐,整个标签为左对齐 + \mkgbnumlabel{#1}\hfill% +\or%中间对齐,比如:序号数字居于[]中间 + \hfil\mkgbnumlabel{\hfill#1\hfill}\hfil% +\fi} + +% +% 修改序号标签格式为以各条参文献为基础进行对齐的方式,即序号与条目内容间隔相等的方式。 +\def\setaligngbstyle{% +\def\blx@bibitem##1{% + \blx@ifdata{##1} + {\begingroup + \blx@getdata{##1}% + \blx@bibcheck + \iftoggle{blx@skipentry}{}{% + \blx@setdefaultrefcontext{##1}% + \global\let\blx@noitem\@empty + \blx@setoptions@type\abx@field@entrytype + \blx@setoptions@entry + \blx@thelabelnumber + \addtocounter{instcount}\@ne + \blx@initsep + \blx@namesep + \csuse{blx@item@\blx@theenv}\relax +% \blx@initsep %移动到上面去,恢复bibnamesep等的作用机制 +% \blx@namesep + \csuse{blx@hook@bibitem}% + \blx@execute + \blx@initunit + \blx@anchor + \blx@beglangbib + \bibsentence + \blx@pagetracker + \blx@driver\abx@field@entrytype + \blx@postpunct + \blx@endlangbib}% + \par\endgroup}%这里增加了一个\par + {}} +\newlength{\lengthid} +\newlength{\lengthlw} +\newcommand{\itemcmd}{% +\settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} +\addtolength{\lengthid}{\biblabelsep} +\setlength{\lengthlw}{\textwidth} +\addtolength{\lengthlw}{-\lengthid} +\addvspace{\bibitemsep}%恢复\bibitemsep的作用 +%\parshape 2 0em \textwidth \lengthid \lengthlw +\hangindent\lengthid +\mkgbnumlabel{\printfield{labelnumber}}% +\hspace{\biblabelsep}} +% +% 简单的段落环境 +\defbibenvironment{bibliography} +{\begingroup\setlength{\parindent}{0em}} +{\endgroup} +{\itemcmd}} + + +%===================================================================== +% 设置单元或块等的标点 +%===================================================================== +\renewrobustcmd*{\bibinithyphendelim}{\addhighpenspace}%用于处理姓名中名部分存在-的情况,比如ZHANG Yu-xin +\renewcommand*{\subtitlepunct}{\addcolon\addspace} %修改标题和其它标题信息间的标点,来源biblatex.def, +% +% 利用set实现的多语言文献不同语言间的分隔符 +% 20170411,双语之间用newline替换par,避免采用gb7714-2015的项对齐方式第二语言间分段导致没有缩进 +% +% 原理方法:set方法可以参考3.11.5 Entry Sets,4.11.1 Entry Sets +% 这里调整一下两种语言参考文献的间隔,源来自biblatex.def +\renewcommand*{\entrysetpunct}{\adddot\newline\nobreak} +\renewcommand*{\bibpagespunct}{\addcolon\addthinspace}%%页码引用格式的修改,修改为用冒号 +%\renewcommand{\relateddelim}{}%\par + +%===================================================================== +% 修改域的格式,重定义域的输出宏 +%===================================================================== +% +% 新增文献类型标识符的格式 +% []前的nobreak,从GB4.1节的例子看不应该加,所以去掉 +% 但因为考虑到cjk字符和[]之间可能添加空格,所以仍然加上 +% 而[]中间的内容,从4.6.2节的例子看也是可以分割的,因此内部的nobreak也可以去掉 +% +\DeclareFieldFormat{gbtypeflag}{% +\iftoggle{bbx:url}% + {\iffieldundef{url}%当存在url时,增加一个OL标识符 + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}% + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}% + }% + {\ifentrytype{online}% + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}% + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}% + }% +} + +% +% 新增用于报纸的文献类型标识符的格式 +% +\DeclareFieldFormat{gbtypeflagn}{%用于报纸newspaper +\iftoggle{bbx:url}% + {\iffieldundef{url}%当存在url时,增加一个OL标识符 + {\nobreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% + {\nobreak\printtext{[}\nobreak N\printtext{\texttt{/}OL]}\nobreak}% + }% + {\nobreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% +} + +% +% 新增用于标准的文献类型标识符的格式 +% +\DeclareFieldFormat{gbtypeflags}{%用于标准standard +\iftoggle{bbx:url}% + {\iffieldundef{url}%当存在url时,增加一个OL标识符 + {\nobreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% + {\nobreak\printtext{[}\nobreak S\printtext{\texttt{/}OL]}\nobreak}% + }% + {\nobreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% +} + +% +% 重设title等参考文献信息的输出格式 +% +% 原理方法:修改来自biblatex.def文件的原格式 +\newcommand{\bibtitlefont}{} +\newcommand{\bibauthorfont}{} +\newcommand{\bibpubfont}{} + +\DeclareFieldFormat{title}{#1\adddot\addthinspace} +\DeclareFieldFormat{journaltitle}{#1\isdot}%添加\isdot用于缩写名带点情况,将其转换为缩写点,便于标点的追踪 +\DeclareFieldFormat{issuetitle}{#1} +\DeclareFieldFormat{maintitle}{#1} +\DeclareFieldFormat{booktitle}{#1} +\DeclareFieldFormat%将期刊等文献的标题中原来带的引号去掉 + [article,patent,thesis,unpublished] + {title}{#1\adddot\addthinspace}%\mkbibquote{#1\isdot} +\DeclareFieldFormat%将期刊等文献的标题中原来带的引号去掉 + [inbook,incollection,inproceedings] + {title}{#1}%\nopunct\unspace +\DeclareFieldFormat{url}{\url{#1}} %%url相关输出,url域修改如本行,源来自biblatex.def +\def\UrlFont{\rmfamily}%设置url字体为roman字体%\ttfamily +%\urlstyle{rm} %使用这句也一样 +\setcounter{biburlnumpenalty}{100} %让url可以在数字后断行 +\setcounter{biburlucpenalty}{100} %让url可以在大写字母后断行 +\setcounter{biburllcpenalty}{100} %让url可以在小写字母后断行 +\DeclareFieldFormat{doi}{% + \rmfamily{DOI}\addcolon\space + \ifhyperref + {\href{https://doi.org/#1}{\nolinkurl{#1}}} + {\nolinkurl{#1}}} +% +% 标题的字母大小写格式修改 +% +% 注意:修改标题的字母大小写,不能用前面的title的格式而要用titlecase +% 因为titlecase is applied to the contents of the field directly,title is not +%\DeclareFieldFormat{titlecase}{\MakeCapital#1}%重设标题格式,将其修改为首字母大写 +\DeclareFieldFormat{titlecase}{\iftoggle{bbx:titlelink}{% +\iffieldundef{url}{\MakeCapital#1}{% +\href{\thefield{url}}{#1}}}{\MakeCapital#1}}%重设标题格式,将其修改为首字母大写 +\DeclareFieldFormat{pages}{#1}%去掉前面引导页码的pp.等字符,\mkpageprefix[bookpagination]{#1} +\DefineBibliographyExtras{english}{\renewcommand*{\bibrangedash}{-}}%将页码间隔符替换会英文的短横线 + +\def\execgbfdfmtstd{%恢复到标准样式的设置 +\DeclareFieldFormat{title}{\mkbibemph{##1}} +\DeclareFieldFormat + [article,inbook,incollection,inproceedings,patent,thesis,unpublished] + {title}{\mkbibquote{##1\isdot}} +\DeclareFieldFormat + [suppbook,suppcollection,suppperiodical] + {title}{##1} +\DeclareFieldFormat{journaltitle}{\mkbibemph{##1}} +\DeclareFieldFormat{issuetitle}{\mkbibemph{##1}} +\DeclareFieldFormat{maintitle}{\mkbibemph{##1}} +\DeclareFieldFormat{booktitle}{\mkbibemph{##1}} +\DeclareFieldFormat{url}{\mkbibacro{URL}\addcolon\space\url{##1}} +\DeclareFieldFormat{titlecase}{##1} +\DeclareFieldFormat{pages}{\mkpageprefix[bookpagination]{##1}} +} + +% +% 文献标题后的标点问题 +% v1.0k,20180405,为texlive2017以上版本中的beamer兼容性做的处理,Hu Zhenzhen +% +% 原理方法:如下代码处理texlive2017以上版本中,beamer中文献的标题后出现两个点的情况: +% texlive2017以上的beamer中对macro{title}做了patch,正常情况下不会出现两个点的情况,但由于 +% 之前为了处理texlive2015,2016下的title格式添加了adddot,导致出现两个点的情况,而且也影响 +% 析出文献的//符号的输出,因此再次对macro{title}做patch消除beamer中做apptocmd时添加的\newunitpunct +\ifboolexpr{% + test{\iftoggle{iftlfive}} + or + test{\iftoggle{iftlsix}} + }{}% + {%texlive 2017对应iftlseven以上版本 + \@ifclassloaded{beamer}{ + \DeclareFieldFormat{title}{#1}% + \DeclareFieldFormat[article,patent,thesis,unpublished]{title}{#1} + \AtBeginDocument{% + \patchcmd{\abx@macro@title}{\newunitpunct}{}{}{}}}{} + } + + +% +% 修改译者位置格式 +% +% 原理方法:修改来自biblatex.def文件的bytranslator+others宏的格式 +\renewbibmacro*{bytranslator+others}{\bibauthorfont% + \ifnameundef{translator} + {} + {%\usebibmacro{bytranslator+othersstrg} + %\setunit{\addspace}% + \printnames[bytranslator]{translator}% + \clearname{translator}% + %从macro*{bytranslator+othersstrg}%中可以看到当地化字符串格式的引用前的代码处理 + %比如生成cotranslator等用于调用cotranslator所代表的当地化字符串 + \usebibmacro{bytranslator+othersstrg}%“译”的位置换到下面来,即放到译者后面。 + %\setunit{\addspace}% + \newunit}% + \usebibmacro{withothers}} + + +% +% 修改作者数量超过限定值,做省略时的处理格式 +% v1.0,20160701,hzz +% v1.0O,20190103,hzz,修改利用新定义的一个分隔符strandothersdelim +% +% 原理方法:判断作者或译者是否中文,若中文用字符等,否则用et al. 。 +\renewbibmacro*{name:andothers}{\bibauthorfont% + \ifboolexpr{ + test {\ifnumequal{\value{listcount}}{\value{liststop}}} + and + test \ifmorenames + }{\ifnumgreater{\value{liststop}}{1}% + {\finalandcomma}% + {}% +\printdelim{andothersdelim}\printdelim{strandothersdelim}% +}{%当是译者的时候需要特殊处理:从7.2节看等,译前面加逗号,但从示例看等和译同时出现时,译前的逗号没有,比如: +%袁训来, 陈哲, 肖书海, 等. +%胡泳, 范海燕, 译. +%潘惠霞, 魏婧, 杨艳, 等译. +\ifcurrentname{translator}{\addcomma\addthinspace}{}%为了实现上述第二个示例情况做的处理 +}} + + +% +% 修改省略作者后的本地化字符串,比如et al. +% v1.0o,20190103,hzz +% +% 原理方法:默认情况下判断作者或译者是否中文,若中文用字符andotherscn=“等”,否则用andothers=“et al.”。 +% 非默认情况,根据选项信息,选择选择强制中文或英文 +% 首先设置全局的,然后设置文献表中的,这一等价于将所有的cite命令环境都设置过了 +% 而不用对每一个引用命令单独设置,比如cite,parancite,textcite都设置 +\DeclareDelimFormat{strandothersdelim}{% + \edef\userfieldabcde{userd}% + \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andotherscn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andotherskr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andothersjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\bibstring{andothers}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{andothers}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{andothers}}{}% + \or% + \bibstring{andotherscn}% + \or% + \bibstring{andothers}% + \fi} + +% +% 修改最后一个作者前的字符串,比如 and +% v1.0o,20190103,hzz +% +% 原理方法:默认情况下判断作者或译者是否中文,若中文用字符andcn=“和”,否则用and=“and”。 +% 非默认情况,根据选项信息,选择选择强制中文或英文 +% 首先设置全局的,然后设置文献表中的,这一等价于将所有的cite命令环境都设置过了 +% 而不用对每一个引用命令单独设置,比如cite,parancite,textcite都设置 +\DeclareDelimFormat{finalnamedelim}{% + \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% + \addspace% + \edef\userfieldabcde{userd}% + \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andcn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andkr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\bibstring{and}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{and}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{and}}{}% +\space% + \or% + \bibstring{andcn}\space% + \or% + \bibstring{and}\space% + \fi} + + +% +% 重设title的输出 +% +% 20180425,v1.0k,为标题增加字体控制命令,Hu Zhenzhen +% 原理方法:将文献类型标识符输出出去,原输出来自biblatex.def文件 +% 利用toggle做标识符是否输出的判断 +\renewbibmacro*{title}{% + \ifboolexpr{% + test{\iffieldundef{title}}% + and + test{\iffieldundef{subtitle}}% + }% + {}% + {\printtext[title]{\bibtitlefont%增加字体控制命令 + \printfield[titlecase]{title}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct}% + \printfield[titlecase]{subtitle}}% + \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 + {\setunit{\subtitlepunct}\printfield{titleaddon}}% + \iftoggle{bbx:gbtype}{% + \iffieldundef{note}{\printfield[gbtypeflag]{usera}}%在标题后直接给出文献标识字母,判断一下,是否是报纸和标准 + {\iffieldequalstr{note}{standard}{\printfield[gbtypeflags]{usera}}%判断是否为标准 + {\iffieldequalstr{note}{news}{\printfield[gbtypeflagn]{usera}}%判断是否为报纸 + {\printfield[gbtypeflag]{usera}}}%其它 + }}{}% + %\iffieldundef{booktitle}{\newunit}{}%当title是析出时,不要标点 + %\newunit +}% +}} + +% +% 作者信息的输出格式 +% +% 20180425,v1.0k,为作者增加字体控制命令,Hu Zhenzhen +% 20180603,v1.0l,增加使用nameformat域来选择姓名格式 +\DeclareNameFormat{namefmtselected}{% +\iffieldundef{namefmtid}{}% +{\defcounter{gbnamefmtcase}{\thefield{namefmtid}}}% +\ifcase\value{gbnamefmtcase}% + \ifgiveninits + {\usebibmacro{name:gbuppercase} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:gbuppercase} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or + \ifgiveninits + {\usebibmacro{name:gblowercase} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:gblowercase} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or + \ifgiveninits + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or + \ifgiveninits + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or +\usebibmacro{name:gbpinyin} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}% +\or + \ifnumequal{\value{listcount}}{1} + {\ifgiveninits + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% + \ifboolexpe{% + test {\ifdefvoid\namepartgiven} + and + test {\ifdefvoid\namepartprefix}} + {} + {\usebibmacro{name:revsdelim}}} + {\ifgiveninits + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}}% +\fi + \usebibmacro{name:andothers}} + +\DeclareNameAlias{default}{namefmtselected}%姓名的默认格式采用可选的模式 +\DeclareNameAlias{sortname}{default}% Used in the bibliography %family-given/given-family +\DeclareNameAlias{citename}{default}% Default used by \citename + +\DeclareDelimFormat[bib,biblist]{andothersdelim}{\addcomma\addspace} +%\DeclareDelimFormat[textcite]{andothersdelim}{\addspace}% + +%GB/T 7714-2015 风格,全部大写 +\newbibmacro*{name:gbuppercase}[4]{\bibauthorfont% +\renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 +\renewcommand*{\revsdnamepunct}{}% + \ifuseprefix% + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifdefvoid{#3}{}{% + \ifcapital% + {\mkbibnameprefix{\MakeCapital{#3}}\isdot}% + {\mkbibnameprefix{#3}\isdot}% + \ifprefchar{}{\bibnamedelimc}}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{\MakeUppercase{#2}}\isdot}%\MakeCapital + \ifdefvoid{#4}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}%后缀前加逗号 + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifboolexpe{% + test {\ifdefvoid{#2}} + and + test {\ifdefvoid{#3}}} + {}{\revsdnamepunct}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{\MakeUppercase{#2}}\isdot}%\MakeCapital + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}% + \ifdefvoid{#4}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}%%后缀前加逗号 +} + +%GB/T 7714-2015 风格,大小写不变,根据bib文件内输入原样输出 +\newbibmacro*{name:gblowercase}[4]{\bibauthorfont% + \renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 + \renewcommand*{\revsdnamepunct}{}%%来源biblatex.def + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifdefvoid{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifprefchar{}{\bibnamedelimc}}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{{#1}}}\isdot% + \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{{#2}}\isdot}%\MakeCapital + \ifdefvoid{#4}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}%后缀前加逗号 + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{{#1}}}\isdot% + \ifboolexpe{% + test {\ifdefvoid{#2}} + and + test {\ifdefvoid{#3}}} + {}{\revsdnamepunct}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{{#2}}\isdot}%\MakeCapital + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot} + \ifdefvoid{#4}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}%%后缀前加逗号 +} + +%中文常见风格,汉语拼音全拼模式 +\newbibmacro*{name:gbpinyin}[4]{\bibauthorfont% +\renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉,%来源biblatex2.STY +\renewcommand*{\revsdnamepunct}{}%%来源biblatex.def +\renewrobustcmd*{\bibnamedelima}{\mbox{-}}% + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifdefvoid{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifprefchar{}{\bibnamedelimc}}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\MakeSentenceCase{\mkbibnamegiven{#2}}\isdot}%\MakeCapital + \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}} + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifboolexpe{% + test {\ifdefvoid{#2}} + and + test {\ifdefvoid{#3}}} + {} + {\revsdnamepunct}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{\MakeCapital{#2}}\isdot}%\MakeCapital + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot} + \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}% +} + + +\@ifpackagelater{biblatex}{2016/03/27}%biblatex<3.2版的情况 + {}{ + %GB/T 7714-2015 风格,全部大写 + \renewbibmacro*{name:gbuppercase}[4]{\bibauthorfont% + \renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 + \renewcommand*{\revsdnamepunct}{}%%来源biblatex.def + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifblank{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifpunctmark{'}{}{\bibnamedelimc}}% + %\mkbibnamelast{#1}\isdot + \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{\MakeUppercase{#1}}}\isdot%\MakeUppercase %\mkbibnamelast{\MakeUppercase{#1}} %\MakeSentenceCase + %注意上一句\MakeCapital后面如果再跟一个{}包含#1,则没有效果,可能是包在里面少了一层展开 + %因为机构名通常包括在{}内,所以要多展开一次才行,所以这里去掉#1外面的{} + %\mkbibnamelast{\MakeUppercase{#1}}\isdot + %\ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%这句放到后面 + \ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamefirst{\MakeUppercase{#2}}\isdot}% + \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}}%后缀前加逗号 + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + %\mkbibnamelast{#1}\isdot %3.9.1 Generic Commands and Hooks,对姓重新处理,如下句: %\mkbibnamelast{\MakeUppercase{#1}} + \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{\MakeUppercase{#1}}}\isdot %大写,参考4.6.4 Miscellaneous Commands,\MakeUppercase %\MakeSentenceCase + %\mkbibnamelast{\MakeUppercase{#1}}\isdot + %\ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%这句放到后面 + \ifblank{#2#3}{}{\revsdnamepunct}% + \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{\MakeUppercase{#2}}\isdot}% + \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}% + \addcomma\addspace% + \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}%%后缀前加逗号 + }% + } + + %GB/T 7714-2015 风格,大小写不变,根据bib文件内输入原样输出 + \renewbibmacro*{name:gblowercase}[4]{\bibauthorfont% + \renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 + \renewcommand*{\revsdnamepunct}{}%%来源biblatex.def + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifblank{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifpunctmark{'}{}{\bibnamedelimc}}% + \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{{#1}}}\isdot%\MakeUppercase %\mkbibnamelast{\MakeUppercase{#1}} %\MakeSentenceCase + \ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamefirst{{#2}}\isdot}% + \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}}%后缀前加逗号 + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{{#1}}}\isdot %大写,参考4.6.4 Miscellaneous Commands,\MakeUppercase %\MakeSentenceCase + \ifblank{#2#3}{}{\revsdnamepunct}% + \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{{#2}}\isdot}% + \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}% + \addcomma\addspace% + \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}%%后缀前加逗号 + }% + } + + %中文常见风格,汉语拼音全拼模式 + \renewbibmacro*{name:gbpinyin}[4]{\bibauthorfont% + \renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 + \renewcommand*{\revsdnamepunct}{}%%来源biblatex.def + \renewrobustcmd*{\bibnamedelima}{\mbox{-}}% + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifblank{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifpunctmark{'}{}{\bibnamedelimc}}% + \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{\MakeUppercase{#1}}}\isdot%\MakeUppercase %\mkbibnamelast{\MakeUppercase{#1}} %\MakeSentenceCase + \ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\MakeSentenceCase{\mkbibnamefirst{#2}}\isdot}% + \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}} + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{\MakeUppercase{#1}}}\isdot %大写,参考4.6.4 Miscellaneous Commands,\MakeUppercase %\MakeSentenceCase + \ifblank{#2#3}{}{\revsdnamepunct}% + \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{\MakeUppercase{#2}}\isdot}% + \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}% + \addcomma\addspace% + \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}% + }% + } + + %%biblatex<3.2版的情况,姓名的处理格式带参数 + \DeclareNameFormat{namefmtselected}{% + \iffieldundef{namefmtid}{}% + {\defcounter{gbnamefmtcase}{\thefield{namefmtid}}}% + \ifcase\value{gbnamefmtcase}% + \iffirstinits + {\usebibmacro{name:gbuppercase}{#1}{#4}{#5}{#7}} + {\usebibmacro{name:gbuppercase}{#1}{#3}{#5}{#7}}% + \or + \iffirstinits + {\usebibmacro{name:gblowercase}{#1}{#4}{#5}{#7}} + {\usebibmacro{name:gblowercase}{#1}{#3}{#5}{#7}}% + \or + \iffirstinits + {\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}} + {\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}}% + \ifblank{#3#5} + {} + {\usebibmacro{name:revsdelim}}% + \or + \iffirstinits + {\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}} + {\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}% + \or + \usebibmacro{name:gbpinyin}{#1}{#3}{#5}{#7}% + \or + \ifnumequal{\value{listcount}}{1} + {\iffirstinits + {\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}} + {\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}}% + \ifblank{#3#5} + {} + {\usebibmacro{name:revsdelim}}} + {\iffirstinits + {\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}} + {\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}% + \fi + \usebibmacro{name:andothers}} +} + +% +% url和url日期格式 +% +\renewbibmacro*{url+urldate}{% + %\usebibmacro{url}%%更换url的位置,放到下面 + \iffieldundef{urlyear}% + {}{%\setunit*{\addspace}% + \usebibmacro{urldate}}% + \setunit{\addperiod\addspace}% + \usebibmacro{url}} +\renewbibmacro*{url}{\printfield{url}} + + + + +% +% 日期信息的输出格式,针对biblatex<3.7版本 +% +\defversion{3.4}{date}{ + \renewbibmacro*{urldate}{% + \addthinspace\printtext{[}\printfield{urlyear}% + \iffieldundef{urlmonth}{}{\bibrangedash\printfield{urlmonth}}% + \iffieldundef{urlday}{}{\bibrangedash\printfield{urlday}}\printtext{]}} + + \newbibmacro*{newsdate}{%%新增加一个公告日期,公开日期或新闻日期 + \iffieldundef{year}{}{\printfield{year}% + \iffieldundef{month}{}{\bibrangedash\printtext{\thefield{month}}% + \iffieldundef{day}{}{\bibrangedash\printfield{day}}}}% + } + + \newbibmacro*{modifydate}{%新增加一个带括号的日期,用于表示电子资源的更新和修改日期,而公告日期则按日期格式 + \ifboolexpr{% + test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% + }% + {}%更新或修改日期通常有day信息 + {\iffieldequalstr{year}{}{%替换\iffieldundef{year},因为year总是存在,但为空 + \iffieldundef{endyear}{% + \iffieldundef{eventyear}{}{\printtext{\mkbibparens{\printtext{\printfield{eventyear}}% + \iffieldundef{eventmonth}{}{\bibrangedash\thefield{eventmonth}}% + \iffieldundef{eventday}{}{\bibrangedash\printfield{eventday}}}}% + }% + }{% + \iffieldundef{endyear}{}{\printtext{\mkbibparens{\printtext{\printfield{endyear}}% + \iffieldundef{endmonth}{}{\bibrangedash\thefield{endmonth}}% + \iffieldundef{endday}{}{\bibrangedash\printfield{endday}}}}% + }% + }% + }% + {% + \iffieldundef{year}{}{\printtext{\mkbibparens{\printtext{\printfield{year}}% + \iffieldundef{month}{}{\bibrangedash\thefield{month}}% + \iffieldundef{day}{}{\bibrangedash\printfield{day}}}}% + }% + }% + }}% +} + +% +% 日期信息的输出格式,针对3.9>=biblatex>=3.7版本 +% +\defversion{3.7}{date}{ + \DeclareFieldFormat{urldate}{##1} + \renewbibmacro*{urldate}{% + \addthinspace\printtext{[}\printurldate\printtext{]}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令 + + % + % 专利的公告日期、或报纸的日期的输出宏 + % 20160701,v1.0,新增加 + % 20180405,v1.0k,为biblatexv3.7-3.9版本,出现多出点bug做处理,Hu Zhenzhen + % + % 原理方法:加上printtext避免破坏异步标点机制 + % + \newbibmacro*{newsdate}{% + \printtext{\blx@edtfdate{}{}}% + } + + \newbibmacro*{modifydate}{%新增加一个带括号的日期,用于表示电子资源的更新和修改日期,而公告日期则按日期格式 + \ifboolexpr{% + test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% + }% + {}%更新或修改日期通常有day信息 + {\iffieldundef{year}{% + \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{(}\printeventdate\printtext{)}}}% + {\printtext{(}\printenddate\printtext{)}}% + }{\iffieldequalstr{year}{}{%因为year存在,但为空 + }{\printtext{(}\blx@edtfdate{}{}\printtext{)}}% + }% + }}% +} + +% +% 日期信息的输出格式,针对biblatex>=3.10版本 +% +\defversion{3.10}{date}{ + \DeclareFieldFormat{urldate}{##1} + \renewbibmacro*{urldate}{% + \addthinspace\printtext{[}\printurldate\printtext{]}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令 + + % + % 专利的公告日期、或报纸的日期的输出宏 + % 20160701,v1.0,新增加 + % 20180405,为biblatexv3.10版本,出现多出点bug做处理,Hu Zhenzhen + % + % 原理方法:加上printtext避免破坏异步标点机制 + % 本可以用\printdate,但由于date选项设置为year,所以仅会给出年份 + % 所以无法再用选项设置的方法,印象需要用底层的命令 + % 这里可以用\blx@isodate,但用\blx@gbdate试图避免版本判断 + \newbibmacro*{newsdate}{%% + \printtext{\blx@gbdate{}{}}%%\blx@isodate{}{}% + } + + % + \newbibmacro*{modifydate}{%新增加一个带括号的日期,用于表示电子资源的更新和修改日期,而公告日期则按日期格式 + \ifboolexpr{% + test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% + }% + {}%更新或修改日期通常有day信息 + {\iffieldundef{year}{% + \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{(}\printeventdate\printtext{)}}}% + {\printtext{(}\printenddate\printtext{)}}% + }{\iffieldequalstr{year}{}{%因为year存在,但为空 + }{\printtext{(}\blx@gbdate{}{}\printtext{)}}% + }% + }}% +} + +% +% biblatex>v3.8版利用related实现双语文献的处理 +% +\defversion{3.8}{dblang}{ + %为了实现v3.8以上版本的双语文献,采用related的方法代替set方法,因为set方法已经无法实现了, + %因为set不再复制其第一个成员的信息。于是定义一个命令,用于动态的修改数据,即添加related域的信息 + %其中使用了\DeclareStyleSourcemap,但由于其只能出现在导言区中,因此\defdoublelangentry命令也只能出现在导言区中 + \newcommand{\defdoublelangentry}[2]{% + \edef\entrykeya{##1} + \edef\entrykeyb{##2} + \DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map{ + \step[fieldsource=entrykey, match=\entrykeya, final] + \step[fieldset=related, fieldvalue=\entrykeyb] + } + } + } + } +} + +% +% 关联文献间的分隔符 +% +\renewcommand{\relateddelim}{\adddot\newline\nobreak}%\par,而作者年样式不需要修改,因为没有项对齐的标签问题 + +% +% 关联文献的输出格式,针对3.9>=biblatex>=3.7版本 +% +% 原理方法:因为related宏中带有##了,所以无法封装到defversion中了。所以直接做判断 +% 下面这一段主要针对v3.8-3.10,因为我提问后,biblatex作者为3.11版增加了一个钩子控制relatedblock前的分隔符。 +\ifboolexpr{ +test{\iftoggle{iftleight}} +or +test{\iftoggle{iftlnine}} +}{\renewbibmacro*{related}{%standard.bbx + \ifboolexpr{ test {\iffieldundef{related}} or test {\ifrelatedloop} } + {} + {\usebibmacro{begrelated}% + \def\bbx@tempa{}% + \setcounter{bbx:relatedtotal}{0}% + \def\do##1{% + \entrydata{##1}{% + \ifrelatedloop + {} + {\stepcounter{bbx:relatedtotal}% + \gappto{\bbx@tempa}{##1,}}}}% + \docsvfield{related}% + \restorefield{related}{\bbx@tempa}% + \ifnumgreater{\value{bbx:relatedtotal}}{0} + {\listcsxadd{bbx:relatedloop}{\strfield{entrykey}}% + \iffieldundef{clonesourcekey} + {} + {\listcsxadd{bbx:relatedloop}{\strfield{clonesourcekey}}}% + \setcounter{bbx:relatedcount}{0}% + \def\do{% + \stepcounter{bbx:relatedcount}% + \ifnumgreater{\value{bbx:relatedcount}}{0}%这里从1改为0 + {\ifcsundef{relateddelim\strfield{relatedtype}} + {\printtext{\relateddelim}} + {\printtext{\csuse{relateddelim\strfield{relatedtype}}}}} + {}}% + \ifbibmacroundef{related:\strfield{relatedtype}} + {\appto{\do}{\usebibmacro{related:default}}} + {\appto{\do}{\usebibmacro*{related:\strfield{relatedtype}}}}% + \iffieldformatundef{related:\strfield{relatedtype}} + {\def\bbx@tempa{related}} + {\def\bbx@tempa{related:\strfield{relatedtype}}}% + \iffieldformatundef{relatedstring:\strfield{relatedtype}} + {\def\bbx@tempb{relatedstring:default}} + {\def\bbx@tempb{relatedstring:\strfield{relatedtype}}}% + \printtext[\bbx@tempa]{% + \usebibmacro{begrelatedloop}% + \iffieldundef{relatedstring} + {\ifboolexpr{ + test {\ifnumgreater{\value{bbx:relatedtotal}}{1}} + and + test {\ifbibxstring{\thefield{relatedtype}s}} + } + {\printtext[\bbx@tempb]{% + \bibstring[\mkrelatedstring]{\thefield{relatedtype}s}}} + {\iffieldbibstring{relatedtype} + {\printtext[\bbx@tempb]{% + \bibstring[\mkrelatedstring]{\thefield{relatedtype}}}} + {}}} + {\iffieldbibstring{relatedstring} + {\printtext[\bbx@tempb]{% + \bibstring[\mkrelatedstring]{\thefield{relatedstring}}}} + {\printfield[\bbx@tempb]{relatedstring}}}% + \docsvfield{related}% + \usebibmacro{endrelatedloop}}}% + {}% + \usebibmacro{endrelated}}} +}{} + +% +% 关联文献块前的分隔符,针对biblatex>3.11 +% +% 原理方法:因为增加了begrelateddelim钩子,所以不需要重定义related输出宏 +\defversion{3.11}{related}{ +\renewcommand{\begrelateddelim}{\adddot\newline\nobreak} +} + +\iftoggle{iftlfive}{\switchversion{3.4}{date}}{}%biblatex<=3.2 +\iftoggle{iftlsix}{\switchversion{3.4}{date}}{}%3.3<=biblatex<=3.6 +\iftoggle{iftlseven}{\switchversion{3.7}{date}}{}%biblatex=3.7 +\iftoggle{iftleight}{\switchversion{3.7}{date}\switchversion{3.8}{dblang}}{}%3.8<=biblatex<=3.9 +\iftoggle{iftlnine}{\switchversion{3.10}{date}\switchversion{3.8}{dblang}}{}%biblatex=3.10 +\iftoggle{iftlatest}{\switchversion{3.10}{date}\switchversion{3.8}{dblang}\switchversion{3.11}{related}}{}%biblatex最新3.11 + +% +% 调整doi+eprint+url格式 +% 2016.07.01 byhzz +% 2019.05.01 byhzz 在eprint前增加一个空格 +% 原理方法:源来自standard.bbx,因为页码后面直接跟引用日期,没有标点所以去掉其中的标点。 +\renewbibmacro*{doi+eprint+url}{% +% \iftoggle{bbx:doi}%把doi的位置放到url后面 +% {\printfield{doi}} +% {}% + %\newunit\newblock + \iftoggle{bbx:eprint} + {\iffieldundef{eprint}{}{\newunit\usebibmacro{eprint}}} + {}% + %\newunit\newblock + \iftoggle{bbx:url} + {\usebibmacro{url+urldate}} + {} + \newunit\newblock + \iftoggle{bbx:doi} + {\printfield{doi}} + {}} + +% +% 调整页码的格式,即chapter+pages格式 +% +\renewbibmacro*{chapter+pages}{% +\iftoggle{bbx:gbstrict}{}{% + \printfield{chapter}}% + \iffieldundef{pages}{}{%这里增加一个判断,当没有页码时就不输出 + \setunit{\bibpagespunct}% + \printfield{pages}}% + %\newunit %这里的标点去掉 +} + +% +% 当location等出版项超过maxitem缩减后不再输出etal +% +\DeclareListFormat{location}{% + \usebibmacro{list:delim}{#1}% + #1\isdot} +\DeclareListAlias{institution}{location} +\DeclareListAlias{publisher}{location} + +% 新增一个样式用于输出连续出版物的地址,单位,时间, +% 用于periodical连续出版物的出版社和地址的处理 +% +% v1.0k,20180425,为出版信息增加字体控制命令,hzz +% %类似\newbibmacro*{publisher+location+date} +\newbibmacro*{location+institution+date}{\bibpubfont% +\iftoggle{bbx:gbpub}% +{\testCJKfirst{userd}% +\ifboolexpr{% +test {\iflistundef{location}} and test {\iflistundef{institution}}% +}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}% +{\printtext{[S.l.\space :\space s.n.\adddot]}}% +}{% +\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}}{\printtext{[S.l.\adddot]}}}% + {\printlist{location}}% +\addcolon\addspace% +\iflistundef{institution}{% +\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}}{\printtext{\mkbibbrackets{s.n.}}}}% +{\printlist{institution}}}% +\setunit{\addcomma\addspace}% + %\usebibmacro{date}% + \printfield{year}% + \bibrangedash% + \iffieldundef{endyear}{}{\printfield{endyear}}% + \newunit}% +{\printlist{location}% + \iflistundef{institution}% + {\setunit*{\addcomma\space}} + {\setunit*{\addcolon\space}}% + \printlist{institution}% + \setunit*{\addcomma\space}% + \usebibmacro{date}% + \newunit}% +} +% +% 通用的出版社和地址的处理 +% +% 原理方法:当没有出版社地址时,直接判断title的信息是否是中文,若为中文,则写出版地不详,否则用英文的字符表示。 +% 事实上title对于每个文献来说是必须的,所以用它判断是最快的,而且一般标题和出版社的语言是一样的。 +% 注意标准standard类型,因为当没有出版项时直接省略,所以做特殊处理 +\renewbibmacro*{publisher+location+date}{\bibpubfont% +\iftoggle{bbx:gbpub}% +{\testCJKfirst{userd}% + \ifboolexpr{ test {\iflistundef{location}} and test {\iflistundef{publisher}} }% + {\iffieldequalstr{note}{standard}{}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}{\printtext{[S.l.\space :\space s.n.\adddot]}}}}% + {\iflistundef{location}{%\adddot + \iffieldequalstr{note}{standard}{}%%从gbt7714-2015标准第19页看到,标准存在出版项时输出,没有时完全省略。 + {\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}\addcolon\addspace}{\printtext{[S.l.\adddot]}\addcolon\addspace}}}% \bibstring{noaddress} + {\printlist{location}\addcolon\addspace}%%\addcolon\addspace% + \iflistundef{publisher}{% + \iffieldequalstr{note}{standard}{}% + {\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}% + {\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}}}% + {\printlist{publisher}}}% +\setunit*{\addcomma\addspace}%\addcomma\addspace% +\usebibmacro{date}%%\newunit %去掉这个标点 +}% +{\printlist{location}% + \iflistundef{publisher} + {\setunit*{\addcomma\space}} + {\setunit*{\addcolon\space}}% + \printlist{publisher}% + \setunit*{\addcomma\space}% + \usebibmacro{date}%%\newunit + }% +} + +% +% 修改了一个institution+location+date用于manual、report、thesis等类型 +% +% 20180425,v1.0k,增加了字体控制命令,hzz +% 20190105,v1.0o,加了一个编组避免\usebibmacro{date}把month和day信息去掉 +\renewbibmacro*{institution+location+date}{\bibpubfont%当没有institution时不处理。 +{\printlist{location}%%加了一个编组避免\usebibmacro{date}把month和day信息去掉 + \iflistundef{institution} + {\setunit*{\addcomma\space}} + {\setunit*{\addcolon\space}}% + \printlist{institution}% + \setunit*{\addcomma\space}% + \usebibmacro{date}% + %\newunit + }} + +% +% 对volume卷信息格式做出修改 +% v1.0o,20190105,hzz +% +\DeclareFieldFormat{volume}{% +\testCJKfirst{userd}% +\iftoggle{ifCJKforgbt}% +{\bibstring{serialcn}#1\bibstring{volumecn}}% +{\bibstring{volume}~#1}% +}% volume of a book +\DeclareFieldFormat[article,periodical]{volume}{#1}% volume of a journal + +% +% 对number册信息格式做出修改 +% v1.0o,20190105,hzz +% +\DeclareFieldFormat{number}{#1}% +\DeclareFieldFormat[book,collection,inbook,% +incollection,proceedings,inproceedings]{number}{% +\testCJKfirst{userd}% +\iftoggle{ifCJKforgbt}% +{\bibstring{serialcn}#1\bibstring{numbercn}}% +{#1}% +}% + +% +% 对edition版本信息格式做出修改 +% +\DeclareFieldFormat{edition}{\bibtitlefont%源来自biblatex.DEF +\testCJKfirst{userd}% +\iftoggle{ifCJKforgbt}% +{\ifinteger{#1}% +{\printtext{#1\str@edition}}% +{#1\isdot}}% +{\ifinteger{#1}% +{\mkbibordedition{#1}~\bibstring{edition}}% +{#1\isdot}}} + +% +% 对version的版本信息做出修改 +% +\DeclareFieldFormat{version}{\bibtitlefont%源来自biblatex.DEF +\testCJKfirst{userd}% +\ifinteger{#1}% +{\iftoggle{ifCJKforgbt}{\printtext{#1\str@edition}}% +{\mkbibordedition{#1}~\bibstring{version}}}% +{#1\isdot}} + +% +% 修改析出文献的文集的标题与附加标题间的符号 +% +\renewbibmacro*{booktitle}{% + \ifboolexpr{ + test {\iffieldundef{booktitle}} + and + test {\iffieldundef{booksubtitle}} + } + {} + {\printtext[booktitle]{\bibtitlefont% + \printfield[titlecase]{booktitle}% + \setunit{\subtitlepunct}% + \printfield[titlecase]{booksubtitle}}% + \newunit%标点换成下一句 + \setunit{\subtitlepunct}}% + \printfield{booktitleaddon}} + + +% +% 调整期刊名的格式 +% +% v1.0k,20180425,增加了字体控制命令,hzz +\renewbibmacro*{journal+issuetitle}{\bibpubfont%源来自standard.bbx + \usebibmacro{journal}% + %\setunit*{\addspace}% + \setunit*{\addcomma\addspace}%修改为增加一个逗号 + \iffieldundef{series} + {} + {\newunit + \printfield{series}% + \setunit{\addspace}}% + %\usebibmacro{volume+number+eid}% + %\setunit{\addspace}% + \usebibmacro{issue+date}% + %\setunit{\addcolon\space}% + \iffieldundef{volume}{}{\setunit{\addcomma\space}}% + %换成逗号和空格 + \usebibmacro{issue}% + \usebibmacro{volume+number+eid}%把卷期放到年份后面 + %\newunit + } + + + +% +% 调整期刊卷和期的格式 +% +\renewbibmacro*{volume+number+eid}{%源来自standard.bbx +\iftoggle{bbx:gbfieldstd}{% + \printfield{volume}% + \setunit*{\adddot}% + \printfield{number}% + \setunit{\addcomma\space}% + \printfield{eid}}{% + \printfield{volume}% + %\setunit*{\adddot}%去掉点号 + %\printfield{number}% + \iffieldundef{number}{}{\printtext{\mkbibparens{\printfield{number}}}}%增加一个圆括号 + \iffieldundef{eid}{}{% + \setunit{\addcomma\space}% + \printfield{eid}}}} + +% +% 调整期刊年份的格式 +% +\renewbibmacro*{issue+date}{%去掉括号 + \printtext{%去掉了[parens] + \iffieldundef{issue} + {%\usebibmacro{date} + \iffieldundef{note}{\usebibmacro{date}}%判断一下,是否是报纸 + {\iffieldequalstr{note}{news}{\usebibmacro{newsdate}}%判断是否为报纸 + {\usebibmacro{date}}% + }}% + {\iftoggle{bbx:gbstrict}{}{\printfield{issue}% + \setunit*{\addspace}}% + %\usebibmacro{date} + \iffieldundef{note}{\usebibmacro{date}}%判断一下,是否是报纸 + {\iffieldequalstr{note}{news}{\usebibmacro{newsdate}}%判断是否为报纸 + {\usebibmacro{date}}% + }}}% + %\newunit + } + +% +% 调整页码前的标点和去掉期刊文章等页码后面的标点 +% +\renewbibmacro*{note+pages}{%源来自standard.bbx + %\printfield{note}%不要note,note用来判断是否是报纸newspaper + \iffieldundef{pages}{}{ + \setunit{\bibpagespunct}% + \printfield{pages}}% + %\newunit + } + + +% +% 编者的符号修改一下 +% v1.0 2016-07-01 +% v1.0q 2019-03-01 hzz 修改editortype前的标点 +% +\renewbibmacro*{editor}{%源来自biblatex.DEF + \ifboolexpr{ + test \ifuseeditor + and + not test {\ifnameundef{editor}} + } + {\printnames{editor}% + \iffieldundef{editortype}%增加一个类型判断,用于存在editortype的情况 + {\setunit\addspace}%当没有editortype时,直接用句点 + {%\setunit{\addcomma\space}% + \usebibmacro{editorstrg}}% + %\clearname{editor} + }% + {}} + +% +% 编者类型做一修改 +% v1.0 2016-07-01 +% v1.0q 2019-03-01 hzz 修改editortype不同语言的不同本地化字符串 +% +\renewbibmacro*{editorstrg}{%源来自biblatex.DEF + \printtext[editortype]{% + \iffieldundef{editortype} + {% +% \ifboolexpr{ %这一段去掉,未定义编者类型情况下不处理 +% test {\ifnumgreater{\value{editor}}{1}} +% or +% test {\ifandothers{editor}} +% } +% {\bibstring{editors}} +% {\bibstring{editor}} + } + {\ifbibxstring{\thefield{editortype}} %定义编者类型情况下处理,以后根据需要修改 + {\ifboolexpr{ + test {\ifnumgreater{\value{editor}}{1}} + or + test {\ifandothers{editor}} + } + {\printdelim{streditortypes}} + {\printdelim{streditortype}}} + {\thefield{editortype}}}% + }} + +% +% 编者类型的本地化字符串输出 +% v1.0q 2019-03-01 hzz +% 能对不同条目类型作格式设置的域格式,能对不同环境做格式设置的分隔符 +% 能对不同文境作设置的包括排序,标签等 +% 这里因为考虑可能标注和文献表中存在不同,所以用分隔符来输出本地化字符串 +% +\DeclareDelimFormat{streditortypes}{% + \edef\userfieldabcde{userd}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{\thefield{editortype}scn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{\thefield{editortype}skr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{\thefield{editortype}sjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}% + \or% + \bibstring{\thefield{editortype}scn}% + \or% + \addcomma\addthinspace\bibstring{\thefield{editortype}s}% + \fi} +% +\DeclareDelimFormat{streditortype}{% + \edef\userfieldabcde{userd}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{\thefield{editortype}cn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{\thefield{editortype}kr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{\thefield{editortype}jp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}% + \or% + \bibstring{\thefield{editortype}cn}% + \or% + \addcomma\addthinspace\bibstring{\thefield{editortype}}% + \fi} + + +% +% bookauthor域的输出, +% v1.0q 2019-03-01 hzz +% 不再对editor和bookauthor做sourcemap,而是下面的宏内逻辑代替, +% 使得除使用bookauthor外也可以使用editor,便于在使用editor时使用editortype +\renewbibmacro*{bybookauthor}{% + \ifnameundef{bookauthor}% + {\ifnameundef{editor}% + {}% + {\ifnamesequal{author}{editor}% + {}{\usebibmacro{editor}}}% + }% + {\ifnamesequal{author}{bookauthor}% + {}{\printnames{bookauthor}}% + }% +} + +% +% 修改期刊的标题 +% +\renewbibmacro*{periodical}{%源来自biblatex.DEF + \iffieldundef{title} + {} + {\printtext[title]{\bibtitlefont% + \printfield[titlecase]{title}% + %\setunit{\subtitlepunct}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct} + \printfield[titlecase]{subtitle}}% + %}%把编组结束移到后面去 + \iftoggle{bbx:gbtype}{% + \iffieldundef{usera}{}{%在标题后直接给出文献标识字母 + \printfield[gbtypeflag]{usera}}}{} + }} + } + +% +% 期刊的标题做修改 +% +\renewbibmacro*{title+issuetitle}{%源来自standard.BBX + \usebibmacro{periodical}% + %\setunit*{\addspace}% + \setunit*{\adddot\addspace}%标点修改为句点 + \iffieldundef{series} + {} + {\newunit + \printfield{series}% + \setunit{\addspace}}% + \usebibmacro{periodical+issue}%将issue调整到上面来,并修改 +\iffieldundef{number}{}{%%进一步处理有范围的数字 + \multinumberparser{\thefield{number}}}% + \iffieldundef{volume}% + {\printfield{year}% + \printtext{\mkbibparens{\multinumberfirst}}% + \bibrangedash% + \iffieldundef{endyear}{}{\printfield{endyear}\printtext{\mkbibparens{\multinumbersecond}}}% + }% + {\multivolparser{\thefield{volume}}% + \printfield{year}% + \setunit{\addcomma\space}%将冒号修改为逗号 + \printtext{\multivolfirst}% + \printtext{\mkbibparens{\multinumberfirst}}% + \bibrangedash% + \iffieldundef{endyear}{}{% + \printfield{endyear}% + \setunit{\addcomma\space}%将冒号修改为逗号 + \printtext{\multivolsecond}% + \printtext{\mkbibparens{\multinumbersecond}}}% + }% + \setunit{\addcomma\space}% + \printfield{eid}% + \setunit{\addspace}% + %\usebibmacro{issue+date}% + %\setunit{\addcolon\space}% + \usebibmacro{issue}% + \newunit} + +% +% 新增一个样式用于调整期刊年份的格式,只打印年份 +% +\newbibmacro*{periodical+issue}{% + \printtext{%去掉了[parens] + \iffieldundef{issue} + {%\usebibmacro{date}%修改为下一句 + }% + {\printfield{issue}% + \setunit*{\addspace}% + %\usebibmacro{date}%修改为下一句 + }% + }% + %\newunit +} + +% +% 重设专利title的输出,将文献类型标识符输出出去 +% +\newbibmacro*{patenttitle}{%原输出来自biblatex.def文件 + \ifboolexpr{% + test{\iffieldundef{title}}% + and% + test{\iffieldundef{subtitle}}% + }% + {}% + {\printtext[title]{\bibtitlefont% + \printfield[titlecase]{title}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct}% + \printfield[titlecase]{subtitle}}% + \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 + {\setunit{\subtitlepunct}\printfield{titleaddon}}% + \setunit{\subtitlepunct}\printfield{number}%写专利号 + \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}% + %\iffieldundef{booktitle}{\newunit}{}%当title是析出时,不要标点 + %\newunit + }% +}% +} + + + +% +% 修改in:用于inbook、incollection、inproceedings等类型 +% 2018.04.20,v1.0k,renewed marco,by hzz +% 20190212,v1.0q,增加中英文区分,by hzz +% +% 原理方法:使用bibmacro{in:}改变了以前在driver中直接输出//的方式,同时也简化了标点控制。 +\renewbibmacro*{in:}{% + \iftoggle{bbx:gbpunctin}{\printtext{\texttt{//}\allowbreak}}%\addthinspace + {\setunit{\adddot\addspace}% + \iffieldequalstr{userd}{chinese}% + {\printtext{\bibstring{incn}}}% + {\printtext{\bibstring{in}}}% + }}%\newunit\newblock\intitlepunct + +% +% 修改type域的输出格式 +% 2019.02.12,v1.0q,byhzz +% 使其可以区分中英文输出不同的格式,比如博士论文英文输出PHD thesis,中文则是博士学位论文 +\DeclareFieldFormat{type}% +{\iffieldequalstr{userd}{chinese}% + {\ifbibxstring{#1cn}{\bibxstring{#1cn}}{#1}}% + {\ifbibstring{#1}{\bibstring{#1}}{#1}}% +} + +% +% 修改series域的输出格式 +% 2019.05.01,v1.0r,byhzz +\renewbibmacro*{series+number}{% + \printfield{series}% + %\setunit*{\addspace}% + %\printfield{number}% + %\newunit + } + +%===================================================================== +%设置驱动格式 +%===================================================================== +% +% book条目类的驱动 +% + \DeclareBibliographyDriver{book}{%源来自standard.bbx文件 + \usebibmacro{bibindex}% + \usebibmacro{begentry}% +\usebibmacro{author/editor+others/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\usebibmacro{maintitle+title}% +\iftoggle{bbx:gbstrict}{}{% +\newunit +\printlist{language}% +\newunit\newblock% +\usebibmacro{byauthor}% +\newunit\newblock}% +\usebibmacro{byeditor+others}% +\newunit +\printfield{edition}% +\newunit\newblock%% +\iftoggle{bbx:gbstrict}{}{% +\iffieldundef{maintitle}% +{\printfield{volume}% +\printfield{part}}% +{}% +\newunit% +\printfield{volumes}% +\newunit\newblock% +\usebibmacro{series+number}}% +\newunit\newblock% +%\printfield{note}% +%\newunit\newblock% +\usebibmacro{publisher+location+date}% +%\newunit\newblock %这里标点去掉 +\usebibmacro{chapter+pages}% + \iffieldundef{url}{}{%当没有网址时也不输出 + \usebibmacro{modifydate}}%带括号的修改或更新日期, +\usebibmacro{doi+eprint+url}%从下面移动到上面来,因为gbt2015的url需直接放在页码后面。 + \newunit\newblock% + \printfield{pagetotal}% + \newunit\newblock% + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock + %\usebibmacro{doi+eprint+url}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + +% +% 期刊文章,连续出版物中的析出文献的格式 +% + \DeclareBibliographyDriver{article}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{bytranslator+others}% + \newunit\newblock + \printfield{version}}% + \newunit\newblock + %\usebibmacro{in:}% 不使用in来表示期刊等连续出版物 + \usebibmacro{journal+issuetitle}% + %\newunit +% \usebibmacro{byeditor+others}% +% \newunit + \usebibmacro{note+pages}% + \iffieldequalstr{note}{news}{}{%当是新闻时不输出修改或更新日期 + \iffieldundef{url}{}{%当没有网址时也不输出 + \usebibmacro{modifydate}}}%带括号的修改或更新日期, + \usebibmacro{doi+eprint+url}%从后面移上来,调整url和页码之间的位置 + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{issn}} + {}% + \newunit\newblock + %\usebibmacro{doi+eprint+url}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + + +% +% 连续出版物的驱动 +% + \DeclareBibliographyDriver{periodical}{%源来自standard.BBX + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{editor}% + %\setunit{\labelnamepunct}\newblock + \newunit\newblock %删除上面一行,添加这一行 + \usebibmacro{title+issuetitle}% + \newunit\newblock% + \usebibmacro{location+institution+date}%添加这一行用于输出地址,单位和时间 + \newunit\newblock%添加这一行 + \iftoggle{bbx:gbstrict}{}{% + \printlist{language}% + \newunit\newblock + \usebibmacro{byeditor}% + \newunit\newblock + \printfield{note}% + \newunit\newblock} + \iftoggle{bbx:isbn} + {\printfield{issn}} + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + +% +% 专利文献驱动 +% + \DeclareBibliographyDriver{patent}{%源来自standard.BBX + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + %\usebibmacro{title}% + \usebibmacro{patenttitle}%给出专利专用的标题输出 + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \printfield{type}% + \setunit*{\addspace}% + %\printfield{number}%已放到patenttitle中处理 + \iflistundef{location} + {} + {\setunit*{\addspace}% + \printtext{%[parens] + \printlist[][-\value{listtotal}]{location}}}% + \newunit\newblock + \usebibmacro{byholder}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \usebibmacro{newsdate}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + +% +% 在线文献驱动 +% +\DeclareBibliographyDriver{online}{%源来自standard.BBX + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{note}}% + \newunit + \printfield{version}% + \newunit\newblock + %\printlist{organization}% + \printlist{institution}% + \newunit\newblock +\ifboolexpr{% +test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% +}{\usebibmacro{date}}% +{\usebibmacro{modifydate}}%修改或更新日期,为带括号的时间 + \usebibmacro{url+urldate}%从下面移上来 + \newunit\newblock + \iftoggle{bbx:eprint} + {\usebibmacro{eprint}} + {}% + \newunit\newblock + %\usebibmacro{url+urldate}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + +% +% 报告类型驱动 +% 当有网址无出版项时,用online输出 +% +\DeclareBibliographyDriver{report}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \usebibmacro{byeditor+others}%增加的译者信息 + \newunit\newblock + \printfield{type}% + \setunit*{\addspace}% + \printfield{number}% + \newunit\newblock + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + \usebibmacro{doi+eprint+url}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isrn}} + {}% + \newunit\newblock +% \usebibmacro{doi+eprint+url}% +% \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + +% +% 论文、手册类型驱动 +% 2016-11-11,增加了译者信息 +% +\DeclareBibliographyDriver{manual}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \usebibmacro{byeditor+others}%增加的译者信息 + \newunit\newblock + \iftoggle{bbx:gbfieldtype}{% + \printfield{type}% + \setunit*{\addspace}}{}% + \printfield{number}% + \newunit\newblock + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{institution+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + \iffieldundef{url}{}{%当没有网址时也不输出修改或更新日期 + \usebibmacro{modifydate}}%修改或更新日期为带括号的时间 + \usebibmacro{doi+eprint+url}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isrn}} + {}% + \newunit\newblock +% \usebibmacro{doi+eprint+url}% +% \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + +% +% 备选类型驱动 +% +% 利用biblatex的misc驱动 +\DeclareBibliographyDriver{misc}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% +\iftoggle{bbx:gbstrict}{}{% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}}% + \newunit\newblock + \printfield{howpublished}% + \newunit\newblock + \printfield{type}% + \newunit + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{institution+location+date}% + %\usebibmacro{organization+location+date}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + +% +% 专著中的析出文献的格式修改 +% +\DeclareBibliographyDriver{inbook}{%源来自standard.bbx + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\usebibmacro{title}% +\usebibmacro{in:}% +%\printtext{\texttt{//}\addthinspace}% + \usebibmacro{bybookauthor}% + \ifnameundef{bookauthor}{% + \ifnameundef{editor}{}{\newunit}% + }{\newunit}%替换下一句 + %\newunit\newblock +\iffieldundef{series}{}{\usebibmacro{series+number}\setunit{\addcolon\addspace}}%为处理一些存在series的情况而增加 + \usebibmacro{maintitle+booktitle}% +\iffieldundef{volume}{}{\setunit{\addcolon\addspace}\printfield{volume}}% +\iffieldundef{number}{}{\setunit{\addcolon\addspace}\printfield{number}}%增加卷和册信息 + \newunit\newblock% +% \usebibmacro{byeditor+others}% +% \newunit\newblock + \printfield{edition}% + \newunit + \iftoggle{bbx:gbstrict}{}{% +% \iffieldundef{maintitle} +% {\printfield{volume}% +% \printfield{part}} +% {}% +% \newunit +% \printfield{volumes}% +% \newunit\newblock +% \usebibmacro{series+number} + }% + \newunit\newblock + %\printfield{note}% + %\newunit\newblock + \usebibmacro{publisher+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}%移到上面来 + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock +% \usebibmacro{doi+eprint+url}% +% \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} diff --git a/config/gb7714-2015.cbx b/config/gb7714-2015.cbx new file mode 100644 index 0000000..213d96f --- /dev/null +++ b/config/gb7714-2015.cbx @@ -0,0 +1,279 @@ +%% +%% --------------------------------------------------------------- +%% biblatex-gb7714-2015 --- A biblatex implementation of the +%% GBT7714-2015 citation style,numerical sequence +%% Maintained by huzhenzhen +%% E-mail: hzzmail@163.com +%% Released under the LaTeX Project Public License v1.3c or later +%% --------------------------------------------------------------- +%% +\def\versionofgbtstyle{2019/03/28 v1.0r} +\ProvidesFile{gb7714-2015.cbx}[\versionofgbtstyle biblatex citation style] + +% +% 加载标准样式 +% +\RequireCitationStyle{numeric-comp} %numeric + + +% +% 选项设置 +% +\ExecuteBibliographyOptions{ + autocite = superscript , + autopunct = true , + %sorting = none , + maxcitenames=1, + mincitenames=1, +} + +%textcite标注命令中的标点设置 +%\DeclareDelimFormat[textcite]{andothersdelim}{\addspace}% + +% +% 定义一个上标方括号wrapper +% +\newcommand*\mkbibsuperbracket[1]{% + \mkbibsuperscript{\mkbibbrackets{#1}}% +} + +% 修改postnote的输出格式 +\DeclareFieldFormat{postnote}{#1} + +% +% 重定义cite命令 +% +% 方法:\DeclareCiteCommand{\cite}[\mkbibparens]{precode}{loopcode}{sepcode}{postcode} +% v1.0p版后将cite的处理方式修改为类似pagescite,而不再使用biblatex的标准方式 +\DeclareCiteCommand{\cite}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号 + {[\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \printfield{postnote}} +% v1.0p 以前用的方式 +%\DeclareCiteCommand{\cite}[\mkbibsuperbracket]%利用mkbibsuperbracket添加方括号 +% {\usebibmacro{cite:init}% +% \usebibmacro{prenote}} +% {\usebibmacro{citeindex}% +% \usebibmacro{cite:comp}} +% {} +% {\usebibmacro{cite:dump}% +% \usebibmacro{postnote}} + +% +% 定义upcite命令 +% 20180604,v1.0l,hzz +% 20190409,v1.0r,hzz +% 方法:对supercite增加[] +\newrobustcmd*{\upcite}{% + \cite} + +% +% 重定义parencite命令,以满足标签带页码的国标要求 +% +\DeclareCiteCommand{\parencite}%[\mkbibbrackets] + {[\usebibmacro{cite:init}%] + \usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {%[ + \usebibmacro{cite:dump}]% + \mkbibsuperscript{\printfield{postnote}}} + +% +% 新定义pagescite命令,以满足标签带页码的国标要求 +% +% 原理方法: +% 1.新增页码输出宏 +\newbibmacro*{postpages}{% + \iffieldundef{postnote} + {\printfield[postnote]{pages}} + {\printfield{postnote}}} +% 2.新增\pagescite引用命令 +\DeclareCiteCommand{\pagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标 + {[\usebibmacro{cite:init}%]直接添加方括号 + \usebibmacro{prenote}% + } + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \usebibmacro{postpages}} + +% +% 定义yearpagescite,为与ay样式兼容,等同于\pagescite +% +\DeclareCiteCommand{\yearpagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标 + {[\usebibmacro{cite:init}%]直接添加方括号 + \usebibmacro{prenote}% + } + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \usebibmacro{postpages}} + +% +% 定义\yearcite命令,为与ay样式兼容,且提供不输出页码的标签格式, +% +% 原理方法:等同于\pagescite,但不要页码 +\DeclareCiteCommand{\yearcite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标 + {[\usebibmacro{cite:init}%]直接添加方括号 + \usebibmacro{prenote}% + } + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]} + +% +% 定义\authornumcite命令,输出作者信息,然后在后面带上顺序编码 +% 20180427,v1.0k,增加,hzz +% gb7714样式新定义的命令都把cite放到最后,比如前面的pagescite,yearcite,这里的\authornumcite +% 区别于biblatex定义的命令都把cite放到前面,比如citeauthor等。 +%见numeric.CBX +\newbibmacro*{cite}{% + \printtext[bibhyperref]{% + \printfield{labelprefix}% + \printfield{labelnumber}% + \ifbool{bbx:subentry} + {\printfield{entrysetcount}} + {}}} +%见numeric.CBX,\DeclareCiteCommand{\cite}, +\DeclareCiteCommand{\authornumcite}%[\mkbibsuperscript] + {\usebibmacro{prenote}} + {\iffieldequalstr{userf}{cn}{\renewcommand*{\andothersdelim}{\addthinspace}}%\addthinspace + {\renewcommand*{\andothersdelim}{\addspace}}% + \printnames{labelname}\mkbibsuperscript{\mkbibbrackets{\usebibmacro{citeindex}% + \usebibmacro{cite}}}} + {\multicitedelim} + {\mkbibsuperscript{\printfield{postnote}}} + + +% +% 增加如下多个命令 +% 20190409,v1.0r,hzz +% 方法:利用newcommand或newrobustcmd命令进行定义 +% 注意\citet和\citep命令之所以不用newrobustcmd,是为避免加载natbib模块后产生冲突 +\DeclareCiteCommand{\citet}% + {\usebibmacro{prenote}} + {\iffieldequalstr{userf}{cn}{\renewcommand*{\andothersdelim}{\addthinspace}}%\addthinspace + {\renewcommand*{\andothersdelim}{\addspace}}% + \printnames{labelname}\mkbibsuperscript{\mkbibbrackets{\usebibmacro{citeindex}% + \usebibmacro{cite}}}} + {\multicitedelim} + {\mkbibsuperscript{\printfield{postnote}}} + + +\DeclareCiteCommand{\citep}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号 + {[\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \printfield{postnote}} + +\newrobustcmd*{\citetns}% + {\textcite} + +\newrobustcmd*{\citepns}% + {\parencite} + +\newrobustcmd*{\inlinecite}% + {\parencite} + +% +% 增加如下复数的命令,以符合biblatex的复数命令习惯 +% 20190430,v1.0r,hzz +% citec和citecs命令是实现了[1]-[3]这样的压缩形式。 +% authornumcites是常用命令authornumcite的复数形式 +\DeclareFieldFormat{labelbracket}{\mkbibbrackets{#1}} + +\newbibmacro*{citec:comp:comp}{% + \ifboolexpr{ + ( test {\iffieldundef{labelprefix}} and test {\ifundef\cbx@lastprefix} ) + or + test {\iffieldequals{labelprefix}{\cbx@lastprefix}} + } + {\ifnumequal{\thefield{labelnumber}}{\value{cbx@tempcntb}} + {\savefield{entrykey}{\cbx@lastkey}% + \savefield{labelnumber}{\cbx@lastnumber}% + \addtocounter{cbx@tempcnta}{1}} + {\ifnumequal{\thefield{labelnumber}}{\value{cbx@tempcntb}-1} + {} + {\usebibmacro{citec:dump}% + \ifnumgreater{\value{cbx@tempcntb}}{-1} + {\multicitedelim} + {}% + \printtext[bibhyperref]{% + \printfield{labelprefix}% + \printtext[labelbracket]{\printfield{labelnumber}}}}}} + {\usebibmacro{cite:comp:end}}% + \setcounter{cbx@tempcntb}{\thefield{labelnumber}}% + \savefield{labelprefix}{\cbx@lastprefix}} + +\newbibmacro*{citec:comp}{% + \addtocounter{cbx@tempcntb}{1}% + \iffieldundef{shorthand} + {\ifbool{bbx:subentry} + {\iffieldundef{entrysetcount} + {\usebibmacro{citec:comp:comp}} + {\usebibmacro{cite:comp:inset}}} + {\usebibmacro{citec:comp:comp}}} + {\usebibmacro{cite:comp:shand}}} + +\newbibmacro*{citec:dump}{% + \ifnumgreater{\value{cbx@tempcnta}}{0} + {\ifnumgreater{\value{cbx@tempcnta}}{1} + {\bibrangedash} + {\multicitedelim}% + \bibhyperref[\cbx@lastkey]{% + \ifdef\cbx@lastprefix + {\printtext[labelprefix]{\cbx@lastprefix}} + {}% + \printtext[labelbracket]{\cbx@lastnumber}}}%labelnumber + {}% + \setcounter{cbx@tempcnta}{0}% + \global\undef\cbx@lastprefix} + +%\DeclareCiteCommand{\citec}[\mkbibsuperscript]%[\mkbibbrackets] +% {\usebibmacro{cite:init}% +% \usebibmacro{prenote}} +% {\usebibmacro{citeindex}% +% \usebibmacro{citec:comp}} +% {} +% {\usebibmacro{citec:dump}% +% \usebibmacro{postnote}} + +%上面这个用于非压缩情况,这里考虑了压缩的情况 +\DeclareCiteCommand{\citec}[\mkbibsuperscript]% + {\ifnumless{\value{multicitecount}}{2} + {\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\iffieldundef{prenote} + {\iffieldundef{postnote} + {} + {\usebibmacro{citec:dump}% + \usebibmacro{cite:init}% + \setunit{\multicitedelim}}} + {\usebibmacro{citec:dump}% + \usebibmacro{cite:init}% + \setunit{\multicitedelim}% + \usebibmacro{prenote}}}} + {\usebibmacro{citeindex}% + \usebibmacro{citec:comp}} + {} + {\ifboolexpr{ test {\ifnumequal{\value{multicitecount}}{\value{multicitetotal}}} + or not test {\iffieldundef{postnote}}} + {\usebibmacro{citec:dump}% + \usebibmacro{postnote}} + {}} + +\DeclareMultiCiteCommand{\citecs}[\mkbibsuperscript]{\citec}{} + +\DeclareMultiCiteCommand{\authornumcites}[]{\authornumcite}{\multicitedelim} diff --git a/config/gb7714-2015ay.bbx b/config/gb7714-2015ay.bbx new file mode 100644 index 0000000..63a1361 --- /dev/null +++ b/config/gb7714-2015ay.bbx @@ -0,0 +1,3787 @@ +%% +%% --------------------------------------------------------------- +%% biblatex-gb7714-2015 --- A biblatex implementation of the +%% GBT7714-2015 bibliography style,author year sequence +%% Maintained by huzhenzhen +%% E-mail: hzzmail@163.com +%% Released under the LaTeX Project Public License v1.3c or later +%% --------------------------------------------------------------- +%% +% +% 版本和时间信息 +% +\def\versionofgbtstyle{2019/03/28 v1.0r} +\def\versionofbiblatex{\abx@version} +\ProvidesFile{gb7714-2015ay.bbx}[\versionofgbtstyle biblatex bibliography style] +%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 + +%===================================================================== +%加载标准样式 +%===================================================================== +\RequireBibliographyStyle{authoryear} +\RequirePackage{xstring}%解决texlive2015的biblatex3.0不加载xstring包的问题 + + +%===================================================================== +% 功能函数 +%===================================================================== + % + % biblatex版本判断 + % 20180405,v1.0k,为兼容biblatexv3.11增加toggle:iftlnine,HU zhenzhen + % 20181020,v1.0n,为不再使用xstring宏包做的修改,hzz + % + % 原理方法:当版本继续更新时,增加一个新的toggle用以处理新的旧版,最新版和未判断出来的版本永远用iftlatest + \providetoggle{iftlfive}\togglefalse{iftlfive} %处理biblatex3.2之前版本,时间2016-03-01前 + \providetoggle{iftlsix}\togglefalse{iftlsix} %处理biblatex3.3开始改变姓名机制后版本,时间2016-03-01及以后 + \providetoggle{iftlseven}\togglefalse{iftlseven}%处理biblatex3.7的兼容性,时间2016-12-01后 + \providetoggle{iftleight}\togglefalse{iftleight}%处理biblatex3.8到3.9的兼容性,时间2017-11-01后到2017-12-01前 + \providetoggle{iftlnine}\togglefalse{iftlnine} %处理biblatex10的兼容性,时间2017-12-01后 + \providetoggle{iftlatest}\toggletrue{iftlatest} %假设是最新版biblatex + \@ifpackagelater{biblatex}{2014/04/01}{ + \@ifpackagelater{biblatex}{2016/03/01}{ + \@ifpackagelater{biblatex}{2016/12/01}{ + \@ifpackagelater{biblatex}{2017/11/01}{ + \@ifpackagelater{biblatex}{2017/12/01}{ + \@ifpackagelater{biblatex}{2018/02/19}{} + {\toggletrue{iftlnine}\togglefalse{iftlatest}}} + {\toggletrue{iftleight}\togglefalse{iftlatest}}} + {\toggletrue{iftlseven}\togglefalse{iftlatest}}} + {\toggletrue{iftlsix}\togglefalse{iftlatest}}} + {\toggletrue{iftlfive}\togglefalse{iftlatest}}} + {\PackageError{biblatex}{Outdated 'biblatex' package} + {Please update biblatex, This is a fatal error.}} + + \newcommand\defversion[2]{\csdef{codeversion#1#2}}%定义不同版本的命令 + \newcommand\switchversion[2]{\csuse{codeversion#1#2}}%使用不同版本的命令 + + % + % 判断CJK字符的函数,用于判断作者等信息是否由中文字符构成 + % v1.0k,20180509,hzz + % + % 原理方法:用biber中的perl方法代替。因为利用tex函数对字符判断时,当字符在宏 + % 中时,基于`的方法无法解决GBK编码的问题,基于CJKsymbol的方法无法解决utf-8 + % 编码用xelatex编译的问题。 + % + % 原理是:利用perl正则将中文标识记录到域中, + % 然后利用\iffieldundef和\iffieldequalstr进行判断 + \providetoggle{ifCJKforgbt} + \def\testCJKfirst#1{% + \iffieldundef{#1}{\togglefalse{ifCJKforgbt}}{% + \iffieldequalstr{#1}{chinese}{\toggletrue{ifCJKforgbt}}{\togglefalse{ifCJKforgbt}}}} + + % + % 2个卷的解析函数,用于连续出版物 + % + % 原理方法: 范围起止间隔符号还是用-,而不是与date相同的/,因为有合期期刊的问题,需要用到/符号 + \newcommand{\multivolparser}[1]{% + \IfSubStr{#1}{-}% + {\StrBefore{#1}{-}[\multivolfirst]\StrBehind{#1}{-}[\multivolsecond]}% + {\def\multivolfirst{#1}\def\multivolsecond{}}% + } + + % + % 2个期的解析函数,用于连续出版物 + % + \newcommand{\multinumberparser}[1]{% + \IfSubStr{#1}{-}% + {\StrBefore{#1}{-}[\multinumberfirst]\StrBehind{#1}{-}[\multinumbersecond]}% + {\def\multinumberfirst{#1}\def\multinumbersecond{}}% + } + + % 对没有分隔符环境命令的低版本biblatex做增补,避免报错 + % + \iftoggle{iftlfive}{ + + \def\blx@inf@delimdeclare#1#2{% + \blx@info{Delimiter '#1' in context '#2' already defined, overwriting}} + + \def\blx@warn@delimuse#1#2{% + \blx@warning{Delimiter '#1' in context '#2' undefined}} + % Delimiter interface + + % []{}{} + \newrobustcmd*{\DeclareDelimFormat}{% + \@ifstar + {\blx@declaredelimclear} + {\blx@declaredelim}} + + \newrobustcmd*{\blx@declaredelimclear}[3][]{% + \ifcsvoid{blx@declaredelimcontexts@#2} + {} + {\def\do##1{\csundef{blx@printdelim@##1@#2}}% + \dolistcsloop{blx@declaredelimcontexts@#2}}% + \cslet{blx@declaredelimcontexts@#2}\@empty + \ifblank{#1} + {\blx@declaredelim{#2}{#3}} + {\blx@declaredelim[#1]{#2}{#3}}} + + \newrobustcmd*{\blx@declaredelim}[3][]{% + \ifblank{#1} + {\blx@declaredelim@i{}{}{#2}{#3}} + {\def\do##1{% + \listcsadd{blx@declaredelimcontexts@#2}{##1}% + \blx@declaredelim@i{blx@printdelim@##1@}{##1}{#2}{#3}}% + \docsvlist{#1}}}% + + \def\blx@declaredelim@i#1#2#3#4{% + \def\do@i##1{% + \ifcsdef{#1##1} + {\blx@inf@delimdeclare{##1}{#2}} + {}% + \csdef{#1##1}{#4}}% + \forcsvlist{\do@i}{#3}} + + % *[]{}{} + \newrobustcmd*{\DeclareDelimAlias}{% + \@ifstar + {\blx@declaredelimalias} + {\blx@declaredelimaliasauto}} + + \newrobustcmd*{\blx@declaredelimalias}[3][]{% + \ifblank{#1} + {\blx@declaredelimalias@i{}{#2}{#3}} + {\def\do##1{% + \blx@declaredelimalias@i{blx@printdelim@##1@}{#2}{#3}}% + \docsvlist{#1}}} + + \newrobustcmd*{\blx@declaredelimaliasauto}[2]{% + \blx@declaredelimalias@i{}{#1}{#2}% + \ifcsvoid{blx@declaredelimcontexts@#2} + {} + {\def\do##1{% + \blx@declaredelimalias@i{blx@printdelim@##1@}{#1}{#2}}% + \dolistcsloop{blx@declaredelimcontexts@#2}}} + + \def\blx@declaredelimalias@i#1#2#3{% + \ifcsdef{#1#2} + {\blx@inf@delimdeclare{#2}{#1}} + {}% + \csdef{#1#2}{\csuse{#1#3}}} + + \def\blx@delimcontext{none} + \newcommand*{\printdelim}[2][]{% + \ifblank{#1} + {\ifcsdef{blx@printdelim@\blx@delimcontext @#2} + {\csuse{blx@printdelim@\blx@delimcontext @#2}} + {\ifcsdef{#2}% fall back on legacy macros + {\csuse{#2}} + {\blx@warn@delimuse{#2}{*}}}} + {\ifcsdef{blx@printdelim@#1@#2} + {\csuse{blx@printdelim@#1@#2}} + {\blx@warn@delimuse{#2}{#1}}}} + + \newcommand*{\delimcontext}[1]{% + \edef\blx@delimcontext{\blx@delimcontextalias{#1}}} + + \def\blx@delimcontextalias#1{% + \ifcsdef{blx@delimcontextalias@#1} + {\csuse{blx@delimcontextalias@#1}} + {#1}} + + \newcommand*{\DeclareDelimcontextAlias}[2]{% + \csgdef{blx@delimcontextalias@#1}{#2}} + }{} + + +%===================================================================== +% 数据模型定义 +%===================================================================== + %定义类型和载体标识,从gb内容看载体基本属于介质。 + %为与lee zeping的bst的样式统一,使用mark和medium这两域名 + %为单个条目的姓名格式控制增加nameformat和namefmtid两个域 + %为缩略信息文献表增加了shortbooktitle域 + %为多语言排序增加了lansortorder域 + \DeclareDatamodelFields[type=field,datatype=literal]{mark,medium,nameformat} + \DeclareDatamodelFields[type=field,datatype=integer]{namefmtid} + \DeclareDatamodelFields[type=field,datatype=literal]{shortbooktitle} + \DeclareDatamodelFields[type=field,datatype=literal]{lansortorder} + + + +%===================================================================== +% 设置宏包选项 +%===================================================================== + % + % 增加一个控制是否输出annotation域的选项,该域可以用于在文献条目后面输出一些注释信息 + % 20190509,v1,0s,hzz + \newtoggle{bbx:gbannote} + \DeclareBibliographyOption{gbannote}[false]{%biblatex低版本 + \settoggle{bbx:gbannote}{#1}} + \ExecuteBibliographyOptions{gbannote} + % + %用于在文献条目后面输出注释信息的宏 + %FieldFormat{annotation}用于设置注释信息的格式 + \DeclareFieldFormat{annotation}{% + \printtext{\addspace(#1)}% + } + \renewbibmacro*{annotation}{% + \iftoggle{bbx:gbannote}% + {\iffieldundef{annotation}% + {\printfile[annotation]{\bibannotationprefix\thefield{entrykey}.tex}}% + {\printfield{annotation}}}% + {}% + } + + + % + % 增加一个控制是否输出type域的选项 + % 20190212,v1,0q,hzz + \newtoggle{bbx:gbfieldtype} + \DeclareBibliographyOption{gbfieldtype}[false]{%biblatex低版本 + \settoggle{bbx:gbfieldtype}{#1}} + \ExecuteBibliographyOptions{gbfieldtype} + + % + % 增加一个控制是否根据页码重设脚注数字标号的选项 + % 20190422,v1,0r,hzz + \newtoggle{bbx:gbfnperpage} + \DeclareBibliographyOption{gbfnperpage}[false]{% + \settoggle{bbx:gbfnperpage}{#1}} + \ExecuteBibliographyOptions{gbfnperpage} + + % + % 增加一个选项,用于控制是否实现GB/T 7714-2015标准的脚注文献表 + % 20190203,v1.0p,hzz + % 原理方法:默认做patch,文献引用带圈上标数字表示,脚注中的文献用带圈非上标数字做标签 + % 当前面的脚注中已经存在当前文献,那么当前文献内容不再输出而用同(4)这样的方式 + % 需要注意的是由于小页环境和表格中的脚注本身的问题,可能会有一些问题 + \DeclareBibliographyOption{gbfootbib}[false]{% + \ifstrequal{#1}{false}{}{\execgbfootbib}} + \ExecuteBibliographyOptions{gbfootbib} + + %% + \newlength{\footbibmargin} + \newlength{\footbiblabelsep} + \setlength{\footbibmargin}{1em}%脚注的段落左侧缩进距离 + \setlength{\footbiblabelsep}{0.5em}%脚注中标记号与脚注段落的间距 + \def\execgbfootbib% + {% + %开启引用跟踪计数器,为使用\ifciteseen等测试命令 + \ExecuteBibliographyOptions{citetracker=true} + % + %利用footmisc宏包来实现脚注文献的悬挂对齐 + \AtEndPreamble{ + \@ifclassloaded{beamer}{}{ + %beamer类因为其特殊性,为避免冲突不调footmisc。 + %同时footmisc与hyperref宏包也不兼容,所以使用footmisc时会破坏脚注的超链接 + %如果要实现超链接可以将下句注释掉,这里留着主要是实现悬挂对齐。 + %\PassOptionsToPackage{perpage,hang}{footmisc}% + %\RequirePackage{footmisc}% + + %重新实现脚注的根据单页重设脚注号码 + %重新实现脚注的悬挂对齐问题,不再使用footmisc,直接从latex核心代码和hyperref代码进行修改 + %v1.0q 20190317 hzz + %v1.0r 20190422 hzz 根据gbfnperpage选项设置 + \iftoggle{bbx:gbfnperpage}% + {\@addtoreset{footnote}{page}}{}%重设计数器 + +\@ifpackageloaded{hyperref}{%加载hyperref则对\H@@footnotetext做重定义 + \long\def\H@@footnotetext##1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \leftskip \footbibmargin%增加的左侧缩进 + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox% + }% + \color@endgroup}}% + \long\def\H@@mpfootnotetext##1{% + \global\setbox\@mpfootins\vbox{% + \unvbox\@mpfootins + \reset@font\footnotesize + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel + {\csname p@mpfootnote\endcsname\@thefnmark}% + \leftskip \footbibmargin%增加的左侧缩进 + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox}% + \color@endgroup}} + }{%否则对latex核心代码中的\@footnotetext做重定义 + \long\def\@footnotetext##1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \leftskip \footbibmargin%增加的左侧缩进 + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox% + }% + \color@endgroup}}% + + \long\def\@mpfootnotetext##1{% + \global\setbox\@mpfootins\vbox{% + \unvbox\@mpfootins + \reset@font\footnotesize + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel + {\csname p@mpfootnote\endcsname\@thefnmark}% + \leftskip \footbibmargin%增加的左侧缩进 + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox}% + \color@endgroup}} + } + + \long\def\@makefntext##1{%增加了脚注标记与正文的间隔 + \parindent 1em\noindent \hb@xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1} + + } + + % + %使脚注标记加圈并设置数字的字体为tiny,不使用修改thefootnote的方式 + \def\@makefnmark{\hbox{\@textsuperscript{\textcircled{\tiny\@thefnmark}}}} + %做patch使得脚注内容中的脚注数字标签不上标 + \pretocmd{\@makefntext}{% + \def\@makefnmark{% + \hbox{\textcircled{\tiny\@thefnmark}}% + }% + }{}{} + } + + % + %判断当前文献是否已经引用过且是做的footfullcite(即已经作为脚注输出文献内容) + %记录首次输出时的脚注号码,用于后面再次引用该文献时的输出,比如同(4)。 + %v1.0q 20190309 区分使脚注标注适应minipage中的情况 + \newbibmacro*{citesavefn}{% + \ifciteseen%当被引用过为true + {\ifcsdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}%当已经定义过脚注序号信息 + {\csgdef{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{% + \str@sameentry\gdef\@thefnmark{\csuse{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}}% + \@makefnmark% + }}% + {\csxdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{% + \ifcsstring{@mpfn}{mpfootnote}{\@alph\c@mpfootnote}{\thefootnote}% + }}% + }% + {\csxdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{% + \ifcsstring{@mpfn}{mpfootnote}{\@alph\c@mpfootnote}{\thefootnote}% + %判断在minipage中比较麻烦,这里使用\@mpfn的定义进行判断 + }}% + } + + % + %重定义\footfullcite使完成gb7714-2015的脚注文献要求 + \DeclareCiteCommand{\footfullcite}[\mkbibfootnote]% + {\defcounter{maxnames}{\blx@maxbibnames}%局部定义maxnames和minnames计数器 + \defcounter{minnames}{\blx@minbibnames}%使footfullcite内的作者输出与正文文献表中的一致。 + \usebibmacro{prenote}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}{\setunit{\addcolon\addspace}\printtext{\thefield{postnote}}}}%由于ay样式中没有修改postnote域,此处因为格式需要不使用默认域格式 + }% + {\usebibmacro{citesavefn}% + \ifcsdef{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}% + {\csuse{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}\nopunct}% + {\usedriver{\DeclareNameAlias{sortname}{default}}{\thefield{entrytype}}}% + }% + {\multicitedelim}% + {\usebibmacro{postnote}} + + } + + % + % 增加一个选项,用于控制gb7714的使用范围,即英文文献和中文文献使用不同的样式 + % 20180814,v1.0m,hzz + % 原理方法: + % 只为兼容性考虑不做任何处理 + \DeclareBibliographyOption{gbstyle}[true]{%biblatex低版本 + } + + % + % 增加一个控制是否输出文献类型和载体标识的选项 + % + % 原理方法: + % 对于biblatex3.4以上版本DeclareBibliographyOption命令中的[datatype]如果是boolean,那么是可以省略的 + % 所以用老版本的不用[datatype]的命令可以兼容所有biblatex版本 + \newtoggle{bbx:gbtype} + %\DeclareBibliographyOption[boolean]{gbtype}[true]{%biblatex高版本 + \DeclareBibliographyOption{gbtype}[true]{%biblatex低版本 + \settoggle{bbx:gbtype}{#1}} + \ExecuteBibliographyOptions{gbtype} + + % + % 增加一个源文件编码选择选项,当true时可以使用GBK编码。 + % v1.0k, 2018.05.08, by hzz + % + % 原理方法:将需要输出的中文字符串用命令形式表示存储,采用utf8编码时采用bbx文档 + % 内的定义即是utf8编码的中文字符串,但tex源文件是gbk编码时,利用gb7714-2015-gbk.def + % 文档内的gbk编码的字符串覆盖。这种覆盖只能在宏包末尾加载时成功实现,所以使用 + % AtEndOfPackage。该解决思路源自biblatex-caspervector宏包。 + % 另外注意: + % gbk编码的tex文档,利用pdflatex/latex能正确编译,利用xelatex能编译,但中文显示乱码 + % 在源文档前面增加 XeTeX 原语:\XeTeXinputencoding "GBK" 后,显示正常 + % utf-8编码的tex文档,利用xelatex能正确编译,而pdflatex/latex不能编译。 + \newtoggle{bbx:codegbk} + \DeclareBibliographyOption{gbcodegbk}[false]{% + \settoggle{bbx:codegbk}{#1}} + \ExecuteBibliographyOptions{gbcodegbk} + + \def\str@bibliography{参考文献} + \def\str@references{参考文献} + \def\str@bytranslator{译} + \def\str@andotherscn{等} + \def\str@backrefpage{引用页} + \def\str@backrefpages{引用页} + \def\str@noaddress{出版地不详} + \def\str@nopublisher{出版者不详} + \def\str@edition{版} + \def\str@volumecn{卷} + \def\str@numbercn{册} + \def\str@serialcn{第} + \def\str@sameentry{同} + \def\str@incn{见} + \def\str@mathesiscn{硕士学位论文} + \def\str@phdthesiscn{博士学位论文} + \def\str@editorcn{主编} + + \AtEndOfPackage{% + \iftoggle{bbx:codegbk}{% + \ExecuteBibliographyOptions{texencoding = GBK} + \input{gb7714-2015-gbk.def} + }{}} + + % + % 增加一个严格按GB/T 7714-2015给出著录格式控制域的输出的选项 + % v1.0k, 2018.05.08, by hzz + % + % 原理方法: + % 默认设置该选项为真,进而不输出GB/T 7714-2015中没有的域的信息 + % 这样可以避免因为bib文件带有多余的域的信息的输出,比如因为bibtex样式 + % 可能需要用于中英文判断的language域的信息。 + \newtoggle{bbx:gbstrict} + \DeclareBibliographyOption{gbstrict}[true]{% + \settoggle{bbx:gbstrict}{#1}} + \ExecuteBibliographyOptions{gbstrict} + + % + % 增加一个控制标题域超链接设置的选项 + % v1.0k, 2018.05.24, by hzz + % + % 原理方法: + % 利用标题域格式来实现,默认设置该选项为false,不做超链接。 + % 设置为true,则标题设置超链接 + \newtoggle{bbx:titlelink} + \DeclareBibliographyOption{gbtitlelink}[false]{% + \settoggle{bbx:titlelink}{#1}} + \ExecuteBibliographyOptions{gbtitlelink} + + % + % 增加一个控制参考文献标题是否能够被ctex宏包设置的选项 + % v1.0l, 2018.07.02, by hzz + % + % 原理方法: + % 重定义biblatex的宏,去除使用本地化字符串的方式,是的可以利用ctexset进行设置 + \newtoggle{bbx:ctexset} + \DeclareBibliographyOption{gbctexset}[true]{% + \settoggle{bbx:ctexset}{#1}} + \ExecuteBibliographyOptions{gbctexset} + + \AtEndOfPackage{% + \iftoggle{bbx:ctexset}{% + \def\blx@defbibstrings#1#2{% + \def\do##1{\csundef{abx@lstr@##1}\csundef{abx@sstr@##1}}% + \abx@dostrings + \csuse{abx@strings@#1}% + \setkeys{blx@lbx}{#2}% + \let\do\blx@defbibstrings@i + \csxdef{abx@strings@#1}{\abx@dostrings}% + } + }{}} + + % + %增加一个处理佚名或noauthor的控制选项 + \DeclareBibliographyOption{gbnoauthor}[true]{% + \ifstrequal{#1}{false}{}{\dealnoathor}} + %\ExecuteBibliographyOptions{gbnoauthor=true}%对于需要展开较早(展开层级优先)的选项,这一执行无效,只能用宏包加载时给出的选项。 + + + % + % 增加一个恢复域格式为标准样式的控制选项 + % v1.0k, 2018.05.15, by hzz + % + % 原理方法: + % 默认设置该选项为false,采用国标要求的域格式输出相关域 + % 当设置该选项为true时,则重新利用标准样式的域格式输出相关的域 + \newtoggle{bbx:gbfieldstd} + \DeclareBibliographyOption{gbfieldstd}[false]{% + \settoggle{bbx:gbfieldstd}{#1}% + \ifstrequal{#1}{false}{}{\execgbfdfmtstd}% + } + \ExecuteBibliographyOptions{gbfieldstd} + + % + % 增加一个出版项自动处理控制选项,当true时使用出版者不详等信息补充缺失的出版信息。 + % + \newtoggle{bbx:gbpub} + \DeclareBibliographyOption{gbpub}[true]{% + %\settoggle{bbx:gbpub}{#1} %或采用下面这一句 + \ifstrequal{#1}{false}{\togglefalse{bbx:gbpub}}{\toggletrue{bbx:gbpub}}} + \ExecuteBibliographyOptions{gbpub} + + % + % 增加控制析出文献来源前的标点符号//输出的选项 + % v1.0k, 2018.04.20,added in by hzz + \newtoggle{bbx:gbpunctin} + \DeclareBibliographyOption{gbpunctin}[true]{% + \settoggle{bbx:gbpunctin}{#1}} + \ExecuteBibliographyOptions{gbpunctin} + + + % 选项设置 + % + \ExecuteBibliographyOptions{ + useprefix = true, %名字的信息包括前缀 + date = year, %日期仅写到年 + maxbibnames=3, %将文献列表和引用中最大名字数量区分开 + minbibnames=3, + maxitems = 1,%设置列表最大数量 + minitems = 1, %设置缩减后的列表最小数量 + isbn=false, + sorting=gb7714-2015, + sortlocale=zh__pinyin,%zh__big5han,%zh__stroke,%zh__gb2312han,%zh__pinyin, + } + + % + %为日期相关选项增加选项值gb7714-2015 + % + \csdef{mkdaterangegb7714-2015}#1{% + \begingroup + \blx@metadateinfo{#1}% + \iffieldundef{#1year} + {} + {\printtext[#1date]{% + \blx@gbdate{#1}{}}}% + \endgroup} + + \newrobustcmd*{\blx@gbdate}[3][]{% + \dateeraprintpre{#2#3year}% + \blx@imc@forcezerosy{\thefield{#2#3year}}\ifblank{#1}{}{\printfield{#1}}% + \iffieldundef{#2#3month}{}{\hyphen\blx@imc@forcezerosmdt{\thefield{#2#3month}}}% + \iffieldundef{#2#3day}{}{\hyphen\blx@imc@forcezerosmdt{\thefield{#2#3day}}}} + + %为姓名格式选择增加的计数器 + \newcounter{gbnamefmtcase} + \def\thegbnamefmtcase{\the\c@gbnamefmtcase} + %为引用标签标注/文献表中本地化字符串中英文选择增加的计数器/命令 + \newcounter{gbcitelocalcase} + \newcounter{gbbiblocalcase} + \def\thegbcitelocalcase{\the\c@gbcitelocalcase} + \def\thegbbiblocalcase{\the\c@gbbiblocalcase} + + +\@ifpackagelater{biblatex}{2016/03/27} + { % 针对biblatex>=3.3版本的选项设置 + + % 增加不同语言排序的切换选项 + % gblanorder=chineseahead的顺序为cn,jp,kr,en,fr,ru + % gblanorder=englishahead的顺序为en,fr,ru,cn,jp,kr + % gblanorder=cn;en;ru;fr;jp;kr的顺序为指定的cn;en;ru;fr;jp;kr,自定义内容可以随意写以分号分隔 + % v1.0q,20190307,hzz + % + \DeclareBibliographyOption[string]{gblanorder}[chineseahead]{% + \ifstrequal{#1}{chineseahead}%%中文在前的顺序 + {\gdef\lancnorder{1}\gdef\lanjporder{2}\gdef\lankrorder{3}% + \gdef\lanenorder{4}\gdef\lanfrorder{5}\gdef\lanruorder{6}}% + {% + \ifstrequal{#1}{englishahead}% + {\execlanodeah\dealsortlan}% + {\execlanodudf{#1}\dealsortlan}% + }% + } + \ExecuteBibliographyOptions{gblanorder} + + \def\execlanodeah{%中文在后的顺序 + \gdef\lancnorder{4} + \gdef\lanjporder{5} + \gdef\lankrorder{6} + \gdef\lanenorder{1} + \gdef\lanfrorder{2} + \gdef\lanruorder{3}} + + \newcounter{lanordernum} + \newcommand{\execlanodudf}[1]{%like:cn;en;ru;fr;jp;kr + \setcounter{lanordernum}{0} + \DeclareListParser{\parsinglanorder}{;} + \renewcommand*{\do}[1]{\stepcounter{lanordernum}\csxdef{lan##1order}{\thelanordernum}} + \parsinglanorder{#1} + } + + % 增加本地化字符串的中英文切换选项 + % gbcitelocal指标注中的本地化字符串 + % gbbiblocal 指文献表中的本地化字符串 + % gblocal 指设置文献表和标注中的本地化字符串 + % v1.0o,20190103,hzz + % + \DeclareBibliographyOption[string]{gbcitelocal}[gb7714-2015]{% + \ifstrequal{#1}{gb7714-2015}{\setcounter{gbcitelocalcase}{0}}{}% + \ifstrequal{#1}{chinese}{\setcounter{gbcitelocalcase}{1}}{}% + \ifstrequal{#1}{english}{\setcounter{gbcitelocalcase}{2}}{}% + } + \ExecuteBibliographyOptions{gbcitelocal} + + \DeclareBibliographyOption[string]{gbbiblocal}[gb7714-2015]{% + \ifstrequal{#1}{gb7714-2015}{\setcounter{gbbiblocalcase}{0}}{}% + \ifstrequal{#1}{chinese}{\setcounter{gbbiblocalcase}{1}}{}% + \ifstrequal{#1}{english}{\setcounter{gbbiblocalcase}{2}}{}% + } + \ExecuteBibliographyOptions{gbbiblocal} + + \DeclareBibliographyOption[string]{gblocal}[gb7714-2015]{% + \ExecuteBibliographyOptions{gbbiblocal=#1}% + \ExecuteBibliographyOptions{gbcitelocal=#1}% + } + %\ExecuteBibliographyOptions{gblocal} %默认值已经通过两个相关选项设置 + + + % + % 增加序号标签格式处理选项,作者年制不做处理,给出只为兼容选项考虑 + % v1.0l,20180623,hzz + % + \DeclareBibliographyOption[string]{gbbiblabel}[bracket]{} + + % + % 增加姓名大小写格式处理选项 + % + \DeclareBibliographyOption[string]{gbnamefmt}[uppercase]{% + \ifstrequal{#1}{uppercase}{\setcounter{gbnamefmtcase}{0}}{}% + \ifstrequal{#1}{lowercase}{\setcounter{gbnamefmtcase}{1}}{}% + \ifstrequal{#1}{givenahead}{\setcounter{gbnamefmtcase}{2}}{}%given-family + \ifstrequal{#1}{familyahead}{\setcounter{gbnamefmtcase}{3}}{}%family-given + \ifstrequal{#1}{pinyin}{\setcounter{gbnamefmtcase}{4}}{}% + \ifstrequal{#1}{reverseorder}{\setcounter{gbnamefmtcase}{5}}{}%family-given/given-family + } + \ExecuteBibliographyOptions{gbnamefmt} + + % + % 增加标签对齐选项 + % + %因为在作者年制中,不需要使用,这里也增加,为了与顺序编码制的兼容性考虑。 + \DeclareBibliographyOption[string]{gbalign}[right]{}% + + + + + } + { + % 增加不同语言排序的切换选项 + % biblatex 3.4及以下版本不能使用多个stylesourcemap,所以不使用该选项 + % 这里给出仅为兼容性考虑 + % v1.0q,20190307,hzz + % + \DeclareBibliographyOption[string]{gblanorder}[chineseahead]{} + + % + % 增加序号标签格式处理选项,作者年制不做处理,给出只为兼容选项考虑 + % v1.0l,20180623,hzz + % + \DeclareBibliographyOption{gbbiblabel}[bracket]{} + + % + % 增加姓名大小写格式处理选项 + % + \DeclareBibliographyOption{gbnamefmt}[uppercase]{% + \ifstrequal{#1}{uppercase}{\setcounter{gbnamefmtcase}{0}}{}% + \ifstrequal{#1}{lowercase}{\setcounter{gbnamefmtcase}{1}}{}% + \ifstrequal{#1}{givenahead}{\setcounter{gbnamefmtcase}{2}}{}%given-family + \ifstrequal{#1}{familyahead}{\setcounter{gbnamefmtcase}{3}}{} + \ifstrequal{#1}{pinyin}{\setcounter{gbnamefmtcase}{4}}{}%family-given + \ifstrequal{#1}{reverseorder}{\setcounter{gbnamefmtcase}{5}}{}%family-given/given-family + } + \ExecuteBibliographyOptions{gbnamefmt} + + % + % 增加标签对齐选项 + % + %因为在作者年制中,不需要使用,这里也增加,为了与顺序年制的兼容性考虑。 + \DeclareBibliographyOption{gbalign}[right]{}% + + } + + +% +% 针对biblatex<3.3版本的选项设置,比如texlive2015中的3.0版 +% +\defversion{3.0}{opt}{ + \ExecuteBibliographyOptions{ + firstinits = true, %名字有缩写,参考3.1.2.3 Internal + } +} +% +% 针对3.3<=biblatex<3.5版本的选项设置,比如texlive2016中的3.4版 +% +\defversion{3.4}{opt}{ + \ExecuteBibliographyOptions{ + giveninits = true, + } +} +% +% 针对3.7<=biblatex<=3.9版本的选项设置,比如texlive2017中的3.7版 +% +\defversion{3.7}{opt}{ + \ExecuteBibliographyOptions{ + giveninits = true, + urldate =edtf, + eventdate =edtf, + } +} +% +% 针对3.10<=biblatex版本的选项设置,比如texlive2018中的3.11版 +% +\defversion{3.10}{opt}{ + \ExecuteBibliographyOptions{ + giveninits = true, + urldate =gb7714-2015,%iso + eventdate =gb7714-2015,%iso + } +} + +% +% 根据biblatex版本信息,选择选项设置 +% +% 原理方法:如下这种选择机制能自动兼容更新的版本,但对于老版本 +% 必须要把情况列全。 +\iftoggle{iftlfive}{\switchversion{3.0}{opt}}{}%biblatex<=3.2 +\iftoggle{iftlsix}{\switchversion{3.4}{opt}}{}%3.3<=biblatex<=3.6 +\iftoggle{iftlseven}{\switchversion{3.7}{opt}}{}%biblatex=3.7 +\iftoggle{iftleight}{\switchversion{3.7}{opt}}{}%3.8<=biblatex<=3.9 +\iftoggle{iftlnine}{\switchversion{3.10}{opt}}{}%biblatex=3.10 +\iftoggle{iftlatest}{\switchversion{3.10}{opt}}{}%biblatex最新3.11 + + +%===================================================================== +%设置本地化字符串 +%===================================================================== + % + % 新建当地化字符串,用来记录“等”字符、“和”字符 + % + \NewBibliographyString{andotherscn} + \NewBibliographyString{andothersincitecn} + \NewBibliographyString{andothersincite} + \NewBibliographyString{andcn} + \NewBibliographyString{andothersjp} + \NewBibliographyString{andotherskr} + \NewBibliographyString{andjp} + \NewBibliographyString{andkr} + \NewBibliographyString{andincitecn} + \NewBibliographyString{andincite} + \NewBibliographyString{volumecn} + \NewBibliographyString{numbercn} + \NewBibliographyString{serialcn} + \NewBibliographyString{incn} + \NewBibliographyString{mathesiscn} + \NewBibliographyString{phdthesiscn} + \NewBibliographyString{editorcn} + \NewBibliographyString{editorscn} + + % + % 修改一些当地化字符串 + % + % 原理方法:直接利用当地化格式english修改出一些中文的格式,具体修改内容参考english.lbx文件 + % 当然也可以增加比如上面定义的andotherscn + % 注意:在lbx文件和bbx文件中定义本地字符串的不同语法,两个参数和一个参数的区别 + \DefineBibliographyStrings{english}{ + bibliography = {\str@bibliography}, + references = {\str@references}, + bytranslator= {\str@bytranslator\adddot}, %将trans. by 改成 译 + and = {\addcomma},%将第2和3人名见的and符号改成 逗号,用\finalnamedelim命令也可以定义,参见3.9.1节 + andcn = {\addcomma},%\str@andcn\ and本地化字符串的中文对应词 + andincitecn = {\addcomma},%将标注中的分开,便于与文献表中的区分 + andincite = {\addcomma}, + %andothers = {et al.}, %将超过3个人名的省略,et al.改成为 等 + andotherscn = {\str@andotherscn},%将超过3个人名的省略,et al.改成为 等 + andothersincitecn={\str@andotherscn},%将标注中的分开,便于与文献表中的区分 + andothersincite={et al\adddot}, + backrefpage = {\str@backrefpage:}, + backrefpages = {\str@backrefpages:}, + in={in\intitlepunct}, + volumecn={\str@volumecn}, + numbercn={\str@numbercn}, + serialcn={\str@serialcn}, + andothersjp={他}, + andotherskr={외}, + andjp={和}, + andkr={和}, + incn={\str@incn\addcolon\addspace}, + mathesiscn={\str@mathesiscn}, + phdthesiscn={\str@phdthesiscn}, + editorscn={\str@editorcn}, + editorcn={\str@editorcn}, + } + + % + % 增加两个命令用于临时的局部的修改本地化字符串 + % 其中\setlocalbibstring修改缩写字符串,setlocalbiblstring修改长字符串 + % 注意使用时因为是局部修改,因此要将其与需要修改的引用命令放在一个编组符号内 + % v1.0t,hzz,20190525 + \newcommand{\setlocalbibstring}[2]{% + \csdef{abx@sstr@#1}{#2}} + \newcommand{\setlocalbiblstring}[2]{% + \csdef{abx@lstr@#1}{#2}} + +%===================================================================== +% 动态数据修改 +%===================================================================== +% +% 各层次的数据映射和动态修改 +% +% 原理方法: +% 1. 进行语言包括中英文判断,并设置和记录,比如记录到userf,usere中 +% 2. 增加文献标识符如[M],[J]等,对一些容易混淆的域进行设置以增强兼容性 +% 3. \DeclareSourcemap命令对于biblatex3.11以下版本只能出现一次,3.11版开始支持多个 +% 4. \DeclarestyleSourcemap在biblatex v3.7版开始可以支持出现多次 +% 5. 把作者和译者信息准确的记录到userf,usere中,用于后面判断是否是cjk字符。 +% 注意:这里用userf,usere而不是namee,namef,是因为只有把name列表转成域,才能有效读取姓名中的字符, +% 如果用namee,namef,name信息会自动解析,所以就不能为cjk判断提供需要的信息 +% +% 不同的文献类型使用相同的驱动输出可以有5种方法: +% 1. 是数据源层的映射,将其它类型转换为某一要使用驱动的类型 +% 2. 是样式层映射,也是将其它类型转换为某一要使用驱动的类型 +% 3. 是驱动层映射,也是将其它类型转换为某一要使用驱动的类型 +% 4. 定义驱动类型别名DeclareBibliographyAlias,将其它类型定义为某一要使用驱动的类型的别名 +% 驱动别名定义本质上是做了驱动层映射 +% 5. 直接定义不同的类型的驱动,但驱动内容相同。 +% +% 关于数据映射和驱动使用的考虑如下: +% 1. 为避免利用biber输出bib文件时的数据变动,尽量不在数据源层映射做类型转换 +% 2. 为减少代码量,尽量少做内容相同的不同类型驱动 +% 3. 因此类型相关的处理主要在样式层映射、驱动层映射、驱动别名 +% 4. 由于biblatex默认做的驱动别名处理可能增加一些信息比如masterthesis转thesis时增加的type +% 可以在样式层映射做某些需要避免这种默认处置的转换 +% 5. 当没有避免默认行为的需求时,全部采用驱动别名的方式处理,等价于驱动层的映射 +% +% 文献类型和驱动考虑如下: +% 1. 连续出版物及析出文献有其特殊性,因此考虑两类periodical和article +% newpaper映射为article,并以note域做区分特殊处理 +% 2. 专著和专著中的析出文献是主要的类型,因此考虑book和inbook +% standard映射为book或inbook,并以note域做区分特殊处理 +% collection和proceedings基本与book类似,因此做book驱动别名处理 +% incollection和inproceedings基本与inbook类似,因此做inbook驱动别名处理 +% 3. 专利类型有其特殊性,考虑patent类型 +% 4. 电子资源类型有其特殊性,考虑online类型 +% 5. 报告类型与book有点类似,出版项处理与book一样,但有时又要有修改和更细日期 +% 因此考虑用一种类型来输出,使用report类型 +% 6. 手册/学位论文等类型与book有点类似,但对于出版项处理时,有缺省时,直接省略, +% 同时有version和edition的区别,因此考虑用一种类型来输出,使用manual类型 +% 7. 包括报告,学位论文在内的其它所有的类型,都做一个判断,当没有出版项时, +% 且存在网址信息时,将其转换为online类型输出,否则都做为manual类型输出。 +% 8. 备选类型misc当存在网址时直接转换为online,由于howpublished域可用于描述 +% 更多的信息,因此不存在网址时,独立做一个备选格式 +% 9. 出版项主要以如下方式处理: +% (a) location+institution+date 仅用于连续出版物 +% (b)publisher+location+date 用于需要完整输出出版项的类型,比如book,collection,proceedings,in*,report +% (c)institution+location+date 用于出版项缺失时不输出的类型,包括manual,thesis,archive等其他类型 +% (d)printlist{insitution} 用于电子资源,仅输出出版者或组织,为数据映射方便,本来默认的organization域转换为用insitution输出。 +% (e) 不输出,主要用于连续出版物析出的文献 +% 10. 日期以如下方式处理: +% date 由于存在biblatex选项,因此通过选项控制,数据源为date解析数据或year +% urldate 由于存在biblatex选项,因此通过选项控制,输出到日,且用[]包围,数据源为urldate +% newsdate 用于公告日期,公开日期或新闻日期,输出到日,但无包围符号,数据源为date +% modifydate 用于更新或修改日期,输出到日,且用()包围,数据源为date或enddate或eventdate + +\DeclareSourcemap{ +\maps[datatype=bibtex]{ + \map{%当没有作者时将editor转成author + \pernottype{inbook}%因为in系列中editor可能用来表示bookauthor,所以排除 + \pernottype{inproceedings} + \pernottype{incollection} + \pernottype{periodical}%因为peridical直接使用editor,所以排除 + %注意notfield在低版本biblatex中没有 + %\step[notfield=author,final]%当author不存在,将editor复制给author + \step[fieldsource=editor,fieldtarget=author]%并删除editor + } + \map{%当没有作者时将translator转成author + \pernottype{inbook} + \pernottype{inproceedings} + \pernottype{incollection} + %\step[notfield=author,final]%当author不存在,将translator复制给author + \step[fieldsource=translator,fieldtarget=author]%并删除translator + } + \map{%让address和location同步,biblatex中address是location的别名 + %因此输出的时候只有location信息,但处理过程中是可以存在address的。 + %\step[notfield=address,final] + \step[fieldsource=location,final] + \step[fieldset=address,origfieldval] + } + \map{%让address和location同步 + %\step[notfield=location,final] + \step[fieldsource=address,final] + \step[fieldset=location,origfieldval] + } + \map{%处理在bib文件用mark标记文献类型标识符的情况 + \step[fieldsource=mark,final] + \step[fieldset=usera, origfieldval] + } + \map{%处理在bib文件中直接给出文献的姓名格式为lowercase的情况 + \step[fieldsource=nameformat,match=lowercase,final] + \step[fieldset=namefmtid,fieldvalue={1}] + } + \map{%处理在bib文件中直接给出文献的姓名格式为givenahead的情况 + \step[fieldsource=nameformat,match=givenahead,final] + \step[fieldset=namefmtid,fieldvalue={2}] + } + \map{%处理在bib文件中直接给出文献的姓名格式为familyahead的情况 + \step[fieldsource=nameformat,match=familyahead,final] + \step[fieldset=namefmtid,fieldvalue={3}] + } + \map{%处理在bib文件中直接给出文献的姓名格式为pinyin的情况 + \step[fieldsource=nameformat,match=pinyin,final] + \step[fieldset=namefmtid,fieldvalue={4}] + } + \map{%根据article确定文献类型标识符 + \pertype{article} + \step[fieldset=usera, fieldvalue={J}] + } + \map{%根据periodical确定文献类型标识符 + \pertype{periodical} + \step[fieldset=usera, fieldvalue={J}] + \step[fieldsource=author] %有时会把author和editor混淆,处理后使用editor + \step[fieldset=editor, origfieldval] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%根据增加一个新闻报纸的类型newspaper确定文献类型标识符 + \pertype{newspaper} + \step[fieldset=usera, fieldvalue={N}] + \step[fieldset=note, fieldvalue=news]%因为没有专门的驱动,记录note方便映射为article后判断 + } + \map{%对应增加的一个数据库类型database确定文献类型标识符 + \pertype{database} + \step[fieldset=usera, fieldvalue={DB}] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个数据集类型dataset确定文献类型标识符 + \pertype{dataset} + \step[fieldset=usera, fieldvalue={DS}]% + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个软件类型software确定文献类型标识符 + \pertype{software} + \step[fieldset=usera, fieldvalue={CP}] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个舆图类型map确定文献类型标识符 + \pertype{map} + \step[fieldset=usera, fieldvalue={CM}]% + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个档案类型archive确定文献类型标识符 + \pertype{archive} + \step[fieldset=usera, fieldvalue={A}] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%因为misc类型本身就是没有类型,而不像其它文献有明确的类型,所以 + %当misc类型带有网址时,直接将其转换为online类型 + \pertype{misc} + \step[fieldsource=url,final] + \step[typesource=misc,typetarget=online] + } + \map{%对应增加的一个备选类型misc确定文献类型标识符 + \pertype{misc} + \step[fieldset=usera, fieldvalue={Z}]% + } + \map{ + \pertype{book} + \pertype{inbook} + \step[fieldset=usera, fieldvalue={M}] + \step[fieldsource=version] %有时会把version和edition混淆,处理后直接用edition + \step[fieldset=edition, origfieldval] + } + \map{%兼容老的standard类型,确定文献类型标识符 + \pertype{standard} + \step[fieldset=usera, fieldvalue={S}] + \step[fieldset=note, fieldvalue=standard]%因为没有专门的驱动,记录note方便映射为book和inbook后判断 + } + \map{ + \pertype{patent} + \step[fieldset=usera, fieldvalue={P}] + } + \map{ + \pertype{inproceedings} + \pertype{conference}%兼容老的conference类型 + \step[fieldset=usera, fieldvalue={C}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{proceedings} + \step[fieldset=usera, fieldvalue={C}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{incollection} + \step[fieldset=usera, fieldvalue={G}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{collection} + \step[fieldset=usera, fieldvalue={G}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{report} + \pertype{techreport}%兼容老的techreport类型 + \step[fieldset=usera, fieldvalue={R}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{thesis} + \pertype{mastersthesis}%兼容老的mastersthesis和phdthesis类型 + \pertype{phdthesis} + \step[fieldset=usera, fieldvalue={D}] + \step[fieldsource=publisher]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{ + \pertype{online} + \pertype{electronic}%兼容老的electronic类型 + \pertype{www}%兼容老的www类型 + \step[fieldset=usera, fieldvalue={EB}] + \step[fieldsource=publisher]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval]%因为online的出版项处理类似手册 + \step[fieldsource=organization]%有时会把organization和institution混淆,处理后使用institution,以增强兼容性 + \step[fieldset=institution, origfieldval] + } + \map{ + \pertype{manual} + \step[fieldset=usera, fieldvalue={A}] + \step[fieldsource=edition]%有时会把version和edition混淆,处理后使用version + \step[fieldset=version, origfieldval] + \step[fieldsource=publisher]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + \step[fieldsource=organization]%有时会把organization和institution混淆,处理后使用institution,以增强兼容性 + \step[fieldset=institution, origfieldval] + } + \map{ + \pertype{unpublished} + \step[fieldset=usera, fieldvalue={Z}] + } + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={author}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={editor}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={translator}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={bookauthor}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map{%处理一些用year表示date的情况 + %这样处理将会设置date域,并使得labeldatesource变为空,因为date的前缀为空(如果是urldate,那么labeldatesource就是url)。 + %同时date域会被biblatex自动解析为year,month,day,并且覆盖原来的year信息 + \step[fieldsource=year] + \step[fieldset=date, origfieldval] + } + \map{%将entrykey放入keywords中用于后期使用 + \step[fieldsource=entrykey] + \step[fieldset=keywords, origfieldval] + } + \map{%文献题名的中文判断,将信息保存到userd中,避免因为标签生成原因导致title域被清除而产生问题 + \step[fieldsource=title, match=\regexp{[\x{2FF0}-\x{9FA5}]},final]% + \step[fieldset=userd, fieldvalue={chinese}] + } + \map{\step[fieldsource=title,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userd,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=title,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userd,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=title,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userd,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=title,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userd,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userd,且存在title域的默认设置为英文 + \step[fieldsource=title,final] + \step[fieldset=userd,fieldvalue={english}] + } + \map{%作者的中文判断 + \step[fieldsource=author, match=\regexp{[\x{2FF0}-\x{9FA5}]},final] + \step[fieldset=userf, fieldvalue={chinese}] + } + \map{\step[fieldsource=author,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userf,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=author,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userf,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=author,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userf,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=author,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userf,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userf,且存在author域的默认设置为英文 + \step[fieldsource=author,final] + \step[fieldset=userf,fieldvalue={english}] + } + \map{%译者的中文判断 + \step[fieldsource=translator, match=\regexp{[\x{2FF0}-\x{9FA5}]},final] + \step[fieldset=usere, fieldvalue={chinese}] + } + \map{\step[fieldsource=translator,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=usere,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=translator,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=usere,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=translator,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=usere,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=translator,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=usere,fieldvalue={korean}]%韩语 + } + \map{%将没有设置usere,且存在translator域的默认设置为英文 + \step[fieldsource=translator,final] + \step[fieldset=usere,fieldvalue={english}] + } + \map{%编者的中文判断 + \step[fieldsource=editor, match=\regexp{[\x{2FF0}-\x{9FA5}]},final]%直接匹配cjk字符,unicode编码位置从2FF0到9FA5 + \step[fieldset=userc, fieldvalue={chinese}] + } + \map{\step[fieldsource=editor,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userc,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=editor,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userc,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=editor,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userc,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=editor,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userc,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userc,且存在editor域的默认设置为英文 + \step[fieldsource=editor,final] + \step[fieldset=userc,fieldvalue={english}] + } + \map{%编者的中文判断 + \step[fieldsource=bookauthor, match=\regexp{[\x{2FF0}-\x{9FA5}]},final]%直接匹配cjk字符,unicode编码位置从2FF0到9FA5 + \step[fieldset=userb, fieldvalue={chinese}] + } + \map{\step[fieldsource=bookauthor,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userb,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=bookauthor,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userb,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=bookauthor,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userb,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=bookauthor,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userb,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userc,且存在editor域的默认设置为英文 + \step[fieldsource=bookauthor,final] + \step[fieldset=userb,fieldvalue={english}] + } + \map{\step[fieldsource=userd,final]%userd存在则用根据标题的语言设定language + \step[fieldset=language,origfieldval]%本身language存在则不设定 + } + \map{\step[fieldsource=userf,final]%userd不存在,而userf存在则根据author的语言设定language + \step[fieldset=language,origfieldval] + }%如果没有作者和标题,那么剩下的最可能有意义的只有网址了,而网址通常是英文的,因此不用再进一步对其它域进行判断了。 + \map{%将没有设置的language设置成en,即认为不是中文的就是英文的。 + \step[fieldset=language,fieldvalue={english}] + } + \map{%一条文献的语言已经设定在language域中,由于出版项相关宏中使用userd判断, + %所以将一条文献的主体语言设定到userd中,本身前面userd已经设定,但没有处理无标题的情况, + %这里的处理等价于没有标题时,利用作者的语言设定userd,再没有作者,则默认用英文设定userd + \step[fieldsource=language] + \step[fieldset=userd,origfieldval] + } + \map{%当文献给出language域时,设置文献要使用的本地化字符串的语言 + %biblatex 3.11及以下版本仅有match是区分大小写的,而3.12版开始用matchi来区分大小,而match不区分 + %这里为兼容3.11及以下版本,所以用一个复杂一点的正则表达式 + \step[fieldsource=language,match=\regexp{(e|E)(n|N)(g|G)(l|L)(i|I)(s|S)(h|H)},final] + \step[fieldset=langid,fieldvalue={english}] + \step[fieldset=lansortorder,fieldvalue=\lanenorder] + } + \map{ + \step[fieldsource=language,match=\regexp{(r|R)(u|U)(s|S)(s|S)(i|I)(a|A)(n|N)},final] + \step[fieldset=langid,fieldvalue={russian}] + \step[fieldset=lansortorder,fieldvalue=\lanruorder] + } + \map{% + \step[fieldsource=language,match=\regexp{(f|F)(r|R)(e|E)(n|N)(c|C)(h|H)},final] + \step[fieldset=langid,fieldvalue={french}] + \step[fieldset=lansortorder,fieldvalue=\lanfrorder] + } + \map{% + \step[fieldsource=language,match=\regexp{(c|C)(h|H)(i|I)(n|N)(e|E)(s|S)(e|E)},final]%中日韩语目前都用english, + \step[fieldset=langid,fieldvalue={english}] + \step[fieldset=lansortorder,fieldvalue=\lancnorder] + } + \map{% + \step[fieldsource=language,match=\regexp{(j|J)(a|A)(p|P)(a|A)(n|N)(e|E)(s|S)(e|E)},final]%中日韩语目前都用english, + \step[fieldset=langid,fieldvalue={english}] + \step[fieldset=lansortorder,fieldvalue=\lanjporder] + } + \map{% + \step[fieldsource=language,match=\regexp{(k|K)(o|O)(r|R)(e|E)(a|A)(n|N)},final]%中日韩语目前都用english, + \step[fieldset=langid,fieldvalue={english}] + \step[fieldset=lansortorder,fieldvalue=\lankrorder] + } + \map{%尝试未定义数据模型的standard类型映射为其他类型book或inbook, + %standard类型在blx-dm中有出现,但仅定义了类型,域和约束等都没有定义 + %因为可能要映射两种类型,所以不能在驱动层处理,因为要做判断 + \step[fieldsource=booktitle,final]%当存在booktitle域是映射为inbook + \step[typesource=standard, typetarget=inbook, final] + } + \map{%剩下的全部映射为book + \step[typesource=standard, typetarget=book, final] + } +% \map{%先于标准样式的driver层映射,以取消type设置 +% \step[typesource=mastersthesis, typetarget=thesis, final] +% %\step[fieldset=type, fieldvalue=mathesis] +% } +% \map{%先于标准样式的driver层映射,以取消type设置 +% \step[typesource=phdthesis, typetarget=thesis, final] +% %\step[fieldset=type, fieldvalue=phdthesis] +% } + \map{%先于标准样式的driver层映射,以取消type设置 + \step[typesource=techreport, typetarget=report, final] + %\step[fieldset=type, fieldvalue=techreport] + } + \map{% + \pertype{report} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=report,typetarget=online] + \step[fieldset=note,fieldvalue={report}] + } + \map{% + \pertype{thesis} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=thesis,typetarget=online] + } + \map{% + \pertype{manual} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=manual,typetarget=online] + } + \map{% + \pertype{unpublished} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=unpublished,typetarget=online] + } + \map{% + \pertype{database} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=databasetypetarget=online] + } + \map{% + \pertype{dataset} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=dataset,typetarget=online] + } + \map{% + \pertype{software} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=software,typetarget=online] + } + \map{% + \pertype{map} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=map,typetarget=online] + } + \map{% + \pertype{archive} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=archive,typetarget=online] + } + \map[overwrite]{%这里还必须有overwrite,注意不同版本存在差异,比如texlive2015变16后biber有变化(20161207修改正确) + \step[fieldsource=note, final]%将note域信息复制给keywords,用于输出时容易区分标准和报纸 + \step[fieldset=keywords, fieldvalue={,}, append] + \step[fieldset=keywords, origfieldval, append] + } + \map[overwrite]{%title,booktitle,journaltitle,journal,publisher,address,location,institution,organization + \step[fieldsource={title}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={booktitle}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={journaltitle}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={journal}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={publisher}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={address}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={location}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={institution}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + \map[overwrite]{ + \step[fieldsource={booktitle}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}] + } + \map[overwrite]{ + \step[fieldsource={booktitle}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}] + } + %对于高版本(3.4以上)可以用下面这一段取代前面那一段,为了兼容gbnoauthor选项,这些代码只能在sourcemap中使用,所以只能选择前面那一段 + %\map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{ +% \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}] +% } +% \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{ +% \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}] +% } +% \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,% +% address,location,institution,organization}]{ +% \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] +% } + } +} + +% +% 佚名/noauthor的处理 +% +% 原理方法:利用样式层的动态数据修改实现 +\def\dealnoathor{ + \DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map{%默认情况下将空缺作者的中文文献设置为佚名 + \step[fieldsource=language,match={chinese},final] + \step[fieldset=author, fieldvalue={佚名}] + } + \map{%默认情况下将空缺作者的英文文献设置为A{non} + \step[fieldsource=language,match={english},final] + \step[fieldset=author, fieldvalue={A{non}}]%noauthor换成Anon,同时为避免大写还加了{} + } + } + } +} + +% +% 不同语言分集调整的实现方式 +% +% 原理方法:利用样式层的动态数据修改lansortorder域来实现排序 +\def\dealsortlan{ + \DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map[overwrite]{%当文献给出language域时,设置文献要使用的本地化字符串的语言 + \step[fieldsource=language,match=english,final] + \step[fieldset=lansortorder,fieldvalue=\lanenorder] + } + \map[overwrite]{ + \step[fieldsource=language,match=russian,final] + \step[fieldset=lansortorder,fieldvalue=\lanruorder] + } + \map[overwrite]{% + \step[fieldsource=language,match=french,final] + \step[fieldset=lansortorder,fieldvalue=\lanfrorder] + } + \map[overwrite]{% + \step[fieldsource=language,match=chinese,final]%中日韩语目前都用english, + \step[fieldset=lansortorder,fieldvalue=\lancnorder] + } + \map[overwrite]{% + \step[fieldsource=language,match=japanese,final]%中日韩语目前都用english, + \step[fieldset=lansortorder,fieldvalue=\lanjporder] + } + \map[overwrite]{% + \step[fieldsource=language,match=korean,final]%中日韩语目前都用english, + \step[fieldset=lansortorder,fieldvalue=\lankrorder] + } + } + } +} + + +% +%驱动别名等价于驱动层映射 +% +\DeclareBibliographyAlias{newspaper}{article}% +\DeclareBibliographyAlias{inproceedings}{inbook}%会议论文文献类型驱动 +\DeclareBibliographyAlias{conference}{inbook}%会议论文文献类型驱动 +\DeclareBibliographyAlias{incollection}{inbook}%文集中析出文献类型驱动 +\DeclareBibliographyAlias{collection}{book}%%文集类型驱动 +\DeclareBibliographyAlias{proceedings}{book}%会议论文集文献类型驱动 +\DeclareBibliographyAlias{thesis}{manual}%学位论文驱动 +\DeclareBibliographyAlias{unpublished}{manual}%其它类型驱动 +\DeclareBibliographyAlias{database}{manual} +\DeclareBibliographyAlias{dataset}{manual} +\DeclareBibliographyAlias{software}{manual} + + +%===================================================================== +% 设置排序格式 +%===================================================================== +% +% 排序格式,用降序,及userb域,针对biblatex3.7及以下版本 +% +\defversion{3.7}{sort}{%这是3.4版的,3.7版略有差异,但不大,后面有注释 + \DeclareSortingScheme{gb7714-2015}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{lansortorder}%language + } + \sort{%[direction=descending] + \field{sortname} + \field{author} + \field{editor} + \field{translator} + } + \sort{ + \field{sortyear} + \field{year} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field[padside=left,padwidth=4,padchar=0]{volume}%3.7版是\field{volume} + \literal{0000}%3.7版是\literal{0} + } + } + + %降序的nyt + \DeclareSortingScheme{gbnytd}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{lansortorder}%language + } + \sort[direction=descending]{ + \field{sortname} + \field{author} + \field{editor} + \field{translator} + } + \sort{ + \field{sortyear} + \field{year} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field[padside=left,padwidth=4,padchar=0]{volume}%3.7版是\field{volume} + \literal{0000}%3.7版是\literal{0} + } + } + + %降序的ynt + \DeclareSortingScheme{gbyntd}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{lansortorder}%language + } + \sort[direction=descending]{ + \field{sortyear} + \field{year} + } + \sort{ + \field{sortname} + \field{author} + \field{editor} + \field{translator} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field[padside=left,padwidth=4,padchar=0]{volume}%3.7版是\field{volume} + \literal{0000}%3.7版是\literal{0} + } + } + + %升序的ynt + \DeclareSortingScheme{gbynta}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{lansortorder}%language + } + \sort{ + \field{sortyear} + \field{year} + } + \sort{ + \field{sortname} + \field{author} + \field{editor} + \field{translator} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field[padside=left,padwidth=4,padchar=0]{volume}%3.7版是\field{volume} + \literal{0000}%3.7版是\literal{0} + } + } +} + + +% +% 排序格式,用降序,及userb域,针对biblatex3.8及以上版本 +% +\defversion{3.8}{sort}{ + \DeclareSortingTemplate{gb7714-2015}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{lansortorder}%language + } + \sort{%[direction=descending] + \field{sortname} + \field{author} + \field{editor} + \field{translator} + } + \sort{ + \field{sortyear} + \field{year} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field{volume} + \literal{0} + } + } + + %降序的nyt + \DeclareSortingTemplate{gbnytd}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{lansortorder}%language + } + \sort[direction=descending]{% + \field{sortname} + \field{author} + \field{editor} + \field{translator} + } + \sort{ + \field{sortyear} + \field{year} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field{volume} + \literal{0} + } + } + + %降序的ynt + \DeclareSortingTemplate{gbyntd}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{lansortorder}%language + } + \sort[direction=descending]{ + \field{sortyear} + \field{year} + } + \sort{% + \field{sortname} + \field{author} + \field{editor} + \field{translator} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field{volume} + \literal{0} + } + } + + %升序的ynt + \DeclareSortingTemplate{gbynta}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{lansortorder}%language + } + \sort{%[direction=ascending] + \field{sortyear} + \field{year} + } + \sort{% + \field{sortname} + \field{author} + \field{editor} + \field{translator} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field{volume} + \literal{0} + } + } + + % + % 定义命令\defdoublelangentry,用于biblatex>v3.8版利用related实现双语文献的处理 + % + %为了实现v3.8以上版本的双语文献,采用related的方法代替set方法,因为set方法已经无法实现了, + %因为set不再复制其第一个成员的信息。于是定义一个命令,用于动态的修改数据,即添加related域的信息 + %其中使用了\DeclareStyleSourcemap,但由于其只能出现在导言区中,因此\defdoublelangentry命令也只能出现在导言区中 + \newcommand{\defdoublelangentry}[2]{% + \edef\entrykeya{##1} + \edef\entrykeyb{##2} + \DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map{ + \step[fieldsource=entrykey, match=\entrykeya, final] + \step[fieldset=related, fieldvalue=\entrykeyb] + } + } + } + } +} + + +\ifboolexpr{ +test {\iftoggle{iftlfive}} +or +test {\iftoggle{iftlsix}} +or +test {\iftoggle{iftlseven}}%biblatex<=3.7 +}{\switchversion{3.7}{sort}}{\switchversion{3.8}{sort}}%3.8<=biblatex + + +%===================================================================== +%参考文献表环境 +%===================================================================== + +% +% 列表格式 +% +% 增加一个\bibitemindent尺寸用于控制list环境的itemindent +% v1.0l,20180615,hzz +\setlength{\bibhang}{1em} +\newlength{\bibitemindent} +\setlength{\bibitemindent}{-\bibhang} + \defbibenvironment{bibliography} + {\list + {} + {\setlength{\leftmargin}{\bibhang}% + \setlength{\itemindent}{\bibitemindent}% + \setlength{\itemsep}{\bibitemsep}% + \setlength{\parsep}{\bibparsep}}} + {\endlist} + {\item} + + +%===================================================================== +% 设置单元或块等的标点 +%===================================================================== +\renewrobustcmd*{\bibinithyphendelim}{\addhighpenspace}%用于处理姓名中名部分存在-的情况,比如ZHANG Yu-xin +\renewcommand*{\subtitlepunct}{\addcolon\space} %修改标题和其它标题信息间的标点%来源biblatex.def +% +% 利用set实现的多语言文献不同语言间的分隔符 +% 20170411,双语之间用newline替换par,避免采用gb7714-2015的项对齐方式第二语言间分段导致没有缩进 +% +% 原理方法:set方法可以参考3.11.5 Entry Sets,4.11.1 Entry Sets +% 这里调整一下两种语言参考文献的间隔,源来自biblatex.def +\renewcommand*{\entrysetpunct}{\adddot\par\nobreak} +\renewcommand*{\bibpagespunct}{\addcolon\addthinspace}%页码引用格式的修改%修改为用冒号 +%\renewcommand{\relateddelim}{}%\par + +%===================================================================== +% 修改域的格式,重定义域的输出宏 +%===================================================================== +% +% 新增文献类型标识符的格式 +% []前的nobreak,从GB4.1节的例子看不应该加,所以去掉 +% 但因为考虑到cjk字符和[]之间可能添加空格,所以仍然加上 +% 而[]中间的内容,从4.6.2节的例子看也是可以分割的,因此内部的nobreak也可以去掉 +% +\DeclareFieldFormat{gbtypeflag}{% +\iftoggle{bbx:url}% + {\iffieldundef{url}%当存在url时,增加一个OL标识符 + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}% + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}% + }% + {\ifentrytype{online}% + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}% + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}% + }% +} + + +% +% 新增用于报纸的文献类型标识符的格式 +% +\DeclareFieldFormat{gbtypeflagn}{%用于报纸newspaper +\iftoggle{bbx:url}% + {\iffieldundef{url}%当存在url时,增加一个OL标识符 + {\nobreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% + {\nobreak\printtext{[}\nobreak N\printtext{\texttt{/}OL]}\nobreak}% + }% + {\nobreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% +} + + +% +% 新增用于标准的文献类型标识符的格式 +% +\DeclareFieldFormat{gbtypeflags}{%用于标准standard +\iftoggle{bbx:url}% + {\iffieldundef{url}%当存在url时,增加一个OL标识符 + {\nobreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% + {\nobreak\printtext{[}\nobreak S\printtext{\texttt{/}OL]}\nobreak}% + }% + {\nobreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% +} + +% +% 重设title等参考文献信息的输出格式 +% +% 原理方法:修改来自biblatex.def文件的原格式 +\newcommand{\bibtitlefont}{} +\newcommand{\bibauthorfont}{} +\newcommand{\bibpubfont}{} +\DeclareFieldFormat{title}{#1\adddot\addthinspace} +\DeclareFieldFormat{journaltitle}{#1\isdot}%添加\isdot,用于缩写名带点情况,将其转换为缩写点,便于标点的追踪 +\DeclareFieldFormat{issuetitle}{#1} +\DeclareFieldFormat{maintitle}{#1} +\DeclareFieldFormat{booktitle}{#1} +\DeclareFieldFormat%将期刊等文献的标题中原来带的引号去掉 + [article,patent,thesis,unpublished] + {title}{#1\adddot\addthinspace} +\DeclareFieldFormat%将期刊等文献的标题中原来带的引号去掉 + [inbook,incollection,inproceedings] + {title}{#1}%\nopunct\unspace +\DeclareFieldFormat{url}{\url{#1}} %url域修改如本行%url相关输出,源来自biblatex.def +\def\UrlFont{\rmfamily}%设置url字体为roman字体%\ttfamily +\setcounter{biburlnumpenalty}{100} %让url可以在数字后断行 +\setcounter{biburlucpenalty}{100} %让url可以在大写字母后断行 +\setcounter{biburllcpenalty}{100} %让url可以在小写字母后断行 +\DeclareFieldFormat{doi}{% + \rmfamily{DOI}\addcolon\space + \ifhyperref + {\href{https://doi.org/#1}{\nolinkurl{#1}}} + {\nolinkurl{#1}}} +% +% 标题的字母大小写格式修改 +% +% 注意:修改标题的字母大小写,不能用前面的title的格式而要用titlecase +% 因为titlecase is applied to the contents of the field directly,title is not +%\DeclareFieldFormat{titlecase}{\MakeCapital#1}%重设标题格式,将其修改为首字母大写 +\DeclareFieldFormat{titlecase}{\iftoggle{bbx:titlelink}{% +\iffieldundef{url}{\MakeCapital#1}{% +\href{\thefield{url}}{#1}}}{\MakeCapital#1}}%重设标题格式,将其修改为首字母大写 +\DeclareFieldFormat{pages}{#1}%页码引用格式的修改%去掉前面引导页码的pp.等字符 +\DefineBibliographyExtras{english}{\renewcommand*{\bibrangedash}{-}} + +\def\execgbfdfmtstd{%恢复到标准样式的设置 +\DeclareFieldFormat{title}{\mkbibemph{##1}} +\DeclareFieldFormat + [article,inbook,incollection,inproceedings,patent,thesis,unpublished] + {title}{\mkbibquote{##1\isdot}} +\DeclareFieldFormat + [suppbook,suppcollection,suppperiodical] + {title}{##1} +\DeclareFieldFormat{journaltitle}{\mkbibemph{##1}} +\DeclareFieldFormat{issuetitle}{\mkbibemph{##1}} +\DeclareFieldFormat{maintitle}{\mkbibemph{##1}} +\DeclareFieldFormat{booktitle}{\mkbibemph{##1}} +\DeclareFieldFormat{url}{\mkbibacro{URL}\addcolon\space\url{##1}} +\DeclareFieldFormat{titlecase}{##1} +\DeclareFieldFormat{pages}{\mkpageprefix[bookpagination]{##1}} +} + +% +% 文献标题后的标点问题 +% v1.0k,20180405,为texlive2017以上版本中的beamer兼容性做的处理,Hu Zhenzhen +% +% 原理方法:如下代码处理texlive2017以上版本中,beamer中文献的标题后出现两个点的情况: +% texlive2017以上的beamer中对macro{title}做了patch,正常情况下不会出现两个点的情况,但由于 +% 之前为了处理texlive2015,2016下的title格式添加了adddot,导致出现两个点的情况,而且也影响 +% 析出文献的//符号的输出,因此再次对macro{title}做patch消除beamer中做apptocmd时添加的\newunitpunct +\ifboolexpr{% + test{\iftoggle{iftlfive}} + or + test{\iftoggle{iftlsix}} + }{}% + {%texlive 2017对应iftlseven以上版本 + \@ifclassloaded{beamer}{ + \DeclareFieldFormat{title}{#1}% + \DeclareFieldFormat[article,patent,thesis,unpublished]{title}{#1} + \AtBeginDocument{% + \patchcmd{\abx@macro@title}{\newunitpunct}{}{}{}}}{} + } + + +% +% 修改译者位置格式 +% +% 原理方法:修改来自biblatex.def文件的bytranslator+others宏的格式 +\renewbibmacro*{bytranslator+others}{% + \ifnameundef{translator} + {} + {%\usebibmacro{bytranslator+othersstrg} + %\setunit{\addspace}% + \printnames[bytranslator]{translator}% + \clearname{translator}% + %从macro*{bytranslator+othersstrg}%中可以看到当地化字符串格式的引用前的代码处理 + %比如生成cotranslator等用于调用cotranslator所代表的当地化字符串 + \usebibmacro{bytranslator+othersstrg}%“译”的位置换到下面来,即放到译者后面。 + %\setunit{\addspace}% + \newunit}% + \usebibmacro{withothers}} + + + +% +% 修改作者数量超过限定值,做省略时的处理格式 +% v1.0,20160701,hzz +% v1.0O,20190103,hzz,修改利用新定义的一个分隔符strandothersdelim +% +% 原理方法:判断作者或译者是否中文,若中文用字符等,否则用et al. 。 +% \printnames由start-stop控制项数,默认是1和maxnames/minnames +\renewbibmacro*{name:andothers}{% + \ifboolexpr{ + test {\ifnumequal{\value{listcount}}{\value{liststop}}} + and + test \ifmorenames + }{\ifnumgreater{\value{liststop}}{1}%注意这里试图去区分姓名总数大于1的情况,当姓名总数大于1时,最后一个姓名后面先加入一个\finalandcomma + {\finalandcomma}%目前国标没有这样的区分要求,如果有需要也是可以这么去做的。 + {}% +\printdelim{andothersdelim}\printdelim{strandothersdelim}% +}{%当是译者的时候需要特殊处理:从7.2节看等,译前面加逗号,但从示例看等和译同时出现时,译前的逗号没有,比如: +%袁训来, 陈哲, 肖书海, 等. +%胡泳, 范海燕, 译. +%潘惠霞, 魏婧, 杨艳, 等译. +\ifcurrentname{translator}{\addcomma\addthinspace}{}%为了实现上述第二个示例情况做的处理 +}} + +% 修改省略作者后的本地化字符串,比如et al. +% v1.0o,20190103,hzz +% +% 原理方法:默认情况下判断作者或译者是否中文,若中文用字符andotherscn=“等”,否则用andothers=“et al.”。 +% 非默认情况,根据选项信息,选择选择强制中文或英文 +% 首先设置全局的,然后设置文献表中的,这一等价于将所有的cite命令环境都设置过了 +% 而不用对每一个引用命令单独设置,比如cite,parancite,textcite都设置 +\DeclareDelimFormat{strandothersdelim}{% + \edef\userfieldabcde{userd}%这里使用\iffieldequalstr{labelnamesource}替代ifcurrentname因为标注中使用ifcurrentname无效 + \iffieldequalstr{labelnamesource}{translator}{\edef\userfieldabcde{usere}}{}% + \iffieldequalstr{labelnamesource}{editor}{\edef\userfieldabcde{userc}}{}% + \iffieldequalstr{labelnamesource}{author}{\edef\userfieldabcde{userf}}{}% + \iffieldequalstr{labelnamesource}{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbcitelocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\ifbibstring{andothersincitecn}{\bibstring{andothersincitecn}}{\bibstring{andothers}}}{}%中文已经通过english本地化字符串定义 + \iffieldequalstr{\userfieldabcde}{korean}{\ifbibstring{andotherskr}{\bibstring{andotherskr}}{\bibstring{andothers}}}{}%韩语未定义,所以与bib中一致 + \iffieldequalstr{\userfieldabcde}{japanese}{\ifbibstring{andothersjp}{\bibstring{andothersjp}}{\bibstring{andothers}}}{}%日与同韩语 + \iffieldequalstr{\userfieldabcde}{english}{\ifbibstring{andothersincite}{\bibstring{andothersincite}}{\bibstring{andothers}}}{}%英语已定义 + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{andothers}}{}%法语未定义,若要定义需要针对french本地化字符串定义 + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{andothers}}{}%俄语未定义,若要定义需要针对russian本地化字符串定义 + \or% + \bibstring{andothersincitecn}% + \or% + \bibstring{andothersincite}% + \fi} + + +\DeclareDelimFormat[bib,biblist]{strandothersdelim}{% + \edef\userfieldabcde{userd}% + \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andotherscn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andotherskr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andothersjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\bibstring{andothers}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{andothers}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{andothers}}{}% + \or% + \bibstring{andotherscn}% + \or% + \bibstring{andothers}% + \fi} + + +% +% 修改最后一个作者前的字符串,比如 and +% v1.0o,20190103,hzz +% +% 原理方法:默认情况下判断作者或译者是否中文,若中文用字符andcn=“和”,否则用and=“and”。 +% 非默认情况,根据选项信息,选择选择强制中文或英文 +% 首先设置全局的,然后设置文献表中的,这一等价于将所有的cite命令环境都设置过了 +% 而不用对每一个引用命令单独设置,比如cite,parancite,textcite都设置 +\DeclareDelimFormat{finalnamedelim}{% + \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% +% \addspace% + \edef\userfieldabcde{userd}% + \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbcitelocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andincitecn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andkr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\space\bibstring{andincite}\space}{}% + \iffieldequalstr{\userfieldabcde}{french}{\space\bibstring{and}\space}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\space\bibstring{and}\space}{}% +%\space% + \or% + \bibstring{andincitecn}%\space% + \or% +\space\bibstring{andincite}\space% + \fi} + +\DeclareDelimFormat[bib,biblist]{finalnamedelim}{% + \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% + \addspace% + \edef\userfieldabcde{userd}% + \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andcn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andkr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\bibstring{and}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{and}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{and}}{}% +\space% + \or% + \bibstring{andcn}\space% + \or% + \bibstring{and}\space% + \fi} + + + +% +% 重设title的输出 +% +% 20180425,v1.0k,为标题增加字体控制命令,Hu Zhenzhen +% 原理方法:将文献类型标识符输出出去,原输出来自biblatex.def文件 +% 利用toggle做标识符是否输出的判断 +\renewbibmacro*{title}{% + \ifboolexpr{% + test{\iffieldundef{title}}% + and + test{\iffieldundef{subtitle}}% + }% + {}% + {\printtext[title]{\bibtitlefont%增加字体控制命令 + \printfield[titlecase]{title}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct}% + \printfield[titlecase]{subtitle}}% + \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 + {\setunit{\subtitlepunct}\printfield{titleaddon}}% + \iftoggle{bbx:gbtype}{% + \iffieldundef{note}{\printfield[gbtypeflag]{usera}}%在标题后直接给出文献标识字母,判断一下,是否是报纸和标准 + {\iffieldequalstr{note}{standard}{\printfield[gbtypeflags]{usera}}%判断是否为标准 + {\iffieldequalstr{note}{news}{\printfield[gbtypeflagn]{usera}}%判断是否为报纸 + {\printfield[gbtypeflag]{usera}}}%其它 + }}{}% + %\iffieldundef{booktitle}{\newunit}{}%当title是析出时,不要标点 + %\newunit + }% +}} + + +% +% 作者信息的输出格式 +% +% 20180425,v1.0k,为作者增加字体控制命令,Hu Zhenzhen +% 20180603,v1.0l,增加使用nameformat域来选择姓名格式 +\DeclareNameFormat{namefmtselected}{% +\iffieldundef{namefmtid}{}% +{\defcounter{gbnamefmtcase}{\thefield{namefmtid}}}% +\ifcase\value{gbnamefmtcase}% + \ifgiveninits + {\usebibmacro{name:gbuppercase} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:gbuppercase} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or + \ifgiveninits + {\usebibmacro{name:gblowercase} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:gblowercase} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or + \ifgiveninits + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or + \ifgiveninits + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or +\usebibmacro{name:gbpinyin} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}% +\or + \ifnumequal{\value{listcount}}{1} + {\ifgiveninits + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% + \ifboolexpe{% + test {\ifdefvoid\namepartgiven} + and + test {\ifdefvoid\namepartprefix}} + {} + {\usebibmacro{name:revsdelim}}} + {\ifgiveninits + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}}% +\fi + \usebibmacro{name:andothers}} + +\DeclareNameAlias{default}{namefmtselected}%姓名的默认格式采用可选的模式 +\DeclareNameAlias{sortname}{default}% Used in the bibliography %family-given/given-family +\DeclareNameAlias{citename}{default}% Default used by \citename + +\DeclareDelimFormat[bib,biblist]{andothersdelim}{\addcomma\addspace} +%\DeclareDelimFormat[textcite]{andothersdelim}{\addspace}% + +%GB/T 7714-2015 风格,全部大写 +\newbibmacro*{name:gbuppercase}[4]{\bibauthorfont% +\renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 +\renewcommand*{\revsdnamepunct}{}% + \ifuseprefix% + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifdefvoid{#3}{}{% + \ifcapital% + {\mkbibnameprefix{\MakeCapital{#3}}\isdot}% + {\mkbibnameprefix{#3}\isdot}% + \ifprefchar{}{\bibnamedelimc}}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{\MakeUppercase{#2}}\isdot}%\MakeCapital + \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}% + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifboolexpe{% + test {\ifdefvoid{#2}} + and + test {\ifdefvoid{#3}}} + {}{\revsdnamepunct}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{\MakeUppercase{#2}}\isdot}%\MakeCapital + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}% + \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}% +} + +%GB/T 7714-2015 风格,大小写不变,根据bib文件内输入原样输出 +\newbibmacro*{name:gblowercase}[4]{\bibauthorfont% + \renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 + \renewcommand*{\revsdnamepunct}{}%%来源biblatex.def + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifdefvoid{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifprefchar{}{\bibnamedelimc}}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{{#1}}}\isdot% + \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{{#2}}\isdot}%\MakeCapital + \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}} + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{{#1}}}\isdot% + \ifboolexpe{% + test {\ifdefvoid{#2}} + and + test {\ifdefvoid{#3}}} + {}{\revsdnamepunct}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{{#2}}\isdot}%\MakeCapital + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot} + \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}% +} + +%中文常见风格,汉语拼音全拼模式 +\newbibmacro*{name:gbpinyin}[4]{\bibauthorfont% +\renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉,%来源biblatex2.STY +\renewcommand*{\revsdnamepunct}{}%%来源biblatex.def +\renewrobustcmd*{\bibnamedelima}{\mbox{-}}% + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifdefvoid{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifprefchar{}{\bibnamedelimc}}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\MakeSentenceCase{\mkbibnamegiven{#2}}\isdot}%\MakeCapital + \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}} + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifboolexpe{% + test {\ifdefvoid{#2}} + and + test {\ifdefvoid{#3}}} + {} + {\revsdnamepunct}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{\MakeCapital{#2}}\isdot}%\MakeCapital + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot} + \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}% +} + + +\@ifpackagelater{biblatex}{2016/03/27}%biblatex<3.2版的情况 + {}{ + %GB/T 7714-2015 风格,全部大写 + \renewbibmacro*{name:gbuppercase}[4]{\bibauthorfont% + \renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 + \renewcommand*{\revsdnamepunct}{}%%来源biblatex.def + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifblank{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifpunctmark{'}{}{\bibnamedelimc}}% + %\mkbibnamelast{#1}\isdot + \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{\MakeUppercase{#1}}}\isdot%\MakeUppercase %\mkbibnamelast{\MakeUppercase{#1}} %\MakeSentenceCase + %注意上一句\MakeCapital后面如果再跟一个{}包含#1,则没有效果,可能是包在里面少了一层展开 + %因为机构名通常包括在{}内,所以要多展开一次才行,所以这里去掉#1外面的{} + %\mkbibnamelast{\MakeUppercase{#1}}\isdot + %\ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%这句放到后面 + \ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamefirst{\MakeUppercase{#2}}\isdot}% + \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}} + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + %\mkbibnamelast{#1}\isdot %3.9.1 Generic Commands and Hooks,对姓重新处理,如下句: %\mkbibnamelast{\MakeUppercase{#1}} + \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{\MakeUppercase{#1}}}\isdot %大写,参考4.6.4 Miscellaneous Commands,\MakeUppercase %\MakeSentenceCase + %\mkbibnamelast{\MakeUppercase{#1}}\isdot + %\ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%这句放到后面 + \ifblank{#2#3}{}{\revsdnamepunct}% + \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{\MakeUppercase{#2}}\isdot}% + \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}% + \addcomma\addspace% + \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}% + }% + } + + %GB/T 7714-2015 风格,大小写不变,根据bib文件内输入原样输出 + \renewbibmacro*{name:gblowercase}[4]{\bibauthorfont% + \renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 + \renewcommand*{\revsdnamepunct}{}%%来源biblatex.def + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifblank{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifpunctmark{'}{}{\bibnamedelimc}}% + \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{{#1}}}\isdot%\MakeUppercase %\mkbibnamelast{\MakeUppercase{#1}} %\MakeSentenceCase + \ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamefirst{{#2}}\isdot}% + \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}} + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{{#1}}}\isdot %大写,参考4.6.4 Miscellaneous Commands,\MakeUppercase %\MakeSentenceCase + \ifblank{#2#3}{}{\revsdnamepunct}% + \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{{#2}}\isdot}% + \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}% + \addcomma\addspace% + \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}% + }% + } + + %中文常见风格,汉语拼音全拼模式 + \renewbibmacro*{name:gbpinyin}[4]{\bibauthorfont% + \renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 + \renewcommand*{\revsdnamepunct}{}%%来源biblatex.def + \renewrobustcmd*{\bibnamedelima}{\mbox{-}}% + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifblank{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifpunctmark{'}{}{\bibnamedelimc}}% + \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{\MakeUppercase{#1}}}\isdot%\MakeUppercase %\mkbibnamelast{\MakeUppercase{#1}} %\MakeSentenceCase + \ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\MakeSentenceCase{\mkbibnamefirst{#2}}\isdot}% + \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}} + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{\MakeUppercase{#1}}}\isdot %大写,参考4.6.4 Miscellaneous Commands,\MakeUppercase %\MakeSentenceCase + \ifblank{#2#3}{}{\revsdnamepunct}% + \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{\MakeUppercase{#2}}\isdot}% + \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}% + \addcomma\addspace% + \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}% + }% + } + + %%biblatex<3.2版的情况,姓名的处理格式带参数 + \DeclareNameFormat{namefmtselected}{% + \iffieldundef{namefmtid}{}% + {\defcounter{gbnamefmtcase}{\thefield{namefmtid}}}% + \ifcase\value{gbnamefmtcase}% + \iffirstinits + {\usebibmacro{name:gbuppercase}{#1}{#4}{#5}{#7}} + {\usebibmacro{name:gbuppercase}{#1}{#3}{#5}{#7}}% + \or + \iffirstinits + {\usebibmacro{name:gblowercase}{#1}{#4}{#5}{#7}} + {\usebibmacro{name:gblowercase}{#1}{#3}{#5}{#7}}% + \or + \iffirstinits + {\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}} + {\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}}% + \ifblank{#3#5} + {} + {\usebibmacro{name:revsdelim}}% + \or + \iffirstinits + {\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}} + {\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}% + \or + \usebibmacro{name:gbpinyin}{#1}{#3}{#5}{#7}% + \or + \ifnumequal{\value{listcount}}{1} + {\iffirstinits + {\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}} + {\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}}% + \ifblank{#3#5} + {} + {\usebibmacro{name:revsdelim}}} + {\iffirstinits + {\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}} + {\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}% + \fi + \usebibmacro{name:andothers}} +} + +% +% url和url日期格式 +% +\renewbibmacro*{url+urldate}{% + %\usebibmacro{url}%%更换url的位置,放到下面 + \iffieldundef{urlyear}% + {}{%\setunit*{\addspace}% + \usebibmacro{urldate}}% + \setunit{\addperiod\addspace}% + \usebibmacro{url}} +\renewbibmacro*{url}{\printfield{url}} + +% +% 日期信息的输出格式,针对biblatex<3.7版本 +% +\defversion{3.4}{date}{ + \renewbibmacro*{urldate}{% + \addthinspace\printtext{[}\printfield{urlyear}% + \iffieldundef{urlmonth}{}{\bibrangedash\printfield{urlmonth}}% + \iffieldundef{urlday}{}{\bibrangedash\printfield{urlday}}\printtext{]}} + + \newbibmacro*{newsdate}{%%新增加一个公告日期,公开日期或新闻日期 + \iffieldundef{year}{}{\printfield{year}% + \iffieldundef{month}{}{\bibrangedash\printtext{\thefield{month}}% + \iffieldundef{day}{}{\bibrangedash\printfield{day}}}}% + } + + \newbibmacro*{modifydate}{%新增加一个带括号的日期,用于表示电子资源的更新和修改日期,而公告日期则按日期格式 + \ifboolexpr{% + test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% + }% + {}%更新或修改日期通常有day信息 + {\iffieldequalstr{year}{}{%替换\iffieldundef{year},因为year总是存在,但为空 + \iffieldundef{endyear}{% + \iffieldundef{eventyear}{}{\printtext{\mkbibparens{\printtext{\printfield{eventyear}}% + \iffieldundef{eventmonth}{}{\bibrangedash\thefield{eventmonth}}% + \iffieldundef{eventday}{}{\bibrangedash\printfield{eventday}}}}% + }% + }{% + \iffieldundef{endyear}{}{\printtext{\mkbibparens{\printtext{\printfield{endyear}}% + \iffieldundef{endmonth}{}{\bibrangedash\thefield{endmonth}}% + \iffieldundef{endday}{}{\bibrangedash\printfield{endday}}}}% + }% + }% + }% + {% + \iffieldundef{year}{}{\printtext{\mkbibparens{\printtext{\printfield{year}}% + \iffieldundef{month}{}{\bibrangedash\thefield{month}}% + \iffieldundef{day}{}{\bibrangedash\printfield{day}}}}% + }% + }% + }}% +} + +% +% 日期信息的输出格式,针对3.9>=biblatex>=3.7版本 +% +\defversion{3.7}{date}{ + \DeclareFieldFormat{urldate}{##1} + \renewbibmacro*{urldate}{% + \addthinspace\printtext{[}\printurldate\printtext{]}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令 + + % + % 专利的公告日期、或报纸的日期的输出宏 + % 20160701,v1.0,新增加 + % 20180405,v1.0k,为biblatexv3.7-3.9版本,出现多出点bug做处理,Hu Zhenzhen + % + % 原理方法:加上printtext避免破坏异步标点机制 + % + \newbibmacro*{newsdate}{% + \printtext{\blx@edtfdate{}{}}% + } + + \newbibmacro*{modifydate}{%新增加一个带括号的日期,用于表示电子资源的更新和修改日期,而公告日期则按日期格式 + \ifboolexpr{% + test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% + }% + {}%更新或修改日期通常有day信息 + {\iffieldundef{year}{% + \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{(}\printeventdate\printtext{)}}}% + {\printtext{(}\printenddate\printtext{)}}% + }{\iffieldequalstr{year}{}{%因为year存在,但为空 + }{\printtext{(}\blx@edtfdate{}{}\printtext{)}}% + }% + }}% +} + +% +% 日期信息的输出格式,针对biblatex>=3.10版本 +% +\defversion{3.10}{date}{ + \DeclareFieldFormat{urldate}{##1} + \renewbibmacro*{urldate}{% + \addthinspace\printtext{[}\printurldate\printtext{]}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令 + + % + % 专利的公告日期、或报纸的日期的输出宏 + % 20160701,v1.0,新增加 + % 20180405,为biblatexv3.10版本,出现多出点bug做处理,Hu Zhenzhen + % + % 原理方法:加上printtext避免破坏异步标点机制 + % 本可以用\printdate,但由于date选项设置为year,所以仅会给出年份 + % 所以无法再用选项设置的方法,印象需要用底层的命令 + % 这里可以用\blx@isodate,但用\blx@gbdate试图避免版本判断 + \newbibmacro*{newsdate}{%% + \printtext{\blx@gbdate{}{}}%%\blx@isodate{}{}% + } + + \newbibmacro*{modifydate}{%新增加一个带括号的日期,用于表示电子资源的更新和修改日期,而公告日期则按日期格式 + \ifboolexpr{% + test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% + }% + {}%更新或修改日期通常有day信息 + {\iffieldundef{year}{% + \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{(}\printeventdate\printtext{)}}}% + {\printtext{(}\printenddate\printtext{)}}% + }{\iffieldequalstr{year}{}{%因为year存在,但为空 + }{\printtext{(}\blx@gbdate{}{}\printtext{)}}% + }% + }}% +} + +% +% 关联文献的输出格式,针对3.9>=biblatex>=3.7版本 +% +% 原理方法:因为related宏中带有##了,所以无法封装到defversion中了。所以直接做判断 +% 下面这一段主要针对v3.8-3.10,因为我提问后,biblatex作者为3.11版增加了一个钩子控制relatedblock前的分隔符。 +\ifboolexpr{ +test{\iftoggle{iftleight}} +or +test{\iftoggle{iftlnine}} +}{\renewbibmacro*{related}{%standard.bbx + \ifboolexpr{ test {\iffieldundef{related}} or test {\ifrelatedloop} } + {} + {\usebibmacro{begrelated}% + \def\bbx@tempa{}% + \setcounter{bbx:relatedtotal}{0}% + \def\do##1{% + \entrydata{##1}{% + \ifrelatedloop + {} + {\stepcounter{bbx:relatedtotal}% + \gappto{\bbx@tempa}{##1,}}}}% + \docsvfield{related}% + \restorefield{related}{\bbx@tempa}% + \ifnumgreater{\value{bbx:relatedtotal}}{0} + {\listcsxadd{bbx:relatedloop}{\strfield{entrykey}}% + \iffieldundef{clonesourcekey} + {} + {\listcsxadd{bbx:relatedloop}{\strfield{clonesourcekey}}}% + \setcounter{bbx:relatedcount}{0}% + \def\do{% + \stepcounter{bbx:relatedcount}% + \ifnumgreater{\value{bbx:relatedcount}}{0}%这里从1改为0 + {\ifcsundef{relateddelim\strfield{relatedtype}} + {\printtext{\relateddelim}} + {\printtext{\csuse{relateddelim\strfield{relatedtype}}}}} + {}}% + \ifbibmacroundef{related:\strfield{relatedtype}} + {\appto{\do}{\usebibmacro{related:default}}} + {\appto{\do}{\usebibmacro*{related:\strfield{relatedtype}}}}% + \iffieldformatundef{related:\strfield{relatedtype}} + {\def\bbx@tempa{related}} + {\def\bbx@tempa{related:\strfield{relatedtype}}}% + \iffieldformatundef{relatedstring:\strfield{relatedtype}} + {\def\bbx@tempb{relatedstring:default}} + {\def\bbx@tempb{relatedstring:\strfield{relatedtype}}}% + \printtext[\bbx@tempa]{% + \usebibmacro{begrelatedloop}% + \iffieldundef{relatedstring} + {\ifboolexpr{ + test {\ifnumgreater{\value{bbx:relatedtotal}}{1}} + and + test {\ifbibxstring{\thefield{relatedtype}s}} + } + {\printtext[\bbx@tempb]{% + \bibstring[\mkrelatedstring]{\thefield{relatedtype}s}}} + {\iffieldbibstring{relatedtype} + {\printtext[\bbx@tempb]{% + \bibstring[\mkrelatedstring]{\thefield{relatedtype}}}} + {}}} + {\iffieldbibstring{relatedstring} + {\printtext[\bbx@tempb]{% + \bibstring[\mkrelatedstring]{\thefield{relatedstring}}}} + {\printfield[\bbx@tempb]{relatedstring}}}% + \docsvfield{related}% + \usebibmacro{endrelatedloop}}}% + {}% + \usebibmacro{endrelated}}} +}{} + +% +% 关联文献块前的分隔符,针对biblatex3.11 +% +% 原理方法:因为增加了begrelateddelim钩子,所以不需要重定义related输出宏 +\defversion{3.11}{related}{ +\renewcommand{\begrelateddelim}{\adddot\newline\nobreak} +} + +\iftoggle{iftlfive}{\switchversion{3.4}{date}}{}%biblatex<=3.2 +\iftoggle{iftlsix}{\switchversion{3.4}{date}}{}%3.3<=biblatex<=3.6 +\iftoggle{iftlseven}{\switchversion{3.7}{date}}{}%biblatex=3.7 +\iftoggle{iftleight}{\switchversion{3.7}{date}}{}%3.8<=biblatex<=3.9 +\iftoggle{iftlnine}{\switchversion{3.10}{date}}{}%biblatex3.10 +\iftoggle{iftlatest}{\switchversion{3.10}{date}\switchversion{3.11}{related}}{}%biblatex最新 + +% +% 调整doi+eprint+url格式 +% +% 原理方法:源来自standard.bbx,因为页码后面直接跟引用日期,没有标点所以去掉其中的标点。 +\renewbibmacro*{doi+eprint+url}{% +% \iftoggle{bbx:doi}%把doi的位置放到url后面 +% {\printfield{doi}} +% {}% + %\newunit\newblock + \iftoggle{bbx:eprint} + {\iffieldundef{eprint}{}{\newunit\usebibmacro{eprint}}}%必须要做域判断否则容易产生多余的标点 + {}% + %\newunit\newblock + \iftoggle{bbx:url} + {\usebibmacro{url+urldate}} + {} + \newunit\newblock + \iftoggle{bbx:doi} + {\printfield{doi}} + {}} + +% +% 调整页码的格式,即chapter+pages格式 +% +\renewbibmacro*{chapter+pages}{% +\iftoggle{bbx:gbstrict}{}{% + \printfield{chapter}}% + \iffieldundef{pages}{}{%这里增加一个判断,当没有页码时就不输出 + \setunit{\bibpagespunct}% + \printfield{pages}}% + %\newunit %这里的标点去掉 + } + +% +% 当location等出版项超过maxitem缩减后不再输出etal +% +\DeclareListFormat{location}{% + \usebibmacro{list:delim}{#1}% + #1\isdot} +\DeclareListAlias{institution}{location} +\DeclareListAlias{publisher}{location} + +% 新增一个样式用于输出连续出版物的地址,单位,时间, +% 用于periodical连续出版物的出版社和地址的处理 +% +% v1.0k,20180425,为出版信息增加字体控制命令,hzz +% %类似\newbibmacro*{publisher+location+date} +\newbibmacro*{location+institution+date}{\bibpubfont% +\iftoggle{bbx:gbpub}% +{\testCJKfirst{userd}% +\ifboolexpr{% +test {\iflistundef{location}} and test {\iflistundef{institution}}% +}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}% +{\printtext{[S.l.\space :\space s.n.\adddot]}}% +}{% +\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}}{\printtext{[S.l.\adddot]}}}% + {\printlist{location}}% +\addcolon\addspace% +\iflistundef{institution}{% +\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}}{\printtext{\mkbibbrackets{s.n.}}}}% \bibstring{nopublisher}%[s.n.\adddot] +{\printlist{institution}}}% +\setunit{\addcomma\addspace}% + %\usebibmacro{date}% + \printfield{year}% + \bibrangedash% + \iffieldundef{endyear}{}{\printfield{endyear}}% + \newunit}% +{ \printlist{location}% + \iflistundef{institution}% + {\setunit*{\addcomma\space}} + {\setunit*{\addcolon\space}}% + \printlist{institution}% + \setunit*{\addcomma\space}% + \usebibmacro{date}% + \newunit}% +} +% +% 通用的出版社和地址的处理 +% +% 原理方法:当没有出版社地址时,直接判断title的信息是否是中文,若为中文,则写出版地不详,否则用英文的字符表示。 +% 事实上title对于每个文献来说是必须的,所以用它判断是最快的,而且一般标题和出版社的语言是一样的。 +% 注意标准standard类型,因为当没有出版项时直接省略,所以做特殊处理 +\renewbibmacro*{publisher+location+date}{\bibpubfont% +\iftoggle{bbx:gbpub}% +{\testCJKfirst{userd}% + \ifboolexpr{ test {\iflistundef{location}} and test {\iflistundef{publisher}} }% + {\iffieldequalstr{note}{standard}{}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}{\printtext{[S.l.\space :\space s.n.\adddot]}}}}% + {\iflistundef{location}{%\adddot + \iffieldequalstr{note}{standard}{}%%从gbt7714-2015标准第19页看到,标准存在出版项时输出,没有时完全省略。 + {\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}\addcolon\addspace}{\printtext{[S.l.\adddot]}\addcolon\addspace}}}% \bibstring{noaddress} + {\printlist{location}\addcolon\addspace}%%\addcolon\addspace% + \iflistundef{publisher}{% + \iffieldequalstr{note}{standard}{}% + {\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}% + {\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}}}% + {\printlist{publisher}}}% +\setunit*{\addcomma\addspace}%\addcomma\addspace% +\usebibmacro{date}%%\newunit %去掉这个标点 +}% +{\printlist{location}% + \iflistundef{publisher} + {\setunit*{\addcomma\space}} + {\setunit*{\addcolon\space}}% + \printlist{publisher}% + \setunit*{\addcomma\space}% + \usebibmacro{date}%%\newunit + }% +} + +% +% 修改了一个institution+location+date用于manual、report、thesis等类型 +% +% 20180425,v1.0k,增加了字体控制命令,hzz +% 20190105,v1.0o,加了一个编组避免\usebibmacro{date}把month和day信息去掉 +\renewbibmacro*{institution+location+date}{\bibpubfont%当没有institution时不处理。 +{\printlist{location}%%加了一个编组避免\usebibmacro{date}把month和day信息去掉 + \iflistundef{institution} + {\setunit*{\addcomma\space}} + {\setunit*{\addcolon\space}}% + \printlist{institution}% + \setunit*{\addcomma\space}% + \usebibmacro{date}% + %\newunit + }} + +% +% 对volume卷信息格式做出修改 +% v1.0o,20190105,hzz +% +\DeclareFieldFormat{volume}{% +\testCJKfirst{userd}% +\iftoggle{ifCJKforgbt}% +{\bibstring{serialcn}#1\bibstring{volumecn}}% +{\bibstring{volume}~#1}% +}% volume of a book +\DeclareFieldFormat[article,periodical]{volume}{#1}% volume of a journal + +% +% 对number册信息格式做出修改 +% v1.0o,20190105,hzz +% +\DeclareFieldFormat{number}{#1}% +\DeclareFieldFormat[book,collection,inbook,% +incollection,proceedings,inproceedings]{number}{% +\testCJKfirst{userd}% +\iftoggle{ifCJKforgbt}% +{\bibstring{serialcn}#1\bibstring{numbercn}}% +{#1}% +}% + +% +% 对edition版本信息格式做出修改 +% +\DeclareFieldFormat{edition}{%源来自biblatex.DEF +\testCJKfirst{userd}% +\iftoggle{ifCJKforgbt}% +{\ifinteger{#1}% +{\printtext{#1\str@edition}}% +{#1\isdot}}% +{\ifinteger{#1}% +{\mkbibordedition{#1}~\bibstring{edition}}% +{#1\isdot}}} + +% +% 对version的版本信息做出修改 +% +\DeclareFieldFormat{version}{%源来自biblatex.DEF +\testCJKfirst{userd}% + \ifinteger{#1}% + {\iftoggle{ifCJKforgbt}{\printtext{#1\str@edition}}% + {\mkbibordedition{#1}~\bibstring{version}}}% + {#1\isdot}} + +% +% 作者域的输出控制宏 +% +% 当两篇文献作者相同且连续时,标准样式是用-代替后面的文献的作者,这里取消这一设置 +\renewbibmacro*{author}{%author for biblatex version <=3.7 + \ifboolexpr{ + test \ifuseauthor + and + not test {\ifnameundef{author}} + } + {\usebibmacro{bbx:dashcheck} + {%\bibnamedash + \printnames{author}% + }% + {\usebibmacro{bbx:savehash}% + \printnames{author}% + \iffieldundef{authortype} + {\setunit{\addspace}} + {\setunit{\addcomma\space}}}% + \iffieldundef{authortype} + {} + {\usebibmacro{authorstrg}% + \setunit{\addspace}}}% + {\global\undef\bbx@lasthash + \usebibmacro{labeltitle}% + \setunit*{\addspace}}% + \setunit{\addcomma\space}%增加一个逗号 + \usebibmacro{date+extrayear} + } + +% +% 设置标注和文献表中作者和年份之间的分隔符 +% +% 原理方法:注意3.4版已经有\nameyeardelim,上述修改的author宏虽然定义了著录表中的标点,但标注中的未定义 +% 设置因为mergedate默认为true时的情况,来自\bbx@opt@mergedate@compact +% 去掉作者后面包围年份的圆括号 +% 这里因为biblatex版本的不同,做不同的处理,texlive2017版/2016等低版本分开处理 +\defversion{3.0}{dateextra}{ +\renewcommand*{\nameyeardelim}{\addcomma\space} + \renewbibmacro*{date+extrayear}{%%重设date+extrayear格式,源来自authoryear.BBX + \iffieldundef{\thefield{datelabelsource}year} + {} + {\printtext{%[parens]%这里把括号去掉 + \iffieldsequal{year}{\thefield{datelabelsource}year} + {\printdateextralabel}% + {\printfield{labelyear}% + \printfield{extrayear}}}}}% + \newbibmacro{date+extradate}{\usebibmacro{date+extrayear}} +} + +\defversion{3.4}{dateextra}{ + \DeclareDelimFormat{nameyeardelim}{\addcomma\space} + \DeclareDelimFormat[bib,biblist]{nameyeardelim}{\addcomma\space} + \renewbibmacro*{date+extrayear}{%%重设date+extrayear格式,源来自authoryear.BBX + \iffieldundef{\thefield{datelabelsource}year} + {} + {\printtext{%[parens]%这里把括号去掉 + \iffieldsequal{year}{\thefield{datelabelsource}year} + {\printdateextralabel}% + {\printfield{labelyear}% + \printfield{extrayear}}}}}% + \newbibmacro{date+extradate}{\usebibmacro{date+extrayear}} +} +\defversion{3.7}{dateextra}{ + \DeclareDelimFormat{nameyeardelim}{\addcomma\space} + \DeclareDelimFormat[bib,biblist]{nameyeardelim}{\addcomma\space} + \renewbibmacro*{date+extrayear}{%以前的\printdateextralabel宏变为了\printlabeldateextra + \iffieldundef{labelyear} + {} + {\printtext{%[parens] + \iffieldsequal{year}{labelyear} + {\printlabeldateextra}% + {\printfield{labelyear}% + \printfield{extrayear}}}}}% + +\newbibmacro{date+extradate}{\usebibmacro{date+extrayear}} +} +\defversion{3.8}{dateextra}{ + \DeclareDelimFormat{nameyeardelim}{\addcomma\space} + \DeclareDelimFormat[bib,biblist]{nameyeardelim}{\addcomma\space} +%注意这里当没有作者只有标题时在年份之前的标点是否需要标准并未涉及,所以未做处理。 +\renewbibmacro*{author}{%以前的date+extrayear变为date+extradate,所以对3.8以上版本重定义一下author + \ifboolexpr{ + test \ifuseauthor + and + not test {\ifnameundef{author}} + } + {\usebibmacro{bbx:dashcheck} + {%\bibnamedash %去掉相同作者用横线代替的处理 + \printnames{author}\setunit{\printdelim{nameyeardelim}}%把标点也带上 + } + {\usebibmacro{bbx:savehash}% + \printnames{author}% + \iffieldundef{authortype} + {\setunit{\printdelim{nameyeardelim}}} + {\setunit{\printdelim{authortypedelim}}}}% + \iffieldundef{authortype} + {} + {\usebibmacro{authorstrg}% + \setunit{\printdelim{nameyeardelim}}}}% + {\global\undef\bbx@lasthash + \usebibmacro{labeltitle}% + \setunit*{\printdelim{nonameyeardelim}}}% + \usebibmacro{date+extradate}} + \renewbibmacro*{date+extradate}{% + \iffieldundef{labelyear} + {} + {\printtext{%[parens]%这里去掉括号 + \iflabeldateisdate + {\printdateextra} + {\printlabeldateextra}}}}% + +} + + +% +%为mergedate增加选项none,即实现年份不提前到作者后面的标签中 +%也不打印用于区分同作者同年份文献的标识符如(a,b,c) +%目的是实现一些特殊的文献表样式比如ucas的作者年制 +%v1.0q,20190212,hzz +\def\bbx@opt@mergedate@none{% + \renewbibmacro*{date+extradate}{% + \iffieldundef{labelyear} + {} + {}}%[parens]\printtext{\printlabeldateextra} +\renewbibmacro*{bbx:ifmergeddate}{\@secondoftwo}%这一句用于3.12版本 +\renewbibmacro*{date}{\printdate}%这一句用于biblatex3.11以下版本 +\renewbibmacro*{issue+date}{%去掉括号 +\setunit{\addcomma\addspace}% + \printtext{%去掉了[parens] + \iffieldundef{issue} + {%\usebibmacro{date} + \iffieldundef{note}{\usebibmacro{date}}%判断一下,是否是报纸 + {\iffieldequalstr{note}{news}{\usebibmacro{newsdate}}%判断是否为报纸 + {\usebibmacro{date}}% + }}% + {\iftoggle{bbx:gbstrict}{}{\printfield{issue}% + \setunit*{\addspace}}% + %\usebibmacro{date} + \iffieldundef{note}{\usebibmacro{date}}%判断一下,是否是报纸 + {\iffieldequalstr{note}{news}{\usebibmacro{newsdate}}%判断是否为报纸 + {\usebibmacro{date}}% + }}}% + %\newunit + }% + } + +\iftoggle{iftlfive}{\switchversion{3.0}{dateextra}}{}%biblatex<=3.2 +\iftoggle{iftlsix}{\switchversion{3.4}{dateextra}}{}%3.3<=biblatex<=3.6 +\iftoggle{iftlseven}{\switchversion{3.7}{dateextra}}{}%biblatex=3.7 +\iftoggle{iftleight}{\switchversion{3.8}{dateextra}}{}%<=3.8biblatex<=3.9 +\iftoggle{iftlnine}{\switchversion{3.8}{dateextra}}{}%biblatex3.10 +\iftoggle{iftlatest}{\switchversion{3.8}{dateextra}}{}%biblatex最新3.11 + +% +% 修改析出文献的文集的标题与附加标题间的符号 +% +\renewbibmacro*{booktitle}{% + \ifboolexpr{ + test {\iffieldundef{booktitle}} + and + test {\iffieldundef{booksubtitle}} + } + {} + {\printtext[booktitle]{\bibtitlefont% + \printfield[titlecase]{booktitle}% + \setunit{\subtitlepunct}% + \printfield[titlecase]{booksubtitle}}% + \newunit%标点换成下一句 + \setunit{\subtitlepunct}}% + \printfield{booktitleaddon}} + +% +% 调整期刊名的格式 +% +% 原理方法:因为作者年制年份提到前面,因此涉及到期刊名与后面的卷期的关系。 +% v1.0k,20180425,增加了字体控制命令,hzz +\renewbibmacro*{journal+issuetitle}{\bibpubfont%源来自standard.bbx + \usebibmacro{journal}% + %\setunit*{\addspace}% + %\setunit*{\addcomma\addspace}%修改为增加一个逗号 + \iffieldundef{series}% + {}% + {\newunit% + \printfield{series}% + \setunit{\addspace}}% + %\usebibmacro{volume+number+eid}% + %\setunit{\addspace}% + \usebibmacro{issue+date}% + %\setunit{\addcolon\space}% + \iffieldundef{volume}{}{\setunit{\addcomma\space}}% + %换成逗号和空格 + \usebibmacro{issue}% + \usebibmacro{volume+number+eid}%把卷期放到年份后面 + %\newunit + } + +% +% 增加一个number带括号的格式,避免使用mkbibparens而引入一个不必要的空格 +% +\DeclareFieldFormat{addnumflag}{% +\nobreak\printtext{(}\nobreak #1\nobreak\printtext{)}} + +% +% 调整journal输出 +% +% 原理方法:首先判断子标题,然后再设置标点。 +% 避免直接设置标点后,当volume不存在时需要使用\nopuct去标点进而引入不必要的空格 +\renewbibmacro*{journal}{% + \iffieldundef{journaltitle}% + {}% + {\printtext[journaltitle]{% + \printfield[titlecase]{journaltitle}% + \iffieldundef{journalsubtitle}{}{\setunit{\subtitlepunct}% + \printfield[titlecase]{journalsubtitle}}}}} + + + +% +% 调整期刊卷和期的格式 +% +\renewbibmacro*{volume+number+eid}{%源来自standard.bbx +\iftoggle{bbx:gbfieldstd}{% + \printfield{volume}% + \setunit*{\adddot}% + \printfield{number}% + \setunit{\addcomma\space}% + \printfield{eid}}{% + \printfield{volume}% + %\setunit*{\adddot}%去掉点号 + %\printfield{number}% + \iffieldundef{number}{}{\printfield[addnumflag]{number}}%区别于顺序编码制 + \iffieldundef{eid}{}{% + \setunit{\addcomma\space}% + \printfield{eid}}}} + +% +% 调整期刊年份的格式 +% +% 原理方法:原在authoryear.BBX中\bbx@opt@mergedate@compact中定义 +% 当issue存在时,才设置newunit。避免直接设置标点后,当volume不存在是需要使用\nopuct去标点进而引入不必要的空格 + \renewbibmacro*{issue+date}{% + \iffieldundef{issue}% + {}% + {\iftoggle{bbx:gbstrict}{}{\printtext[parens]{\printfield{issue}}\newunit}}} + + + +% +% 调整页码前的标点和去掉期刊文章等页码后面的标点 +% +\renewbibmacro*{note+pages}{%源来自standard.bbx + %\printfield{note}%不要note,note用来判断是否是报纸newspaper + \iffieldundef{pages}{}{ + \setunit{\bibpagespunct}% + \printfield{pages}}% + %\newunit + } + +% +% 编者的符号修改一下 +% v1.0 2016-07-01 +% v1.0q 2019-03-01 hzz 修改editortype前的标点 +% +\renewbibmacro*{editor}{% + \ifboolexpr{ + test \ifuseeditor + and + not test {\ifnameundef{editor}} + } + {\usebibmacro{bbx:dashcheck} + {%\bibnamedash + \printnames{editor}% + } + {\printnames{editor}% + %\setunit{\printdelim{editortypedelim}}% + %\usebibmacro{bbx:savehash} + }% + \usebibmacro{editorstrg}% + %\clearname{editor}% + \setunit{\printdelim{nameyeardelim}}}% + {\global\undef\bbx@lasthash + \usebibmacro{labeltitle}% + \setunit*{\printdelim{nonameyeardelim}}}% + \ifboolexpr{% +test {\ifentrytype{inbook}} +or +test {\ifentrytype{incollection}} +or +test {\ifentrytype{inproceedings}} +or +test {\ifentrytype{conference}} +}% +{}% +{\usebibmacro{date+extradate}}} + +% +% 编者类型做一修改 +% v1.0 2016-07-01 +% v1.0q 2019-03-01 hzz 修改editortype不同语言的不同本地化字符串 +% +\renewbibmacro*{editorstrg}{%源来自biblatex.DEF + \printtext[editortype]{% + \iffieldundef{editortype} + {% +% \ifboolexpr{ %这一段去掉,未定义编者类型情况下不处理 +% test {\ifnumgreater{\value{editor}}{1}} +% or +% test {\ifandothers{editor}} +% } +% {\bibstring{editors}} +% {\bibstring{editor}} + } + {\ifbibxstring{\thefield{editortype}} %定义编者类型情况下处理,以后根据需要修改 + {\ifboolexpr{ + test {\ifnumgreater{\value{editor}}{1}} + or + test {\ifandothers{editor}} + } + {\printdelim{streditortypes}} + {\printdelim{streditortype}}} + {\thefield{editortype}}}% + }} + +% +% 编者类型的本地化字符串输出 +% v1.0q 2019-03-01 hzz +% 能对不同条目类型作格式设置的域格式,能对不同环境做格式设置的分隔符 +% 能对不同文境作设置的包括排序,标签等 +% 这里因为考虑可能标注和文献表中存在不同,所以用分隔符来输出本地化字符串 +% +\DeclareDelimFormat{streditortypes}{% + \edef\userfieldabcde{userd}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{\thefield{editortype}scn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{\thefield{editortype}skr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{\thefield{editortype}sjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}% + \or% + \bibstring{\thefield{editortype}scn}% + \or% + \addcomma\addthinspace\bibstring{\thefield{editortype}s}% + \fi} +% +\DeclareDelimFormat{streditortype}{% + \edef\userfieldabcde{userd}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{\thefield{editortype}cn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{\thefield{editortype}kr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{\thefield{editortype}jp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}% + \or% + \bibstring{\thefield{editortype}cn}% + \or% + \addcomma\addthinspace\bibstring{\thefield{editortype}}% + \fi} + + +% +% bookauthor域的输出, +% v1.0q 2019-03-01 hzz +% 不再对editor和bookauthor做sourcemap,而是下面的宏内逻辑代替, +% 使得除使用bookauthor外也可以使用editor,便于在使用editor时使用editortype +\renewbibmacro*{bybookauthor}{% + \ifnameundef{bookauthor}% + {\ifnameundef{editor}% + {}% + {\ifnamesequal{author}{editor}% + {}{\usebibmacro{editor}}}% + }% + {\ifnamesequal{author}{bookauthor}% + {}{\printnames{bookauthor}}% + }% +} + +% +% 修改期刊的标题 +% +\renewbibmacro*{periodical}{%源来自biblatex.DEF + \iffieldundef{title} + {} + {\printtext[title]{\bibtitlefont% + \printfield[titlecase]{title}% + %\setunit{\subtitlepunct}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct} + \printfield[titlecase]{subtitle}}% + %}%把编组结束移到后面去 + \iftoggle{bbx:gbtype}{% + \iffieldundef{usera}{}{%在标题后直接给出文献标识字母 + \printfield[gbtypeflag]{usera}}}{} + }} + } + +% +% 期刊的标题做修改 +% +\renewbibmacro*{title+issuetitle}{%源来自standard.BBX + \usebibmacro{periodical}% + %\setunit*{\addspace}% + \setunit*{\adddot\addspace}%标点修改为句点 + \iffieldundef{series} + {} + {\newunit + \printfield{series}% + \setunit{\addspace}}% + \usebibmacro{periodical+issue}%将issue调整到上面来,并修改 +\iffieldundef{number}{}{%%进一步处理有范围的数字 + \multinumberparser{\thefield{number}}}% + \iffieldundef{volume}% + {\printfield{year}% + \printtext{\mkbibparens{\multinumberfirst}}% + \bibrangedash% + \iffieldundef{endyear}{}{\printfield{endyear}\printtext{\mkbibparens{\multinumbersecond}}}% + }% + {\multivolparser{\thefield{volume}}% + \printfield{year}% + \setunit{\addcomma\space}%将冒号修改为逗号 + \printtext{\multivolfirst}% + \printtext{\mkbibparens{\multinumberfirst}}% + \bibrangedash% + \iffieldundef{endyear}{}{% + \printfield{endyear}% + \setunit{\addcomma\space}%将冒号修改为逗号 + \printtext{\multivolsecond}% + \printtext{\mkbibparens{\multinumbersecond}}}% + }% + \setunit{\addcomma\space}% + \printfield{eid}% + \setunit{\addspace}% + %\usebibmacro{issue+date}% + %\setunit{\addcolon\space}% + \usebibmacro{issue}% + \newunit} + +% +% 新增一个样式用于调整期刊年份的格式,只打印年份 +% +\newbibmacro*{periodical+issue}{% + \printtext{%去掉了[parens] + \iffieldundef{issue} + {%\usebibmacro{date}%修改为下一句 + }% + {\printfield{issue}% + \setunit*{\addspace}% + %\usebibmacro{date}%修改为下一句 + }% + }% + %\newunit +} + +% +% 重设专利title的输出,将文献类型标识符输出出去 +% +\newbibmacro*{patenttitle}{%原输出来自biblatex.def文件 + \ifboolexpr{% + test{\iffieldundef{title}}% + and% + test{\iffieldundef{subtitle}}% + }% + {}% + {\printtext[title]{\bibtitlefont% + \printfield[titlecase]{title}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct}% + \printfield[titlecase]{subtitle}}% + \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 + {\setunit{\subtitlepunct}\printfield{titleaddon}}% + \setunit{\subtitlepunct}\printfield{number}%写专利号 + \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}% + %\iffieldundef{booktitle}{\newunit}{}%当title是析出时,不要标点 + %\newunit + }% +}% +} + + + +% +% 修改in:用于inbook、incollection、inproceedings等类型 +% 2018.04.20,v1.0k,renewed marco,by hzz +% 20190212,v1.0q,增加中英文区分,by hzz +% +% 原理方法:使用bibmacro{in:}改变了以前在driver中直接输出//的方式,同时也简化了标点控制。 +\renewbibmacro*{in:}{% + \iftoggle{bbx:gbpunctin}{\printtext{\texttt{//}\allowbreak}}%\addthinspace + {\setunit{\adddot\addspace}% + \iffieldequalstr{userd}{chinese}% + {\printtext{\bibstring{incn}}}% + {\printtext{\bibstring{in}}}% + }}%\newunit\newblock\intitlepunct + +% +% 修改type域的输出格式 +% 2019.02.12,v1.0q,byhzz +% 使其可以区分中英文输出不同的格式,比如博士论文英文输出PHD thesis,中文则是博士学位论文 +\DeclareFieldFormat{type}% +{\iffieldequalstr{userd}{chinese}% + {\ifbibxstring{#1cn}{\bibxstring{#1cn}}{#1}}% + {\ifbibstring{#1}{\bibstring{#1}}{#1}}% +} + + +% +% 修改series域的输出格式 +% 2019.05.01,v1.0r,byhzz +\renewbibmacro*{series+number}{% + \printfield{series}% + %\setunit*{\addspace}% + %\printfield{number}% + %\newunit + } + +%===================================================================== +%设置驱动格式 +%===================================================================== +% +% book条目类的驱动 +% + \DeclareBibliographyDriver{book}{%源来自standard.bbx文件 + \usebibmacro{bibindex}% + \usebibmacro{begentry}% +\usebibmacro{author/editor+others/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\usebibmacro{maintitle+title}% +\iftoggle{bbx:gbstrict}{}{% +\newunit +\printlist{language}% +\newunit\newblock% +\usebibmacro{byauthor}% +\newunit\newblock}% +\usebibmacro{byeditor+others}% +\newunit +\printfield{edition}% +\newunit\newblock%% +\iftoggle{bbx:gbstrict}{}{% +\iffieldundef{maintitle}% +{\printfield{volume}% +\printfield{part}}% +{}% +\newunit% +\printfield{volumes}% +\newunit\newblock% +\usebibmacro{series+number}}% +\newunit\newblock% +%\printfield{note}% +%\newunit\newblock% +\usebibmacro{publisher+location+date}% +%\newunit\newblock %这里标点去掉 +\usebibmacro{chapter+pages}% + \iffieldundef{url}{}{%当没有网址时也不输出 + \usebibmacro{modifydate}}%带括号的修改或更新日期, +\usebibmacro{doi+eprint+url}%从下面移动到上面来,因为gbt2015的url需直接放在页码后面。 + \newunit\newblock% + \printfield{pagetotal}% + \newunit\newblock% + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock + %\usebibmacro{doi+eprint+url}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + + + +% +% 期刊文章,连续出版物中的析出文献的格式 +% + \DeclareBibliographyDriver{article}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{bytranslator+others}% + \newunit\newblock + \printfield{version}}% + \newunit\newblock + %\usebibmacro{in:}% 不使用in来表示期刊等连续出版物 + \usebibmacro{journal+issuetitle}% +% \newunit +% \usebibmacro{byeditor+others}% +% \newunit + \usebibmacro{note+pages}% + \iffieldequalstr{note}{news}{}{%当是新闻时不输出修改或更新日期 + \iffieldundef{url}{}{%当没有网址时也不输出 + \usebibmacro{modifydate}}}%带括号的修改或更新日期, + \usebibmacro{doi+eprint+url}%从后面移上来,调整url和页码之间的位置 + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{issn}} + {}% + \newunit\newblock + %\usebibmacro{doi+eprint+url}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + +% +% 连续出版物的驱动 +% + \DeclareBibliographyDriver{periodical}{%源来自standard.BBX + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{editor}% + %\setunit{\labelnamepunct}\newblock + \newunit\newblock %删除上面一行,添加这一行 + \usebibmacro{title+issuetitle}% + \newunit\newblock% + \usebibmacro{location+institution+date}%添加这一行用于输出地址,单位和时间 + \newunit\newblock%添加这一行 + \iftoggle{bbx:gbstrict}{}{% + \printlist{language}% + \newunit\newblock + \usebibmacro{byeditor}% + \newunit\newblock + \printfield{note}% + \newunit\newblock} + \iftoggle{bbx:isbn} + {\printfield{issn}} + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + +% +% 专利文献驱动 +% + \DeclareBibliographyDriver{patent}{%源来自standard.BBX + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + %\usebibmacro{title}% + \usebibmacro{patenttitle}%给出专利专用的标题输出 + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \printfield{type}% + \setunit*{\addspace}% + %\printfield{number}%已放到patenttitle中处理 + \iflistundef{location} + {} + {\setunit*{\addspace}% + \printtext{%[parens] + \printlist[][-\value{listtotal}]{location}}}% + \newunit\newblock + \usebibmacro{byholder}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \usebibmacro{newsdate}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + +% +% 在线文献驱动 +% +\DeclareBibliographyDriver{online}{%源来自standard.BBX + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{note}}% + \newunit + \printfield{version}% + \newunit\newblock +% \printlist{organization}% + \printlist{institution}% + \newunit\newblock +\ifboolexpr{% +test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% +}{\usebibmacro{date}}% +{\usebibmacro{modifydate}}%修改或更新日期,为带括号的时间 + \usebibmacro{url+urldate}%从下面移上来 + \newunit\newblock + \iftoggle{bbx:eprint} + {\usebibmacro{eprint}} + {}% + \newunit\newblock + %\usebibmacro{url+urldate}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + + + +% +% 报告类型驱动 +% 当有网址无出版项时,用online输出 +% +\DeclareBibliographyDriver{report}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \usebibmacro{byeditor+others}%增加的译者信息 + \newunit\newblock + \printfield{type}% + \setunit*{\addspace}% + \printfield{number}% + \newunit\newblock + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + \usebibmacro{doi+eprint+url}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isrn}} + {}% + \newunit\newblock +% \usebibmacro{doi+eprint+url}% +% \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + +% +% 论文、手册类型驱动 +% 2016-11-11,增加了译者信息 +% +\DeclareBibliographyDriver{manual}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \usebibmacro{byeditor+others}%增加的译者信息 + \newunit\newblock + \iftoggle{bbx:gbfieldtype}{% + \printfield{type}% + \setunit*{\addspace}% + }{}% + \printfield{number}% + \newunit\newblock + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{institution+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + \iffieldundef{url}{}{%当没有网址时也不输出修改或更新日期 + \usebibmacro{modifydate}}%修改或更新日期为带括号的时间 + \usebibmacro{doi+eprint+url}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isrn}} + {}% + \newunit\newblock +% \usebibmacro{doi+eprint+url}% +% \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + +% +% 备选类型驱动 +% +% 利用biblatex的misc驱动 +\DeclareBibliographyDriver{misc}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% +\iftoggle{bbx:gbstrict}{}{% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}}% + \newunit\newblock + \printfield{howpublished}% + \newunit\newblock + \printfield{type}% + \newunit + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{institution+location+date}% + %\usebibmacro{organization+location+date}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + + + + +% +% 专著中的析出文献的格式修改 +% +\DeclareBibliographyDriver{inbook}{%源来自standard.bbx + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\usebibmacro{title}% +\usebibmacro{in:}% +%\printtext{\texttt{//}\addthinspace}% + \usebibmacro{bybookauthor}% + \ifnameundef{bookauthor}{% + \ifnameundef{editor}{}{\newunit}% + }{\newunit}%替换下一句 + %\newunit\newblock +\iffieldundef{series}{}{\usebibmacro{series+number}\setunit{\addcolon\addspace}}%为处理一些存在series的情况而增加 + \usebibmacro{maintitle+booktitle}% +\iffieldundef{volume}{}{\setunit{\addcolon\addspace}\printfield{volume}}% +\iffieldundef{number}{}{\setunit{\addcolon\addspace}\printfield{number}}%增加卷和册信息 + \newunit\newblock% +% \usebibmacro{byeditor+others}% +% \newunit\newblock + \printfield{edition}% + \newunit + \iftoggle{bbx:gbstrict}{}{% +% \iffieldundef{maintitle} +% {\printfield{volume}% +% \printfield{part}} +% {}% +% \newunit +% \printfield{volumes}% +% \newunit\newblock +% \usebibmacro{series+number} + }% + \newunit\newblock + %\printfield{note}% + %\newunit\newblock + \usebibmacro{publisher+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}%移到上面来 + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock +% \usebibmacro{doi+eprint+url}% +% \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} diff --git a/config/gb7714-2015ay.cbx b/config/gb7714-2015ay.cbx new file mode 100644 index 0000000..79e6435 --- /dev/null +++ b/config/gb7714-2015ay.cbx @@ -0,0 +1,271 @@ +%% +%% --------------------------------------------------------------- +%% biblatex-gb7714-2015 --- A biblatex implementation of the +%% GBT7714-2015 citation style,author year sequence +%% Maintained by huzhenzhen +%% E-mail: hzzmail@163.com +%% Released under the LaTeX Project Public License v1.3c or later +%% --------------------------------------------------------------- +%% +\def\versionofgbtstyle{2019/03/28 v1.0r} +\ProvidesFile{gb7714-2015ay.cbx}[\versionofgbtstyle biblatex citation style] + +% +% 加载标准样式 +% +\RequireCitationStyle{authoryear-comp} + +\ExecuteBibliographyOptions{ + %autocite = superscript , + %autopunct = true , + %sorting = none , + maxcitenames=1, + mincitenames=1, + uniquename=init,%因为使用了名字缩写选项,所以需要设置uniquename=init而不是full避免冲突 + uniquelist=minyear +} + +% +% 选项设置,针对3.7以下版本 +% +% 原理方法:labeldate用于控制是否给引用标签提供日期的成分 +\defversion{3.4}{cbxopt}{ + \ExecuteBibliographyOptions{ + labeldate=true + } +} + +% +% 选项设置,针对3.7以上版本 +% +% 原理方法:labeldateparts用于控制是否给引用标签提供日期的成分 +\defversion{3.7}{cbxopt}{ + \ExecuteBibliographyOptions{ + labeldateparts=true + } +} + +\ifboolexpr{%选择选项设置 +test {\iftoggle{iftlfive}}%biblatex<=3.2 +or +test {\iftoggle{iftlsix}}%3.3<=biblatex<=3.6 +}{\switchversion{3.4}{cbxopt}}{\switchversion{3.7}{cbxopt}}%else: biblatex>=3.7 + + +\ifboolexpr{%兼容cite:labelyear+extrayear +test {\iftoggle{iftlfive}}%biblatex<=3.2 +or +test {\iftoggle{iftlsix}}%3.3<=biblatex<=3.6 +or +test {\iftoggle{iftlseven}}%3.7=biblatex +}{\newbibmacro{cite:labeldate+extradate}{\usebibmacro{cite:labelyear+extrayear}}}{}%else: biblatex>3.7 + +%textcite标注命令中的标点设置,注意只针对textcite命令。 +\DeclareDelimFormat[textcite]{nameyeardelim}{}%\addcomma\space +\DeclareDelimFormat[textcite]{andothersdelim}{\iffieldequalstr{userf}{chinese}{\addthinspace}{\addspace}}% +\AtEveryCitekey{% +\iffieldequalstr{userf}{chinese}{\renewcommand*{\andothersdelim}{\addthinspace}}%\addthinspace + {\renewcommand*{\andothersdelim}{\addspace}}% +} + + +% +% 重定义cite:label,针对biblatex3.8以上版本set条目集的标注(引用)标签 +% +% 原理方法:当条目是set时,v3.8以上版本,都没有有用的信息(区别于3.7以下版本set复制第一个成员的信息), +% 于是利用entrykey来给出标签,那么就要set的条目关键字是需要的字符串,注意字符串中间不能有空格 +\renewbibmacro*{cite:label}{% + \iffieldundef{label}% + {\iffieldundef{labeltitle}{\printtext[bibhyperref]{\printfield{entrykey}}}%entrykey + {\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}}% + {\printtext[bibhyperref]{\printfield{label}}}} + +% +% 重定义cite命令 +% +% 方法:\DeclareCiteCommand{\cite}[\mkbibparens]{precode}{loopcode}{sepcode}{postcode} +% v1.0p版后将cite的处理方式修改为类似pagescite,而不再使用biblatex的标准方式 +\DeclareCiteCommand{\cite} + {\usebibmacro{cite:init}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}% + {\thefield{postnote}}}% + (\usebibmacro{prenote}}%) + {\usebibmacro{citeindex}% + \usebibmacro{cite}} + {} + {%( + )\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} + } + +% +% 定义upcite命令 +% 20180604,v1.0l,hzz +% 20190409,v1.0r,hzz +% 方法:与cite命令相同 +\newrobustcmd*{\upcite}{% + \cite} + +% +% 重定义parencite命令 +% +%\DeclareCiteCommand{\parencite} +% {\usebibmacro{cite:init}% +% \renewbibmacro*{postnote}{% +% \iffieldundef{postnote}% +% {}% +% {\nopunct% +% \printfield{postnote}}}% +% (\usebibmacro{prenote}}%) +% {\usebibmacro{citeindex}% +% \usebibmacro{cite}} +% {} +% {%( +% )\mkbibsuperscript{\usebibmacro{postnote}}} + + +% +% 新定义pagescite命令,以满足标签带页码的国标要求 +% +% 原理方法: +% 新增\pagescite引用命令 +\DeclareCiteCommand{\pagescite} + {\usebibmacro{cite:init}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {\thefield{pages}}% + {\thefield{postnote}}}% + (\usebibmacro{prenote}%) + }% + {\usebibmacro{citeindex}% + \usebibmacro{cite}} + {} + {%( + )\mkbibsuperscript{\usebibmacro{postnote}}} + +% +% 定义yearpagescite,用于当文中作者已经存在,需要页码和年份的情况 +% +% 原理:增加一个命令yearpagescite +% 参考biblatex.DEF中的\DeclareCiteCommand*{\citeyear}命令 +\DeclareCiteCommand{\yearpagescite} + {\usebibmacro{cite:init}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {\thefield{pages}}% + {\thefield{postnote}}}% + \printtext{(}\usebibmacro{prenote}}% + {\usebibmacro{cite:labeldate+extradate}}%\printfield{year}\printfield{extrayear} + {\multicitedelim}% + {\printtext{)}\textsuperscript{\usebibmacro{postnote}}} + +% +% 定义yearcite,用于当文中作者已经存在,仅需要年份的情况 +% +% 原理:增加一个命令yearcite +\DeclareCiteCommand{\yearcite}%仅输出年份,不要页码 + {\usebibmacro{cite:init}% + \printtext{(}\usebibmacro{prenote}}% + {\usebibmacro{cite:labeldate+extradate}}%\printfield{year}\printfield{extrayear} + {\multicitedelim}% + {\printtext{)}} + +% +% 定义\authornumcite命令,输出作者信息,然后在后面带上顺序编码 +% 20180427,v1.0k,增加,hzz +% 20190409,v1.0r,hzz +% 为与顺序编码制兼容,增加了命令,定义与citet相同 +\newbibmacro*{citet}{% + \iffieldundef{shorthand} + {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}} + {\usebibmacro{cite:label}% + \setunit{\printdelim{nonameyeardelim}}% + \usebibmacro{cite:labeldate+extradate}% + \usebibmacro{cite:reinit}} + {\iffieldequals{namehash}{\cbx@lasthash} + {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND + \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)} + {\setunit{\addcomma}% + \usebibmacro{cite:extradate}} + {\setunit{\compcitedelim}% + \usebibmacro{cite:labeldate+extradate}% + \savefield{labelyear}{\cbx@lastyear}}} + {\printnames{labelname}% + %\setunit{\printdelim{nameyeardelim}}% + (\usebibmacro{cite:labeldate+extradate})% + \savefield{namehash}{\cbx@lasthash}% + \savefield{labelyear}{\cbx@lastyear}}}} + {\usebibmacro{cite:shorthand}% + \usebibmacro{cite:reinit}}% + \setunit{\multicitedelim}} + +\DeclareCiteCommand{\authornumcite}% + {\usebibmacro{cite:init}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}% + {\thefield{postnote}}}% + \usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{citet}} + {} + {\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} + } + +% +% 增加如下多个命令 +% 20190409,v1.0r,hzz +% 方法:利用newcommand或newrobustcmd命令进行定义 +% 注意\citet和\citep命令之所以不用newrobustcmd,是为避免加载natbib模块后产生冲突 + +%同\authornumcite +\DeclareCiteCommand{\citet}% + {\usebibmacro{cite:init}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}% + {\thefield{postnote}}}% + \usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{citet}} + {} + {\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} + } + +%同cite +\DeclareCiteCommand{\citep} + {\usebibmacro{cite:init}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}% + {\thefield{postnote}}}% + (\usebibmacro{prenote}}%) + {\usebibmacro{citeindex}% + \usebibmacro{cite}} + {} + {%( + )\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} + } + +\newrobustcmd*{\citetns}% + {\textcite} + +\newrobustcmd*{\citepns}% + {\parencite} + +\newrobustcmd*{\inlinecite}% + {\parencite} + + +% +% 增加如下复数的命令,以符合biblatex的复数命令习惯 +% 20190430,v1.0r,hzz +% citec和citecs命令是为了兼容顺序编码制。 +% authornumcites是常用命令authornumcite的复数形式 +\newrobustcmd*{\citec}% + {\cite} + +\DeclareMultiCiteCommand{\citecs}[]{\cite}{\multicitedelim} + +\DeclareMultiCiteCommand{\authornumcites}[]{\authornumcite}{\multicitedelim} diff --git a/config/gb7714-2015ms.bbx b/config/gb7714-2015ms.bbx new file mode 100644 index 0000000..ae63710 --- /dev/null +++ b/config/gb7714-2015ms.bbx @@ -0,0 +1,2710 @@ +%% +%% --------------------------------------------------------------- +%% biblatex-gb7714-2015 --- A biblatex implementation of the +%% GBT7714-2015 bibliography style,numerical sequence +%% Maintained by huzhenzhen +%% E-mail: hzzmail@163.com +%% Released under the LaTeX Project Public License v1.3c or later +%% --------------------------------------------------------------- +%% + +% +% 版本和时间信息 +% +\def\versionofgbtstyle{2019/03/28 v1.0r} +\def\versionofbiblatex{\abx@version} +\ProvidesFile{gb7714-2015ms.bbx}[\versionofgbtstyle biblatex bibliography style] +%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 + + +%===================================================================== +% 加载标准样式 +%===================================================================== +\RequireBibliographyStyle{numeric-comp} +\RequirePackage{xstring}%解决texlive2015的biblatex3.0不加载xstring包的问题 + +%===================================================================== +% 功能函数 +%===================================================================== + % + % biblatex版本判断 + % 20180629,v1.0k,hzz + % + % 原理方法:适用于3.10以上版本的biblatex,否则给出警告 + \@ifpackagelater{biblatex}{2017/12/28}{}{ + \blx@warning@noline{% + biblatex version is too old for this style\MessageBreak + if errors raised,Please update biblatex to the latest version.} + } + + + % + % 判断CJK字符的函数,用于判断作者等信息是否由中文字符构成 + % v1.0k,20180509,hzz + % + % 原理方法:用biber中的perl方法代替。因为利用tex函数对字符判断时,当字符在宏 + % 中时,基于`的方法无法解决GBK编码的问题,基于CJKsymbol的方法无法解决utf-8 + % 编码用xelatex编译的问题。 + % + % 原理是:利用perl正则将中文标识记录到域中, + % 然后利用\iffieldundef和\iffieldequalstr进行判断 + \providetoggle{ifCJKforgbt} + \def\testCJKfirst#1{% + \iffieldundef{#1}{\togglefalse{ifCJKforgbt}}{% + \iffieldequalstr{#1}{chinese}{\toggletrue{ifCJKforgbt}}{\togglefalse{ifCJKforgbt}}}} + + % + % 2个卷的解析函数,用于连续出版物 + % + % 原理方法: 范围起止间隔符号还是用-,而不是与date相同的/,因为有合期期刊的问题,需要用到/符号 + \newcommand{\multivolparser}[1]{% + \IfSubStr{#1}{-}% + {\StrBefore{#1}{-}[\multivolfirst]\StrBehind{#1}{-}[\multivolsecond]}% + {\def\multivolfirst{#1}\def\multivolsecond{}}% + } + + + % + % 2个期的解析函数,用于连续出版物 + % + \newcommand{\multinumberparser}[1]{% + \IfSubStr{#1}{-}% + {\StrBefore{#1}{-}[\multinumberfirst]\StrBehind{#1}{-}[\multinumbersecond]}% + {\def\multinumberfirst{#1}\def\multinumbersecond{}}% + } + + +%===================================================================== +% 数据模型定义 +%===================================================================== + %定义类型和载体标识,从gb内容看载体基本属于介质。 + %为与lee zeping的bst的样式统一,使用mark和medium这两域名 + %为单个条目的姓名格式控制增加nameformat和namefmtid两个域 + %为缩略信息文献表增加了shortbooktitle域 + %为多语言排序增加了lansortorder域 + \DeclareDatamodelFields[type=field,datatype=literal]{mark,medium,nameformat} + \DeclareDatamodelFields[type=field,datatype=integer]{namefmtid} + \DeclareDatamodelFields[type=field,datatype=literal]{shortbooktitle} + \DeclareDatamodelFields[type=field,datatype=literal]{lansortorder} + + + +%===================================================================== +% 设置宏包选项 +%===================================================================== + % + % 增加一个控制是否输出annotation域的选项,该域可以用于在文献条目后面输出一些注释信息 + % 20190509,v1,0s,hzz + \newtoggle{bbx:gbannote} + \DeclareBibliographyOption{gbannote}[false]{%biblatex低版本 + \settoggle{bbx:gbannote}{#1}} + \ExecuteBibliographyOptions{gbannote} + % + %用于在文献条目后面输出注释信息的宏 + %FieldFormat{annotation}用于设置注释信息的格式 + \DeclareFieldFormat{annotation}{% + \printtext{\addspace(#1)}% + } + \renewbibmacro*{annotation}{% + \iftoggle{bbx:gbannote}% + {\iffieldundef{annotation}% + {\printfile[annotation]{\bibannotationprefix\thefield{entrykey}.tex}}% + {\printfield{annotation}}}% + {}% + } + + + % + % 增加一个控制是否输出type域的选项 + % 20190212,v1,0q,hzz + \newtoggle{bbx:gbfieldtype} + \DeclareBibliographyOption{gbfieldtype}[false]{%biblatex低版本 + \settoggle{bbx:gbfieldtype}{#1}} + \ExecuteBibliographyOptions{gbfieldtype} + + % + % 增加一个控制是否根据页码重设脚注数字标号的选项 + % 20190422,v1,0r,hzz + \newtoggle{bbx:gbfnperpage} + \DeclareBibliographyOption{gbfnperpage}[false]{% + \settoggle{bbx:gbfnperpage}{#1}} + \ExecuteBibliographyOptions{gbfnperpage} + + % + % 增加一个选项,用于控制是否实现GB/T 7714-2015标准的脚注文献表 + % 20190203,v1.0p,hzz + % 原理方法:默认做patch,文献引用带圈上标数字表示,脚注中的文献用带圈非上标数字做标签 + % 当前面的脚注中已经存在当前文献,那么当前文献内容不再输出而用同(4)这样的方式 + % 需要注意的是由于小页环境和表格中的脚注本身的问题,可能会有一些问题 + \DeclareBibliographyOption{gbfootbib}[false]{% + \ifstrequal{#1}{false}{}{\execgbfootbib}} + \ExecuteBibliographyOptions{gbfootbib} + + %% + \newlength{\footbibmargin} + \newlength{\footbiblabelsep} + \setlength{\footbibmargin}{1em}%脚注的段落左侧缩进距离 + \setlength{\footbiblabelsep}{0.5em}%脚注中标记号与脚注段落的间距 + \def\execgbfootbib% + {% + %开启引用跟踪计数器,为使用\ifciteseen等测试命令 + \ExecuteBibliographyOptions{citetracker=true} + % + %利用footmisc宏包来实现脚注文献的悬挂对齐 + \AtEndPreamble{ + \@ifclassloaded{beamer}{}{ + %beamer类因为其特殊性,为避免冲突不调footmisc。 + %同时footmisc与hyperref宏包也不兼容,所以使用footmisc时会破坏脚注的超链接 + %如果要实现超链接可以将下句注释掉,这里留着主要是实现悬挂对齐。 + %\PassOptionsToPackage{perpage,hang}{footmisc}% + %\RequirePackage{footmisc}% + + %重新实现脚注的根据单页重设脚注号码 + %重新实现脚注的悬挂对齐问题,不再使用footmisc,直接从latex核心代码和hyperref代码进行修改 + %v1.0q 20190317 hzz + %v1.0r 20190422 hzz 根据gbfnperpage选项设置 + \iftoggle{bbx:gbfnperpage}% + {\@addtoreset{footnote}{page}}{}%重设计数器 + +\@ifpackageloaded{hyperref}{%加载hyperref则对\H@@footnotetext做重定义 + \long\def\H@@footnotetext##1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \leftskip \footbibmargin%增加的左侧缩进 + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox% + }% + \color@endgroup}}% + + \long\def\H@@mpfootnotetext##1{% + \global\setbox\@mpfootins\vbox{% + \unvbox\@mpfootins + \reset@font\footnotesize + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel + {\csname p@mpfootnote\endcsname\@thefnmark}% + \leftskip \footbibmargin%增加的左侧缩进 + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox}% + \color@endgroup}} + }{%否则对latex核心代码中的\@footnotetext做重定义 + \long\def\@footnotetext##1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \leftskip \footbibmargin%增加的左侧缩进 + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox% + }% + \color@endgroup}}% + + \long\def\@mpfootnotetext##1{% + \global\setbox\@mpfootins\vbox{% + \unvbox\@mpfootins + \reset@font\footnotesize + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel + {\csname p@mpfootnote\endcsname\@thefnmark}% + \leftskip \footbibmargin%增加的左侧缩进 + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox}% + \color@endgroup}} + } + + \long\def\@makefntext##1{%增加了脚注标记与正文的间隔 + \parindent 1em\noindent \hb@xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1} + + } + + % + %使脚注标记加圈并设置数字的字体为tiny,不使用修改thefootnote的方式 + \def\@makefnmark{\hbox{\@textsuperscript{\textcircled{\tiny\@thefnmark}}}} + %做patch使得脚注内容中的脚注数字标签不上标 + \pretocmd{\@makefntext}{% + \def\@makefnmark{% + \hbox{\textcircled{\tiny\@thefnmark}}% + }% + }{}{} + } + + % + %判断当前文献是否已经引用过且是做的footfullcite(即已经作为脚注输出文献内容) + %记录首次输出时的脚注号码,用于后面再次引用该文献时的输出,比如同(4)。 + %v1.0q 20190309 区分使脚注标注适应minipage中的情况 + \newbibmacro*{citesavefn}{% + \ifciteseen%当被引用过为true + {\ifcsdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}%当已经定义过脚注序号信息 + {\csgdef{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{% + \str@sameentry\gdef\@thefnmark{\csuse{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}}% + \@makefnmark% + }}% + {\csxdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{% + \ifcsstring{@mpfn}{mpfootnote}{\@alph\c@mpfootnote}{\thefootnote}% + }}% + }% + {\csxdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{% + \ifcsstring{@mpfn}{mpfootnote}{\@alph\c@mpfootnote}{\thefootnote}% + %判断在minipage中比较麻烦,这里使用\@mpfn的定义进行判断 + }}% + } + + % + %重定义\footfullcite使完成gb7714-2015的脚注文献要求 + \DeclareCiteCommand{\footfullcite}[\mkbibfootnote]% + {\defcounter{maxnames}{\blx@maxbibnames}%局部定义maxnames和minnames计数器 + \defcounter{minnames}{\blx@minbibnames}%使footfullcite内的作者输出与正文文献表中的一致。 + \usebibmacro{prenote}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}{\setunit{\addcolon\addspace}\printfield{postnote}}}%与ay样式不同,由于已修改postnote域格式,直接用printfield + }% + {\usebibmacro{citesavefn}% + \ifcsdef{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}% + {\csuse{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}\nopunct}% + {\usedriver{\DeclareNameAlias{sortname}{default}}{\thefield{entrytype}}}% + }% + {\multicitedelim}% + {\usebibmacro{postnote}} + + } + + % + % 增加一个选项,用于控制gb7714的使用范围,即英文文献和中文文献使用不同的样式 + % 20180814,v1.0m,hzz + % 原理方法: + % 当gbstyle=true,则所有的文献使用国标样式,否则仅中文文献使用国标样式 + \newtoggle{bbx:gbstyle} + \DeclareBibliographyOption{gbstyle}[true]{%biblatex低版本 + \settoggle{bbx:gbstyle}{#1}} + + % + % 增加一个控制是否输出文献类型和载体标识的选项 + % + % 原理方法: + % 对于biblatex3.4以上版本DeclareBibliographyOption命令中的[datatype]如果是boolean,那么是可以省略的 + % 所以用老版本的不用[datatype]的命令可以兼容所有biblatex版本 + \newtoggle{bbx:gbtype} + %\DeclareBibliographyOption[boolean]{gbtype}[true]{%biblatex高版本 + \DeclareBibliographyOption{gbtype}[true]{%biblatex低版本 + \settoggle{bbx:gbtype}{#1}} + + % + % 增加一个源文件编码选择选项,当true时可以使用GBK编码。 + % v1.0k, 2018.05.08, by hzz + % + % 原理方法:将需要输出的中文字符串用命令形式表示存储,采用utf8编码时采用bbx文档 + % 内的定义即是utf8编码的中文字符串,但tex源文件是gbk编码时,利用gb7714-2015-gbk.def + % 文档内的gbk编码的字符串覆盖。这种覆盖只能在宏包末尾加载时成功实现,所以使用 + % AtEndOfPackage。该解决思路源自biblatex-caspervector宏包。 + % 另外注意: + % gbk编码的tex文档,利用pdflatex/latex能正确编译,利用xelatex能编译,但中文显示乱码 + % 在源文档前面增加 XeTeX 原语:\XeTeXinputencoding "GBK" 后,显示正常 + % utf-8编码的tex文档,利用xelatex能正确编译,而pdflatex/latex不能编译。 + \newtoggle{bbx:codegbk} + \DeclareBibliographyOption{gbcodegbk}[false]{% + \settoggle{bbx:codegbk}{#1}} + + \def\str@bibliography{参考文献} + \def\str@references{参考文献} + \def\str@bytranslator{译} + \def\str@andotherscn{等} + \def\str@backrefpage{引用页} + \def\str@backrefpages{引用页} + \def\str@noaddress{出版地不详} + \def\str@nopublisher{出版者不详} + \def\str@edition{版} + \def\str@volumecn{卷} + \def\str@numbercn{册} + \def\str@serialcn{第} + \def\str@sameentry{同} + \def\str@incn{见} + \def\str@mathesiscn{硕士学位论文} + \def\str@phdthesiscn{博士学位论文} + \def\str@editorcn{主编} + + \AtEndOfPackage{% + \iftoggle{bbx:codegbk}{% + \ExecuteBibliographyOptions{texencoding = GBK} + \input{gb7714-2015-gbk.def} + }{}} + + % + % 增加一个严格按GB/T 7714-2015给出著录格式控制域的输出的选项 + % v1.0k, 2018.05.08, by hzz + % + % 原理方法: + % 默认设置该选项为真,进而不输出GB/T 7714-2015中没有的域的信息 + % 这样可以避免因为bib文件带有多余的域的信息的输出,比如因为bibtex样式 + % 可能需要用于中英文判断的language域的信息。 + \newtoggle{bbx:gbstrict} + \DeclareBibliographyOption{gbstrict}[true]{% + \settoggle{bbx:gbstrict}{#1}} + + % + % 增加一个控制标题域超链接设置的选项 + % v1.0k, 2018.05.24, by hzz + % + % 原理方法: + % 利用标题域格式来实现,默认设置该选项为false,不做超链接。 + % 设置为true,则标题设置超链接 + \newtoggle{bbx:titlelink} + \DeclareBibliographyOption{gbtitlelink}[false]{% + \settoggle{bbx:titlelink}{#1}} + + % + % 增加一个控制参考文献标题是否能够被ctex宏包设置的选项 + % v1.0l, 2018.07.02, by hzz + % + % 原理方法: + % 重定义biblatex的宏,去除使用本地化字符串的方式,是的可以利用ctexset进行设置 + \newtoggle{bbx:ctexset} + \DeclareBibliographyOption{gbctexset}[true]{% + \settoggle{bbx:ctexset}{#1}} + + \AtEndOfPackage{% + \iftoggle{bbx:ctexset}{% + \def\blx@defbibstrings#1#2{% + \def\do##1{\csundef{abx@lstr@##1}\csundef{abx@sstr@##1}}% + \abx@dostrings + \csuse{abx@strings@#1}% + \setkeys{blx@lbx}{#2}% + \let\do\blx@defbibstrings@i + \csxdef{abx@strings@#1}{\abx@dostrings}% + } + }{}} + + % + % 增加一个恢复域格式为标准样式的控制选项 + % v1.0k, 2018.05.15, by hzz + % + % 原理方法: + % 默认设置该选项为false,采用国标要求的域格式输出相关域 + % 当设置该选项为true时,则重新利用标准样式的域格式输出相关的域 + \newtoggle{bbx:gbfieldstd} + \DeclareBibliographyOption{gbfieldstd}[false]{% + \settoggle{bbx:gbfieldstd}{#1}% + } + + % + % 增加一个出版项自动处理控制选项,当true时使用出版者不详等信息补充缺失的出版信息。 + % + \newtoggle{bbx:gbpub} + \DeclareBibliographyOption{gbpub}[true]{% + %\settoggle{bbx:gbpub}{#1} %或采用下面这一句 + \ifstrequal{#1}{false}{\togglefalse{bbx:gbpub}}{\toggletrue{bbx:gbpub}}} + + % + % 增加控制析出文献来源前的标点符号//输出的选项 + % v1.0k, 2018.04.20,added in by hzz + \newtoggle{bbx:gbpunctin} + \DeclareBibliographyOption{gbpunctin}[true]{% + \settoggle{bbx:gbpunctin}{#1}} + + % + % 增加一个处理佚名或noauthor的控制选项 + % + % 原理方法:在顺序编码制中不需要使用,为与作者年制的兼容性考虑,这里也增加避免报错 + \DeclareBibliographyOption{gbnoauthor}[true]{}% + + + % + %为日期控制格式增加一个gb7714-2015选项 + % + \csdef{mkdaterangegb7714-2015}#1{% + \begingroup + \blx@metadateinfo{#1}% + \iffieldundef{#1year} + {} + {\printtext[#1date]{% + \blx@gbdate{#1}{}}}% + \endgroup} + + \newrobustcmd*{\blx@gbdate}[3][]{% + \dateeraprintpre{#2#3year}% + \blx@imc@forcezerosy{\thefield{#2#3year}}\ifblank{#1}{}{\printfield{#1}}% + \iffieldundef{#2#3month}{}{\hyphen\blx@imc@forcezerosmdt{\thefield{#2#3month}}}% + \iffieldundef{#2#3day}{}{\hyphen\blx@imc@forcezerosmdt{\thefield{#2#3day}}}} + + %为姓名格式选择增加的计数器 + \newcounter{gbnamefmtcase} + \def\thegbnamefmtcase{\the\c@gbnamefmtcase} + %为数字标签格式选择增加的计数器/命令 + \newcommand{\mkgbnumlabel}[1]{\mkbibbrackets{#1}} + \def\gbbiblabelopt@bracket{\renewcommand{\mkgbnumlabel}[1]{\mkbibbrackets{##1}}} + \def\gbbiblabelopt@parens{\renewcommand{\mkgbnumlabel}[1]{\mkbibparens{##1}}} + \def\gbbiblabelopt@dot{\renewcommand{\mkgbnumlabel}[1]{##1\adddot}} + \def\gbbiblabelopt@plain{\renewcommand{\mkgbnumlabel}[1]{##1}} + \def\gbbiblabelopt@box{\renewcommand{\mkgbnumlabel}[1]{\framebox{##1}}} + \def\gbbiblabelopt@circle{\renewcommand{\mkgbnumlabel}[1]{\textcircled{##1}}} + %为文献表中数字标签对齐方式选择增加的计数器/命令 + \newcounter{gbalignlabel} + \def\thegbalignlabel{\the\c@gbalignlabel} + %为引用标签标注/文献表中本地化字符串中英文选择增加的计数器/命令 + \newcounter{gbcitelocalcase} + \newcounter{gbbiblocalcase} + \def\thegbcitelocalcase{\the\c@gbcitelocalcase} + \def\thegbbiblocalcase{\the\c@gbbiblocalcase} + + % 增加不同语言排序的切换选项 + % numeric样式,不使用该选项,这里给出仅为兼容性考虑 + % v1.0q,20190307,hzz + % + \DeclareBibliographyOption[string]{gblanorder}[chineseahead]{} + + + % + % 增加本地化字符串的中英文切换选项 + % gbcitelocal指标注中的本地化字符串 + % gbbiblocal 指文献表中的本地化字符串 + % gblocal 指设置文献表和标注中的本地化字符串 + % v1.0o,20190103,hzz + % + \DeclareBibliographyOption[string]{gbcitelocal}[gb7714-2015]{% + \ifstrequal{#1}{gb7714-2015}{\setcounter{gbcitelocalcase}{0}}{}% + \ifstrequal{#1}{chinese}{\setcounter{gbcitelocalcase}{1}}{}% + \ifstrequal{#1}{english}{\setcounter{gbcitelocalcase}{2}}{}% + } + + \DeclareBibliographyOption[string]{gbbiblocal}[gb7714-2015]{% + \ifstrequal{#1}{gb7714-2015}{\setcounter{gbbiblocalcase}{0}}{}% + \ifstrequal{#1}{chinese}{\setcounter{gbbiblocalcase}{1}}{}% + \ifstrequal{#1}{english}{\setcounter{gbbiblocalcase}{2}}{}% + } + + \DeclareBibliographyOption[string]{gblocal}[gb7714-2015]{% + \ExecuteBibliographyOptions{gbbiblocal=#1}% + \ExecuteBibliographyOptions{gbcitelocal=#1}% + } + + % + % 增加序号标签格式处理选项 + % v1.0l,20180623,hzz + % + \DeclareBibliographyOption[string]{gbbiblabel}[bracket]{% + \csuse{gbbiblabelopt@#1} + } + + % + % 增加姓名大小写格式处理选项 + % + \DeclareBibliographyOption[string]{gbnamefmt}[uppercase]{% + \ifstrequal{#1}{uppercase}{\setcounter{gbnamefmtcase}{0}}{}% + \ifstrequal{#1}{lowercase}{\setcounter{gbnamefmtcase}{1}}{}% + \ifstrequal{#1}{givenahead}{\setcounter{gbnamefmtcase}{2}}{}%given-family + \ifstrequal{#1}{familyahead}{\setcounter{gbnamefmtcase}{3}}{} + \ifstrequal{#1}{pinyin}{\setcounter{gbnamefmtcase}{4}}{}%family-given + \ifstrequal{#1}{reverseorder}{\setcounter{gbnamefmtcase}{5}}{}%family-given/given-family + } + + + % + % 增加标签对齐选项 + % + % right是默认的右对齐,left是左对齐,gb7714-2015是项对齐方式 + \DeclareBibliographyOption[string]{gbalign}[right]{% + \ifstrequal{#1}{right}{\setcounter{gbalignlabel}{0}}{} + \ifstrequal{#1}{left}{\setcounter{gbalignlabel}{1}}{} + \ifstrequal{#1}{center}{\setcounter{gbalignlabel}{2}}{} + \ifstrequal{#1}{gb7714-2015}{\setaligngbstyle}{} + } + + + % + % 选项设置 + % + \ExecuteBibliographyOptions{ + %firstinits=true, 针对biblatex<3.3版本的选项设置,比如texlive2015中的3.0版 + giveninits=true, %针对3.3<=biblatex<3.5版本,比如texlive2016中的3.4版 + sorting=none, + useprefix=true, %名字的信息包括前缀 + date = year, %日期仅写到年 + maxbibnames = 3,%设置名字最大数量 + minbibnames = 3, %设置缩减后的名字最小数量 + maxitems = 1,%设置列表最大数量 + minitems = 1, %设置缩减后的列表最小数量 + isbn=false, + gbstyle=true, + gbtype=true, + gbcodegbk=false, + gbstrict=true, + gbtitlelink=false, + gbfieldstd=false, + gbpub=true, + gbpunctin=true, + gbbiblabel=bracket, + gbnamefmt=uppercase, + gbalign=right, + gbctexset=true, + %urldate =edtf, %针对3.7<=biblatex<=3.9版本的选项设置,比如texlive2017中的3.7版 + %eventdate =edtf,%针对3.7<=biblatex<=3.9版本的选项设置,比如texlive2017中的3.7版 + urldate =gb7714-2015, %iso,针对3.10<=biblatex版本的选项设置,比如texlive2018中的3.11版 + eventdate =gb7714-2015, + gblocal=gb7714-2015, + } + + +%===================================================================== +% 设置本地化字符串 +%===================================================================== + % + % 新建当地化字符串,用来记录“等”字符、“和”字符 + % + \NewBibliographyString{andotherscn} + \NewBibliographyString{andothersincitecn} + \NewBibliographyString{andothersincite} + \NewBibliographyString{andcn} + \NewBibliographyString{andothersjp} + \NewBibliographyString{andotherskr} + \NewBibliographyString{andjp} + \NewBibliographyString{andkr} + \NewBibliographyString{andincitecn} + \NewBibliographyString{andincite} + \NewBibliographyString{volumecn} + \NewBibliographyString{numbercn} + \NewBibliographyString{serialcn} + \NewBibliographyString{incn} + \NewBibliographyString{mathesiscn} + \NewBibliographyString{phdthesiscn} + \NewBibliographyString{editorcn} + \NewBibliographyString{editorscn} + + + % + % 修改一些当地化字符串 + % + % 原理方法:直接利用当地化格式english修改出一些中文的格式,具体修改内容参考english.lbx文件 + % 当然也可以增加比如上面定义的andotherscn + % 注意:在lbx文件和bbx文件中定义本地字符串的不同语法,两个参数和一个参数的区别 + \DefineBibliographyStrings{english}{ + bibliography = {\str@bibliography}, + references = {\str@references}, + bytranslator= {\str@bytranslator},%\addperiod,%将trans. by 改成 译 + and = {\addcomma},%将第2和3人名间的and符号改成逗号,用\finalnamedelim命令也可以定义,参见3.9.1节 + andcn = {\addcomma},%and本地化字符串的中文对应词 + andincitecn = {\addcomma},%将标注中的分开,便于与文献表中的区分 + andincite = {\addcomma}, + %andothers = {et al.}, %将超过3个人名的省略,et al.改成为 等 + andotherscn = {\str@andotherscn}, %将超过3个人名的省略,et al.改成为 等 + andothersincitecn={\str@andotherscn},%将标注中的分开,便于与文献表中的区分 + andothersincite={et al\adddot}, + backrefpage = {\str@backrefpage:}, + backrefpages = {\str@backrefpages:}, + in={in\intitlepunct}, + volumecn={\str@volumecn}, + numbercn={\str@numbercn}, + serialcn={\str@serialcn}, + andothersjp={他}, + andotherskr={외}, + andjp={和}, + andkr={和}, + incn={\str@incn\addcolon\addspace}, + mathesiscn={\str@mathesiscn}, + phdthesiscn={\str@phdthesiscn}, + editorscn={\str@editorcn}, + editorcn={\str@editorcn}, +} + + % + % 增加两个命令用于临时的局部的修改本地化字符串 + % 其中\setlocalbibstring修改缩写字符串,setlocalbiblstring修改长字符串 + % 注意使用时因为是局部修改,因此要将其与需要修改的引用命令放在一个编组符号内 + % v1.0t,hzz,20190525 + \newcommand{\setlocalbibstring}[2]{% + \csdef{abx@sstr@#1}{#2}} + \newcommand{\setlocalbiblstring}[2]{% + \csdef{abx@lstr@#1}{#2}} + +%===================================================================== +% 动态数据修改 +%===================================================================== +% +% 各层次的数据映射和动态修改 +% +% 原理方法: +% 1. 进行语言包括中英文判断,并设置和记录,比如记录到userf,usere中 +% 2. 增加文献标识符如[M],[J]等,对一些容易混淆的域进行设置以增强兼容性 +% 3. \DeclareSourcemap命令对于biblatex3.11以下版本只能出现一次,3.11版开始支持多个 +% 4. \DeclarestyleSourcemap在biblatex v3.7版开始可以支持出现多次 +% 5. 把作者和译者信息准确的记录到userf,usere中,用于后面判断是否是cjk字符。 +% 注意:这里用userf,usere而不是namee,namef,是因为只有把name列表转成域,才能有效读取姓名中的字符, +% 如果用namee,namef,name信息会自动解析,所以就不能为cjk判断提供需要的信息 +% +% 不同的文献类型使用相同的驱动输出可以有5种方法: +% 1. 是数据源层的映射,将其它类型转换为某一要使用驱动的类型 +% 2. 是样式层映射,也是将其它类型转换为某一要使用驱动的类型 +% 3. 是驱动层映射,也是将其它类型转换为某一要使用驱动的类型 +% 4. 定义驱动类型别名DeclareBibliographyAlias,将其它类型定义为某一要使用驱动的类型的别名 +% 驱动别名定义本质上是做了驱动层映射 +% 5. 直接定义不同的类型的驱动,但驱动内容相同。 +% +% 关于数据映射和驱动使用的考虑如下: +% 1. 为避免利用biber输出bib文件时的数据变动,尽量不在数据源层映射做类型转换 +% 2. 为减少代码量,尽量少做内容相同的不同类型驱动 +% 3. 因此类型相关的处理主要在样式层映射、驱动层映射、驱动别名 +% 4. 由于biblatex默认做的驱动别名处理可能增加一些信息比如masterthesis转thesis时增加的type +% 可以在样式层映射做某些需要避免这种默认处置的转换 +% 5. 当没有避免默认行为的需求时,全部采用驱动别名的方式处理,等价于驱动层的映射 +% +% 文献类型和驱动考虑如下: +% 1. 连续出版物及析出文献有其特殊性,因此考虑两类periodical和article +% newpaper映射为article,并以note域做区分特殊处理 +% 2. 专著和专著中的析出文献是主要的类型,因此考虑book和inbook +% standard映射为book或inbook,并以note域做区分特殊处理 +% collection和proceedings基本与book类似,因此做book驱动别名处理 +% incollection和inproceedings基本与inbook类似,因此做inbook驱动别名处理 +% 3. 专利类型有其特殊性,考虑patent类型 +% 4. 电子资源类型有其特殊性,考虑online类型 +% 5. 报告类型与book有点类似,出版项处理与book一样,但有时又要有修改和更细日期 +% 因此考虑用一种类型来输出,使用report类型 +% 6. 手册/学位论文等类型与book有点类似,但对于出版项处理时,有缺省时,直接省略, +% 同时有version和edition的区别,因此考虑用一种类型来输出,使用manual类型 +% 7. 包括报告,学位论文在内的其它所有的类型,都做一个判断,当没有出版项时, +% 且存在网址信息时,将其转换为online类型输出,否则都做为manual类型输出。 +% 8. 备选类型misc当存在网址时直接转换为online,由于howpublished域可用于描述 +% 更多的信息,因此不存在网址时,独立做一个备选格式 +% 9. 出版项主要以如下方式处理: +% (a) location+institution+date 仅用于连续出版物 +% (b)publisher+location+date 用于需要完整输出出版项的类型,比如book,collection,proceedings,in*,report +% (c)institution+location+date 用于出版项缺失时不输出的类型,包括manual,thesis,archive等其他类型 +% (d)printlist{insitution} 用于电子资源,仅输出出版者或组织,为数据映射方便,本来默认的organization域转换为用insitution输出。 +% (e) 不输出,主要用于连续出版物析出的文献 +% 10. 日期以如下方式处理: +% date 由于存在biblatex选项,因此通过选项控制,数据源为date解析数据或year +% urldate 由于存在biblatex选项,因此通过选项控制,输出到日,且用[]包围,数据源为urldate +% newsdate 用于公告日期,公开日期或新闻日期,输出到日,但无包围符号,数据源为date +% modifydate 用于更新或修改日期,输出到日,且用()包围,数据源为date或enddate或eventdate + +\DeclareSourcemap{%\perdatasource{examples.bib} +\maps[datatype=bibtex]{% + \map{%当没有作者时将editor转成author + \pernottype{inbook}%因为in系列中editor可能用来表示bookauthor,所以排除 + \pernottype{inproceedings} + \pernottype{incollection} + \pernottype{periodical}%因为peridical直接使用editor,所以排除 + %注意notfield在低版本biblatex中没有 + %\step[notfield=author,final]%当author不存在,将editor复制给author + \step[fieldsource=editor,fieldtarget=author]%并删除editor + } + \map{%当没有作者时将translator转成author + \pernottype{inbook} + \pernottype{inproceedings} + \pernottype{incollection} + %\step[notfield=author,final]%当author不存在,将translator复制给author + \step[fieldsource=translator,fieldtarget=author]%并删除translator + } + \map{%让address和location同步,biblatex中address是location的别名 + %因此输出的时候只有location信息,但处理过程中是可以存在address的。 + \step[notfield=address,final]% + \step[fieldsource=location,final] + \step[fieldset=address,origfieldval] + } + \map{ + \step[notfield=location,final]% + \step[fieldsource=address,final] + \step[fieldset=location,origfieldval] + } + \map{%处理在bib文件用mark标记文献类型标识符的情况 + \step[fieldsource=mark,final] + \step[fieldset=usera, origfieldval] + } + \map{%处理在bib文件中直接给出文献的姓名格式为lowercase的情况 + \step[fieldsource=nameformat,match=lowercase,final] + \step[fieldset=namefmtid,fieldvalue={1}] + } + \map{%处理在bib文件中直接给出文献的姓名格式为givenahead的情况 + \step[fieldsource=nameformat,match=givenahead,final] + \step[fieldset=namefmtid,fieldvalue={2}] + } + \map{%处理在bib文件中直接给出文献的姓名格式为familyahead的情况 + \step[fieldsource=nameformat,match=familyahead,final] + \step[fieldset=namefmtid,fieldvalue={3}] + } + \map{%处理在bib文件中直接给出文献的姓名格式为pinyin的情况 + \step[fieldsource=nameformat,match=pinyin,final] + \step[fieldset=namefmtid,fieldvalue={4}] + } + \map{%根据article确定文献类型标识符 + \pertype{article} + \step[fieldset=usera, fieldvalue={J}] + } + \map{%根据periodical确定文献类型标识符 + \pertype{periodical} + \step[fieldset=usera, fieldvalue={J}] + \step[fieldsource=author] %有时会把author和editor混淆,处理后使用editor + \step[fieldset=editor, origfieldval] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%根据增加一个新闻报纸的类型newspaper确定文献类型标识符 + \pertype{newspaper} + \step[fieldset=usera, fieldvalue={N}] + \step[fieldset=note, fieldvalue=news]%因为没有专门的驱动,记录note方便映射为article后判断 + } + \map{%对应增加的一个数据库类型database确定文献类型标识符 + \pertype{database} + \step[fieldset=usera, fieldvalue={DB}] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个数据集类型dataset确定文献类型标识符 + \pertype{dataset} + \step[fieldset=usera, fieldvalue={DS}]% + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个软件类型software确定文献类型标识符 + \pertype{software} + \step[fieldset=usera, fieldvalue={CP}] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个舆图类型map确定文献类型标识符 + \pertype{map} + \step[fieldset=usera, fieldvalue={CM}]% + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个档案类型archive确定文献类型标识符 + \pertype{archive} + \step[fieldset=usera, fieldvalue={A}] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%因为misc类型本身就是没有类型,而不像其它文献有明确的类型,所以 + %当misc类型带有网址时,直接将其转换为online类型 + \pertype{misc} + \step[fieldsource=url,final] + \step[typesource=misc,typetarget=online] + } + \map{%对应增加的一个备选类型misc确定文献类型标识符 + \pertype{misc} + \step[fieldset=usera, fieldvalue={Z}]% + } + \map{ + \pertype{book} + \pertype{inbook} + \step[fieldset=usera, fieldvalue={M}] + \step[fieldsource=version] %有时会把version和edition混淆,处理后直接用edition + \step[fieldset=edition, origfieldval] + } + \map{%兼容老的standard类型,确定文献类型标识符 + \pertype{standard} + \step[fieldset=usera, fieldvalue={S}] + \step[fieldset=note, fieldvalue=standard]%因为没有专门的驱动,记录note方便映射为book和inbook后判断 + } + \map{ + \pertype{patent} + \step[fieldset=usera, fieldvalue={P}] + } + \map{ + \pertype{inproceedings} + \pertype{conference}%兼容老的conference类型 + \step[fieldset=usera, fieldvalue={C}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{proceedings} + \step[fieldset=usera, fieldvalue={C}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{incollection} + \step[fieldset=usera, fieldvalue={G}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{collection} + \step[fieldset=usera, fieldvalue={G}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{report} + \pertype{techreport}%兼容老的techreport类型 + \step[fieldset=usera, fieldvalue={R}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{thesis} + \pertype{mastersthesis}%兼容老的mastersthesis和phdthesis类型 + \pertype{phdthesis} + \step[fieldset=usera, fieldvalue={D}] + \step[fieldsource=publisher]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{ + \pertype{online} + \pertype{electronic}%兼容老的electronic类型 + \pertype{www}%兼容老的www类型 + \step[fieldset=usera, fieldvalue={EB}] + \step[fieldsource=publisher]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval]%因为online的出版项处理类似手册 + \step[fieldsource=organization]%有时会把organization和institution混淆,处理后使用institution,以增强兼容性 + \step[fieldset=institution, origfieldval] + } + \map{ + \pertype{manual} + \step[fieldset=usera, fieldvalue={A}] + \step[fieldsource=edition]%有时会把version和edition混淆,处理后使用version + \step[fieldset=version, origfieldval] + \step[fieldsource=publisher]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + \step[fieldsource=organization]%有时会把organization和institution混淆,处理后使用institution,以增强兼容性 + \step[fieldset=institution, origfieldval] + } + \map{ + \pertype{unpublished} + \step[fieldset=usera, fieldvalue={Z}] + } + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={author}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + } + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={editor}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={translator}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={bookauthor}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map{%处理一些用year表示date的情况 + %这样处理将会设置date域,并使得labeldatesource变为空,因为date的前缀为空(如果是urldate,那么labeldatesource就是url)。 + %同时date域会被biblatex自动解析为year,month,day,并且覆盖原来的year信息 + \step[fieldsource=year] + \step[fieldset=date, origfieldval] + } + \map{%将entrykey放入keywords中用于后期使用 + \step[fieldsource=entrykey] + \step[fieldset=keywords, origfieldval] + } + \map{%文献题名的中文判断,将信息保存到userd中,避免因为标签生成原因导致title域被清除而产生问题 + \step[fieldsource=title, match=\regexp{[\x{2FF0}-\x{9FA5}]},final]% + \step[fieldset=userd, fieldvalue={chinese}] + } + \map{\step[fieldsource=title,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userd,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=title,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userd,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=title,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userd,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=title,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userd,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userd,且存在title域的默认设置为英文 + \step[fieldsource=title,final] + \step[fieldset=userd,fieldvalue={english}] + } + \map{%作者的中文判断 + \step[fieldsource=author, match=\regexp{[\x{2FF0}-\x{9FA5}]},final] + \step[fieldset=userf, fieldvalue={chinese}] + } + \map{\step[fieldsource=author,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userf,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=author,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userf,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=author,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userf,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=author,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userf,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userf,且存在author域的默认设置为英文 + \step[fieldsource=author,final] + \step[fieldset=userf,fieldvalue={english}] + } + \map{%译者的中文判断 + \step[fieldsource=translator, match=\regexp{[\x{2FF0}-\x{9FA5}]},final] + \step[fieldset=usere, fieldvalue={chinese}] + } + \map{\step[fieldsource=translator,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=usere,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=translator,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=usere,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=translator,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=usere,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=translator,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=usere,fieldvalue={korean}]%韩语 + } + \map{%将没有设置usere,且存在translator域的默认设置为英文 + \step[fieldsource=translator,final] + \step[fieldset=usere,fieldvalue={english}] + } + \map{%编者的中文判断 + \step[fieldsource=editor, match=\regexp{[\x{2FF0}-\x{9FA5}]},final]%直接匹配cjk字符,unicode编码位置从2FF0到9FA5 + \step[fieldset=userc, fieldvalue={chinese}] + } + \map{\step[fieldsource=editor,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userc,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=editor,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userc,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=editor,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userc,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=editor,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userc,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userc,且存在editor域的默认设置为英文 + \step[fieldsource=editor,final] + \step[fieldset=userc,fieldvalue={english}] + } + \map{%编者的中文判断 + \step[fieldsource=bookauthor, match=\regexp{[\x{2FF0}-\x{9FA5}]},final]%直接匹配cjk字符,unicode编码位置从2FF0到9FA5 + \step[fieldset=userb, fieldvalue={chinese}] + } + \map{\step[fieldsource=bookauthor,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userb,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=bookauthor,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userb,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=bookauthor,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userb,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=bookauthor,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userb,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userc,且存在editor域的默认设置为英文 + \step[fieldsource=bookauthor,final] + \step[fieldset=userb,fieldvalue={english}] + } + \map{\step[fieldsource=userd,final]%userd存在则用根据标题的语言设定language + \step[fieldset=language,origfieldval]%本身language存在则不设定 + } + \map{\step[fieldsource=userf,final]%userd不存在,而userf存在则根据author的语言设定language + \step[fieldset=language,origfieldval] + }%如果没有作者和标题,那么剩下的最可能有意义的只有网址了,而网址通常是英文的,因此不用再进一步对其它域进行判断了。 + \map{%将没有设置的language设置成en,即认为不是中文的就是英文的。 + \step[fieldset=language,fieldvalue={english}] + } + \map{%一条文献的语言已经设定在language域中,由于出版项相关宏中使用userd判断, + %所以将一条文献的主体语言设定到userd中,本身前面userd已经设定,但没有处理无标题的情况, + %这里的处理等价于没有标题时,利用作者的语言设定userd,再没有作者,则默认用英文设定userd + \step[fieldsource=language] + \step[fieldset=userd,origfieldval] + } + \map{%当文献给出language域时,设置文献要使用的本地化字符串的语言 + \step[fieldsource=language,match=\regexp{(e|E)(n|N)(g|G)(l|L)(i|I)(s|S)(h|H)},final] + \step[fieldset=langid,fieldvalue={english}] + } + \map{ + \step[fieldsource=language,match=\regexp{(r|R)(u|U)(s|S)(s|S)(i|I)(a|A)(n|N)},final] + \step[fieldset=langid,fieldvalue={russian}] + } + \map{% + \step[fieldsource=language,match=\regexp{(f|F)(r|R)(e|E)(n|N)(c|C)(h|H)},final] + \step[fieldset=langid,fieldvalue={french}] + } + \map{% + \step[fieldsource=language,match=\regexp{(c|C)(h|H)(i|I)(n|N)(e|E)(s|S)(e|E)},final]%中日韩语目前都用english, + \step[fieldset=langid,fieldvalue={english}] + } + \map{% + \step[fieldsource=language,match=\regexp{(j|J)(a|A)(p|P)(a|A)(n|N)(e|E)(s|S)(e|E)},final]%中日韩语目前都用english, + \step[fieldset=langid,fieldvalue={english}] + } + \map{% + \step[fieldsource=language,match=\regexp{(k|K)(o|O)(r|R)(e|E)(a|A)(n|N)},final]%中日韩语目前都用english, + \step[fieldset=langid,fieldvalue={english}] + } +} +} + + + % + % 修改输入的参考文献数据,样式层的操作 + % + % 原理方法:biblatex3.4以上版本map可使用foreach选项来处理特殊字符 + \DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map{%尝试未定义数据模型的standard类型映射为其他类型book或inbook, + %standard类型在blx-dm中有出现,但仅定义了类型,域和约束等都没有定义 + %因为可能要映射两种类型,所以不能在驱动层处理,因为要做判断 + \step[fieldsource=booktitle,final]%当存在booktitle域是映射为inbook + \step[typesource=standard, typetarget=inbook, final] + } + \map{%尝试未定义数据模型的standard类型映射为book,standard类型在blx-dm中有出现,但仅定义了类型,域和约束等都没有定义 + \step[typesource=standard, typetarget=book, final]%当不存在booktitle域是映射为book + } +% \map{%先于标准样式的driver层映射,将其先映射过来,并取消type设置 +% \step[typesource=mastersthesis, typetarget=thesis, final] +% %\step[fieldset=type, fieldvalue=mathesis] +% } +% \map{%先于标准样式的driver层映射,将其先映射过来,并取消type设置 +% \step[typesource=phdthesis, typetarget=thesis, final] +% %\step[fieldset=type, fieldvalue=phdthesis] +% } + \map{%先于标准样式的driver层映射,将其先映射过来,并取消type设置 + \step[typesource=techreport, typetarget=report, final] + %\step[fieldset=type, fieldvalue=techreport] + } + \map{% + \pertype{report} + \step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=report,typetarget=online] + \step[fieldset=note,fieldvalue={report}] + } + \map{% + \pertype{thesis} + \step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=thesis,typetarget=online] + } + \map{% + \pertype{manual} + \step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=manual,typetarget=online] + } + \map{% + \pertype{unpublished} + \step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=unpublished,typetarget=online] + } + \map{% + \pertype{database} + \step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=databasetypetarget=online] + } + \map{% + \pertype{dataset} + \step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=dataset,typetarget=online] + } + \map{% + \pertype{software} + \step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=software,typetarget=online] + } + \map{% + \pertype{map} + \step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=map,typetarget=online] + } + \map{% + \pertype{archive} + \step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=archive,typetarget=online] + } + \map[overwrite]{%这里还必须有overwrite,注意不同版本存在差异,比如texlive2015变16后biber有变化(20161207修改正确) + \step[fieldsource=note, final]%将note域信息复制给keywords,用于输出时容易区分标准和报纸 + \step[fieldset=keywords, fieldvalue={,}, append] + \step[fieldset=keywords, origfieldval, append] + } + \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{ + \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}] + } + \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{ + \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}] + } + \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,% + address,location,institution,organization}]{ + \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + } + } + +% +%驱动别名等价于驱动层映射 +% +\DeclareBibliographyAlias{newspaper}{article}% +\DeclareBibliographyAlias{inproceedings}{inbook}%会议论文文献类型驱动 +\DeclareBibliographyAlias{conference}{inbook}%会议论文文献类型驱动 +\DeclareBibliographyAlias{incollection}{inbook}%文集中析出文献类型驱动 +\DeclareBibliographyAlias{collection}{book}%%文集类型驱动 +\DeclareBibliographyAlias{proceedings}{book}%会议论文集文献类型驱动 +\DeclareBibliographyAlias{thesis}{manual}%学位论文驱动 +\DeclareBibliographyAlias{unpublished}{manual}%其它类型驱动 +\DeclareBibliographyAlias{database}{manual} +\DeclareBibliographyAlias{dataset}{manual} +\DeclareBibliographyAlias{software}{manual} +\DeclareBibliographyAlias{map}{manual} +\DeclareBibliographyAlias{archive}{manual} + + +%===================================================================== +% 参考文献表环境 +%===================================================================== +% +% 列表格式 +% +% 增加一个\bibitemindent尺寸用于控制list环境的itemindent +% v1.0l,20180615,hzz +\setlength{\bibhang}{\biblabelsep}% +\newlength{\bibitemindent} +\setlength{\bibitemindent}{0pt} + + +\defbibenvironment{bibliography} + {\list + {\printtext[labelnumberwidth]{% + \printfield{labelprefix}% + \printfield{labelnumber}}} + {\setlength{\labelwidth}{\labelnumberwidth}% + \setlength{\labelsep}{\biblabelsep}% + \setlength{\leftmargin}{\bibhang}% + \addtolength{\leftmargin}{\labelnumberwidth}% + \setlength{\itemindent}{\bibitemindent}% + \setlength{\itemsep}{\bibitemsep}% + \setlength{\parsep}{\bibparsep}}% + \renewcommand*{\makelabel}[1]{\hss##1}} + {\endlist} + {\item} + +% +% 顺序编码制-标签对齐方式处理 +% +% 原理方法:利用选项提供的计数器数值做选择 +% 左对齐,右对齐为list环境下的处理,此时list环境的\labelwidth只能设置一个,是最宽标签的宽度 +% 项对齐则是在段落环境下做的处理。 +% 左对齐时,参考文献各项内容对齐,序号标签与参考文献项内容的间距可变 +% 右对齐时,参考文献各项内容对齐,序号标签与参考文献项内容的间距相等,标签与页边距离可变 +% 项对齐时,序号标签贴在页边,序号标签与参考文献项内容的间距相等 +% 修改序号标签格式为: +% \DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}} %源来自numeric.BBX +% \DeclareFieldFormat{labelnumberwidth}{\ttfamily\mkbibbrackets{#1}\hfill} +\DeclareFieldFormat{labelnumberwidth}{% +\ifcase\value{gbalignlabel}%右对齐,整个标签为右对齐 + \mkgbnumlabel{#1}% +\or%左对齐,整个标签为左对齐 + \mkgbnumlabel{#1}\hfill% +\or%中间对齐,比如:序号数字居于[]中间 + \hfil\mkgbnumlabel{\hfill#1\hfill}\hfil% +\fi} + +% +% 修改序号标签格式为以各条参文献为基础进行对齐的方式,即序号与条目内容间隔相等的方式。 +\def\setaligngbstyle{% +\def\blx@bibitem##1{% + \blx@ifdata{##1} + {\begingroup + \blx@getdata{##1}% + \blx@bibcheck + \iftoggle{blx@skipentry}{}{% + \blx@setdefaultrefcontext{##1}% + \global\let\blx@noitem\@empty + \blx@setoptions@type\abx@field@entrytype + \blx@setoptions@entry + \blx@thelabelnumber + \addtocounter{instcount}\@ne + \blx@initsep + \blx@namesep + \csuse{blx@item@\blx@theenv}\relax +% \blx@initsep %移动到上面去,恢复bibnamesep等的作用机制 +% \blx@namesep + \csuse{blx@hook@bibitem}% + \blx@execute + \blx@initunit + \blx@anchor + \blx@beglangbib + \bibsentence + \blx@pagetracker + \blx@driver\abx@field@entrytype + \blx@postpunct + \blx@endlangbib}% + \par\endgroup}%这里增加了一个\par + {}} +\newlength{\lengthid} +\newlength{\lengthlw} +\newcommand{\itemcmd}{% +\settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} +\addtolength{\lengthid}{\biblabelsep} +\setlength{\lengthlw}{\textwidth} +\addtolength{\lengthlw}{-\lengthid} +\addvspace{\bibitemsep}%恢复\bibitemsep的作用 +%\parshape 2 0em \textwidth \lengthid \lengthlw +\hangindent\lengthid +\mkgbnumlabel{\printfield{labelnumber}}% +\hspace{\biblabelsep}} +% +% 简单的段落环境 +\defbibenvironment{bibliography} +{\begingroup\setlength{\parindent}{0em}} +{\endgroup} +{\itemcmd}} + + +%===================================================================== +% 设置单元或块等的标点 +%===================================================================== +\renewrobustcmd*{\bibinithyphendelim}{\addhighpenspace}%用于处理姓名中名部分存在-的情况,比如ZHANG Yu-xin +\renewcommand*{\subtitlepunct}{\addcolon\addspace} %修改标题和其它标题信息间的标点,来源biblatex.def, +% +% 利用set实现的多语言文献不同语言间的分隔符 +% 20170411,双语之间用newline替换par,避免采用gb7714-2015的项对齐方式第二语言间分段导致没有缩进 +% +% 原理方法:set方法可以参考3.11.5 Entry Sets,4.11.1 Entry Sets +% 这里调整一下两种语言参考文献的间隔,源来自biblatex.def +\renewcommand*{\entrysetpunct}{\adddot\newline\nobreak} +\renewcommand*{\bibpagespunct}{\addcolon\addthinspace}%%页码引用格式的修改,修改为用冒号 +%\renewcommand{\relateddelim}{}%\par + +%===================================================================== +% 修改域的格式,重定义域的输出宏 +%===================================================================== +% +% 新增文献类型标识符的格式 +% []前的nobreak,从GB4.1节的例子看不应该加,所以去掉 +% 但因为考虑到cjk字符和[]之间可能添加空格,所以仍然加上 +% 而[]中间的内容,从4.6.2节的例子看也是可以分割的,因此内部的nobreak也可以去掉 +% +\DeclareFieldFormat{gbtypeflag}{% +\iftoggle{bbx:url}% + {\iffieldundef{url}%当存在url时,增加一个OL标识符 + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}% + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}% + }% + {\ifentrytype{online}% + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}% + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}% + }% +} + +% +% 新增用于报纸的文献类型标识符的格式 +% +\DeclareFieldFormat{gbtypeflagn}{%用于报纸newspaper +\iftoggle{bbx:url}% + {\iffieldundef{url}%当存在url时,增加一个OL标识符 + {\nobreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% + {\nobreak\printtext{[}\nobreak N\printtext{\texttt{/}OL]}\nobreak}% + }% + {\nobreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% +} + +% +% 新增用于标准的文献类型标识符的格式 +% +\DeclareFieldFormat{gbtypeflags}{%用于标准standard +\iftoggle{bbx:url}% + {\iffieldundef{url}%当存在url时,增加一个OL标识符 + {\nobreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% + {\nobreak\printtext{[}\nobreak S\printtext{\texttt{/}OL]}\nobreak}% + }% + {\nobreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% +} + +% +% 重设title等参考文献信息的输出格式 +% +% 原理方法:修改来自biblatex.def文件的原格式 +\newcommand{\bibtitlefont}{} +\newcommand{\bibauthorfont}{} +\newcommand{\bibpubfont}{} + +% +% 作者信息的输出格式 +% +% 20180425,v1.0k,为作者增加字体控制命令,Hu Zhenzhen +% 20180603,v1.0l,增加使用nameformat域来选择姓名格式 +\DeclareNameFormat{namefmtselected}{% +\iffieldundef{namefmtid}{}% +{\defcounter{gbnamefmtcase}{\thefield{namefmtid}}}% +\ifcase\value{gbnamefmtcase}% + \ifgiveninits + {\usebibmacro{name:gbuppercase} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:gbuppercase} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or + \ifgiveninits + {\usebibmacro{name:gblowercase} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:gblowercase} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or + \ifgiveninits + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or + \ifgiveninits + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or +\usebibmacro{name:gbpinyin} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}% +\or + \ifnumequal{\value{listcount}}{1} + {\ifgiveninits + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% + \ifboolexpe{% + test {\ifdefvoid\namepartgiven} + and + test {\ifdefvoid\namepartprefix}} + {} + {\usebibmacro{name:revsdelim}}} + {\ifgiveninits + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}}% +\fi + \usebibmacro{name:andothers}} + +\DeclareNameAlias{default}{namefmtselected}%姓名的默认格式采用可选的模式 +\DeclareNameAlias{sortname}{default}% Used in the bibliography %family-given/given-family +\DeclareNameAlias{citename}{default}% Default used by \citename + +\DeclareDelimFormat[bib,biblist]{andothersdelim}{\addcomma\addspace} +%\DeclareDelimFormat[textcite]{andothersdelim}{\addspace}% + +%GB/T 7714-2015 风格,全部大写 +\newbibmacro*{name:gbuppercase}[4]{\bibauthorfont% +\renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 +\renewcommand*{\revsdnamepunct}{}% + \ifuseprefix% + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifdefvoid{#3}{}{% + \ifcapital% + {\mkbibnameprefix{\MakeCapital{#3}}\isdot}% + {\mkbibnameprefix{#3}\isdot}% + \ifprefchar{}{\bibnamedelimc}}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{\MakeUppercase{#2}}\isdot}%\MakeCapital + \ifdefvoid{#4}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}%后缀前加逗号 + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifboolexpe{% + test {\ifdefvoid{#2}} + and + test {\ifdefvoid{#3}}} + {}{\revsdnamepunct}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{\MakeUppercase{#2}}\isdot}%\MakeCapital + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}% + \ifdefvoid{#4}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}%%后缀前加逗号 +} + +%GB/T 7714-2015 风格,大小写不变,根据bib文件内输入原样输出 +\newbibmacro*{name:gblowercase}[4]{\bibauthorfont% + \renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 + \renewcommand*{\revsdnamepunct}{}%%来源biblatex.def + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifdefvoid{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifprefchar{}{\bibnamedelimc}}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{{#1}}}\isdot% + \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{{#2}}\isdot}%\MakeCapital + \ifdefvoid{#4}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}%后缀前加逗号 + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{{#1}}}\isdot% + \ifboolexpe{% + test {\ifdefvoid{#2}} + and + test {\ifdefvoid{#3}}} + {}{\revsdnamepunct}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{{#2}}\isdot}%\MakeCapital + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot} + \ifdefvoid{#4}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}%%后缀前加逗号 +} + +%中文常见风格,汉语拼音全拼模式 +\newbibmacro*{name:gbpinyin}[4]{\bibauthorfont% +\renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉,%来源biblatex2.STY +\renewcommand*{\revsdnamepunct}{}%%来源biblatex.def +\renewrobustcmd*{\bibnamedelima}{\mbox{-}}% + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifdefvoid{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifprefchar{}{\bibnamedelimc}}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\MakeSentenceCase{\mkbibnamegiven{#2}}\isdot}%\MakeCapital + \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}} + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifboolexpe{% + test {\ifdefvoid{#2}} + and + test {\ifdefvoid{#3}}} + {} + {\revsdnamepunct}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{\MakeCapital{#2}}\isdot}%\MakeCapital + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot} + \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}% +} + + +\def\UrlFont{\rmfamily}%设置url字体为roman字体%\ttfamily +%\urlstyle{rm} %使用这句也一样 +\setcounter{biburlnumpenalty}{100} %让url可以在数字后断行 +\setcounter{biburlucpenalty}{100} %让url可以在大写字母后断行 +\setcounter{biburllcpenalty}{100} %让url可以在小写字母后断行 +\DeclareFieldFormat{doi}{% + \rmfamily{DOI}\addcolon\space + \ifhyperref + {\href{https://doi.org/#1}{\nolinkurl{#1}}} + {\nolinkurl{#1}}} + +\DefineBibliographyExtras{english}{\renewcommand*{\bibrangedash}{-}}%将页码间隔符替换会英文的短横线 + +% +% beamer中文献标题后的标点问题 +% v1.0k,20180405,为texlive2017以上版本中的beamer兼容性做的处理,Hu Zhenzhen +% +% 原理方法:如下代码处理texlive2017以上版本中,beamer中文献的标题后出现两个点的情况: +% texlive2017以上的beamer中对macro{title}做了patch,正常情况下不会出现两个点的情况,但由于 +% 之前为了处理texlive2015,2016下的title格式添加了adddot,导致出现两个点的情况,而且也影响 +% 析出文献的//符号的输出,因此再次对macro{title}做patch消除beamer中做apptocmd时添加的\newunitpunct +\@ifclassloaded{beamer}{ + \DeclareFieldFormat{title}{#1}% + \DeclareFieldFormat[article,patent,thesis,unpublished]{title}{#1} + \AtBeginDocument{% + \patchcmd{\abx@macro@title}{\newunitpunct}{}{}{}}}{} + + + % + % 专利的公告日期、或报纸的日期的输出宏 + % 20160701,v1.0,新增加 + % 20180405,为biblatexv3.10版本,出现多出点bug做处理,Hu Zhenzhen + % + % 原理方法:加上printtext避免破坏异步标点机制 + % 本可以用\printdate,但由于date选项设置为year,所以仅会给出年份 + % 所以无法再用选项设置的方法,印象需要用底层的命令 + % 这里可以用\blx@isodate,但用自定义的\blx@gbdate,以避免版本判断 + \newbibmacro*{newsdate}{%% + \printtext{\blx@gbdate{}{}}%%\blx@isodate{}{}% + } + + \newbibmacro*{modifydate}{%新增加一个带括号的日期,用于表示电子资源的更新和修改日期,而公告日期则按日期格式 + \ifboolexpr{% + test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% + }% + {}%更新或修改日期通常有day信息 + {\iffieldundef{year}{% + \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{(}\printeventdate\printtext{)}}}% + {\printtext{(}\printenddate\printtext{)}}% + }{\iffieldequalstr{year}{}{%因为year存在,但为空 + }{\printtext{(}\blx@gbdate{}{}\printtext{)}}% + }% + }}% + + + % + % biblatex>v3.8版利用related实现双语文献的处理 + % + %为了实现v3.8以上版本的双语文献,采用related的方法代替set方法,因为set方法已经无法实现了, + %因为set不再复制其第一个成员的信息。于是定义一个命令,用于动态的修改数据,即添加related域的信息 + %其中使用了\DeclareStyleSourcemap,但由于其只能出现在导言区中,因此\defdoublelangentry命令也只能出现在导言区中 + \newcommand{\defdoublelangentry}[2]{% + \edef\entrykeya{#1} + \edef\entrykeyb{#2} + \DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map{ + \step[fieldsource=entrykey, match=\entrykeya, final] + \step[fieldset=related, fieldvalue=\entrykeyb] + } + } + } + } + + % 关联文献的输出格式 + % + % 关联文献间的分隔符 + % + \renewcommand{\relateddelim}{\adddot\newline\nobreak}%\par,而作者年样式不需要修改,因为没有项对齐的标签问题 + % + % 关联文献块前的分隔符,针对biblatex>3.11 + % + % 原理方法:因为增加了begrelateddelim钩子,所以不需要重定义related输出宏 + \ifdef{\begrelateddelim}{\renewcommand{\begrelateddelim}{\adddot\newline\nobreak}}{} + + + +% +% 新增一个样式用于调整期刊年份的格式,只打印年份 +% +\newbibmacro*{periodical+issue}{% + \printtext{%去掉了[parens] + \iffieldundef{issue} + {%\usebibmacro{date}%修改为下一句 + }% + {\printfield{issue}% + \setunit*{\addspace}% + %\usebibmacro{date}%修改为下一句 + }% + }% + %\newunit +} + +% +% 重设专利title的输出,将文献类型标识符输出出去 +% +\renewbibmacro*{patenttitle}{%原输出来自biblatex.def文件 + \ifboolexpr{% + test{\iffieldundef{title}}% + and% + test{\iffieldundef{subtitle}}% + }% + {}% + {\printtext[title]{\bibtitlefont% + \printfield[titlecase]{title}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct}% + \printfield[titlecase]{subtitle}}% + \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 + {\setunit{\subtitlepunct}\printfield{titleaddon}}% + \setunit{\subtitlepunct}\printfield{number}%写专利号 + \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}% + %\iffieldundef{booktitle}{\newunit}{}%当title是析出时,不要标点 + %\newunit + }% +}% +} + +% +% 编者类型的本地化字符串输出 +% v1.0q 2019-03-01 hzz +% 能对不同条目类型作格式设置的域格式,能对不同环境做格式设置的分隔符 +% 能对不同文境作设置的包括排序,标签等 +% 这里因为考虑可能标注和文献表中存在不同,所以用分隔符来输出本地化字符串 +% +\DeclareDelimFormat{streditortypes}{% + \edef\userfieldabcde{userd}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{\thefield{editortype}scn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{\thefield{editortype}skr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{\thefield{editortype}sjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}% + \or% + \bibstring{\thefield{editortype}scn}% + \or% + \addcomma\addthinspace\bibstring{\thefield{editortype}s}% + \fi}% +% +\DeclareDelimFormat{streditortype}{% + \edef\userfieldabcde{userd}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{\thefield{editortype}cn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{\thefield{editortype}kr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{\thefield{editortype}jp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}% + \or% + \bibstring{\thefield{editortype}cn}% + \or% + \addcomma\addthinspace\bibstring{\thefield{editortype}}% + \fi}% + + +% +% 修改series域的输出格式 +% 2019.05.01,v1.0r,byhzz +\renewbibmacro*{series+number}{% + \printfield{series}% + %\setunit*{\addspace}% + %\printfield{number}% + %\newunit + } + +%===================================================================== +%设置驱动格式 +%===================================================================== + +%中文环境的局部化代码 +\def\localsetchinesecode{% +\ifboolexpr{% +togl{bbx:gbstyle} or test {\iffieldequalstr{userd}{chinese}}% +}% +{% +\iftoggle{bbx:gbfieldstd}{}{% +\DeclareFieldFormat{title}{##1\adddot\addthinspace}% +\DeclareFieldFormat{journaltitle}{##1\isdot}%添加\isdot用于缩写名带点情况,将其转换为缩写点,便于标点的追踪 +\DeclareFieldFormat{issuetitle}{##1}% +\DeclareFieldFormat{maintitle}{##1}% +\DeclareFieldFormat{booktitle}{##1}% +\DeclareFieldFormat%将期刊等文献的标题中原来带的引号去掉 + [article,patent,thesis,unpublished]% + {title}{##1\adddot\addthinspace}%\mkbibquote{##1\isdot} +\DeclareFieldFormat%将期刊等文献的标题中原来带的引号去掉 + [inbook,incollection,inproceedings]% + {title}{##1}%\nopunct\unspace +\DeclareFieldFormat{url}{\url{##1}}%%url相关输出,url域修改如本行,源来自biblatex.def +% +% 标题的字母大小写格式修改 +% +% 注意:修改标题的字母大小写,不能用前面的title的格式而要用titlecase +% 因为titlecase is applied to the contents of the field directly,title is not +%\DeclareFieldFormat{titlecase}{\MakeCapital##1}%重设标题格式,将其修改为首字母大写 +\DeclareFieldFormat{titlecase}{\iftoggle{bbx:titlelink}{% +\iffieldundef{url}{\MakeCapital##1}{% +\href{\thefield{url}}{##1}}}{\MakeCapital##1}}%重设标题格式,将其修改为首字母大写 +\DeclareFieldFormat{pages}{##1}%去掉前面引导页码的pp.等字符,\mkpageprefix[bookpagination]{##1} +}% +% +% 修改译者位置格式 +% +% 原理方法:修改来自biblatex.def文件的bytranslator+others宏的格式 +\renewbibmacro*{bytranslator+others}{% + \ifnameundef{translator}% + {}% + {%\usebibmacro{bytranslator+othersstrg} + %\setunit{\addspace}% + \printnames[bytranslator]{translator}% + \clearname{translator}% + %从macro*{bytranslator+othersstrg}%中可以看到当地化字符串格式的引用前的代码处理 + %比如生成cotranslator等用于调用cotranslator所代表的当地化字符串 + \usebibmacro{bytranslator+othersstrg}%“译”的位置换到下面来,即放到译者后面。 + %\setunit{\addspace}% + \newunit}% + \usebibmacro{withothers}}% +% +% 修改作者数量超过限定值,做省略时的处理格式 +% v1.0,20160701,hzz +% v1.0O,20190103,hzz,修改利用新定义的一个分隔符strandothersdelim +% +% 原理方法:判断作者或译者是否中文,若中文用字符等,否则用et al. 。 +\renewbibmacro*{name:andothers}{% + \ifboolexpr{% + test {\ifnumequal{\value{listcount}}{\value{liststop}}}% + and + test \ifmorenames + }{\ifnumgreater{\value{liststop}}{1}% + {\finalandcomma}% + {}% +\printdelim{andothersdelim}\printdelim{strandothersdelim}% +}{%当是译者的时候需要特殊处理:从7.2节看等,译前面加逗号,但从示例看等和译同时出现时,译前的逗号没有,比如: +%袁训来, 陈哲, 肖书海, 等. +%胡泳, 范海燕, 译. +%潘惠霞, 魏婧, 杨艳, 等译. +\ifcurrentname{translator}{\addcomma\addthinspace}{}%为了实现上述第二个示例情况做的处理 +}}% +% +% 修改省略作者后的本地化字符串,比如et al. +% v1.0o,20190103,hzz +% +% 原理方法:默认情况下判断作者或译者是否中文,若中文用字符andotherscn=“等”,否则用andothers=“et al.”。 +% 非默认情况,根据选项信息,选择选择强制中文或英文 +% 首先设置全局的,然后设置文献表中的,这一等价于将所有的cite命令环境都设置过了 +% 而不用对每一个引用命令单独设置,比如cite,parancite,textcite都设置 +\DeclareDelimFormat{strandothersdelim}{% + \edef\userfieldabcde{userd}% + \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andotherscn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andotherskr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andothersjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\bibstring{andothers}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{andothers}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{andothers}}{}% + \or% + \bibstring{andotherscn}% + \or% + \bibstring{andothers}% + \fi}% +% +% 修改最后一个作者前的字符串,比如 and +% v1.0o,20190103,hzz +% +% 原理方法:默认情况下判断作者或译者是否中文,若中文用字符andcn=“和”,否则用and=“and”。 +% 非默认情况,根据选项信息,选择选择强制中文或英文 +% 首先设置全局的,然后设置文献表中的,这一等价于将所有的cite命令环境都设置过了 +% 而不用对每一个引用命令单独设置,比如cite,parancite,textcite都设置 +\DeclareDelimFormat{finalnamedelim}{% + \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% + \addspace% + \edef\userfieldabcde{userd}% + \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andcn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andkr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\bibstring{and}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{and}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{and}}{}% +\space% + \or% + \bibstring{andcn}\space% + \or% + \bibstring{and}\space% + \fi}% +% +% url和url日期格式 +% + \renewbibmacro*{url+urldate}{% + %\usebibmacro{url}%%更换url的位置,放到下面 + \iffieldundef{urlyear}% + {}{%\setunit*{\addspace}% + \usebibmacro{urldate}}% + \setunit{\addperiod\addspace}% + \usebibmacro{url}}% + \renewbibmacro*{url}{\printfield{url}}% +% +% 重设title的输出 +% +% 20180425,v1.0k,为标题增加字体控制命令,Hu Zhenzhen +% 原理方法:将文献类型标识符输出出去,原输出来自biblatex.def文件 +% 利用toggle做标识符是否输出的判断 +\renewbibmacro*{title}{% + \ifboolexpr{% + test{\iffieldundef{title}}% + and + test{\iffieldundef{subtitle}}% + }% + {}% + {\printtext[title]{\bibtitlefont%增加字体控制命令 + \printfield[titlecase]{title}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct}% + \printfield[titlecase]{subtitle}}% + \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 + {\setunit{\subtitlepunct}\printfield{titleaddon}}% + \iftoggle{bbx:gbtype}{% + \iffieldundef{note}{\printfield[gbtypeflag]{usera}}%在标题后直接给出文献标识字母,判断一下,是否是报纸和标准 + {\iffieldequalstr{note}{standard}{\printfield[gbtypeflags]{usera}}%判断是否为标准 + {\iffieldequalstr{note}{news}{\printfield[gbtypeflagn]{usera}}%判断是否为报纸 + {\printfield[gbtypeflag]{usera}}}%其它 + }}{}% + %\iffieldundef{booktitle}{\newunit}{}%当title是析出时,不要标点 + %\newunit +}% +}}% +% +% 日期信息的输出格式,针对biblatex<3.7版本 +% +\DeclareFieldFormat{urldate}{##1}% +\renewbibmacro*{urldate}{% +\addthinspace\printtext{[}\printurldate\printtext{]}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令 +% +% 调整doi+eprint+url格式 +% +% 原理方法:源来自standard.bbx,因为页码后面直接跟引用日期,没有标点所以去掉其中的标点。 +\renewbibmacro*{doi+eprint+url}{% +% \iftoggle{bbx:doi}%把doi的位置放到url后面 +% {\printfield{doi}} +% {}% + %\newunit\newblock + \iftoggle{bbx:eprint} + {\iffieldundef{eprint}{}{\newunit\usebibmacro{eprint}}} + {}% + %\newunit\newblock + \iftoggle{bbx:url} + {\usebibmacro{url+urldate}} + {} + \newunit\newblock + \iftoggle{bbx:doi} + {\printfield{doi}} + {}}% +% +% 调整页码的格式,即chapter+pages格式 +% +\renewbibmacro*{chapter+pages}{% +\iftoggle{bbx:gbstrict}{}{% + \printfield{chapter}}% + \iffieldundef{pages}{}{%这里增加一个判断,当没有页码时就不输出 + \setunit{\bibpagespunct}% + \printfield{pages}}% + %\newunit %这里的标点去掉 +}% +% +% 当location等出版项超过maxitem缩减后不再输出etal +% +\DeclareListFormat{location}{% + \usebibmacro{list:delim}{##1}% + ##1\isdot}% +\DeclareListAlias{institution}{location}% +\DeclareListAlias{publisher}{location}% +% 新增一个样式用于输出连续出版物的地址,单位,时间, +% 用于periodical连续出版物的出版社和地址的处理 +% +% v1.0k,20180425,为出版信息增加字体控制命令,hzz +% %类似\newbibmacro*{publisher+location+date} +\newbibmacro*{location+institution+date}{\bibpubfont% +\iftoggle{bbx:gbpub}% +{\testCJKfirst{userd}% +\ifboolexpr{% +test {\iflistundef{location}} and test {\iflistundef{institution}}% +}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}% +{\printtext{[S.l.\space :\space s.n.\adddot]}}% +}{% +\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}}{\printtext{[S.l.\adddot]}}}% + {\printlist{location}}% +\addcolon\addspace% +\iflistundef{institution}{% +\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}}{\printtext{\mkbibbrackets{s.n.}}}}% \bibstring{nopublisher}%[s.n.\adddot] +{\printlist{institution}}}% +\setunit{\addcomma\addspace}% + %\usebibmacro{date}% + \printfield{year}% + \bibrangedash% + \iffieldundef{endyear}{}{\printfield{endyear}}% + \newunit}% +{\printlist{location}% + \iflistundef{institution}% + {\setunit*{\addcomma\space}} + {\setunit*{\addcolon\space}}% + \printlist{institution}% + \setunit*{\addcomma\space}% + \usebibmacro{date}% + \newunit}% +}% +% +% 通用的出版社和地址的处理 +% +% 原理方法:当没有出版社地址时,直接判断title的信息是否是中文,若为中文,则写出版地不详,否则用英文的字符表示。 +% 事实上title对于每个文献来说是必须的,所以用它判断是最快的,而且一般标题和出版社的语言是一样的。 +% 注意标准standard类型,因为当没有出版项时直接省略,所以做特殊处理 +\renewbibmacro*{publisher+location+date}{\bibpubfont% +\iftoggle{bbx:gbpub}% +{\testCJKfirst{userd}% + \ifboolexpr{ test {\iflistundef{location}} and test {\iflistundef{publisher}} }% + {\iffieldequalstr{note}{standard}{}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}{\printtext{[S.l.\space :\space s.n.\adddot]}}}}% + {\iflistundef{location}{%\adddot + \iffieldequalstr{note}{standard}{}%%从gbt7714-2015标准第19页看到,标准存在出版项时输出,没有时完全省略。 + {\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}\addcolon\addspace}{\printtext{[S.l.\adddot]}\addcolon\addspace}}}% \bibstring{noaddress} + {\printlist{location}\addcolon\addspace}%%\addcolon\addspace% + \iflistundef{publisher}{% + \iffieldequalstr{note}{standard}{}% + {\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}% + {\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}}}% + {\printlist{publisher}}}% +\setunit*{\addcomma\addspace}%\addcomma\addspace% +\usebibmacro{date}%%\newunit %去掉这个标点 +}% +{\printlist{location}% + \iflistundef{publisher} + {\setunit*{\addcomma\space}} + {\setunit*{\addcolon\space}}% + \printlist{publisher}% + \setunit*{\addcomma\space}% + \usebibmacro{date}%%\newunit + }% +}% +% +% 修改了一个institution+location+date用于manual、report、thesis等类型 +% +% 20180425,v1.0k,增加了字体控制命令,hzz +% 20190105,v1.0o,加了一个编组避免\usebibmacro{date}把month和day信息去掉 +\renewbibmacro*{institution+location+date}{\bibpubfont%当没有institution时不处理。 +{\printlist{location}%%加了一个编组避免\usebibmacro{date}把month和day信息去掉 + \iflistundef{institution} + {\setunit*{\addcomma\space}} + {\setunit*{\addcolon\space}}% + \printlist{institution}% + \setunit*{\addcomma\space}% + \usebibmacro{date}% + %\newunit + }}% +% +% 对volume卷信息格式做出修改 +% v1.0o,20190105,hzz +% +\DeclareFieldFormat{volume}{% +\testCJKfirst{userd}% +\iftoggle{ifCJKforgbt}% +{\bibstring{serialcn}##1\bibstring{volumecn}}% +{\bibstring{volume}~##1}% +}% volume of a book +\DeclareFieldFormat[article,periodical]{volume}{##1}% volume of a journal +% +% 对number册信息格式做出修改 +% v1.0o,20190105,hzz +% +\DeclareFieldFormat{number}{##1}% +\DeclareFieldFormat[book,collection,inbook,% +incollection,proceedings,inproceedings]{number}{% +\testCJKfirst{userd}% +\iftoggle{ifCJKforgbt}% +{\bibstring{serialcn}##1\bibstring{numbercn}}% +{##1}% +}% +% +% 对edition版本信息格式做出修改 +% +\DeclareFieldFormat{edition}{%源来自biblatex.DEF +\testCJKfirst{userd}% +\iftoggle{ifCJKforgbt}% +{\ifinteger{##1}% +{\printtext{##1\str@edition}}% +{##1\isdot}}% +{\ifinteger{##1}% +{\mkbibordedition{##1}~\bibstring{edition}}% +{##1\isdot}}}% +% +% 对version的版本信息做出修改 +% +\DeclareFieldFormat{version}{%源来自biblatex.DEF +\testCJKfirst{userd}% +\ifinteger{##1}% +{\iftoggle{ifCJKforgbt}{\printtext{##1\str@edition}}% +{\mkbibordedition{##1}~\bibstring{version}}}% +{##1\isdot}}% +% +% 修改析出文献的文集的标题与附加标题间的符号 +% +\renewbibmacro*{booktitle}{% + \ifboolexpr{% + test {\iffieldundef{booktitle}} + and + test {\iffieldundef{booksubtitle}} + }% + {}% + {\printtext[booktitle]{\bibtitlefont% + \printfield[titlecase]{booktitle}% + \setunit{\subtitlepunct}% + \printfield[titlecase]{booksubtitle}}% + \newunit%标点换成下一句 + \setunit{\subtitlepunct}}% + \printfield{booktitleaddon}}% +% +% 调整期刊名的格式 +% +% v1.0k,20180425,增加了字体控制命令,hzz +\renewbibmacro*{journal+issuetitle}{\bibpubfont%源来自standard.bbx + \usebibmacro{journal}% + %\setunit*{\addspace}% + \setunit*{\addcomma\addspace}%修改为增加一个逗号 + \iffieldundef{series} + {} + {\newunit + \printfield{series}% + \setunit{\addspace}}% + %\usebibmacro{volume+number+eid}% + %\setunit{\addspace}% + \usebibmacro{issue+date}% + %\setunit{\addcolon\space}% + \iffieldundef{volume}{}{\setunit{\addcomma\space}}% + %换成逗号和空格 + \usebibmacro{issue}% + \usebibmacro{volume+number+eid}%把卷期放到年份后面 + %\newunit + }% +% +% 调整期刊卷和期的格式 +% +\renewbibmacro*{volume+number+eid}{%源来自standard.bbx +\iftoggle{bbx:gbfieldstd}{% + \printfield{volume}% + \setunit*{\adddot}% + \printfield{number}% + \setunit{\addcomma\space}% + \printfield{eid}}{% + \printfield{volume}% + %\setunit*{\adddot}%去掉点号 + %\printfield{number}% + \iffieldundef{number}{}{\printtext{\mkbibparens{\printfield{number}}}}%增加一个圆括号 + \iffieldundef{eid}{}{% + \setunit{\addcomma\space}% + \printfield{eid}}}}% +% +% 调整期刊年份的格式 +% +\renewbibmacro*{issue+date}{%去掉括号 + \printtext{%去掉了[parens] + \iffieldundef{issue} + {%\usebibmacro{date} + \iffieldundef{note}{\usebibmacro{date}}%判断一下,是否是报纸 + {\iffieldequalstr{note}{news}{\usebibmacro{newsdate}}%判断是否为报纸 + {\usebibmacro{date}}% + }}% + {\iftoggle{bbx:gbstrict}{}{\printfield{issue}% + \setunit*{\addspace}}% + %\usebibmacro{date} + \iffieldundef{note}{\usebibmacro{date}}%判断一下,是否是报纸 + {\iffieldequalstr{note}{news}{\usebibmacro{newsdate}}%判断是否为报纸 + {\usebibmacro{date}}% + }}}% + %\newunit + }% +% +% 调整页码前的标点和去掉期刊文章等页码后面的标点 +% +\renewbibmacro*{note+pages}{%源来自standard.bbx + %\printfield{note}%不要note,note用来判断是否是报纸newspaper + \iffieldundef{pages}{}{% + \setunit{\bibpagespunct}% + \printfield{pages}}% + %\newunit + }% +% +% 编者的符号修改一下 +% v1.0 2016-07-01 +% v1.0q 2019-03-01 hzz 修改editortype前的标点 +% +\renewbibmacro*{editor}{%源来自biblatex.DEF + \ifboolexpr{% + test \ifuseeditor + and + not test {\ifnameundef{editor}}% + }% + {\printnames{editor}% + \iffieldundef{editortype}%增加一个类型判断,用于存在editortype的情况 + {\setunit\addspace}%当没有editortype时,直接用句点 + {%\setunit{\addcomma\space}% + \usebibmacro{editorstrg}}% + %\clearname{editor} + }% + {}}% +% +% 编者类型做一修改 +% v1.0 2016-07-01 +% v1.0q 2019-03-01 hzz 修改editortype不同语言的不同本地化字符串 +% +\renewbibmacro*{editorstrg}{%源来自biblatex.DEF + \printtext[editortype]{% + \iffieldundef{editortype}% + {% +% \ifboolexpr{ %这一段去掉,未定义编者类型情况下不处理 +% test {\ifnumgreater{\value{editor}}{1}} +% or +% test {\ifandothers{editor}} +% } +% {\bibstring{editors}} +% {\bibstring{editor}} + }% + {\ifbibxstring{\thefield{editortype}}%定义编者类型情况下处理,以后根据需要修改 + {\ifboolexpr{% + test {\ifnumgreater{\value{editor}}{1}}% + or + test {\ifandothers{editor}}% + }% + {\printdelim{streditortypes}}% + {\printdelim{streditortype}}}% + {\thefield{editortype}}}% + }}% +% +% bookauthor域的输出, +% v1.0q 2019-03-01 hzz +% 不再对editor和bookauthor做sourcemap,而是下面的宏内逻辑代替, +% 使得除使用bookauthor外也可以使用editor,便于在使用editor时使用editortype +\renewbibmacro*{bybookauthor}{% + \ifnameundef{bookauthor}% + {\ifnameundef{editor}% + {}% + {\ifnamesequal{author}{editor}% + {}{\usebibmacro{editor}}}% + }% + {\ifnamesequal{author}{bookauthor}% + {}{\printnames{bookauthor}}% + }% +}% +% +% 修改期刊的标题 +% +\renewbibmacro*{periodical}{%源来自biblatex.DEF + \iffieldundef{title} + {}% + {\printtext[title]{\bibtitlefont% + \printfield[titlecase]{title}% + %\setunit{\subtitlepunct}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct} + \printfield[titlecase]{subtitle}}% + %}%把编组结束移到后面去 + \iftoggle{bbx:gbtype}{% + \iffieldundef{usera}{}{%在标题后直接给出文献标识字母 + \printfield[gbtypeflag]{usera}}}{}% + }}% + }% +% +% 期刊的标题做修改 +% +\renewbibmacro*{title+issuetitle}{%源来自standard.BBX + \usebibmacro{periodical}% + %\setunit*{\addspace}% + \setunit*{\adddot\addspace}%标点修改为句点 + \iffieldundef{series} + {}% + {\newunit + \printfield{series}% + \setunit{\addspace}}% + \usebibmacro{periodical+issue}%将issue调整到上面来,并修改 +\iffieldundef{number}{}{%%进一步处理有范围的数字 + \multinumberparser{\thefield{number}}}% + \iffieldundef{volume}% + {\printfield{year}% + \printtext{\mkbibparens{\multinumberfirst}}% + \bibrangedash% + \iffieldundef{endyear}{}{\printfield{endyear}\printtext{\mkbibparens{\multinumbersecond}}}% + }% + {\multivolparser{\thefield{volume}}% + \printfield{year}% + \setunit{\addcomma\space}%将冒号修改为逗号 + \printtext{\multivolfirst}% + \printtext{\mkbibparens{\multinumberfirst}}% + \bibrangedash% + \iffieldundef{endyear}{}{% + \printfield{endyear}% + \setunit{\addcomma\space}%将冒号修改为逗号 + \printtext{\multivolsecond}% + \printtext{\mkbibparens{\multinumbersecond}}}% + }% + \setunit{\addcomma\space}% + \printfield{eid}% + \setunit{\addspace}% + %\usebibmacro{issue+date}% + %\setunit{\addcolon\space}% + \usebibmacro{issue}% + \newunit}% +% +% 修改in:用于inbook、incollection、inproceedings等类型 +% 2018.04.20,v1.0k,renewed marco,by hzz +% 20190212,v1.0q,增加中英文区分,by hzz +% +% 原理方法:使用bibmacro{in:}改变了以前在driver中直接输出//的方式,同时也简化了标点控制。 +\renewbibmacro*{in:}{% + \iftoggle{bbx:gbpunctin}{\printtext{\texttt{//}\allowbreak}}%\addthinspace + {\setunit{\adddot\addspace}% + \iffieldequalstr{userd}{chinese}% + {\printtext{\bibstring{incn}}}% + {\printtext{\bibstring{in}}}% + }}%\newunit\newblock\intitlepunct +% +% 修改type域的输出格式 +% 2019.02.12,v1.0q,byhzz +% 使其可以区分中英文输出不同的格式,比如博士论文英文输出PHD thesis,中文则是博士学位论文 +\DeclareFieldFormat{type}% +{\iffieldequalstr{userd}{chinese}% + {\ifbibxstring{##1cn}{\bibxstring{##1cn}}{##1}}% + {\ifbibstring{##1}{\bibstring{##1}}{##1}}% +}% +% +% book条目类的驱动 +% +\csdef{blx@bbx@book}{%%源来自standard.bbx文件 + \usebibmacro{bibindex}% + \usebibmacro{begentry}% +\usebibmacro{author/editor+others/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\usebibmacro{maintitle+title}% +\iftoggle{bbx:gbstrict}{}{% +\newunit +\printlist{language}% +\newunit\newblock% +\usebibmacro{byauthor}% +\newunit\newblock}% +\usebibmacro{byeditor+others}% +\newunit +\printfield{edition}% +\newunit\newblock%% +\iftoggle{bbx:gbstrict}{}{% +\iffieldundef{maintitle}% +{\printfield{volume}% +\printfield{part}}% +{}% +\newunit% +\printfield{volumes}% +\newunit\newblock% +\usebibmacro{series+number}}% +\newunit\newblock% +%\printfield{note}% +%\newunit\newblock% +\usebibmacro{publisher+location+date}% +%\newunit\newblock %这里标点去掉 +\usebibmacro{chapter+pages}% + \iffieldundef{url}{}{%当没有网址时也不输出 + \usebibmacro{modifydate}}%带括号的修改或更新日期, +\usebibmacro{doi+eprint+url}%从下面移动到上面来,因为gbt2015的url需直接放在页码后面。 + \newunit\newblock% + \printfield{pagetotal}% + \newunit\newblock% + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock + %\usebibmacro{doi+eprint+url}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}}% +% +% 期刊文章,连续出版物中的析出文献的格式 +% +\csdef{blx@bbx@article}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{bytranslator+others}% + \newunit\newblock + \printfield{version}}% + \newunit\newblock + %\usebibmacro{in:}% 不使用in来表示期刊等连续出版物 + \usebibmacro{journal+issuetitle}% + %\newunit +% \usebibmacro{byeditor+others}% +% \newunit + \usebibmacro{note+pages}% + \iffieldequalstr{note}{news}{}{%当是新闻时不输出修改或更新日期 + \iffieldundef{url}{}{%当没有网址时也不输出 + \usebibmacro{modifydate}}}%带括号的修改或更新日期, + \usebibmacro{doi+eprint+url}%从后面移上来,调整url和页码之间的位置 + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{issn}} + {}% + \newunit\newblock + %\usebibmacro{doi+eprint+url}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}}% +% +% 连续出版物的驱动 +% +\csdef{blx@bbx@periodical}{%源来自standard.BBX + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{editor}% + %\setunit{\labelnamepunct}\newblock + \newunit\newblock %删除上面一行,添加这一行 + \usebibmacro{title+issuetitle}% + \newunit\newblock% + \usebibmacro{location+institution+date}%添加这一行用于输出地址,单位和时间 + \newunit\newblock%添加这一行 + \iftoggle{bbx:gbstrict}{}{% + \printlist{language}% + \newunit\newblock + \usebibmacro{byeditor}% + \newunit\newblock + \printfield{note}% + \newunit\newblock} + \iftoggle{bbx:isbn} + {\printfield{issn}} + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}}% +% +% 专利文献驱动 +% +\csdef{blx@bbx@patent}{%源来自standard.BBX + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + %\usebibmacro{title}% + \usebibmacro{patenttitle}%给出专利专用的标题输出 + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \printfield{type}% + \setunit*{\addspace}% + %\printfield{number}%已放到patenttitle中处理 + \iflistundef{location} + {} + {\setunit*{\addspace}% + \printtext{%[parens] + \printlist[][-\value{listtotal}]{location}}}% + \newunit\newblock + \usebibmacro{byholder}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \usebibmacro{newsdate}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}}% +% +% 在线文献驱动 +% +\csdef{blx@bbx@online}{%源来自standard.BBX + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{note}}% + \newunit + \printfield{version}% + \newunit\newblock +%\printlist{organization}% + \printlist{institution}% + \newunit\newblock +\ifboolexpr{% +test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% +}{\usebibmacro{date}}% +{\usebibmacro{modifydate}}%修改或更新日期,为带括号的时间 + \usebibmacro{url+urldate}%从下面移上来 + \newunit\newblock + \iftoggle{bbx:eprint} + {\usebibmacro{eprint}} + {}% + \newunit\newblock + %\usebibmacro{url+urldate}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}}% +% +% 报告类型驱动 +% 2016-11-11,增加了译者信息 +% +\csdef{blx@bbx@report}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \usebibmacro{byeditor+others}%增加的译者信息 + \newunit\newblock + \printfield{type}% + \setunit*{\addspace}% + \printfield{number}% + \newunit\newblock + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + \usebibmacro{doi+eprint+url}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isrn}} + {}% + \newunit\newblock +% \usebibmacro{doi+eprint+url}% +% \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}}% +% +% 手册类型驱动 +% 2016-11-11,增加了译者信息 +% +% +\csdef{blx@bbx@manual}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \usebibmacro{byeditor+others}%增加的译者信息 + \newunit\newblock + \iftoggle{bbx:gbfieldtype}{% + \printfield{type}% + \setunit*{\addspace}}{}% + \printfield{number}% + \newunit\newblock + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{institution+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + \iffieldundef{url}{}{%当没有网址时也不输出修改或更新日期 + \usebibmacro{modifydate}}%修改或更新日期为带括号的时间 + \usebibmacro{doi+eprint+url}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isrn}} + {}% + \newunit\newblock +% \usebibmacro{doi+eprint+url}% +% \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}}% +% +% 备选类型驱动 +% +% 利用biblatex的misc驱动 +\csdef{blx@bbx@misc}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% +\iftoggle{bbx:gbstrict}{}{% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}}% + \newunit\newblock + \printfield{howpublished}% + \newunit\newblock + \printfield{type}% + \newunit + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{institution+location+date}% + %\usebibmacro{organization+location+date}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}}% +% +% 专著中的析出文献的格式修改 +% +\csdef{blx@bbx@inbook}{%源来自standard.bbx + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\usebibmacro{title}% +\usebibmacro{in:}% +%\printtext{\texttt{//}\addthinspace}% + \usebibmacro{bybookauthor}% + \ifnameundef{bookauthor}{% + \ifnameundef{editor}{}{\newunit}% + }{\newunit}%替换下一句 + %\newunit\newblock +\iffieldundef{series}{}{\usebibmacro{series+number}\setunit{\addcolon\addspace}}%为处理一些存在series的情况而增加 + \usebibmacro{maintitle+booktitle}% +\iffieldundef{volume}{}{\setunit{\addcolon\addspace}\printfield{volume}}% +\iffieldundef{number}{}{\setunit{\addcolon\addspace}\printfield{number}}%增加卷和册信息 + \newunit\newblock% +% \usebibmacro{byeditor+others}% +% \newunit\newblock + \printfield{edition}% + \newunit + \iftoggle{bbx:gbstrict}{}{% +% \iffieldundef{maintitle} +% {\printfield{volume}% +% \printfield{part}} +% {}% +% \newunit +% \printfield{volumes}% +% \newunit\newblock +% \usebibmacro{series+number} + }% + \newunit\newblock + %\printfield{note}% + %\newunit\newblock + \usebibmacro{publisher+location+date}% +%\newunit\newblock + \usebibmacro{chapter+pages}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}%移到上面来 + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock + %\usebibmacro{doi+eprint+url}% +% \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}}% +}{}% +} + +\AtEveryBibitem{\localsetchinesecode}% +\AtEveryCite{\localsetchinesecode}% +\AtEveryLositem{\localsetchinesecode}% diff --git a/config/gb7714-2015ms.cbx b/config/gb7714-2015ms.cbx new file mode 100644 index 0000000..a95492e --- /dev/null +++ b/config/gb7714-2015ms.cbx @@ -0,0 +1,190 @@ +%% +%% --------------------------------------------------------------- +%% biblatex-gb7714-2015 --- A biblatex implementation of the +%% GBT7714-2015 citation style,numerical sequence +%% Maintained by huzhenzhen +%% E-mail: hzzmail@163.com +%% Released under the LaTeX Project Public License v1.3c or later +%% --------------------------------------------------------------- +%% +\def\versionofgbtstyle{2019/03/28 v1.0r} +\ProvidesFile{gb7714-2015ms.cbx}[\versionofgbtstyle biblatex citation style] + +% +% 加载标准样式 +% +\RequireCitationStyle{numeric-comp} %numeric + + +% +% 选项设置 +% +\ExecuteBibliographyOptions{ + autocite = superscript , + autopunct = true , + %sorting = none , + maxcitenames=1, + mincitenames=1, +} + +%textcite标注命令中的标点设置 +%\DeclareDelimFormat[textcite]{andothersdelim}{\addspace}% + +% +% 定义一个上标方括号wrapper +% +\newcommand*\mkbibsuperbracket[1]{% + \mkbibsuperscript{\mkbibbrackets{#1}}% +} + +% 修改postnote的输出格式 +\DeclareFieldFormat{postnote}{#1} + +% +% 重定义cite命令 +% +% 方法:\DeclareCiteCommand{\cite}[\mkbibparens]{precode}{loopcode}{sepcode}{postcode} +% v1.0p版后将cite的处理方式修改为类似pagescite,而不再使用biblatex的标准方式 +\DeclareCiteCommand{\cite}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号 + {[\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \printfield{postnote}} +% v1.0p 以前用的方式 +%\DeclareCiteCommand{\cite}[\mkbibsuperbracket]%利用mkbibsuperbracket添加方括号 +% {\usebibmacro{cite:init}% +% \usebibmacro{prenote}} +% {\usebibmacro{citeindex}% +% \usebibmacro{cite:comp}} +% {} +% {\usebibmacro{cite:dump}% +% \usebibmacro{postnote}} + +% +% 定义upcite命令 +% 20180604,v1.0l,hzz +% 20190409,v1.0r,hzz +% 方法:对supercite增加[] +\newrobustcmd*{\upcite}{% + \cite} + +% +% 重定义parencite命令,以满足标签带页码的国标要求 +% +\DeclareCiteCommand{\parencite}%[\mkbibbrackets] + {[\usebibmacro{cite:init}%] + \usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {%[ + \usebibmacro{cite:dump}]% + \mkbibsuperscript{\printfield{postnote}}} + +% +% 新定义pagescite命令,以满足标签带页码的国标要求 +% +% 原理方法: +% 1.新增页码输出宏 +\newbibmacro*{postpages}{% + \iffieldundef{postnote} + {\printfield[postnote]{pages}} + {\printfield{postnote}}} +% 2.新增\pagescite引用命令 +\DeclareCiteCommand{\pagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标 + {[\usebibmacro{cite:init}%]直接添加方括号 + \usebibmacro{prenote}% + } + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \usebibmacro{postpages}} + +% +% 定义yearpagescite,为与ay样式兼容,等同于\pagescite +% +\DeclareCiteCommand{\yearpagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标 + {[\usebibmacro{cite:init}%]直接添加方括号 + \usebibmacro{prenote}% + } + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \usebibmacro{postpages}} + + + +% +% 定义\yearcite命令,为与ay样式兼容,且提供不输出页码的标签格式, +% +% 原理方法:等同于\pagescite,但不要页码 +\DeclareCiteCommand{\yearcite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标 + {[\usebibmacro{cite:init}%]直接添加方括号 + \usebibmacro{prenote}% + } + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]} + +% +% 定义\authornumcite命令,输出作者信息,然后在后面带上顺序编码 +% 20180427,v1.0k,增加,hzz +% gb7714样式新定义的命令都把cite放到最后,比如前面的pagescite,yearcite,这里的\authornumcite +% 区别于biblatex定义的命令都把cite放到前面,比如citeauthor等。 +%见numeric.CBX +\newbibmacro*{cite}{% + \printtext[bibhyperref]{% + \printfield{labelprefix}% + \printfield{labelnumber}% + \ifbool{bbx:subentry} + {\printfield{entrysetcount}} + {}}} +%见numeric.CBX,\DeclareCiteCommand{\cite}, +\DeclareCiteCommand{\authornumcite}%[\mkbibsuperscript] + {\usebibmacro{prenote}} + {\iffieldequalstr{userf}{cn}{\renewcommand*{\andothersdelim}{\addthinspace}}%\addthinspace + {\renewcommand*{\andothersdelim}{\addspace}}% + \printnames{labelname}\mkbibsuperscript{\mkbibbrackets{\usebibmacro{citeindex}% + \usebibmacro{cite}}}} + {\multicitedelim} + {\mkbibsuperscript{\printfield{postnote}}} + + +% +% 增加如下多个命令 +% 20190409,v1.0r,hzz +% 方法:利用newcommand或newrobustcmd命令进行定义 +% 注意\citet和\citep命令之所以不用newrobustcmd,是为避免加载natbib模块后产生冲突 +\DeclareCiteCommand{\citet}% + {\usebibmacro{prenote}} + {\iffieldequalstr{userf}{cn}{\renewcommand*{\andothersdelim}{\addthinspace}}%\addthinspace + {\renewcommand*{\andothersdelim}{\addspace}}% + \printnames{labelname}\mkbibsuperscript{\mkbibbrackets{\usebibmacro{citeindex}% + \usebibmacro{cite}}}} + {\multicitedelim} + {\mkbibsuperscript{\printfield{postnote}}} + + +\DeclareCiteCommand{\citep}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号 + {[\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \printfield{postnote}} + +\newrobustcmd*{\citetns}% + {\textcite} + +\newrobustcmd*{\citepns}% + {\parencite} + +\newrobustcmd*{\inlinecite}% + {\parencite} diff --git a/config/gb7714-2015mx.bbx b/config/gb7714-2015mx.bbx new file mode 100644 index 0000000..416d974 --- /dev/null +++ b/config/gb7714-2015mx.bbx @@ -0,0 +1,3302 @@ +%% +%% --------------------------------------------------------------- +%% biblatex-gb7714-2015 --- A biblatex implementation of the +%% GBT7714-2015 bibliography style,numerical sequence and authoryear mixed style +%% Maintained by huzhenzhen +%% E-mail: hzzmail@163.com +%% Released under the LaTeX Project Public License v1.3c or later +%% --------------------------------------------------------------- +%% + +% +% 版本和时间信息 +% +\def\versionofgbtstyle{2019/03/28 v1.0r} +\def\versionofbiblatex{\abx@version} +\ProvidesFile{gb7714-2015mx.bbx}[\versionofgbtstyle biblatex bibliography style] +%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 + +%===================================================================== +% 加载标准样式 +%===================================================================== +\RequireBibliographyStyle{numeric-comp} +\RequirePackage{xstring}%解决texlive2015的biblatex3.0不加载xstring包的问题 + + +%===================================================================== +% 功能函数 +%===================================================================== + % + % 增加一个控制是否输出annotation域的选项,该域可以用于在文献条目后面输出一些注释信息 + % 20190509,v1,0s,hzz + \newtoggle{bbx:gbannote} + \DeclareBibliographyOption{gbannote}[false]{%biblatex低版本 + \settoggle{bbx:gbannote}{#1}} + \ExecuteBibliographyOptions{gbannote} + % + %用于在文献条目后面输出注释信息的宏 + %FieldFormat{annotation}用于设置注释信息的格式 + \DeclareFieldFormat{annotation}{% + \printtext{\addspace(#1)}% + } + \renewbibmacro*{annotation}{% + \iftoggle{bbx:gbannote}% + {\iffieldundef{annotation}% + {\printfile[annotation]{\bibannotationprefix\thefield{entrykey}.tex}}% + {\printfield{annotation}}}% + {}% + } + + + % + % biblatex版本判断 + % 20180629,v1.0k,hzz + % + % 原理方法:适用于3.10以上版本的biblatex,否则给出警告 + \@ifpackagelater{biblatex}{2017/12/28}{}{ + \blx@warning@noline{% + biblatex version is too old for this style\MessageBreak + if errors raised,Please update biblatex to the latest version.} + } + + % + % 判断CJK字符的函数,用于判断作者等信息是否由中文字符构成 + % v1.0k,20180509,hzz + % + % 原理方法:用biber中的perl方法代替。因为利用tex函数对字符判断时,当字符在宏 + % 中时,基于`的方法无法解决GBK编码的问题,基于CJKsymbol的方法无法解决utf-8 + % 编码用xelatex编译的问题。 + % + % 原理是:利用perl正则将中文标识记录到域中, + % 然后利用\iffieldundef和\iffieldequalstr进行判断 + \providetoggle{ifCJKforgbt} + \def\testCJKfirst#1{% + \iffieldundef{#1}{\togglefalse{ifCJKforgbt}}{% + \iffieldequalstr{#1}{chinese}{\toggletrue{ifCJKforgbt}}{\togglefalse{ifCJKforgbt}}}} + + % + % 2个卷的解析函数,用于连续出版物 + % + % 原理方法: 范围起止间隔符号还是用-,而不是与date相同的/,因为有合期期刊的问题,需要用到/符号 + \newcommand{\multivolparser}[1]{% + \IfSubStr{#1}{-}% + {\StrBefore{#1}{-}[\multivolfirst]\StrBehind{#1}{-}[\multivolsecond]}% + {\def\multivolfirst{#1}\def\multivolsecond{}}% + } + + + % + % 2个期的解析函数,用于连续出版物 + % + \newcommand{\multinumberparser}[1]{% + \IfSubStr{#1}{-}% + {\StrBefore{#1}{-}[\multinumberfirst]\StrBehind{#1}{-}[\multinumbersecond]}% + {\def\multinumberfirst{#1}\def\multinumbersecond{}}% + } + +%===================================================================== +% 数据模型定义 +%===================================================================== + %定义类型和载体标识,从gb内容看载体基本属于介质。 + %为与lee zeping的bst的样式统一,使用mark和medium这两域名 + %为单个条目的姓名格式控制增加nameformat和namefmtid两个域 + %为缩略信息文献表增加了shortbooktitle域 + %为多语言排序增加了lansortorder域 + \DeclareDatamodelFields[type=field,datatype=literal]{mark,medium,nameformat} + \DeclareDatamodelFields[type=field,datatype=integer]{namefmtid} + \DeclareDatamodelFields[type=field,datatype=literal]{shortbooktitle} + \DeclareDatamodelFields[type=field,datatype=literal]{lansortorder} + %为多样式文献表增加的stylesections、styleaysection域: + \DeclareDatamodelFields[type=field,datatype=integer]{aysections} + \DeclareDatamodelFields[type=field,datatype=literal]{styleaysection} + + + + + +%===================================================================== +% 设置宏包选项 +%===================================================================== + % + % 增加一个控制是否输出type域的选项 + % 20190212,v1,0q,hzz + \newtoggle{bbx:gbfieldtype} + \DeclareBibliographyOption{gbfieldtype}[false]{%biblatex低版本 + \settoggle{bbx:gbfieldtype}{#1}} + \ExecuteBibliographyOptions{gbfieldtype} + + % + % 增加一个控制是否根据页码重设脚注数字标号的选项 + % 20190422,v1,0r,hzz + \newtoggle{bbx:gbfnperpage} + \DeclareBibliographyOption{gbfnperpage}[false]{% + \settoggle{bbx:gbfnperpage}{#1}} + \ExecuteBibliographyOptions{gbfnperpage} + + % + % 增加一个选项,用于控制是否实现GB/T 7714-2015标准的脚注文献表 + % 20190203,v1.0p,hzz + % 原理方法:默认做patch,文献引用带圈上标数字表示,脚注中的文献用带圈非上标数字做标签 + % 当前面的脚注中已经存在当前文献,那么当前文献内容不再输出而用同(4)这样的方式 + % 需要注意的是由于小页环境和表格中的脚注本身的问题,可能会有一些问题 + \DeclareBibliographyOption{gbfootbib}[false]{% + \ifstrequal{#1}{false}{}{\execgbfootbib}} + \ExecuteBibliographyOptions{gbfootbib} + + %% + \newlength{\footbibmargin} + \newlength{\footbiblabelsep} + \setlength{\footbibmargin}{1em}%脚注的段落左侧缩进距离 + \setlength{\footbiblabelsep}{0.5em}%脚注中标记号与脚注段落的间距 + \def\execgbfootbib% + {% + %开启引用跟踪计数器,为使用\ifciteseen等测试命令 + \ExecuteBibliographyOptions{citetracker=true} + % + %利用footmisc宏包来实现脚注文献的悬挂对齐 + \AtEndPreamble{ + \@ifclassloaded{beamer}{}{ + %beamer类因为其特殊性,为避免冲突不调footmisc。 + %同时footmisc与hyperref宏包也不兼容,所以使用footmisc时会破坏脚注的超链接 + %如果要实现超链接可以将下句注释掉,这里留着主要是实现悬挂对齐。 + %\PassOptionsToPackage{perpage,hang}{footmisc}% + %\RequirePackage{footmisc}% + + %重新实现脚注的根据单页重设脚注号码 + %重新实现脚注的悬挂对齐问题,不再使用footmisc,直接从latex核心代码和hyperref代码进行修改 + %v1.0q 20190317 hzz + %v1.0r 20190422 hzz 根据gbfnperpage选项设置 + \iftoggle{bbx:gbfnperpage}% + {\@addtoreset{footnote}{page}}{}%重设计数器 + + \@ifpackageloaded{hyperref}{%加载hyperref则对\H@@footnotetext做重定义 + \long\def\H@@footnotetext##1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \leftskip \footbibmargin%增加的左侧缩进 + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox% + }% + \color@endgroup}}% + + \long\def\H@@mpfootnotetext##1{% + \global\setbox\@mpfootins\vbox{% + \unvbox\@mpfootins + \reset@font\footnotesize + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel + {\csname p@mpfootnote\endcsname\@thefnmark}% + \leftskip \footbibmargin%增加的左侧缩进 + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox}% + \color@endgroup}} + }{%否则对latex核心代码中的\@footnotetext做重定义 + \long\def\@footnotetext##1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \leftskip \footbibmargin%增加的左侧缩进 + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox% + }% + \color@endgroup}}% + + \long\def\@mpfootnotetext##1{% + \global\setbox\@mpfootins\vbox{% + \unvbox\@mpfootins + \reset@font\footnotesize + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel + {\csname p@mpfootnote\endcsname\@thefnmark}% + \leftskip \footbibmargin%增加的左侧缩进 + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox}% + \color@endgroup}} + } + + \long\def\@makefntext##1{%增加了脚注标记与正文的间隔 + \parindent 1em\noindent \hb@xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1} + + } + + % + %使脚注标记加圈并设置数字的字体为tiny,不使用修改thefootnote的方式 + \def\@makefnmark{\hbox{\@textsuperscript{\textcircled{\tiny\@thefnmark}}}} + %做patch使得脚注内容中的脚注数字标签不上标 + \pretocmd{\@makefntext}{% + \def\@makefnmark{% + \hbox{\textcircled{\tiny\@thefnmark}}% + }% + }{}{} + } + + % + %判断当前文献是否已经引用过且是做的footfullcite(即已经作为脚注输出文献内容) + %记录首次输出时的脚注号码,用于后面再次引用该文献时的输出,比如同(4)。 + %v1.0q 20190309 区分使脚注标注适应minipage中的情况 + \newbibmacro*{citesavefn}{% + \ifciteseen%当被引用过为true + {\ifcsdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}%当已经定义过脚注序号信息 + {\csgdef{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{% + \str@sameentry\gdef\@thefnmark{\csuse{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}}% + \@makefnmark% + }}% + {\csxdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{% + \ifcsstring{@mpfn}{mpfootnote}{\@alph\c@mpfootnote}{\thefootnote}% + }}% + }% + {\csxdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{% + \ifcsstring{@mpfn}{mpfootnote}{\@alph\c@mpfootnote}{\thefootnote}% + %判断在minipage中比较麻烦,这里使用\@mpfn的定义进行判断 + }}% + } + + % + %重定义\footfullcite使完成gb7714-2015的脚注文献要求 + \DeclareCiteCommand{\footfullcite}[\mkbibfootnote]% + {\defcounter{maxnames}{\blx@maxbibnames}%局部定义maxnames和minnames计数器 + \defcounter{minnames}{\blx@minbibnames}%使footfullcite内的作者输出与正文文献表中的一致。 + \usebibmacro{prenote}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}{\setunit{\addcolon\addspace}\printtext{\thefield{postnote}}}}%由于ay样式中没有修改postnote域,此处因为格式需要不使用默认域格式 + }% + {\usebibmacro{citesavefn}% + \ifcsdef{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}% + {\csuse{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}}%\nopunct + {\usedriver{\DeclareNameAlias{sortname}{default}}{\thefield{entrytype}}}% + }% + {\multicitedelim}% + {\usebibmacro{postnote}} + + } + + % + % 增加一个选项,用于控制gb7714的使用范围,即英文文献和中文文献使用不同的样式 + % 20180814,v1.0m,hzz + % 原理方法: + % 只为兼容性考虑不做任何处理 + \DeclareBibliographyOption{gbstyle}[true]{%biblatex低版本 + } + + % + % 增加一个控制是否输出文献类型和载体标识的选项 + % + % 原理方法: + % 对于biblatex3.4以上版本DeclareBibliographyOption命令中的[datatype]如果是boolean,那么是可以省略的 + % 所以用老版本的不用[datatype]的命令可以兼容所有biblatex版本 + \newtoggle{bbx:gbtype} + %\DeclareBibliographyOption[boolean]{gbtype}[true]{%biblatex高版本 + \DeclareBibliographyOption{gbtype}[true]{%biblatex低版本 + \settoggle{bbx:gbtype}{#1}} + \ExecuteBibliographyOptions{gbtype} + + % + % 增加一个源文件编码选择选项,当true时可以使用GBK编码。 + % v1.0k, 2018.05.08, by hzz + % + % 原理方法:将需要输出的中文字符串用命令形式表示存储,采用utf8编码时采用bbx文档 + % 内的定义即是utf8编码的中文字符串,但tex源文件是gbk编码时,利用gb7714-2015-gbk.def + % 文档内的gbk编码的字符串覆盖。这种覆盖只能在宏包末尾加载时成功实现,所以使用 + % AtEndOfPackage。该解决思路源自biblatex-caspervector宏包。 + % 另外注意: + % gbk编码的tex文档,利用pdflatex/latex能正确编译,利用xelatex能编译,但中文显示乱码 + % 在源文档前面增加 XeTeX 原语:\XeTeXinputencoding "GBK" 后,显示正常 + % utf-8编码的tex文档,利用xelatex能正确编译,而pdflatex/latex不能编译。 + \newtoggle{bbx:codegbk} + \DeclareBibliographyOption{gbcodegbk}[false]{% + \settoggle{bbx:codegbk}{#1}} + \ExecuteBibliographyOptions{gbcodegbk} + + \def\str@bibliography{参考文献} + \def\str@references{参考文献} + \def\str@bytranslator{译} + \def\str@andotherscn{等} + \def\str@backrefpage{引用页} + \def\str@backrefpages{引用页} + \def\str@noaddress{出版地不详} + \def\str@nopublisher{出版者不详} + \def\str@edition{版} + \def\str@volumecn{卷} + \def\str@numbercn{册} + \def\str@serialcn{第} + \def\str@sameentry{同} + \def\str@incn{见} + \def\str@mathesiscn{硕士学位论文} + \def\str@phdthesiscn{博士学位论文} + \def\str@editorcn{主编} + + \AtEndOfPackage{% + \iftoggle{bbx:codegbk}{% + \ExecuteBibliographyOptions{texencoding = GBK} + \input{gb7714-2015-gbk.def} + }{}} + + % + % 增加一个严格按GB/T 7714-2015给出著录格式控制域的输出的选项 + % v1.0k, 2018.05.08, by hzz + % + % 原理方法: + % 默认设置该选项为真,进而不输出GB/T 7714-2015中没有的域的信息 + % 这样可以避免因为bib文件带有多余的域的信息的输出,比如因为bibtex样式 + % 可能需要用于中英文判断的language域的信息。 + \newtoggle{bbx:gbstrict} + \DeclareBibliographyOption{gbstrict}[true]{% + \settoggle{bbx:gbstrict}{#1}} + \ExecuteBibliographyOptions{gbstrict} + + % + % 增加一个控制标题域超链接设置的选项 + % v1.0k, 2018.05.24, by hzz + % + % 原理方法: + % 利用标题域格式来实现,默认设置该选项为false,不做超链接。 + % 设置为true,则标题设置超链接 + \newtoggle{bbx:titlelink} + \DeclareBibliographyOption{gbtitlelink}[false]{% + \settoggle{bbx:titlelink}{#1}} + \ExecuteBibliographyOptions{gbtitlelink} + + % + % 增加一个控制参考文献标题是否能够被ctex宏包设置的选项 + % v1.0l, 2018.07.02, by hzz + % + % 原理方法: + % 重定义biblatex的宏,去除使用本地化字符串的方式,是的可以利用ctexset进行设置 + \newtoggle{bbx:ctexset} + \DeclareBibliographyOption{gbctexset}[true]{% + \settoggle{bbx:ctexset}{#1}} + \ExecuteBibliographyOptions{gbctexset} + + \AtEndOfPackage{% + \iftoggle{bbx:ctexset}{% + \def\blx@defbibstrings#1#2{% + \def\do##1{\csundef{abx@lstr@##1}\csundef{abx@sstr@##1}}% + \abx@dostrings + \csuse{abx@strings@#1}% + \setkeys{blx@lbx}{#2}% + \let\do\blx@defbibstrings@i + \csxdef{abx@strings@#1}{\abx@dostrings}% + } + }{}} + + + + % + % 增加一个恢复域格式为标准样式的控制选项 + % v1.0k, 2018.05.15, by hzz + % + % 原理方法: + % 默认设置该选项为false,采用国标要求的域格式输出相关域 + % 当设置该选项为true时,则重新利用标准样式的域格式输出相关的域 + \newtoggle{bbx:gbfieldstd} + \DeclareBibliographyOption{gbfieldstd}[false]{% + \settoggle{bbx:gbfieldstd}{#1}% + \ifstrequal{#1}{false}{}{\execgbfdfmtstd}% + } + \ExecuteBibliographyOptions{gbfieldstd} + + % + % 增加一个出版项自动处理控制选项,当true时使用出版者不详等信息补充缺失的出版信息。 + % + \newtoggle{bbx:gbpub} + \DeclareBibliographyOption{gbpub}[true]{% + %\settoggle{bbx:gbpub}{#1} %或采用下面这一句 + \ifstrequal{#1}{false}{\togglefalse{bbx:gbpub}}{\toggletrue{bbx:gbpub}}} + \ExecuteBibliographyOptions{gbpub} + + % + % 增加控制析出文献来源前的标点符号//输出的选项 + % v1.0k, 2018.04.20,added in by hzz + \newtoggle{bbx:gbpunctin} + \DeclareBibliographyOption{gbpunctin}[true]{% + \settoggle{bbx:gbpunctin}{#1}} + \ExecuteBibliographyOptions{gbpunctin} + + + % + % 增加一个处理佚名或noauthor的控制选项 + % + % 原理方法:顺序编码制中与作者年制都使用 + \DeclareBibliographyOption{gbnoauthor}[true]{% + \ifstrequal{#1}{false}{}{\dealnoathor}} + %\ExecuteBibliographyOptions{gbnoauthor=true}%对于需要展开较早(展开层级优先)的选项,这一执行无效,只能用宏包加载时给出的选项。 + + + + + % + % 选项设置 + % + \ExecuteBibliographyOptions{ + sorting=none, + useprefix=true, %名字的信息包括前缀 + date = year, %日期仅写到年 + maxbibnames = 3,%设置名字最大数量 + minbibnames = 3, %设置缩减后的名字最小数量 + maxitems = 1,%设置列表最大数量 + minitems = 1, %设置缩减后的列表最小数量 + isbn=false, + sortlocale=zh__pinyin,%zh__big5han,%zh__stroke,%zh__gb2312han,%zh__pinyin, + } + + % + %为日期相关选项增加选项值gb7714-2015 + % + \csdef{mkdaterangegb7714-2015}#1{% + \begingroup + \blx@metadateinfo{#1}% + \iffieldundef{#1year} + {} + {\printtext[#1date]{% + \blx@gbdate{#1}{}}}% + \endgroup} + + \newrobustcmd*{\blx@gbdate}[3][]{% + \dateeraprintpre{#2#3year}% + \blx@imc@forcezerosy{\thefield{#2#3year}}\ifblank{#1}{}{\printfield{#1}}% + \iffieldundef{#2#3month}{}{\hyphen\blx@imc@forcezerosmdt{\thefield{#2#3month}}}% + \iffieldundef{#2#3day}{}{\hyphen\blx@imc@forcezerosmdt{\thefield{#2#3day}}}} + + + %为姓名格式选择增加的计数器 + \newcounter{gbnamefmtcase} + \def\thegbnamefmtcase{\the\c@gbnamefmtcase} + %为数字标签格式选择增加的计数器/命令 + \newcommand{\mkgbnumlabel}[1]{\mkbibbrackets{#1}} + \def\gbbiblabelopt@bracket{\renewcommand{\mkgbnumlabel}[1]{\mkbibbrackets{##1}}} + \def\gbbiblabelopt@parens{\renewcommand{\mkgbnumlabel}[1]{\mkbibparens{##1}}} + \def\gbbiblabelopt@dot{\renewcommand{\mkgbnumlabel}[1]{##1\adddot}} + \def\gbbiblabelopt@plain{\renewcommand{\mkgbnumlabel}[1]{##1}} + \def\gbbiblabelopt@box{\renewcommand{\mkgbnumlabel}[1]{\framebox{##1}}} + \def\gbbiblabelopt@circle{\renewcommand{\mkgbnumlabel}[1]{\textcircled{##1}}} + %为文献表中数字标签对齐方式选择增加的计数器/命令 + \newcounter{gbalignlabel} + \def\thegbalignlabel{\the\c@gbalignlabel} + %为引用标签标注/文献表中本地化字符串中英文选择增加的计数器/命令 + \newcounter{gbcitelocalcase} + \newcounter{gbbiblocalcase} + \def\thegbcitelocalcase{\the\c@gbcitelocalcase} + \def\thegbbiblocalcase{\the\c@gbbiblocalcase} + + + % + % 增加不同语言排序的切换选项,numeric样式,不使用该选项 + % gblanorder=chineseahead的顺序为cn,jp,kr,en,fr,ru + % gblanorder=englishahead的顺序为en,fr,ru,cn,jp,kr + % gblanorder=cn;en;ru;fr;jp;kr的顺序为指定的cn;en;ru;fr;jp;kr,自定义内容可以随意写以分号分隔 + % v1.0q,20190307,hzz + % + \DeclareBibliographyOption[string]{gblanorder}[chineseahead]{% + \ifstrequal{#1}{chineseahead}%%中文在前的顺序 + {\gdef\lancnorder{1}\gdef\lanjporder{2}\gdef\lankrorder{3}% + \gdef\lanenorder{4}\gdef\lanfrorder{5}\gdef\lanruorder{6}}% + {% + \ifstrequal{#1}{englishahead}% + {\execlanodeah\dealsortlan}% + {\execlanodudf{#1}\dealsortlan}% + }% + } + \ExecuteBibliographyOptions{gblanorder} + + \def\execlanodeah{%中文在后的顺序 + \gdef\lancnorder{4} + \gdef\lanjporder{5} + \gdef\lankrorder{6} + \gdef\lanenorder{1} + \gdef\lanfrorder{2} + \gdef\lanruorder{3}} + + \newcounter{lanordernum} + \newcommand{\execlanodudf}[1]{%like:cn;en;ru;fr;jp;kr + \setcounter{lanordernum}{0} + \DeclareListParser{\parsinglanorder}{;} + \renewcommand*{\do}[1]{\stepcounter{lanordernum}\csxdef{lan##1order}{\thelanordernum}} + \parsinglanorder{#1} + } + + % + % 增加本地化字符串的中英文切换选项 + % gbcitelocal指标注中的本地化字符串 + % gbbiblocal 指文献表中的本地化字符串 + % gblocal 指设置文献表和标注中的本地化字符串 + % v1.0o,20190103,hzz + % + \DeclareBibliographyOption[string]{gbcitelocal}[gb7714-2015]{% + \ifstrequal{#1}{gb7714-2015}{\setcounter{gbcitelocalcase}{0}}{}% + \ifstrequal{#1}{chinese}{\setcounter{gbcitelocalcase}{1}}{}% + \ifstrequal{#1}{english}{\setcounter{gbcitelocalcase}{2}}{}% + } + \ExecuteBibliographyOptions{gbcitelocal} + + \DeclareBibliographyOption[string]{gbbiblocal}[gb7714-2015]{% + \ifstrequal{#1}{gb7714-2015}{\setcounter{gbbiblocalcase}{0}}{}% + \ifstrequal{#1}{chinese}{\setcounter{gbbiblocalcase}{1}}{}% + \ifstrequal{#1}{english}{\setcounter{gbbiblocalcase}{2}}{}% + } + \ExecuteBibliographyOptions{gbbiblocal} + + \DeclareBibliographyOption[string]{gblocal}[gb7714-2015]{% + \ExecuteBibliographyOptions{gbbiblocal=#1}% + \ExecuteBibliographyOptions{gbcitelocal=#1}% + } + %\ExecuteBibliographyOptions{gblocal} %默认值已经通过两个相关选项设置 + + % + % 增加序号标签格式处理选项 + % v1.0l,20180623,hzz + % + \DeclareBibliographyOption[string]{gbbiblabel}[bracket]{% + \csuse{gbbiblabelopt@#1} + } + \ExecuteBibliographyOptions{gbbiblabel} + + % + % 增加姓名大小写格式处理选项 + % + \DeclareBibliographyOption[string]{gbnamefmt}[uppercase]{% + \ifstrequal{#1}{uppercase}{\setcounter{gbnamefmtcase}{0}}{}% + \ifstrequal{#1}{lowercase}{\setcounter{gbnamefmtcase}{1}}{}% + \ifstrequal{#1}{givenahead}{\setcounter{gbnamefmtcase}{2}}{}%given-family + \ifstrequal{#1}{familyahead}{\setcounter{gbnamefmtcase}{3}}{} + \ifstrequal{#1}{pinyin}{\setcounter{gbnamefmtcase}{4}}{}%family-given + \ifstrequal{#1}{reverseorder}{\setcounter{gbnamefmtcase}{5}}{}%family-given/given-family + } + \ExecuteBibliographyOptions{gbnamefmt} + + % + % 增加标签对齐选项 + % + % right是默认的右对齐,left是左对齐,gb7714-2015是项对齐方式 + \DeclareBibliographyOption[string]{gbalign}[right]{% + \ifstrequal{#1}{right}{\setcounter{gbalignlabel}{0}}{} + \ifstrequal{#1}{left}{\setcounter{gbalignlabel}{1}}{} + \ifstrequal{#1}{center}{\setcounter{gbalignlabel}{2}}{} + \ifstrequal{#1}{gb7714-2015}{\setaligngbstyle}{} + } + + \ExecuteBibliographyOptions{ + giveninits=true, + urldate =gb7714-2015, %iso,iso8601,edtf + eventdate =gb7714-2015, + labeldateparts=true, + } + + +%===================================================================== +% 设置本地化字符串 +%===================================================================== + % + % 新建当地化字符串,用来记录“等”字符、“和”字符 + % + \NewBibliographyString{andotherscn} + \NewBibliographyString{andothersincitecn} + \NewBibliographyString{andothersincite} + \NewBibliographyString{andcn} + \NewBibliographyString{andothersjp} + \NewBibliographyString{andotherskr} + \NewBibliographyString{andjp} + \NewBibliographyString{andkr} + \NewBibliographyString{andincitecn} + \NewBibliographyString{andincite} + \NewBibliographyString{volumecn} + \NewBibliographyString{numbercn} + \NewBibliographyString{serialcn} + \NewBibliographyString{incn} + \NewBibliographyString{mathesiscn} + \NewBibliographyString{phdthesiscn} + \NewBibliographyString{editorcn} + \NewBibliographyString{editorscn} + + + + % + % 修改一些当地化字符串 + % + % 原理方法:直接利用当地化格式english修改出一些中文的格式,具体修改内容参考english.lbx文件 + % 当然也可以增加比如上面定义的andotherscn + % 注意:在lbx文件和bbx文件中定义本地字符串的不同语法,两个参数和一个参数的区别 + + \DefineBibliographyStrings{english}{ + bibliography = {\str@bibliography}, + references = {\str@references}, + bytranslator= {\str@bytranslator},%\addperiod,%将trans. by 改成 译\addcomma\ + and = {\addcomma},%将第2和3人名间的and符号改成逗号,用\finalnamedelim命令也可以定义,参见3.9.1节 + andcn = {\addcomma},%and本地化字符串的中文对应词 + andincitecn = {\addcomma},%将标注中的分开,便于与文献表中的区分 + andincite = {\addcomma}, + %andothers = {et al.},%将超过3个人名的省略,et al.改成为 等 + andotherscn = {\str@andotherscn},%将超过3个人名的省略,et al.改成为 等 + andothersincitecn={\str@andotherscn},%将标注中的分开,便于与文献表中的区分 + andothersincite={et al\adddot}, + backrefpage = {\str@backrefpage:}, + backrefpages = {\str@backrefpages:}, + in={in\intitlepunct}, + volumecn={\str@volumecn}, + numbercn={\str@numbercn}, + serialcn={\str@serialcn}, + andothersjp={他}, + andotherskr={외}, + andjp={和}, + andkr={和}, + incn={\str@incn\addcolon\addspace}, + mathesiscn={\str@mathesiscn}, + phdthesiscn={\str@phdthesiscn}, + editorscn={\str@editorcn}, + editorcn={\str@editorcn}, +} + + % + % 增加两个命令用于临时的局部的修改本地化字符串 + % 其中\setlocalbibstring修改缩写字符串,setlocalbiblstring修改长字符串 + % 注意使用时因为是局部修改,因此要将其与需要修改的引用命令放在一个编组符号内 + % v1.0t,hzz,20190525 + \newcommand{\setlocalbibstring}[2]{% + \csdef{abx@sstr@#1}{#2}} + \newcommand{\setlocalbiblstring}[2]{% + \csdef{abx@lstr@#1}{#2}} + +%===================================================================== +% 动态数据修改 +%===================================================================== +% +% 各层次的数据映射和动态修改 +% +% 原理方法: +% 1. 进行语言包括中英文判断,并设置和记录,比如记录到userf,usere中 +% 2. 增加文献标识符如[M],[J]等,对一些容易混淆的域进行设置以增强兼容性 +% 3. \DeclareSourcemap命令对于biblatex3.11以下版本只能出现一次,3.11版开始支持多个 +% 4. \DeclarestyleSourcemap在biblatex v3.7版开始可以支持出现多次 +% 5. 把作者和译者信息准确的记录到userf,usere中,用于后面判断是否是cjk字符。 +% 注意:这里用userf,usere而不是namee,namef,是因为只有把name列表转成域,才能有效读取姓名中的字符, +% 如果用namee,namef,name信息会自动解析,所以就不能为cjk判断提供需要的信息 +% +% 不同的文献类型使用相同的驱动输出可以有5种方法: +% 1. 是数据源层的映射,将其它类型转换为某一要使用驱动的类型 +% 2. 是样式层映射,也是将其它类型转换为某一要使用驱动的类型 +% 3. 是驱动层映射,也是将其它类型转换为某一要使用驱动的类型 +% 4. 定义驱动类型别名DeclareBibliographyAlias,将其它类型定义为某一要使用驱动的类型的别名 +% 驱动别名定义本质上是做了驱动层映射 +% 5. 直接定义不同的类型的驱动,但驱动内容相同。 +% +% 关于数据映射和驱动使用的考虑如下: +% 1. 为避免利用biber输出bib文件时的数据变动,尽量不在数据源层映射做类型转换 +% 2. 为减少代码量,尽量少做内容相同的不同类型驱动 +% 3. 因此类型相关的处理主要在样式层映射、驱动层映射、驱动别名 +% 4. 由于biblatex默认做的驱动别名处理可能增加一些信息比如masterthesis转thesis时增加的type +% 可以在样式层映射做某些需要避免这种默认处置的转换 +% 5. 当没有避免默认行为的需求时,全部采用驱动别名的方式处理,等价于驱动层的映射 +% +% 文献类型和驱动考虑如下: +% 1. 连续出版物及析出文献有其特殊性,因此考虑两类periodical和article +% newpaper映射为article,并以note域做区分特殊处理 +% 2. 专著和专著中的析出文献是主要的类型,因此考虑book和inbook +% standard映射为book或inbook,并以note域做区分特殊处理 +% collection和proceedings基本与book类似,因此做book驱动别名处理 +% incollection和inproceedings基本与inbook类似,因此做inbook驱动别名处理 +% 3. 专利类型有其特殊性,考虑patent类型 +% 4. 电子资源类型有其特殊性,考虑online类型 +% 5. 报告类型与book有点类似,出版项处理与book一样,但有时又要有修改和更新日期 +% 因此考虑用一种类型来输出,使用report类型 +% 6. 手册/学位论文等类型与book有点类似,但对于出版项处理时,有缺省时,直接省略, +% 同时有version和edition的区别,因此考虑用一种类型来输出,使用manual类型 +% 7. 包括报告,学位论文在内的其它所有的类型,都做一个判断,当没有出版项时, +% 且存在网址信息时,将其转换为online类型输出,否则都做为manual类型输出。 +% 8. 备选类型misc当存在网址时直接转换为online,由于howpublished域可用于描述 +% 更多的信息,因此不存在网址时,独立做一个备选格式 +% 9. 出版项主要以如下方式处理: +% (a) location+institution+date 仅用于连续出版物 +% (b)publisher+location+date 用于需要完整输出出版项的类型,比如book,collection,proceedings,in*,report +% (c)institution+location+date 用于出版项缺失时不输出的类型,包括manual,thesis,archive等其他类型 +% (d)printlist{insitution} 用于电子资源,仅输出出版者或组织,为数据映射方便,本来默认的organization域转换为用insitution输出。 +% (e) 不输出,主要用于连续出版物析出的文献 +% 10. 日期以如下方式处理: +% date 由于存在biblatex选项,因此通过选项控制,数据源为date解析数据或year +% urldate 由于存在biblatex选项,因此通过选项控制,输出到日,且用[]包围,数据源为urldate +% newsdate 用于公告日期,公开日期或新闻日期,输出到日,但无包围符号,数据源为date +% modifydate 用于更新或修改日期,输出到日,且用()包围,数据源为date或enddate或eventdate + + +\DeclareSourcemap{ +\maps[datatype=bibtex]{% + \map{%当没有作者时将editor转成author + \pernottype{inbook}%因为in系列中editor可能用来表示bookauthor,所以排除 + \pernottype{inproceedings} + \pernottype{incollection} + \pernottype{periodical}%因为peridical直接使用editor,所以排除 + %注意notfield在低版本biblatex中没有 + %\step[notfield=author,final]%当author不存在,将editor复制给author + \step[fieldsource=editor,fieldtarget=author]%并删除editor + } + \map{%当没有作者时将translator转成author + \pernottype{inbook} + \pernottype{inproceedings} + \pernottype{incollection} + %\step[notfield=author,final]%当author不存在,将translator复制给author + \step[fieldsource=translator,fieldtarget=author]%并删除translator + } + \map{%让address和location同步,biblatex中address是location的别名 + %因此输出的时候只有location信息,但处理过程中是可以存在address的。 + %\step[notfield=address,final] + \step[fieldsource=location,final] + \step[fieldset=address,origfieldval] + } + \map{%让address和location同步 + %\step[notfield=location,final] + \step[fieldsource=address,final] + \step[fieldset=location,origfieldval] + } + \map{%处理在bib文件用mark标记文献类型标识符的情况 + \step[fieldsource=mark,final] + \step[fieldset=usera, origfieldval] + } + \map{%处理在bib文件中直接给出文献的姓名格式为lowercase的情况 + \step[fieldsource=nameformat,match=lowercase,final] + \step[fieldset=namefmtid,fieldvalue={1}] + } + \map{%处理在bib文件中直接给出文献的姓名格式为givenahead的情况 + \step[fieldsource=nameformat,match=givenahead,final] + \step[fieldset=namefmtid,fieldvalue={2}] + } + \map{%处理在bib文件中直接给出文献的姓名格式为familyahead的情况 + \step[fieldsource=nameformat,match=familyahead,final] + \step[fieldset=namefmtid,fieldvalue={3}] + } + \map{%处理在bib文件中直接给出文献的姓名格式为pinyin的情况 + \step[fieldsource=nameformat,match=pinyin,final] + \step[fieldset=namefmtid,fieldvalue={4}] + } + \map{%根据article确定文献类型标识符 + \pertype{article} + \step[fieldset=usera, fieldvalue={J}] + } + \map{%根据periodical确定文献类型标识符 + \pertype{periodical} + \step[fieldset=usera, fieldvalue={J}] + \step[fieldsource=author] %有时会把author和editor混淆,处理后使用editor + \step[fieldset=editor, origfieldval] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%根据增加一个新闻报纸的类型newspaper确定文献类型标识符 + \pertype{newspaper} + \step[fieldset=usera, fieldvalue={N}] + \step[fieldset=note, fieldvalue=news]%因为没有专门的驱动,记录note方便映射为article后判断 + } + \map{%对应增加的一个数据库类型database确定文献类型标识符 + \pertype{database} + \step[fieldset=usera, fieldvalue={DB}] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个数据集类型dataset确定文献类型标识符 + \pertype{dataset} + \step[fieldset=usera, fieldvalue={DS}]% + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个软件类型software确定文献类型标识符 + \pertype{software} + \step[fieldset=usera, fieldvalue={CP}] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个舆图类型map确定文献类型标识符 + \pertype{map} + \step[fieldset=usera, fieldvalue={CM}]% + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%对应增加的一个档案类型archive确定文献类型标识符 + \pertype{archive} + \step[fieldset=usera, fieldvalue={A}] + \step[fieldsource=publisher] %有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{%因为misc类型本身就是没有类型,而不像其它文献有明确的类型,所以 + %当misc类型带有网址时,直接将其转换为online类型 + \pertype{misc} + \step[fieldsource=url,final] + \step[typesource=misc,typetarget=online] + } + \map{%对应增加的一个备选类型misc确定文献类型标识符 + \pertype{misc} + \step[fieldset=usera, fieldvalue={Z}]% + } + \map{ + \pertype{book} + \pertype{inbook} + \step[fieldset=usera, fieldvalue={M}] + \step[fieldsource=version] %有时会把version和edition混淆,处理后直接用edition + \step[fieldset=edition, origfieldval] + } + \map{%兼容老的standard类型,确定文献类型标识符 + \pertype{standard} + \step[fieldset=usera, fieldvalue={S}] + \step[fieldset=note, fieldvalue=standard]%因为没有专门的驱动,记录note方便映射为book和inbook后判断 + } + \map{ + \pertype{patent} + \step[fieldset=usera, fieldvalue={P}] + } + \map{ + \pertype{inproceedings} + \pertype{conference}%兼容老的conference类型 + \step[fieldset=usera, fieldvalue={C}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{proceedings} + \step[fieldset=usera, fieldvalue={C}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{incollection} + \step[fieldset=usera, fieldvalue={G}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{collection} + \step[fieldset=usera, fieldvalue={G}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{report} + \pertype{techreport}%兼容老的techreport类型 + \step[fieldset=usera, fieldvalue={R}] + \step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher + \step[fieldset=publisher, origfieldval] + } + \map{ + \pertype{thesis} + \pertype{mastersthesis}%兼容老的mastersthesis和phdthesis类型 + \pertype{phdthesis} + \step[fieldset=usera, fieldvalue={D}] + \step[fieldsource=publisher]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + } + \map{ + \pertype{online} + \pertype{electronic}%兼容老的electronic类型 + \pertype{www}%兼容老的www类型 + \step[fieldset=usera, fieldvalue={EB}] + \step[fieldsource=publisher]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval]%因为online的出版项处理类似手册 + \step[fieldsource=organization]%有时会把organization和institution混淆,处理后使用institution,以增强兼容性 + \step[fieldset=institution, origfieldval] + } + \map{ + \pertype{manual} + \step[fieldset=usera, fieldvalue={A}] + \step[fieldsource=edition]%有时会把version和edition混淆,处理后使用version + \step[fieldset=version, origfieldval] + \step[fieldsource=publisher]%有时会把publisher和institution混淆,处理后使用institution + \step[fieldset=institution, origfieldval] + \step[fieldsource=organization]%有时会把organization和institution混淆,处理后使用institution,以增强兼容性 + \step[fieldset=institution, origfieldval] + } + \map{ + \pertype{unpublished} + \step[fieldset=usera, fieldvalue={Z}] + } + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={author}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={editor}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={translator}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map[overwrite]{%用于处理zotero从cnki导出中文文献姓名中存在逗号的情况 + \step[fieldsource={bookauthor}, match=\regexp{([\x{2FF0}-\x{9FA5}])\,\s*}, replace=\regexp{$1}] + }% + \map{%处理一些用year表示date的情况 + %这样处理将会设置date域,并使得labeldatesource变为空,因为date的前缀为空(如果是urldate,那么labeldatesource就是url)。 + %同时date域会被biblatex自动解析为year,month,day,并且覆盖原来的year信息 + \step[fieldsource=year] + \step[fieldset=date, origfieldval] + } + \map{%将entrykey放入keywords中用于后期使用 + \step[fieldsource=entrykey] + \step[fieldset=keywords, origfieldval] + } + \map{%文献题名的中文判断,将信息保存到userd中,避免因为标签生成原因导致title域被清除而产生问题 + \step[fieldsource=title, match=\regexp{[\x{2FF0}-\x{9FA5}]},final]% + \step[fieldset=userd, fieldvalue={chinese}] + } + \map{\step[fieldsource=title,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userd,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=title,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userd,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=title,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userd,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=title,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userd,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userd,且存在title域的默认设置为英文 + \step[fieldsource=title,final] + \step[fieldset=userd,fieldvalue={english}] + } + \map{%作者的中文判断 + \step[fieldsource=author, match=\regexp{[\x{2FF0}-\x{9FA5}]},final] + \step[fieldset=userf, fieldvalue={chinese}] + } + \map{\step[fieldsource=author,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userf,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=author,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userf,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=author,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userf,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=author,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userf,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userf,且存在author域的默认设置为英文 + \step[fieldsource=author,final] + \step[fieldset=userf,fieldvalue={english}] + } + \map{%译者的中文判断 + \step[fieldsource=translator, match=\regexp{[\x{2FF0}-\x{9FA5}]},final] + \step[fieldset=usere, fieldvalue={chinese}] + } + \map{\step[fieldsource=translator,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=usere,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=translator,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=usere,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=translator,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=usere,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=translator,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=usere,fieldvalue={korean}]%韩语 + } + \map{%将没有设置usere,且存在translator域的默认设置为英文 + \step[fieldsource=translator,final] + \step[fieldset=usere,fieldvalue={english}] + } + \map{%编者的中文判断 + \step[fieldsource=editor, match=\regexp{[\x{2FF0}-\x{9FA5}]},final]%直接匹配cjk字符,unicode编码位置从2FF0到9FA5 + \step[fieldset=userc, fieldvalue={chinese}] + } + \map{\step[fieldsource=editor,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userc,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=editor,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userc,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=editor,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userc,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=editor,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userc,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userc,且存在editor域的默认设置为英文 + \step[fieldsource=editor,final] + \step[fieldset=userc,fieldvalue={english}] + } + \map{%编者的中文判断 + \step[fieldsource=bookauthor, match=\regexp{[\x{2FF0}-\x{9FA5}]},final]%直接匹配cjk字符,unicode编码位置从2FF0到9FA5 + \step[fieldset=userb, fieldvalue={chinese}] + } + \map{\step[fieldsource=bookauthor,match=\regexp{[\x{0100}-\x{017F}]},final]%\x80-\xFF + \step[fieldset=userb,fieldvalue={french}]%法语,0080开始到00ff的字符没法匹配有点奇怪 + } + \map{% + \step[fieldsource=bookauthor,match=\regexp{[\x{0400}-\x{052F}]},final] + \step[fieldset=userb,fieldvalue={russian}]%俄语 + } + \map{% + \step[fieldsource=bookauthor,match=\regexp{[\x{3040}-\x{30FF}\x{31F0}-\x{31FF}]},final] + \step[fieldset=userb,fieldvalue={japanese}]%日语 + } %确定形式后可增加类似andotherscn这样的本地化字符串处理 + \map{% + \step[fieldsource=bookauthor,match=\regexp{[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]},final] + \step[fieldset=userb,fieldvalue={korean}]%韩语 + } + \map{%将没有设置userc,且存在editor域的默认设置为英文 + \step[fieldsource=bookauthor,final] + \step[fieldset=userb,fieldvalue={english}] + } + \map{\step[fieldsource=userd,final]%userd存在则用根据标题的语言设定language + \step[fieldset=language,origfieldval]%本身language存在则不设定 + } + \map{\step[fieldsource=userf,final]%userd不存在,而userf存在则根据author的语言设定language + \step[fieldset=language,origfieldval] + }%如果没有作者和标题,那么剩下的最可能有意义的只有网址了,而网址通常是英文的,因此不用再进一步对其它域进行判断了。 + \map{%将没有设置的language设置成en,即认为不是中文的就是英文的。 + \step[fieldset=language,fieldvalue={english}] + } + \map{%一条文献的语言已经设定在language域中,由于出版项相关宏中使用userd判断, + %所以将一条文献的主体语言设定到userd中,本身前面userd已经设定,但没有处理无标题的情况, + %这里的处理等价于没有标题时,利用作者的语言设定userd,再没有作者,则默认用英文设定userd + \step[fieldsource=language] + \step[fieldset=userd,origfieldval] + } + \map{%当文献给出language域时,设置文献要使用的本地化字符串的语言 + %biblatex 3.11及以下版本仅有match是区分大小写的,而3.12版开始用matchi来区分大小,而match不区分 + %这里为兼容3.11及以下版本,所以用一个复杂一点的正则表达式 + \step[fieldsource=language,match=\regexp{(e|E)(n|N)(g|G)(l|L)(i|I)(s|S)(h|H)},final] + \step[fieldset=langid,fieldvalue={english}] + \step[fieldset=lansortorder,fieldvalue=\lanenorder] + } + \map{ + \step[fieldsource=language,match=\regexp{(r|R)(u|U)(s|S)(s|S)(i|I)(a|A)(n|N)},final] + \step[fieldset=langid,fieldvalue={russian}] + \step[fieldset=lansortorder,fieldvalue=\lanruorder] + } + \map{% + \step[fieldsource=language,match=\regexp{(f|F)(r|R)(e|E)(n|N)(c|C)(h|H)},final] + \step[fieldset=langid,fieldvalue={french}] + \step[fieldset=lansortorder,fieldvalue=\lanfrorder] + } + \map{% + \step[fieldsource=language,match=\regexp{(c|C)(h|H)(i|I)(n|N)(e|E)(s|S)(e|E)},final]%中日韩语目前都用english, + \step[fieldset=langid,fieldvalue={english}] + \step[fieldset=lansortorder,fieldvalue=\lancnorder] + } + \map{% + \step[fieldsource=language,match=\regexp{(j|J)(a|A)(p|P)(a|A)(n|N)(e|E)(s|S)(e|E)},final]%中日韩语目前都用english, + \step[fieldset=langid,fieldvalue={english}] + \step[fieldset=lansortorder,fieldvalue=\lanjporder] + } + \map{% + \step[fieldsource=language,match=\regexp{(k|K)(o|O)(r|R)(e|E)(a|A)(n|N)},final]%中日韩语目前都用english, + \step[fieldset=langid,fieldvalue={english}] + \step[fieldset=lansortorder,fieldvalue=\lankrorder] + } +} +} + + +% +% 修改输入的参考文献数据,样式层的操作 +% + \DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map{%尝试未定义数据模型的standard类型映射为其他类型book或inbook, + %standard类型在blx-dm中有出现,但仅定义了类型,域和约束等都没有定义 + %因为可能要映射两种类型,所以不能在驱动层处理,因为要做判断 + \step[fieldsource=booktitle,final]%当存在booktitle域是映射为inbook + \step[typesource=standard, typetarget=inbook, final] + } + \map{%剩下的全部映射为book + \step[typesource=standard, typetarget=book, final] + } +% \map{%先于标准样式的driver层映射,以取消type设置 +% \step[typesource=mastersthesis, typetarget=thesis, final] +% %\step[fieldset=type, fieldvalue=mathesis] +% } +% \map{%先于标准样式的driver层映射,以取消type设置 +% \step[typesource=phdthesis, typetarget=thesis, final] +% %\step[fieldset=type, fieldvalue=phdthesis] +% } + \map{%先于标准样式的driver层映射,以取消type设置 + \step[typesource=techreport, typetarget=report, final] + %\step[fieldset=type, fieldvalue=techreport] + } + \map{% + \pertype{report} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=report,typetarget=online] + \step[fieldset=note,fieldvalue={report}] + } + \map{% + \pertype{thesis} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=thesis,typetarget=online] + } + \map{% + \pertype{manual} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=manual,typetarget=online] + } + \map{% + \pertype{unpublished} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=unpublished,typetarget=online] + } + \map{% + \pertype{database} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=databasetypetarget=online] + } + \map{% + \pertype{dataset} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=dataset,typetarget=online] + } + \map{% + \pertype{software} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=software,typetarget=online] + } + \map{% + \pertype{map} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=map,typetarget=online] + } + \map{% + \pertype{archive} + %biblatex3.7以下版本用如下方式来替代,address和location已在sourcemap中同步 + \step[fieldset=location,fieldvalue={}] + \step[fieldsource=location,notmatch=\regexp{.},final]%地址不存在且存在url那么转变为online + %3.7以上版本用notfield + %\step[notfield=address,final]%当address不存在则继续 + \step[fieldsource=url,final]%地址不存在且存在url那么转变为online + \step[typesource=archive,typetarget=online] + } + \map[overwrite]{%这里还必须有overwrite,注意不同版本存在差异,比如texlive2015变16后biber有变化(20161207修改正确) + \step[fieldsource=note, final]%将note域信息复制给keywords,用于输出时容易区分标准和报纸 + \step[fieldset=keywords, fieldvalue={,}, append] + \step[fieldset=keywords, origfieldval, append] + } + \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{ + \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}] + } + \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{ + \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}] + } + \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,% + address,location,institution,organization}]{ + \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}] + } + } + } + +% +% 佚名/noauthor的处理 +% +% 原理方法:利用样式层的动态数据修改实现 +\def\dealnoathor{ + \DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map{%默认情况下将空缺作者的中文文献设置为佚名 + \step[fieldsource=language,match={chinese},final] + \step[fieldset=author, fieldvalue={佚名}] + } + \map{%默认情况下将空缺作者的英文文献设置为A{non} + \step[fieldsource=language,match={english},final] + \step[fieldset=author, fieldvalue={A{non}}]%noauthor换成Anon,同时为避免大写还加了{} + } + } + } +} + +% +% 不同语言分集调整的实现方式 +% +% 原理方法:利用样式层的动态数据修改lansortorder域来实现排序 +\def\dealsortlan{ + \DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map[overwrite]{%当文献给出language域时,设置文献要使用的本地化字符串的语言 + \step[fieldsource=language,match=english,final] + \step[fieldset=lansortorder,fieldvalue=\lanenorder] + } + \map[overwrite]{ + \step[fieldsource=language,match=russian,final] + \step[fieldset=lansortorder,fieldvalue=\lanruorder] + } + \map[overwrite]{% + \step[fieldsource=language,match=french,final] + \step[fieldset=lansortorder,fieldvalue=\lanfrorder] + } + \map[overwrite]{% + \step[fieldsource=language,match=chinese,final]%中日韩语目前都用english, + \step[fieldset=lansortorder,fieldvalue=\lancnorder] + } + \map[overwrite]{% + \step[fieldsource=language,match=japanese,final]%中日韩语目前都用english, + \step[fieldset=lansortorder,fieldvalue=\lanjporder] + } + \map[overwrite]{% + \step[fieldsource=language,match=korean,final]%中日韩语目前都用english, + \step[fieldset=lansortorder,fieldvalue=\lankrorder] + } + } + } +} + + + + +% +%驱动别名等价于驱动层映射 +% +\DeclareBibliographyAlias{newspaper}{article}% +\DeclareBibliographyAlias{inproceedings}{inbook}%会议论文文献类型驱动 +\DeclareBibliographyAlias{conference}{inbook}%会议论文文献类型驱动 +\DeclareBibliographyAlias{incollection}{inbook}%文集中析出文献类型驱动 +\DeclareBibliographyAlias{collection}{book}%%文集类型驱动 +\DeclareBibliographyAlias{proceedings}{book}%会议论文集文献类型驱动 +\DeclareBibliographyAlias{thesis}{manual}%学位论文驱动 +\DeclareBibliographyAlias{unpublished}{manual}%其它类型驱动 +\DeclareBibliographyAlias{database}{manual} +\DeclareBibliographyAlias{dataset}{manual} +\DeclareBibliographyAlias{software}{manual} +\DeclareBibliographyAlias{map}{manual} +\DeclareBibliographyAlias{archive}{manual} + + +%===================================================================== +% 设置排序格式 +%===================================================================== +% +% 排序格式,用降序,及userb域,针对biblatex3.8及以上版本 +% + \DeclareSortingTemplate{gb7714-2015}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{lansortorder}%language + } + \sort{%[direction=descending] + \field{sortname} + \field{author} + \field{editor} + \field{translator} + \field{sorttitle} + \field{title} + } + \sort{ + \field{sortyear} + \field{year} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field{volume} + \literal{0} + } + } + + %降序的nyt + \DeclareSortingTemplate{gbnytd}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{lansortorder}%language + } + \sort[direction=descending]{% + \field{sortname} + \field{author} + \field{editor} + \field{translator} + \field{sorttitle} + \field{title} + } + \sort{ + \field{sortyear} + \field{year} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field{volume} + \literal{0} + } + } + + %降序的ynt + \DeclareSortingTemplate{gbyntd}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{lansortorder}%language + } + \sort[direction=descending]{ + \field{sortyear} + \field{year} + } + \sort{% + \field{sortname} + \field{author} + \field{editor} + \field{translator} + \field{sorttitle} + \field{title} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field{volume} + \literal{0} + } + } + + %升序的ynt + \DeclareSortingTemplate{gbynta}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{lansortorder}%language + } + \sort{%[direction=ascending] + \field{sortyear} + \field{year} + } + \sort{% + \field{sortname} + \field{author} + \field{editor} + \field{translator} + \field{sorttitle} + \field{title} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field{volume} + \literal{0} + } + } + +%===================================================================== +% 参考文献表环境 +%===================================================================== +% +% 列表格式 +% +% 增加一个\bibitemindent尺寸用于控制list环境的itemindent +% v1.0l,20180615,hzz +\setlength{\bibhang}{\biblabelsep}% +\newlength{\bibitemindent} +\setlength{\bibitemindent}{0pt} + + +\defbibenvironment{bibliography} + {\list + {\printtext[labelnumberwidth]{% + \printfield{labelprefix}% + \printfield{labelnumber}}} + {\setlength{\labelwidth}{\labelnumberwidth}% + \setlength{\labelsep}{\biblabelsep}% + \setlength{\leftmargin}{\bibhang}% + \addtolength{\leftmargin}{\labelnumberwidth}% + \setlength{\itemindent}{\bibitemindent}% + \setlength{\itemsep}{\bibitemsep}% + \setlength{\parsep}{\bibparsep}}% + \renewcommand*{\makelabel}[1]{\hss##1}} + {\endlist} + {\item} + +% +% 顺序编码制-标签对齐方式处理 +% +% 原理方法:利用选项提供的计数器数值做选择 +% 左对齐,右对齐为list环境下的处理,此时list环境的\labelwidth只能设置一个,是最宽标签的宽度 +% 项对齐则是在段落环境下做的处理。 +% 左对齐时,参考文献各项内容对齐,序号标签与参考文献项内容的间距可变 +% 右对齐时,参考文献各项内容对齐,序号标签与参考文献项内容的间距相等,标签与页边距离可变 +% 项对齐时,序号标签贴在页边,序号标签与参考文献项内容的间距相等 +% 修改序号标签格式为: +% \DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}} %源来自numeric.BBX +% \DeclareFieldFormat{labelnumberwidth}{\ttfamily\mkbibbrackets{#1}\hfill} +\DeclareFieldFormat{labelnumberwidth}{% +\ifcase\value{gbalignlabel}%右对齐,整个标签为右对齐 + \mkgbnumlabel{#1}% +\or%左对齐,整个标签为左对齐 + \mkgbnumlabel{#1}\hfill% +\or%中间对齐,比如:序号数字居于[]中间 + \hfil\mkgbnumlabel{\hfill#1\hfill}\hfil% +\fi} + +% +% 修改序号标签格式为以各条参文献为基础进行对齐的方式,即序号与条目内容间隔相等的方式。 +\def\setaligngbstyle{% +\def\blx@bibitem##1{% + \blx@ifdata{##1} + {\begingroup + \blx@getdata{##1}% + \blx@bibcheck + \iftoggle{blx@skipentry}{}{% + \blx@setdefaultrefcontext{##1}% + \global\let\blx@noitem\@empty + \blx@setoptions@type\abx@field@entrytype + \blx@setoptions@entry + \blx@thelabelnumber + \addtocounter{instcount}\@ne + \blx@initsep + \blx@namesep + \csuse{blx@item@\blx@theenv}\relax +% \blx@initsep %移动到上面去,恢复bibnamesep等的作用机制 +% \blx@namesep + \csuse{blx@hook@bibitem}% + \blx@execute + \blx@initunit + \blx@anchor + \blx@beglangbib + \bibsentence + \blx@pagetracker + \blx@driver\abx@field@entrytype + \blx@postpunct + \blx@endlangbib}% + \par\endgroup}%这里增加了一个\par + {}} +\newlength{\lengthid} +\newlength{\lengthlw} +\newcommand{\itemcmd}{% +\settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} +\addtolength{\lengthid}{\biblabelsep} +\setlength{\lengthlw}{\textwidth} +\addtolength{\lengthlw}{-\lengthid} +\addvspace{\bibitemsep}%恢复\bibitemsep的作用 +%\parshape 2 0em \textwidth \lengthid \lengthlw +\hangindent\lengthid +\mkgbnumlabel{\printfield{labelnumber}}% +\hspace{\biblabelsep}} +% +% 简单的段落环境 +\defbibenvironment{bibliography} +{\begingroup\setlength{\parindent}{0em}} +{\endgroup} +{\itemcmd}} + + +%===================================================================== +% 设置单元或块等的标点 +%===================================================================== +\renewrobustcmd*{\bibinithyphendelim}{\addhighpenspace}%用于处理姓名中名部分存在-的情况,比如ZHANG Yu-xin +\renewcommand*{\subtitlepunct}{\addcolon\addspace} %修改标题和其它标题信息间的标点,来源biblatex.def, +% +% 利用set实现的多语言文献不同语言间的分隔符 +% 20170411,双语之间用newline替换par,避免采用gb7714-2015的项对齐方式第二语言间分段导致没有缩进 +% +% 原理方法:set方法可以参考3.11.5 Entry Sets,4.11.1 Entry Sets +% 这里调整一下两种语言参考文献的间隔,源来自biblatex.def +\renewcommand*{\entrysetpunct}{\adddot\newline\nobreak} +\renewcommand*{\bibpagespunct}{\addcolon\addthinspace}%%页码引用格式的修改,修改为用冒号 +%\renewcommand{\relateddelim}{}%\par + +%===================================================================== +% 修改域的格式,重定义域的输出宏 +%===================================================================== +% +% 新增文献类型标识符的格式 +% []前的nobreak,从GB4.1节的例子看不应该加,所以去掉 +% 但因为考虑到cjk字符和[]之间可能添加空格,所以仍然加上 +% 而[]中间的内容,从4.6.2节的例子看也是可以分割的,因此内部的nobreak也可以去掉 +% +\DeclareFieldFormat{gbtypeflag}{% +\iftoggle{bbx:url}% + {\iffieldundef{url}%当存在url时,增加一个OL标识符 + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}% + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}% + }% + {\ifentrytype{online}% + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}% + {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}% + }% +} + +% +% 新增用于报纸的文献类型标识符的格式 +% +\DeclareFieldFormat{gbtypeflagn}{%用于报纸newspaper +\iftoggle{bbx:url}% + {\iffieldundef{url}%当存在url时,增加一个OL标识符 + {\nobreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% + {\nobreak\printtext{[}\nobreak N\printtext{\texttt{/}OL]}\nobreak}% + }% + {\nobreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% +} + +% +% 新增用于标准的文献类型标识符的格式 +% +\DeclareFieldFormat{gbtypeflags}{%用于标准standard +\iftoggle{bbx:url}% + {\iffieldundef{url}%当存在url时,增加一个OL标识符 + {\nobreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% + {\nobreak\printtext{[}\nobreak S\printtext{\texttt{/}OL]}\nobreak}% + }% + {\nobreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}% +} + +% +% 重设title等参考文献信息的输出格式 +% +% 原理方法:修改来自biblatex.def文件的原格式 +\newcommand{\bibtitlefont}{} +\newcommand{\bibauthorfont}{} +\newcommand{\bibpubfont}{} + +\DeclareFieldFormat{title}{#1\adddot\addthinspace} +\DeclareFieldFormat{journaltitle}{#1\isdot}%添加\isdot用于缩写名带点情况,将其转换为缩写点,便于标点的追踪 +\DeclareFieldFormat{issuetitle}{#1} +\DeclareFieldFormat{maintitle}{#1} +\DeclareFieldFormat{booktitle}{#1} +\DeclareFieldFormat%将期刊等文献的标题中原来带的引号去掉 + [article,patent,thesis,unpublished] + {title}{#1\adddot\addthinspace}%\mkbibquote{#1\isdot} +\DeclareFieldFormat%将期刊等文献的标题中原来带的引号去掉 + [inbook,incollection,inproceedings] + {title}{#1}%\nopunct\unspace +\DeclareFieldFormat{url}{\url{#1}} %%url相关输出,url域修改如本行,源来自biblatex.def +\def\UrlFont{\rmfamily}%设置url字体为roman字体%\ttfamily +%\urlstyle{rm} %使用这句也一样 +\setcounter{biburlnumpenalty}{100} %让url可以在数字后断行 +\setcounter{biburlucpenalty}{100} %让url可以在大写字母后断行 +\setcounter{biburllcpenalty}{100} %让url可以在小写字母后断行 +\DeclareFieldFormat{doi}{% + \rmfamily{DOI}\addcolon\space + \ifhyperref + {\href{https://doi.org/#1}{\nolinkurl{#1}}} + {\nolinkurl{#1}}} +% +% 标题的字母大小写格式修改 +% +% 注意:修改标题的字母大小写,不能用前面的title的格式而要用titlecase +% 因为titlecase is applied to the contents of the field directly,title is not +%\DeclareFieldFormat{titlecase}{\MakeCapital#1}%重设标题格式,将其修改为首字母大写 +\DeclareFieldFormat{titlecase}{\iftoggle{bbx:titlelink}{% +\iffieldundef{url}{\MakeCapital#1}{% +\href{\thefield{url}}{#1}}}{\MakeCapital#1}}%重设标题格式,将其修改为首字母大写 +\DeclareFieldFormat{pages}{#1}%去掉前面引导页码的pp.等字符,\mkpageprefix[bookpagination]{#1} +\DefineBibliographyExtras{english}{\renewcommand*{\bibrangedash}{-}}%将页码间隔符替换会英文的短横线 + +\def\execgbfdfmtstd{%恢复到标准样式的设置 +\DeclareFieldFormat{title}{\mkbibemph{##1}} +\DeclareFieldFormat + [article,inbook,incollection,inproceedings,patent,thesis,unpublished] + {title}{\mkbibquote{##1\isdot}} +\DeclareFieldFormat + [suppbook,suppcollection,suppperiodical] + {title}{##1} +\DeclareFieldFormat{journaltitle}{\mkbibemph{##1}} +\DeclareFieldFormat{issuetitle}{\mkbibemph{##1}} +\DeclareFieldFormat{maintitle}{\mkbibemph{##1}} +\DeclareFieldFormat{booktitle}{\mkbibemph{##1}} +\DeclareFieldFormat{url}{\mkbibacro{URL}\addcolon\space\url{##1}} +\DeclareFieldFormat{titlecase}{##1} +\DeclareFieldFormat{pages}{\mkpageprefix[bookpagination]{##1}} +} + +% +% 文献标题后的标点问题 +% v1.0k,20180405,为texlive2017以上版本中的beamer兼容性做的处理,Hu Zhenzhen +% +% 原理方法:如下代码处理texlive2017以上版本中,beamer中文献的标题后出现两个点的情况: +% texlive2017以上的beamer中对macro{title}做了patch,正常情况下不会出现两个点的情况,但由于 +% 之前为了处理texlive2015,2016下的title格式添加了adddot,导致出现两个点的情况,而且也影响 +% 析出文献的//符号的输出,因此再次对macro{title}做patch消除beamer中做apptocmd时添加的\newunitpunct + {%texlive 2017对应iftlseven以上版本 + \@ifclassloaded{beamer}{ + \DeclareFieldFormat{title}{#1}% + \DeclareFieldFormat[article,patent,thesis,unpublished]{title}{#1} + \AtBeginDocument{% + \patchcmd{\abx@macro@title}{\newunitpunct}{}{}{}}}{} + } + + +% +% 修改译者位置格式 +% +% 原理方法:修改来自biblatex.def文件的bytranslator+others宏的格式 +\renewbibmacro*{bytranslator+others}{% + \ifnameundef{translator} + {} + {%\usebibmacro{bytranslator+othersstrg} + %\setunit{\addspace}% + \printnames[bytranslator]{translator}% + \clearname{translator}% + %从macro*{bytranslator+othersstrg}%中可以看到当地化字符串格式的引用前的代码处理 + %比如生成cotranslator等用于调用cotranslator所代表的当地化字符串 + \usebibmacro{bytranslator+othersstrg}%“译”的位置换到下面来,即放到译者后面。 + %\setunit{\addspace}% + \newunit}% + \usebibmacro{withothers}} + + +% +% 修改作者数量超过限定值,做省略时的处理格式 +% v1.0,20160701,hzz +% v1.0O,20190103,hzz,修改利用新定义的一个分隔符strandothersdelim +% +% 原理方法:判断作者或译者是否中文,若中文用字符等,否则用et al. 。 +% \printnames由start-stop控制项数,默认是1和maxnames/minnames +\renewbibmacro*{name:andothers}{% + \ifboolexpr{ + test {\ifnumequal{\value{listcount}}{\value{liststop}}} + and + test \ifmorenames + }{\ifnumgreater{\value{liststop}}{1}%注意这里试图去区分姓名总数大于1的情况,当姓名总数大于1时,最后一个姓名后面先加入一个\finalandcomma + {\finalandcomma}%目前国标没有这样的区分要求,如果有需要也是可以这么去做的。 + {}% +\printdelim{andothersdelim}\printdelim{strandothersdelim}% +}{%当是译者的时候需要特殊处理:从7.2节看等,译前面加逗号,但从示例看等和译同时出现时,译前的逗号没有,比如: +%袁训来, 陈哲, 肖书海, 等. +%胡泳, 范海燕, 译. +%潘惠霞, 魏婧, 杨艳, 等译. +\ifcurrentname{translator}{\addcomma\addthinspace}{}%为了实现上述第二个示例情况做的处理 +}} + + +% +% 修改省略作者后的本地化字符串,比如et al. +% v1.0o,20190103,hzz +% +% 原理方法:默认情况下判断作者或译者是否中文,若中文用字符andotherscn=“等”,否则用andothers=“et al.”。 +% 非默认情况,根据选项信息,选择选择强制中文或英文 +% 首先设置全局的,然后设置文献表中的,这一等价于将所有的cite命令环境都设置过了 +% 而不用对每一个引用命令单独设置,比如cite,parancite,textcite都设置 +\DeclareDelimFormat{strandothersdelim}{% + \edef\userfieldabcde{userd}%这里使用\iffieldequalstr{labelnamesource}替代ifcurrentname因为标注中使用ifcurrentname无效 + \iffieldequalstr{labelnamesource}{translator}{\edef\userfieldabcde{usere}}{}% + \iffieldequalstr{labelnamesource}{editor}{\edef\userfieldabcde{userc}}{}% + \iffieldequalstr{labelnamesource}{author}{\edef\userfieldabcde{userf}}{}% + \iffieldequalstr{labelnamesource}{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbcitelocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\ifbibstring{andothersincitecn}{\bibstring{andothersincitecn}}{\bibstring{andothers}}}{}%中文已经通过english本地化字符串定义 + \iffieldequalstr{\userfieldabcde}{korean}{\ifbibstring{andotherskr}{\bibstring{andotherskr}}{\bibstring{andothers}}}{}%韩语未定义,所以与bib中一致 + \iffieldequalstr{\userfieldabcde}{japanese}{\ifbibstring{andothersjp}{\bibstring{andothersjp}}{\bibstring{andothers}}}{}%日与同韩语 + \iffieldequalstr{\userfieldabcde}{english}{\ifbibstring{andothersincite}{\bibstring{andothersincite}}{\bibstring{andothers}}}{}%英语已定义 + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{andothers}}{}%法语未定义,若要定义需要针对french本地化字符串定义 + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{andothers}}{}%俄语未定义,若要定义需要针对russian本地化字符串定义 + \or% + \bibstring{andothersincitecn}% + \or% + \bibstring{andothersincite}% + \fi} + + +\DeclareDelimFormat[bib,biblist]{strandothersdelim}{% + \edef\userfieldabcde{userd}% + \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andotherscn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andotherskr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andothersjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\bibstring{andothers}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{andothers}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{andothers}}{}% + \or% + \bibstring{andotherscn}% + \or% + \bibstring{andothers}% + \fi} + +% +% 修改最后一个作者前的字符串,比如 and +% v1.0o,20190103,hzz +% +% 原理方法:默认情况下判断作者或译者是否中文,若中文用字符andcn=“和”,否则用and=“and”。 +% 非默认情况,根据选项信息,选择选择强制中文或英文 +% 首先设置全局的,然后设置文献表中的,这一等价于将所有的cite命令环境都设置过了 +% 而不用对每一个引用命令单独设置,比如cite,parancite,textcite都设置 +\DeclareDelimFormat{finalnamedelim}{% + \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% + \addspace% + \edef\userfieldabcde{userd}% + \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbcitelocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andincitecn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andkr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\bibstring{andincite}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{and}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{and}}{}% +\space% + \or% + \bibstring{andincitecn}\space% + \or% + \bibstring{andincite}\space% + \fi} + +\DeclareDelimFormat[bib,biblist]{finalnamedelim}{% + \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% + \addspace% + \edef\userfieldabcde{userd}% + \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andcn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andkr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\bibstring{and}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{and}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{and}}{}% +\space% + \or% + \bibstring{andcn}\space% + \or% + \bibstring{and}\space% + \fi} + + +% +% 重设title的输出 +% +% 20180425,v1.0k,为标题增加字体控制命令,Hu Zhenzhen +% 原理方法:将文献类型标识符输出出去,原输出来自biblatex.def文件 +% 利用toggle做标识符是否输出的判断 +\renewbibmacro*{title}{% + \ifboolexpr{% + test{\iffieldundef{title}}% + and + test{\iffieldundef{subtitle}}% + }% + {}% + {\printtext[title]{\bibtitlefont%增加字体控制命令 + \printfield[titlecase]{title}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct}% + \printfield[titlecase]{subtitle}}% + \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 + {\setunit{\subtitlepunct}\printfield{titleaddon}}% + \iftoggle{bbx:gbtype}{% + \iffieldundef{note}{\printfield[gbtypeflag]{usera}}%在标题后直接给出文献标识字母,判断一下,是否是报纸和标准 + {\iffieldequalstr{note}{standard}{\printfield[gbtypeflags]{usera}}%判断是否为标准 + {\iffieldequalstr{note}{news}{\printfield[gbtypeflagn]{usera}}%判断是否为报纸 + {\printfield[gbtypeflag]{usera}}}%其它 + }}{}% + %\iffieldundef{booktitle}{\newunit}{}%当title是析出时,不要标点 + %\newunit +}% +}} + +% +% 作者信息的输出格式 +% +% 20180425,v1.0k,为作者增加字体控制命令,Hu Zhenzhen +% 20180603,v1.0l,增加使用nameformat域来选择姓名格式 +\DeclareNameFormat{namefmtselected}{% +\iffieldundef{namefmtid}{}% +{\defcounter{gbnamefmtcase}{\thefield{namefmtid}}}% +\ifcase\value{gbnamefmtcase}% + \ifgiveninits + {\usebibmacro{name:gbuppercase} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:gbuppercase} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or + \ifgiveninits + {\usebibmacro{name:gblowercase} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:gblowercase} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or + \ifgiveninits + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or + \ifgiveninits + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% +\or +\usebibmacro{name:gbpinyin} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}% +\or + \ifnumequal{\value{listcount}}{1} + {\ifgiveninits + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:family-given} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}% + \ifboolexpe{% + test {\ifdefvoid\namepartgiven} + and + test {\ifdefvoid\namepartprefix}} + {} + {\usebibmacro{name:revsdelim}}} + {\ifgiveninits + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiveni} + {\namepartprefix} + {\namepartsuffix}} + {\usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}}}% +\fi + \usebibmacro{name:andothers}} + +\DeclareNameAlias{default}{namefmtselected}%姓名的默认格式采用可选的模式 +\DeclareNameAlias{sortname}{default}% Used in the bibliography %family-given/given-family +\DeclareNameAlias{citename}{default}% Default used by \citename + +\DeclareDelimFormat[bib,biblist]{andothersdelim}{\addcomma\addspace} +%\DeclareDelimFormat[textcite]{andothersdelim}{\addspace}% + +%GB/T 7714-2015 风格,全部大写 +\newbibmacro*{name:gbuppercase}[4]{\bibauthorfont% +\renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 +\renewcommand*{\revsdnamepunct}{}% + \ifuseprefix% + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifdefvoid{#3}{}{% + \ifcapital% + {\mkbibnameprefix{\MakeCapital{#3}}\isdot}% + {\mkbibnameprefix{#3}\isdot}% + \ifprefchar{}{\bibnamedelimc}}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{\MakeUppercase{#2}}\isdot}%\MakeCapital + \ifdefvoid{#4}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}%后缀前加逗号 + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifboolexpe{% + test {\ifdefvoid{#2}} + and + test {\ifdefvoid{#3}}} + {}{\revsdnamepunct}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{\MakeUppercase{#2}}\isdot}%\MakeCapital + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}% + \ifdefvoid{#4}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}%%后缀前加逗号 +} + +%GB/T 7714-2015 风格,大小写不变,根据bib文件内输入原样输出 +\newbibmacro*{name:gblowercase}[4]{\bibauthorfont% + \renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 + \renewcommand*{\revsdnamepunct}{}%%来源biblatex.def + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifdefvoid{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifprefchar{}{\bibnamedelimc}}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{{#1}}}\isdot% + \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{{#2}}\isdot}%\MakeCapital + \ifdefvoid{#4}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}%后缀前加逗号 + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{{#1}}}\isdot% + \ifboolexpe{% + test {\ifdefvoid{#2}} + and + test {\ifdefvoid{#3}}} + {}{\revsdnamepunct}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{{#2}}\isdot}%\MakeCapital + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot} + \ifdefvoid{#4}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}%%后缀前加逗号 +} + +%中文常见风格,汉语拼音全拼模式 +\newbibmacro*{name:gbpinyin}[4]{\bibauthorfont% +\renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉,%来源biblatex2.STY +\renewcommand*{\revsdnamepunct}{}%%来源biblatex.def +\renewrobustcmd*{\bibnamedelima}{\mbox{-}}% + \ifuseprefix + {\usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \ifdefvoid{#3}{}{% + \ifcapital + {\mkbibnameprefix{\MakeCapital{#3}}\isdot} + {\mkbibnameprefix{#3}\isdot}% + \ifprefchar{}{\bibnamedelimc}}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\MakeSentenceCase{\mkbibnamegiven{#2}}\isdot}%\MakeCapital + \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}} + {\usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \ifdefvoid{#2}{\mkbibnamefamily{\MakeCapital{#1}}}{\mkbibnamefamily{\MakeUppercase{#1}}}\isdot% + \ifboolexpe{% + test {\ifdefvoid{#2}} + and + test {\ifdefvoid{#3}}} + {} + {\revsdnamepunct}% + \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{\MakeCapital{#2}}\isdot}%\MakeCapital + \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot} + \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}% +} + + +% +% url和url日期格式 +% +\renewbibmacro*{url+urldate}{% + %\usebibmacro{url}%%更换url的位置,放到下面 + \iffieldundef{urlyear}% + {}{%\setunit*{\addspace}% + \usebibmacro{urldate}}% + \setunit{\addperiod\addspace}% + \usebibmacro{url}} +\renewbibmacro*{url}{\printfield{url}} + + +% +% 日期信息的输出格式,针对biblatex>=3.10版本 +% + \DeclareFieldFormat{urldate}{#1} + \renewbibmacro*{urldate}{% + \addthinspace\printtext{[}\printurldate\printtext{]}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令 + + % + % 专利的公告日期、或报纸的日期的输出宏 + % 20160701,v1.0,新增加 + % 20180405,为biblatexv3.10版本,出现多出点bug做处理,Hu Zhenzhen + % + % 原理方法:加上printtext避免破坏异步标点机制 + % 本可以用\printdate,但由于date选项设置为year,所以仅会给出年份 + % 所以无法再用选项设置的方法,印象需要用底层的命令 + % 这里可以用\blx@isodate,但用\blx@gbdate试图避免版本判断 + \newbibmacro*{newsdate}{%% + \printtext{\blx@gbdate{}{}}%%\blx@isodate{}{}% + } + + % + \newbibmacro*{modifydate}{%新增加一个带括号的日期,用于表示电子资源的更新和修改日期,而公告日期则按日期格式 + \ifboolexpr{% + test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% + }% + {}%更新或修改日期通常有day信息 + {\iffieldundef{year}{% + \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{(}\printeventdate\printtext{)}}}% + {\printtext{(}\printenddate\printtext{)}}% + }{\iffieldequalstr{year}{}{%因为year存在,但为空 + }{\printtext{(}\blx@gbdate{}{}\printtext{)}}% + }% + }}% + + +% +% biblatex>v3.8版利用related实现双语文献的处理 +% + %为了实现v3.8以上版本的双语文献,采用related的方法代替set方法,因为set方法已经无法实现了, + %因为set不再复制其第一个成员的信息。于是定义一个命令,用于动态的修改数据,即添加related域的信息 + %其中使用了\DeclareStyleSourcemap,但由于其只能出现在导言区中,因此\defdoublelangentry命令也只能出现在导言区中 + \newcommand{\defdoublelangentry}[2]{% + \edef\entrykeya{##1} + \edef\entrykeyb{##2} + \DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map{ + \step[fieldsource=entrykey, match=\entrykeya, final] + \step[fieldset=related, fieldvalue=\entrykeyb] + } + } + } + } + +% +% 关联文献间的分隔符 +% +\renewcommand{\relateddelim}{\adddot\newline\nobreak}%\par,而作者年样式不需要修改,因为没有项对齐的标签问题 + +% +% 关联文献块前的分隔符,针对biblatex>=3.11 +% +% 原理方法:因为增加了begrelateddelim钩子,所以不需要重定义related输出宏 +\renewcommand{\begrelateddelim}{\adddot\newline\nobreak} + + +% +% 调整doi+eprint+url格式 +% +% 原理方法:源来自standard.bbx,因为页码后面直接跟引用日期,没有标点所以去掉其中的标点。 +\renewbibmacro*{doi+eprint+url}{% +% \iftoggle{bbx:doi}%把doi的位置放到url后面 +% {\printfield{doi}} +% {}% + %\newunit\newblock + \iftoggle{bbx:eprint} + {\iffieldundef{eprint}{}{\newunit\usebibmacro{eprint}}} + {}% + %\newunit\newblock + \iftoggle{bbx:url} + {\usebibmacro{url+urldate}} + {} + \newunit\newblock + \iftoggle{bbx:doi} + {\printfield{doi}} + {}} + +% +% 调整页码的格式,即chapter+pages格式 +% +\renewbibmacro*{chapter+pages}{% +\iftoggle{bbx:gbstrict}{}{% + \printfield{chapter}}% + \iffieldundef{pages}{}{%这里增加一个判断,当没有页码时就不输出 + \setunit{\bibpagespunct}% + \printfield{pages}}% + %\newunit %这里的标点去掉 +} + +% +% 当location等出版项超过maxitem缩减后不再输出etal +% +\DeclareListFormat{location}{% + \usebibmacro{list:delim}{#1}% + #1\isdot} +\DeclareListAlias{institution}{location} +\DeclareListAlias{publisher}{location} + +% 新增一个样式用于输出连续出版物的地址,单位,时间, +% 用于periodical连续出版物的出版社和地址的处理 +% +% v1.0k,20180425,为出版信息增加字体控制命令,hzz +% %类似\newbibmacro*{publisher+location+date} +\newbibmacro*{location+institution+date}{\bibpubfont% +\iftoggle{bbx:gbpub}% +{\testCJKfirst{userd}% +\ifboolexpr{% +test {\iflistundef{location}} and test {\iflistundef{institution}}% +}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}% +{\printtext{[S.l.\space :\space s.n.\adddot]}}% +}{% +\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}}{\printtext{[S.l.\adddot]}}}% + {\printlist{location}}% +\addcolon\addspace% +\iflistundef{institution}{% +\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}}{\printtext{\mkbibbrackets{s.n.}}}}% +{\printlist{institution}}}% +\setunit{\addcomma\addspace}% + %\usebibmacro{date}% + \printfield{year}% + \bibrangedash% + \iffieldundef{endyear}{}{\printfield{endyear}}% + \newunit}% +{\printlist{location}% + \iflistundef{institution}% + {\setunit*{\addcomma\space}} + {\setunit*{\addcolon\space}}% + \printlist{institution}% + \setunit*{\addcomma\space}% + \usebibmacro{date}% + \newunit}% +} +% +% 通用的出版社和地址的处理 +% +% 原理方法:当没有出版社地址时,直接判断title的信息是否是中文,若为中文,则写出版地不详,否则用英文的字符表示。 +% 事实上title对于每个文献来说是必须的,所以用它判断是最快的,而且一般标题和出版社的语言是一样的。 +% 注意标准standard类型,因为当没有出版项时直接省略,所以做特殊处理 +\renewbibmacro*{publisher+location+date}{\bibpubfont% +\iftoggle{bbx:gbpub}% +{\testCJKfirst{userd}% + \ifboolexpr{ test {\iflistundef{location}} and test {\iflistundef{publisher}} }% + {\iffieldequalstr{note}{standard}{}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}{\printtext{[S.l.\space :\space s.n.\adddot]}}}}% + {\iflistundef{location}{%\adddot + \iffieldequalstr{note}{standard}{}%%从gbt7714-2015标准第19页看到,标准存在出版项时输出,没有时完全省略。 + {\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}\addcolon\addspace}{\printtext{[S.l.\adddot]}\addcolon\addspace}}}% \bibstring{noaddress} + {\printlist{location}\addcolon\addspace}%%\addcolon\addspace% + \iflistundef{publisher}{% + \iffieldequalstr{note}{standard}{}% + {\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}% + {\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}}}% + {\printlist{publisher}}}% +\setunit*{\addcomma\addspace}%\addcomma\addspace% +\usebibmacro{date}%%\newunit %去掉这个标点 +}% +{\printlist{location}% + \iflistundef{publisher} + {\setunit*{\addcomma\space}} + {\setunit*{\addcolon\space}}% + \printlist{publisher}% + \setunit*{\addcomma\space}% + \usebibmacro{date}%%\newunit + }% +} + +% +% 修改了一个institution+location+date用于manual、report、thesis等类型 +% +% 20180425,v1.0k,增加了字体控制命令,hzz +% 20190105,v1.0o,加了一个编组避免\usebibmacro{date}把month和day信息去掉 +\renewbibmacro*{institution+location+date}{\bibpubfont%当没有institution时不处理。 +{\printlist{location}%%加了一个编组避免\usebibmacro{date}把month和day信息去掉 + \iflistundef{institution} + {\setunit*{\addcomma\space}} + {\setunit*{\addcolon\space}}% + \printlist{institution}% + \setunit*{\addcomma\space}% + \usebibmacro{date}% + %\newunit + }} + +% +% 对volume卷信息格式做出修改 +% v1.0o,20190105,hzz +% +\DeclareFieldFormat{volume}{% +\testCJKfirst{userd}% +\iftoggle{ifCJKforgbt}% +{\bibstring{serialcn}#1\bibstring{volumecn}}% +{\bibstring{volume}~#1}% +}% volume of a book +\DeclareFieldFormat[article,periodical]{volume}{#1}% volume of a journal + +% +% 对number册信息格式做出修改 +% v1.0o,20190105,hzz +% +\DeclareFieldFormat{number}{#1}% +\DeclareFieldFormat[book,collection,inbook,% +incollection,proceedings,inproceedings]{number}{% +\testCJKfirst{userd}% +\iftoggle{ifCJKforgbt}% +{\bibstring{serialcn}#1\bibstring{numbercn}}% +{#1}% +}% + +% +% 对edition版本信息格式做出修改 +% +\DeclareFieldFormat{edition}{%源来自biblatex.DEF +\testCJKfirst{userd}% +\iftoggle{ifCJKforgbt}% +{\ifinteger{#1}% +{\printtext{#1\str@edition}}% +{#1\isdot}}% +{\ifinteger{#1}% +{\mkbibordedition{#1}~\bibstring{edition}}% +{#1\isdot}}} + +% +% 对version的版本信息做出修改 +% +\DeclareFieldFormat{version}{%源来自biblatex.DEF +\testCJKfirst{userd}% +\ifinteger{#1}% +{\iftoggle{ifCJKforgbt}{\printtext{#1\str@edition}}% +{\mkbibordedition{#1}~\bibstring{version}}}% +{#1\isdot}} + +% +% 修改析出文献的文集的标题与附加标题间的符号 +% +\renewbibmacro*{booktitle}{% + \ifboolexpr{ + test {\iffieldundef{booktitle}} + and + test {\iffieldundef{booksubtitle}} + } + {} + {\printtext[booktitle]{\bibtitlefont% + \printfield[titlecase]{booktitle}% + \setunit{\subtitlepunct}% + \printfield[titlecase]{booksubtitle}}% + \newunit%标点换成下一句 + \setunit{\subtitlepunct}}% + \printfield{booktitleaddon}} + + +% +% 调整期刊名的格式 +% +% v1.0k,20180425,增加了字体控制命令,hzz +\renewbibmacro*{journal+issuetitle}{\bibpubfont%源来自standard.bbx + \usebibmacro{journal}% + %\setunit*{\addspace}% + \setunit*{\addcomma\addspace}%修改为增加一个逗号 + \iffieldundef{series} + {} + {\newunit + \printfield{series}% + \setunit{\addspace}}% + %\usebibmacro{volume+number+eid}% + %\setunit{\addspace}% + \usebibmacro{issue+date}% + %\setunit{\addcolon\space}% + \iffieldundef{volume}{}{\setunit{\addcomma\space}}% + %换成逗号和空格 + \usebibmacro{issue}% + \usebibmacro{volume+number+eid}%把卷期放到年份后面 + %\newunit + } + + + +% +% 调整期刊卷和期的格式 +% +\renewbibmacro*{volume+number+eid}{%源来自standard.bbx +\iftoggle{bbx:gbfieldstd}{% + \printfield{volume}% + \setunit*{\adddot}% + \printfield{number}% + \setunit{\addcomma\space}% + \printfield{eid}}{% + \printfield{volume}% + %\setunit*{\adddot}%去掉点号 + %\printfield{number}% + \iffieldundef{number}{}{\printtext{\mkbibparens{\printfield{number}}}}%增加一个圆括号 + \iffieldundef{eid}{}{% + \setunit{\addcomma\space}% + \printfield{eid}}}} + +% +% 调整期刊年份的格式 +% +\renewbibmacro*{issue+date}{%去掉括号 + \printtext{%去掉了[parens] + \iffieldundef{issue} + {%\usebibmacro{date} + \iffieldundef{note}{\usebibmacro{date}}%判断一下,是否是报纸 + {\iffieldequalstr{note}{news}{\usebibmacro{newsdate}}%判断是否为报纸 + {\usebibmacro{date}}% + }}% + {\iftoggle{bbx:gbstrict}{}{\printfield{issue}% + \setunit*{\addspace}}% + %\usebibmacro{date} + \iffieldundef{note}{\usebibmacro{date}}%判断一下,是否是报纸 + {\iffieldequalstr{note}{news}{\usebibmacro{newsdate}}%判断是否为报纸 + {\usebibmacro{date}}% + }}}% + %\newunit + } + +% +% 调整页码前的标点和去掉期刊文章等页码后面的标点 +% +\renewbibmacro*{note+pages}{%源来自standard.bbx + %\printfield{note}%不要note,note用来判断是否是报纸newspaper + \iffieldundef{pages}{}{ + \setunit{\bibpagespunct}% + \printfield{pages}}% + %\newunit + } + + +% +% 编者的符号修改一下 +% v1.0 2016-07-01 +% v1.0q 2019-03-01 hzz 修改editortype前的标点 +% +\renewbibmacro*{editor}{%源来自biblatex.DEF + \ifboolexpr{ + test \ifuseeditor + and + not test {\ifnameundef{editor}} + } + {\printnames{editor}% + \iffieldundef{editortype}%增加一个类型判断,用于存在editortype的情况 + {\setunit\addspace}%当没有editortype时,直接用句点 + {%\setunit{\addcomma\space}% + \usebibmacro{editorstrg}}% + %\clearname{editor} + }% + {}} + +% +% 编者类型做一修改 +% v1.0 2016-07-01 +% v1.0q 2019-03-01 hzz 修改editortype不同语言的不同本地化字符串 +% +\renewbibmacro*{editorstrg}{%源来自biblatex.DEF + \printtext[editortype]{% + \iffieldundef{editortype} + {% +% \ifboolexpr{ %这一段去掉,未定义编者类型情况下不处理 +% test {\ifnumgreater{\value{editor}}{1}} +% or +% test {\ifandothers{editor}} +% } +% {\bibstring{editors}} +% {\bibstring{editor}} + } + {\ifbibxstring{\thefield{editortype}} %定义编者类型情况下处理,以后根据需要修改 + {\ifboolexpr{ + test {\ifnumgreater{\value{editor}}{1}} + or + test {\ifandothers{editor}} + } + {\printdelim{streditortypes}} + {\printdelim{streditortype}}} + {\thefield{editortype}}}% + }} + +% +% 编者类型的本地化字符串输出 +% v1.0q 2019-03-01 hzz +% 能对不同条目类型作格式设置的域格式,能对不同环境做格式设置的分隔符 +% 能对不同文境作设置的包括排序,标签等 +% 这里因为考虑可能标注和文献表中存在不同,所以用分隔符来输出本地化字符串 +% +\DeclareDelimFormat{streditortypes}{% + \edef\userfieldabcde{userd}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{\thefield{editortype}scn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{\thefield{editortype}skr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{\thefield{editortype}sjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}% + \or% + \bibstring{\thefield{editortype}scn}% + \or% + \addcomma\addthinspace\bibstring{\thefield{editortype}s}% + \fi} +% +\DeclareDelimFormat{streditortype}{% + \edef\userfieldabcde{userd}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{\thefield{editortype}cn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{\thefield{editortype}kr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{\thefield{editortype}jp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}% + \or% + \bibstring{\thefield{editortype}cn}% + \or% + \addcomma\addthinspace\bibstring{\thefield{editortype}}% + \fi} + + +% +% bookauthor域的输出, +% v1.0q 2019-03-01 hzz +% 不再对editor和bookauthor做sourcemap,而是下面的宏内逻辑代替, +% 使得除使用bookauthor外也可以使用editor,便于在使用editor时使用editortype +\renewbibmacro*{bybookauthor}{% + \ifnameundef{bookauthor}% + {\ifnameundef{editor}% + {}% + {\ifnamesequal{author}{editor}% + {}{\usebibmacro{editor}}}% + }% + {\ifnamesequal{author}{bookauthor}% + {}{\printnames{bookauthor}}% + }% +} + +% +% 修改期刊的标题 +% +\renewbibmacro*{periodical}{%源来自biblatex.DEF + \iffieldundef{title} + {} + {\printtext[title]{\bibtitlefont% + \printfield[titlecase]{title}% + %\setunit{\subtitlepunct}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct} + \printfield[titlecase]{subtitle}}% + %{}%把编组结束移到后面去 + \iftoggle{bbx:gbtype}{% + \iffieldundef{usera}{}{%在标题后直接给出文献标识字母 + \printfield[gbtypeflag]{usera}}}{} + }} + } + + +% +% 期刊的标题做修改 +% +\renewbibmacro*{title+issuetitle}{%源来自standard.BBX + \usebibmacro{periodical}% + %\setunit*{\addspace}% + \setunit*{\adddot\addspace}%标点修改为句点 + \iffieldundef{series} + {} + {\newunit + \printfield{series}% + \setunit{\addspace}}% + \usebibmacro{periodical+issue}%将issue调整到上面来,并修改 +\iffieldundef{number}{}{%%进一步处理有范围的数字 + \multinumberparser{\thefield{number}}}% + \iffieldundef{volume}% + {\printfield{year}% + \printtext{\mkbibparens{\multinumberfirst}}% + \bibrangedash% + \iffieldundef{endyear}{}{\printfield{endyear}\printtext{\mkbibparens{\multinumbersecond}}}% + }% + {\multivolparser{\thefield{volume}}% + \printfield{year}% + \setunit{\addcomma\space}%将冒号修改为逗号 + \printtext{\multivolfirst}% + \printtext{\mkbibparens{\multinumberfirst}}% + \bibrangedash% + \iffieldundef{endyear}{}{% + \printfield{endyear}% + \setunit{\addcomma\space}%将冒号修改为逗号 + \printtext{\multivolsecond}% + \printtext{\mkbibparens{\multinumbersecond}}}% + }% + \setunit{\addcomma\space}% + \printfield{eid}% + \setunit{\addspace}% + %\usebibmacro{issue+date}% + %\setunit{\addcolon\space}% + \usebibmacro{issue}% + \newunit} + +% +% 新增一个样式用于调整期刊年份的格式,只打印年份 +% +\newbibmacro*{periodical+issue}{% + \printtext{%去掉了[parens] + \iffieldundef{issue} + {%\usebibmacro{date}%修改为下一句 + }% + {\printfield{issue}% + \setunit*{\addspace}% + %\usebibmacro{date}%修改为下一句 + }% + }% + %\newunit +} + +% +% 重设专利title的输出,将文献类型标识符输出出去 +% +\newbibmacro*{patenttitle}{%原输出来自biblatex.def文件 + \ifboolexpr{% + test{\iffieldundef{title}}% + and% + test{\iffieldundef{subtitle}}% + }% + {}% + {\printtext[title]{\bibtitlefont% + \printfield[titlecase]{title}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct}% + \printfield[titlecase]{subtitle}}% + \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 + {\setunit{\subtitlepunct}\printfield{titleaddon}}% + \setunit{\subtitlepunct}\printfield{number}%写专利号 + \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}% + %\iffieldundef{booktitle}{\newunit}{}%当title是析出时,不要标点 + %\newunit + }% +}% +} + + + +% +% 修改in:用于inbook、incollection、inproceedings等类型 +% 2018.04.20,v1.0k,renewed marco,by hzz +% 20190212,v1.0q,增加中英文区分,by hzz +% +% 原理方法:使用bibmacro{in:}改变了以前在driver中直接输出//的方式,同时也简化了标点控制。 +\renewbibmacro*{in:}{% + \iftoggle{bbx:gbpunctin}{\printtext{\texttt{//}\allowbreak}}%\addthinspace + {\setunit{\adddot\addspace}% + \iffieldequalstr{userd}{chinese}% + {\printtext{\bibstring{incn}}}% + {\printtext{\bibstring{in}}}% + }}%\newunit\newblock\intitlepunct + +% +% 修改type域的输出格式 +% 2019.02.12,v1.0q,byhzz +% 使其可以区分中英文输出不同的格式,比如博士论文英文输出PHD thesis,中文则是博士学位论文 +\DeclareFieldFormat{type}% +{\iffieldequalstr{userd}{chinese}% + {\ifbibxstring{#1cn}{\bibxstring{#1cn}}{#1}}% + {\ifbibstring{#1}{\bibstring{#1}}{#1}}% +} + + +% +% 修改series域的输出格式 +% 2019.05.01,v1.0r,byhzz +\renewbibmacro*{series+number}{% + \printfield{series}% + %\setunit*{\addspace}% + %\printfield{number}% + %\newunit + } + +%===================================================================== +%设置驱动格式 +%===================================================================== +% +% book条目类的驱动 +% + \DeclareBibliographyDriver{book}{%源来自standard.bbx文件 + \usebibmacro{bibindex}% + \usebibmacro{begentry}% +\usebibmacro{author/editor+others/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\usebibmacro{maintitle+title}% +\iftoggle{bbx:gbstrict}{}{% +\newunit +\printlist{language}% +\newunit\newblock% +\usebibmacro{byauthor}% +\newunit\newblock}% +\usebibmacro{byeditor+others}% +\newunit +\printfield{edition}% +\newunit\newblock%% +\iftoggle{bbx:gbstrict}{}{% +\iffieldundef{maintitle}% +{\printfield{volume}% +\printfield{part}}% +{}% +\newunit% +\printfield{volumes}% +\newunit\newblock% +\usebibmacro{series+number}}% +\newunit\newblock% +%\printfield{note}% +%\newunit\newblock% +\usebibmacro{publisher+location+date}% +%\newunit\newblock %这里标点去掉 +\usebibmacro{chapter+pages}% + \iffieldundef{url}{}{%当没有网址时也不输出 + \usebibmacro{modifydate}}%带括号的修改或更新日期, +\usebibmacro{doi+eprint+url}%从下面移动到上面来,因为gbt2015的url需直接放在页码后面。 + \newunit\newblock% + \printfield{pagetotal}% + \newunit\newblock% + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock + %\usebibmacro{doi+eprint+url}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + +% +% 期刊文章,连续出版物中的析出文献的格式 +% + \DeclareBibliographyDriver{article}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{bytranslator+others}% + \newunit\newblock + \printfield{version}}% + \newunit\newblock + %\usebibmacro{in:}% 不使用in来表示期刊等连续出版物 + \usebibmacro{journal+issuetitle}% + %\newunit +% \usebibmacro{byeditor+others}% +% \newunit + \usebibmacro{note+pages}% + \iffieldequalstr{note}{news}{}{%当是新闻时不输出修改或更新日期 + \iffieldundef{url}{}{%当没有网址时也不输出 + \usebibmacro{modifydate}}}%带括号的修改或更新日期, + \usebibmacro{doi+eprint+url}%从后面移上来,调整url和页码之间的位置 + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{issn}} + {}% + \newunit\newblock + %\usebibmacro{doi+eprint+url}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + + +% +% 连续出版物的驱动 +% + \DeclareBibliographyDriver{periodical}{%源来自standard.BBX + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{editor}% + %\setunit{\labelnamepunct}\newblock + \newunit\newblock %删除上面一行,添加这一行 + \usebibmacro{title+issuetitle}% + \newunit\newblock% + \usebibmacro{location+institution+date}%添加这一行用于输出地址,单位和时间 + \newunit\newblock%添加这一行 + \iftoggle{bbx:gbstrict}{}{% + \printlist{language}% + \newunit\newblock + \usebibmacro{byeditor}% + \newunit\newblock + \printfield{note}% + \newunit\newblock} + \iftoggle{bbx:isbn} + {\printfield{issn}} + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + +% +% 专利文献驱动 +% + \DeclareBibliographyDriver{patent}{%源来自standard.BBX + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + %\usebibmacro{title}% + \usebibmacro{patenttitle}%给出专利专用的标题输出 + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \printfield{type}% + \setunit*{\addspace}% + %\printfield{number}%已放到patenttitle中处理 + \iflistundef{location} + {} + {\setunit*{\addspace}% + \printtext{%[parens] + \printlist[][-\value{listtotal}]{location}}}% + \newunit\newblock + \usebibmacro{byholder}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \usebibmacro{newsdate}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + +% +% 在线文献驱动 +% +\DeclareBibliographyDriver{online}{%源来自standard.BBX + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{note}}% + \newunit + \printfield{version}% + \newunit\newblock + %\printlist{organization}% + \printlist{institution}% + \newunit\newblock +\ifboolexpr{% +test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% +}{\usebibmacro{date}}% +{\usebibmacro{modifydate}}%修改或更新日期,为带括号的时间 + \usebibmacro{url+urldate}%从下面移上来 + \newunit\newblock + \iftoggle{bbx:eprint} + {\usebibmacro{eprint}} + {}% + \newunit\newblock + %\usebibmacro{url+urldate}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + +% +% 报告类型驱动 +% 当有网址无出版项时,用online输出 +% +\DeclareBibliographyDriver{report}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \usebibmacro{byeditor+others}%增加的译者信息 + \newunit\newblock + \printfield{type}% + \setunit*{\addspace}% + \printfield{number}% + \newunit\newblock + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + \usebibmacro{doi+eprint+url}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isrn}} + {}% + \newunit\newblock +% \usebibmacro{doi+eprint+url}% +% \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + +% +% 论文、手册类型驱动 +% 2016-11-11,增加了译者信息 +% +\DeclareBibliographyDriver{manual}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \usebibmacro{byeditor+others}%增加的译者信息 + \newunit\newblock + \iftoggle{bbx:gbfieldtype}{% + \printfield{type}% + \setunit*{\addspace}}{}% + \printfield{number}% + \newunit\newblock + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{institution+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + \iffieldundef{url}{}{%当没有网址时也不输出修改或更新日期 + \usebibmacro{modifydate}}%修改或更新日期为带括号的时间 + \usebibmacro{doi+eprint+url}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isrn}} + {}% + \newunit\newblock +% \usebibmacro{doi+eprint+url}% +% \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + +% +% 备选类型驱动 +% +% 利用biblatex的misc驱动 +\DeclareBibliographyDriver{misc}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% +\iftoggle{bbx:gbstrict}{}{% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}}% + \newunit\newblock + \printfield{howpublished}% + \newunit\newblock + \printfield{type}% + \newunit + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{institution+location+date}% + %\usebibmacro{organization+location+date}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + +% +% 专著中的析出文献的格式修改 +% +\DeclareBibliographyDriver{inbook}{%源来自standard.bbx + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% +\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\usebibmacro{title}% +\usebibmacro{in:}% +%\printtext{\texttt{//}\addthinspace}% + \usebibmacro{bybookauthor}% + \ifnameundef{bookauthor}{% + \ifnameundef{editor}{}{\newunit}% + }{\newunit}%替换下一句 + %\newunit\newblock +\iffieldundef{series}{}{\usebibmacro{series+number}\setunit{\addcolon\addspace}}%为处理一些存在series的情况而增加 + \usebibmacro{maintitle+booktitle}% +\iffieldundef{volume}{}{\setunit{\addcolon\addspace}\printfield{volume}}% +\iffieldundef{number}{}{\setunit{\addcolon\addspace}\printfield{number}}%增加卷和册信息 + \newunit\newblock% +% \usebibmacro{byeditor+others}% +% \newunit\newblock + \printfield{edition}% + \newunit + \iftoggle{bbx:gbstrict}{}{% +% \iffieldundef{maintitle} +% {\printfield{volume}% +% \printfield{part}} +% {}% +% \newunit +% \printfield{volumes}% +% \newunit\newblock +% \usebibmacro{series+number} + }% + \newunit\newblock + %\printfield{note}% + %\newunit\newblock + \usebibmacro{publisher+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}%移到上面来 + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock +% \usebibmacro{doi+eprint+url}% +% \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{finentry}\usebibmacro{annotation}} + + +% +%针对不同refsection做不同的格式处理的代码 +% + +% +%默认采用顺序编码制,因此只需增加的是作者年制 +\newrobustcmd{\setaystylesection}[1]{\csxdef{gb@aystyle@section#1}{#1}} + +% +%在AtBeginBibliography处已经无法重定义defbibenvironment{bibliographyay} +%所以输出只能是用另外定义的环境来实现 +%可以在refsection后面做patch +%为排序引入newrefcontext +\apptocmd{\refsection}{ +\edef\gb@refsecnum{\number\c@refsection}% +\ifcsdef{gb@aystyle@section\gb@refsecnum}% +{ +\newrefcontext[sorting=gb7714-2015] + +\setlength{\bibhang}{1em} +\setlength{\bibitemindent}{-\bibhang} +\defbibenvironment{bibliography} + {\list + {} + {\setlength{\leftmargin}{\bibhang}% + \setlength{\itemindent}{\bibitemindent}% + \setlength{\itemsep}{\bibitemsep}% + \setlength{\parsep}{\bibparsep}}} + {\endlist} + {\item} +}{} +}{}{} + +% +%为排序引入endrefcontext +% +\pretocmd{\endrefsection}{ +\edef\gb@refsecnum{\number\c@refsection}% +\ifcsdef{gb@aystyle@section\gb@refsecnum}% +{\endrefcontext}{} +}{}{} + +%因为是整个文献表,在打印文献表的时候,增加钩子代码 +%因为下面的钩子是在defbibenvironment的begincode之后,所以对于defbibenvironment相关的设置都是无效的 +\AtBeginBibliography{ + +\edef\gb@refsecnum{\number\c@refsection}% +\ifcsdef{gb@aystyle@section\gb@refsecnum}% +%\ifboolexpr{ +%not test {\ifcsundef{gb@aystyle@section\gb@refsecnum}} +%and +%test {\ifcsequal{gb@refsecnum}{gb@aystyle@section\gb@refsecnum}} +%} + { + + \DeclareDelimFormat{nameyeardelim}{\addcomma\space} + \DeclareDelimFormat[bib,biblist]{nameyeardelim}{\addcomma\space} + + \renewbibmacro*{date}{% + \iflabeldateisdate + {} + {\printdate}}% + + \renewbibmacro*{date+extradate}{% + \iffieldundef{labelyear} + {} + {\printtext{%[parens]%这里去掉括号 + \iflabeldateisdate + {\printdateextra} + {\printlabeldateextra}}}}% + + \newbibmacro*{bbx:savehash}{% + \savefield{fullhash}{\bbx@lasthash}} + + \newbibmacro*{bbx:dashcheck}[2]{} + + %注意这里当没有作者只有标题时在年份之前的标点是否需要标准并未涉及,所以未做处理。 + \renewbibmacro*{author}{%以前的date+extrayear变为date+extradate,所以对3.8以上版本重定义一下author + \ifboolexpr{ + test \ifuseauthor + and + not test {\ifnameundef{author}} + } + {% + \usebibmacro{bbx:savehash}% + \printnames{author}% + \iffieldundef{authortype} + {\setunit{\printdelim{nameyeardelim}}} + {\setunit{\printdelim{authortypedelim}}}% + \iffieldundef{authortype} + {} + {\usebibmacro{authorstrg}% + \setunit{\printdelim{nameyeardelim}}} + }% + {\global\undef\bbx@lasthash + \usebibmacro{labeltitle}% + \setunit*{\printdelim{nonameyeardelim}}}% + \usebibmacro{date+extradate}} + + \newbibmacro*{labeltitle}{% + \iffieldundef{label} + {\iffieldundef{shorttitle} + {\printfield{title}% + \clearfield{title}} + {\printfield[title]{shorttitle}}} + {\printfield{label}}} + +% +% 增加一个number带括号的格式,避免使用mkbibparens而引入一个不必要的空格 +% +\DeclareFieldFormat{addnumflag}{% +\nobreak\printtext{(}\nobreak #1\nobreak\printtext{)}} + +% +% 调整journal输出 +% +% 原理方法:首先判断子标题,然后再设置标点。 +% 避免直接设置标点后,当volume不存在时需要使用\nopuct去标点进而引入不必要的空格 +\renewbibmacro*{journal}{% + \iffieldundef{journaltitle}% + {}% + {\printtext[journaltitle]{% + \printfield[titlecase]{journaltitle}% + \iffieldundef{journalsubtitle}{}{\setunit{\subtitlepunct}% + \printfield[titlecase]{journalsubtitle}}}}} + + + +% +% 调整期刊卷和期的格式 +% +\renewbibmacro*{volume+number+eid}{%源来自standard.bbx +\iftoggle{bbx:gbfieldstd}{% + \printfield{volume}% + \setunit*{\adddot}% + \printfield{number}% + \setunit{\addcomma\space}% + \printfield{eid}}{% + \printfield{volume}% + %\setunit*{\adddot}%去掉点号 + %\printfield{number}% + \iffieldundef{number}{}{\printfield[addnumflag]{number}}%区别于顺序编码制 + \iffieldundef{eid}{}{% + \setunit{\addcomma\space}% + \printfield{eid}}}} + +% +% 调整期刊年份的格式 +% +% 原理方法:原在authoryear.BBX中\bbx@opt@mergedate@compact中定义 +% 当issue存在时,才设置newunit。避免直接设置标点后,当volume不存在是需要使用\nopuct去标点进而引入不必要的空格 + \renewbibmacro*{issue+date}{% + \iffieldundef{issue}% + {}% + {\iftoggle{bbx:gbstrict}{}{\printtext[parens]{\printfield{issue}}\newunit}}} + +% +% 编者的符号修改一下 +% v1.0 2016-07-01 +% v1.0q 2019-03-01 hzz 修改editortype前的标点 +% +\renewbibmacro*{editor}{% + \ifboolexpr{ + test \ifuseeditor + and + not test {\ifnameundef{editor}} + } + {\usebibmacro{bbx:dashcheck} + {%\bibnamedash + \printnames{editor}% + } + {\printnames{editor}% + %\setunit{\printdelim{editortypedelim}}% + %\usebibmacro{bbx:savehash} + }% + \usebibmacro{editorstrg}% + %\clearname{editor}% + \setunit{\printdelim{nameyeardelim}}}% + {\global\undef\bbx@lasthash + \usebibmacro{labeltitle}% + \setunit*{\printdelim{nonameyeardelim}}}% + \ifboolexpr{% + test {\ifentrytype{inbook}} + or + test {\ifentrytype{incollection}} + or + test {\ifentrytype{inproceedings}} + or + test {\ifentrytype{conference}} + }% + {}% + {\usebibmacro{date+extradate}}} + + + }{} + + + +} + + + +% +%针对具体条目做处理时的特殊处理 +% +%\def\localsetrefsectionstyle{% +%} + +%\AtEveryBibitem{\localsetrefsectionstyle}% +%\AtEveryCite{\localsetchinesecode}% +%\AtEveryLositem{\localsetchinesecode}% diff --git a/config/gb7714-2015mx.cbx b/config/gb7714-2015mx.cbx new file mode 100644 index 0000000..e52a7c8 --- /dev/null +++ b/config/gb7714-2015mx.cbx @@ -0,0 +1,466 @@ +%% +%% --------------------------------------------------------------- +%% biblatex-gb7714-2015 --- A biblatex implementation of the +%% GBT7714-2015 citation style,numerical sequence +%% Maintained by huzhenzhen +%% E-mail: hzzmail@163.com +%% Released under the LaTeX Project Public License v1.3c or later +%% --------------------------------------------------------------- +%% +\def\versionofgbtstyle{2019/03/28 v1.0r} +\ProvidesFile{gb7714-2015mx.cbx}[\versionofgbtstyle biblatex citation style] + +% +% 加载标准样式 +% +\RequireCitationStyle{numeric-comp} %numeric + + +% +% 选项设置 +% +\ExecuteBibliographyOptions{ + %autocite = superscript , + %autopunct = true , + %sorting = none , + maxcitenames=1, + mincitenames=1, + uniquename=init,%因为使用了名字缩写选项,所以需要设置uniquename=init而不是full避免冲突 + uniquelist=minyear, + labeldateparts, + sortcites, +} + + + +% +% 定义一个上标方括号wrapper +% +\newcommand*\mkbibsuperbracket[1]{% + \mkbibsuperscript{\mkbibbrackets{#1}}% +} + +% 修改postnote的输出格式 +\DeclareFieldFormat{postnote}{#1} + +% +% 重定义cite命令 +% +% 方法:\DeclareCiteCommand{\cite}[\mkbibparens]{precode}{loopcode}{sepcode}{postcode} +% v1.0p版后将cite的处理方式修改为类似pagescite,而不再使用biblatex的标准方式 +\DeclareCiteCommand{\cite}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号 + {[\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \printfield{postnote}} +% v1.0p 以前用的方式 +%\DeclareCiteCommand{\cite}[\mkbibsuperbracket]%利用mkbibsuperbracket添加方括号 +% {\usebibmacro{cite:init}% +% \usebibmacro{prenote}} +% {\usebibmacro{citeindex}% +% \usebibmacro{cite:comp}} +% {} +% {\usebibmacro{cite:dump}% +% \usebibmacro{postnote}} + +% +% 定义upcite命令 +% 20180604,v1.0l,hzz +% 20190409,v1.0r,hzz +% 方法:对supercite增加[] +\newrobustcmd*{\upcite}{% + \cite} + +% +% 重定义parencite命令,以满足标签带页码的国标要求 +% +\DeclareCiteCommand{\parencite}%[\mkbibbrackets] + {[\usebibmacro{cite:init}%] + \usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {%[ + \usebibmacro{cite:dump}]% + \mkbibsuperscript{\printfield{postnote}}} + +% +% 新定义pagescite命令,以满足标签带页码的国标要求 +% +% 原理方法: +% 1.新增页码输出宏 +\newbibmacro*{postpages}{% + \iffieldundef{postnote} + {\printfield[postnote]{pages}} + {\printfield{postnote}}} +% 2.新增\pagescite引用命令 +\DeclareCiteCommand{\pagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标 + {[\usebibmacro{cite:init}%]直接添加方括号 + \usebibmacro{prenote}% + } + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \usebibmacro{postpages}} + +% +% 定义yearpagescite,为与ay样式兼容,等同于\pagescite +% +\DeclareCiteCommand{\yearpagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标 + {[\usebibmacro{cite:init}%]直接添加方括号 + \usebibmacro{prenote}% + } + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \usebibmacro{postpages}} + +% +% 定义\yearcite命令,为与ay样式兼容,且提供不输出页码的标签格式, +% +% 原理方法:等同于\pagescite,但不要页码 +\DeclareCiteCommand{\yearcite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标 + {[\usebibmacro{cite:init}%]直接添加方括号 + \usebibmacro{prenote}% + } + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]} + +% +% 定义\authornumcite命令,输出作者信息,然后在后面带上顺序编码 +% 20180427,v1.0k,增加,hzz +% gb7714样式新定义的命令都把cite放到最后,比如前面的pagescite,yearcite,这里的\authornumcite +% 区别于biblatex定义的命令都把cite放到前面,比如citeauthor等。 +%见numeric.CBX +\newbibmacro*{cite}{% + \printtext[bibhyperref]{% + \printfield{labelprefix}% + \printfield{labelnumber}% + \ifbool{bbx:subentry} + {\printfield{entrysetcount}} + {}}} +%见numeric.CBX,\DeclareCiteCommand{\cite}, +\DeclareCiteCommand{\authornumcite}%[\mkbibsuperscript] + {\usebibmacro{prenote}} + {\iffieldequalstr{userf}{cn}{\renewcommand*{\andothersdelim}{\addthinspace}}%\addthinspace + {\renewcommand*{\andothersdelim}{\addspace}}% + \printnames{labelname}\mkbibsuperscript{\mkbibbrackets{\usebibmacro{citeindex}% + \usebibmacro{cite}}}} + {\multicitedelim} + {\mkbibsuperscript{\printfield{postnote}}} + + +% +% 增加如下多个命令 +% 20190409,v1.0r,hzz +% 方法:利用newcommand或newrobustcmd命令进行定义 +% 注意\citet和\citep命令之所以不用newrobustcmd,是为避免加载natbib模块后产生冲突 +\DeclareCiteCommand{\citet}% + {\usebibmacro{prenote}} + {\iffieldequalstr{userf}{cn}{\renewcommand*{\andothersdelim}{\addthinspace}}%\addthinspace + {\renewcommand*{\andothersdelim}{\addspace}}% + \printnames{labelname}\mkbibsuperscript{\mkbibbrackets{\usebibmacro{citeindex}% + \usebibmacro{cite}}}} + {\multicitedelim} + {\mkbibsuperscript{\printfield{postnote}}} + + +\DeclareCiteCommand{\citep}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号 + {[\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \printfield{postnote}} + +\newrobustcmd*{\citetns}% + {\textcite} + +\newrobustcmd*{\citepns}% + {\parencite} + +\newrobustcmd*{\inlinecite}% + {\parencite} + + +%textcite标注命令中的标点设置 +%\DeclareDelimFormat[textcite]{andothersdelim}{\addspace}% + +%textcite标注命令中的标点设置,注意只针对textcite命令。 +\DeclareDelimFormat[textcite]{nameyeardelim}{}%\addcomma\space +\DeclareDelimFormat[textcite]{andothersdelim}{\iffieldequalstr{userf}{chinese}{\addthinspace}{\addspace}}% +\AtEveryCitekey{% +\iffieldequalstr{userf}{chinese}{\renewcommand*{\andothersdelim}{\addthinspace}}%\addthinspace + {\renewcommand*{\andothersdelim}{\addspace}}% +} + +% +% +% +\apptocmd{\refsection}{ + +%\edef\gb@refsecnum{\number\c@refsection} +\edef\gb@refsecnum{\number\c@refsection}% +\ifcsundef{gb@aystyle@section\gb@refsecnum}% +{}% +{ + +\renewcommand*{\iffinalcitedelim}{% + \ifnumequal{\value{textcitecount}}{\value{textcitetotal}-1}} + +\newbibmacro*{cite:init}{% + \ifnumless{\value{multicitecount}}{2} + {\global\boolfalse{cbx:parens}% + \global\undef\cbx@lasthash + \global\undef\cbx@lastyear} + {\iffieldundef{prenote} + {} + {\global\undef\cbx@lasthash + \global\undef\cbx@lastyear}}} + +\newbibmacro*{cite:reinit}{% + \global\undef\cbx@lasthash + \global\undef\cbx@lastyear} + +\newbibmacro*{cite}{% + \iffieldundef{shorthand} + {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}} + {\usebibmacro{cite:label}% + \setunit{\printdelim{nonameyeardelim}}% + \usebibmacro{cite:labeldate+extradate}% + \usebibmacro{cite:reinit}} + {\iffieldequals{namehash}{\cbx@lasthash} + {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND + \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)} + {\setunit{\addcomma}% + \usebibmacro{cite:extradate}} + {\setunit{\compcitedelim}% + \usebibmacro{cite:labeldate+extradate}% + \savefield{labelyear}{\cbx@lastyear}}} + {\printnames{labelname}% + \setunit{\printdelim{nameyeardelim}}% + \usebibmacro{cite:labeldate+extradate}% + \savefield{namehash}{\cbx@lasthash}% + \savefield{labelyear}{\cbx@lastyear}}}} + {\usebibmacro{cite:shorthand}% + \usebibmacro{cite:reinit}}% + \setunit{\multicitedelim}} + +\newbibmacro*{citeyear}{% + \iffieldundef{shorthand} + {\iffieldundef{labelyear} + {\usebibmacro{cite:label}% + \usebibmacro{cite:reinit}} + {\iffieldequals{namehash}{\cbx@lasthash} + {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND + \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)} + {\setunit{\addcomma}% + \usebibmacro{cite:extradate}} + {\setunit{\compcitedelim}% + \usebibmacro{cite:labeldate+extradate}% + \savefield{labelyear}{\cbx@lastyear}}} + {\usebibmacro{cite:labeldate+extradate}% + \savefield{namehash}{\cbx@lasthash}% + \savefield{labelyear}{\cbx@lastyear}}}} + {\usebibmacro{cite:shorthand}% + \usebibmacro{cite:reinit}}% + \setunit{\multicitedelim}} + +\newbibmacro*{textcite}{% + \iffieldequals{namehash}{\cbx@lasthash} + {\iffieldundef{shorthand} + {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND + \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)} + {\setunit{\addcomma}% + \usebibmacro{cite:extradate}} + {\setunit{\compcitedelim}% + \usebibmacro{cite:labeldate+extradate}% + \savefield{labelyear}{\cbx@lastyear}}} + {\setunit{\compcitedelim}% + \usebibmacro{cite:shorthand}% + \global\undef\cbx@lastyear}} + {\ifnameundef{labelname} + {\iffieldundef{shorthand} + {\usebibmacro{cite:label}% + \setunit{% + \global\booltrue{cbx:parens}% + \printdelim{nonameyeardelim}\bibopenparen}% + \ifnumequal{\value{citecount}}{1} + {\usebibmacro{prenote}} + {}% + \usebibmacro{cite:labeldate+extradate}} + {\usebibmacro{cite:shorthand}}} + {\printnames{labelname}% + \setunit{% + \global\booltrue{cbx:parens}% + \printdelim{nameyeardelim}\bibopenparen}% + \ifnumequal{\value{citecount}}{1} + {\usebibmacro{prenote}} + {}% + \iffieldundef{shorthand} + {\iffieldundef{labelyear} + {\usebibmacro{cite:label}} + {\usebibmacro{cite:labeldate+extradate}}% + \savefield{labelyear}{\cbx@lastyear}} + {\usebibmacro{cite:shorthand}% + \global\undef\cbx@lastyear}}% + \stepcounter{textcitecount}% + \savefield{namehash}{\cbx@lasthash}}% + \setunit{% + \ifbool{cbx:parens} + {\bibcloseparen\global\boolfalse{cbx:parens}} + {}% + \textcitedelim}} + +\newbibmacro*{cite:shorthand}{% + \printtext[bibhyperref]{\printfield{shorthand}}} + +% +% 重定义cite:label,针对biblatex3.8以上版本set条目集的标注(引用)标签 +% +% 原理方法:当条目是set时,v3.8以上版本,都没有有用的信息(区别于3.7以下版本set复制第一个成员的信息), +% 于是利用entrykey来给出标签,那么就要set的条目关键字是需要的字符串,注意字符串中间不能有空格 +\renewbibmacro*{cite:label}{% + \iffieldundef{label}% + {\iffieldundef{labeltitle}{\printtext[bibhyperref]{\printfield{entrykey}}}%entrykey + {\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}}% + {\printtext[bibhyperref]{\printfield{label}}}} + +\newbibmacro*{cite:labeldate+extradate}{% + \iffieldundef{labelyear} + {} + {\printtext[bibhyperref]{\printlabeldateextra}}} + +\newbibmacro*{cite:extradate}{% + \iffieldundef{extradate} + {} + {\printtext[bibhyperref]{\printfield{extradate}}}} + + + +% +% 重定义cite:label,针对biblatex3.8以上版本set条目集的标注(引用)标签 +% +% 原理方法:当条目是set时,v3.8以上版本,都没有有用的信息(区别于3.7以下版本set复制第一个成员的信息), +% 于是利用entrykey来给出标签,那么就要set的条目关键字是需要的字符串,注意字符串中间不能有空格 +\renewbibmacro*{cite:label}{% + \iffieldundef{label}% + {\iffieldundef{labeltitle}{\printtext[bibhyperref]{\printfield{entrykey}}}%entrykey + {\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}}% + {\printtext[bibhyperref]{\printfield{label}}}} + +% +% 重定义cite命令 +% +% 方法:\DeclareCiteCommand{\cite}[\mkbibparens]{precode}{loopcode}{sepcode}{postcode} +% v1.0p版后将cite的处理方式修改为类似pagescite,而不再使用biblatex的标准方式 +\DeclareCiteCommand{\cite} + {\usebibmacro{cite:init}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}% + {\thefield{postnote}}}% + (\usebibmacro{prenote}}%) + {\usebibmacro{citeindex}% + \usebibmacro{cite}} + {} + {%( + )\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} + } + +\DeclareCiteCommand{\parencite}[\mkbibparens] + {\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite}} + {} + {\usebibmacro{postnote}} + +% +% 定义\authornumcite命令,输出作者信息,然后在后面带上顺序编码 +% 20180427,v1.0k,增加,hzz +% 20190409,v1.0r,hzz +% 为与顺序编码制兼容,增加了命令,定义与citet相同 +\newbibmacro*{citet}{% + \iffieldundef{shorthand} + {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}} + {\usebibmacro{cite:label}% + \setunit{\printdelim{nonameyeardelim}}% + \usebibmacro{cite:labeldate+extradate}% + \usebibmacro{cite:reinit}} + {\iffieldequals{namehash}{\cbx@lasthash} + {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND + \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)} + {\setunit{\addcomma}% + \usebibmacro{cite:extradate}} + {\setunit{\compcitedelim}% + \usebibmacro{cite:labeldate+extradate}% + \savefield{labelyear}{\cbx@lastyear}}} + {\printnames{labelname}% + %\setunit{\printdelim{nameyeardelim}}% + (\usebibmacro{cite:labeldate+extradate})% + \savefield{namehash}{\cbx@lasthash}% + \savefield{labelyear}{\cbx@lastyear}}}} + {\usebibmacro{cite:shorthand}% + \usebibmacro{cite:reinit}}% + \setunit{\multicitedelim}} + +\DeclareCiteCommand{\authornumcite}% + {\usebibmacro{cite:init}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}% + {\thefield{postnote}}}% + \usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{citet}} + {} + {\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} + } + +% +% 增加如下多个命令 +% 20190409,v1.0r,hzz +% 方法:利用newcommand或newrobustcmd命令进行定义 +% 注意\citet和\citep命令之所以不用newrobustcmd,是为避免加载natbib模块后产生冲突 + +%同\authornumcite +\DeclareCiteCommand{\citet}% + {\usebibmacro{cite:init}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}% + {\thefield{postnote}}}% + \usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{citet}} + {} + {\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} + } + +%同cite +\DeclareCiteCommand{\citep} + {\usebibmacro{cite:init}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}% + {\thefield{postnote}}}% + (\usebibmacro{prenote}}%) + {\usebibmacro{citeindex}% + \usebibmacro{cite}} + {} + {%( + )\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} + } + + +} +}{}{} diff --git a/config/seuthesiY.cls b/config/seuthesiY.cls new file mode 100644 index 0000000..445dfe5 --- /dev/null +++ b/config/seuthesiY.cls @@ -0,0 +1,701 @@ + +%% This is file `seuthesix.cls', +%% This file provides a LaTeX document class for typesetting thesis of Southeast University, Nanjing, China. +%% Copyright (c) 2007--2012 Xu Yuan, email: xuyuan.cn@gmail.com +%% Copyright (c) 2016 James Fan, email: zhimengfan1990@163.com +%% License: GNU General Public License, version 3 +%% This file is part of ``seuthesix'' package. +%% ``seuthesix'' is free software: you can redistribute it and/or modify +%% it under the terms of the GNU General Public License as published by +%% the Free Software Foundation, either version 3 of the License, or +%% (at your option) any later version. +%% ``seuthesix'' is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with this program. If not, see . + + +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesClass{seuthesiY}[2019/06/23 1.0.2 The LaTeX template for academic degree thesis of Southeast University] +\typeout{Document Class `seuthesix' 1.0.1 by James Fan (2016/03/20), \\ +Document Class `seuthesiY' 1.0.2 by Deans Yu (2019/06/23)} + +\newif\ifnocolorlinks\nocolorlinksfalse +\newif\ifcoadvisor\coadvisorfalse +\newif\ifengineering\engineeringfalse +\newif\ifmasters\masterstrue +\newif\ifphd\phdfalse +\newif\ifalgorithmlist\algorithmlistfalse +\newif\iffigurelist\figurelistfalse +\newif\iftablelist\tablelistfalse +\newif\ifnomlist\nomlistfalse +\InputIfFileExists{seuthesix.cfg} +{\typeout{[seuthesix]: Load seuthesix.cfg successfully!}}% + {\typeout{[seuthesix]: Load seuthesix.cfg failed!}}% +\DeclareOption{nocolorlinks}{\nocolorlinkstrue} +\DeclareOption{algorithmlist}{\algorithmlisttrue} +\DeclareOption{phd}{\phdtrue\mastersfalse\engineeringfalse\renewcommand\@degreelevel{博士}} +\DeclareOption{masters}{\masterstrue\engineeringfalse\phdfalse\renewcommand\@degreelevel{硕士}} +\DeclareOption{engineering}{% +\engineeringtrue\masterstrue\phdfalse\renewcommand\@degreelevel{工程硕士}} +\DeclareOption{figurelist}{\figurelisttrue} +\DeclareOption{tablelist}{\tablelisttrue} +\DeclareOption{nomlist}{\nomlisttrue} +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexrep}} +\ProcessOptions +\LoadClass[twoside,a4paper,zihao=-4,UTF8,openright]{ctexrep} +\RequirePackage[titles]{tocloft} +\renewcommand{\cftchapleader}{\bfseries\cftdotfill{\cftdotsep}} +\newcommand{\chuhao}{\fontsize{42bp}{46bp}\selectfont} +\newcommand{\xiaochuhao}{\fontsize{36bp}{40bp}\selectfont} +\newcommand{\yichu}{\fontsize{32bp}{36bp}\selectfont} +\newcommand{\yihao}{\fontsize{28bp}{32bp}\selectfont} +\newcommand{\erhao}{\fontsize{21bp}{24bp}\selectfont} +\newcommand{\xiaoerhao}{\fontsize{18bp}{20bp}\selectfont} +\newcommand{\sanhao}{\fontsize{15.75bp}{18bp}\selectfont} +\newcommand{\sihao}{\fontsize{14bp}{16bp}\selectfont} +\newcommand{\xiaosihao}{\fontsize{12bp}{14bp}\selectfont} +\newcommand{\wuhao}{\fontsize{10.5bp}{13bp}\selectfont} +\newcommand{\xiaowuhao}{\fontsize{9bp}{11bp}\selectfont} +\newcommand{\liuhao}{\fontsize{7.5bp}{9bp}\selectfont} +\newcommand{\xiaoliuhao}{\fontsize{6.5bp}{7.5bp}\selectfont} +\newcommand{\qihao}{\fontsize{5.5bp}{6.5bp}\selectfont} +\setCJKmainfont{SimSun} +\ctexset{% +chapter/format=\centering, +chapter/nameformat=\large\heiti, +chapter/numberformat=\large\heiti, +chapter/titleformat=\large\heiti, +chapter/beforeskip=0pt, +section/format=\raggedright, +section/nameformat={\large\bfseries}, +section/numberformat={\large\bfseries}, +section/titleformat={\sihao\bfseries}, +subsection/format=\sihao\mdseries\raggedright, +subsubsection/format=\sihao\mdseries\raggedright, +listfigurename={插图目录}, +listtablename={表格目录} +} +\RequirePackage[font=small]{caption} +%\RequirePackage{mathptmx} +\setmainfont[Mapping=tex-text]{Times New Roman} +\RequirePackage{amsmath} +\RequirePackage{amssymb} +\RequirePackage{amsthm} +\numberwithin{equation}{chapter} +\newcommand{\dif}{\mathrm{d}} +\DeclareMathOperator*{\argmin}{argmin} +\DeclareMathOperator*{\argmax}{argmax} +\DeclareMathOperator{\diag}{diag} +\DeclareMathOperator{\rank}{rank} +\DeclareMathOperator{\sinc}{sinc} +\DeclareMathOperator{\unwrap}{unwrap} +\def\me{\mathrm{e}} +\RequirePackage[mathscr]{eucal} +\RequirePackage{eufrak} +\RequirePackage{bm} +\RequirePackage{graphicx} +\graphicspath{{figures/}{./}} +\RequirePackage{nomencl} +\makenomenclature +\newcommand{\setnomname}[1]{\renewcommand\nomname{#1}} +\renewcommand{\nomname}{术语与数学符号约定} +\RequirePackage{algorithm} +\RequirePackage{algorithmic} +\numberwithin{algorithm}{chapter} +\floatname{algorithm}{算法} +\renewcommand{\listalgorithmname}{算法目录} +% \RequirePackage[super,square]{natbib} +%================================================ +\RequirePackage[backend=biber,bibstyle=config/gb7714-2015,citestyle=config/gb7714-2015,gbfieldtype=true,url=false,gbpunctin=false, +gbpub=false,gbnamefmt=lowercase,gbbiblabel=dot,]{biblatex} +%================================================ +\newcommand\citen[1]{[\!\!\citenum{#1}]} +\RequirePackage{hyperref} +\ifnocolorlinks +\hypersetup{colorlinks=false} +\else +\hypersetup{colorlinks=true} +\fi +\hypersetup{ + linkcolor=blue, + anchorcolor=black, + citecolor=red, + filecolor=magenta, + menucolor=red, + urlcolor=magenta +} +\AtEndDocument{\backcover} +\newcommand{\backcover}{ +\clearpage\thispagestyle{empty}\cleardoublepage\mbox{ } +\clearpage\thispagestyle{empty} %backcover always at even page. +\begin{picture}(0,0) + \put(-1,-22){ % +\includegraphics[width=\textwidth]{figures/back-cover.png}} +\end{picture} +} + +\RequirePackage[top=1.2in,bottom=1in,left=2.5cm,right=2.5cm,a4paper]{geometry} +\RequirePackage{fancyhdr} +\fancypagestyle{seustyle}{% +\fancyhf{} +\fancyhead[CO]{\xiaowuhao\universityname{}\@thesistype} +\fancyhead[CE]{ \xiaowuhao\leftmark} +\fancyfoot[CO,CE]{\thepage} +} +\pagestyle{seustyle} + +\fancypagestyle{nom}{% +\fancyhf{} +\fancyhead[CO]{\xiaowuhao\universityname{}\@thesistype} +\fancyhead[CE]{ \xiaowuhao\nomname} +\fancyfoot[CO,CE]{\thepage} +} + +\renewcommand{\headrulewidth}{0.4pt} +\RequirePackage{eso-pic} +\renewcommand{\author}[2]{ + \def\@author{#1} + \newcommand{\@authoreng}{#2} +} +\newcommand{\@titleeng}{} +\newcommand{\@subtitleeng}{} +\renewcommand{\title}[4]{ + \def\@title{#1} + \newcommand{\@subtitle}{#2} + \renewcommand{\@titleeng}{#3} + \renewcommand{\@subtitleeng}{#4} +} +\newcommand{\@advisorname}{} +\newcommand{\@advisortitle}{} +\newcommand{\@advisornameeng}{} +\newcommand{\@advisortitleeng}{} +\newcommand{\advisor}[4]{ + \renewcommand{\@advisorname}{#1} + \renewcommand{\@advisortitle}{#2} + \renewcommand{\@advisornameeng}{#3} + \renewcommand{\@advisortitleeng}{#4} +} +\newcommand{\@coadvisorname}{} +\newcommand{\@coadvisortitle}{} +\newcommand{\@coadvisornameeng}{} +\newcommand{\@coadvisortitleeng}{} +\newcommand{\coadvisor}[4]{ + \coadvisortrue + \renewcommand{\@coadvisorname}{#1} + \renewcommand{\@coadvisortitle}{#2} + \renewcommand{\@coadvisornameeng}{#3} + \renewcommand{\@coadvisortitleeng}{#4} +} +\newcommand{\@categorynumber}{} +\newcommand{\categorynumber}[1]{\renewcommand{\@categorynumber}{#1}} +\newcommand{\@secretlevel}{} +\newcommand{\secretlevel}[1]{\renewcommand{\@secretlevel}{#1}} +\newcommand{\@UDC}{} +\newcommand{\UDC}[1]{\renewcommand{\@UDC}{#1}} +\newcommand{\@studentid}{} +\newcommand{\studentid}[1]{\renewcommand{\@studentid}{#1}} +\newcommand\degreetype[2]{\renewcommand\@degreetype{#1}% +\renewcommand\@degreetypeen{#2}} +\newcommand{\@majorlen}{8em} +\newcommand{\@major}{} +\newcommand{\major}[2][8em]{ + \renewcommand{\@majorlen}{#1} + \renewcommand{\@major}{#2} +} +\newcommand{\@department}{} +\newcommand{\@departmenteng}{} +\newcommand{\department}[2]{ + \renewcommand{\@department}{#1} + \renewcommand{\@departmenteng}{#2} +} +\newcommand{\@submajor}{} +\newcommand{\submajor}[1]{ + \renewcommand{\@submajor}{#1} +} +\newcommand{\@defenddate}{} +\newcommand{\defenddate}[1]{\renewcommand{\@defenddate}{#1}} +\newcommand{\authorizeorganization}[1]{ + \renewcommand{\@authorizeorganization}{#1} +} + +\newcommand{\@authorizedate}{} +\newcommand{\authorizedate}[1]{\renewcommand{\@authorizedate}{#1}} +\newcommand{\@committeechair}{} +\newcommand{\committeechair}[1]{\renewcommand{\@committeechair}{#1}} +\newcommand{\@reviewerA}{} +\newcommand{\@reviewerB}{} +\newcommand{\reviewer}[2]{ + \renewcommand{\@reviewerA}{#1} + \renewcommand{\@reviewerB}{#2} +} +\newcommand{\CoverTopOption}[3][s]{ + \makebox[1.5cm][#1]{\xiaowuhao #2}:{ + \underline{\makebox[1.5cm][c]{\xiaowuhao #3}}} +} +\newcommand{\CoverBottomOption}[3][4.5cm]{ + \makebox[7cm][s]{ + {\songti\xiaosihao#2} + \underline{\makebox[#1][c]{\heiti\xiaosihao#3}} + } +} +\newif\ifthanks\thanksfalse +\newcommand\@seuthesisthanks{ } +\newcommand\seuthesisthanks[1]{\renewcommand\@seuthesisthanks{#1}\thankstrue} +\newcommand\@thesisthanks{\ifthanks\thispagestyle{thanksstyle}\fi} +\fancypagestyle{thanksstyle}{% +\fancyhf{} +\fancyfoot[L]{\setlength{\baselineskip}{0pt}% +\rule[-2.5pt]{6cm}{.4pt}\\ \small\@seuthesisthanks} +\renewcommand\headrulewidth{0pt} +} +\newcommand\makebigcover{%generating a3 front cover +\pdfpagewidth=420mm +\pdfpageheight=297mm +\setlength{\paperheight}{297mm} +\setlength{\paperwidth}{420mm} +\thispagestyle{empty} + \setlength{\unitlength}{1cm} + \noindent +\begin{picture}(0,0) +\setlength{\unitlength}{1cm}\put(19.5,-8){% +\includegraphics[width=19cm]{figures/front-cover.jpg}}% +\end{picture} + \begin{picture}(0,0) +\put(19.5,0){ +\renewcommand{\arraystretch}{1.0} + \begin{tabular}{l} + \CoverTopOption{\schoolcodepre}{\schoolcode} \\ + \CoverTopOption{\categorynumberpre}{\@categorynumber} \\ + \CoverTopOption{\secretlevelpre}{\@secretlevel}\\ + \CoverTopOption{U D C}{\@UDC} \\ + \CoverTopOption{\studentidpre}{\@studentid} + \end{tabular} + } +\end{picture} + \ifengineering +\begin{picture}(0,0) + \put(23.2,-7.5){ % +\includegraphics[scale=0.65]{figures/engineering.png}} +\end{picture} + \else \ifmasters +\begin{picture}(0,0) + \put(24.5,-7.5){ % +\includegraphics[scale=1.1]{figures/master-hwzs.pdf}} +\end{picture} + \else \ifphd +\begin{picture}(0,0) + \put(24.5,-7.5){ % +\includegraphics[scale=1.1]{figures/doctor-hwzs.pdf}} +\end{picture} + \else + \ClassError{seuthesix}{invalid degree type option.}% + {Check your class option of degree type to be one of the following:% + masters, engineering, phd.} + \fi + \fi + \fi + \begin{picture}(0,0) + \put(35,0){ % +\includegraphics[width=2cm]{figures/seu-color-logo.png}} +\end{picture} +\begin{picture}(0,0) + \put(-1,-22){ % +\includegraphics[width=\textwidth]{figures/back-cover.png}} +\end{picture} +\begin{picture}(0,0) +\put(18,-11){% +\parbox[c]{\ccwd}{% +\bfseries% +\setlength{\baselineskip}{0pt} +\@title\\ +\rule{0pt}{\ccwd}\\ +\@subtitle\\ +\vspace*{2cm} +\@author\\ +\vspace*{2cm} +\universityname +} +} +\end{picture} + +\vspace*{8cm} + +\hspace*{20.5cm} +\begin{minipage}{16cm} + \begin{center} + \linespread{1.25} + \yihao\heiti\@title\\ + \yihao\heiti\@subtitle + \end{center} +\end{minipage} + +\hspace*{20.5cm} +\begin{minipage}{16cm} + \begin{center} + \setlength{\tabcolsep}{0pt} + \renewcommand{\arraystretch}{2.0} + \begin{tabular}{cr} + \makebox[3.5cm][s]{\xiaoerhao\songti\authorpre: } & + \underline{\makebox[6cm][s]{ + \hspace*{1cm} + \makebox[2.5cm][c]{\xiaoerhao\heiti\@author} + \makebox[2cm][r]{}}} \\ + \makebox[3.5cm][s]{\xiaoerhao\songti\advisorpre: } & + \underline{\makebox[6cm][s]{ + \hspace*{1cm} + \makebox[2.5cm][c]{\xiaoerhao\heiti\@advisorname} + \makebox[2cm][r]{\xiaoerhao\heiti\@advisortitle}}} + \\ + & + \ifcoadvisor + \underline{\makebox[6cm][s]{ + \hspace*{1cm} + \makebox[2.5cm][c]{\xiaoerhao\heiti\@coadvisorname} + \makebox[2cm][r]{\xiaoerhao\heiti\@coadvisortitle}}} + \else + \fi \\ + \end{tabular} + \end{center} + \end{minipage} + + \hspace*{20.5cm} + \begin{minipage}{16cm} + \begin{center} + \setlength{\tabcolsep}{10pt} + \renewcommand{\arraystretch}{2.0} + \begin{tabular}{ll} + \CoverBottomOption{\appdegreepre}{\@degreetype} & + \CoverBottomOption{\authorizeorganizationpre}{\@authorizeorganization} \\ + \CoverBottomOption{\majorpre}{\@major} & + \CoverBottomOption{\defenddatepre}{\@defenddate}\\ + \CoverBottomOption{\submajorpre}{\@submajor} & + \CoverBottomOption{\authorizedatepre}{\@authorizedate}\\ + \CoverBottomOption[4.05cm]{\committeechairpre}{\@committeechair} & + \CoverBottomOption{\reviewerpre}{\@reviewerA}\\ + & \CoverBottomOption{\makebox[2.55cm]{}}{\@reviewerB} + \end{tabular} + \end{center} + \end{minipage} + + \vfill + + \hspace*{20.5cm} +{\songti\sihao\centerline{\today} \par} +\eject +\pdfpagewidth=210mm +\pdfpageheight=297mm +\setlength{\paperheight}{297mm} +\setlength{\paperwidth}{210mm} +} + +\newcommand{\makechinesecover}{ + \hypersetup{ + pdfauthor={\@author}, + pdftitle={\universityname{}\@thesistype}, + pdfsubject={\@title \@subtitle}, + pdfcreator={xetex} + } + +\thispagestyle{empty} +\AddToShipoutPictureFG*{\setlength{\unitlength}{1cm}\put(1,26){% +\renewcommand{\arraystretch}{1.0} + \begin{tabular}{l} + \CoverTopOption{\schoolcodepre}{\schoolcode} \\ + \CoverTopOption{\categorynumberpre}{\@categorynumber} \\ + \CoverTopOption{\secretlevelpre}{\@secretlevel}\\ + \CoverTopOption{U D C}{\@UDC} \\ + \CoverTopOption{\studentidpre}{\@studentid} + \end{tabular} +} +} + +\AddToShipoutPictureBG*{\setlength{\unitlength}{1cm}\put(0,23){% +\parbox{\paperwidth}{\centering\includegraphics[width=\paperwidth]{figures/front-cover.jpg}}}}% + + \ifengineering +\AddToShipoutPictureBG*{\setlength{\unitlength}{1cm}\put(0,18){ % +\parbox{\paperwidth}{\centering\includegraphics[scale=0.65]{figures/engineering.png}}}}% + \else \ifmasters +\AddToShipoutPictureBG*{\setlength{\unitlength}{1cm}\put(0,18){ % +\parbox{\paperwidth}{\centering\includegraphics[scale=1.1]{figures/master-hwzs.pdf}}}}% + \else \ifphd + \AddToShipoutPictureBG*{\setlength{\unitlength}{1cm}\put(0,18){ % +\parbox{\paperwidth}{\centering\includegraphics[scale=1.1]{figures/doctor-hwzs.pdf}}}}% + \else + \ClassError{seuthesix}{invalid degree type option.}% + {Check your class option of degree type to be one of the following:% + masters, engineering, phd.} + \fi + \fi + \fi +\AddToShipoutPictureBG*{\setlength{\unitlength}{1cm}\put(17,27){% +\parbox{\paperwidth}{\includegraphics[width=2cm]{figures/seu-color-logo.png}}}}% + + \vspace*{8cm} + + \begin{center} + \linespread{1.25} + \yihao\heiti\@title\\ + \yihao\heiti\@subtitle + \end{center} + + \begin{center} + \setlength{\tabcolsep}{0pt} + \renewcommand{\arraystretch}{2.0} + \begin{tabular}{cr} + \makebox[3.5cm][s]{\xiaoerhao\songti\authorpre: } & + \underline{\makebox[6cm][s]{ + \hspace*{1cm} + \makebox[2.5cm][c]{\xiaoerhao\heiti\@author} + \makebox[2cm][r]{}}} \\ + \makebox[3.5cm][s]{\xiaoerhao\songti\advisorpre: } & + \underline{\makebox[6cm][s]{ + \hspace*{1cm} + \makebox[2.5cm][c]{\xiaoerhao\heiti\@advisorname} + \makebox[2cm][r]{\xiaoerhao\heiti\@advisortitle}}} + \\ + & + \ifcoadvisor + \underline{\makebox[6cm][s]{ + \hspace*{1cm} + \makebox[2.5cm][c]{\xiaoerhao\heiti\@coadvisorname} + \makebox[2cm][r]{\xiaoerhao\heiti\@coadvisortitle}}} + \else + \fi \\ + \end{tabular} + \end{center} + + \begin{center} + \setlength{\tabcolsep}{10pt} + \renewcommand{\arraystretch}{2.0} + \begin{tabular}{ll} + \CoverBottomOption{\appdegreepre}{\@degreetype} & + \CoverBottomOption{\authorizeorganizationpre}{\@authorizeorganization} \\ + \CoverBottomOption{\majorpre}{\@major} & + \CoverBottomOption{\defenddatepre}{\@defenddate}\\ + \CoverBottomOption{\submajorpre}{\@submajor} & + \CoverBottomOption{\authorizedatepre}{\@authorizedate}\\ + \CoverBottomOption[4.05cm]{\committeechairpre}{\@committeechair} & + \CoverBottomOption{\reviewerpre}{\@reviewerA}\\ + & \CoverBottomOption{\makebox[2.55cm]{}}{\@reviewerB} + \end{tabular} + \end{center} + + \vfill + \setcounter{page}{1} +{\songti\sihao\centerline{\today} \par} + + \clearpage\thispagestyle{empty}\cleardoublepage% + \thispagestyle{empty} + \begin{center} + \xiaochuhao + + \includegraphics[height=0.63in]{figures/seu-text-logo} + + \ifmasters + \includegraphics{figures/master-hwzs} + \else + \includegraphics{figures/doctor-hwzs} + \fi + + \vspace{31.5pt} + \yihao\heiti\@title\@thesisthanks\\ + \yihao\heiti\@subtitle + \vspace{42pt} + + { + \setlength{\tabcolsep}{0pt} + \begin{tabular}{cc} + \makebox[3.5cm][s]{\xiaoerhao\heiti{}专~~业~~名~~称: } & + \underline{\makebox[6cm][s]{ + \xiaoerhao\songti\textbf{\@major} }} \\ + \\ + \makebox[3.5cm][s]{ \xiaoerhao\heiti\authorpre: } & + \underline{\makebox[6cm][s]{ + \xiaoerhao\songti\textbf{\@author} }} \\ + \\ + \makebox[3.5cm][s]{ \xiaoerhao\heiti\advisorpre: } & + \underline{\makebox[6cm][s]{ + \xiaoerhao\songti\textbf{\@advisorname\quad\@advisortitle} }} +\\ + & + \ifcoadvisor + \underline{\makebox[6cm][s]{ + \xiaoerhao\songti\textbf{\@coadvisorname\quad\@coadvisortitle} }} + \else + \fi + \end{tabular} + } + \end{center} +} + +\newcommand{\makeenglishcover}{% +\clearpage\thispagestyle{empty}\cleardoublepage\thispagestyle{empty} + \begin{center} + ~\\ + {\fontsize{24pt}{28pt}\selectfont + \MakeUppercase{\@titleeng}\\ + \MakeUppercase{\@subtitleeng} + \par + } + + \vspace{2cm}% + {\fontsize{16pt}{24pt}\selectfont + {A + \ifmasters + Thesis + \else + Dissertation + \fi + submitted to}\\ + {\universitynameeng}\\ + {For the Academic Degree of \@degreetypeen}\\ + {\vspace{0.5in}}% + {BY}\\ + {\@authoreng}\\ + {\vspace{0.5in}}% + {Supervised by:}\\ + {\@advisortitleeng\ \@advisornameeng}\\ + \ifcoadvisor + {and}\\ + {\@coadvisortitleeng\ \@coadvisornameeng}\\ + \else + \fi + {\vfill} + {\@departmenteng}\\ + {\universitynameeng}\\ + {\todayeng} + \par + }% + \end{center}% + + } + + \newcommand\makecover{% + \makechinesecover + \makeenglishcover + \seudeclare + } + +\renewenvironment{abstract}[1] +{ +\pagenumbering{Roman} +\clearpage\thispagestyle{empty}\cleardoublepage\thispagestyle{plain} + \newcommand{\@keywords}{#1} + \hypersetup{pdfkeywords={\@keywords}} + \phantomsection + \addcontentsline{toc}{chapter}{\@abstracttitle} + \chapter*{\@abstracttitle} + \setcounter{page}{1} +} +{ + \par + \begin{description} + \item[关键词:] \@keywords + \end{description} +} + +\newenvironment{englishabstract}[1] +{ +\cleardoublepage\thispagestyle{plain} + \newcommand{\@keywords}{#1} + \phantomsection + \addcontentsline{toc}{chapter}{Abstract} +\ctexset{% +chapter/nameformat=\large\bfseries, +chapter/titleformat=\large\bfseries +} + \chapter*{Abstract} + \ctexset{% +chapter/nameformat=\large\heiti, +chapter/titleformat=\large\heiti +} +} +{ + \par + \begin{description} + \item[Keywords:] \@keywords + \end{description} +} + +\newcommand\listofothers{% +\iffigurelist +\cleardoublepage +\phantomsection +\addcontentsline{toc}{chapter}{\listfigurename} +\listoffigures +\fi + +\iftablelist +\cleardoublepage +\phantomsection +\addcontentsline{toc}{chapter}{\listtablename} +\listoftables +\fi + +\ifalgorithmlist +\cleardoublepage +\phantomsection +\addcontentsline{toc}{chapter}{\listalgorithmname} +\listofalgorithms +\fi + +\ifnomlist +\cleardoublepage +\phantomsection +\addcontentsline{toc}{chapter}{\nomname} +\pagestyle{nom} +\printnomenclature[1in] +\fi + +} + +\newcommand{\mainmatter}{% +\cleardoublepage +\pagenumbering{arabic} +\pagestyle{seustyle} +} + +\newcommand{\acknowledgement}{% +\cleardoublepage +\phantomsection +\addcontentsline{toc}{chapter}{致 谢} +\chapter*{致 谢} +} + +% \newcommand{\thesisbib}[1]{% +% \bibliographystyle{seuthesix} +% \cleardoublepage +% \phantomsection +% \addcontentsline{toc}{chapter}{\bibname} +% \bibliography{#1} +% } +%========================================================= +\newcommand{\thesisbib}{% +\cleardoublepage +\phantomsection +\addcontentsline{toc}{chapter}{\bibname} +\printbibliography +} +%========================================================== +\newcommand{\resume}[1]{% +\cleardoublepage +\phantomsection +\addcontentsline{toc}{chapter}{#1} +\chapter*{#1} +} + +\newcommand{\seuthesix}{% + \makebox{S\hspace{-0.3ex}\raisebox{-0.5ex}{E}\hspace{-0.3ex}U\hspace{0.1em}% + \textsc{Thesix}} +} +\newcommand{\seuthesis}{% + \makebox{S\hspace{-0.3ex}\raisebox{-0.5ex}{E}\hspace{-0.3ex}U\hspace{0.1em}% + \textsc{Thesis}} +} +\endinput +%% End of file `seuthesix.cls'. diff --git a/config/seuthesix.cfg b/config/seuthesix.cfg index 69ea24e..a7524f5 100644 --- a/config/seuthesix.cfg +++ b/config/seuthesix.cfg @@ -1,84 +1,84 @@ - -%% This is file `seuthesix.cfg', -%% This file provides is a configuration file for ``seuthesix''. -%% Copyright (c) 2007--2012 Xu Yuan, email: xuyuan.cn@gmail.com -%% Copyright (c) 2016 James Fan, email: zhimengfan1990@163.com -%% License: GNU General Public License, version 3 -%% This file is part of ``seuthesix'' package. -%% ``seuthesix'' is free software: you can redistribute it and/or modify -%% it under the terms of the GNU General Public License as published by -%% the Free Software Foundation, either version 3 of the License, or -%% (at your option) any later version. -%% ``seuthesix'' is distributed in the hope that it will be useful, -%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%% GNU General Public License for more details. -%% -%% You should have received a copy of the GNU General Public License -%% along with this program. If not, see . - - -\ProvidesFile{seuthesix.cfg}[2016/03/20 1.0.1 seuthesix configuration file] -\newcommand{\universityname}{东南大学} -\newcommand{\universitynameeng}{Southeast University} -\newcommand{\schoolcodepre}{学校代码} -\newcommand{\schoolcode}{10286} -\newcommand{\secretlevelpre}{密级} -\newcommand{\categorynumberpre}{分类号} -\newcommand{\studentidpre}{学号} -\newcommand{\authorpre}{研究生姓名} -\newcommand{\advisorpre}{导~~师~~姓~~名} -\newcommand{\appdegreepre}{申请学位类别} -\newcommand{\majorpre}{一级学科名称} -\newcommand{\submajorpre}{二级学科名称} -\newcommand{\defenddatepre}{论文答辩日期} -\newcommand{\authorizeorganizationpre}{学位授予单位} -\newcommand{\@authorizeorganization}{~~东~南~大~学~~} -\newcommand{\authorizedatepre}{学位授予日期} -\newcommand{\committeechairpre}{答辩委员会主席} -\newcommand{\reviewerpre}{评~~~~~~~~~阅~~~~~~~~~人} -\newcommand{\@abstracttitle}{摘\quad 要} -\newcommand{\todayeng}{\the\year/\the\month/\the\day} -\newcommand{\@degreelevel}{硕士} -\newcommand{\@degreetype}{工学硕士} -\newcommand{\@degreetypeen}{Master of Engineering}\relax -\newcommand{\@thesistype}{\@degreelevel{}学位论文} -\newcommand{\signline}{\underline{\makebox[2.5cm][s]{}}} -\newcommand{\seudeclare}{ -\clearpage\thispagestyle{empty}\cleardoublepage\thispagestyle{empty} -{\xiaosihao -\begin{center} -{\heiti\sanhao 东南大学学位论文独创性声明} -\end{center} -\vspace{0.5in} -{ \linespread{1.5} -本人声明所呈交的学位论文是我个人在导师指导下进行的研究工作及取得的 -研究成果。尽我所知,除了文中特别加以标注和致谢的地方外,论文中不包 -含其他人已经发表或撰写过的研究成果,也不包含为获得东南大学或其它教 -育机构的学位或证书而使用过的材料。与我一同工作的同志对本研究所做的 -任何贡献均已在论文中作了明确的说明并表示了谢意。\par} -\vspace{0.3in} -\begin{flushright} -研究生签名:\signline 日~期:\signline -\end{flushright} -\vspace{1.5in} -\begin{center} -{\heiti\sanhao 东南大学学位论文使用授权声明} -\end{center} -\vspace{0.5in} -{ \linespread{1.5} -东南大学、中国科学技术信息研究所、国家图书馆有权保留本人所送交学位 -论文的复印件和电子文档,可以采用影印、缩印或其他复制手段保存论文。 -本人电子文档的内容和纸质论文的内容相一致。除在保密期内的保密论文 -外,允许论文被查阅和借阅,可以公布(包括刊登)论文的全部或部分内容。 -论文的公布(包括刊登)授权东南大学研究生院办理。\par} -\vspace{0.3in} -\begin{flushright} -研究生签名:\signline 导师签名:\signline 日~期:\signline -\end{flushright} -\par -} -} -\endinput -%% -%% End of file `seuthesix.cfg'. + +%% This is file `seuthesix.cfg', +%% This file provides is a configuration file for ``seuthesix''. +%% Copyright (c) 2007--2012 Xu Yuan, email: xuyuan.cn@gmail.com +%% Copyright (c) 2016 James Fan, email: zhimengfan1990@163.com +%% License: GNU General Public License, version 3 +%% This file is part of ``seuthesix'' package. +%% ``seuthesix'' is free software: you can redistribute it and/or modify +%% it under the terms of the GNU General Public License as published by +%% the Free Software Foundation, either version 3 of the License, or +%% (at your option) any later version. +%% ``seuthesix'' is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with this program. If not, see . + + +\ProvidesFile{seuthesix.cfg}[2016/03/20 1.0.1 seuthesix configuration file] +\newcommand{\universityname}{东南大学} +\newcommand{\universitynameeng}{Southeast University} +\newcommand{\schoolcodepre}{学校代码} +\newcommand{\schoolcode}{10286} +\newcommand{\secretlevelpre}{密级} +\newcommand{\categorynumberpre}{分类号} +\newcommand{\studentidpre}{学号} +\newcommand{\authorpre}{研究生姓名} +\newcommand{\advisorpre}{导~~师~~姓~~名} +\newcommand{\appdegreepre}{申请学位类别} +\newcommand{\majorpre}{一级学科名称} +\newcommand{\submajorpre}{二级学科名称} +\newcommand{\defenddatepre}{论文答辩日期} +\newcommand{\authorizeorganizationpre}{学位授予单位} +\newcommand{\@authorizeorganization}{~~东~南~大~学~~} +\newcommand{\authorizedatepre}{学位授予日期} +\newcommand{\committeechairpre}{答辩委员会主席} +\newcommand{\reviewerpre}{评~~~~~~~~~阅~~~~~~~~~人} +\newcommand{\@abstracttitle}{摘\quad 要} +\newcommand{\todayeng}{\the\year/\the\month/\the\day} +\newcommand{\@degreelevel}{硕士} +\newcommand{\@degreetype}{工学硕士} +\newcommand{\@degreetypeen}{Master of Engineering}\relax +\newcommand{\@thesistype}{\@degreelevel{}学位论文} +\newcommand{\signline}{\underline{\makebox[2.5cm][s]{}}} +\newcommand{\seudeclare}{ +\clearpage\thispagestyle{empty}\cleardoublepage\thispagestyle{empty} +{\xiaosihao +\begin{center} +{\heiti\sanhao 东南大学学位论文独创性声明} +\end{center} +\vspace{0.5in} +{ \linespread{1.5} +本人声明所呈交的学位论文是我个人在导师指导下进行的研究工作及取得的 +研究成果。尽我所知,除了文中特别加以标注和致谢的地方外,论文中不包 +含其他人已经发表或撰写过的研究成果,也不包含为获得东南大学或其它教 +育机构的学位或证书而使用过的材料。与我一同工作的同志对本研究所做的 +任何贡献均已在论文中作了明确的说明并表示了谢意。\par} +\vspace{0.3in} +\begin{flushright} +研究生签名:\signline 日~期:\signline +\end{flushright} +\vspace{1.5in} +\begin{center} +{\heiti\sanhao 东南大学学位论文使用授权声明} +\end{center} +\vspace{0.5in} +{ \linespread{1.5} +东南大学、中国科学技术信息研究所、国家图书馆有权保留本人所送交学位 +论文的复印件和电子文档,可以采用影印、缩印或其他复制手段保存论文。 +本人电子文档的内容和纸质论文的内容相一致。除在保密期内的保密论文 +外,允许论文被查阅和借阅,可以公布(包括刊登)论文的全部或部分内容。 +论文的公布(包括刊登)授权东南大学研究生院办理。\par} +\vspace{0.3in} +\begin{flushright} +研究生签名:\signline 导师签名:\signline 日~期:\signline +\end{flushright} +\par +} +} +\endinput +%% +%% End of file `seuthesix.cfg'.