# Dropping cs:substitute?

**URL:** <https://discourse.citationstyles.org/t/dropping-cs-substitute/697>\
**Category:** CSL Development\
**Created:** [July 25, 2009, 11:27pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697 "2009-07-25T23:27:49Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [July 25, 2009, 11:27pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/1 "2009-07-25T23:27:49Z")

</div>

In part as a result of earlier comments from Andrea about his  
implementation, it occurs to me we could drop the substitute element  
in favor of the generic cs:choose IF we agree on one simple rule: a  
variable may only print once?

The result would be more consistent and simpler.

Is this worth considering? Any arguments against?

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:** [July 26, 2009, 2:17am UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/2 "2009-07-26T02:17:36Z")

</div>

> In part as a result of earlier comments from Andrea about his  
> implementation, it occurs to me we could drop the substitute element  
> in favor of the generic cs:choose IF we agree on one simple rule: a  
> variable may only print once?
> 
> The result would be more consistent and simpler.
> 
> Is this worth considering? Any arguments against?

> guess what I’m wanting to ask next is … whether the ability to  
> print variables twice, if the first one has no names element in its  
> ancestry, is definitely necessary?

Such, such were the joys.

[http://groups.google.com/group/zotero-dev/browse\_thread/thread/ef62506f54fd66de#](http://groups.google.com/group/zotero-dev/browse_thread/thread/ef62506f54fd66de#)

🙂

In citeproc-js, I’ve already adopted one-time-only suppression as a  
general principle, regardless of where the first rendering element is  
located. This general suppression behavior was the topic of an  
exchange with Simon a couple of weeks ago, in connection with Zotero  
deployment. He noticed the difference in behavior, I asked for an  
example where multiple renderings are needed, and he provided one.

\*\*\*\*\* Simon \*\*\*\*\*

Well, one case is:

from APA style. I’m not sure if I can think of any cases where text  
variables need to be printed twice, but date variables certainly  
should be.

\*\*\*\*\* /Simon \*\*\*\*\*

I’ve kept the general block in place, but made date variables a  
general exception to it; choose statements and substitute work in  
exactly the same way (in fact they’re exactly the same under the  
hood).

At the moment, the only foundation for this design choice is my casual  
bystander’s assumption that it won’t hurt anything. It’s probably a  
good idea to let citeproc-js run interference for you on this one, and  
proceed with remangling all of the styles in the repository only if no  
problems arise in the wild.

---

<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:** [July 26, 2009, 8:01am UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/3 "2009-07-26T08:01:49Z")

</div>

I think label-type of styles usually print (text)-variables multiple  
times. E.g. a recent post on the forums:

In the bibliography we list: Hiatt:1996 [TAB] Hiatt, L. R. ... publication details.

> **[inline \[author:1990\] & Bibliographic reference](https://forums.zotero.org/discussion/7935/inline-author1990-bibliographic-reference/)**
>
> In the Office of Native Title we prepare reports using simple inline square brackets for simple references eg. at the end of a bockquote as \[Hiatt:1996, p.31\].

Don’t know how common those are.

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:** [July 26, 2009, 1:23pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/4 "2009-07-26T13:23:09Z")

</div>



---

<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:** [July 26, 2009, 1:23pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/5 "2009-07-26T13:23:37Z")

</div>

> > \*\*\*\*\* Simon \*\*\*\*\*  
> > from APA style. I’m not sure if I can think of any cases where text  
> > variables need to be printed twice, but date variables certainly  
> > should be.  
> > \*\*\*\*\* /Simon \*\*\*\*\*
> 
> I think label-type of styles usually print (text)-variables multiple  
> times. E.g. a recent post on the forums:
> 
> In the bibliography we list: Hiatt:1996 [TAB] Hiatt, L. R. ... publication details.
> 
> [inline [author:1990] & Bibliographic reference - Zotero Forums](http://forums.zotero.org/discussion/7935/inline-author1990-bibliographic-reference/)
> 
> Don’t know how common those are.

Fun one. Is this possible even with the current setup?

I tried to answer that question myself, but looking at my (slightly  
dated) copy of the CSL spec, I can’t actually find any mention of the  
render-only-once behaviour that people refer to in connection with the  
substitute element. I implemented it in citeproc-js on the basis of  
comments made in mail threads here and on zotero-dev, but I’ve never  
seen a full explanation of how it’s supposed to work.

Is there any detailed and clear documentation around on how the names  
and substitute elements are meant to suppress subsequent renderings of  
a variable? I’m genuinely curious.

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:** [July 27, 2009, 4:36pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/6 "2009-07-27T16:36:04Z")

</div>

…

> Am traveling, but once I return (tonight), I’ll put together an xslt to  
> incorporate all the changes I’m suggesting.

I’ve checked in the start of this as csl/scripts/update.xsl.

---

<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:** [July 27, 2009, 4:37pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/7 "2009-07-27T16:37:29Z")

</div>

No.

But basically, if a variable is substituted, it can’t be printed again.

The idea I’m floating here would make that explicit, and general (with  
possibly an exception for dates).

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:** [July 27, 2009, 4:47pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/8 "2009-07-27T16:47:38Z")

</div>

With this change, will it still be possible to localize some of these  
options/attributes? E.g. Frank has an example:

[http://bitbucket.org/fbennett/citeproc-js/src/29073b81ff8a/locale/locales-en-US.xmlOn](http://bitbucket.org/fbennett/citeproc-js/src/29073b81ff8a/locale/locales-en-US.xmlOn) Mon, Jul 27, 2009 at 6:36 PM, Bruce D’Arcus\<@Bruce\_D\_Arcus1\> wrote:

> Result example fragment is:
> 
> …

* * *
 ---

I could imagine something like

* * *
 ---

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:** [July 27, 2009, 4:48pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/9 "2009-07-27T16:48:21Z")

</div>

…

> The idea I’m floating here would make that explicit, and general (with  
> possibly an exception for dates).

I guess thinking about this more, I don’t think it’s a great idea to  
remove it. The existing syntax is nice-and-tight, and I think we’re  
fine if we just document the damned thing. The same applies to  
cs:group, which is also a kind of PITA implementation wise, but still  
useful.

Bruce

---

<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:** [July 27, 2009, 4:50pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/10 "2009-07-27T16:50:50Z")

</div>

Yeah, I forgot about this, but it’s something to consider.

But this also raises another issue: right now, there are no global  
parameters. We might need to allow them, so that one could do:

... or ? 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:** [July 27, 2009, 5:16pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/11 "2009-07-27T17:16:40Z")

</div>

> > > > \*\*\*\*\* Simon \*\*\*\*\*  
> > > > from APA style. I’m not sure if I can think of any cases where text  
> > > > variables need to be printed twice, but date variables certainly  
> > > > should be.  
> > > > \*\*\*\*\* /Simon \*\*\*\*\*
> > > 
> > > I think label-type of styles usually print (text)-variables multiple  
> > > times. E.g. a recent post on the forums:
> > > 
> > > In the bibliography we list: Hiatt:1996 [TAB] Hiatt, L. R. ... publication details.
> > > 
> > > [inline [author:1990] & Bibliographic reference - Zotero Forums](http://forums.zotero.org/discussion/7935/inline-author1990-bibliographic-reference/)
> > > 
> > > Don’t know how common those are.
> > 
> > Fun one. Is this possible even with the current setup?
> > 
> > I tried to answer that question myself, but looking at my (slightly  
> > dated) copy of the CSL spec, I can’t actually find any mention of the  
> > render-only-once behaviour that people refer to in connection with the  
> > substitute element. I implemented it in citeproc-js on the basis of  
> > comments made in mail threads here and on zotero-dev, but I’ve never  
> > seen a full explanation of how it’s supposed to work.
> > 
> > Is there any detailed and clear documentation around on how the names  
> > and substitute elements are meant to suppress subsequent renderings of  
> > a variable?
> 
> No.
> 
> But basically, if a variable is substituted, it can’t be printed again.

Got that much.

> The idea I’m floating here would make that explicit, and general (with  
> possibly an exception for dates).

Unless I’m missing something, Rintze’s example above won’t compute  
with the current setup, and won’t work in the new processor either.  
Maybe there’s a case for a no-suppress attribute?

---

<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:** [July 27, 2009, 5:18pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/12 "2009-07-27T17:18:42Z")

</div>

> …
> 
> > The idea I’m floating here would make that explicit, and general (with  
> > possibly an exception for dates).
> 
> I guess thinking about this more, I don’t think it’s a great idea to  
> remove it. The existing syntax is nice-and-tight, and I think we’re  
> fine if we just document the damned thing. The same applies to  
> cs:group, which is also a kind of PITA implementation wise, but still  
> useful.

No complaints here.

---

<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:** [July 27, 2009, 5:18pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/13 "2009-07-27T17:18:47Z")

</div>

Yes, global parameters would be nice. I guess global options specified  
in would be overruled by the same options set in   
and ?

To keep the style and locale files similar in layout, perhaps we could use this:On Mon, Jul 27, 2009 at 6:50 PM, Bruce D’Arcus\<@Bruce\_D\_Arcus1\> wrote:

> > 
> 
> Yeah, I forgot about this, but it’s something to consider.
> 
> But this also raises another issue: right now, there are no global  
> parameters. We might need to allow them, so that one could do:
> 
> ... or ?

* * *
 n.d. ---

The locale element would just contain the bare bones structure of a  
complete CSL style. I propose using both and , so we  
can use the same layout in a style that specifies overriding  
locale-terms/options, e.g:

* * *
 ... n.d. ... ... ---

Rintze

---

<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:** [July 27, 2009, 5:26pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/14 "2009-07-27T17:26:45Z")

</div>

I don’t want to push this thread too much off-topic, but that example  
also has a problem with second-field-align (i.e. it needs  
third-field-align, or arbitrary-field-align). Unless the current  
second-field-align would consider a group a single field, e.g.:

 first author year of publication all names

But full support for these label-type styles will probably require  
more changes. Maybe something for CSL 1.1 :).

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:** [July 27, 2009, 5:29pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/15 "2009-07-27T17:29:34Z")

</div>

> Unless I’m missing something, Rintze’s example above won’t compute  
> with the current setup, and won’t work in the new processor either.

True, but I’m fine with that. We’re not going to make 99% of styles  
difficult to support one, odd, style.

> Maybe there’s a case for a no-suppress attribute?

That might be an option to consider.

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:** [July 27, 2009, 5:32pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/16 "2009-07-27T17:32:03Z")

</div>

> > Unless I’m missing something, Rintze’s example above won’t compute  
> > with the current setup, and won’t work in the new processor either.  
> > Maybe there’s a case for a no-suppress attribute?
> 
> I don’t want to push this thread too much off-topic, but that example  
> also has a problem with second-field-align (i.e. it needs  
> third-field-align, or arbitrary-field-align). Unless the current  
> second-field-align would consider a group a single field, e.g.:

In citeproc-js, groups are indeed treated as a single “field”.  
There’s no other way to handle it (at least while remaining sane).

Bruce has suggested in the forums that these complex formatting  
options be replaced with class tags on groups, with some standard  
bundle of styling names. That seems like a really (really) good idea.  
Things like second-field-align are very difficult to define and  
control.

---

<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:** [July 27, 2009, 5:33pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/17 "2009-07-27T17:33:29Z")

</div>

> > Unless I’m missing something, Rintze’s example above won’t compute  
> > with the current setup, and won’t work in the new processor either.
> 
> True, but I’m fine with that. We’re not going to make 99% of styles  
> difficult to support one, odd, style.

Very fair.

> > Maybe there’s a case for a no-suppress attribute?
> 
> That might be an option to consider.

(Just to avoid misunderstanding – I’d _not_ be in a rush for that one. 🙂

---

<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:** [July 27, 2009, 5:41pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/18 "2009-07-27T17:41:33Z")

</div>

Uhmz. After taking a second look it seems better to keep out  
of , because terms can only be specified within , so  
that would make:On Mon, Jul 27, 2009 at 7:18 PM, Rintze Zelle\<@Rintze\_Zelle\> wrote:

> To keep the style and locale files similar in layout, perhaps we could use this:
> 
> * * *
> n.d. ---

* * *
 n.d. ---

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:** [July 27, 2009, 9:19pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/19 "2009-07-27T21:19:14Z")

</div>



---

<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:** [July 27, 2009, 9:22pm UTC](https://discourse.citationstyles.org/t/dropping-cs-substitute/697/20 "2009-07-27T21:22:46Z")

</div>



[Next page](https://discourse.citationstyles.org/t/dropping-cs-substitute/697.md?page=2)
