检测文本内引用第一次出现的语法

问题描述 投票:0回答:1

我正在尝试创建一个 CSL 文件,该文件在第一个文本引用中使用作者姓名,但在所有后续引用中使用贡献者姓名(除非没有贡献者)。 我要在

cs:if
块中测试什么条件才能实现此目的?

以下是我的 CSL 引文部分的片段。

<citation>
  <sort />
  <layout>
    <choose>
      <!-- I need assistance getting the condition for the next line -->
      <if match="CONDITIONAL FOR FIRST IN-TEXT CITATION">
        <text macro="author-short"/>
      </if>
      <else>
        <choose>
          <!-- 
            Use the contributor for subsequent citations if a contributor exists
            else use the short-author.
          -->
          <if match="any" variable="contributor">
            <text macro="author-contrib"/>
          </if>
          <else>
            <text macro="author-short"/>
          </else>
        </choose>
      </else>
    </choose>
  </layout>
</citation>
csl
1个回答
0
投票

position
属性正是为此而设计的,因此在您的示例中:

<if position="first">
    <text macro="author-short"/>
</if>
© www.soinside.com 2019 - 2024. All rights reserved.