设为首页收藏本站获取积分奖励

R语言中文网

 找回密码
 立即注册
查看: 845|回复: 0

R语言R / LaTeX Sweave驱动程序RweaveLatex()函数-中英文对照帮助文档

[复制链接]
发表于 2020-8-21 08:13:23 | 显示全部楼层 |阅读模式
        R语言R / LaTeX Sweave驱动程序RweaveLatex()函数-中英文对照帮助文档

                                         By MicroRbt Martinez PhD

R语言函数名:RweaveLatex()
R语言函数功能:R / LaTeX Sweave驱动程序
来自资源库:基础库(R语言自带)
RweaveLatex()函数所属R语言包:所在R包具体名称、包功能的中英文双语描述见正文后面'--所在R语言包信息--'部分。

描述-----Description-----

A driver for Sweave that translates R code chunks in LaTeX files by running them , i.e., parse() and eval() each.
Sweave的驱动程序通过running them转换LaTeX文件中的R代码块,即每个parse()和eval()。


使用方法-----Usage-----

RweaveLatex()
RweaveLatexSetup(file, syntax, output = NULL, quiet = FALSE,
debug = FALSE, stylepath, ...)

参数-----Arguments-----

参数file介绍: Name of Sweave source file. See the description of the corresponding argument of Sweave.
Sweave源文件的名称。请参见Sweave的相应参数的说明。

参数syntax介绍: An object of class SweaveSyntax.
类SweaveSyntax的对象。

参数output介绍: Name of output file. The default is to remove extension <code>.nw</code> , <code>.Rnw</code> or <code>.Snw</code> and to add extension <code>.tex</code> . Any directory paths in file are also removed such that the output is created in the current working directory.
输出文件名。默认设置是删除扩展名<code>.nw </ code>,<code>.Rnw </ code>或<code>.Snw </ code>并添加扩展名<code>.tex </ code>。 file中的所有目录路径也将被删除,以便在当前工作目录中创建输出。

参数quiet介绍: If TRUE all progress messages are suppressed.
如果TRUE取消了所有进度消息。

参数debug介绍: If TRUE, input and output of all code chunks is copied to the console.
如果为TRUE,则将所有代码块的输入和输出复制到控制台。

参数stylepath介绍: See Details .
请参阅Details。

参数...介绍: named values for the options listed in Supported Options .
Supported Options中列出的选项的命名值。


详情-----Details-----

The LaTeX file generated needs to contain the line \usepackage{Sweave}, and if this is not present in the Sweave source file (possibly in a comment), it is inserted by the RweaveLatex driver. If stylepath = TRUE, a hard-coded path to the file <code>Sweave.sty</code> in the R installation is set in place of Sweave. The hard-coded path makes the LaTeX file less portable, but avoids the problem of installing the current version of <code>Sweave.sty</code> to some place in your TeX input path. However, TeX may not be able to process the hard-coded path if it contains spaces (as it often will under Windows) or TeX special characters.
生成的LaTeX文件需要包含\usepackage{Sweave}行,如果Sweave源文件中不存在此行(可能在注释中),则由RweaveLatex驱动程序插入。如果是stylepath = TRUE,则将R安装中的文件<code>Sweave.sty </ code>的硬编码路径设置为代替Sweave。硬编码的路径使LaTeX文件的可移植性降低,但避免了将当前版本的<code>Sweave.sty </ code>安装到TeX输入路径中的某个位置的问题。但是,如果TeX包含空格(在Windows中通常会出现)或TeX特殊字符,则它可能无法处理硬编码路径。

The default for stylepath is now taken from the environment variable SWEAVE_STYLEPATH_DEFAULT, or is FALSE it that is unset or empty. If set, it should be exactly TRUE or FALSE: any other values are taken as FALSE.
现在从环境变量SWEAVE_STYLEPATH_DEFAULT中获取stylepath的默认值,或者它是未设置或为空的FALSE。如果设置,则应为TRUE或FALSE:其他任何值都将作为FALSE。

The simplest way for frequent Sweave users to ensure that <code>Sweave.sty</code> is in the TeX input path is to add <code><var>R_HOME</var>/share/texmf</code> as a texmf tree (root directory in the parlance of the MiKTeX settings utility).
频繁使用Sweave的用户确保<code>Sweave.sty </ code>在TeX输入路径中的最简单方法是将<code><var>R_HOME</var>/share/texmf </ code>添加为texmf tree(在MiKTeX settings的说法中为root directory效用)。

By default, <code>Sweave.sty</code> sets the width of all included graphics to:
默认情况下,<code>Sweave.sty </ code>将所有包含的图形的宽度设置为:

\setkeys{Gin}{width=0.8\textwidth}.
\setkeys{Gin}{width=0.8\textwidth}。

This setting affects the width size option passed to the \includegraphics{} directive for each plot file and in turn impacts the scaling of your plot files as they will appear in your final document.
此设置会影响传递给每个图文件的\includegraphics{}指令的宽度大小选项,进而影响图文件的缩放比例,因为它们将出现在最终文档中。

Thus, for example, you may set width=3 in your figure chunk and the generated graphics files will be set to 3 inches in width. However, the width of your graphic in your final document will be set to 0.8\textwidth and the height dimension will be scaled accordingly. Fonts and symbols will be similarly scaled in the final document.
因此,例如,您可以在图形块中设置width=3,并且生成的图形文件的宽度将设置为3英寸。但是,最终文档中图形的宽度将设置为0.8\textwidth,并且高度尺寸将相应缩放。字体和符号将在最终文档中按类似比例缩放。

You can adjust the default value by including the \setkeys{Gin}{width=...} directive in your <code>.Rnw</code> file after the \begin{document} directive and changing the width option value as you prefer, using standard LaTeX measurement values.
您可以通过在\begin{document}指令之后的<code>.Rnw </ code>文件中包括\setkeys{Gin}{width=...}指令并使用标准LaTeX测量值根据需要更改width选项值来调整默认值。

If you wish to override this default behavior entirely, you can add a \usepackage[nogin]{Sweave} directive in your preamble. In this case, no size/scaling options will be pa
-----未完,待续-----,↓↓↓展开剩余72%↓↓↓
购买主题 前行需要您的支持,请赞助作者 【15 金钱】 就能浏览全部100%内容啦!(本贴一次赞助、永久可读)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|R语言中文网    

GMT+8, 2024-5-20 22:37 , Processed in 0.037548 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表