Dear all

I have worked towards a revision of our LaTeX argument inset (bug 6753), and 
I've come to a state where things work, but I need some help with polishing, 
testing and finishing up the feature.

I've created a private repo (should be readable to all and writable to devs), 
and pushed what I have into a branch features/latexargs:
http://git.lyx.org/?p=developers/spitz/lyx.git;a=commitdiff;h=2e69c66195544ee06e2b286f84fdfb6a2515a36d

The Argument inset now has a numeric ID (e.g. "\begin_inset Argument 1"), and 
the layouts specify its details, such as

* gui string (appears in the menu and on the inset button)
* Menu accelerator
* tooltip (for the inset)
* type (mandatory/optional)
* dependency on other arguments (as in \command[][this requires the previous 
optional to be output]{})
* custom delimiters (instead of "[...]" or "{...}")


We feature now:

* Random order of optional and required arguments. So commands such as  
  \biling[short1]{long1}[short2]{long2}
can finally be supported

* Random insertion order of argument insets in LyX wrt the respective LaTeX 
command (so if you insert "Short Title (Header)" from the menu for a memoir 
section, it will be output as second optional argument notwithstanding the 
order of the argument insets in LyX). 

* The menu now always offers all (unused) arguments and has proper entries 
(instead of the general and often misleading "Short Title" we have until now).

* Optional and required arguments are implemented to InsetLayout (#8289).

* Argument delimiters can be customized. This allows support for things such 
as beamer's overlay arguments (<...>) or the special Sweave arguments.


TODO:

* lyx2lyx reversion routine (see comment there)
* layout2layout: bump the layout format and convert the old OptionalArgs and 
RequiredArgs items to the new scheme.
* tex2lyx changes need to be audited
* the code itself as needs a thorough review as well

The most "ugly" thing is that we cannot properly convert to the new scheme 
with lyx2lyx only. Since lyx2lyx does not know how many optional and required 
args a layout has (and since optional arguments are, well, optional), we need 
some conversion code in InsetArgument itself. Not nice, but the only solution 
I came across. Perhaps someone has a better idea.


I would appreciate if you could checkout this code, test, and help finishing, 
especially in the areas I am not very much at home (lyx2lyx, tex2lyx. 
layout2layout).

You can just push your enhancements into my repo.

Thanks
Jürgen

Reply via email to