On 23 Aug 2014, at 4:49 am, Sean Allred <[log in to unmask]> wrote:

> And I don't mean to advocate that these objects should be able to have
> many (9+) mandatory arguments; I'm far more concerned with the
> homelessness for optional ones.

I think after Frank’s experiments with sectioning, it became apparent that this was a major stumbling block. When a chapter heading can have

1. title
2. toc title
3. header title
4. label
5. unnumbered flag
6. author
7. epigraph
…

it no longer makes sense to require mandatory arguments. On the other hand I do see Joseph’s point that when you have just one or two actually mandatory arguments that writing the following is a bit ugly:

   \UseInstance{crossref}{latex2e}{ label = #1 }% only one mandatory argument

* * *

A model that I think has worked quite well in the LaTeX world is how BibTeX has a notion of “mandatory” and “optional” fields for bibliography references.

Perhaps we could supplement the current xtemplate interface with a keyval-type-argument (one only per interface, of course), in which the optional/mandatory nature of each keyval item within is specified by the document design (and some may well be always mandatory).

So according to the situation you could have either

    \UseInstance{…}{…}{arg one}{arg two}{arg three}

or

    \UseInstance{…}{…}{ arg-one=… , arg-two=…, arg-three=… }

or even a combination of the two:

    \UseInstance{…}{…}{arg one}{ arg-two=…, arg-three=… }

Any thoughts?

Will