4

我使用注释掉的代码尝试了它,但没有成功。有人可以帮忙吗?

\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',warning=FALSE,message=FALSE,error=FALSE>>=
boxplot(Ozone ~ Month, data = airquality)
@
\end{center}

\end{document}
4

1 回答 1

2

这里的问题不是 R,而是让乳胶与希腊语很好地配合的问题。有了这个答案的提示,也许最简单的解决方案是切换到 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会这样做)。

于 2013-03-03T11:21:25.560 回答