Dropping cs:substitute?

Since weā€™re working on 1.1 now, I thought Iā€™d resurrect this, though itā€™s obviously been more than a decade since we discussed it!

Is there merit to this in 2020, and least to clarify the spec?

@Denis_Maier @bwiernik

What exactly? This thread discussed removing substitute, universal suppression of repeated variables, style attributes on groups, second field align, and other things.

Itā€™s hard to follow the discussion because the switch to Discourse has mangled the style coding.

For the question of removing substituteā€”no, the compact syntax and inheritance of name formatting parameters is incredibly useful, and most CSL styles are written with it. It would be a monumental task to remove substitute, and I think it has a lot of good coding value.

For the question of general suppression of repeated elements, that seems potentially reasonable. That would be a backwards compatible change I thinkā€”most styles have been written to do this suppression manually, those would still work I think? If a variable is suppressed by substitute, it still tests as non-empty in if, so existing styles would still work as expected, but future styles and revisions could be written assuming that a variable is only rendered once. The one case that comes to mind where a variable is often printed twice is dates, where it is common, for example, to print the year early in a reference, then include the month and day later in the reference for some types. Dates should be an exception to general suppression (an alternative would be to suppress date parts individually, but that seems as much extra work on processorsā€™ part and more difficult for users and style coders).

I think that the label style discussion is a bit misleading here. ā€œHiattā€ shouldnā€™t be understood as an author but as citation-label. These cases would best be handled by adding a citation-label syntax to styles. Variables included in the construction of citation-label would not have any suppression applied to them.

I donā€™t know enough about specifics of alignment Needs to weigh in there at the moment.

Sorry; I only meant about the main subject; dropping substitute.

And as I said, at minimum, the idea could help clarify the spec.

I donā€™t think we should drop substitute. We could consider adding general ā€œonly-render-onceā€ logic.

3 Likes

Lgtm. But we should add an escaping mechanism. force="true" or similar.

1 Like

Or an attribute to be set on the first rendering 9f a variable suppress-next="false"

I think the force=ā€œtrueā€ syntax is clearer? But what is an actual use case for one of these?

And the behavior would be default?

Does the form + related issue complicate this?

Hmm, yeah, with main/sub as forms that does create an issue. Suppression would need to not apply when form=ā€œsubā€ is used. But that becomes messy when, for example a title macro is substituted for an author in substitute. If the macro includes main and sub title, then the sub title should be suppressed later.

related I donā€™t think is much of a problem. The spec should state that suppression only occurs within each context (base, original, reviewed, etc.).

Universal once-only suppression would require at least two exceptions then:

  1. dates
  2. Some resolution to the sub titles

Starting to seem like more trouble than itā€™s worth

I was thinking about label style citation styles. But probably the same result can be achieved with citation-label as well, if variables used in a label are exempted from general suppression.

1 Like

How should short forms be handled? Iā€™d say they should not be suppressed.

Maybe just add a new condition If seen="title form=ā€œlongā€ match=ā€œnoneā€`?

Maybe just add a new condition if seen="title" form="ong" match="none"?

If processors automatically suppress variables from showing a second time, there would need to be an attribute to override that explicitly by users or automatically for relevant cases. It might work

  1. Date variables are not automatically supppressed.
  2. title variable with form="main" or form="sub" are only suppressed if that form, full, or short, has appeared previously (essentially, treat title-main and title-sub as separate variables)

How should short forms be handled? Iā€™d say they should not be suppressed.

Long and short forms are rarely rendered together both in the same citation/bibliography, so Iā€™d say they should be suppressed.

There are styles that, on position="first", indicate the short title after the full title in parentheses. So here we really need something like force="true".

ā€¦ or styles that append the short title in square brackets at the end of bibliography entries.

For universal once-only suppression: there are cases of author-year styles which require the author year string as used in the in-text citations to be prepended to the bibliography entry. Thatā€™s a systematic repetition of rendered variables.

For universal once-only suppression: there are cases of author-year styles which require the author year string as used in the in-text citations to be prepended to the bibliography entry. Thatā€™s a systematic repetition of rendered variables.

Thatā€™s citation-label.

1 Like

Iā€™m not following. Can you give an example?

cs:substitute does three things:

  • It provides a convenient way to inherit settings on names nodes.
  • It suppresses output of the variable elsewhere.
  • It does not render all its children: it stops as soon as one of the child nodes manages to render.

These are separate points. Thereā€™s no advantage I can see to removing the first one: itā€™s a convenience with obvious usefulness. Nor the third, which I think is required.

As to the second, I think itā€™s better to think of a number of other questions

  1. As a general matter, should the working assumption anyway be that variables are printed only once? Or should that be confined to substitute variables?
  2. Should there be any general exceptions to that (e.g. for dates and short forms)?
  3. Should there be a mechanism for the style-writer to alter that behaviour?

I donā€™t have an answer to 1 or 2: the correct answer is to do whatever will be most generally useful. Itā€™s surely clear, however, that the answer to (3) is ā€œyesā€. What, then, are the options:

(a) A syntax to force printing of a variable even if it has already been output. Two mechanisms spring to mind:

  • A force="true" attribute that can be set on anything that outputs a variable (cs:names, cs:number, cs:text, cs:date) which will guarantee that it is printed even if it otherwise wouldnā€™t be.

(b) A syntax to unsuppress a variable, which could be set when it is output and would prevent it from being suppressed (e.g. `suppress=ā€œneverā€).

Ā© A test which could easily be applied to any variable (e.g. already-output).

Probably (a) or (b) would be easier to implement than Ā©, which would require one to track both suppression (through substitute) and outputting (in other contexts).

One could have something like:

  • A variable will not be printed more than once unless force="true" is set.
  • The default for both date nodes and short-forms of text will be force="true". The default for other nodes is force="false"
  • Either of those defaults can, however, be changed in the style.

The ā€œsuppressionā€ behaviour of substitute is then no longer needed (itā€™s just ā€œbusiness as usualā€), but the inheritance behaviour and early termination are retained.

2 Likes