Steve Litt wrote:
On Monday 22 March 2010 17:43:10 Julio Rojas wrote:
The only feature I miss is a layout editor. I don't know how easy
would it be to program one, but that would be one good addition.

It's hard Julio. It's hard enough that I couldn't even *specify* a layout editor, though I tried. If I'd been able to specify one, I'd have either pestered the LyX crew to write it, or written it myself in Perl/Tk (I'm not much of a Qt type of guy).


The customization manual already tells how to write a layout file. One can specify a GUI for doing the same, removing much of the tediousness
and many possibilities for error. (For example, such a GUI would always
remember to put "End" somewhere after "Style stylename".

This would give us an "easy" way of making layout files. The problem is, to do anything interesting with it, one would still need to know latex. Instead of writing a .layout from scratch, you could fill out a form like this (the layoutmodule "code" from logical markup):

=============
Type: charstyle  (alt. paragraph style, document class)
Name of your character style: Code

Font in LyX:
 Family: typewriter
 Size: unchanged
 weight: unchanged
 ...

Latex implementation: command  (alt. environment)
Latex command: code
Latex preamble: \newcommand{\code}[1]{\texttt{#1}}
=============

Of course, many of the fields would be comboboxes, making it impossible to enter a wrong value.

The tricky parts would be the latex command or the preamble. Still, it might be useful for those who understands some latex.


Making a layout editor for people who don't understand latex is much harder. And to some extent pointless. If the layout editor understand more latex than lyx does, then perhaps the effort could be better spent on improving lyx instead. And if it understands less, then it doesn't implement all that LyX can do.

Still, one could perhaps have something like "math macros", but for text. Let the user create a style by doing ordinary edits on a demo word. This way, a user could create a style for, say, "big green boxed marginal notes" by inserting a marginal note around the demo text, then a box, and then use the text style dialog to make the text big and green as well.

I'm thinking the best way to address the difficulty of new environments and character styles might be to start a public collection of them. A person could start with something close to what he wants and tweak it til it's right. Such a collection could come with a supporting document that organizes various environments and character styles in a hierarchy so that what you need is easily findable.


Yes, this can make LyX more and more useful. There will still be people
complaining that "I can't make my own style in an easy way" though. :-/

Helge Hafting

Reply via email to