I have recently updated texlive following these instructions and I have set the new path for latex from an old to the new one by adding the line

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

to the end of the /etc/bash.bashrc file, following these instructions.

When running an old .tex file that has already its .log file created I get

! LaTeX Error: File `book.cls' not found.

Actually the whole log file is


This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2017.12.19) 24 DEC 2017 20:14
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
LaTeX2e <2011/06/27>
Babel <3.9h> and hyphenation patterns for 4 languages loaded.
! LaTeX Error: File `book.cls' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)
Enter file name:
! Emergency stop.
<read *>
l.2 ^^M
*** (cannot \read from terminal in nonstop modes)
Here is how much of TeX's memory you used:
10 strings out of 494985
170 string characters out of 6180355
46094 words of memory out of 5000000
3325 multiletter control sequences out of 15000+600000
3640 words of font info for 14 fonts, out of 8000000 for 9000
36 hyphenation exceptions out of 8191
10i,0n,7p,46b,8s stack positions out of 5000i,500n,10000p,200000b,80000s
! ==> Fatal error occurred, no output PDF file produced!

When running an new simple .tex without its .log file I get

Log File not found !

and no .log file is created.

This is weird since I do have book.cls on the right location

$ kpsewhich book.cls

Also my installation seems to be fine since

$ which latex


$ which tex

I followed the instructions of the second link because previously I was not running with a previous version of latex in


Do you know how can I see where texmaker is actually looking for the book.cls file?

Finally I have been careful not to leave any spaces in any name of the path of my .tex file.

I am using Ubuntu 14.04 and as a compiler Texmaker 4.1. Here are the Texmaker preferences

Temaker ComandsQuick BuildEditor

When compiling on terminal I get:

$ pdflatex 0.QFT.tex  
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
 restricted \write18 enabled.

kpathsea: Running mktexfmt pdflatex.fmt
mktexfmt: No such file or directory
I can't find the format file `pdflatex.fmt'!

And the same thing I get when typing latex 0.QFT.tex

  • 2
    Which instructions did you follow to install updatream's TeX Live on which distro? Did you make sure to eradicate your distro's TL packages and install appropriate dummies? Have you logged out and in since changing bash.bashrc? Are you sure this is the correct file to edit? Are you trying to compile on the command line or in an editor? If an editor, try compiling on the command line: does it work? How does the log/console output begin? Which version of TL does it say you are using? 2017 or not? Upstream or distro? Why did you think you needed the second link's instructions? – cfr Dec 25 '17 at 2:50
  • 1
    Can you show your texmaker preferences? – user36296 Dec 25 '17 at 12:17
  • @cfr thanks for the reply. I have brought the file bash.bashrc to its original form and changed the path of tex and latex back to the old one by typing PATH=/usr/bin:$PATH; export PATH on the terminal and I still get the same thing with book.cls and when I compile the .tex file on command line. – giopolykra Dec 25 '17 at 20:42
  • 1
    When you compile on the command line you are using Debian's TeX Live 2013 installation and not the one in /usr/local. It is not recommended to keep your Linux distro's TL installed alongside upstreams's: use the instructions in the linked question to remove it and to avoid a dummy package. – cfr Dec 26 '17 at 3:10
  • Ok I corrected some mistakes but I still have a similar problem. I uninstalled anything related with texlive and did a clean installation again. I think I added the correct paths on configure texmaker commands e.g "/usr/local/texlive/2017/bin/x86_64-linux/xelatex" -interaction=nonstopmode %.tex for xelatex. And I permanently added the paths to /usr/local texlive installation in the .bashrc file. When running a simple test .tex file I get ! LaTeX Error: File `.cls' not found. Oh and by compliling it on command line with pdflatex I get the same thing – giopolykra Dec 26 '17 at 10:51

I did a clean installation of Texlive again and added the lines from the first link

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

to the end of the .bashrc file to make the paths permanent. Finally, I did the trivial thing that forgot to do with the first installation, to change the path to latex, pdflatex, xelatex and lualatex in the Texmaker configuration, e.g for latex

latex -interaction=nonstopmode %.tex


"/usr/local/texlive/2017/bin/x86_64-linux/latex" -interaction=nonstopmode %.tex

,respectively for the rest and the problem was solved. Thanks everyone!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.