Hello!

Thank you for you answer. Comments bellow.

Jean-Marc Lasgouttes wrote:
>>>>>> "Gregor" == Gregor Gorjanc <[EMAIL PROTECTED]> writes:
> 
> Gregor> Gregor Gorjanc <[EMAIL PROTECTED]> writes: ...
>>> to noweb only. Sweave is based on noweb, but has a bit different
>>> philosophy uses code to do the "computing in the document" and the
>>> code is then replaced with the results. Does anyone see any other
>>> route to provide Sweave support directly in LyX?
> 
> Gregor> Thinking a bit further, this could be solved by another option
> Gregor> for tex2lyx to specify which literate programing file format
> Gregor> would be chosen. I suggest noweb for default name instead of
> Gregor> literate as literate is far more general than noweb. For
> Gregor> Sweave file format name sweave could be chosen. 
> 
> Is there any reason to have a sweave-article and a noweb-article
> class? What would the difference be between the two? It seems to me
> that it would be better to pick a tool in Document>Settings to choose
> a literate programming program.

The differences are minor, but there are some. I am writting an article
for RNews and for the moment I have this (preliminary) stuff on layouts.
I can send you offline the whole article if you are interested. When I
was writting this I was thinking a lot about how to get things around.
Perhaps I do not see things from right perspective.

--- Start

\LyX{} uses layouts for definition of document classes as well as for
sytles/environments, say standard layout for normal text and scrap
layout for program code in literate programming. There are already
layouts with literate support for article, report and book. Definitions
for this files can be found in \file{layout} subdirectory of library
directory.  Files are named \file{literate-article.layout},
\file{literate-report.layout} and \file{literate-book.layout}. These
files include \file{literate-scrap.inc} file, where scrap layout is
defined. These files are really very simple and new ones for other
document classes can be easily created. When \LyX{} imports literate
programming file it automatically chooses one of these layouts. That is
the reason for mandatory use of \command{literate} file format name as
described before in formats subsection.

Default layout files for literate programming in \LyX{} were written
with \command{noweb} tool in mind. There are two problems with these
layouts, because \command{Sweave} does not have exactly the same
implementation as \command{noweb}. Default layouts are available for use
to \LyX{} user only if \file{noweb.sty} file is found by \TeX{} in the
configuration of \LyX{} - done during first start of \LyX{} or via
\command{Tools} --> \command{Reconfigure} menu. Another problem lies in
the heart of the difference between \command{Sweave} and
\command{noweb}. In weave ``mode'' \command{Sweave} can output code as
well as results from the code and user might want to format this
results, while \command{noweb} produces only code. Therefore, it does
not seem necesarry to use alignment for code chunk in \command{noweb},
whereas in \command{Sweave} this can be used often - especially when
inserting figures via \code{plot()} functions.

To avoid mentioned problems we provide modified literate layout files
for article, report and book at ?. Note that it is not mandatory to use
these layouts to have \command{Sweave} support in \LyX{} - install
\file{noweb.sty} file (could also be a fake file) and live with a
contraint that you can not align code chunks. Provided layouts offer
better integration\footnote{}.

--- End

> I would personally be interested in using sweave in LyX, but
> unfortunately I will not have time to work on that.

Of course. Availability of human resources is always a problem.

Gregor

Reply via email to