Georg Baum <[EMAIL PROTECTED]> writes: ... > > 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. > > Why a different format? What is different in sweave that requires tex2lyx to > act differently? I suspect that you simply found a bug in the noweb import > that would also accor with noweb files, because the tex2lyx noweb support > was really a quick hack.
I did not found any bug in tex2lyx noweb! There is no difference in syntax between noweb and Sweave. There is only difference in what layout should provide - for example Sweave does not need \usepackage{noweb} - it needs \usepackage{Sweave}, but this is inserted by Sweave intself. And there is a need to be able to align scrap environment - current literate layouts do not allow this. I have all the needed modifications, but that is a hack. Partly because noweb support is a hack. > > 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. > > But that is already possible if you simply redefine the noweb converter. As > Gregor pointed out this is not nice if you use both. The alternative to a > new document class would be yet another set of dvi, ps and pdf formats for > output via sweave, with an appropriate set of converters. That becomes > unmanageable if it is extended even more. I already do not like the > different pdf formats, but I have no better idea. > I always wanted to reply to his original message but did not find the time. Only literate format can be used as it has specific meaning. > IMO, there are four problems: > > 1) output to sweave format. This is currently only possible with hacks, > either via redefining the literate format, or by defining a literate->seave > converter (would be a dummy converter that just copies the file), and new Hmm. This is interesting. How can I define dummy converter that just copies literate to sweave layout? > dvi,ps and pdf formats with an appropriate converter from sweave. The long This is again a problem, as I have to use literate in output definition in layout files. Then I would need sweave --> literate converter, but then I again have problem with noweb specific things. > term solution would be to implement a sweave backend in LyX (it could just > be an alias for the existing noweb backend), so that LyX knows what > converters to call for a sweave doc. Seems to be the way I proposed. But involves some coding. I can at least help in testing. > 2) layout files (or maybe not - depending on the solution to 1) I have it. > 3) import: should not be difficult to fix once 1) is decided Current tex2lyx works just fine we would just need to specify sweave and not noweb (current literate) format. > 4) problems with some encironments. I do nut understand that fully yet. Will be fixed with proper layout and newline fix in align environments. Thanks! Gregor