Setting default PDF viewer for rstudio

Using knitr in Rstudio, when a .Rmd file is linked to a PDF, a file viewer appears. I would really like to change this to okular, but I cannot find a way to do this.

Looking at the Sweave settings, I see that the “system viewer” is marked for preview, but okular is already installed as my default system viewer. I also checked the default viewer using xdg-mime and okular is also the default. In all other cases, okular is the default, but Rstudio / knitr is always used by evince.

How can I change this behavior?

+5
source share
3 answers

Rstudio setup

Same as you:

  • Opitons | Sweave | PDF:

:

  • - .pdf
  • ... | ...
  • PDF

Linux Mint 18.2 Sonya
: nemo
PDF: apvlv
RStudio 1.1.383

0

.

, PDF:

    Sys.getenv("R_PDFVIEWER")

"", "xdg-open".

, :

    Sys.setenv(R_PDFVIEWER = "xdg-open")

:

    # Checking where your home directory is in R
    Sys.getenv('HOME')

, :

    # Making an R environment file that runs at startup
    touch .Renviron

    # Add the environment variable change
    echo 'R_PDFVIEWER = xdg-open' >> .Renviron

, R , PDF.

0

Mac, R Studio 1.2.1335

Opitons | Sweave | View PDF: View Systementer image description here

0
source

Source: https://habr.com/ru/post/1686271/


All Articles