Knit button doesn't load user specific configuration

Hello everyone,

  • I'm using Ubuntu 18.04;
  • I have texlive (tex, pdflatex, xelatex, etc) installed at "/usr/local/texlive/2020/bin/x86_64-linux";
  • The above path is set in my $PATH variable via .bashrc file (export PATH="/usr/local/texlive/2020/bin/x86_64-linux:$PATH");

When I click the Knit button, it doesn't locate the texlive installation. If I create a bash chunk with "echo $PATH", for example, it doesn't show my user specific configuration. As a temporary solution, I'm using symbolic links to copy the relevant files to places like "/usr/share/bin", but I hope there is a better solution. Can you guys help me?

PS.: I'm also using the renv package to create a local instance of packages, don't know if it affects the knit button behavior.

1 Like

Which version of RStudio are you using ? RStudio server I assume ?

Can you check with a R chunk and using Sys.getenv("PATH") instead of a bash chunk ?
It is possible the bash chunk loads another profile. It is not an image of what is loaded in your R session.

Also, you can try to set the PATH for R itself in .Renviron to add the path to your TEX installation, instead of you .bashrc (or in addition to)

Can you check that ?