Make a non-listed csl 1.0.1 valid

edited January 16, 2017
Hi,

I'm obliged by my university to use a specific csl which has not been published to this repository https://github.com/citation-style-language/styles (an older version is listed, universite-du-quebec-a-montreal.csl is still there but not maintained anymore by the university). As the older one is working fine with zotero and citeproc, the new one send me a warning when I import it in Zotero:

"style_UQAM.csl" n'est pas un style CSL 1.0.1 valide, et peut ne pas fonctionner correctement avec Zotero.
(or, roughly, "style_UQAM.csl" is not a valid CSL 1.0.1 style, and may not work correctly with Zotero.)

As I guess it would still work with Libreoffice Writer or Microsoft Word, my main problem is that I want to write in markdown and export pdfs using pandoc-citeproc. When I try to use pandoc with the flag "--csl=style_UQAM.csl", I get this error:

pandoc-citeproc: Prelude.head: empty list
pandoc: Error running filter pandoc-citeproc
Filter returned error status 1

I googled this error with and without specification about being a pandoc-citeproc specific error and it seems to be an Haskell error, a programming langage that I never used before. My main hypothesis is that pandoc-citeproc need a CSL 1.0.1 to work at all. I've written to my university to ask if that may be the case, but, as I'm waiting for an answer, I suppose I'll be asked to use a supported software, like LO or Word. If necessary, I would like to modify the csl file so I could use it but I'm new to editing those and I'm unsure what I should look for. Is there a tool I could use which could look for errors in the csl file? Do you have any tips for me? The style_UQAM.csl is available at this link : http://guides.bibliotheques.uqam.ca/uploads/uploads/original/style_UQAM.csl?1466513597

Thanks

  • Yes, the validator tool is here: http://validator.citationstyles.org/
    and for this style there are indeed a whole number of problems: http://validator.citationstyles.org/?url=http://guides.bibliotheques.uqam.ca/uploads/uploads/original/style_UQAM.csl?1466513597&version=1.0.1#source-code

    The pandoc error message is a bit cryptic, but you've made sure that the csl file is actually in your working directory when running that command?

  • Thanks for the quick answer. Yes, I tried first with an absolute file path, then a relative path to the csl in the working directory and I also tried moving the file in the .csl folder in my home directory which all gave me the same error. As I wrote earlier, I used a flag to specify the csl file, but I also tried to do the same by adding "csl = style_UQAM.csl" in the metadata section of my markdown file, without any different result. If I use a random file name it gives me a different error saying that the file is not found, so pandoc-citeproc seems to really load the csl file. I will try to play with the validator tool later, thanks for pointing it to me.
  • we've also contacted the person who coded the current UQAM style to see if he has any knowledge of the new style and what's up with that.
  • Thanks again. I'll keep this thread updated with any information I can get from UQAM's library about it.
  • Can you also give us the URL of the webpage that has the link you gave us above?
  • Absolutely.

    http://guides.bibliotheques.uqam.ca/themes/108-Zotero-a-l-uQAM-et-Carrefour-Zotero

    I can't find an english version of this page; if you need, I can translate.
  • Thanks. No need.

    You could try to contact the librarians (bibliotheques at uqam.ca) and point them to this thread. Obviously it's not good that they recommend the use of an invalid style. We'd be happy to work with them to update the copy in our repository with a new valid version.

    (our repository style was submitted in 2013, and we haven't gotten any updates from the original submitter. See https://github.com/citation-style-language/styles/pull/428)
  • I sent an email to bibliotheques-at-uqam.ca with a pointer to this thread, but haven't heard back yet. The original author of the CSL style mentioned that he is no longer with UQAM and no longer maintains the style (https://github.com/citation-style-language/styles/pull/428#issuecomment-273217802).
  • edited January 22, 2017
    I received an answer from a librarian a few days later. I pasted the email's content below, but in short, the csl file will be updated somewhere in 2017, but, they encourage me to contribute if I have the abilities. I would be glad to help if this is something I can do with you.

    "· En effet, vous avez raison, l’usager qui télécharge le style UQAM reçoit un message précisant que le style n’est pas valide, mais même si il n’est pas parfaitement aux normes, il est tout à fait opérationnel et fonctionne bien avec Zotero.

    · Le style va être corrigé en 2017 pour être conforme aux normes CSL, Rinze Zelle avec qui vous avez notamment communiqué a déjà pris contact avec l’UQAM.

    · Comme vous l’avez probablement noté, le style UQAM actuel est bien différent du style UQAM (Bouthat) (=ancien style UQAM), ce dernier a été codé en CSL par des étudiants et rendu disponible sur le répertoire des styles
    de Zotero, alors que le style UQAM actuel n’est pas encore disponible sur le répertoire des styles Zotero. Bien sûr, dès qu’il sera valide au regard des normes CSL, probablement pour l’automne 2017, il sera déposé sur le répertoire de styles Zotero.

    · Évidemment, si vous êtes déjà à même de rendre le style UQAM actuel conforme, ce serait apprécié, pourquoi pas ? Vous pouvez nous faire parvenir le fichier CSL dans ce cas. Soyez assuré que votre contribution serait mentionnée sur notre site Web, en plus d’apparaître dans les métadonnées du fichier CSL.

    · Dans l’attente de la validation du style, je n’ai pas de solution pour votre utilisation du logiciel Pandoc, peut-être vous rapprocher du service informatique de l’UQAM pour voir s’ils assurent le soutient à ce logiciel : https://servicesinformatiques.uqam.ca/accueil . De mon côté, je ne l’ai pas vu dans leur liste."
  • that sounds great -- if they're happy with the output of their currently posted style, the most promising approach would seem to be to just fix the validation errors in their style.
    https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step gives you some initial pointers on CSL
    Depending on how far you get, either follow-up with questions here, or include them in a pull request for the style:
    https://github.com/citation-style-language/styles/blob/master/CONTRIBUTING.md

    For this forum, if you have any questions, please include the code you're asking about. You can encode small code snippets (<10lines) usinge <code> </code> tags. Post longer code passages to gist.github.com and link to them here.
  • edited January 22, 2017
    Hi @lifestain
    I just had a quick look and it seemed quite easy things that were broken.
    It validates now, but I didn't check if the various types of references (journla article, book, chapter etc) actually look like they should, so it would be good if you could do the testing and let us know if it actually looks like it's supposed to look. (or can you specifically pinpoint where the examples are in the pdf. so much going on there...)
    https://gist.github.com/damnation333/0b0a082dad1e19c5c51031908e96cb1c

    From what I gather they style in the repo is old and very different from this one and the old not used anymore? It would be good to get this one uploaded, so students don't use the old one then.
  • (And hopefully get the library to keep the GitHub one up to date, rather than hosting their own version. )
  • I created a pull request to update the existing CSL repository style. Needs a few tweaks, but should be up in a few days: https://github.com/citation-style-language/styles/pull/2458. Reviews welcome.
  • edited February 3, 2017
    @lifestain, we just replaced our old repository style with a corrected version of the newer style at http://guides.bibliotheques.uqam.ca/themes/108-Zotero-a-l-uQAM-et-Carrefour-Zotero. Maybe you could inform the librarian you were in contact with?

    If they want to update their copy, they can download our latest version at https://raw.githubusercontent.com/citation-style-language/styles/master/universite-du-quebec-a-montreal.csl.
  • (But even better, they could just link to the CSL github file.)
Sign In or Register to comment.