You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

RStudio不再在独立窗口显示Rmarkdown生成的PDF输出

RStudio编织Rmd为PDF后不弹出预览窗口的恢复方法

问题描述

正常情况下,将Rmarkdown文件编织为PDF后,RStudio会自动弹出独立窗口显示PDF输出,且保持窗口打开时,重新编织PDF会随Rmd修改自动更新。当前编织后PDF可正常生成更新,但不再弹出独立预览窗口,需手动用Acrobat打开,且Acrobat打开时无法覆盖更新PDF,需恢复原预览功能。

恢复设置步骤

  • 调整RMarkdown预览选项
    1. 打开RStudio顶部菜单栏的Tools -> Global Options
    2. 切换到R Markdown选项卡
    3. 在Show output preview in:选项中,选择Viewer pane or new window(或直接选New window),确保勾选Preview when knitting
  • 切换默认PDF查看器
    1. 在Global Options中切换到General -> File Editing
    2. 找到PDF viewer选项,选择RStudio PDF Viewer,替代外部的Acrobat
  • 清理缓存并重启
    1. 删除Rmd文件所在目录下的_files和_cache文件夹
    2. 重启RStudio后重新编织测试

测试用Rmarkdown代码

---
title: "test"
author: "The Name"
date: "2023-01-20"
output:
  pdf_document
---
## R Markdown
```{r}
#this is a comment 
内容的提问来源于stack exchange,提问作者KeepDigging
相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 06:42:46