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

Why does explicit cite-group-delimiter override year-suffix-delimiter? #50

Open
zepinglee opened this issue Jul 15, 2022 · 7 comments
Open

Comments

@zepinglee
Copy link
Contributor

zepinglee commented Jul 15, 2022

In name_CiteGroupDelimiterWithYearSuffixCollapse.txt, the cite-group-delimiter is explicitly set ", " and the year-suffix-delimiter is by default the delimiter of citation > layout (i.e., "; ") according to the spec.

<citation collapse="year-suffix" cite-group-delimiter=", " disambiguate-add-year-suffix="true">
<layout prefix="(" suffix=")" delimiter="; ">

In the result, only cite-group-delimiter (", ") is outputed.

>>==== RESULT ====>>
(Aalto 2015a, b)
<<==== RESULT ====<<

I also check other cases and the results of citeproc-js f56f8c95 are as follow. It seems that cite-group-delimiter is used as the delimiter of year suffixes if it's explicitly set. I can't find relevant description in the spec.

cite-group-delimiter year-suffix-delimiter Result
", " Not set (Aalto 2015a, b)
", " "!" (Aalto 2015a, b)
Not set "!" (Aalto 2015a!b)
Not set Not set (Aalto 2015a; b)
@adam3smith
Copy link
Member

If I'm understanding the question correctly, it's a question about the hierarchy of delimiter rules for citations, which I agree are not covered by the specs. In other words, it's row 2 of the table above that's in question. Is that correct?

The current test suite and citeproc-js behavior seems to be that cite-group-delimiter overrules year-suffix-delimiter. I agree that's not ideal, since year-suffix-delimiter is a subset of cite-group-delimiter and generally we have more specific rules taking precedence over more general rules. In terms of possible outputs, for example, if I want to have
(Doe 2008; Smith 2012) -- delimiter="; "
(Doe 2008, 2010) -- cite-group-delimiter=", "
(Doe 2008a,b) -- year-suffix-delimiter=","
that's not possible with current behavior. On the other hand, I don't see any output that's not possible with year-suffix-delimiter taking precedence.

@zepinglee
Copy link
Contributor Author

If I'm understanding the question correctly, it's a question about the hierarchy of delimiter rules for citations, which I agree are not covered by the specs. In other words, it's row 2 of the table above that's in question. Is that correct?

I've not fully understood row 1. The current spec says:

year-suffix-delimiter
Specifies the delimiter for year-suffixes. Defaults to the delimiter set on cs:layout in cs:citation.

The current behavior is that year-suffix-delimiter inherits the value of cite-group-delimiter unless explicitly set.

@zepinglee
Copy link
Contributor Author

I just find #36 (comment) and it's clear now.

@bwiernik
Copy link
Member

bwiernik commented Jul 15, 2022

Could you elaborate on what's clear? I'm not sure I understand. I agree with @adam3smith that year-suffix-delimiter should take precedence if both are set. Is that not the case?

It makes sense to me that if cite-group-delimiter is set but year-suffix-delimiter is not set, that year-suffix-delimiter should default to cite-group-delimiter rather than the overall layout delimiter. If that's the current behavior that you're seeing, we should fix that in the spec.

@zepinglee
Copy link
Contributor Author

Could you elaborate on what's clear? I'm not sure I understand. I agree with @adam3smith that year-suffix-delimiter should take precedence if both are set. Is that not the case?

It makes sense to me that if cite-group-delimiter is set but year-suffix-delimiter is not set, that year-suffix-delimiter should default to cite-group-delimiter rather than the overall layout delimiter. If that's the current behavior that you're seeing, we should fix that in the spec.

Sorry, I was messed up with a bunch of test cases. I agree that year-suffix-delimiter should take precedence over cite-group-delimiter.

Besides the description of cite-group-delimiter's default value may be mistaken.

https://docs.citationstyles.org/en/stable/specification.html#cite-grouping

cite-group-delimiter
Activates cite grouping and specifies the delimiter for cites within a cite group. Defaults to “, “.

@zepinglee
Copy link
Contributor Author

I check several case in test-suite and confirm the default values of both parameter in the current citeproc-js implementation are as described in spec: cite-group-delimiter defaults to ", " (sort_GroupedByAuthorstring.txt) and year-suffix-delimiter defaults to the delimiter in citation > layout (magic_ImplicitYearSuffixDelimiter.txt). The current behavior of year suffixes' delimiter can be summarized: if cite-group-delimiter is explicitly set, it takes precedence over year-suffix-delimiter; Otherwise year-suffix-delimiter or its default value is used. IMHO it's a strange behavior.

@bwiernik
Copy link
Member

Yeah, that doesn't seem correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants