Cambridge University Press - Law (note) | Ibid option

Hi,

I would like to include the "ibid" option in the "Cambridge University Press - Law (note)" style. I have tried to do this myself using explanations given in previous discussions, but it is a bit Chinese to me. Is there any chance someone can help me with this?

Many thanks!

Hanna
  • So I mean the following:

    - If the source, including the page number is identical: "Ibid"

    - If it contains another page from the same source: "Ibid, p. [...]"
  • You'll need to edit the style following this general guide: https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step

    If you look in the <citation... section you will see a conditional.
    That already has defined how subsequent citations look. To that you had an else-if condition for ibid+ibid-with-locator like so.

    <else-if position="ibid ibid-with-locator" match="any">
    <group delimiter=", ">
    <text term="ibid" form="short"/>
    <text macro="pageref"/>
    </group>
    </else-if>




  • Thanks for the input. I tried to adjust the style, but now I am just not able to upload the .csl file... Is there a chance I can just send you the new code?
  • First run it through: validator.citationstyles.org/
    To share your code, upload to pastebin.com and share the link.
  • edited April 8, 2022
    Okay, I ran it through the validator and there was a mistake in the "ibid" section. When I simply inserted what you suggested, the validator tells me it is not correct.

    So I tried to make changes but it is still not correct apparently:



























  • The code does not want to appear in this discussion?
  • Short pieces of code: <code>asdf</code>

    Large pieces via pastebin.com or similar.
  • The ibid-section can be found under lines 186 and following
  • edited April 8, 2022
    Well, you didn't copy paste my code, that's why it got broken.
    You can only have one if and one else.
    Generally it's:
    if
    else-if
    else-if
    ....
    else
  • If I include your suggestion, I get two errors:

    Line 186: Element “choose” from namespace “http://purl.org/net/xbiblio/csl” is missing a required instance of child element “if”.




    Line 192: Element “if” from namespace “http://purl.org/net/xbiblio/csl” not allowed as child of element “choose” from namespace “http://purl.org/net/xbiblio/csl” in this context. (Suppressing further errors from this subtree.)

    -if>


  • edited April 8, 2022
    You butchered that quite a bit. haha

    Also, you need to be careful as you're using some " " marks that are not correct. You also just invented a new term ibid-short that just doesn't exist in CSL.


    <citation>
    <layout suffix="." delimiter="; ">
    <choose>
    <if position="ibid-with-locator">
    <group delimiter=", ">
    <text term="ibid" form="short"/>
    <text macro="pageref"/>
    </group>
    </if>
    <else-if position="ibid">
    <group delimiter=", ">
    <text term="ibid" form="short"/>
    <text macro="pageref"/>
    </group>
    </else-if>
    <else-if position="subsequent">
    <group delimiter=", ">
    <text macro="author-short"/>
    <text macro="title-short"/>
    <text macro="pageref"/>
    </group>
    </else-if>
    <else>
    <group delimiter=" ">
    <group delimiter=", ">
    <text macro="author"/>
    <text macro="title"/>
    </group>
    <group>
    <choose>
    <if type="article-journal" match="any">
    <group delimiter=" " prefix=" ">
    <text macro="date" prefix="(" suffix=")"/>
    <text macro="volref"/>
    <text macro="container"/>
    <text macro="pageno"/>
    </group>
    </if>
    <else-if type="chapter paper-conference" match="any">
    <group delimiter=", " prefix=" ">
    <text macro="container"/>
    <text macro="publisher"/>
    <text macro="pageno"/>
    </group>
    </else-if>
    <else-if type="book" match="any">
    <group delimiter=" ">
    <group delimiter=", " prefix=", ">
    <text macro="volumes"/>
    <text macro="edition"/>
    </group>
    <group delimiter=", " prefix=" ">
    <text macro="publisher"/>
    <text macro="volume"/>
    </group>
    </group>
    </else-if>
    <else-if type="thesis" match="any">
    <group delimiter=", " prefix=" ">
    <text variable="container-title"/>
    <text variable="genre"/>
    <group delimiter=" ">
    <text macro="publisher"/>
    <date form="text" date-parts="year-month-day" variable="issued"/>
    </group>
    </group>
    </else-if>
    <else>
    <text macro="publisher"/>
    <text macro="date" prefix="(" suffix=")"/>
    </else>
    </choose>
    </group>
    <text macro="pageref" prefix=" "/>
    </group>
    </else>
    </choose>
    </layout>
    </citation>
Sign In or Register to comment.