0

I'm trying to have both MikTex and TexLive working on my Ubuntu Linux. Both the tex distros have been installed through apt-get. I know this is related to settings on the PATH variable. So what I did is:

Find TexLive executables location:

whereis texlive

That gives:

texlive: /usr/local/texlive /usr/share/texlive

so I added the first one to the PATH, by making sure it comes as first:

PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH ; export PATH

Checking the PATH indeed gives:

/usr/local/texlive/2018/bin/x86_64-linux:/home/stefano/mpich-install/bin:/home/stefano/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

However, if I do:

tex --version

Still I get:

MiKTeX-TeX 2.9.6300 (3.14159265) (MiKTeX 2.9.6700) Copyright (C) 1982 by D. E. Knuth; all rights are reserved. TeX is a trademark of the American Mathematical Society. using bzip2 version 1.0.6, 6-Sept-2010 compiled with curl version 7.58.0; using libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3 compiled with expat version 2.2.5; using expat_2.2.5 compiled with liblzma version 50020022; using 50020022 compiled with MiKTeX Application Framework version 2.6636; using 2.6636 compiled with MiKTeX Core version 6.6704; using 6.6704 compiled with MiKTeX Archive Extractor version 1.6300; using 1.6300 compiled with MiKTeX Package Manager version 2.6700; using 2.6700 compiled with openssl version OpenSSL 1.1.0g 2 Nov 2017; using OpenSSL 1.1.0g 2 Nov 2017 compiled with uriparser version 0.8.4 compiled with zlib version 1.2.11; using 1.2.11

And the same goes for pdflatex and xelatex. Notice that:

which pdflatex

Gives:

/home/stefano/bin/pdflatex

Which is actually a symlink as I can see from:

ls -lah | grep pdflatex

Output:

lrwxrwxrwx  1 root    root      22 mag 29 14:37 pdflatex -> /usr/bin/miktex-pdftex

What I'm missing?

5
  • the question seems more about shell (bash?) setup than about tex, so this may not be the best place to ask, however what does type -a pdflatex report? Commented Jun 25, 2018 at 18:09
  • also what does pdflatex --version report Commented Jun 25, 2018 at 18:11
  • ONT: what editor are you using? OFT: do you wish to cross-compile or compile sequentially?
    – naphaneal
    Commented Jun 25, 2018 at 21:10
  • @DavidCarlisle pdflatex --version gives exactly the same as tex --versionreported above. Yes, I'm using bash shell. The command type -a pdflatex gives pdflatex is /home/stefano/bin/pdflatex pdflatex is /usr/bin/pdflatex. Commented Jun 26, 2018 at 7:39
  • @naphaneal I'm using TexStudio. I guess sequentially. I would just want to compile through pdflatex (from terminal or from editor, whatever) either referring to MikTex or TexLive. So simply switch between distros as I need to. Commented Jun 26, 2018 at 7:45

1 Answer 1

0

You only have the miktex pdflatex in your path (it isn't clear why you would ever want both) type -a pdflatex showed you all the tex's you have in your path, and you only have two, the one in your home area which is symlinked to miktex and the ubuntu system texlive which will be the one in /usr/bin.

You added /usr/local/texlive/2018/bin/x86_64-linux to your path but (I assume) if you look there you will not see a tex, that is the default directory for the upstream texlive if you install it directly from the installer from TUG. If you use your linux distro's apt-get then you get a customised texlive that does not install there but in the system /usr/bin.

So you just need /usr/bin or /home/stefano/bin at the front of your path to switch between the two.

2
  • Now all makes sense and of course it works. Thank you for the explanation. If you want to know why I want both: it's just because I have a bug with a scientific journal template that I know in TexLive has already been fixed. I just did not want to uninstall MikTex, since, the other month, exactly happened the opposite. Commented Jun 26, 2018 at 9:02
  • @S.G.Rinaldo installing thousands of files in a completely separate tex distribution seems a somewhat extravagant way to update a .cls file that would only be a a few k in size, but perhaps I show my age, and disk space is cheap these days:-) Commented Jun 26, 2018 at 10:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .