What is the difference between the visual editor and code editor?

I'm wondering whether there is a difference in what can be achieved with the visual csl editor compared to the code editor. Are there modifications one can make in the code editor that are not possible to make in the visual editor or vice versa?
  • No, everything should be possible with the visual editor (@damnation would probably know best if there are any limitations). It mostly comes down to preference. I find editing the code directly much faster, but if you aren’t very familiar with the CSL language or aren’t comfortable coding, then the visual editor might be easier and more intuitive to work with.
  • Thank you! I was wondering mainly because I find the visual editor to be somewhat rigid. For example, I edited APA 6th edition to generate this in-text citation format: Author (Year) , p.x by putting the comma as a prefix of p., but I couldn't find a way to remove the space between (Year) and the comma in front p. I assume this type of modificaiton would not be possible in the code editor either?
  • The only thing you'd ever need the Code Editor for is to override locale sections. That can only be done via code. It's not the most common thing and if needed is very easy to do.
    And soooometimes one can't find where a certain comma/dot is coming from and it is then easier to look in the code.

    If you need help, post youre code on Hastebin and share the link with us here. :)
  • I have no experience coding so I'm not entirely sure what I'm looking at. I think this https://pastebin.com/mz9rBcHM is the code for my edited version of APA6. All I want to do is to remove the space between (Year) and the comma in front of p. so that the in-text citation will take this form: Author (Year), p.x

    I would very much appreciate some help with this if possible!
  • So, that you can totally do in the Visual Editor. :)

    You have a delimiter set in the "Inline citations" group. This group adds a space between authors+(year), but also between (year) and the pages.
    To get rid of it the 2nd space, but keep it between author and date, you can do the following.


    <citation et-al-min="6" et-al-use-first="1" et-al-subsequent-min="3" et-al-subsequent-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" collapse="year" givenname-disambiguation-rule="primary-name">
    <sort>
    <key macro="author" names-min="8" names-use-first="6"/>
    <key macro="issued-sort"/>
    </sort>
    <layout delimiter="; ">
    <group delimiter=" ">
    <text macro="author-short"/>
    <group delimiter=", ">
    <text macro="issued-citation"/>
    <text macro="citation-locator"/>
    </group>
    </group>
    </layout>
    </citation>

    (Replace citation section from 1401.... with this).

  • Perfect, thanks a lot!! May I ask an unrelated question (but still on the topic of code editor) in this thread?
  • Yes, please feel free to keep all your style editing questions in this thread.
  • Ok! So my other problem is this: Whenever I make a reference citing several works by the same author, my edited version of APA6 will generate the following in-text citation format: Author (Year), (Year), (Year). I would like for it to take this format instead: Author (Year, Year, Year). How can I make this change?
  • Have a look at the Cite Grouping section in the CSL Spec: http://docs.citationstyles.org/en/stable/specification.html#cite-grouping
  • I actually think this may not be possible. CSL is currently intended for author (date) styles to be handled by writing the author(s) in the text (various long discussions in the forums; improved handling in the works)
  • @adamsmith I'm not sure I understand what you mean. Is it not possible to get the Author (Year, Year) format?
  • See here for the best way currently to use author (year) formatting: https://www.zotero.org/support/word_processor_plugin_usage
  • @Asker -- I haven't tested, but yes that's what I mean.
    I don't think you can get Author (year, year) generated by a citation style, I'm afraid. The only way to do this is to use suppress author in an (author year) style and write the author in the text.
  • I see, thank you for the clarification!
  • @damnation I have another style editing question... My edited version of APA6 (referred to above) generates the following format for in-text citations where several works by the same author in the same year are referenced: Doe (2000)a, (2000)b. I need the letters to be inside the brackets like this: Doe (2000a), (2000b).

    I put the brackets around the year as prefix and suffix, perhaps this has something to do with the problem?

    Is there a way to fix this?
  • Move the brackets to the group that includes both your issued-year and year-suffix macro.
  • @damnation It seems that if I do that, either I do not get the second bracket on the issued-year when there is no suffix or I get double brackets, hence either:
    1. Doe (2000 when there is no suffix (and Doe (2000a) when there is a suffix)
    2. Doe (2000)a)

    I'm not sure how to get Doe (2000) when there is no suffix and Doe (2000a) when there is...
  • We'd need to see the code, but unless something isn't working correctly, it seems like you're setting the suffix on a specific element rather than a group.
  • Yes! I figured it out finally. It works now, thanks!
  • I didn't distinguish between the specific element and the group..
  • edited 7 days ago
    Test output:
    Accadia et al. (2012a), (2012b); Mares (2001)

    Code:


    <macro name="issued-year">
    <group prefix="(" suffix=")">
    <choose>
    <if type="personal_communication">
    <choose>
    <if variable="archive DOI publisher URL" match="none">
    <date variable="issued" form="text"/>
    </if>
    <else>
    <date variable="issued">
    <date-part name="year"/>
    </date>
    </else>
    </choose>
    </if>
    <else>
    <date variable="issued">
    <date-part name="year"/>
    </date>
    </else>
    </choose>
    <text variable="year-suffix"/>
    </group>
    </macro>


    (I have used the style you had posted on Pastebin as a base. It might be different now if you have changed this part a lot.)
Sign In or Register to comment.