首页 > 解决方案 > 为什么编织 pdf_document 需要很长时间?

问题描述

我正在尝试pdf_document在 RStudio 中编织一个,但它需要永远,只停留在编织第一块?我尝试重新安装 RStudio 并删除.Rhistory但仍然无法正常工作。知道为什么它无法生成 pdf 文档以及如何解决问题吗?

这是rmarkdown文件:


    ---
    title: "Title"
    author: "Author"
    date: "29/5/2020"
    output:
      pdf_document:
        fig_caption: yes
        extra_dependencies:
          epigrafica: null
          fontenc:
          - LGR
          - OT1
          float: null
    header-includes: \usepackage{float} \floatplacement{figure}{H}
    editor_options: 
      chunk_output_type: inline
    ---
    
    
    \tableofcontents

    ```{r libraries, include=FALSE}
    
     library(ggbio) 
     library(EnsDb.Hsapiens.v75)    
     library(Homo.sapiens)  
     library(showtext)  
    
    font_add_google(name='Nunito')
    showtext_auto()
    ```
    
    ```{r global-options, include=FALSE}
    knitr::opts_chunk$set(
      fig.pos = 'H',
      cache       = TRUE,
      fig.align   = 'center',
      results     = 'asis',
      echo        = TRUE,
    
    ) 
    ```


    ```{r transcripts, echo=FALSE, fig.showtext=TRUE, message=FALSE, warning=FALSE}

    
      ensdb <- EnsDb.Hsapiens.v75
      ggbio::autoplot(
        ensdb,
        GeneNameFilter("BRCA2"),
        fill = "#56B4E9",
        color = "black",
        size = 0.1,
        gap.geom = "segment"
      ) +
      theme_bw() +
      theme(
        panel.grid.major.y = element_blank(),
        panel.grid.minor.y = element_blank(),
        panel.grid.major.x = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.border = element_blank()
      )

    ```
rmarkdown::render('/Users/A/Desktop/GitHub/A/rmd/Report.Rmd',  encoding = 'UTF-8');


processing file: Report.Rmd
  |.                                                                     |   2%
  ordinary text without R code

  |...                                                                   |   4%
label: libraries (with options) 
List of 1
 $ include: logi FALSE

但它永远不会继续完成......需要几个小时

标签: rr-markdownknitr

解决方案


我能提供的最大帮助是你被困在库块上。所以尝试一次从那里删除一个元素,直到你越过那个块,看看哪一行是问题所在。


推荐阅读