5

I know a similar question has been asked many times, but I cannot seem to port those answers to my situation.

I have recently installed TeXLive on my Ubuntu 14.04 system. I did this using the install-tl.zip file from texlive.org.

When I try to compile just the basic TeXLive default article, it crashes on every package, giving me (just to pick the first one):

! LaTeX Error: File 'booktabs.sty' not found.

But I know booktabs.sty is on my system:

/usr/local/texlive/2016/texmf-dist/tex/latex/booktabs/booktabs.sty

I have the following lines at the end of my .bashrc:

PATH=/usr/local/texlive/2016/bin/x86_64-linux:$PATH 
export PATH
MANPATH=$MANPATH:/usr/local/texlive/2016/texmf-dist/doc/man
export MANPATH
INFOPATH=$INFOPATH:/usr/local/texlive/2016/texmf-dist/doc/info
export INFOPATH

None of those lines point to the location of any of my .sty files, and I'm not sure what variable should.

Thank you for your help.

cfr
  • 198,882
  • Welcome! You should almost certainly remove MANPATH. However, that's not the problem here, obviously. Can you compile a document on the command line? If not, what does which pdflatex give? (Substitute whichever command you use to compile e.g. which xelatex or which context.) If you can compile at the command line but not in your editor, which editor do you use? – cfr Sep 16 '16 at 01:24
  • Have a look through the answers to http://tex.stackexchange.com/questions/1092/how-to-install-vanilla-texlive-on-debian-or-ubuntu?s=2|0.0000 to see if you've missed anything. For example, it may be that you have a partial Ubuntu installation of TeX as well as the one in /usr/local, in which case you need to remove it but keep your package manager happy. The answers to the linked question explain the details. – cfr Sep 16 '16 at 01:26
  • @cfr Thanks! I only have one pdflatex: which pdflatex /usr/local/texlive/2016/bin/x86_64-linux/pdflatex – bigred_bluejay Sep 16 '16 at 01:29
  • So what does which pdflatex give? Can you compile on the command line? – cfr Sep 16 '16 at 01:30
  • @cfr compiling via command line works using pdflatex test.tex The problem seems to be with TeXWorks. – bigred_bluejay Sep 16 '16 at 01:33
  • You almost certainly have a partial Ubuntu TeX installation as well. You need to get rid of that by following the advice in the posts I linked to above. Then you may need to configure TeXWorks if it doesn't find the binaries automatically. But get rid of the parallel installation first, because TeXWorks may then pick up the right pdflatex without help. If not, you can deal with it then. – cfr Sep 16 '16 at 02:33
  • Thank you for the advice, but I'm not sure about this parallel installation idea. I only have one pdflatex, only one copy of the various packages, my entire ubuntu installation is very fresh and I've only used install-tl once and never the package manager. The solution you linked to offers good instructions on how to install LaTeX initially, but I haven't yet found anything about locating and removing another installation. Can you suggest another test to locate and verify this partial install? – bigred_bluejay Sep 16 '16 at 03:48
  • Sorry for the extended discussion, but i cannot chat. I see your point about the dual install. I installed manually to /usr/local/ but TeXworks comes from the software center and thus seems to look at /usr/share. I'm still trying to parse what the solution might be, but am not clear on that yet. Do you recommend getting rid of the /usr/local, or the /usr/share? – bigred_bluejay Sep 16 '16 at 04:26
  • Did you install TeXworks after adding those lines to your .bashrc (and where did you copy those lines from? the INFO and MAN paths are not, as written, helpful). Although I have never used TeXworks, I wonder: what does 'seems to look at' mean in this context? If which latex returns the right thing, what happens if you open an instance of TeXworks from that shell and try to compile a document? – jon Sep 16 '16 at 06:44
  • I'd stick with the /usr/local installation. The posts I linked to cover how to keep your package manager happy. When you install TeXWorks, Ubuntu will install a rudimentary TeX Live installation as well, unless you have installed a dummy package to satisfy it. – cfr Sep 16 '16 at 12:43
  • @jon - I got those .bashrc lines from the first answer here I've also run across them in several other posts addressing this question. I installed TeXworks long before they were added to my .bashrc file, and furthermore, they seemed to have no impact on my issue. By "seems to look at" I meant that looking at the log file that TeXworks generates, I see many entries listing files located in /usr/share/. – bigred_bluejay Sep 16 '16 at 15:33
  • You are setting your $PATH, $INFOPATH, and $MANPATH in different ways is all (and not identical to what you linked to), but it is no big deal. However, they are fundamentally important to the issue: without setting $PATH, e.g., you would not be able to compile from the command line. Did you try what I suggested in my last question in the previous comment? For my editor it would matter if I changed the path assignment. But it sounds like TeXworks uses $PATH, too, but only after checking the settings in something like 'Preferences' – jon Sep 16 '16 at 15:50
  • @jon. which latex returns /usr/bin/latex. Opening TeXworks via command line then opens an instance which finds the basic .sty files successfully. Unfortunately, the experiment is flawed, because before running that test, I had already implemented the answer below. TeXworks now works fine whether opened from command line or from the icon I have in my launcher. If you can shed some light on why my solution below works, I'd appreciate it. – bigred_bluejay Sep 17 '16 at 17:44

1 Answers1

3

I solved my issue by following the answer by @Dox here.

Specifically, simply running

sudo apt-get -y install texlive-latex-recommended texlive-pictures texlive-latex-extra

fixed my installation.

I confess that I don't entirely understand why that worked, and I would love it if someone would explain why. Using install-tl.tar.gz from TeXlive seems to have installed LaTeX into /usr/local. But that does not come with an editor, like TeXworks. Downloading TeXworks from the ubuntu software center seems to make the editor think that all LaTeX .sty files will be located in in /usr/share. Finally, running the above line of code makes the editor work, yet my /usr/share/ installation doesn't balloon to ~2 GB. I still seem to only have one "full" LaTeX installation in /usr/local (1.8 GB), while /usr/share is very small (100 MB).

I would appreciate any explanation of why this works, or ideas about what is going on behind the scenes of my installation(s?).

Thanks

  • I cannot answer why /usr/share is so small, but you definitely seem to have two different installations. (A simple test: as we know which latex is returning the version installed by Apt, then do you have commands like latex in [something like] /usr/local/texlive/2016/texmf-dist/tex/latex?) Your basic issue is that you tried to install the editor from Apt, but TeX Live for the official sources; and I imagine Apt-installed versions of TeXworks assume you will install TeX Live from Apt as well. But, originally, you did not. – jon Sep 17 '16 at 22:14
  • 1
    You can also check and see which version of a package (e.g., booktabs) is being used by adding \listfiles to the top of your .tex file, compiling the file, and then examining the end of the resulting .log file. – jon Sep 17 '16 at 22:17
  • @jon How do you know that the /usr/bin/latex is the one from apt? Putting \listfiles at the beginning of my document confirms that it is finding the .sty files in /usr/share which is the small installation from apt. I'm considering removing both and trying to install from tug.org again. Can I just rm -r /usr/local/texlive to eliminate that entire install? I'll use my package manager to remove the /usr/share/ version. Thank you for your help. I've been a user of TeX for a while, but have rarely dipped into the behind the scenes things. I appreciate your help and patience. – bigred_bluejay Sep 18 '16 at 20:55
  • I know because I've done it both ways over the years. TUG's version installs into the corresponding year directory under /usr/local/texlive (see your comment below question; and this is why you had to set your PATH variable). I'd do rm -rf /usr/local/texlive/2016 if you want to uninstall it. Then reinstall and make sure the PATH is OK; then I'd install the 'fake version' of TeX Live from Apt (see here); then install TeXworks or your editor of choice. – jon Sep 18 '16 at 21:10