BUG: IEEE Bibliography Export does not match configured format

Report-ID: 1389390411

If you try to create a text-format bibliography, the exported bibliography format (IEEE) does not match the template.
It does not include the space after the reference number: "[1]Author...", but the template says it has to be "[1] Author..."

Steps to reproduce:
1. Select an entry
2. Right-Click and select "Create Bibliography from Item..."
3. Select IEEE as your citation style; Output Mode: Bibliography, Output Method: Copy to Clipboard
4. Paste the bibliography to your editor of choice (e.g. notepad.exe)
5. You will notice, that the entry misses a space after the citation number e.g. "[1]Author" instead of "[1] Author"
  • The alignment of the number and the rest of the refernce is done using html properties, which obviously get removed in plain text. There's no big here
  • edited May 22, 2022
    @adamsmith
    "[...] and the rest of the refernce is done using html properties, which obviously get removed in plain text"
    Okay, same template, but incorrect text output (missing spaces), so a different result and you say no bug here?!
    Yes they get removed, instead of doing a proper text conversion preserving spaces, and thats a bug. A bibliography template should deliver consistent results, regardless of the target format chosen. If thats not the case, the feature is pretty useless, because you have to manually edit all your entries and cannot be sure, that your templates will look almost the same in every format.
  • I mean, you don't get italics in plain text either...
    There's no space there in IEEE, the text after the number is left aligned, which, like italics, isn't possible in plain text.
    I agree that makes the output less useable in plain text, though note that Zotero doesn't actually offer that as an output format: you're forcing it by pasting into a plain text editor. I don't think there's much of a chance of that changing, sorry.
  • edited May 22, 2022
    @adamsmith
    " There's no space there in IEEE, the text after the number is left aligned [...]"
    I would say alignment can be created by different techniques, if you do it by using spaces or by applying css rules in html doesn't make a big difference in what you want to achieve.
    It boils down to doing some alignment. And in textfiles this is usally done with whitespace. Every source I found for IEEE creates whitespace between the number and the author. So it's more unusual to omit it.

    Sad that zotero doesn't provide a real plain text output
  • Zotero doesn't actually offer that as an output format: you're forcing it by pasting into a plain text editor
    @adamsmith: That's actually not the case. citeproc-js produces both text and HTML, and we put both on the clipboard. It seems like this might be as simple as adding a space after the ] in the style — that seems to add the space to the plain-text output, while having no effect in HTML due to whitespace collapsing.

    https://github.com/citation-style-language/styles/blob/374238f1ca4d4cbcc8ceb1951794cbf12bdde5df/ieee.csl#L314
  • edited May 23, 2022
    Though thinking about it more, a more general fix might be for the citation processor to automatically add a space after the first field in plain-text mode when second-field-align is used? Adding hard-coded spaces to individual styles isn't a great solution.

    Obviously there's no real "correct" behavior here, since the plain-text output is inherently lossy, but it seems like it would generally make plain text more usable for certain styles.
  • Though thinking about it more, a more general fix might be for the citation processor to automatically add a space after the first field in plain-text mode when second-field-align is used?
    Yeah, that makes more sense. I don't like the idea of adding the space in CSL code -- while whitespace collapses in HTML, it can mess with tabs in RTF/Word/LO
  • OK, this is a bit more complicated. Other bundled styles already do what I initially suggested above, so while someone already submitted a processor patch for this, we couldn't apply it without removing the hard-coded space in those styles.

    Moving this to the CSL list for discussion:

    https://discourse.citationstyles.org/t/space-after-first-field-in-plain-text-mode-when-using-second-field-align/1762
Sign In or Register to comment.