Quantcast
Channel: Autarchy of the Private Cave » how-to
Viewing all articles
Browse latest Browse all 35

R under Debian testing/i386: permanently set pdfviewer option

$
0
0

If you get this message when opening vignettes:

Error in openPDF(vif) :
getOption(‘pdfviewer’) is ”; please use ‘options(pdfviewer=…)’

and you are tired of running this command every time:

> options(pdfviewer=”okular”)

then you should check if your system-wide Renviron file has proper PDF viewer set:

grep -i pdf /etc/R/Renviron

R_PDFLATEXCMD=${R_PDFLATEXCMD-${PDFLATEX-’/usr/bin/pdflatex’}}
R_RD4PDF=${R_RD4PDF-’times,hyper’}
## Default PDF viewer
R_PDFVIEWER=${R_PDFVIEWER-”}

It wasn’t in my case.

To set one, either edit the system-wide Renviron (e.g. by editing the R_PDFVIEWER=${R_PDFVIEWER-”} line to look like R_PDFVIEWER=${R_PDFVIEWER-’/usr/bin/xdg-open’} – this will use MIME types to open your preferred PDF viewer), or one of the per-user/per-directory Renviron files to fix this minor annoyance (format is the same, e.g. R_PDFVIEWER=okular ).

Share


Viewing all articles
Browse latest Browse all 35

Trending Articles