2

It seems that I have two installations of TeXlive, one of which is more updated.

When I run latex, it seems to search packages inside the old installation. How can I direct latex to look for the updated installation?

All my packages in the new installation (such as tcolorbox) are listed as directories in the directory /usr/local/texlive/2015/texmf-dist/tex/latex/.

The old installation lists the package files in /usr/share/texlive/texmf-dist/tex/latex/.

Also, the command which latex gives /usr/bin/latex.

usr203050
  • 373
  • 4
  • 16
  • Set the paths correctly (or whatever Windows requires). What OS do you use? – jon Jul 03 '15 at 16:34
  • I use Ubuntu 14.10. How do I set the paths permanently (if possible)? Thank you. – usr203050 Jul 03 '15 at 16:47
  • I use my ~/.profile file, with something like PATH=/usr/local/texlive/2014/bin/x86_64-linux:$PATH (and similarly for MANPATH AND INFOPATH, though paths not identical). This means that which latex returns: /usr/local/texlive/2014/bin/x86_64-linux/latex. But note that I have yet to update to 2015: you'll need to find your own current file path. – jon Jul 03 '15 at 16:57
  • Thanks. But I cannot find the '~/.profile' file using Ctr+L in the home directory. Where is this file located? My updated installations are in /usr/local/texlive/2015/... – usr203050 Jul 03 '15 at 17:05
  • I have no idea what "using Ctr+L" means. I think it should be there by default. What does ls -a ~/.profile return? As for your paths, it sounds like it is going to be /usr/local/texlive/2015/x86_64-inux/, but that depends on a few things like whether you are using a 64-bit or 32-bit OS, etc. – jon Jul 03 '15 at 17:13
  • I have found the ~/.profile file using sudo gedit ~/.profile and it contains lines like PATH="$PATH:bin/$PATH" etc or something like that. My bin is directly below /2015/ if what I say means something. But it still does not work. – usr203050 Jul 03 '15 at 17:15
  • 2
    If you don't actually need both distributions, the best way to go is to remove the outdated one. Things will be much simpler that way. But if you really need to have two or more TeX distributions, the other path-related comments will be useful. – Paul Gessler Jul 03 '15 at 17:29
  • I do not need the two distributions, but if I remove the old one, I am afraid of losing all LaTeX, since I cannot let latex change to look for the good distribution. If I remove one, will it search automatically for the other? I don't think. – usr203050 Jul 03 '15 at 17:32
  • 1
    Do not use sudo gedit ~/.profile! You should not need sudo to edit a file in your home directory. – jon Jul 03 '15 at 17:48
  • You must provide a full path that (in your case, it sounds), like it goes from /usr/local/all/the/way/to/latex; from there we can get the correct path. And I hope you realize that statements like " it contains lines like PATH="$PATH:bin/$PATH" etc or something like that" are not helpful. Setting a path correctly obviously requires a certain degree of precision, not vague-and-possibly-accurate generalities. I would suggest editing your question to reflect what you have so far regarding setting paths and what is still unclear. Then we can delete all of our comments. – jon Jul 03 '15 at 17:54
  • Here is my full latex installation path: /usr/local/texlive/2015/ and the directory 2015 contains the subdirectories bin, readme-html.dir,readme-txt.dir, texmf-config,texmf-dist, texmf-var and tlpkg.

    Besides this, there is a directory /usr/local/texlive/texmf-local/ which ramifies to several subdirectories! Do I make sense?

    – usr203050 Jul 03 '15 at 17:58
  • All the packages are listed in the path /usr/local/texlive/2015/texmf-dist/tex/latex/. Should I then set PATH="/usr/local/texlive/2015/texmf-dist/tex/latex/? – usr203050 Jul 03 '15 at 18:12
  • 1
    No: The $PATH variable is so your system can find the commands latex and so forth, not find the packages. – jon Jul 03 '15 at 18:34
  • It seems your answers will not settle my problem. Thank you any way. – usr203050 Jul 03 '15 at 18:35
  • By far the best option is to remove the unneeded installation. Search on the term 'vanilla' and look for a question in the first few results with lots and lots of views and upvotes. That will explain what you need to do to keep your package manager happy. Do that and simply remove your old installation and set your path according to the instructions provided when you installed TL from upstream. – cfr Jul 03 '15 at 19:24
  • Ok, thank you. I have removed using sudo apt-get purge texlive*. But let's see. – usr203050 Jul 03 '15 at 19:26
  • Did you find this? – cfr Jul 03 '15 at 20:23
  • Yes, I installed afresh but it still cannot find the packages. Also, which latex continues to give /usr/bin/latex. – usr203050 Jul 04 '15 at 05:52

2 Answers2

0

The path variable can be set in TeXstudio in options -> Configure TeXstudio -> Build.

Then tick the Show Advanced Options in the lower left corner.

Then put your path in Commands, in my case it is

/usr/local/texlive/2018/bin/x86_64-linux

click OK.

If your path is set in .bashrc to include the texlive installation, then you can test it with opening TeXstudio in a terminal which has the correct $PATH value. With which you can find the path to the pdflatex:

$ which pdflatex /usr/local/texlive/2018/bin/x86_64-linux/pdflatex

and paste it into TeXstudio.

user855443
  • 1,120
0

If you are using an operating system (such as Linux) that logs you in using a profile, or ~/.bashrc file, you may export the various TeX environment variables there. Then, each time you log in, TeX will use those variables, instead of whatever it sets by itself.

You might also add a line in your .bashrc that will echo whichever version of TeX is enabled, as a reminder to yourself.

rallg
  • 2,379