knitr installation in Lyx

拜拜、爱过 提交于 2019-12-10 13:18:42

问题


I was trying to install Knitr package in Lyx but I encountered the following error.

"The module knitr requires a package that is not available in your Latex installation or a converter that you have not installed. Latex output may not be possible. Package missing Knitr>latex."

I would greatly appreciate if you could please help me to fix this problem. I checked the Lyx module but couldn't figure out exactly what to do. I am a new user to Lyx and Knitr.

Thank you in advance


回答1:


That is often an indication of the PATH problem; see the first section of the LyX/Sweave/knitr manual (link to PDF is at http://yihui.name/knitr/demo/lyx/)




回答2:


Ahem... In Windows 10, using MikTeX, you should be aware that R installs under x64 and i386 architecture so that when you run R.home('bin') in R it gives:

"C:/Users/DIEGOA~1.ACO/DOCUME~1/R/R-34~1.2/bin/i386" for i386 architecture and "C:/Users/DIEGOA~1.ACO/DOCUME~1/R/R-34~1.2/bin/x64" for x64 architecture... You should test both when adding the Rnw(knitr) in LyX (One complains, the other doesn´t)...

Hope this helps...




回答3:


I had this same error message on my Windows 10 machine and found that the error was in the path I provided for R. If you don't have the path all the way to the R executable, it will not work. Change the path in Lyx with Tools>Preferences>Paths and edit the PATH prefix content. I had to add

                C:\Program Files\R\R-3.6.0\bin\x64


来源:https://stackoverflow.com/questions/12451581/knitr-installation-in-lyx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!