Import Rnw is something I was asked long time ago but have not figured
out how it works. It seems the Sweave/knitr module is called but
really should not be, because these modules are only responsible for
Rnw-->TeX, not for Rnw-->LyX. Or should they? Ideally LyX should be
able to handle the TeX part, and for the R code chunks (<<>>= and @),
they can be imported to ERT, but I do not know how to do that.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Thu, Oct 18, 2012 at 5:02 AM, Scott Kostyshak <skost...@lyx.org> wrote:
> On Thu, Oct 18, 2012 at 3:46 AM, Jean-Marc Lasgouttes
> <lasgout...@lyx.org> wrote:
>> Le 18/10/12 01:49, Scott Kostyshak a écrit :
>>
>>>> Stupid question; where is importation of knitr files defined in
>>>> converters?
>>>
>>>
>>> Rnw (knitr) -> latex (plain)
>>> The converter is currently:
>>> Rscript --verbose --no-save --no-restore $$s/scripts/lyxknitr.R $$p$$i
>>> $$p$$o $$e $$r
>>> When I change this to the following, import works:
>>> Rscript --verbose --no-save --no-restore $$s/scripts/lyxknitr.R $$p$$i
>>> $$p$$o ISO-8859-15 $$r
>>
>>
>> But this is a converter for export, not import.
>
> 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?
>
>> 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. To get it to import I only substitute for $$e before step
> (3) (importing).
>
> Scott

Reply via email to