Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lychichem/22891a5220227b32dfe63366ef806a07 to your computer and use it in GitHub Desktop.
Save lychichem/22891a5220227b32dfe63366ef806a07 to your computer and use it in GitHub Desktop.
china-national-standard-gb-t-7714-2015-numeric.csl
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="in-text" default-locale="en-US" delimiter-precedes-last="always" demote-non-dropping-particle="never" initialize-with=" " name-delimiter=", " names-delimiter=". " name-as-sort-order="all" sort-separator=" ">
<info>
<title>China National Standard GB/T 7714-2015(numeric, 中文)</title>
<title-short>GB/T 7714-2015</title-short>
<id>http://www.zotero.org/styles/china-national-standard-gb-t-7714-2015-numeric</id>
<link href="http://www.zotero.org/styles/china-national-standard-gb-t-7714-2015-numeric" rel="self"/>
<link href="http://www.std.gov.cn/gb/search/gbDetailed?id=71F772D8055ED3A7E05397BE0A0AB82A" rel="documentation"/>
<author>
<name>lychichem</name>
</author>
<category citation-format="numeric"/>
<category field="generic-base"/>
<summary>The Chinese GB/T7714-2015 numeric style</summary>
<updated>9999-12-31T18:00:00+08:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<locale xml:lang="zh-CN">
<terms>
<term name="anonymous">佚名</term>
<term name="edition">版</term>
<term name="et-al">等</term>
<term name="page" form="short">
<single>p.</single>
<multiple>pp.</multiple>
</term>
</terms>
</locale>
<locale xml:lang="en-US">
<terms>
<term name="edition"> edition</term>
</terms>
</locale>
<macro name="accessed-date">
<date variable="accessed" delimiter="&#8211;" prefix="[" suffix="]">
<date-part name="year"/>
<date-part name="month" form="numeric-leading-zeros"/>
<date-part name="day" form="numeric-leading-zeros"/>
</date>
</macro>
<macro name="author">
<choose>
<if variable="author">
<names variable="author">
<name>
<name-part name="family"/>
<name-part name="given"/>
</name>
</names>
</if>
<else>
<text term="anonymous"/>
</else>
</choose>
</macro>
<macro name="container-author">
<names variable="container-author">
<name>
<name-part name="family"/>
<name-part name="given"/>
</name>
</names>
</macro>
<macro name="edition">
<choose>
<if variable="edition">
<group delimiter="">
<text variable="edition"/>
<text term="edition"/>
</group>
</if>
</choose>
</macro>
<macro name="editor">
<names variable="editor translator">
<name>
<name-part name="family"/>
<name-part name="given"/>
</name>
<label form="short" prefix=", "/>
</names>
</macro>
<macro name="issued-date">
<choose>
<if variable="issued">
<date variable="issued" delimiter="&#8211;">
<date-part name="year"/>
<date-part name="month" form="numeric-leading-zeros"/>
<date-part name="day" form="numeric-leading-zeros"/>
</date>
</if>
<else>
<text term="no date" prefix="[" suffix="]"/>
</else>
</choose>
</macro>
<macro name="issue-date-year">
<choose>
<if variable="issued">
<date variable="issued" date-parts="year" form="numeric"/>
</if>
<else>
<text term="no date" prefix="[" suffix="]"/>
</else>
</choose>
</macro>
<macro name="publishing">
<choose>
<if variable="publisher">
<group delimiter=": ">
<text variable="publisher-place"/>
<group delimiter=", ">
<text variable="publisher"/>
<text macro="issue-date-year"/>
</group>
</group>
<text variable="page" prefix=": "/>
</if>
</choose>
</macro>
<macro name="serial-information">
<choose>
<if variable="page">
<group delimiter=", ">
<text macro="issue-date-year"/>
<text variable="volume"/>
</group>
<text variable="issue" prefix="(" suffix=")"/>
<text variable="page" prefix=": "/>
</if>
<else-if variable="DOI">
<text variable="DOI" prefix="doi:"/>
</else-if>
</choose>
</macro>
<macro name="type-code">
<choose>
<if type="article-journal article-magazine" match="any">
<text value="J"/>
</if>
<else-if type="article-newspaper">
<text value="N"/>
</else-if>
<else-if type="bill legislation" match="any">
<text value="S"/>
</else-if>
<else-if type="book">
<text value="M"/>
</else-if>
<else-if type="chapter">
<text value="M"/>
</else-if>
<else-if type="dataset">
<text value="DS"/>
</else-if>
<else-if type="paper-conference">
<text value="C"/>
</else-if>
<else-if type="patent">
<text value="P"/>
</else-if>
<else-if type="post-weblog webpage" match="any">
<text value="EB"/>
</else-if>
<else-if type="report">
<text value="R"/>
</else-if>
<else-if type="thesis">
<text value="D"/>
</else-if>
<else>
<text value="Z"/>
</else>
</choose>
</macro>
<macro name="title">
<text variable="title" text-case="title"/>
<text variable="number" prefix=": "/>
<group delimiter="/" prefix="[" suffix="]">
<text macro="type-code"/>
<choose>
<if type="article article-magazine article-newspaper article-journal bill broadcast dataset entry entry-dictionary entry-encyclopedia figure graphic interview manuscript map motion_picture musical_score pamphlet post post-weblog personal_communication report song speech treaty webpage book chapter">
<choose>
<if variable="URL">
<text value="OL"/>
</if>
</choose>
</if>
</choose>
</group>
</macro>
<citation collapse="citation-number" after-collapse-delimiter=",">
<sort>
<key variable="citation-number" sort="ascending"/>
</sort>
<layout vertical-align="sup" delimiter="," prefix="[" suffix="]">
<text variable="citation-number"/>
<group prefix="(" suffix=")">
<label variable="locator" suffix=". " form="short" strip-periods="true"/>
<text variable="locator"/>
</group>
</layout>
</citation>
<bibliography entry-spacing="0" et-al-min="4" et-al-use-first="3" line-spacing="1" second-field-align="flush">
<layout suffix="." locale="zh">
<text variable="citation-number" prefix="[" suffix="]"/>
<text macro="author" suffix=". "/>
<choose>
<if type="paper-conference">
<text variable="title" suffix=": "/>
<text variable="event"/>
<text macro="type-code" prefix="[" suffix="]"/>
</if>
<else>
<text macro="title"/>
</else>
</choose>
<choose>
<if type="book bill chapter legislation report thesis" match="any">
<text macro="editor" prefix=". "/>
<choose>
<if variable="container-title">
<text value="//"/>
<text macro="container-author" suffix=". "/>
<text variable="container-title" suffix=". " text-case="title"/>
</if>
<else>
<text value=". "/>
</else>
</choose>
<text variable="event" suffix=", "/>
<text macro="edition" prefix="第" suffix=". "/>
<text macro="publishing"/>
</if>
<else-if type="paper-conference">
<text macro="editor" prefix=". "/>
<choose>
<if variable="container-title">
<text value="//"/>
<text macro="container-author" suffix=". "/>
<text variable="container-title" suffix=": " text-case="title"/>
</if>
<else>
<text value=". "/>
</else>
</choose>
<text macro="publishing"/>
</else-if>
<else-if type="article-journal article-magazine article-newspaper" match="any">
<group prefix=". ">
<choose>
<if variable="container-title">
<text variable="container-title" text-case="title"/>
<text macro="serial-information" prefix=", "/>
</if>
<else>
<text macro="serial-information" suffix=". "/>
<text macro="publishing"/>
</else>
</choose>
</group>
</else-if>
<else-if type="patent">
<text macro="issued-date" prefix=". "/>
</else-if>
<else>
<text macro="publishing" prefix=". "/>
<text macro="issued-date" prefix="(" suffix=")"/>
</else>
</choose>
<text macro="accessed-date"/>
<group delimiter=". " prefix=". ">
<choose>
<if type="bill broadcast dataset entry entry-dictionary entry-encyclopedia figure graphic interview manuscript map motion_picture musical_score pamphlet post post-weblog personal_communication report song speech treaty webpage book chapter" match="any">
<text variable="URL"/>
</if>
</choose>
</group>
</layout>
<layout suffix=".">
<text variable="citation-number" prefix="[" suffix="]"/>
<text macro="author" suffix=". "/>
<choose>
<if type="paper-conference">
<text variable="title" suffix=": "/>
<text variable="event"/>
<text macro="type-code" prefix="[" suffix="]"/>
</if>
<else>
<text macro="title"/>
</else>
</choose>
<choose>
<if type="book bill chapter legislation report thesis" match="any">
<text macro="editor" prefix=". "/>
<choose>
<if variable="container-title">
<text value="//"/>
<text macro="container-author" suffix=". "/>
<text variable="container-title" suffix=". " text-case="title"/>
</if>
<else>
<text value=". "/>
</else>
</choose>
<text macro="edition" suffix=". "/>
<text macro="publishing"/>
</if>
<else-if type="paper-conference">
<text macro="editor" prefix=". "/>
<choose>
<if variable="container-title">
<text value="//"/>
<text macro="container-author" suffix=". "/>
<text variable="container-title" suffix=": " text-case="title"/>
</if>
<else>
<text value=". "/>
</else>
</choose>
<text macro="publishing"/>
</else-if>
<else-if type="article-journal article-magazine article-newspaper" match="any">
<group prefix=". ">
<choose>
<if variable="container-title">
<text variable="container-title" text-case="title"/>
<text macro="serial-information" prefix=", "/>
</if>
<else>
<text macro="serial-information" suffix=". "/>
<text macro="publishing"/>
</else>
</choose>
</group>
</else-if>
<else-if type="patent">
<text macro="issued-date" prefix=". "/>
</else-if>
<else>
<text macro="publishing" prefix=". "/>
<text macro="issued-date" prefix="(" suffix=")"/>
</else>
</choose>
<text macro="accessed-date"/>
<group delimiter=". " prefix=". ">
<choose>
<if type="bill broadcast dataset entry entry-dictionary entry-encyclopedia figure graphic interview manuscript map motion_picture musical_score pamphlet post post-weblog personal_communication report song speech treaty webpage book chapter" match="any">
<text variable="URL"/>
</if>
</choose>
</group>
</layout>
</bibliography>
</style>
@lychichem
Copy link
Author

lychichem commented Apr 17, 2021

这是一个修改版的GB/T 7714-2015引文样式

优点:

  1. 相比官方版,能正确处理双语同时排版,不会在英文中出现“等”或在中文中出现“et al”;
  2. 相比网上流传的一些修改版,引用中文书籍类文献时不会在版本号和“版”字间加入空格,并且不用在版本号前手动加“第”字;
  3. 对于没有出页码的期刊自动使用doi,但不像其他修改版一样要么全加doi要么没有doi;
  4. 将主语言设置为英语,更好解决毕业论文引文更多使用英语的问题(当然如果你是引用中文多的可以选择把default-locale改成zh-CN,把205行的 locale="zh"改成 locale="en"并剪切到256行,然后把256-306行放在205-255行之前,然后引的英文内容在zotero里写上语言是en);
  5. 把更新时间设置成了9999年12月31日老板再也不用担心鬼佬乱更新搞坏我论文了。
  6. 把英文姓名调成仅姓名首字母大写(也可以加代码调回去的,两种都是对的)

目前问题:

  1. 对于zotero而言,中文内容的识别是靠“语言(locale)”字段,所以对于中文内容这里必须填zh才能被本样式正确识别为中文(不过正常论文引英文多一点,所以敲中文信息工作量应该不大,网上流传版那个默认语言是中文的需要你确保英文内容的locale是en,那个有些网站抓取的时候没处理好很头痛的),当然如果你是引用中文多的可以选择把default-locale改成zh-CN,把205行的 locale="zh"改成 locale="en"并剪切到256行,然后把256-306行放在205-255行之前,然后引的英文内容在zotero里写上语言是en;
  2. 当期刊没有页码时插入的doi后面会自动加访问日期(可能其他类型的文献也有只是我没发现)。
  3. 对于带有url的书籍和图书章节,目前的处理方式是判定为OL并会加上URL和访问时间的……如果不需要可以:1、手动在zotero里把url和访问时间清空 2、删掉182、250、301行的 book chapter(只会取消OL判定和URL)
  4. 法条、案例是不会被判定为OL的(因为觉得这玩意法学的朋友们应该都会引用什么法律出版社或者最高人民法院出的正经出版物而不会引网页资源),但我不是文科对这个不熟,如果有要引网络资源的情况麻烦自己在上面提到的那三行加上legislation legal_case,加在type=的那个引号里面,和前一单词中间空一格(但是会造成你所有有URL的法条类出版物全被判定成OL并加URL)

@yh0725
Copy link

yh0725 commented Oct 21, 2021

我在用的时候中文文献作者数量多的时候,出现的仍然是et al,不是‘等’,请问是什么原因

@lychichem
Copy link
Author

我在用的时候中文文献作者数量多的时候,出现的仍然是et al,不是‘等’,请问是什么原因

中文需要手动在zotero里把条目的语言指定为zh

@yh0725
Copy link

yh0725 commented Oct 22, 2021 via email

@lychichem
Copy link
Author

感谢回复,已经解决了,多谢。 另外,在使用中发现文末的参考文献列表中会有自动缩进,如图,请问在哪里可以调整?

-----原始邮件----- 发件人:"Chi Lei" @.> 发送时间:2021-10-21 22:18:03 (星期四) 收件人: lychichem @.> 抄送: yh0725 @.>, Comment @.> 主题: Re: lychichem/china-national-standard-gb-t-7714-2015-numeric.csl @lychichem commented on this gist. 我在用的时候中文文献作者数量多的时候,出现的仍然是et al,不是‘等’,请问是什么原因 中文需要手动在zotero里把条目的语言指定为zh — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

可以选中后设置格式的(

@yh0725
Copy link

yh0725 commented Oct 22, 2021

可以选中后设置格式的(

是指在word里调整吗?调了之后更新参考文献又会变成有缩进的,所以想问问能不能在格式代码里调整

@lychichem
Copy link
Author

可以选中后设置格式的(

是指在word里调整吗?调了之后更新参考文献又会变成有缩进的,所以想问问能不能在格式代码里调整

那你试着把204行的second-field-align="flush"去掉……

@Yutianyi5140357
Copy link

作者请问为什么我引用会议论文的时候,页数和年份信息会直接缺失呢

@lychichem
Copy link
Author

lychichem commented Jan 5, 2022

@Yutianyi5140357 有可能是我biblography部分的代码设置有问题,导致会议论文的页码被排除了
不过我这里实测是会议名没了,但页码和年份在的啊
修好了会议名的问题

@Changhy1115
Copy link

您好,不知道是否方便问您一下如何修改把英文参考文献里标题只有第一个单词的第一个字母大写,后面单词的第一个字母小写呀?以及在引用中文硕博论文时发现会将下载日期也附上,不知道您是否知道如何修改?
image

@kaluojushi
Copy link

您好,不知道是否方便问您一下如何修改把英文参考文献里标题只有第一个单词的第一个字母大写,后面单词的第一个字母小写呀?以及在引用中文硕博论文时发现会将下载日期也附上,不知道您是否知道如何修改? image

第二个问题解决了,应该是通过Zotero插件插入的条目会有一个访问时间,把访问时间删掉就不会出现了
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment