Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    R under Debian testing/i386: permanently set pdfviewer option

    21st October 2009

    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

    Leave a Reply

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>