citeproc-js should add a whitespace after a prefix/before a suffix in more cases.

If you enter a prefix finishing or a suffix beginning by a non-alphabetical (except a colon) character, such as a parenthesis, the processor will not add any whitespace (whereas it does add a space in other cases). I think this should be changed (for any kind of parens and, maybe, quotes).

E.g. if you select a book and type in the quick format citation bar :
Page : "135"
Prefix : "See (amongst other sources)"
Suffix : "(my emphasis)"

You'll get this output (with Chicago 16th full note) :

See (amongst other sources)Maurie Dee McInnis et Louis P. Nelson, ed., Shaping the body politic: art and political formation in early America (Charlottesville, VA: University of Virginia Press, 2011), 135(my emphasis).

--
(what should be done, for future reference)

opening parenthesis (
at the end of the Prefix field: don't change anything
at the beginning of the Suffix field: add a whitespace before

closing parenthesis )
at the end of the Prefix field: add a whitespace after
at the beginning of the Suffix field: don't change anything

full stop.
Prefix: add a whitespace after
Suffix: don't (or localize)

Comma,
Prefix: add a whitespace after
Suffix: don't (or localize)

colon :
Prefix: add a whitespace after
Suffix: don't (or localize... fr-FR)

semi-colon ;
Prefix: add a whitespace after
Suffix: don't (or localize... fr-FR)
  • edited June 26, 2014
    I've pushed a processor version that adds whitespace after the prefix unless the text is from a non-romanlike script, and before the suffix if it leads with an opening bracket or parens.
  • edited September 25, 2014
    Frank--the prefix version of this turns out to be a little too thorough:
    https://forums.zotero.org/discussion/40745/extra-space-after-opening-bracket-or-parenthesis-in-sbl-style/
    Could you add the list of exceptions that I specify there (or some other solution that avoids that particular problem)
    Oh, add em dashes as one more possible exception.
  • Funny that I just encountered the same issue with the parentheses yesterday and wanted to post here.

    From the other thread :
    I'm thinking " ' (as well as their smart opening versions) ( [ and, probably for completeness, ¿¡
    smart opening versions? If you're thinking about « and » please localize as, in french, they always come with (non-breaking) spaces...
  • I was actually just thinking of
    “ and ‘ but that doesn't give us localized ones (e.g. not the low German one, either.) Maybe Frank has an idea.
  • When would you want to put quotation marks around a dynamic citation?
  • edited September 25, 2014
    I've posted a note over on the original thread that goes over the logic.
  • edited September 25, 2014
    On closing guillemet in user-supplied prefixes, would this be correct?

    Martin␣said␣«␣boo.␣»Martin,␣Big␣Book␣of␣Examples␣(2009).

    = User-supplied prefix.

    = Space supplied by the processor.

    = Generated cite.
  • When would you want to put quotation marks around a dynamic citation?
    nothing concrete in mind. I was just thinking of markers that could potentially be used and wouldn't be followed by a space.
  • edited September 25, 2014
    With the logic it's applying, quotation marks are ignored, and non-alphanumeric characters attract no space unless they are in the terminal punctuation list. I think for guillemet as well that things will work correctly if we just ignore them (plus space that precedes them), and look at the character behind.
  • That's some fancy posting, Frank. It's nice to see more color on these forums :)
  • edited September 25, 2014
    Just trying to be clear. As Gary Larson has it: [image] :-)
Sign In or Register to comment.