Home Comments Thread
New Thread

3 Comments

giscus-bot giscus-bot 2022-12-16 20:24:34
访客 *peter* @ 2011-05-24 13:01:57 写道:

折腾这些配置是够辛苦的,开源软件就靠大侠这样的积极奉献,省却了众多小白们的恐惧,多谢了!

yihui yihui 2022-12-16 20:24:38

我不是什么大侠,人家建的是一栋大厦,我只不过跑过去帮忙钉了个钉子而已

——原帖发布于 2011-05-25 00:10:42

giscus-bot giscus-bot 2022-12-16 20:24:35
访客 *flashcrazy* @ 2011-05-31 08:02:26 写道:

我现在折腾lyx 2 + texlive,英文的整成了,中文的搞不定,你介绍的pgfsweave更别提了。发现用sweave模块的时候,原来写好的代码,贴进lyx来,全乱了,多了空格,回车什么的,就输出不了PDF,自己一行一行的检查很麻烦啊,谢兄有没有什么方法将已经编好的代码转成LYX中用的。

yihui yihui 2022-12-16 20:24:39

你这是两个问题吗?

1、如何贴代码:你没说从哪里往LyX里贴,如果是某处的纯文本往LyX里贴的话,要用Ctrl+Shift+V才能保持原来的换行,否则贴出来是一行,除非有空行(空行前后将被当成两个段落)。代码贴完之后要应用Chunk环境(左上角下拉菜单)。

2、如何检查错误:要搞清楚错误的来源,是LaTeX错误还是R错误。方法:View --> View Messages看详细编译过程。

另:既然你用Windows,为什么要用TeXLive呢?我个人非常非常讨厌TeXLive,但因为常用Ubuntu没办法才用它。Windows下的MikTeX不是挺好的么?如果要用Windows而且要用中文,那么何不用CTeX?各种烦人的中文问题都已经给你解决好了。

——原帖发布于 2011-06-01 06:46:16

giscus-bot giscus-bot 2022-12-16 20:24:37
访客 *姜昊来* @ 2011-08-02 19:30:24 写道:

师兄昨天我在COS给你留言说我的 Sweave在lyx下配置好了。 今天在工作的电脑上无论如何都弄不好。R和Lyx都是最新版的,系统是XP。在R下运行了 source('http://gitorious.org/yihui/lyx-sweave/blobs/raw/master/lyx-sweave-config.R') 这个自动配置程序。

R中显示如下:
Warning messages:
1: running command 'mpm --install mptopdf' had status 1
2: running command 'mpm --install fancyvrb' had status 1
3: running command 'mpm --install ae' had status 1
4: running command 'mpm --install ms' had status 1
5: running command 'mpm --install xcolor' had status 1
6: running command 'mpm --install pgf' had status 1
7: running command 'C:WINDOWSsystem32cmd.exe /c R --version' had status 1
8: In shell("R --version") :
'R --version' execution failed with error code 1

然后打开你在cos的那篇文章中的demo, 没办法把demo输出成pdf(按钮是灰色不可点击)。把Sweave Module选中,有如下信息:
Allows to use the statistical language S/R as a literate programming tool via Sweave package. See sweave.lyx in examples.
Package(s) required: sweave->latex.
Modules excluded: LilyPond Book.
WARNING: Some required packages are unavailable!

以前在家中电脑(Win7),也有这样的问题,但是昨天神奇的被解决了,我都不知道为啥。 望赐教啊~

yihui yihui 2022-12-16 20:24:40

有可能是你的R不在PATH变量中。无论如何,还是等LyX 2.0.1发布吧,我过去提到的所有关于LyX和Sweave的东西都显得太麻烦了。

——原帖发布于 2011-08-09 23:12:49

Sign in to join the discussion

Sign in with GitHub