Extra Variables Documentation

edited January 21, 2025
I have found the [Citing Fields from Extra](https://www.zotero.org/support/kb/item_types_and_fields) page in the Zotero documentation, but I was wondering if there was a resource indicating which variables will work with which item type. I rarely get the output I need, and would love a guide to help me figure it out (As it comes up a lot).

For example, I have a historical document. Based on its type and citation data, I'm using the 'Manuscript' as the item type. My citation style is Chicago (Full Note).

Attempt 1: placed 'type: periodical'; 'volume: 1'; and 'issue: 9' in the extra field (each on its own row). None of the extra data was returned.

Attempt 2: removed 'type: periodical', and left 'volume: 1'; and 'issue: 9' in the extra field. Volume returned, issue did not.

Attempt 3: changed to 'book' item type, placed 'type: periodical'; 'volume: 1'; and 'issue: 9' in the extra field (each on its own row). None of the extra data was returned.

Attempt 4: still book type, removed 'type: periodical' left 'volume: 1' and and 'issue: 9' in the extra field. None of the extra data was returned.

Attempt 5: still book type, removed 'type: periodical', placed 1 in the 'volume' field, left issue: 9 in extra. Volume returned, issue did not.

There are also other fields in the linked list that would be really useful to show in citation data, but they rarely work for me. Some kind of mapping guide would be handy.

I didn't want to use book for this (the icons serve as a visual cure for me) but tried it anyway and it didn't work. I don't want to have to use report as that seems to be a catch-all and I really need to clean it up and get out of the habit of using it for things vastly different to reports.
  • It sounds difficult, whether or not the Extra field will actually be used will mostly depend on the style (I think).
  • Yes, that's correct.

    I would recommend that you tell us what you want to achieve in each individual case and we can give guidance or adapt the necessary citation style with/for you.
  • Thanks, I was hoping to avoid having to do that. I'd rather have the information so I can adjust as I go.

    I'm using Chicago 17th Edition. Is there any documentation on this?
  • The Extra field can hold any valid CSL variable and which variable is used for which item type and how depends entirely on the citation style, so you'd have to read the style's CSL code to follow that (we certainly can't document that individually for every one of >1,000 different styles).

    So we can help you with specific questions and we might be able to help you get CMoS 17 to do what you need, but I'm afraid the type of documentation you appear to have in mind is just not possible given how CSL works, sorry.
  • All good, If this comes up again I'll see if I can make sense of the CSL code in the first instance and then post here if I can't figure it out.

    Regarding the example in my original post, would you know how I could set up the item to achieve the desired output? It needs to have title, author, place, date, archive, vol, number/issue.

    My citation style is Chicago (Full Note).
  • That'd take quite a bit of moving things around, because Chicago is only to a very limited degree organized around item types and more about systematics of information (and volume/issue would never be in the end of the citation in regular Chicago style).
    You're wedded to using those variables? E.g. using dedicated variables for archival information, such as archive_collection and archive_location (I'm assuming that's what vol and number are) isn't an option? That'd make things much easier.
  • Archive was more the name of the repository that the historical document is kept in. The issue I'm encountering is that I can't get the extra field to return what I need.

    It's not optimal to have to manage so much in the extra fields, but if that's what I need to do so be it.
  • edited 14 days ago
    @sicahjes
    I'm not a programmer, but AFAIK you expect Extra field will do some magic. In your initial post, you gave some examples, like e.g: 'type: periodical' when using Manuscript type. IMHO this cannot work.

    Extra field may be used ALSO for storing custom variables / values pairs. As you enter content there manually (however, from my little experience, some sources added via browser Connector also stores some info there), you have to be careful how you name your variables you want to use later in CSL. There are a list of standard variables here: https://docs.citationstyles.org/en/stable/specification.html#appendix-iv-variables which you cannot - or shouldn't - use to avoid conflicts (I suppose). Also, you cannot use standard source type names to avoid conflict within Zotero itself (again, I suppose).

    ---------------
    IMO somewhere there at Zotero site SHOULD BE a manual describing what can be put in Zotero Extra field as a variable, and how to use it later in CSL (with examples!). Also - which are forbidden / can interfere badly with Zotero.
    ---------------

    If any Zotero developer (or experienced user) reading this, please correct me.
    I'm new to Zotero, using it for a few days;-)


  • Thanks TomassoTomassini,

    Your comment "I'm not a programmer, but AFAIK you expect Extra field will do some magic. In your initial post, you gave some examples, like e.g: 'type: periodical' when using Manuscript type. IMHO this cannot work" illustrates the underlying purpose of my post: to understand how the Extra field works.

    Regarding the manuscript type, I used this based on comments I read elsewhere in this forum. For example, in a post discussing citing entire periodicals, the follow exchange occurred in response:

    A: CSL has a 'periodical' item type that could mark whole journal issues and allow citing them: enter as type: Periodical in Extra.
    Q: what actual Item Type should be used to populate the fields, if using the Periodical option in Extra?
    A: doesn't matter, whatever works for you. The Extra field overrides the item type under the hood.

    https://forums.zotero.org/discussion/111485/full-journal-issue

    I had read the guide on the extra fields, and it provides a list of variables that can be used in that field. Through trial an error, I discovered that there may be some exceptions (likely based on the citation style) making this contingent on the item type - which is why I asked if "there was a resource indicating which variables will work with which item type."
  • @sicahjes
    Could you please put here a link to the guide on the extra fields?

    What I wrote above is based on my little Zotero experience and general approach to avoid non standard solutions as much as possible. Even if they work, there are ALWAYS some exeptions - exactly as you wrote.

    Additionally, I really would like to know how overwriting standard key/value pairs works. For example:
    1. If we can set there different "type", Extra field have to be parsed at the beggining, as the first field. Then, some unclear things are happening "under the hood", like e.g. after changing "type", some form fields belonging to initialy chosen one may not work, and some other variables become available.
    2. Regardless of what happens then inside the Zotero and how it really works, I suppose we should modify CSL
    3. If we encounter exceptions, no. 1 above is not always true:-( which may lead to much more complicated CSL, which means we (end users), should know how it works, and why sometimes something is not working.

    Zotero developers, please join this conversation;-)
  • The documentation is here: https://www.zotero.org/support/kb/item_types_and_fields#citing_fields_from_extra to be read together with the CSL specifications https://docs.citationstyles.org/en/stable/specification.html which define the CSL standard and the existing mappings of Zotero to CSL as e.g. here: https://pobrien333.github.io/zot2csl/

    With the exception of "type" and any date variables, you shouldn't use Extra to specifiy already existing variables for a Zotero item (I believe they'll just get merged back into the existing field on Sync, but haven't tested for a while).

    CSL doesn't have a concept of certain variables not 'working' for any type, so that consideration is irrelevant.

    They key reason something isn't working as _you_ expect it would be in the CSL style you used. For example, there is not particular reason to think that any given CSL style should display a specific variable for a specific item type (which was the original issue here). Since every CSL style can define the behavior of every item type separately, there is, as I say above, no way to provide some sort of list/documentation for this in general.

    Beyond this, we're happy to try to answer specific questions, but it's ime generally not a good use of time to try to discuss this in the abstract before someone has worked with this enough to be able to formulate questions about specific issues.
  • To summarize this up:
    1.
    Modifying CSL, you can use any Zotero variable in any "type".

    2.
    Key/Value specified in Extra field can overwrite only "Type" value and any date values.

    3.
    Full consequences of overwriting "Type" are still unknown (something can work, someting not).

    4.
    Using Extra field, you cannot enter there any predefined Zotero variables, which come from Zotero interface after chosing initial "Type" (Extra values will be ignored).

    Assumption:
    We can define our own unique variable in CSL, and put it in Extra field - is that correct?

    Suggestion for Zotero guys:
    Add validation for Extra field, to avoid entering there Zotero variables, assigned to initially chosen Type, or used by Zotero itself in any way (to avoid repeating again and again questions "why it's not working").

    Correct me if I'm wrong, please.

    And many thanks to anyone writing here - this may help future generations:-)
  • It really, really is much better to ask specific questions than to try to get at this abstractly. The language above isn't super precise so a lot of these I honestly don't know if they're correct.
  • "Assumption:
    We can define our own unique variable in CSL, and put it in Extra field - is that correct? "

    No, you can't just invent new variables.
  • @damnation
    OK, thanks. FYI: Trying to get something, I've created custom macro. Maybe it's an overkill, but it was fast, and it works.

    @adamsmith
    Are you a Zotero developer or an experienced user? In first case, maybe email would be a better way to discuss smth.
    In the 2nd case - I'm not going to make a mess in someone's topic. But after reading dozens of various forum entries (some very old), I still have doubts how Extra field works, how can be / should be used, and how not. Especially when I read about somebody's experiments.
    Pls consider approach, that generalizations are the real help. And explanations of the individual cases very often lead to another individual cases.

    (English is not my native language - pls apologize if what I'm writing is not super precise. I will try better)
  • I think what I provide above is exhaustive documentation.
    If a specific case isnt' clear, please ask about a specific case.
    The behavior (and the syntax) has changed slightly over time, so old posts will not always be reliable; the links above are.

    I maintain CSL and help maintain the Zotero translators, but I'm not part of Zotero's core dev team, but all communications with devs happen either here or on the dev list anyway. No one is going to communicate with you via email except about billing or security.
  • I admit I've missed https://pobrien333.github.io/zot2csl/ before. This is huge and I think it should be important part of the official Zotero documentation (just in case Zotero change something inside). Anyway, thanks.
  • It's built directly from Zotero's source code, so will reflect updates in Zotero.
  • If a specific case isnt' clear, please ask about a specific case.
    The behavior (and the syntax) has changed slightly over time, so old posts will not always be reliable; the links above are. @adamsmith
    Sorry to be a pain, but: do you know if there's a way to stop URLs displaying for statues, bills, and hearings? Per the Bluebook, 'authentic, official, or exact copies of a source available online can be cited as if they were the original print source'. However, no matter what I do the URL always displays in the bibliography when using Chicago (Note / Full Note).

    I like to store the URLs in Zotero just in case (and it's saved me when I've had some tech issues) so I'd prefer not to remove them. I've tried playing around with different configurations (for eg, add information in different fields adding 'archive place' to the extra field, removing the 'type: treaty' option from the extra field etc.) but the URL still displays.

    I've seen that there's the 'include urls of paper articles in references' option in settings, but it seems to only apply to journal, magazines, and newspapers.

    I've really tried... but I'm at a loss.
  • This has nothing to do with the topic per se.
    You'd need to modify your citation style. That's where that is dealt with. You shouldn't be deleting/moving metadata around in your Zotero library to achieve a certain output.
  • The 18th edition of Chicago specifies an option for omitting URLs, and the new styles that I am developing include this as a variant.

    To test the new edition, I am encoding some of the citations from the manual in a Zotero group library and comparing the results. You can see there how I have used variables in the Extra field to obtain a usable citation (see the Rights field for the relevant CMOS section).

    There is a really interesting AGLC4 Automated Citation Guide, with an accompanying open-source framework. It might be useful to create something similar for Chicago, but this would take more than a volunteer effort! Plus given that Zotero is at last adding new CSL variables as fields, this should become easier very soon.
  • edited 6 days ago
    damnation yesterday at 10:02pm
    This has nothing to do with the topic per se.
    You'd need to modify your citation style. That's where that is dealt with. You shouldn't be deleting/moving metadata around in your Zotero library to achieve a certain output.
    Apologies. I initially thought this had something to do with the treaty variable, and that got lost in the late night edits I made as I typed the comment in question.
    dunning today at 3:43am
    The 18th edition of Chicago specifies an option for omitting URLs, and the new styles that I am developing include this as a variant.
    Alas, I'm afraid the C18 style won't be available in time (for me). I did check out the linked library, though. It would be good to see some Bill, Statute and Hearing item types, to see how things like UN Conventions, Resolutions, EU legislation etc. are handled.

    As an aside, I'm not sure how I feel about C18 just yet... but like anything I'm sure I'll adjust. I prefer em dashes in the bib for repeat authors (it draws my eye to it faster), and chapter page ranges serve a purpose for undergrad papers (detecting AI use etc.). Technically, Chicago 17 permits some items to be cited as per the print versions (14.270), but based on the above response I'm guessing the CSL doesn't?

    I'll post a seperate post asking for advice :)
  • Note that you can just install Chicago 18 from the linked pull request
    https://forums.zotero.org/discussion/comment/486641/#Comment_486641
  • edited 6 days ago
    @adamsmith thanks :-) Am I correct that this removes the URL for all item types?
    There will be sources where the URL is necessary (some reports, journals without page ranges etc.). I just need them to not display for bills and statutes.
  • See CMOS 13.6: they give options for either printing the text of URLs or omitting them (with the intent of linking the titles instead), but do not give criteria for omitting selected URLs on narrower terms.
  • @dunning

    The criteria for omitting urls in sources relevant to my use case (statutes, bills etc) is covered in Chicago 14.11 and 14.270, as well as Bluebook rule 12.5.

    14.11: Library and other bibliographic databases
    For a source consulted via a library or other commercial bibliographic database and available only through a subscription or library account, it may be best to name the database in lieu of a URL. Even a URL recommended for such a source
    (see 14.9) may lead a nonsubscriber to a login page with no information about the source itself.
    14.270 Legal and public documents online
    In general, for citations of cases, constitutions and statutes, and like materials, print sources are preferred, but online versions authenticated by a government entity or considered to be the official version (or an exact copy thereof) can be treated as if they were print.
    Bluebook, rule 12.5
    Authentic, official, or exact copies of a source available online can be cited as if they were the original print source.
Sign In or Register to comment.