Help updating cls

I edited harvard-cape-peninsula-university-of-technology cls file to match the one of my university. I did this back in 2018 but nowadays it says that the file is old and may not work. I need to re-add the file everytime I open zotero cause it won't remember it. Ofc I can do that but it'd be more convenient if I just could update it. I don't know how to do that tho.
So how would I go about it?
  • Hey,

    put your code on HasteBin or PasteBin and share the link here. :)

    You will likely have not changed the ID and self link in the style (lines 5-6, I think) and therefore gets overwritten each time.
  • edited 25 days ago
    https://pastebin.com/LexPCz7Q
    This is the code I use.
    So I'd assume it might be line 7-9 that's arguing then.

    https://gyazo.com/d05d3b9255f402824c82ebfcd7396430
    It says that it's not a valid csl 1.0.1 templatefile and may not work with zotero.
  • edited 25 days ago
    No, as you based your code on a style from the repository this should be not about the version of the CSL.

    What language is this style supposed to be in? I think the error might stem from your default-locale you've set as "SV" which is probably not correct. If it is Swedish, put "sv-SE", if it is Salvadorian Spanish, put "es-SV".


    Using https://validator.citationstyles.org/ we can see where the error is and why it's not validating.
    Delete lines 56-58 and it'll validate.

    Also, as I mentioned before, you'll need to modify your line 6 + 7 with something unique.
    (and you can move the original title to line 8, so you'll remember what style you used as a template).

    So, I recommend something like below for your "info" section:



    <?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="SV">
    <info>
    <title>Harvard - My University Name - Faculty of XXX</title>
    <id>http://www.zotero.org/styles/harvard-my-university-name-faculty-of-xxx</id>;
    <link href="http://www.zotero.org/styles/harvard-my-university-name-faculty-of-xxx"; rel="self"/>
    <link href="http://www.zotero.org/styles/harvard-cape-peninsula-university-of-technology"; rel="template"/>
    <link href="put your URL with the style guide here" rel="documentation"/>
    <author>
    <name>Lara Skelly</name>
    <email>laralibrarian@gmail.com</email>
    </author>
    <category citation-format="author-date"/>
    <category field="generic-base"/>
    <summary>Put your style description here!</summary>
    <updated>2020-05-11T14:50:45+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>


  • That did the trick! Thank you so much! This makes it so much easier for me and my fellow students to write our master thesis.
  • If the style is of a good quality and with guidelines that one can find online, you could think about uploading the style to the repository. That way your fellow students in the far future can still find the style (and it can be made better), rather just you and your few friends.
    You've done the legwork now.
Sign In or Register to comment.