为什么Knitr无法找到framed.sty或kpsewhich? [英] Why is knitr unable to find framed.sty or kpsewhich?
本文介绍了为什么Knitr无法找到framed.sty或kpsewhich?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
knit('test2.rnw')
processing file: test2.rnw
|>>>>>>>>>>>>> | 20%
|>>>>>>>>>>>>>>>>>>>>>>>>>> | 40%
label: setup (with options)
List of 2
$ include: logi FALSE
$ cache : logi FALSE
sh: kpsewhich: command not found
|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | 60%
|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | 80%
|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| 100%
ordinary text without R code
output file: /Users/xxx/Desktop/R_meetup/documentation/test2.tex
Warning message:
In test_latex_pkg("framed", system.file("misc", "framed.sty", package = "knitr")) :
unable to find LaTeX package 'framed'; will use a copy from knitr
>
我正在使用OSX Lion 10.7.3
I'm on OSX Lion 10.7.3
kpsewhich的路径:
Path for kpsewhich:
$ which kpsewhich
/usr/texbin/kpsewhich
$ which pdflatex
/usr/texbin/pdflatex
这两个路径都在我的home
目录中的.bash_profile
中.我的Tex安装中确实有带框的包装.
Both paths are in my .bash_profile
in my home
directory. I do have the framed package in my Tex install.
PATH=$PATH:/usr/texbin/pdflatex
PATH=$PATH:/usr/texbin/kpsewhich
export PATH
解决方案
将此添加到我的.rprofile
中修复了它:
Adding this to my .rprofile
fixed it:
Sys.setenv("PATH" = paste(Sys.getenv("PATH"),"/usr/texbin",sep=":"))
推荐答案
安装texlive-latex-extra
为我解决了.原始答案( https://stackoverflow.com/a/25517332/1169233 )适用于Ubuntu,但适用于AFAIK应该也可以在Mac OS上逐字记录.
Installing texlive-latex-extra
solved for me. The original answer (https://stackoverflow.com/a/25517332/1169233) is intended for Ubuntu, but AFAIK it should work verbatim on Mac OS too.
这篇关于为什么Knitr无法找到framed.sty或kpsewhich?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文