Citation - Author-short tag

I am trying to make it so only the authors surname appears in citations, not first name/initials.

My author-short macro is

<macro name="author-short">
<names variable="author">
<name form="short" and="symbol" delimiter=", " delimiter-precedes-last="never" initialize-with=". "/>
<et-al font-style="italic"/>
<substitute>
<names variable="translator"/>
<text macro="anon"/>
</substitute>
</names>
</macro>

and my cs:citation is

<citation et-al-min="4" et-al-use-first="3" disambiguate-add-year-suffix="true" collapse="year">
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<text macro="author-short"/>
<text macro="year-date"/>
<group>
<label variable="locator" suffix="*" form="short" strip-periods="true"/>
<text variable="locator"/>
</group>
</group>
</layout>
</citation>

Any ideas?
  • As far as I can tell, that should produce the result you want. (The initialize-with attribute is unnecessary, but it shouldn't do any harm.)
  • But see here:
    http://www.zotero.org/support/kb/given_name_disambiguation
    (and the initialize-with attribute does affect how first names added for disambiguation are displayed.)
  • I thought of that, but the cs:citation block above doesn't appear to invoke given name disambiguation.
  • it seems initialise with does appear to invoke given name disambiguation.
  • edited July 23, 2011
    Hmm. That's not particularly good, but do I take it that removing the attribute gets things working correctly?
  • removing initialize-with from author-short sorts out the problem for every citation type except book-chapter for some reason...
  • I've built a processor test for this, and as far as I can tell, initialize-with does not implicitly turn on given name disambiguation. With the CSL you've posted above, I get this output:(Doe 1965a; 1965b)
  • If you can paste your style code to http://gist.github.com/, save it as a "public gist", and post the URL from the address bar back here, I'll take a look. It's probably a small thing.
  • https://gist.github.com/1101340
  • The style isn't valid:

    http://validator.nu/?doc=https%3A%2F%2Fraw.github.com%2Fgist%2F1101340%2F3257a03914cc3ed0a23b6857954e735fbcc22d4b%2FIMPCSL&schema=https%3A%2F%2Fgithub.com%2Fcitation-style-language%2Fschema%2Fraw%2Fv1.0%2Fcsl.rnc&parser=xml&laxtype=yes

    (you can ignore messages 1-9)
  • couple of problems with a dodgy if statement in the bit of script that addes the DOI to online journals, its not going to affect the author-short citation... Would welcome recommendations to fix it i dont properly undstand if/else/elseif/choose.
  • There is an extra <choose> </choose> at lines 122 and 124 or so. If those are removed, the style validates. In the test fixture, running with the style (in all three versions -- before and after the "choose" fix, and even with initialize-with="." set on the cs:name inside author-short), the author of a book or a chapter comes out in the short form only, as expected, even when there is ambiguity. Everything seems to be in order.

    Maybe a couple of things to check in your test setup are whether the names are correctly entered (in two-field mode, with family name in the family field, and given name in the given name field), and whether the style is being updated (for that, try switching to another style, then back again, if testing in a word processor).
  • cool all sorted now. thanks.
  • Also, Adamsmith or whoever - i would be very happy for this style to be added to the repository. Whom can I send the final csl file to?
  • thanks, see here:
    http://www.zotero.org/support/dev/citation_styles/sharing%20styles
  • As a general rule, any style troubleshooting should start with making sure the style validates. Even errors in unrelated parts of the style can confuse the CSL processor.

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