5

As the picture shown, the left top picture shows that I have installed Tex Live successfully, but when I input the code 'latex', it shows that I have not installed the latex program and recommends me use the code (the Chinese characters on the picture means that) 'sudo apt install texlive-latex-base', which is shown in the right bottom picture! I wonder why. I installed Tex Live but there is no latex program in my computer

I installed Tex Live according to link

I am beginner of latex, and I'm sorry for ask trival a so simple question.enter image description here

6
  • 1
    In the top left corner terminal, two lines before the end of the install, it is said "Most importantly, add <path> to your PATH for current and future session". It means, that binaries are well installed, but your system doesn't know where to look for them, and thus 'thinks' you have not installed it (and recommend you a way to do it).
    – ebosi
    Oct 17, 2016 at 8:25
  • the message at the top line of the right hand box is telling you to set your PATH (in .profile or similar startup file) to include the 2016 bin directory, have you done that? Oct 17, 2016 at 8:26
  • 1
    Did you do what the last line of the installation output say, namely Most importantly, add /usr/local/texlive/2016/bin/x86_64-linux to your PATH for current and future sessions?
    – gernot
    Oct 17, 2016 at 8:27
  • Please post the results of echo $PATH after you have done what gemot asked (remember, it might be a good idea to log out and in again)
    – daleif
    Oct 17, 2016 at 10:56
  • Thank you, after doing that, the PATH is okay, and latex can compile .tex code. thank you!
    – Zhang
    Oct 17, 2016 at 14:17

1 Answer 1

8

Add the lines

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

to $HOME/.profile. As a user of bash I also have the line

source ~/.profile

in $HOME/.bashrc.

In order for the change to affect not only newly started shells, but also programs managed by the GUI, you have to start a new session.


Problems with evince and a local TeXLive installation under Ubuntu

(This addresses an issue raised in the comments below the answer.)

The document viewer Evince may exhibit two problems when trying to view dvi files in this arrangement.

Evince fails to display dvi files. When starting it from the command line, you see messages like

kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+100/600 --dpi 700 cmss12
mktexpk: Permission denied

Evince is supervised by apparmor, a kernel module for preventing applications from doing mischief, and is forbidden to use TeXLive in \usr\local. You can either switch off supervision completely by

sudo aa-disable /usr/bin/evince

(aa-disable comes with the apparmor-utils package), or you modify the apparmor rules. Add the following lines to /etc/apparmor.d/abstractions/evince:

# TeXlive 2016
/usr/local/texlive/2016/bin/x86_64-linux/mktexpk Cx -> sanitized_helper,
/usr/local/texlive/2016/bin/x86_64-linux/mktextfm Cx -> sanitized_helper,
/usr/local/texlive/2016/bin/x86_64-linux/dvipdfm Cx -> sanitized_helper,
/usr/local/texlive/2016/bin/x86_64-linux/mkofm Cx -> sanitized_helper,
/usr/local/texlive/** r,

and the following lines to /etc/apparmor.d/abstractions/ubuntu-helpers:

# TeXlive 2016
/usr/local/texlive/2016/texmf{,-dist}/web2c/{,**/}* Pixr,
/usr/local/texlive/2016/bin/x86_64-linux/* Pixr,

Insert the lines near similar-looking rules for Ubuntu-TeX. For these changes to take effect without rebooting, issue the command

sudo service apparmor restart

Evince re-generates fonts each time a dvi file is viewed. When starting it from the command line, you see messages like

kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+100/600 --dpi 700 cmss12
mktexpk: /home/someuser/.texlive2016/texmf-var/fonts/pk/ljfour/public/cm/cmss12.700pk already exists.

This is caused by Evince not finding the new configuration file for TeXLive 2016. The problem can be solved by putting a link to it into the folder /usr/local/share/texmf/web2c:

sudo mkdir -p /usr/local/share/texmf/web2c
sudo ln -s /usr/local/texlive/2016/texmf-dist/web2c/texmf.cnf /usr/local/share/texmf/web2c/texmf.cnf

Tested for

  • TeXLive 2016, Ubuntu 16.04, evince 3.18.2

  • TeXLive 2016, Ubuntu 16.10, evince 3.22

36
  • Very thankful for your answer, but after doing as you said, the problem remains as before. I run the command 'latex test.tex' to compile a test code and it shows that: latex program has not been installed.
    – Zhang
    Oct 17, 2016 at 10:36
  • 1
    @Zhang First, try the command /usr/local/texlive/2016/bin/x86_64-linux/latex, to make sure that latex indeed exists in the directory. Then issue echo $PATH on the command line; this gives a list of directories, among them there should be /usr/local/texlive/2016/bin/x86_64-linux. If this is the case, latex on the command line should work.
    – gernot
    Oct 17, 2016 at 11:35
  • Thank you! 'path+latex' works while 'latex' does not, this kind of problem may be caused by the 'PATH variable'. But I added export PATH=/usr/local/texlive/2016/bin/x86_64-linux:$PATH export MANPATH=/usr/local/texlive/2016/texmf-dist/doc/man:$MANPATH export INFOPATH=/usr/local/texlive/2016/texmf-dist/doc/info:$INFOPATH these three line to the file $home/.profile
    – Zhang
    Oct 17, 2016 at 12:09
  • also it does not work. Is it that the Path variable adding not successfully?
    – Zhang
    Oct 17, 2016 at 12:11
  • Which shell do you use? Each shell has rules, which initialisation files are loaded depending whether it is used interactively or non-interactively, whether as login-shell or not. For bash, you also have to modify .bashrc, see above. What do you get when issuing echo $SHELL on the command line?
    – gernot
    Oct 17, 2016 at 12:45

You must log in to answer this question.

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