Problems creating a CSL style: name first author multiple times in biography entry

I am currently trying to generate a CSL style that adheres to a somewhat weird format I need to follow in a document:

In general it is a author-year style citation format. The specifics are:

Inline citations are of the form:
[Accadia12] or [Accadia12;Ahlquist68] for multiple references. So first authors family name followed by the truncated year.

Bibliography should be of the form:

[Accadia12] T. Accadia, F. Acernese, M. Alshourbagy, P. Amico, F. Antonucci, S. Aoudia, et al., J. Instrum. 7, P03012–P03012 (2012).
So it is a repetition of the inline citation form, followed by authors etc.

I used the Elsevier Harvard Style by David Kaplan as a basis and almost got everything working. However, there is a slight problem
* I can create the first author family name by creating a Names field with author name (with only name-part family) and setting et-al-min as well as et-al-use-first both to "1"
* This works great for the inline citations. However, when I do this in the bibliography, I run into a problem:
The first author (who is already named in repetition of the the inline citation) is omitted from the next Names field that contains the authors. The result is:

[Accadia12] F. Acernese, M. Alshourbagy, P. Amico, F. Antonucci, S. Aoudia, et al., J. Instrum. 7, P03012–P03012 (2012).

Instead of what I want:

[Accadia12] T. Accadia, F. Acernese, M. Alshourbagy, P. Amico, F. Antonucci, S. Aoudia, et al., J. Instrum. 7, P03012–P03012 (2012).

You can find a copy of the style where I have this problem here: http://pastebin.com/UnkF1p5i

Does anyone know how I can force the first author to appear once again?

If I add another names field with authors afterwards, all authors are named (it seems the stack of author names is only reset once it is emptied?). I did not find anything regarding this in the CSL documentation.

Thanks in advance, this really confuses me,
Stephan
  • This is a naughty non-standard feature of the citeproc-js processor. Try setting the value of et-al-min to "2" (which should have the same effect, but without loss of the first-mentioned author in the next rendering).
  • edited May 30, 2016
    Oh wow, that does indeed solve this problem. However, it creates a new problem: The "et al." is now added to the first item ([Accadia12] becomes [Accadia et al.12]), which I also don't want.

    However, it works without problems for works by a single author. I fear I will just need to clean up the bibliography by hand afterwards.

    This is the first time I work with CSL files and while editing them is certainly more straightforward than working with bibtex style files (the preview in the visual editor is great!), working with these kind of unintuitive and hardly documented features feels frustrating and I would wish for the language to be a bit more powerful.
  • That's not a feature of csl, but rather the particular implementation used by zotero. You should be able to get rid of the et al. By calling for and other and defining that as an empty term. As for more powerful, that had significant costs
  • The "et al" term can be localized to either of two forms (an et-al form or an and-others form). If you set one of the two to an empty string, you can render the name without "et al," but use it elsewhere.

    The passage on it in the CSL Specification is here.
  • Tough crowd.
  • you managed without typos, though ;)
  • edited May 30, 2016
    Really tough crowd. Good night.
  • The "and others" trick does work marvelously in the visual editor, but sadly Zotero throws a "myStyle.csl is not a valid CSL 1.0.1 ..." error when I try to import it and it does subsequently not work in Word (produces 'et al.').

    This only depends the one line where command it to use "and others" instead of "et-al":

    <names variable="author">
    <et-al term="and others" font-style="italic"/> % <!--This line-->
    <!-- more code -->
    </names>

    If I leave this part out, Zotero does not throw an error. Is this due to a malformed part somewhere else in my CSL file or is this option simply not supported by Zotero?
  • This is a bit confusing, since the visual editor seems to use citeproc-js 1.1.67, whereas Zotero uses the version 1.1.101, which I would naively assume to parse at least every file the older version could parse.

    Thanks to you guys for the help by the way, you have been much more help to me than my digging through the CSL reference.
  • Ok, you can declare me insane, but reshuffling the XML elements a bit (shifting the <locale> to the end of the <style> text and shifting the <et-al> part to the end of the <names> text) still produces an error when importing everything into Zotero ... but it works.

    Weirdly, a colleague managed to set up the visual CSL editor with the version 1.1.101 of citeproc-js and it did not throw any errors on the CSL file, while Zotero still does.

    Anyways, I am just happy it works (and at this point, I could have written all the citations and the bibliography by hand and it would have been faster than my adventures in CSL wonderland :)

    If anyone is interested in my weird style file or runs into similar problems, I have uploaded the last version of the file here:

    http://pastebin.com/Gn0XAwru
  • There's a validating version of your style here.
    https://gist.github.com/adam3smith/f9e9959286b4a72d5aebd2cdf079872e

    Your placement of the term is invalid, note the "which must follow the cs:name element (if present)" part here: http://docs.citationstyles.org/en/stable/specification.html#et-al

    You have it after cs:substitute

    The visual editor doesn't actually validate, and the behavior of the processor for non-validating styles may occasionally change.
  • edited May 30, 2016
    Ok, that fix looks a lot easier than I had anticipated and actually works properly. Sorry for not having caught that myself in the documentation, I had gotten a bit impatient with the whole problem at this point ;)

    Thank you both for your time! And sorry if I sounded a bit harsh about what I now realize is your software, fbennett. I think that a great point of CSL is, that it is really easy to write the citation style you need for almost every journal with it (especially if you start with a template and use the visual editor). I still wonder whether implementing a more complete language would not make it much easier to handle these very specific cases (it's always the last 5% of all users that need a million special cases and flags to mold your software to their very specific needs). But then, I think you have probably thought about this much more, longer and with more experience of the problem domain than I did, so my view does probably not add a lot.
  • What do you see as missing?

This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.

Sign In or Register to comment.