# collapse question

**URL:** <https://discourse.citationstyles.org/t/collapse-question/548>\
**Category:** CSL Development\
**Created:** [March 2, 2009, 2:39pm UTC](https://discourse.citationstyles.org/t/collapse-question/548 "2009-03-02T14:39:41Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [March 2, 2009, 2:39pm UTC](https://discourse.citationstyles.org/t/collapse-question/548/1 "2009-03-02T14:39:41Z")

</div>

I have another question, about how collapsing should be done.  
specification says the following:

## “citation-number” collapses numeric citations from [1, 2, 3] to [1-3]

## “year” collapses authors from (Doe 2000, Doe 2001) to (Doe 2000,

## 2001)

## “year-suffix” collapses as “year”, but also collapses (Doe 2000a,

## Doe 2000b) to (Doe 2000a, b) (ignored if

## disambiguate-add-year-suffix is missing)

I’m wondering how should this collapse: (Doe 2000a, Doe 2000b, Doe 2001)

If a valid year-suffix implies year, then does this become: (Doe 2000a, b, 2001)

… or should it be handled in some other way?

It’s a rare case, I know, but if I deal with it on authority now, it  
will be out of the way.

@Bruce, thanks for the edit to the specification of groups, I think  
that puts it in context (although you never know, I do have a  
well-tapped but largely unexplored capacity for misunderstanding).

Frank

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [March 2, 2009, 6:35pm UTC](https://discourse.citationstyles.org/t/collapse-question/548/2 "2009-03-02T18:35:48Z")

</div>

> I have another question, about how collapsing should be done.  
> specification says the following:
> 
> ## “citation-number” collapses numeric citations from [1, 2, 3] to [1-3]
> 
> ## “year” collapses authors from (Doe 2000, Doe 2001) to (Doe 2000,
> 
> ## 2001)
> 
> ## “year-suffix” collapses as “year”, but also collapses (Doe 2000a,
> 
> ## Doe 2000b) to (Doe 2000a, b) (ignored if
> 
> ## disambiguate-add-year-suffix is missing)
> 
> I’m wondering how should this collapse: (Doe 2000a, Doe 2000b, Doe 2001)
> 
> If a valid year-suffix implies year, then does this become: (Doe 2000a, b, 2001)

That looks a little strange, but I think that would have to be  
correct; I see no other obvious way.

Does anyone have a different opinion?

BTW, this is exactly the sort of thing we ought to formalize in a test suite.

> It’s a rare case, I know, but if I deal with it on authority now, it  
> will be out of the way.
> 
> @Bruce, thanks for the edit to the specification of groups …

Sure thing.

Bruce

---

<div class="post-metadata">

**Author:** ![Andrea\_Rossato1](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@Andrea\_Rossato1](https://discourse.citationstyles.org/u/Andrea_Rossato1)\
**Post date:** [March 2, 2009, 7:07pm UTC](https://discourse.citationstyles.org/t/collapse-question/548/3 "2009-03-02T19:07:57Z")

</div>

Interesting… I didn’t think about this possibility. I would think  
that, in order to collapse to (Doe 2000a, b, 2001), you would need both  
the year _and_ year-suffix options set, though. Right?

In this case my implementation should only handle the first option,  
whichever it might be.

Andrea

---

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [March 2, 2009, 11:00pm UTC](https://discourse.citationstyles.org/t/collapse-question/548/4 "2009-03-02T23:00:12Z")

</div>

> > I have another question, about how collapsing should be done.  
> > specification says the following:
> > 
> > ## “citation-number” collapses numeric citations from [1, 2, 3] to [1-3]
> > 
> > ## “year” collapses authors from (Doe 2000, Doe 2001) to (Doe 2000,
> > 
> > ## 2001)
> > 
> > ## “year-suffix” collapses as “year”, but also collapses (Doe 2000a,
> > 
> > ## Doe 2000b) to (Doe 2000a, b) (ignored if
> > 
> > ## disambiguate-add-year-suffix is missing)
> > 
> > I’m wondering how should this collapse: (Doe 2000a, Doe 2000b, Doe 2001)
> > 
> > If a valid year-suffix implies year, then does this become: (Doe 2000a, b, 2001)
> 
> That looks a little strange, but I think that would have to be  
> correct; I see no other obvious way.
> 
> Does anyone have a different opinion?
> 
> BTW, this is exactly the sort of thing we ought to formalize in a test suite.

That’s a great idea. I’m at the point now where the engine is stable,  
and it’s just waiting for the definitions of the attributes. It’s  
quite a mountain to climb, and a full set of tests would hugely  
simplify the remaining work. As a newcomer to CSL, there are a lot of  
details that I don’t fully understand. I don’t mean to be a burden  
(obviously), but the questions and calls for explanation will keep  
coming.

I’ll work up a simple format for high level input/output tests that  
can be parsed easily by system XYZ, and written up with a minimum of  
typing. I can put it into citeproc-js, but maybe a better location  
would be the csl svn?

Frank

---

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [March 3, 2009, 10:25am UTC](https://discourse.citationstyles.org/t/collapse-question/548/5 "2009-03-03T10:25:02Z")

</div>

> > I’m wondering how should this collapse: (Doe 2000a, Doe 2000b, Doe 2001)
> > 
> > If a valid year-suffix implies year, then does this become: (Doe 2000a,  
> > b, 2001)
> 
> That looks a little strange, but I think that would have to be  
> correct; I see no other obvious way.
> 
> Does anyone have a different opinion?
> 
> BTW, this is exactly the sort of thing we ought to formalize in a test  
> suite.

A quick search with Google Scholar yielded these results (with queries like  
“1999a b 2000” and “1999a 1999b 2000”):  
(Alcock et al. 1999a,b, 2000)  
(Vander Zanden et al. 1999a,b, 2000)  
(Steudie, 2000a b; 2001)  
(Geller et al., 1998c,d, 2000a,b)  
(for reviews, see Pertwee, 2000b; 2001a,b, 2002; Piomelli  
et al., 2000).

So a slightly more robust test case might use different delimiters between  
the year-suffix-disambiguators (e.g. a comma between the a and the b) and  
between citations from different years (e.g. a semi-colon, or " ,"  
[space-comma]). I don’t know if this can already be described in CSL though.

Rintze

---

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [March 3, 2009, 10:57am UTC](https://discourse.citationstyles.org/t/collapse-question/548/6 "2009-03-03T10:57:53Z")

</div>

> > > I’m wondering how should this collapse: (Doe 2000a, Doe 2000b, Doe 2001)
> > > 
> > > If a valid year-suffix implies year, then does this become: (Doe 2000a,  
> > > b, 2001)
> > 
> > That looks a little strange, but I think that would have to be  
> > correct; I see no other obvious way.
> > 
> > Does anyone have a different opinion?
> > 
> > BTW, this is exactly the sort of thing we ought to formalize in a test  
> > suite.
> 
> A quick search with Google Scholar yielded these results (with queries like  
> “1999a b 2000” and “1999a 1999b 2000”):  
> (Alcock et al. 1999a,b, 2000)  
> (Vander Zanden et al. 1999a,b, 2000)  
> (Steudie, 2000a b; 2001)  
> (Geller et al., 1998c,d, 2000a,b)  
> (for reviews, see Pertwee, 2000b; 2001a,b, 2002; Piomelli  
> et al., 2000).
> 
> So a slightly more robust test case might use different delimiters between  
> the year-suffix-disambiguators (e.g. a comma between the a and the b) and  
> between citations from different years (e.g. a semi-colon, or " ,"  
> [space-comma]). I don’t know if this can already be described in CSL though.

Rintze,

It would be great if you could produce a test case or cases for this,  
when the archive is set up.

FB

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [March 3, 2009, 1:44pm UTC](https://discourse.citationstyles.org/t/collapse-question/548/7 "2009-03-03T13:44:41Z")

</div>

I believe I already added this variable (‘year-suffix’).

Bruce

---

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [March 3, 2009, 2:37pm UTC](https://discourse.citationstyles.org/t/collapse-question/548/8 "2009-03-03T14:37:18Z")

</div>

I noticed that update to the schema, but I don’t understand how to use the  
variable ‘year-suffix’ in CSL. At what point in the style (for instance APA)  
do you declare it?

Rintze

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [March 3, 2009, 2:41pm UTC](https://discourse.citationstyles.org/t/collapse-question/548/9 "2009-03-03T14:41:06Z")

</div>

It’d go after the year (in the macro), of course 😉

But AFAIK, it’s not yet implemented.

Bruce

---

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [March 3, 2009, 3:23pm UTC](https://discourse.citationstyles.org/t/collapse-question/548/10 "2009-03-03T15:23:05Z")

</div>

Uhm, okay. Is this (based on APA) then the supposed usage:

How do you then assign a value to the year-suffix variable (e.g. “,”)?

Rintze

---

<div class="post-metadata">

**Author:** ![Andrea\_Rossato1](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@Andrea\_Rossato1](https://discourse.citationstyles.org/u/Andrea_Rossato1)\
**Post date:** [March 3, 2009, 6:59pm UTC](https://discourse.citationstyles.org/t/collapse-question/548/11 "2009-03-03T18:59:52Z")

</div>

In my implementation that variable is automatically instantiated with  
the disambiguation suffix. That is to say, the above example, coupled  
with a

would held something like:

(Rossato, 2008aa; Rossato, 2008bb)

Is that right?

Andrea

---

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [March 3, 2009, 7:18pm UTC](https://discourse.citationstyles.org/t/collapse-question/548/12 "2009-03-03T19:18:38Z")

</div>

Scrap that last sentence from my previous email: I was confusing support for  
formatting of year-suffices (a problem that should indeed be solved with the  
addition of the variable “year-suffix”) with the ability to set custom  
delimiters for subsequent year-suffices (for which I wrote a ticket some  
time ago:  
[http://sourceforge.net/tracker2/index.php?func=detail&aid=2212677&group\_id=117435&atid=678021](http://sourceforge.net/tracker2/index.php?func=detail&aid=2212677&group_id=117435&atid=678021)).  
Do you have any ideas the latter could be implemented? E.g. in the example

(Steudie, 2000a b; 2001)

the delimiter between different years ("; “) is different from that between  
subsequent year-suffices (” "). To stress this point: I have just been  
toying with Zotero’s csledit.xul, and if you replace “” with “” in the APA style and remove all the commas in the  
style, you still get:

(Doe 1999a, b, 2000)

Rintze

---

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [March 4, 2009, 12:02am UTC](https://discourse.citationstyles.org/t/collapse-question/548/13 "2009-03-04T00:02:42Z")

</div>

> Scrap that last sentence from my previous email: I was confusing support for  
> formatting of year-suffices (a problem that should indeed be solved with the  
> addition of the variable “year-suffix”) with the ability to set custom  
> delimiters for subsequent year-suffices (for which I wrote a ticket some  
> time ago:  
> [http://sourceforge.net/tracker2/index.php?func=detail&aid=2212677&group\_id=117435&atid=678021](http://sourceforge.net/tracker2/index.php?func=detail&aid=2212677&group_id=117435&atid=678021)).  
> Do you have any ideas the latter could be implemented? E.g. in the example
> 
> (Steudie, 2000a b; 2001)
> 
> the delimiter between different years ("; “) is different from that between  
> subsequent year-suffices (” "). To stress this point: I have just been  
> toying with Zotero’s csledit.xul, and if you replace “” with “” in the APA style and remove all the commas in the  
> style, you still get:
> 
> (Doe 1999a, b, 2000)

Fun one! And an occasion for a mea culpa from me (to Bruce  
particularly) about the unseemly fuss I made over capitalization of  
terms. This requires very similar logic.

At first I also thought that this should be handled by a header  
option, but it’s simpler to tell the year-suffix itself to change the  
back-splice string when it’s the first item in the item cite that gets  
rendered. So something like …

… would do the trick. If the engine knows how to identify that a  
cite is not the first in a cluster to be rendered, and that an element  
is the first in the cite to produce rendered output, it can pick this  
up and do the right thing. Plus it would work with other cases  
requiring splice changes that might come down the pipe.

Frank

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [March 4, 2009, 1:08am UTC](https://discourse.citationstyles.org/t/collapse-question/548/14 "2009-03-04T01:08:42Z")

</div>

But that’s foreign to how CSL has been designed. Why not just build on  
the existing delimiter support?

Bruce

---

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [March 4, 2009, 1:55am UTC](https://discourse.citationstyles.org/t/collapse-question/548/15 "2009-03-04T01:55:08Z")

</div>

> > > Scrap that last sentence from my previous email: I was confusing support for  
> > > formatting of year-suffices (a problem that should indeed be solved with the  
> > > addition of the variable “year-suffix”) with the ability to set custom  
> > > delimiters for subsequent year-suffices (for which I wrote a ticket some  
> > > time ago:  
> > > [http://sourceforge.net/tracker2/index.php?func=detail&aid=2212677&group\_id=117435&atid=678021](http://sourceforge.net/tracker2/index.php?func=detail&aid=2212677&group_id=117435&atid=678021)).  
> > > Do you have any ideas the latter could be implemented? E.g. in the example
> > > 
> > > (Steudie, 2000a b; 2001)
> > > 
> > > the delimiter between different years ("; “) is different from that between  
> > > subsequent year-suffices (” "). To stress this point: I have just been  
> > > toying with Zotero’s csledit.xul, and if you replace “” with “” in the APA style and remove all the commas in the  
> > > style, you still get:
> > > 
> > > (Doe 1999a, b, 2000)
> > 
> > Fun one! And an occasion for a mea culpa from me (to Bruce  
> > particularly) about the unseemly fuss I made over capitalization of  
> > terms. This requires very similar logic.
> > 
> > At first I also thought that this should be handled by a header  
> > option, but it’s simpler to tell the year-suffix itself to change the  
> > back-splice string when it’s the first item in the item cite that gets  
> > rendered. So something like …
> > 
> > … would do the trick. If the engine knows how to identify that a  
> > cite is not the first in a cluster to be rendered, and that an element  
> > is the first in the cite to produce rendered output, it can pick this  
> > up and do the right thing. Plus it would work with other cases  
> > requiring splice changes that might come down the pipe.
> 
> But that’s foreign to how CSL has been designed. Why not just build on  
> the existing delimiter support?

Could do that too. I guess it’s unlikely that other doctoring of  
splices will be needed, and that would be more intuitive when writing  
CSL code.

Frank

---

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [March 4, 2009, 6:42am UTC](https://discourse.citationstyles.org/t/collapse-question/548/16 "2009-03-04T06:42:32Z")

</div>

I guess that should do the trick. The delimiter between subsequent years  
(e.g. the "; " in (Steudie, 2000a b; 2001)) can probably default to the same  
delimiter used to delimit grouped and non-collapsed citations (in this case  
(Doe, 2000; Joe 2001)), but that might be more of an implementation issue,  
although it could be documented in the schema. The list of examples I gave  
includes one exception from this rule:

(for reviews, see Pertwee, 2000b; 2001a,b, 2002; Piomelli et al., 2000)

where I would expect “2001a,b; 2002;” instead of “2001a,b, 2002;”. Unless  
some of the major style guides mention something to this effect, I would  
write this one of as a fluke (it might very well be an error, and it doesn’t  
make a lot of sense).

Rintze
