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

前端之家收集整理的这篇文章主要介绍了windows – 使用希腊语文本编译.Rnw到pdf前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用注释掉的代码尝试了它但没有成功.有人可以帮忙吗?

\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}
\newfontfamily\greekfont[Script=Greek]{Linux Libertine O}
\newfontfamily\greekfontsf[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会这样做).

猜你在找的Windows相关文章