I am trying to compile a tex file on ubuntu 14.04 but I get a very strange error.

When I do:

"latex nextwim.tex"

I get:

"This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) restricted \write18 enabled.
entering extended mode
! I can't find file `nextwim.tex'.
<*> nextwim.tex

(Press Enter to retry, or Control-D to exit)
Please type another input file name:"

I am in the same directory as the file:

"ls -lh nextwim.tex"


-rw-rw-r-- 1 timothy timothy 35K aug. 19 16:37 nextwim.tex

Maybe on ubuntu I need to set some variable to "." to let latex search the current directory?

  • Try to see what latex means for your system, maybe it points to a shell script or something wrong. Type which latex at the command prompt in the folder where nextwim.tex is and follow the returned link to inspect. Try pdflatex nextwim (or xelatex, lualatex) just to see if those engines can see the file in the current folder. Also try cat nextwim.tex -- this should list the file on the screen if it's in the current folder. – alwaysask Aug 22 '16 at 22:19
  • Try a command kpsewhich -progname=latex -var-value TEXINPUTS to see if a period for the current directory is printed or not. – Akira Kakuto Aug 22 '16 at 23:09
  • @AkiraKakuto: thanks for the idea - it seems that TEXINPUTS was empty, and adding TEXINPUTS=.:$TEXINPUTS to my .bashrc file fixed the problem – DingoTim Aug 23 '16 at 6:38

Your Answer

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

Browse other questions tagged or ask your own question.