20

I have a problem with LaTeX. I have installed MiKTeX 2.9 and Texmaker, and when I try to compile a .tex file in Texmaker, I get the error

Could not start the command

When I try to build it from the terminal (using pdfLaTeX) it works, though.

By the way, I have found the same question here, but when I try to do as in the answers (i.e., go to options > configure and then choose the correct documents for LaTeX and pdfLaTeX) it doesn't work. What can I do, other than build my files every time from the terminal?

My configuration

  • Have you made sure latex and friends are in your path? – Sean Allred Apr 05 '13 at 22:56
  • @SeanAllred: Sorry, what do you mean with this? – Daniel Robert-Nicoud Apr 05 '13 at 22:58
  • Assuming you're using the standard command line, could you reply with the output of typing $PATH into your terminal? – Sean Allred Apr 05 '13 at 23:01
  • 1
    Actually, after re-reading your question, I don't suppose that will help much. If it works from the command line, then it's in your $PATH. What exactly is your configuration for TeXMaker? Are you sure you're starting 'Quick Build'? Try just doing 'pdfLaTeX' from the drop-down, maybe? – Sean Allred Apr 05 '13 at 23:04
  • @SeanAllred: I don't understand what you want me to do. Please, tell me step by step what I have to do. To compile a file I change directory to get to the folder my file is in, then type pdflatex filename.tex, and that's it. – Daniel Robert-Nicoud Apr 05 '13 at 23:04
  • For the record, all you would do is open your terminal and type in $PATH and then hit enter. It'll spit out it's contents, which is a list of directories that contain commands/programs that are always available. – Sean Allred Apr 05 '13 at 23:06
  • Try Tools→PDFLaTeX (or press F2). What happens? Just to be on the safe side, you could also add a screen shot of your options→configure to your question here. – doncherry Apr 05 '13 at 23:11
  • @SeanAllred: Oh, then yes. In my path I have MikTeX 2.9\miktex\bin\x64 – Daniel Robert-Nicoud Apr 05 '13 at 23:11
  • @SeanAllred: A developement: After checking the path in the terminal I changed a bit the path for PdfLaTeX in the configuration to match the object in the path. Now it seems to compile, but it gives me only errors and no output pdf. the errors are the same as for F2. Any idea of what could be the cause? – Daniel Robert-Nicoud Apr 05 '13 at 23:18
  • My hypothesis is: now I have the correct thing for PdfLaTeX, but not for LaTeX. Problem: I don't know to what I should change the latter... – Daniel Robert-Nicoud Apr 05 '13 at 23:19
  • You seem to have the 64-bit MiKTeX installed? I suppose a picture of your configuration would still be helpful. – doncherry Apr 05 '13 at 23:22
  • @doncherry: I posted a screen of my configuration. – Daniel Robert-Nicoud Apr 05 '13 at 23:28
  • 2
    @DanielRobert-Nicoud There we go ... LaTeX should be latex -interaction=nonstopmode %.tex and pdfLaTeX pdflatex -synctex=1 -interaction=nonstopmode %.tex. – doncherry Apr 05 '13 at 23:30
  • 1
    @doncherry: Wow! It worked! Thank you very, very much! Post your comment as an answer and I'll mark it as the accepted answer, if you want. – Daniel Robert-Nicoud Apr 05 '13 at 23:33
  • @Close-Voters: While this specific problem is quite localized (i.e. not very many people will try to compile with latexsym.sty), the general problem (wrong configuration of Texmaker) is decently widely applicable, and I tried to make my answer equally broadly helpful. No need to close imho. – doncherry Apr 05 '13 at 23:57

3 Answers3

17

The paths to your LaTeX und PdfLaTeX are wrong. latexsym.sty is a package, which isn’t ever gonna compile anything, and pdfetex.exe is a compiler, but definitely not the one you’re looking for (see e.g. Glossary of TeX and LaTeX terms). If MiKTeX is in your PATH varible (which usually is the case if you installed it normally), you don’t need to specify the full path to the directory, the name of the compiler/program with the desired options is entirely sufficient. Basically, you just enter what you would enter when compiling from the command line, just with %.tex as a placeholder for the file to compile. So here’s the right (standard) configuration:

LaTeX: latex -interaction=nonstopmode %.tex

PdfLaTeX: pdflatex -synctex=1 -interaction=nonstopmode %.tex

doncherry
  • 54,637
7

Sorry for opening an old issue, but the above did not work for me. What worked for me was to "Refresh FNDB" from MiKTeX Options (Start -> MiKTeX 2.9 -> Maintenance -> Settings). Note also that a warning box popped up after clicking Settings, which goes away after refreshing FNDB.

Richard
  • 71
  • For those are using windows 8.0 or 8.1 (although 10 has been released shortly), they may go to start screen rather than start menu (it's not exist actually), and open MiKTeX sitting, some details. Perfect, this helped me a lot; I should not say... but, I had to ... – AlFagera Nov 25 '15 at 09:29
7

(This is a bit different than the OP's problem, but the error message is the same. I hope this helps someone else:)

Having never used LaTeX before, I started off by installing Texmaker, and encountered this error. I didn't know that the LaTeX tool is not bundled with the editor, and must be installed separately.

In my case, I was able to fix the above error message by downloading the proTeXT tool from the LaTeX site:

http://www.latex-project.org/

...and running the MikTeX installer.

RMorrisey
  • 171