attribute ignored

Hi everybody,

I am new to Zotero but already a fan. Now I am facing my first problem. In my style I use the names element and in that nested the name element with the attribute form="short". All of this is called via multiple macros (see below). Unfortunately the form="short" seems to be ignored. Any idea why that happens ???

I am working with Zotero standalone and tested the style in Zotero Style Editor. It has been validated successfully by http://validator.citationstyles.org/. The version of Zotero is 4.0.28

Now follows the style. There is only one macro with names elements at the top of the style. This is called by the mandatoryAuthor macro which in turn is called by the citation element.

Thanks in advance for eny help on this

Thomas

<?xml version="1.0" encoding="UTF-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="note">
<info>
    <id>some uri</id>
    <link href="http://www.zotero.org/styles/style-title" rel="self"/>
    <title>non functioning names element</title>
    <updated>2016-01-01T08:00:00+00:00</updated>
</info>
<locale xml:lang="de-AT" />
<macro name="author">
    <choose>
        <if position="near-note">
            <names variable="author">
                <name delimiter=" / " 
                      delimiter-precedes-et-al="never"
                      et-al-min="3"
                      et-al-use-first="3"
                      form="short" />
            </names>
        </if>
        <else>
            <names variable="author">
                <name delimiter=" / " 
                      delimiter-precedes-et-al="never"
                      et-al-min="3"
                      et-al-use-first="3"/>
            </names>
        </else>
    </choose>
</macro>
<macro name="mandatoryAuthor">
    <choose>
        <if variable="author">
            <text macro="author" />
        </if>
        <else>
            <text value=""Pflichtfeld Author fehlt"" 
                  font-weight="bold" />
        </else>
    </choose>
</macro>
<citation near-note-distance="5">    
    <layout>
        <choose>
            <if type="book">
                <text macro="mandatoryAuthor" />
            </if>
            <else>
                <text value=""Literaturtyp nicht unterstützt""
                      font-weight="bold"/>
            </else>
        </choose>
    </layout>
</citation>
</style>
  • how are you testing this? Could be that the problem is just the near-note test in the style editor.
  • @adamsmith

    Just as pointed out I am testing in the Zotero Style Editor of the Zotero standalone version. There I can set the value of the cite position to "near-note" "first" or any other.

    Below find a new version of the style that now prompts whether it the cite position is "near-note" or not.

    Please verify in the Style Editor

    Thanks for the quick response

    Thomas

    <?xml version="1.0" encoding="UTF-8"?>
    <style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="note">
    <info>
        <id>some uri</id>
        <link href="http://www.zotero.org/styles/style-title" rel="self"/>
        <title>non functioning names element</title>
        <updated>2016-01-01T08:00:00+00:00</updated>
    </info>
    <locale xml:lang="de-AT" />
    <macro name="author">
        <choose>
            <if position="near-note">
                <names variable="author">
                    <name delimiter=" / " 
                          delimiter-precedes-et-al="never"
                          et-al-min="3"
                          et-al-use-first="3"
                          form="short" />
                </names>
               <text value=" near-node=true" />
            </if>
            <else>
                <names variable="author">
                    <name delimiter=" / " 
                          delimiter-precedes-et-al="never"
                          et-al-min="3"
                          et-al-use-first="3"/>
                </names>
                <text value=" near-node=false" />
            </else>
        </choose>
    </macro>
    <macro name="mandatoryAuthor">
        <choose>
            <if variable="author">
                <text macro="author" />
            </if>
            <else>
                <text value=""Pflichtfeld Author fehlt"" 
                      font-weight="bold" />
            </else>
        </choose>
    </macro>
    <citation near-note-distance="5">    
        <layout>
            <choose>
                <if type="book">
                    <text macro="mandatoryAuthor" />
                </if>
                <else>
                    <text value=""Literaturtyp nicht unterstützt""
                          font-weight="bold"/>
                </else>
            </choose>
        </layout>
    </citation>
    </style>
  • @adamsmith

    Ok according to your advice I removed the choose element from the "author" macro. Intrestlingly then it works. But I want to act according to a state of cite position="near-note", so I have to use a choose element.

    Any ideas, maybe I am getting something wrong?

    Thomas

    <?xml version="1.0" encoding="UTF-8"?>
    <style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="note">
    <info>
        <id>some uri</id>
        <link href="http://www.zotero.org/styles/style-title" rel="self"/>
        <title>non functioning names element</title>
        <updated>2016-01-01T08:00:00+00:00</updated>
    </info>
    <locale xml:lang="de-AT" />
    <macro name="author">

               <names variable="author">
                    <name delimiter=" / " 
                          delimiter-precedes-et-al="never"
                          et-al-min="3"
                          et-al-use-first="3"
                          form="short" />
                </names>

                <names variable="author">
                    <name delimiter=" / " 
                          delimiter-precedes-et-al="never"
                          et-al-min="3"
                          et-al-use-first="3"/>
                </names>
          
    </macro>
    <macro name="mandatoryAuthor">
        <choose>
            <if variable="author">
                <text macro="author" />
            </if>
            <else>
                <text value=""Pflichtfeld Author fehlt"" 
                      font-weight="bold" />
            </else>
        </choose>
    </macro>
    <citation near-note-distance="5">    
        <layout>
            <choose>
                <if type="book">
                    <text macro="mandatoryAuthor" />
                </if>
                <else>
                    <text value=""Literaturtyp nicht unterstützt""
                          font-weight="bold"/>
                </else>
            </choose>
        </layout>
    </citation>
    </style>
  • Ok I justed tried the code from within LibreOffice and receive the same result. The code prompts that it is inside the near-node=true condition and the names are still not in short form.

    Any ideas on this are highly appreciated.

    Thanks in advance

    Thomas
  • This is definitely not working as it should, but I can't quite make out what's triggering it, because it does work in other styles.
    (and please put codesnippets on github or pastebin -- the forum breaks all types of things)
  • @adamsmith

    Thank you for your quick reply. I am with you. Something does not work out correctly here.

    With respect to github, should I post this issue to

    https://github.com/zotero/zotero/issues

    Thanks for your afford

    Thomas
  • no, that github issue tracker is for Zotero developer use (and in this case wouldn't be the right place anyway, since the citation processor is a separate project).

    I meant to put code snippets for sharing on gist.github.com or pastebin.com so the various odd things the forum does (messing up tabs, converting escaped XML characters like quotes etc.) doesn't affect them.
  • @adamsmith

    OK after all this really seems to be a bug. I switched from "near-note" to "subsequent" and then it works as expected.

    Thanks for the help

    Thomas
  • @tog: I would like to look at this problem, to see if there really is a bug (I maintain the citation formatter).

    It would be helpful if you could paste a full copy of your style into https://gist.github.com, save it as a "public gist", and post the link from the URL address bar back here.

    Frank Bennett
  • @fbennett

    OK here is the link to the style code

    https://gist.github.com/anonymous/6c289cbfb7d2e6aabc9e

    It is valid according to http://validator.citationstyles.org/.

    As mentioned the problem only occurs when using "near-node". When switching to "subsequent" everything works as expected.

    If I can provide anything further sensible please let me know.

    Thanks for your efforts.

    Thomas
  • Confirmed. Weird that it runs the condition correctly, but fails to shorten the name. I'll look into it tomorrow - thanks for reporting!
  • @fbennett

    Great that you could reproduce it. From my point of view this is not an issue of high priority as there is the fall back with "subsequent"

    But thanks a lot that you will look into it - but take your time.

    All in all a great start into the Zotero forums, great response.

    Thanks a lot

    Thomas
  • Found the bug: I wasn't setting "near-note" to true when testing for ambiguity in citations. The bug could well have affected other styles as well. I will post again when the processor patch plugins have been updated with this change.

    Thanks again for reporting.
  • @fbennett

    Wow, that was quick, great job :-)))

    Looking forward to seeing this bug fixed.

    Thomas
  • You should be able to try the revised processor by installing one of the Propachi plugins:

    https://juris-m.github.io/downloads/#csl-stuff

    A Propachi plugin swaps the latest citeproc-js version into Zotero. It should be removed when the next version of Zotero is released.
  • @fbennett

    OK I intalled the Propachi Vanilla plugin and tested again. And yes behaviour has changed. But I am not sure whether it is correct.

    I have tested the cite positions in the Zotero Style Editor with the following style

    https://gist.github.com/anonymous/e4771e20489c364f79c6

    which is valid according to http://validator.citationstyles.org/.

    Now testing the individual cite positions in the editor I receive the follwoing outputs:

    Cite position = first
    "GivenName" "FamilyName" near-node=false

    Cite position = subsequent
    "FamilyName" near-node=false

    Cite position = ibid
    "FamilyName" near-node=false

    Cite position = ibid-with-locator
    "FamilyName" near-node=false

    Cite position = near-note
    "FamilyName" near-node=true

    Now according to my understanding, with the provided style, GivenName should only be omitted when cite position is actually near-note=true. But as you can see with subsequent, ibid and ibid-with-locator near-note is correctly false but GivenName is still omitted.

    So from my point of view subsequent, ibid and ibid-with-locator wrongly omit GivenName.

    Is that true or do I misunderstand cite position logic.

    Sorry to bother you once again.

    Looking forward to hearing from you.

    Thomas
  • You should be able to force the long name form on ibid and ibid-with-locator references by setting it explicitly in conditional blocks above the near-note form. Normally no author name is used on those forms, though, so it hasn't been an issue in the past.
Sign In or Register to comment.