LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced 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
Subject:
From:
Joseph Wright <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Mon, 31 Aug 2009 20:50:22 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (52 lines)
Will Robertson wrote:
> On 28/08/2009, at 10:43 PM, Lars Hellström wrote:
> 
>> Well, why use a syntax that needs a separate parser at all?
> 
> [...]
> 
>>  \DeclareTemplate{caption}{lesssimple}{4}{
>>     \Variable {above-skip}           {\l_caption_above_skip}
>>     \Variable {below-skip}           {\l_caption_below_skip}
>>     \Function {number-format}     {2}{\caption_number_format:nn}
>>     \Function {nonumber-format}   {2}{\caption_nonumber_format:nn}
>>     \Function {single-line-format}{1}{\caption_single_line_format:n}
>>     \Function {caption-font}      {0}{\caption_set_font:}
>>     \Instance {caption-hj-setup} {hj}{\caption_hj_instance}
>>  }
>>
>> The \Variable, \Function, and \Instance commands above need not exist
>> in general; they can be locally redefined "within the parameter
>> declarations". (Philologically it is not unheard of in other languages
>> to have special sets of commands available within declaration blocks.)
>> Besides avoiding the overhead of a special parser, the above also has
>> the advantage of being more robust by virtue of simplicity and
>> adherence to the general language syntax and semantics, which tend to
>> have their corner cases better worked out than something invented for
>> a special purpose.
> 
> Bonus points for the word "philologically" :)
> I quite like this approach.
> 
> I'm going to be a bit quiet over the next little while, but after that I
> may try to put together a "template-alt-alt" along these lines to see
> how things turn out.
> 
> Thanks,
> Will
> 

Hello Will,

I'd point out that most of template-alt was about trying to understand
the code in template (which is not easy to read at all). I'd hope that
I've done enough with template-alt to enable discussion of the ideas
without needing too much more coding until a clear idea emerges of what
is wanted. (I'd add that at the moment I prefer the idea of using a
keyval approach as I like the "symmetry" of both defining and using in
the same style. But if it turns out this is not the best approach, then
I don't see too much difficultly in writing the code to do what Lars
suggests.)
-- 
Joseph Wright

ATOM RSS1 RSS2