Sven Schreiber wrote:

> The first design issue is: should it be a global default or
> document-specific? I guess the latter would require changing the lyx
> file format, so I would stick to global -- less convenient for the user,
> but more realistic in terms of implementability, and good enough IMHO.

I don't think a per-document setting makes sense. If I need several similar
tables in a document it is usually faster to copy an existing table.

> So as you said, that implies a new lyxrc part; let's call it
> \tabular_style_border. I would suggest that a style consists of a name
> and of a definition (pair of strings).
> 
> The syntax for the definition: What about denominating the borders by
> 'h' and 'v' for horizontal and vertical, and indexing in python style,
> i.e. 0 is the first possible border (before the first row or column), -1
> is the last one (after the last row or column), and a colon (:) is for
> defining ranges. To stick with the python convention, the range would
> not include the upper bound. If no upper or lower bound is given, every
> border after or before is included. If some border is indexed several
> times, that means several drawn lines.

Note that LyX does currently not support more than two lines.

> Examples:
> 'h1,h1,v1,h-1' would mean a tabular with a double horizontal line under
> the headings (first row), a vertical line between the first and second
> columns, and a horizontal line at the bottom.
> 'h:2, h-2:, h1' would have the first and last rows enclosed in
> horizontal lines, where the one under the headings (first row) is doubled.
> 'v:, h:, h1' would be the current default (if I'm not mistaken).
> 'h0, h-1, v0, v-1' would enable all outer borders.
> etc.
> 
> So much for setting the default in the lyxrc file. Several pre-defined
> styles could be distributed with lyx, for example:
> 
> 1. the current default
> 2. no borders
> 3. all borders (only single lines)
> 4. all horizontal lines, no vertical lines
> 5. all horizontal lines, plus doubled between rows 1 and 2
> 6. lines after the first row and column respectively, and a line at the
> bottom
> 
> The pre-defined styles would have to be stored somewhere of course --
> don't know if there's an obvious place for that, or if a new config file
> is needed.
> 
> The gui way would add a 'tabular' item in the global settings dialog in
> the look&feel (German: Aussehen) group. There a user could choose from
> the list of pre-defined line styles, and there would be a little, say
> 5x5, schematic tabular next to the drop-down list to visualize the
> choices. Something like:
> ========================================================
> initial line style for new tabulars:  [drop-down-list]
> (you can always adjust lines later)
> 
> preview:
> _|____
>  |
>  |
>  |
> _|____
> ========================================================
> 
> Later that dialog could be enhanced by an input field so that a user can
> add (or load) new styles; but I think it's not needed initially, the
> "tweaking community" should be satisfied with defining their new styles
> in a config file for the time being. Users can share their styles on the
> wiki, for example. This dialog pane for tabulars could later maybe also
> hold some other table defaults like font styles etc. But that is another
> story.
> 
> Ok so much for that. Boy, all I wanted is a better default...
> Now you guys better get to work ;-)

I intended to comment in more detail, but am unfortunately very busy ATM.
Thanks for thinking, please create a bugzilla request for this and add a
link to this thread. Then we can come back later.


Georg

Reply via email to