Andre Poenitz wrote:

On Fri, May 06, 2005 at 10:12:50AM +0100, Paul Smith wrote:


where the 8 indicates you will have 8 editable entries. In the macro
definition box, insert the left brace, the 2x4 array (with right
justification) and the right null delimiter. Then (still in the macro
definition box) switch into each cell and enter an argument index in the
form #1, #2, ..., #8. When you invoke the macro with \myArray inside a
math environment, you'll get editable cells in which to enter the eight
arguments. The limit is nine (the indexing must be '#' followed by a
single digit, and #0 won't fly).


It would be even more interesting to have a macro able to accept a
variable number of entries, which would be chosen by the user. Is my
idea feasible?



Not really, first of all it's hard to implement and secondly there's a
hard maximum of 9 macro arguments in TeX, so this will be quite some
hackery to create 5x5 tables this way.


There is a way around this, if tex seems too limiting.
A lyx macro doesn't have to have a corresponding tex macro.
Lyx could simply expand "lyx-macros" itself when exporting
tex, instead of outputting a tex macro.  That'd allow more than
10 arguments, and avoid any other tex-specific limitation as well.
I don't know if it is worth the trouble though.

Helge Hafting









Reply via email to