1

我是 Zotero 和引文风格语言 (CSL) 的新手。我想修改一种样式以允许引用格式为 [NameYear] 格式,其中“姓名”是第一作者的姓氏,“年份”是出版年份。我可以轻松地适应另一种类似的“作者日期”类型的样式,但是我无法删除“等”。出现在下面的示例中:

[King et al.2011]

在这种情况下,我想要得到的是 [King2011]。出于引用的目的,我想忽略所有其他作者。

我还使用与参考书目条目开头相同的格式,目前读取为:

“[King et al.2011] RR King et al., 下一代多结太阳能电池中的带隙电压偏移和能量生产。Prog. Photovolt: Res. Appl. 19, 797–812 (2011)。”

在这里,我希望这个书目条目的开头简单地读为“[King2011]”。

(注意:我确实了解如何控制书目条目中的完整作者列表,在上面显示为“RR King et al.”,所以我对这部分没有任何问题。)

如果有人对如何删除“等”有见识。从引文中的这个作者“列表”(或者只是插入第一作者的姓氏),我非常感谢您提供的任何帮助!

(我使用的是 Zotero 5.0.96.2)

这是我正在尝试改编的 CSL 文件,基于 Elsevier Harvard (titles) 文件。我添加了宏“author-short”和“citation_text”,并修改了引文和参考书目部分。

<?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-US">
  <!-- This style was edited with the Visual CSL Editor (https://editor.citationstyles.org/visualEditor/) -->
  <info>
    <title>Modified_Elsevier_Harvard_titles</title>
    <id>http://www.zotero.org/styles/cev_elsevier_harvard_titles</id>
    <link href="http://www.zotero.org/styles/cev_elsevier_harvard_titles" 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>2021-10-20T22:57:37+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 et-al-min="3" et-al-use-first="1" initialize-with="."/>
      <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">
    <names variable="author">
      <name form="short" delimiter="" and="symbol" delimiter-precedes-et-al="never" delimiter-precedes-last="never" et-al-min="1" et-al-use-first="1" initialize-with=". " sort-separator=""/>
      <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>
  <macro name="citation_text">
    <group>
      <text macro="author-short"/>
      <text value=""/>
      <text macro="issued"/>
      <group delimiter=" ">
        <label variable="locator" form="short"/>
        <text variable="locator"/>
      </group>
    </group>
  </macro>
  <citation et-al-min="3" et-al-use-first="1" disambiguate-add-givenname="true" disambiguate-add-year-suffix="true" collapse="year" cite-group-delimiter=", ">
    <sort>
      <key macro="author"/>
      <key macro="issued" sort="descending"/>
    </sort>
    <layout delimiter="; " prefix="[" suffix="]">
      <text macro="citation_text"/>
    </layout>
  </citation>
  <bibliography hanging-indent="true" entry-spacing="0" line-spacing="1">
    <sort>
      <key macro="author"/>
      <key macro="issued" sort="descending"/>
    </sort>
    <layout>
      <text macro="citation_text" prefix="[" suffix="]  "/>
      <group suffix=".">
        <text macro="author" suffix=","/>
        <group prefix=" ">
          <text macro="title"/>
          <text macro="container"/>
          <text macro="locators"/>
        </group>
        <text macro="issued" prefix=" (" suffix=")"/>
      </group>
    </layout>
  </bibliography>
</style>
4

0 回答 0