"soft return"/line feed/cr vs display="block"
Old programmer here, but new to Zotero/CSL. Sorry to take up bandwidth, but have been combing the forum for days trying to answer my own question about inserting a "soft return" or line feed (aka "line break", "newline", or "carriage return", et al) into a citation or bibliographic entry. Have seen documented a flurry of interests YEARS ago, but have seen nothing recent, and more importantly, nothing that works for me.
I want to add annotations (via the Extra field) to my citation; I am editing an already defined style (in this case, latest version of Chicago), which will ultimately end up in Word (2016). I want to have a "soft return" -- in Microsoft Word parlance (shift+enter) -- between the citation entry and the annotation; I do not want extra space, as one would have between paragraphs.
If I say:
I will get the annotation tacked onto the end of my citation, wherever on the line that occurs.
If I say:
I will get the annotated [Remarks:....] on a new line BUT with a bunch of whitespace after it. The whitespace is not affected by Word paragraph formats which dictate 0 spacing after paragraphs.
I understand the handoff between the Zotero styles and the Word format controls. Ideally, I'd rather be telling Word how to handle white space than changing a Zotero style.
There are a few kludgey ways around this, like post-processing the Word file, for example. But I'd rather not; I'm trying to set up for a large project, involving a few hundred files & anticipating many annotated citations per file.
So, can one insert a "soft return" into a citation or bibliography? And if so, how? (And please note, if "
" is involved, you are going to have to hold my hand for a moment & give me a firm example, because I've tried this, multiple ways, to no avail.)
Thanks in advance....
I want to add annotations (via the Extra field) to my citation; I am editing an already defined style (in this case, latest version of Chicago), which will ultimately end up in Word (2016). I want to have a "soft return" -- in Microsoft Word parlance (shift+enter) -- between the citation entry and the annotation; I do not want extra space, as one would have between paragraphs.
If I say:
I will get the annotation tacked onto the end of my citation, wherever on the line that occurs.
If I say:
I will get the annotated [Remarks:....] on a new line BUT with a bunch of whitespace after it. The whitespace is not affected by Word paragraph formats which dictate 0 spacing after paragraphs.
I understand the handoff between the Zotero styles and the Word format controls. Ideally, I'd rather be telling Word how to handle white space than changing a Zotero style.
There are a few kludgey ways around this, like post-processing the Word file, for example. But I'd rather not; I'm trying to set up for a large project, involving a few hundred files & anticipating many annotated citations per file.
So, can one insert a "soft return" into a citation or bibliography? And if so, how? (And please note, if "
" is involved, you are going to have to hold my hand for a moment & give me a firm example, because I've tried this, multiple ways, to no avail.)
Thanks in advance....
To display=block or not, yes, that is the question.
I don't like display=block because it seems there is no control over the whitespace. Once display=block is employed, that whitespace is there (seems to be varying amounts depending on the text being displayed) -- and Word paragraph settings don't appear to affect that whitespace.
I just want my little added bit of text to start on a new line, but I don't want to tart it up with a lot of trailing whitespace.
Am I missing something here?
Seems like display=block is the hardest of hard returns, not the soft one that I'm looking for. But if the code won't support a soft return, then perhaps I need to rethink my approach.
Zotero is such a nifty tool, I was really hoping to do some cool customizations, but I may need to scale my expectations back just a tad. ;)
(FYI, you can wrap code in
<code>
tags on the forums, but it is much easier to read entire styles if you post them as a link to a gist.)What I'm trying to do is take the Chicago Manual of Style 17th edition (full note) style and tweak it a bit to add some additional information which I've entered into the "Extra" field (is that the correct terminology?) in Zotero. I figured out that this info is stored in the variable "note" & I want to output that at the end of the citation, but on a new line with no white space.
I do that in the last line of the layout section. I also made a minor change to the layout to remove the suffix "." and instead output that before the note variable is output (to put the period at the end of the citation where it belongs, not after the following remarks). The style is here: https://gist.github.com/clcabler/226f6c656be034928455411c9412a3a5
If I have display=block in the text line, I get something in Word that looks like the output shown here: https://gist.github.com/clcabler/2bbb72561f148917bd336bff380ddf3e
The first citation does not have data in the Extra field, so nothing output, and the 0 spacing after the paragraph is preserved. The next 2 citations (lines 2-7) both have data in the Extra field; this is correctly output on the next line following the citation BUT an extra line is inserted. This line cannot be deleted in Word without deleting the citation; its size/spacing cannot be managed through the paragraph formatting controls.
In the style I supply, I have commented out the line where I output the note variable without display=block. When I use that line instead, I get something in Word that looks like the output shown here: https://gist.github.com/clcabler/ec606e4381df8b9727af56436d51a020
Here, no extra blank lines are created in the Word document. Of course, the remarks are tacked onto the end citation, instead of going onto a new line.
Thanks for offering to look through the style. I've gotten pretty frustrated -- I'm so close to having the look I want!
Word: Microsoft Office Professional Plus 2016, version 1708, running on Windows 10, version 1703
Would it make a difference for the annotations to appear in the bib? I guess it just depends on what code is causing the undesired side effect. Guess I should try & see. And it could be something on the Word side of things -- wouldn't be the first time a Microsoft product has bitten me with unexpected behavior. OTOH the extra lines show up in the display panel of the Zotero Style Editor also.
I figured that trying to use Extra for the medium field would negate being able to use Extra as my annotation field, but when I tried it I was surprised to find out that I could do both, simultaneously!
What else can Extra do? Iron shirts & tie ties? ;) Seriously, is there a mapping of the fields within fields somewhere?
Sorry to pull this thread somewhat off-topic, but wondering if storing my annotations in a different field would have a different effect on the output.
@adamsmith Is it correct for display="block" to insert a soft return both before and after the text element? That would seem to produce undesired output in a lot of circumstances. Shouldn't the correct behavior be to only insert a soft return before?
Relatedly, none of the XML line end entities work anymore in CSL styles (though they did previously [years ago]). Is that also expected?
display="block"
the expected behavior?Interesting to bring a discussion 7 years ago alive.
I confirm that the
display="block"
produces 2 linebreaks, i.e. one at the beginning and one the end.For example, in the
bibliography
block, the<text macro="fullref" display="block" />
(where themacro="fullref"
is a full bibliography item) results in 2 blank lines, i.e. 3 linebreaks, between items.In the
citation
block for a footnote style, the<text macro="fullref" display="block" />
produces a line break after the citation number label (i.e. before themacro="fullref"
), and 1 blank line (i.e. 2 linebreaks) between items.The above is found when I want to insert a linebreak (soft return) between footnote citation items, instead of using semicolon by
<layout suffix="" delimiter="; ">
. But as @bwiernik said, "none of the XML line end entities works".<layout suffix="" delimiter=" ">
does not produce a linebreak at all.So, as a suggestion or bug report to the Zotero development, it is useful to activate:
delimiter=" "
, and it is also reasonable to add only 1 linebreak at the end of the part withdisplay="block"
.Would be nice to see the change. Cheers!