简体   繁体   English

RStudio / knitr默认的PDF查看器设置?

[英]RStudio/knitr default PDF viewer settings?

I'm using knitr to weave .Rnw files in RStudio on Mac OSX 10.8.1. 我在Mac OSX 10.8.1上的RStudio中使用knitr编织.Rnw文件。 When I compile the PDF (either with the button in RStudio, or Cmd-Shift-i), the default RStudio PDF viewer appears, and the view is set to "Auto". 编译PDF时(使用RStudio中的按钮或Cmd-Shift-i),将显示默认的RStudio PDF查看器,并且视图设置为“自动”。 Is there a way that I can set this view to open to "Page Fit", eg? 例如,是否可以将此视图设置为“页面适合”打开? Below are the contents of a small working .Rnw file. 下面是一个小的工作.Rnw文件的内容。

Thanks, RTM 谢谢,RTM

\documentclass[12pt]{article}

\title{Sweave Min}

\author{RTM}

\begin{document}

<<setup, include=FALSE, cache=FALSE>>=
  opts_chunk$set(fig.path='figs/', fig.align='center', fig.show='hold', echo=FALSE, include=FALSE)
options(replace.assign=TRUE, width=90)
@

\maketitle

<<min, include=TRUE>>= 
  x <- 1+1
print(x)
@

$x = \Sexpr{x}$

\end{document}

Depending on if you want the page to fit horizontally or vertically, you can use the LaTeX package hyperref , eg 根据您希望页面水平放置还是垂直放置,可以使用LaTeX包hyperref ,例如

\usepackage{hyperref}
\hypersetup{pdfstartview=FitH}

It also depends on whether RStudio's PDF viewer recognizes this setting. 这还取决于RStudio的PDF查看器是否可以识别此设置。

Or you can configure your own PDF viewer to set the default view to "Page Fit" instead of using RStudio's viewer. 或者,您可以配置自己的PDF查看器以将默认视图设置为“页面适合”,而不是使用RStudio的查看器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM