G. Milde wrote:
On 19.08.08, Steve Litt wrote:
I developed these, so let me add a bit.
0) What is a layout module?
A file with syntax and content similar to a LyX layout file that can be
added to a chosen documentclass' layout definitions on a per-document base.
Modules are similar to included files, except in this sense: They are
included on a per-document basis, using a GUI in Document>Settings. And,
as you put it elsewhere, they allow easy sharing of layout code, without
anyone's having to edit a layout file. Put the new module in your
layouts/ directory, reconfigure, and use it.
1) Why are they better than just writing your own layout file?
It's orthogonal: you can combine document classes with additional features
provided by the modules.
The advantage is precisely that they can be included on a per-document
basis. Suppose, for example, that you sometimes want a "Formula" layout.
You want it in articles, books, etc, but not all of them. In 1.5, you
could put this into formula.inc and then Input it into various new
layouts: article-formula.layout, book-formula.layout, etc. This is very
inconvenient, and it gets worse the more customizations you want to mix
and match. You need a new layout for every such combination. Modules are
a solution. You have formula.module, and you can include it in a
document that uses article.layout, book.layout, mycustom.layout, or
whatever, all without ever touching those files.
3) By what design methodology do you create them?
Take an example from the LyX 1.6 layouts directory and modify.
Modules are just layout files, like *.inc files, but with a special
extension, and identifying information in the header.
4) What are the attributes of a "good" layout module?
Reusability, mostly. And usefulness.
5) What are the attributes of a "bad" layout module?
Bugs. ;-)
rh