Counting authors

Well, so long as the sorting rules can be a simple macro call like …

… then that’s fine.

On what the macro should look like, I confess I hadn’t thought that
count-min/max approach would be anything like as complex as your
example. What about:

Does that not work?

If it does, is there any reason not to implement this?

Bruce

Available time, mostly. It’s more complicated than it looks on the
page. Are the counts of individual variables or totals?

Totals.

If the former, is it okay to forego totals by design (seems safe, but you
never know). If the count is of individual variables, are the counts
expected to work in the normal way with match=“any|none|all”?

Yes.

If so, what happens if there is an item with one author and two editors in
the example above (any|none|all doesn’t permit control over sequence
and priority of evaluation – you would get that out of the box with
form=“count” just by relying on substitution and counting the names
that would be printed).

count == 3

A problem you would have with support is that errors in the CSL code
that are not obvious to a designer coming to the new syntax for the
first time might produce results that are hard to connect to the
error. You may get lots of support queries. Are you comfortable with
that?

I’m not comfortable with this use case at all, but I’d like to solve it :wink:

It’s late here, but if my sleepy reasoning doesn’t deceive me,
addressing the use case and retaining the simple syntax in the example
above, you would need to return the count of the first non-nil
variable, and invalidate match=“none|any|all” for conditional elements
that contain a count-min/max (or allow them, but offer first-non-nil
sequential checking as the default, which would be more flexible, but
would also be confusing).

Correct.

Subject to all of that, it would work. You’d need to provide a spec
explaining how all of the possible option combinations should be
handled. It would be nice to have it expressed as a set of tests.

I’m curious so I might as well ask, what is your objection to form=“count”?

I don’t have any particular objection to it; was just trying to
clarify the issues.

Your point is that the counting folds in the substitution logic, such
that we’d avoid the potential problems you note above (that it’s a
little awkward to have to essentially duplicate substitution logic
across different macros)?

That’s a reasonable point.

Andrea, any thoughts on this?

Bruce

So here’s the schema changes that I think we’d need to implement
Frank’s suggestion. Do I have this right? Any objections?

– csl.rnc (revision 894)
+++ csl.rnc (working copy)
@@ -297,7 +297,12 @@
delimiter,
attribute variable {
list { cs-names+ }

  • }
  • },
  • the starting position in a list of contributors

  • attribute start { xsd:integer }?,
  • the ending position in a list of contributors

  • attribute end { xsd:integer }?+
    names = element cs:names { names-attributes, ((name, et-al?) &
    name-label*), substitute? }

Short version of “names” element, without children, allowed in

@@ -308,8 +313,9 @@
   ## Indicates long (first name + last name, for Western names) or short
   ## (last name only, for Western names) form of name. Default is long
  •  ## form
    
  •  attribute form { "long" | "short" }?,
    
  •  ## form. The "count" form is used to return the count of the contributor
    
  •  ## list, and may be used in special sorting routines.
    
  •  attribute form { "long" | "short" | "count" }?,
    
     ## Controls appearance of "and"/"&". To disable, do not specify.
     attribute and { "text" | "symbol" }?,

So here’s the schema changes that I think we’d need to implement
Frank’s suggestion. Do I have this right? Any objections?

– csl.rnc (revision 894)
+++ csl.rnc (working copy)
@@ -297,7 +297,12 @@
delimiter,
attribute variable {
list { cs-names+ }

  • }
  • },

  • the starting position in a list of contributors

  • attribute start { xsd:integer }?,

  • the ending position in a list of contributors

  • attribute end { xsd:integer }?

  • names = element cs:names { names-attributes, ((name, et-al?) &
    name-label*), substitute? }

    Short version of “names” element, without children, allowed in

@@ -308,8 +313,9 @@
  ## Indicates long (first name + last name, for Western names) or short
  ## (last name only, for Western names) form of name. Default is long
  •  ## form
    
  •  attribute form { "long" | "short" }?,
    
  •  ## form. The "count" form is used to return the count of the contributor
    
  •  ## list, and may be used in special sorting routines.
    
  •  attribute form { "long" | "short" | "count" }?,
    
    ## Controls appearance of "and"/"&". To disable, do not specify.
    attribute and { "text" | "symbol" }?,
    

I think maybe (I really should be asleep now – and actually might
be) AGU support can be done without the start/end attributes. I ran
into some debugging snags today, but things seem to be working again,
and I’ll see tomorrow if it actually does work to wake up et-al-min
within the sort.

There’s one other item that I just realized; with normal behaviour,
names only render once in a citation or bib entry, so without extra
effort, an attempt to render it in printed text would yield something
like Smith 0, rather than Smith 1. So maybe the comment should be a
little more restrictive, like “## list, for use in special sorting
routines.”

And now – good night!

Frank