capitalization differences for non-year "dates"

Hi all,

I wanted to use the CSL style called "unified style sheet for linguistics" in Pandoc. The current version is here:

http://zotero.org/styles/unified-style-linguistics

Linguists (more so than most) are fond of circulating pre-publication drafts and manuscripts, usually to be cited as "in press" or "to appear", even "forthcoming" or "in preparation". The problem is that the style sheet needs to differentiate between the capitalization of these non-digit dates in the references section (where the first letter should be capitalized) and in author-date in-text citations (where they should be all lowercase). Here's what I have in mind:

<doc>
This point is made by Kiparsky (forthcoming).

REFERENCES

Paul Kiparsky. Forthcoming. Paradigm effects and Opacity. Stanford, CA: CSLI.
</doc>

If you put "Forthcoming" in the bibliography file, you'll incorrectly get "Kiparsky (Forthcoming)" in the text body. If you put "forthcoming" in the bibliography file, you'll incorrectly get "Paul Kiparsky. forthcoming." in the references section.

I've been unable to find anything about how to generate this effect in the CSL documentation and would appreciate any help. The authors of the style inform me they are no longer maintaining it.
  • this can't currently be done - will be in the future, though.
  • edited August 1, 2018
    I was wondering exactly the same thing, for the same reason.

    It seems possible (now?), but requires splitting the date for in-text citations and bibliography entries.

    Find this code:
    <macro name="date">
    <date variable="issued">
    <date-part name="year"/>
    </date>
    </macro>


    Duplicate it, making the following changes:
    <macro name="date">
    <date variable="issued">
    <date-part name="year" text-case="capitalize-first"/>
    </date>
    </macro>
    <macro name="datecite">
    <date variable="issued">
    <date-part name="year"/>
    </date>
    </macro>

    The first entry is as before, but capitalizing the first letter. The second is as before, but renamed for use with in-text citations.

    You don't need to make any changes to the bibliography section. The capitalization will now be enabled there.

    For the in-text citation section, find this line:
    <text macro="date"/>
    And simply replace the name:
    <text macro="datecite"/>

    Now what I'm wondering is how to get "Forthcoming" to be sorted below "1999" or "2018" in the bibliography, which is turning out to be tricky...
  • edited August 1, 2018
    Actually, there appears to be a problem with this:

    "2018a" and "2018b" become "2018A" and "2018B", when there are multiple publications from the same author in the same year.

    It's somewhat bizarre that "capitalize-first" is targetting a non-initial character, but I guess it's the first letter. This seems like a bug.

    Suggestions are welcome. For now, I guess the change above may not be a full solution, just trading one problem for another.

    --

    One alternative seems to be converting the in-text citation date to lowercase, and writing "Forthcoming" in the Zotero entry. (That assumes you would never need capital letters in the citation date-- maybe if you wanted "N.D." or something? But that seems unlikely, less than "2018a" at least.)
  • In general, don’t enter text in lieu of a date. Instead, if an article is forthcoming or similar, enter than in Extra as “Status: forthcoming” and leave Date blank. Then, in the style, set it to print status (with appropriate capitalization rules) if there is no issued variable.
  • 1. "Status" is awkward to use as extra.
    2. Among even the default styles, only APA and Chicago support this. Inserting text works in all styles (as far as I know).

    I am running into what add up to unfixable problems (really frustrating, because it's so close) so I think I'll give up, but this would be a simple solution, while the much more complicated version has been under discussion for about 10 years and yet to be implemented.

    Another problem I noticed is that "forthcoming-a" and "forthcoming-b" won't work. I don't think that's solvable with "status" either. So however we approach this, there's really no way to do it right.

    Back to flagging all of the forthcoming entries for manual corrections.

    Your help is appreciated, even though I'm frustrated for technical reasons.
  • I don't think that's solvable with "status" either.
    Yes it is. Check APA:
    https://github.com/citation-style-language/styles/blob/master/apa.csl#L417
  • edited August 1, 2018
    Interesting! That also seems to work for different non-date text entered in the date field. That means that somehow the parser actually does know what's being used as a date ("forthcoming"≠"in press"!), even though it can't sort based on it. How odd.

    I'm still hesitant to poke around too much in the code because I don't understand how all of this is connected. Your comments are very helpful.
  • Check out the CSL JSON in the field code in Word (alt+F9). I'd expect that to provide some clue.
  • Huh. Interesting to look at, but doesn't answer why it's sorting the way it is (that data doesn't seem to end up in the Word field codes).

    What I see for a date is like this:
    "issued":{"literal":"forthcoming"}

    So what seems to be happening is that Zotero is bypassing that entirely for sorting. And the actual display form (for example, if capitalized, or if "-a" is added) is not shown either. That's just the original value. Still not exactly sure where all of the information is.

    (Actually, what I suspect is something like this: There was an older thread discussing 3-number dates like the year "800", which were not being sorted correctly versus "1200". In order to fix that, I'm assuming a date format was forced by Zotero, bypassing the literal string. This then would be one of the sort of unfortunate compatibility issues that comes up from a patch like that.)

    Well I've gone about as far as I can with these things for now. Even if I switched over to the status method, I wouldn't be able to fully update the Linguistics stylesheet on my own I don't think. So I'll just plan to manually edit these. It's been interesting looking under the hood, so to speak.
  • edited August 2, 2018
    As a makeshift solution to the issues above, if you wish to keep the capitalization difference but not have the disambiguating letters (2018a, etc.) also capitalized, then the following code works fairly well:
    <macro name="date">
    <date variable="issued">
    <date-part name="year" text-case="capitalize-first"/>
    </date>
    <text variable="year-suffix" prefix=""/>
    </macro>
    <macro name="datecite">
    <date variable="issued">
    <date-part name="year"/>
    </date>
    <text variable="year-suffix" prefix=""/>
    </macro>


    Thanks to @adamsmith for referring to how APA does this. I've just copied one line (to each place dates are used).

    The result is not perfect because it results in "2018a" but "Forthcominga" and "Forthcomingb". That's not perfect, but it does disambiguate so that manual corrections don't need to also check which thing is cited each time. We could also always add "-" but that would apply to the years as well.

    A more complete solution would require using the "status" method which I don't prefer because not all styles support it, so your 'forthcoming' (etc.) would be lost in that case. For me, I'm happy splitting the difference this way, and fixing it manually.

    Note: it's not entirely clear to me why manually adding "year-suffix" works like this without getting capitalized, versus not adding it and having it applied automatically but only to years (not forthcoming, and also getting capitalized "A", etc.). Something automated is going on behind the scenes I don't fully understand, and again seems like an issue that could be solved in Zotero's approach, but I'll leave it for now.
  • it's getting capitalized when it gets renderes as part of the year, on which you're applying capitalization rules, but not if you're rendering it as a separate variable (which exists as an option specifically so you can add styling like italics etc. to the year suffix as needed)
  • Regarding add the - to year suffixes only for words and not numbers, look again at how APA does this for “status” and “no-date” citations. Regarding adding the hyphen only for words and not numeric dates, you could try to set the formatting of the date conditionally on If is-numeric=“issued”, but I’m not sure if that would work. Honestly, the most appropriate way to do this with CSL is not store words in “issued” at all and to use “status” for such descriptors (e.g., see how APA does this).
  • you could try to set the formatting of the date conditionally on If is-numeric=“issued”,
    no, I'm pretty sure that's always false, so won't work.
  • Okay, I thought that might be the case.
  • edited August 3, 2018
    Thanks for the suggestions. I think this is close enough now, with manual touch-up required.

    Honestly, the most appropriate way to do this with CSL is not store words in “issued” at all and to use “status” for such descriptors (e.g., see how APA does this).
    If/when all styles do it that way, it would be workable. Until then I'd rather have the somewhat broken text in the date field so it at least half works in all styles. Having style-specific information in the entries seems like the wrong approach at the moment. But I completely understand why you're in favor of that approach-- it's a trade-off currently.

    And yes, is-numeric doesn't seem to do anything about dates (vs. text, etc.). What would be needed is "is-date", or of course some way to actually test values.
  • I’m strongly in favor of coding things properly in styles, rather than coding in hacks. If a style doesn’t handle ‘status’, it is better to correct that style, rather than trying to hack other styles to accommodate that.
  • edited August 3, 2018
    I don't disagree. But that's not my motivation:

    I'm avoiding "status" because it isn't supported in OTHER styles. If an editor asks me for a paper in some other style, I don't want my forthcoming dates to disappear-- I'd rather correct them manually.

    I'm using a single style, patched (yes, somewhat awkwardly) to best handle this, and also to help me identify any other issues, either in that style or for others, so I can manually correct them.

    Currently:
    1. "status" works only in a handful of styles, for others it is completely ignored.
    2. Non-numeric dates half work in all styles (with manual correction required).
    3. Non-numeric dates work even better than that in the personal style I'm using.

    Plus, "status" isn't a default field in Zotero and there is no indication that by writing it in "extra" that information will be carried over into new citations once the date system is replaced. So when that happens, either way, we'll need to change how we're approaching this. (The handful of styles (or maybe more by then) that do work with "status" will continue to work with the new system, though.)

    Finally, I am generally opposed to the idea of using "style" rather than non-numeric dates because that information ("forthcoming", etc.) is a date, so that, for example, it should be exported as such, rather than moved into some additional "status" category that might not work when importing my Zotero library into other software if I ever decided to change, or if I wanted to export and send to someone else for a project.

    Again, your reasoning makes sense, but it's a trade-off-- is the glass half full or half empty. I call it half full. Your warnings, however, have made me aware that I need to do this carefully, and probably at some point my library will have some compatibility issues to fix, so I'll watch out for that. It's appreciated.
  • (CSL variables stored in Extra will be carried over to real Zotero fields when they are implemented. That has been indicated by the Zotero developers.)

Sign In or Register to comment.