Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BibTeX CSL output missing last character "}" #3568

Closed
israelcefrin opened this issue Jun 27, 2018 · 5 comments

Comments

@israelcefrin
Copy link

commented Jun 27, 2018

Hi
We use OJS with citeproc-php CSL parser. We have found an issue when we try export a citation format based on BibTex, it is missing last closing character "}".

We've opened an issue on citeproc-php Github project and they pointed that this bug is related to identical consecutive suffixes that are removed . In fact this behavior is desirable because there are styles where consecutive identical characters have to be removed (especially punctuation characters).

As workaround they've suggested change the style (line 146):
<group prefix="{" suffix="}" delimiter=", ">
with <group prefix="{" suffix=" }" delimiter=", ">
or
<group prefix="{" suffix="\n}" delimiter=", ">.

And it has solved our problem.

But, my question is: would you happen have an alternative solution if someone has already face such bug?
Or is this only and best feasible solution for now?

Cheers,
Israel

@adam3smith

This comment has been minimized.

Copy link
Member

commented Jun 27, 2018

I disagree with citeproc-php here -- which identical consecutive suffixes should be removed should be handled more judiciously than extending this to all characters.

But I'd take a PR that adds the space there (not the \n character though).

@rmzelle

This comment has been minimized.

Copy link
Member

commented Jun 28, 2018

Or is this only and best feasible solution for now?

The best solution is to not use CSL styles to generate BibTeX. We know there is a BibTeX CSL style in the repository, but its use should be avoided if possible. The whole CSL ecosystem was built for human-readable output, and CSL styles and CSL processors are limited in their ability to generate correct computer-readable output, which often has requirements CSL can't satisfy.

There are dedicated software libraries for converting bibliographic formats, such as https://citation.js.org/ (open source and can handle CSL JSON and BibTeX).

@rmzelle rmzelle changed the title BIBITEX format missing last character "}" when exporting BibTeX CSL output missing last character "}" Jun 28, 2018

@rmzelle

This comment has been minimized.

Copy link
Member

commented Jun 28, 2018

(that said, it would be better if the CSL specification was explicit about how punctuation collapsing should work, and as @adam3smith mentioned, this automatic collapsing should probably not extend to curved brackets)

NateWr added a commit to NateWr/styles that referenced this issue Aug 16, 2018

citation-style-language#3568 Add space to bibtex suffix to prevent co…
…llapsing brackets in third-party converters
@NateWr

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2018

Sorry for the delay in following up on this. I understand building bibtex with CSL is stretching things. But we would prefer not to introduce an additional conversion dependency into our platform if possible.

@adam3smith are you still open to a PR to add the space? If so, I've opened one here: #3651

adam3smith added a commit that referenced this issue Aug 16, 2018

@NateWr

This comment has been minimized.

Copy link
Contributor

commented Aug 17, 2018

This can be closed now that #3651 has been merged. Thanks everyone! 👍

@adam3smith adam3smith closed this Aug 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.