1

My operating system is linux mint 15, and I recently installed the texlive 2013. After installation, I appended the search path for texlive to ~/.bashrc

# set PATH
PATH=/usr/local/texlive/2013/bin/x86_64-linux:$PATH; export PATH

# set MANPATH
MANPATH=/usr/local/texlive/2013/texmf/doc/man:$MANPATH; export MANPATH

# set INFOPATH
INFOPATH=/usr/local/texlive/2013/texmf/doc/info:$INFOPATH; export INFOPATH

Then I could locate cmds such as pdflatex on xterm. However, when I wanted to use the pkg Sweave in rstudio, it always prompted that No Tex installation detected. I examined the $PATH in rstudio by Sys.getenv("PATH") and found out that the texlive/ directory was not appended to $PATH. So I guessed the problem was that the environment of Xsession doesn't take ~/.bashrc into considration. How to address this issue. Any help would be appreciated.

zeno tsang
  • 735
  • 1
  • 6
  • 16

2 Answers2

3

You are right. R Studio runs in a shell that doesn't pay attention to the usual startup scripts. As far as I can tell, the appropriate place to change them globally (for all users) is R_HOME/etc/Renviron.site and for individual users, $HOME/.Renviron. (On my system, R_HOME is /usr/lib/R.)

Run ?Startup in the R Studio console for more details.

Dave R
  • 63
  • 5
  • 1
    This is correct, I don't think RStudio will check `~./profile`. Note also that you have to escape dollar-sign quoted variables with {}, so the line you want to add at the end of `Renviron.site` is: `PATH=/usr/local/texlive/2013/bin/x86_64-linux:${PATH}` – nograpes Feb 17 '14 at 23:56
3

I have recently set up a configuration like yours.

The most correct solution is to put those lines into ~/.profile (or /etc/profile, for all users, as I did); this way all processes will inherit that PATH, not only those derived from bash.

JoshDM
  • 4,939
  • 7
  • 43
  • 72
ƒacu.-
  • 507
  • 3
  • 9
  • yes, I already solve the problem by adding the code `Sys.setenv(PATH=paste(Sys.getenv("PATH"),"/usr/local/texlive/2013/bin/x86_64-linux/",sep=":"))` in `~/.Rprofile`. Thanks. – zeno tsang Oct 10 '13 at 08:55