Adding "container-title" and "volume" to macro name "author"

edited May 29, 2017
I'd like to add "container-title" and "volume" to <macro name="author">.

But if I add one text variable string after another, only the first shows up as a reference.

How can I fix this?

Thanks in advance.
  • Can you describe more fully what you are trying to do? What style are you modifying? How exactly do you want these to display? In the in-text citation or in the bibliography entry?
  • My apologies for not being clear enough.

    I'm editing American Psychological Association 6th Edition in order to support references to Swedish legislations. As such, I'm trying to create a version of the item type statute where I can refer to, for example, a Swedish law as per this model:

    SFS 19XX:XX. Name of Act. http://foo.bar

    By using the following Zotero fields:

    Item type: Statute
    Name of Act: "Name of Act"
    Code: SFS
    Code Number: 19XX:XX
    URL: http://foo.bar

    Since I want to have "code" and "code number" in the beginning of the reference and citation, I have tried to add this to the macro field "author", but with no luck yet.
  • Also, I would like the citation to read simply (SFS 19XX:XX).
  • We'd have to see the code to say more, but it sounds like you're adding them as subelements of <substitute>, which only prints the first element that's present. You'll want them outsides the entire <names> complex.
  • Thank you, adamsmith! That did the trick. Unfortunately, I can't get the citation to work right.

    My issue is that the Name of Act is still showing up as per (SFS 19XX:XX“Name of Act”)

    <macro name="author-short">
    <if type="legislation" match="any">
    <text variable="container-title" suffix=" "/>
    <text variable="volume"/>
    </if>
    <names variable="author">
    <name form="short" and="symbol" delimiter=", " initialize-with=". "/>
    <substitute>
    <names variable="editor"/>
    <names variable="translator"/>
    <choose>
    <if type="report">
    <text variable="publisher"/>
    <text variable="title" form="short" font-style="italic"/>
    </if>
    <else-if type="legal_case">
    <text variable="title" font-style="italic"/>
    </else-if>
    <else-if type="book graphic motion_picture song" match="any">
    <text variable="title" form="short" font-style="italic"/>
    </else-if>
    <else-if type="bill" match="any">
    <text variable="title" form="short" font-style="italic"/>
    </else-if>
    <else-if variable="reviewed-author">
    <choose>
    <if variable="reviewed-title" match="none">
    <text variable="title" form="short" font-style="italic" prefix="Review of "/>
    </if>
    <else>
    <text variable="title" form="short" quotes="true"/>
    </else>
    </choose>
    </else-if>
    <else>
    <text variable="title" form="short" quotes="true"/>
    </else>
    </choose>
    </substitute>
    </names>
    </macro>
  • You need to place <choose> tags around the <if> condition.
  • I tried this now and it didn't make any difference unfortunately.
  • Does your style validate?
    http://validator.citationstyles.org/
    If not, you'd need to fix that. If it does, I'd need to see the whole thing. Post to gist.github.com (no need to register), create a secret gist, post the link here.
  • edited May 29, 2017
    I fixed an else-if which messed things up. Other than that it validates. It's just the citation bit I have issues with now. I'd very much not like the title to show up in the citation of the legislation item type.

    Here's a gist. https://gist.github.com/bjornekstrom/284917253810479289f1344a409272d9
  • Also, for statutes, I'm currently using the Section field for defining city of publishing and departement (i.e. "Stockholm: State Department"). Please let me know if this is valid or if this information could be stated elsewhere.
  • So currently you get
    SFS 19XX:XX"Name of Act") for the citation, correct?
    To avoid having the title appear, use something like
    <else-if type="legislation"/>
    in the substitute section of the author-short macro.
  • And section is as good as anything else for the publisher &place info.
  • edited May 29, 2017
    Correct. Although, when I place

    <else-if type="legislation" match="any">
    <text variable="container-title" suffix=" "/>
    <text variable="volume"/>
    </else-if>

    in-between substitute, I only end up with "(SFS )" as a citation. I.e., the "container-title" but not the "volume" variable.
  • right, I meant keeping the combination of the two at the top of the macro where they are now and then putting an empty else-if into substitute.
    <else-if type="legislation"/>
    was meant literally.
  • That worked great. Thanks!

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.