robinsonkwame / bibtex_zotero_citation_style

BibTeX generic citation style (works w multiple inline)
Creative Commons Zero v1.0 Universal
9 stars 1 forks source link

not a valid CSL 1.0.2 style file #3

Open Zephyr-Sylvester opened 2 months ago

Zephyr-Sylvester commented 2 months ago

Followed your step 1 (below) and received the following message:

Zotero > Settings > Cite Icon > "+" button > select bibtex_style.csl


Are you sure you want to continue?```

I am running mac Sonoma version 14.6.1 and zotero version 7.0.3 
robinsonkwame commented 2 months ago

The file fails CSL validation, with,

Line 65: Bad value “et-al-custom” for attribute “name” on element “term” from namespace “[http://purl.org/net/xbiblio/csl”](http://purl.org/net/xbiblio/csl%E2%80%9D).
<term name="et-al-custom">etal.

Line 71: Bad value “et-al-custom” for attribute “term” on element “et-al” from namespace “[http://purl.org/net/xbiblio/csl”](http://purl.org/net/xbiblio/csl%E2%80%9D).
<et-al term="et-al-custom" font-style="italic"/>

where the CSL specification doesn't allow for custom term names. The name attribute of the term element must be a predefined term in the CSL schema.

However, when importing and applying the style it does generate a latex \cite and @misc{...} style bibliography. So you could ignore the error.

I will see if I have time this week to apply the following recommendation, test, and push the change (or someone else can make a PR :D)

<?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="sort-only" default-locale="en-US">
  <info>
    <title>BibTeX generic citation style (works w multiple inline) </title>
    <id>http://www.zotero.org/styles/bibtex</id>
    <link href="http://www.zotero.org/styles/bibtex" rel="self"/>
    <link href="http://www.bibtex.org/" rel="documentation"/>
    <!-- ... (rest of the info section remains unchanged) ... -->
  </info>
  <!-- ... (other macros remain unchanged) ... -->

  <!-- Remove the custom term definition -->
  <!-- <term name="et-al-custom">etal.</term> -->

  <!-- Add the new macro for custom et-al text -->
  <macro name="custom-et-al">
    <text value="etal." font-style="italic"/>
  </macro>

  <!-- Modify the author-short macro to use the new custom-et-al macro -->
  <macro name="author-short">
    <names variable="author">
      <name form="short" delimiter="_" delimiter-precedes-last="always" et-al-min="2" et-al-use-first="2"/>
      <et-al>
        <text macro="custom-et-al"/>
      </et-al>
      <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"/>
          </if>
          <else>
            <text variable="title" form="short"/>
          </else>
        </choose>
      </substitute>
    </names>
  </macro>

  <!-- ... (rest of the file remains unchanged) ... -->
</style>