加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows – 使用希腊语文本编译.Rnw到pdf

发布时间:2020-12-14 05:27:11 所属栏目:Windows 来源:网络整理
导读:我使用注释掉的代码尝试了它但没有成功.有人可以帮忙吗? documentclass[a4paper]{article}%usepackage[english,greek]{babel}%latintext title{Sweave Example 1}author{George Dontas}begin{document}maketitleIn this example we embed parts of t
我使用注释掉的代码尝试了它但没有成功.有人可以帮忙吗?

documentclass[a4paper]{article}
%usepackage[english,greek]{babel}


%latintext 
title{Sweave Example 1}
author{George Dontas}

begin{document}

maketitle

In this example we embed parts of the examples from the
texttt{kruskal.test} help page into a LaTeX{} document:

%greektext 
Αυτ? ε?ναι κε?μενο στα Ελληνικ?
%latintext
<<eval=TRUE,echo=TRUE,warning=FALSE,message=FALSE,error=FALSE>>=
data(airquality)

kruskal.test(Ozone ~ Month,data = airquality)
@

which shows that the location parameter of the Ozone distribution varies significantly from month to month. Finally we
include a boxplot of the data:

begin{center}
<<eval=TRUE,echo=FALSE,results='hide',error=FALSE>>=
boxplot(Ozone ~ Month,data = airquality)
@
end{center}

end{document}

解决方法

这里的问题不是R,而是让乳胶与希腊语发挥良好关系.随着帽子提示到 this answer,也许最简单的解决方案是切换到XeLaTeX编译并将文件重写为

documentclass[a4paper]{article}
usepackage{fontspec}
setmainfont{Times New Roman}
setsansfont{Arial}
newfontfamilygreekfont[Script=Greek]{Linux Libertine O}
newfontfamilygreekfontsf[Script=Greek]{Linux Libertine O}
usepackage{polyglossia}
setdefaultlanguage{english}
setotherlanguage{greek}

title{Sweave Example 1}
author{George Dontas}

begin{document}
maketitle

Ελληνικ? κε?μενο

In this example we embed parts of the examples from the
texttt{kruskal.test} help page into a LaTeX{} document:

...

和以前一样.然后用XeLaTeX编译(latexmk -xelatex file.Rnw会这样做).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读