Configurable range delimiters #56

Open
fbennett opened this Issue Jun 23, 2011 · 14 comments

Comments

Projects
None yet
2 participants
Member

fbennett commented Jun 23, 2011

This issue has been raised in a thread on the Zotero forums.

Currently, based on discussions on xbiblio-devel, citeproc-js and the test suite assume en-dash as the delimiter for collapsed ranges. This applies to page numbers, and also to citation numbers and year-suffixes.

However, according to the thread linked above, Russian orthography apparently permits only em-dash (not en-dash). To support that use case (Russian support), some method of configuring the range delimiter seems to be needed.

A simple approach would be to allow the range-delimiter attribute on cs:layout under cs:citation.

(This ticket has a sister ticket in the documentation tracker, here.)

Owner

rmzelle commented Jun 23, 2011

If there is sufficient evidence that the range delimiter is mostly locale-dependent, we could make it an attribute on cs:style-options in the locale files.

Member

fbennett commented Jun 23, 2011

It's just a string, with no change to dynamic behavior, so setting it as a term would have the same effect, no? Something like:

  <term name="range-delimiter">–</term>

Or since there are two separate cases that might occur in the same style, maybe:

  <term name="page-range-delimiter">–</term>
  <term name="citation-range-delimiter">–</term>
Owner

rmzelle commented Jun 23, 2011

Yes, a term is better.

Owner

rmzelle commented Jun 24, 2011

What are all the ranges currently available in CSL? Just those for the "page", "citation-number" and (implicit) "year-suffix" variables? Are there any other hyphen-type delimiters that should be customizable or automatically reformatted (e.g. those in locator content)? What about the "initialize-with-hyphen" attribute?

Member

fbennett commented Jun 25, 2011

initialize-with-hyphen should be safe with plain vanilla hyphen. For ranges, a scan of the cieproc-js source suggests this is the full list of suspects:

  • Dates (configurable via range-delimiter attribute on cs:date-part, defaults to U+2013)
  • Citation ranges (either citation-number and year-suffix depending on the style, currently normalized to U+2013)
  • Ranges inside the item page variable (normalized to U+2013, but only when page-range-format is set)

Currently citeproc-js doesn't touch the user-supplied locator string. It doesn't seem safe to make assumptions about user intentions there, so it's just passed through verbatim.

Owner

rmzelle commented Jun 25, 2011

So I guess the question is whether we need separate terms for the citation-number, year-suffix and page range delimiters? E.g. we could have one term, "range-delimiter", or three, "citation-number-range-delimiter", "year-suffix-range-delimiter", and "page-range-delimiter".

Member

fbennett commented Jun 29, 2011

Or four:

  • default-range-delimiter
  • citation-number-range-delimiter
  • year-suffix-range-delimiter
  • page-range-delimiter
Owner

rmzelle commented Nov 15, 2011

Another option is to allow the "range-delimiter" attribute on cs:text and cs:number, e.g.:

<text variable="year-suffix" range-delimiter="-"/>

This won't localize as well as a term, but would be far more consistent in the way we usually deal with delimiters.

Owner

rmzelle commented Mar 3, 2012

@fbennett, do you think introducing a "page-range-delimiter" term suffices for now? (now = CSL 1.0.1)

Member

fbennett commented Mar 3, 2012

Hard to say. It's the only thing people have piped up to ask for so far, so limited the extension to that one attribute should be good enough. Once we have reliable painless and smooth backward-compatible upgrade procedures in place, we can always extend in CSL 1.0.2 ...

Owner

rmzelle commented Mar 3, 2012

Yeah, there are some calls for a quick CSL 1.0.1 release, so in a case like this where we can easily extend the options later on we probably should limit ourselves to what we know is desired at this point in time (i.e. just the page-range-delimiter term (not an attribute!)).

Member

fbennett commented Mar 3, 2012

Oh, that's right. The perils of complexity. A term is indeed sufficient for this.

Owner

rmzelle commented Mar 11, 2012

And just to make sure: the trunk spec currently reads

The "locator" variable is always rendered with an en-dash replacing any hyphens. For the "page" variable, this replacement is only performed if the page-range-format attribute is set on cs:style (see Page Ranges).

I guess we can just remove this sentence, and write something to the effect that the page-range-delimiter is defined by a term?

Owner

rmzelle commented Mar 13, 2012

Reflecting on my previous comment: a term doesn't gives us a way to toggle the behavior (since the term will always be present in the locale files), so we might want to keep delimiter-replacement dependent on the use of the page-range-format attribute.

I added the term to the schema and spec:
schema: 58ac031
spec: citation-style-language/documentation@042921e

fbennett referenced this issue in citation-style-language/documentation Jun 29, 2011

Closed

Include (default) character to be used as range delimiter in specification #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment