Can't insert a line break in CSL style

Hi all,
I want to insert a blank line between each reference in the bibliography.
I have set the display to block but it doesn't have any effect. Ideas? Here is my code:
https://hastebin.com/ihinedafok.xml

thanks!
Erik
  • You want to set entry-spacing="2" in the bibliography node in your style
  • That seems to be just what I was looking for! Except it didn't work. The bibliography looks the same, with no space between entries. Updated code:
    https://hastebin.com/okeletumor.xml

    Erik
  • edited November 10, 2020
    That looks right. Try to change to a different style and back. Also be sure to change the style id at the top of the style if you haven’t already
  • Also -- how/where are you testing the bibliography?
  • I was testing it in Word, linked through the Zotero plug-in. That's why it didn't work. When I deleted the style and reloaded in Zotero, and then refreshed the Word document, it worked great. thanks for the help!
  • It looks great in Zotero's preview. I used the Visual CSL editor. But when it gets to Word, now there are two blank spaces (a carriage return at the end of the entry, a blank line, and then another carriage return). I tried changing the entry-spacing to 1 but I got the same result.
  • The carriage return would be the result of display=“block”. Remove that
  • So I cleaned up a few other things but I am back to square one: I can't get a blank line between entries, even after trying block display and the entry-spacing. Ideas??
    Here's the code: https://hastebin.com/gumifuxezo.xml
    Thanks!
  • Is it possible to get a line break using the visual editor
    https://editor.citationstyles.org/visualEditor/ ?

    And if so, how does it work? Any hint is appreciated, thanks!
  • @erikmarsh -- this should work and does for me: https://hastebin.com/kujiteseve.xml


    @MarcoLerim it's unclear what the exact question is -- if you just want an empty line between bibliography entries, click on "bibliography" on the left and then set entry-spacing to 2 on the bottom right. Inserting linebreaks within a bibliography entry is possible but can be quite messy in the visual editor because you need to set the group (on which then to apply display="block") right.
  • @ erikmarsh In fact I would like to be able to do both:
    - insert empty line between bibliography entries: I tried your hint, but haven't managed to get it work. But I will continue to play around with it.

    -insert linebreaks within bibliography: When I apply on a group display="block" I get this error code: "Citeproc exception: citeproc-js error: Level mismatch error: wanted bib_first but found bib_other" ( I tried with different groups and always et this error.)
  • Can you post your code to hastebin.com or similar and give a link here?
  • To edit my custom style I started from the style "International Pig Veterinary Society Congress Proceedings". My version is here:
    https://hastebin.com/zosojupuve.xml

    I would like to have:
    1.) a line break before URLs
    2.) an empty line between every bibliographic entry

    I would be very thankful for any help or hints!
  • @adamsmith thanks for the code, but it still doesn't work - there are spaces in the between the entries in the Zotero preview, but not when I export to an RTF or Word file. it looks like you're removed the group with the block display. I had tried this but it didn't work for me either. I also get an error in Zotero that this is not a valid CSL 1.0.1 file.
  • The reason it's invalid is just because hastebin appears to move the sort element down just move it up before saving & the style will validate.
    Maybe we're talking past each other -- entry spacing inserts space between paragraphs, not, technically, an additional line break, but the spacing definitely works in RTF/Word. Is there a particular reason you need an actual linebreak (which would be poor formatting -- spacing between paragraphs is much better handled as spacing than with dozen of hard returns)
  • Great, I moved the sort element up and it validated. Weird that hastebin does that.

    Yes, now I am seeing the correct spacing with your code. This is what I was doing when I didn't see spaces: select three refs > Generate Bib from items... > copy to clipboard > paste to text files. Saving them as an RTF works great!

    It would have been easier from the start if I had aimed for spacing between paragraphs instead of hard returns. This is what I originally envisioned and is how I would have done it manually.... but not the right approach here.

    It would be handy if Zotero's editor could save changes to styles instead of having to save as a new file and then import the edited files. Somehow integrating the Visual CSL editor into Zotero's style editor would make this kind of tinkering so much easier.

    Thank you! Your help and patience are much appreciated
  • In case this is useful to others, the key things I learned here was:
    • to get a blank space between bib entries, you want to add space between paragraphs, not add a carriage return
    • in the visual CSL editor, go to the right panel and locate Advanced > Global Formatting Options > Bibliography
    • in the bottom panel, the third-to-last option is "entry-spacing". Change this to 1. Do not use the option "display-block".
    • in Word, this is equivalent to Format > Paragraph > Spacing After = 12 pt. This gives you the appearance of a blank line, which is actually extra space added after the paragraph that has the height of one line.
  • It would be handy if Zotero's editor could save changes to styles instead of having to save as a new file and then import the edited files.
    @dstillman -- what do you think about this? I think it'd be nice to install styles directly from the editor. Will require some thinking (esp. to prevent people installing over existing styles and then having their changes reverted and likely lost) but still seems like a nice UX improvement.
    Somehow integrating the Visual CSL editor into Zotero's style editor would make this kind of tinkering so much easier.
    I'm afraid no to the visual editor, though -- that's a fairly massive app by itself, so doesn't lend itself well for direct integration with Zotero -- what part are you most after, though? Just quicker installing of styles or something else?
  • @adamsmith @dstillman This would be great! Zotero already shows a preview, so I can see why it would be perhaps unnecessary or difficult to integrate a visual editor.

    What would make things much easier is being able to make small changes to the CSL and saving them. As is, every small change requires you to save as and then import a new style. Perhaps Zotero could automatically save a user's version of an "official CSL" (from the github repository) alongside the unedited version, so you can always revert back if you mess it up.
Sign In or Register to comment.