Anon-Substitute for Authors name does not work - please help.

Hi all,

First of all thanks to the makers of Zotero - it is a great tool!
I am working on the citation style for my university right now and this is what I want to achieve:
In case someone is citing an internet-source with an unknown author, the citation should look like this:

blabla
(o.A. 2009)
whereby o.A. means "ohne Angabe" => not stated

The Bibliography for this case should look like this:

(o.A. 2009): titleofwebsite etc. url etc.

Unfortunately It doesnt work out - meaning i can't get the "o.A." part to be displayed.

This is what my code looks right now:

To reach the goal I defined an anon - macro which looks like this:
- - - - - - - - - -
<macro name="anon">
<text value="o. A."/>
</macro>
- - - - - - - - - -

The Author-short macro should substitute this in case there is no author:

This is my code for the author and the author-short macro:
- - - - - - - - - - - -- -
<macro name="author">
<names variable="author" delimiter="; ">
<name name-as-sort-order="all" sort-separator=", " delimiter="; "
delimiter-precedes-last="always" form="long"/>
<label form="short" prefix=" (" suffix=".)"/>
<substitute>
<text macro="editor"/>
<text macro="anon"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author" delimiter="; ">
<name form="short" delimiter="; " initialize-with=". " delimiter-precedes-last="always" sort-separator=","/>
<substitute>
<names variable="editor"/>
<!-- <names variable="translator"/> -->
<text macro="anon"/>
</substitute>
</names>
</macro>

- - - - - - - - - - - - - - - - - -- - - - - -

The layout code for the citation looks like this:
- - - - - - - - - - - - -
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=" ">
<text macro="author-short"/>
<text macro="year-date"/>
</group>
<!-- <group> -->
<text variable="locator" prefix=", S. "/>
<!-- </group> -->
</layout>
- - - - - - - -- -- --

The code for the bibliography looks like this:
- - - - - -- - - - - - - - - -- - - - - -
<bibliography>
<option name="hanging-indent" value="true"/>
<option name="et-al-min" value="4"/>
<option name="et-al-use-first" value="1"/>
<sort>
<key macro="author"/>
<key variable="title"/>
</sort>
<layout suffix=".">
<group delimiter=" ">
<text macro="author" delimiter="; "/>
<text macro="anon"/>
<text macro="year-date" prefix="(" suffix="):"/>
<text macro="title"/>
<text macro="container-prefix"/>
<text macro="editor"/>
<text variable="container-title" font-style="normal" suffix="."/>
<text macro="edition"/>
<text macro="publisher"/>
<text macro="locator"/>
<text macro="published-date"/>
<text macro="access"/>
<group delimiter=", ">
<group delimiter=", " prefix="(= " suffix=")">
<text variable="collection-title"/>
<!-- <text variable="volume" suffix=" Bd. "/> -->
</group>
</group>
</group>
</layout>
</bibliography>
- - - - - -- - - - - - - -- - - - ----- - - -

Where is the Problem? What can I do to fix this?

Your help is appreciated!

Frank from Austria
  • You could
    a) Check whether your modified style is valid (http://www.zotero.org/support/dev/creating_citation_styles#xml_validation), as invalid styles will often not function properly.
    b) Look at how the "anon" macro's in the AMA (http://www.zotero.org/styles/ama) and CMS (http://www.zotero.org/styles/chicago-author-date) work. Maybe you can spot a difference with your style.
  • Hi Rintze,

    thanks a lot for your help

    ad a)
    i tried the validator.nu - site, bit i didn't really know how to handle the options there...but anyway, my experience is that firefox gives an error message any time the code is incorrect, so i thought that this is not where i have to look

    ad b)
    this helped, thanks!
    I managed to get the anon-thing right - now i am struggling with other stuff...
  • i tried the validator.nu - site, bit i didn't really know how to handle the options there...
    You need to put your CSL file into the first box and the schema URL (http://xbiblio.svn.sourceforge.net/viewvc/*checkout*/xbiblio/csl/schema/trunk/csl.rnc) in the schemas box.
    but anyway, my experience is that firefox gives an error message any time the code is incorrect
    Firefox will complain about malformed XML, but does not validate the XML against the schema. It will tell you when you have very gross errors, but will not tell you about all errors.
  • hi,

    thanks, i tried to validate the file and i got the message:

    IO Error: Non-XML Content-Type: text/plain.

    but so far my csl-file seems to work allright with word, so do i have to worry about this?
  • edited April 17, 2009
    You have to check the option "Be lax about HTTP Content-Type" on the validator.nu website. (the website seems to be designed to validate websites more than standalone files like CSL styles, so it exhibits some quirks like this one)
  • hi,
    thanks a lot, now it worked!
Sign In or Register to comment.