Inserting space before "author-date" for in-text citation style

Hi all, I am trying to edit the "Brain, Behavior, and Immunity" citation style to include a space before the in-text citations. I was using Nature as I wrote to keep the text clean with numbered in-text citations, but in switching to the other style, there are now no spaces before all of the many author-date in-text citations. I read other posts describing how to edit citation styles to add a space, but I can't find the appropriate line in the code to do it (csl file text pasted below):

<?xml version="1.0" encoding="utf-8"?>



Brain Behavior and Immunity
http://www.zotero.org/styles/brain-behavior-and-immunity



0889-1591
2018-03-09T05:06:46+00:00
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License



Changing

to

didn't do anything.

Anyone have any suggestions? I wonder if I might have to find a very similar style that has more csl code to edit -- just seems like there's not much that editable with this style. Thanks!
  • Sorry... didn't realize the csl code would disappear. This is the change I tried making:
    adding a " " to before the "author-date" part of the citation category line. There wasn't an obvious citation layout section to edit as shown in other posts about this with other styles. Any ideas? Thanks!
  • Ok, I tried what was described in a previous post (https://forums.zotero.org/discussion/61947/spaces-vs-no-spaces-in-citation-styles) with the citation style for Cell, and it worked!

    It just seems that the Brain, Behavior, and Immunity csl file doesn't have all of the editable code that other styles do. And, actually, neither did another Elsevier journal style that I looked at. Also, it doesn't show up as a choice in the dropdown list of styles to edit when you open the Style Editor window in Zotero... does that mean that this style isn't editable?

    Thanks again!
  • edited September 18, 2021
    Without checking, this is probably a dependent style. In line 6 or so is a link to a style name with the attribute "independent-parent". That's the style you want to edit.

    Note though a space before the brackets, you can just type in your text. I don't understand why anyone would want to add a space before via CSL.
  • Hi @damnation -- thank you for the info about the style! I think that will be really helpful.

    I know I can just type a space in my text. The reason I want to edit the style is because I've already written a really long text using a style that has numbered in-text citations. When you switch from that to a style that uses (Author, Year) in-text citations, there isn't a space between the last word of your text and (Author, Year), so it ends up looking like this:

    A recent study showed similar results(Smith, 2020).

    instead of

    A recent study showed similar results (Smith, 2020).

    Given the length of my paper and number of citations, it would take a long time to go back in and enter those spaces manually.
  • As damnation suspected, "Brain Behavior and Immunity" is just Elsevier Harvard: https://www.zotero.org/styles?q=id:elsevier-harvard so that's the style you'd want to edit.
    General instructions here: https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step
    In particular, don't forget to change title and ID
  • Great, thanks so much everyone!! Huge help. Love the Zotero community.
Sign In or Register to comment.