Thesis type using "genre"

I am trying to format thesis citations in the bibliography as follows:

Bjorndal, K.A. 1979. Nutrition and grazing behavior of the Green Turtle, Chelonia mydas, a seagrass herbivore. Ph.D. Dissertation, University of Florida, Gainesville, Florida, USA. 73 p.

Saumure, R.A. 1997. Growth, mutilation, and age structure of two populations of Wood Turtles (Clemmys insculpta) in southern Québec. M.Sc. Thesis, McGill University, Montréal, Québec, Canada. 70 p.

Here is the code that I have set-up so far:

<macro name="container">
<choose>
<if type="article-journal article-magazine" match="any">
<group delimiter=" ">
<text variable="container-title"/>
<group delimiter=":">
<text variable="volume"/>
<text variable="page"/>
</group>
</group>
</if>
<else-if type="thesis">
<group delimiter=", ">
<text variable="genre"/>
<text variable="university"/>
<text variable="city"/>
<text variable="country"/>
</group>
</else-if>
<else>
<text variable="container-title"/>
</else>
</choose>
</macro>

However, I cannot seem to get the "genre" to display (i.e., the thesis type [M.Sc. Thesis or Ph.D. Dissertation] do not appear).

And, secondarily, what code is recommended to get the number of pages displayed as above for this reference type? I played around with several options in this container macro, but nothing worked - the number of pages (without p.) kept displaying after the title but before the rest of the container despite that the code was sequential.

Would it be better to set-up a pages macro or...? Aside from the journal article page display above, I use pages as part of chapters as follows:

<macro name="chapter-info">
<group delimiter=" ">
<choose>
<if type="chapter paper-conference" match="any">
<group delimiter=" ">
<label text-case="capitalize-first" variable="page" form="short"/>
<text variable="page"/>
<text term="in" text-case="capitalize-first" font-style="italic"/>
</group>
</if>
</choose>
<text macro="editor"/>
</group>
</macro>

Thanks!

Matt
  • For genre/type the above should work, but might fail because you're inventing a bunch of variables that don't exist (university, city, country -- that should be publisher and publisher-place).
    You'll want to make sure your style validates:
    http://validator.citationstyles.org/

    the variable for the number of pages is number-of-pages
    See here for a full list of variables and their mappings to Zotero
    aurimasv.github.io/z2csl/typeMap.xml
  • Thanks Adam,

    I got rid of the variables that don't exist and still genre gives me nothing. Anything else I can try?

    And, I figured out the pages thing - my issue wasn't what the variable was called, but rather where to add the code so it was positioned correctly in the Bibliography entries. This is what I did:

    <macro name="pages">
    <choose>
    <if type="thesis">
    <text variable="number-of-pages" suffix=" p."/>
    </if>
    </choose>
    </macro>

    Then added this macro to the end of the bibliography layout set of code.
  • and you do have something in the type field for the thesis item in Zotero? Could coup post the whole style to gist.github.com (no registration required) and link to it from here?
  • Yes the type field for thesis is populated in the reference manager. Personally I use Mendeley (shouldn't make a difference, should it?), which has two possible fields for this in Mendeley = "type" and "type of work," I have them both populated with no success. I am developing the style for a journal for which I am an assistant editor (Herpetological Conservation and Biology) and we will deposit it in the Zotero repository once I get it finalized.

    Here is the link:

    https://gist.github.com/anonymous/2ed124b660f3dc0e751c
  • Field mapping is not uniform and CSL processor versions aren't always aligned, so please always mention that you're using anything that's not Zotero when posting here. I'm happy to answer CSL-related Mendeley et al. questions, but I do need to know that's what I'm doing.

    In this case, Mendeley isn't mapping Type to genre, you have to add the Genre field to Thesis (in the preferences) and use that. I've mentioned this to them before, not sure why they haven't fixed it.
  • Oops - sorry about that! I'm new to all this CSL coding, didn't realize!

    That seems to do the trick and even cleaned up my code a bit because now I can just leave the 'genre' call in my publisher macro and take it out of my 'container' macro.

    Thanks!!!
Sign In or Register to comment.