Paul Johnson wrote:
I think the other part--the layout part--is just cosmetic. It controls
the way the R code chunks look on the screen only. The R code chunks
can be written as ordinary ERT. If the Lyx user is happy enough to
just put in ERT (without a layout representation in the on-screen
display), the document will go through LaTeX and R fine. It does not
matter what the blocks of ERT are called.
You could follow Gregor's example and add a layout environment that is
common to all noweb document classes. It could be called "Scrap" or
"Schunk". Note in Gregor's Layouts, the structure is simple. He
includes the existing noweb document layout and a
"literate-scrap.inc".
For 1.6, this can be created as a module that can then be used with any
document class. That conversion may be as simple as renaming the file
with the .module extension and adding the appropriate header. See the
docs in 1.6.svn.
There is a more serious problem that I was never able to overcome. If
one writes a book LyX, the R code chunks will be properly processed
only if they are actually in the main book file. If one follows the
usual practice of writing chapters and then putting them together with
includes in the main book file, then in my experience, the R code does
not get processed. I would be eager to see a working example of an R
book that solved this problem. I asked about this in the LyX user
list last year and didn't get any answers, so I assumed it was an
intractable problem.
This may be a known sort of problem. If you're putting all the relevant
header info in the main document---e.g., in the preamble---then it won't
be seen when you compile the children. The solution (workaround) is to
include that info in the child as well. At present, children don't know
about their parents unless they are loaded as children of the parents,
and even then they don't import the parent's preamble when compiled
separately.
rh