武大硕士毕业论文csl格式文件代码

结果如下

在这里插入图片描述

代码

  1. 我基于Harvard格式修改
  2. citation混淆时用 年份+a/b 来区分
  3. 英文citation和reference中 用 andet al.
  4. 中文citation和reference中 用
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" default-locale="en">
  <info>
    <title>HYC_graduate</title>
    <id>http://www.zotero.org/styles/harvard-modified-2</id>
    <link href="http://www.zotero.org/styles/elsevier-harvard" rel="self"/>
    <link href="http://www.zotero.org/styles/ecology-letters" rel="template"/>
    <link href="http://www.elsevier.com/journals/biological-conservation/0006-3207/guide-for-authors#68000" rel="documentation"/>
    <author>
      <name>David Kaplan</name>
      <email>david.kaplan@ird.fr</email>
    </author>
    <contributor>
      <name>Simon Kornblith</name>
      <email>simon@simonster.com</email>
    </contributor>
    <contributor>
      <name>Bruce D'Arcus</name>
    </contributor>
    <contributor>
      <name>Curtis M. Humphrey</name>
    </contributor>
    <contributor>
      <name>Richard Karnesky</name>
      <email>karnesky+zotero@gmail.com</email>
      <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>
    </contributor>
    <contributor>
      <name>Sebastian Karcher</name>
    </contributor>
    <category citation-format="author-date"/>
    <category field="biology"/>
    <category field="generic-base"/>
    <updated>2019-01-22T15:57:12+00: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>
  <macro name="container">
    <choose>
      <if type="chapter paper-conference" match="any">
        <text term="in" prefix=", " suffix=": "/>
        <names variable="editor translator" delimiter=", " suffix=", ">
          <name name-as-sort-order="all" sort-separator=", " initialize-with="." delimiter=", " delimiter-precedes-last="always"/>
          <label form="short" text-case="capitalize-first" prefix=" (" suffix=")"/>
        </names>
        <group delimiter=", ">
          <text variable="container-title" text-case="title"/>
          <text variable="collection-title" text-case="title"/>
        </group>
      </if>
      <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
        <group prefix=", " delimiter=", ">
          <text variable="container-title"/>
          <text variable="collection-title"/>
        </group>
      </else-if>
      <else>
        <group prefix=". " delimiter=", ">
          <text variable="container-title" form="short"/>
          <text variable="collection-title"/>
        </group>
      </else>
    </choose>
  </macro>
  <macro name="author">
    <names variable="author">
      <name form="long" name-as-sort-order="all" sort-separator=" " et-al-use-first="3"
            delimiter=", " delimiter-precedes-last="never" initialize-with=" "
            et-al-min="3" delimiter-precedes-et-al="always">
      </name>
      <label form="short" prefix=" (" suffix=")" text-case="capitalize-first"/>
	  
      <substitute>
        <names variable="editor"/>
        <names variable="translator"/>
        <text macro="title"/>
      </substitute>
    </names>
  </macro>
  <macro name="author-short_en">
    <names variable="author">
      <name form="short" and="text" delimiter=", " initialize-with=". "/>
      <substitute>
        <names variable="editor"/>
        <names variable="translator"/>
        <choose>
          <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
            <text variable="title" form="short" font-style="italic"/>
          </if>
          <else>
            <text variable="title" form="short" quotes="true"/>
          </else>
        </choose>
      </substitute>
    </names>
  </macro>

  <macro name="access">
    <choose>
      <if variable="DOI">
        <text variable="DOI" prefix="https://doi.org/"/>
      </if>
      <else-if type="webpage post-weblog" match="any">
        <group delimiter=" ">
          <text value="URL"/>
          <text variable="URL"/>
          <group prefix="(" suffix=").">
            <text term="accessed" suffix=" "/>
            <date variable="accessed">
              <date-part name="month" form="numeric" suffix="."/>
              <date-part name="day" suffix="."/>
              <date-part name="year" form="short"/>
            </date>
          </group>
        </group>
      </else-if>
    </choose>
  </macro>
  <macro name="title">
    <choose>
      <if type="report thesis" match="any">
        <text variable="title"/>
        <group prefix=" (" suffix=")" delimiter=" ">
          <text variable="genre"/>
          <text variable="number" prefix="No. "/>
        </group>
      </if>
      <else-if type="bill book graphic legal_case legislation motion_picture report song speech" match="any">
        <text variable="title"/>
        <text macro="edition" prefix=", "/>
      </else-if>
      <else-if type="webpage">
        <text variable="title"/>
        <text value="WWW Document" prefix=" [" suffix="]"/>
      </else-if>
      <else>
        <text variable="title"/>
      </else>
    </choose>
  </macro>
  <macro name="publisher">
    <group delimiter=", ">
      <text variable="publisher"/>
      <text variable="publisher-place"/>
    </group>
  </macro>
  <macro name="event">
    <choose>
      <if variable="event">
        <text term="presented at" text-case="capitalize-first" suffix=" "/>
        <text variable="event"/>
      </if>
    </choose>
  </macro>
  <macro name="issued">
    <choose>
      <if variable="issued">
        <date variable="issued">
          <date-part name="year"/>
        </date>
      </if>
      <else>
        <text term="no date" form="short"/>
      </else>
    </choose>
  </macro>
  <macro name="edition">
    <group delimiter=" ">
      <choose>
        <if is-numeric="edition">
          <number variable="edition" form="ordinal"/>
        </if>
        <else>
          <text variable="edition" suffix="."/>
        </else>
      </choose>
      <text value="ed"/>
    </group>
  </macro>
  <macro name="locators">
    <choose>
      <if type="article-journal article-magazine article-newspaper" match="any">
        <group prefix=" " delimiter=", ">
          <group>
            <text variable="volume"/>
          </group>
          <text variable="page"/>
        </group>
      </if>
      <else-if type="bill book graphic legal_case legislation motion_picture report song thesis" match="any">
        <group delimiter=", " prefix=". ">
          <text macro="event"/>
          <text macro="publisher"/>
        </group>
      </else-if>
      <else-if type="chapter paper-conference" match="any">
        <group delimiter=", " prefix=". ">
          <text macro="event"/>
          <text macro="publisher"/>
          <group>
            <label variable="page" form="short" suffix=" "/>
            <text variable="page"/>
          </group>
        </group>
      </else-if>
      <else-if type="patent">
        <text variable="number" prefix=". "/>
      </else-if>
    </choose>
  </macro>
  <citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-givenname="false" collapse="year" cite-group-delimiter=", ">
    <sort>
      <key macro="author"/>
      <key macro="issued" sort="descending"/>
    </sort>
    <layout locale='zh' prefix="(" suffix=")" delimiter=";">
      <group delimiter=",">
        <names variable="author">
          <name form="long" and="text" name-as-sort-order="all" sort-separator=" " initialize-with="" delimiter=", " delimiter-precedes-last="never">
            <name-part name="family"/>
            <name-part name="given"/>
          </name>
        </names>
        <text macro="issued"/>
      </group>
    </layout>
    <layout prefix="(" suffix=")" delimiter=";">
      <group delimiter=", ">
        <text macro="author-short_en"/>
        <text macro="issued"/>
        <group delimiter=" ">
          <label variable="locator" form="short"/>
          <text variable="locator"/>
        </group>
      </group>
    </layout>
  </citation>
  <bibliography hanging-indent="true" entry-spacing="0" line-spacing="1">
    <sort>
      <key macro="author"/>
      <key macro="issued" sort="descending"/>
    </sort>
    <layout locale='zh'>
      <group suffix=". ">
		    <text variable="citation-number" prefix="[" suffix="] "/>
        <text macro="author" suffix="."/>
        <text macro="issued" prefix=" "/>
        <group prefix=". ">
          <text macro="title"/>
          <choose>
            <if type="article-journal">
              <text value="[J]"/> <!-- 期刊 -->
            </if>
            <else-if type="book">
              <text value="[M]"/> <!-- 书籍 -->
            </else-if>
            <else-if type="paper-conference">
              <text value="[C]"/> <!-- 会议论文 -->
            </else-if>
            <else-if type="thesis">
              <text value="[D]"/> <!-- 学位论文 -->
            </else-if>
            <!-- 其他类型 -->
          </choose>
        </group>
      </group>
      
      <group>
        <text variable="container-title"/> <!-- 期刊名称 -->
        <group>
          <text variable="volume" prefix=", "/> <!-- 卷 -->
          <text variable="issue" prefix="(" suffix=")"/> <!-- 期 -->
        </group>
        <text variable="page" prefix=": " suffix="."/> <!-- 页码 -->
      </group>
    </layout>
    <layout>
      <group suffix=". ">
		    <text variable="citation-number" prefix="[" suffix="] "/>
        <text macro="author" suffix="."/>
        <text macro="issued" prefix=" "/>
        <group prefix=". ">
          <text macro="title"/>
          <choose>
            <if type="article-journal">
              <text value="[J]"/> <!-- 期刊 -->
            </if>
            <else-if type="book">
              <text value="[M]"/> <!-- 书籍 -->
            </else-if>
            <else-if type="paper-conference">
              <text value="[C]"/> <!-- 会议论文 -->
            </else-if>
            <else-if type="thesis">
              <text value="[D]"/> <!-- 学位论文 -->
            </else-if>
            <!-- 其他类型 -->
          </choose>
        </group>
      </group>
      
      <group>
        <text variable="container-title"/> <!-- 期刊名称 -->
        <group>
          <text variable="volume" prefix=", "/> <!-- 卷 -->
          <text variable="issue" prefix="(" suffix=")"/> <!-- 期 -->
        </group>
        <text variable="page" prefix=": " suffix="."/> <!-- 页码 -->
      </group>
    </layout>
  </bibliography>
</style>

余论

  1. 主要是 等 和 et al. 在不同语言中切换的问题,采用这位的方法,通过在开头设置 default-locale=“zh”,并且在最后的citation和bibliography里面设计两个同样layout,但是第一个设置locale=“en” (这里如果zh和en设反了会导致参考文献的英文在中文上面)。在这里插入图片描述在这里插入图片描述在这里插入图片描述

  2. 逗号、圆括号、分号的圆角半角问deepseek自己改

  3. 参考文献条目类型我就加了[J][M][C][D],有其他需要问deepseek自己加

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值