Parentheses and page numbers

Hi,

I've started modifying the Harvard 1 style to suit a small journal that prefers a slight variation on this. I've not really edited styles previously, however the help pages are quite good and I've made most of the amendments successfully.

There are two issues I'm struggling with:

1) Parenthesis around 'ed' for book
I’m not clear on how to insert parentheses around the ‘ed’ abbreviation in my stylesheet for an edited book (as opposed to a book section). I’m assuming this needs to happen in the macro editor definition and have amended it as shown below to make this work for book chapters/sections:

<macro name=”editor”>
<names variable=”editor” delimiter=”, “>
<name and=”text” initialize-with=”. ” delimiter=”, “/>
<label form=”short” prefix=”, (” text-case=”lowercase” suffix=”), “/>
</names>
</macro>

I’ve tried to insert a prefix/suffix with parenthesis at various points in the layout section with no success. Or is there something I've missed?

2) Locator variable showing 'page' in citations
This problem relates to the locator variable in the citation section. I need my citations to look like (Johnson 1989:98). The citation layout is as follows:

<group>
<label variable=”locator” suffix=”:” form="short"/>
<text variable=”locator”/>
</group

This outputs a citation as (Johnson 1989:p98). I’m not clear on how to remove the ‘p’ from the citation. Altering “short” to “long” just outputs page instead of ‘p.’; removing the field ‘form’ or deleting the 'short'/'long' text this default back to ‘page’.

Is there a term that I can insert in place of ‘short’ to suppress the 'page' text output entirely? I’ve tried ‘false’ ‘null’ and neither seem to work

Any ideas or thoughts on this? I've posted something to my website with a link to the css at http://mickmorrison.com/?p=524, csl (as .txt) can be downloaded here: http://mickmorrison.com/wp-content/uploads/2010/12/Harvard-Australian-Archaeology.txt

Thanks
  • edited December 29, 2010
    Re (1), it looks like what's probably happening is that the author macro is substituting the editor variable edited books (since there is presumably no author for an edited volume). You should be able to get the effect you're after by giving the same prefix/suffix treatment to the label element in the author macro. It won't affect ordinary authors, since they don't have a label value for the decorations to attach to.

    Re (2), if you want to apply term labels (like p, but different) to things other than pages, you can use a conditional construct to provide special handling for pages. You'd use something like this:<choose>
    <if locator="page">
    <text variable="locator" prefix=":"/>
    </if>
    <else>
    <group>
    <label variable=”locator” form="short"/>
    <text variable=”locator”/>
    </group>
    </else>
    </choose>
  • Thanks Frank, Re issue 1 it worked a treat by adding a suffix/prefix item to the label element in the author macro, as you suggest. It doesn't affect the other item types as far as I can tell :

    <macro name="author">
    <names variable="author">
    <name name-as-sort-order="all" and="text" sort-separator=", " initialize-with="."
    delimiter-precedes-last="never" delimiter=", "/>
    <label form="short" prefix=" (" suffix=")." text-case="lowercase"/>
    <substitute>
    <names variable="editor"/>
    <text macro="anon"/>

    I may not have explained issue 2 very well: I would like to entirely remove the 'p' from the page locator element. Would this code you've provided go into the page macro, or the citation layout section?

    Thanks for your help.
    mick
  • edited December 29, 2010
    mick -
    Frank's code would remove the p, but maintain labels for other locators - (e.g. ch for chapter etc.), which you can select in the word processor plugin - I would strongly recommend using that. Otherwise you can do what Avram (ajlyon here on the forum) suggests on your blog.
    You can use that in the citation section of the style - you could also turn it into a macro (i.e. precede it by <macro name="locator"> and end with </macro> and then call that macro from the citation section of your style (<text macro="locator"/>). That's just a matter of taste - I find the latter more elegant, for example - but there is no difference in performance.
  • Thanks Adam,

    I have tried this using both the macro and non-macro options. To see how it worked, I tried Franks suggestion initially and amended citation layout as follows, which broke the style. I assume I've broken it by inserting the code in the wrong place - any ideas on what I've done wrong? Sorry if this is blatantly obvious, but first timer at all this. Once I get it correct, I'll turn it into a macro.


    <citation>
    <option name="et-al-min" value="3"/>
    <option name="et-al-use-first" value="1"/>
    <option name="et-al-subsequent-min" value="3"/>
    <option name="et-al-subsequent-use-first" value="1"/>
    <option name="disambiguate-add-year-suffix" value="true"/>
    <option name="disambiguate-add-names" value="true"/>
    <option name="disambiguate-add-givenname" value="true"/>
    <layout prefix="(" suffix=")" delimiter="; ">
    <group delimiter=" ">
    <group delimiter=" ">
    <text macro="author-short"/>
    <text macro="year-date"/>
    </group>
    <group>
    <choose>
    <if locator="page">
    <text variable="locator" prefix=":"/>
    </if>
    <else>
    <group>
    <label variable=”locator” form="short"/>
    <text variable=”locator”/>
    </group>
    </else>
    </choose>
    </group>
    </group>
    </layout>
    </citation>
  • In what way is the style broken -- does it fail to work altogether (which shouldn't happen, if this is the only change), or does the formatting break in some way? If the latter, can you describe what goes wrong?

    (A little trick when posting code to the forums here is to wrap it in a set of <code></code> tags, which will preserve the indenting):<citation>
    <option name="et-al-min" value="3"/>
    <option name="et-al-use-first" value="1"/>
    <option name="et-al-subsequent-min" value="3"/>
    <option name="et-al-subsequent-use-first" value="1"/>
    <option name="disambiguate-add-year-suffix" value="true"/>
    <option name="disambiguate-add-names" value="true"/>
    <option name="disambiguate-add-givenname" value="true"/>
    <layout prefix="(" suffix=")" delimiter="; ">
    <group delimiter=" ">
    <group delimiter=" ">
    <text macro="author-short"/>
    <text macro="year-date"/>
    </group>
    <group>
    <choose>
    <if locator="page">
    <text variable="locator" prefix=":"/>
    </if>
    <else>
    <group>
    <label variable=”locator” form="short"/>
    <text variable=”locator”/>
    </group>
    </else>
    </choose>
    </group>
    </group>
    </layout>
    </citation>
  • edited December 29, 2010
    It seems to stop working entirely in the Zotero test pane- at least I think it stops working. The end result is that entering/amending a page number doesn't update in the preview pane. Before I insert your original code, it updates automatically each time I change the page number in the test pane.

    I also tested the code above in a working version of this style by replacing the citation section entirely. The citation entirely disappears from the preview pane when I do this. i.e. the bibliography displays however the the single/multi citation sections are empty. Code that I'm using is below:

    Thanks for code tip - I was wondering how you made that happen. Unfortunately I loose the indenting with copy/pastes as I'm only using a text editor.


    <citation>
    <option name="et-al-min" value="3"/>
    <option name="et-al-use-first" value="1"/>
    <option name="et-al-subsequent-min" value="3"/>
    <option name="et-al-subsequent-use-first" value="1"/>
    <option name="disambiguate-add-year-suffix" value="true"/>
    <option name="disambiguate-add-names" value="true"/>
    <option name="disambiguate-add-givenname" value="true"/>
    <layout prefix="(" suffix=")" delimiter="; ">
    <group delimiter=" ">
    <group delimiter=" ">
    <text macro="author-short"/>
    <text macro="year-date"/>
    </group>
    <group>
    <choose>
    <if locator="page">
    <text variable="locator" prefix=":"/>
    </if>
    <else>
    <group>
    <label variable=”locator” form="short"/>
    <text variable=”locator”/>
    </group>
    </else>
    </choose>
    </group>
    </group>
    </layout>
    </citation>
Sign In or Register to comment.