LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Forum View

Use Proportional Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Joseph Wright <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Wed, 2 Sep 2009 09:24:09 +0100
text/plain (36 lines)
Joseph Wright wrote:
>   above-skip    .skip_set:Nn    = \caption_above_skip       {0pt}    ,
>   number-format .func_2_args:Nn = \caption_number_format:nn {#1~#2:~},

Thinking about this some more, I feel I've missed a few important points:

- templates always require the keys given to have values, so
.value_required:/.value_forbidden: are not relevant.

- multiple choices for templates should really be calls to instances of
other templates. For example, if I have a key "alignment" which I expect
to take values left, centre, center and right, then I should probably
implement it as a call to look for an appropriately-named instance of
some more basic template. So multiple choice keys are probably not that
important for template.

So taking Lars point about local definitions, and Frank's about self
documentation, how about taking the current template approach and making
it slightly more readable

  above-skip    = \length     \caption_above_skip       {0pt}    ,
  number-format = \function 2 \caption_number_format:nn {#1~#2:~},

where we don't even need to define \skip, \function, etc., but just use
the fact that they are picked up as single tokens by TeX. I think this
is quite "self documenting" and shows the logic of what is being defined
quite well. I've assumed that my earlier point about not having any
optional arguments is agreed with here, but I'd hope that I've made a
good enough case.

(I should add that the l3keys approach is probably right for what it
does, as there keys can have different properties set and may need to be
 set up with more than item given for a particular key.)
Joseph Wright