Italicizing a title in Chicago Style

Someone from this forum was really helpful the last time I had a question, so again, I apologize if this is a stupid one.

I'm using a slight variation on Chicago Style (that I altered from Chicago with help from someone here), and I need the title in "document" (as opposed to "website") to be italicized. Right now it's just in quotes. I tried putting in a couple of lines where I thought it would go in the style document, but nothing happened.

Thanks in advance for the help!
  • edited January 14, 2010
    Somewhere in your style, you read something like:
    text variable="title"
    and you should add to this line:
    font-style="italic"

    See: http://www.zotero.org/support/dev/csl_syntax_summary#formatting
  • Yeah, I added this:

    <else-if type="document">
    <text variable="title" font-style="italic"/>
    </else-if>

    right under this:

    <else-if type="book">
    <text variable="title" font-style="italic"/>
    </else-if>

    And nothing happened.
  • I don't know if book is a generic fallback for document. ( http://www.zotero.org/support/dev/csl_syntax_summary#item_types)

    Try to add the document block *before* the book block. Is there any change?
  • No change, even in a new document after installing the altered style.
  • edited January 14, 2010
    CSL doesn't have type=document. That is the last, generic type & should be used in an "<else>" (rather than an "<else if type=...>") block. Your style should not validate. Do use validation: it could help you overcome a lot of obstacles!
  • edited January 14, 2010
    Uh, document type does not exist actually.

    [edit: see noksagt's answer which is more complete...]
  • How would I set up the "<else>" and where would I put it? My task needs an option that's just like Chicago style but with a "document" option with italicized titles. Also, how do I validate?
  • Put the "<else>" in last position, i.e. after all the "<else-if>".

    Validation: http://www.zotero.org/support/dev/creating_citation_styles#xml_validation
  • So would this be correct?

    <macro name="title-note">
    <choose>
    <if variable="title" match="none">
    <text variable="genre"/>
    </if>
    <else-if type="book">
    <text variable="title" font-style="italic"/>
    </else-if>
    <else>
    <text variable="title" quotes="true"/>
    </else>
    <else>
    <text variable="title" type="document" font-style="italic"/>
    </else>
  • That would be rather:

    <macro name="title-note">
    <choose>
    <if variable="title" match="none">
    <text variable="genre"/>
    </if>
    <else-if type="book">
    <text variable="title" font-style="italic"/>
    </else-if>
    <else>
    <text variable="title" quotes="true" font-style="italic"/>
    </else>
  • Gracile's comment is right assuming you want books to have italicized, unquoted titles & every other type to use unitalicized, quoted titles. I suspect you don't. You probably want either all types to use italicized, unquoted titles (in which case, you should just loose the choose block altogether, as there is no type dependency) or want many/most types to have italicized, unquoted titles & some to have unitalicized, quoted titles (in which case you'd have an if statement that matched the type(s) for the latter formatting & then your final <else> block for the former formatting).
  • The two I use most are Website and Document.

    Website uses unitalicized, quoted titles. This is absolutely perfect as-is.

    Document, which we use for PDFs, needs to have an italicized, unquoted title.

    How do I make that happen? I'm not a programmer.
  • <macro name="title-note">
    <choose>
    <if variable="title" match="none">
    <text variable="genre"/>
    </if>
    <else-if type="webpage">
    <text variable="title" quotes="true"/>
    </else-if>
    <else>
    <text variable="title" font-style="italic"/>
    </else>
    </choose>
  • edited January 14, 2010
    <macro name="title-note">
    <choose>
    <if variable="title" match="none">
    <text variable="genre"/>
    </if>
    <else-if type="book">
    <text variable="title" font-style="italic"/>
    </else-if>
    <else-if type="webpage">
    <text variable="title" quotes="true"/>
    </else-if>
    <else>
    <text variable="title" font-style="italic"/>
    </else>
    </choose>
    </macro>

    the downside of using document is that you have to use the fallback option for these, so anything that is not a book or a webpage will appear as unquote italics now. You'll have to specify all item types that you don't want to appear in that way. So if, for example, you want journal articles also in normal and quoted you'd have to change the webpage line to
    <else-if type="webpage article-journal" match="any">

    edit: I'm glad we agree ;-)
  • That's absolutely glorious - it worked perfectly. Thank you!!

    Now as long as we're all here, does anyone know how I might put a period on the end of every citation? If that's impossible, adding a period at the end of each URL would be helpful. Is there a way to program that in?
  • isn't that the case already?
    if not, change
    <layout> in the citation section to
    <layout suffix=".">
  • It does say:

    <layout prefix="" suffix="." delimiter="; ">

    But there is no period on the end of my footnotes. Any thoughts?
  • Ok, this is weird. But it just fixed itself.

    Thank you all so much for your help!
  • This may also be helpful to some: Although CSL does not have the type Document, it does map (like many other types) to the fallback type of "article".

    In the current Zotero version 2.0.2 you could adapt the following workaround to specifically test for the type Document:

    <choose>
    <if type="book chapter article-journal article-magazine article-newspaper thesis personal_communication manuscript interview webpage patent map speech broadcast song" match="none">
    <!-- type is Document -->
    </if>
    </choose>
Sign In or Register to comment.