[Tex/LaTex] pdflatex cannot find the .tex file

miktexwindows

For some strange reason pdflatex.exe apparently can't find the .tex file I'm trying to process in the Windows terminal.

I open the terminal, navigate to the appropriate folder and enter the following command:

\miktex\bin\pdflatex.exe test.tex 

I get the following error message:

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) 
entering extended mode 
! I can't find file `test.tex'. 

I'm 100% sure that I'm in the correct directory and that the file test.tex is there.

Any help would be greatly appreciated!

Best Answer

Your version of MiKTeX seems to be a little bit outdated.

My current version is:

pdfTeX, Version 3.14159265-2.6-1.40.15 (MiKTeX 2.9), yours is

pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9).

Please update your tex distribution.

If your MikTeX is well installed the following is working:

  1. Open Windows terminal
  2. Change to the directory with test file HelloWorld.tex: cd test. You will see something like (I didn't change the language German, no problem here):

Verzeichnis von C:\Users\Internet\Desktop\LaTeX\TeX.SX\test

  1. Test, that the file is there: dir Helloworld.*. Should result in:

    08.02.2015 23:06 76 HelloWorld.tex

    1 Datei(en), 76 Bytes

  2. Type: pdflatex HelloWorld. The last two lines on sreen are:

    Output written on HelloWorld.pdf (1 page, 12439 bytes).

    Transcript written on HelloWorld.log.

  3. Check result: dir HelloWorld.*. You should see:

    Verzeichnis von C:\Users\Internet\Desktop\LaTeX\TeX.SX\test

    08.02.2015 23:20 9 HelloWorld.aux

    08.02.2015 23:20 5.317 HelloWorld.log

    08.02.2015 23:20 12.439 HelloWorld.pdf

    08.02.2015 23:06 76 HelloWorld.tex

    4 Datei(en), 17.841 Bytes

    0 Verzeichnis(se), 427.102.679.040 Bytes frei

The simple MWE HelloWorld.tex for this is:

\documentclass{scrartcl}
\begin{document}
Hello World!
\end{document}

There should be no need to give the path for pdflatex. Windows should recognize the right path to the program pdflatex.exe. If not you have a problem with your installation and I would suggest to install the current MiKTeX!

Hope this helps you ...