Gregor Gorjanc wrote: > 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.
Then I don't understand your problem with importing. It should be as easy as defining a sweave->lyx converter that calls tex2lyx in noweb mode. Why do you want a new option in tex2lyx as you wrote above? > 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. That has nothing to do with tex2lyx. Please don't mix different problems. >> > 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. I don't understand. Only literate format can be sued for what? >> 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? That depends on your OS. In linux it would be cp $$i $$o >> 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. I don't get it. Why would you need a sweave->literate converter? If we don't have a sweave backend, export would go like this: lyx->literate->sweave->{dvisweave,pssweave,pdfsweave} where the step sweave->{dvisweave,pssweave,pdfsweave} would probably be composed of several steps. Georg