The [[foo]] notation is noweb syntax for a reference to something that is defined elsewhere. By putting it in an ERT we ensure that it ends up in the noweb file unaltered.
On Oct 18, 2012, at 5:18, Jean-Marc Lasgouttes <lasgout...@lyx.org> wrote: > Le 18/10/2012 14:02, Scott Kostyshak a écrit : >> Ah, then I don't understand how LyX handles imports. The Customization >> manual does not talk about importing. Doesn't LyX use the converters >> to convert the file to LaTeX and then use tex2lyx to import the tex >> file? > > Normally, the importation is done by tex2lyx using the -n flag, but I > think that this support needs to be updated to the new world of module > based literate programming. > > The old way this "noweb mode" works is > 1/ ensure that the class name is literate-something (now it would be > ensure that some module is loaded and the module name should be passed > to tex2lyx) > > 2/ when a layout starts with <<, change it to a layout with name > "Scrap". This could be OK because the Sweave/knitr modules declare Scrap > as a synonym for Chunk. > > 3/ transform [[something]] to ERT. I do not know what this is good for, > presumably a noweb-only thing. >> >>> What is the difference between the Rnw files when you do this change? >> >> No difference. In the recipe for reproducing, steps (1) and (2) are >> the same. > > You mean that the Rnw files are the same in the two cases? This is weird. > > JMarc >