Citation Style Language punctuation issue (OJS 3.1.2.4)

The plugin fails to put commas inside quotes for styles using American English (e.g. IEEE) (as shown in the journal’s site).

We use OJS 3.1.2.4.

We have tried including and also as a macro () but still the citations are not shown correctly (the plugin seems to fall back to default styling which is to put commas outside quotes).

However, if the citation is downloaded and opened in a RefMan software (Zotero, Mendeley), then it is shown correctly.

Has anybody noticed/solved this?

*We have tried including ( style-options punctuation-in-quote=“true” ) and as a macro ( text variable=“title” quotes=“true” )

Hi @dion,

We rely on the 3rd-party (and excellent) citeproc-php library for citation formatting; you might check around in its issue list to see whether this has already been filed and possibly resolved.

Regards,
Alec Smecher
Public Knowledge Project Team

As I said, the citation is shown correctly when downloaded through the plugin and then imported in a third-party software, so the problem seems to be related to OJS, not to citeproc -php

As far as I understand, this is something set in each csl style file. The two related settings seem to be the ones I mentioned above.

However, these are specifically ignored by the plugin so I think that there is a setting somewhere in the plugin or the OJS, overriding them.

(I also tried replacing the ieee csl style file with the one that zotero uses (which is more recent and adds the online/accessed metadata at the end of the citation and, of course, shows the commas inside quotes).

When doing so, all additions were shown without a problem but the commas were put outside the quotes.

So I feel rather positive that this issue is OJS/plugin related.

Hi @dion,

Can you post a screenshot showing the issue in more detail?

Thanks,
Alec Smecher
Public Knowledge Project Team

punct_problem

I attach a screenshot from the IEEE citation style but the problem is the same with all American Styles.

Hi @dion,

You can see where OJS maps its metadata into the form the citeproc-php library uses in CitationStyleLanguagePlugin.inc.php; the citeproc-php library (along with the csl files in the plugin repo) takes care of formatting from there, including adding the quotes.

OJS 3.1.2-4 includes citeproc-php v2.1.6. The closest I found to a relevant issue in the citeproc-php library is punctuation-in-quote issue · Issue #50 · seboettg/citeproc-php · GitHub, which appears to have been fixed in v2.1.3 of citeproc-php. So that particular issue shouldn’t appear in OJS 3.1.2-4, at a glance.

However, we did upgrade the version of citeproc-php to a much newer release for OJS 3.2.0-x, so I wonder whether this has improved in that release.

Regards,
Alec Smecher
Public Knowledge Project Team

I went through the citeproc forum and also through citationstyles.org guides.
It seems that this setting is set using the tags I quoted earlier (see the posts above) within the csl style files.
I am rather positive that the csl style files are correct as they have been tested in third party software and in there they show the citations correctly. I have also tested the plugin the opposite way (inserting csl style files from third party software to the plugin and then the problem resurfaces).
So, I am guessing that there is another setting somewhere in the plugin overriding the csl settings or simply ignoring these specific tags/settings (similar to OJS choosing to ignore the html tag for justified text in certain pages).
According to citationstyles.org, the standard attribute for punctuation-in- quote is false, so I am guessing that it falls back to the standard setting for some reason.

My personal opinion is that commas outside quotes look and feel better and in fact I own printed IEEE journal issues from some years back (not that many years, actually) that use this style and specifically ask authors to use the commas-outside-quotes approach.

However, it seems that lately (I am guessing that the RefMan software have “helped” this), the inside-quotes version has been widely adopted.

I think that having a “how to cite” plugin that actually provides wrong styling is an issue as the problem is not contained in OJS journals, but will propagate to all other journals that authors may submit a paper including a citation copied from any OJS journal’s site.

Thus, (I think) if a direct fix is not possible, then it would be nice to have the plugin offering the choice to actually not show any citation style on the journal’s site but just offer the download option (if the citation is downloaded/imported to RefMan software, the problem is lifted).

This could be an acceptable workaround (if anybody can offer some guidance at least for this)

Hi @dion,

I ran a quick test by editing example/index.php in a checkout of the citeproc-php repository and changing:

$style = StyleSheet::loadStyleSheet("elsevier-vancouver");

…to…

$style = StyleSheet::loadStyleSheet("ieee");

This changes the relevant part of the output of the example script from…
image
…to…
image

If I understand the issue you’re encountering correctly, the comma should be inside the quotes, correct? If so, this replicates the problem entirely outside of OJS; I’d suggest filing as an issue on the citeproc-php library.

Thanks,
Alec Smecher
Public Knowledge Project Team

correct BUT the ieee.csl built in the plugin does not contain the style-options punctuation-in-quote=“true” (as it should) that would put the comma inside the plugin according to citeproc and citationsstyles.org instructions.

I have tried to include it but still nothing changes.

Thus, I think this attribute is treated like a “global” setting set in some other file (OJS file or plugin file), that overrides the settings in csl files.
(that this is also the approach followed by zotero as its most recent ieee.csl file does not contain the style-options punctuation-in-quote=“true” but the citations appear correctly there)

did some additional digging and the style-options punctuation-in-quote=“true” can be found inside: lib/locales/locales-en-US
However it still gets ignored by the plugin

I found a post here:

describing similar strange behavior (csl style tags being overriden) but there is no conclusion to what the cause/solution was.

Hi @dion,

The example/index.php test I ran above is run completely independent of OJS and the Citation Style Language plugin for OJS. It demonstrates the same behaviour as your initial report, but only relying on citeproc-php (and its own dependencies), including for the ieee.csl stylesheet (which it gets from GitHub - citation-style-language/styles-distribution: Official repository for distribution of validated CSL citation styles.). I think this demonstrates that the problem is in citeproc-php or its dependencies.

I can confirm that there is no other intervention by OJS or the Citation Style Language plugin into citeproc-php other than the code I linked above, which as you can see just feeds metadata to citeproc-php but does not otherwise change its behaviour.

If you still feel that the issue is in OJS or the Citation Style Language plugin, I’d suggest recreating the example/index.php test above. If you can get citeproc-php to move commas inside quotes, but OJS still won’t, let me know what adjustments to the example script (and/or CSL file) were necessary and I’ll investigate further.

Regards,
Alec Smecher
Public Knowledge Project Team

I will try to contact them and if I have any feedback, I will let you know.

Meanwhile, is it possible to help me applying the workaround I mentioned earlier?
(have the plugin show only the download (bibtex and refman) options and avoid showing the citation in the abstract page).

In any case, I would like to thank you for your time

Hi @dion,

The quickest way to avoid propagating citations with the ", quote ordering will be to set up the Citation Style Language plugin to only provide citation formats that aren’t affected, such as (OTOH) Vancouver style.

Otherwise, an option would be to attach a CSS file to the journal that targets the specific elements you want to hide and prevents their display. (Crawlers that don’t care about CSS would still pick up these elements.)

Beyond those solutions you’d need to modify the code of the Citation Style Language plugin, I’m afraid.

Regards,
Alec Smecher
Public Knowledge Project Team

that would be really helpful.
I just found out that “et al” is also not appearing normally (it just shows the first author and then the title when it should show the first author then “et al.” and then the title) so hiding it I think is the correct way to go for now.

We have a simple css file just to hide the TOC of the latest issue from the home page
.page_index_journal .current_issue { display: none; }
but I do not know what to use to hide the how to cite element and still keep the download options

Hi @dion,

If you mean to hide items from within the drop-down menu, unfortunately that’s not possible with just CSS. You’ll either have to intervene with Javascript (see perhaps the Custom Header plugin) or modify the plugin.

Regards,
Alec Smecher
Public Knowledge Project Team

Dear @asmecher
I have a problem when in bibliography the first name of an author has two letters. I want the name to appear like “Nasibi Sh.” and it actually appears like “Nasibi S.”.
Would you help please
Thanks
2020-12-19_12-18-04