## Compilation problem

TXS - Help
2012-09-16
2013-02-28
• Hi,

I have a problem compiling my .tex files. I just "migrated" from TeXnicCenter,
where everything worked fine.
I use the default values for the commands and try to build a pdf using
pdflatex.exe. However, this hives the error "pdflatex.exe: Invalid command-
line option". I am at a complete loss as how to correct this problem. Is tere
a common cause for this error? What information would you need to help me
solving the problem?

Thanks, Whistler

• Tim Hoffmann
2012-09-18

What is the result of Help->Check LaTeX Installation? (You may remove
environment variables other than the path, if you do not want to share this
information.)

• Here is the results:

where pdflatex: C:\Program Files\MiKTeX 2.5\miktex\bin\pdflatex.exe

PDFLATEX: pdflatex -v

Environment variables:
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 13, GenuineIntel
COMSPEC=C:\Windows\system32\cmd.exe
CLASSPATH=.;C:\Program Files\Java\jre1.6.0_07\lib\ext\QTJava.zip
HOMEPATH=\Users\My_Name
FP_NO_HOST_CHECK=NO
PROGRAMFILES=C:\Program Files
LOGONSERVER=\NB-My_Name
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
APPDATA=C:\Users\My_Name\AppData\Roaming
PATH=C:\Perl\site\bin;C:\Perl\bin;C:\Program Files\Mendeley
Desktop\wordPlugin;C:\Program Files\Common Files\Microsoft Shared\Windows
Live;C:\Program Files\MiKTeX 2.5\miktex\bin;C:\Windows\system32;C:\Windows;C:\ Windows\System32\Wbem;C:\Program Files\Common Files\Roxio
Shared\DLLShared\;C:\Program Files\Common Files\Roxio
Shared\DLLShared\;C:\Program Files\Common Files\Roxio
Files\Common Files\MDL Shared\ISIS;C:\Program
Files\Haufe\iDesk\iDeskService\;C:\Program Files\QuickTime\QTSystem\;C:\Window
s\System32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\DivX
Shared\;C:\Windows\System32;C:\Program Files\Common Files\Microsoft
Shared\Windows
Live;C:\Python26;C:\Python26\DLLs;C:\Python26\Scripts;C:\Python26\Lib\site-
packages\PyQt4;C:\Python26\gnuplot\bin;C:\Python26\Lib\site-
packages\vtk;C:\Program Files\pythonxy\console;C:\Program
Files\pythonxy\SciTE-2.21;C:\Program Files\pythonxy\mingw\bin
USERDOMAIN=NB-My_Name
QTJAVA=C:\Program Files\Java\jre1.6.0_07\lib\ext\QTJava.zip
OS=Windows_NT
WINDIR=C:\Windows
LOCK_NAME_OVERRIDE_QTSINGLEAPP_TEXSTU_1B4B_1=C:/Users/My_Name~1/AppData/Local/
Temp/qtsingleapp-TeXstu-1b4b-1-lockfile
SYSTEMDRIVE=C:
PROCESSOR_REVISION=0f0d
PUBLIC=C:\Users\Public
TMP=C:\Users\My_Name~1\AppData\Local\Temp
USERPROFILE=C:\Users\My_Name
COMMONPROGRAMFILES=C:\Program Files\Common Files
SESSIONNAME=Console
HOMEDRIVE=C:
PROGRAMDATA=C:\ProgramData
VTK_DATA_ROOT=C:\Python26\VTKData
NUMBER_OF_PROCESSORS=2
PSMODULEPATH=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
ALLUSERSPROFILE=C:\ProgramData
PROCESSOR_LEVEL=6
LOCALAPPDATA=C:\Users\My_Name\AppData\Local
ROXIOCENTRAL=C:\Program Files\Common Files\Roxio Shared\9.0\Roxio Central33\
TEMP=C:\Users\NIEDER~1\AppData\Local\Temp
PROCESSOR_ARCHITECTURE=x86
SYSTEMROOT=C:\Windows
COMPUTERNAME=NB-My_Name

• Tim Hoffmann
2012-09-19

Does it work, if you specify the full path to pdflatex in the config (Options
-> Configure -> Commands -> pdflatex):
"C:\Program Files\MiKTeX 2.5\miktex\bin\pdflatex.exe" -synctex=1
-interaction=nonstopmode %.tex

• No, this does not work, either. I get the attached error message "could not
start..." followed by a "log file not found" error. This happens several times
in a row. I wonder what log file it does need and does not find?

The TexStudio output is

Prozess gestartet: "C:\Program Files\MiKTeX 2.5\miktex\bin\pdflatex.exe"
-synctex=1 -interaction=nonstopmode "Habil".tex
pdflatex.exe: Invalid command-line option
Prozess endete mit Fehler(n)

• ERROR! The markdown supplied could not be parsed correctly. Did you forget to surround a code snippet with "~~~~"?

```I just did another search, and it seems that I am not the only one with this
problem?
[http://sourceforge.net/projects/texstudio/forums/forum/907840/topic/5486141](
http://sourceforge.net/projects/texstudio/forums/forum/907840/topic/5486141)

Any help would be appreciated, as I really would like to discontinue using
TeXnicCenter and move to TexStudio...

Thanks!

```

• Tim Hoffmann
2012-09-25

The log file is the TeX log file, which TXS tries to parse to show errors and
warnings. This second message is no surpise, because pdflatex did not run and
thus did not create the log file.

To narrow down the problem: Enable verbose output by setting Configure ->
Build -> Show stdout to "Always". You need to have advanced options enabled
for this.

Please post the result of a call to pdflatex in this case.

• Hm, I have activated verbose output ( the option is set to "Immer (wenn nicht
nach > dev/null umgeleitet)" ), but the output still is the same:

Prozess gestartet: pdflatex.exe -synctex=1 -interaction=nonstopmode
"Habil".tex
pdflatex.exe: Invalid command-line option
Prozess endete mit Fehler(n)

Is the verbose output redirected to dev/null - wherever I can change this... ?

Thanks again.

• the command start itself fails
how did you set the command pdflatex ?

• can you open a "cmd.exe" and just type in "pdflatex -v"

• Hi,

when I type "pdflatex -v" in cmd.exe, it gives:

pdflatex: Invalid command-line option

• okay, the command should be pdflatex -version

• OK, this time the output is:

MiKTeX-pdfetex 2.5.2579 (1.30.6) (MiKTeX 2.5)
Copyright (C) 1982 D. E. Knuth, (C) 1996-2002 Han The Th
TeX is a trademark of the American Mathematical Society.

• can you try to compile your document from command line (cmd.exe)
it should give the same errors as txs.

• No, it does not behave the same. No "Invalid command-line option"
It runs up to the first error and spits out a log file. TexStudio does not
come this far...

Seems I need to go back to TeXnicCenter where I could compile this file fine?

• OK, not quite true.

If I say "pdflatex file.tex" it compiles fine.

If I say "pdflatex -synctex=1 -interaction=nonstopmode file.tex" it gives me
this "Invalid..." error.

What do these two options mean anyways? Are they important?

• -synctex=1 tells pdflatex to embed position information into the pdf so that forward/reverse search works
-interaction=nonstopmode forces pdflatex to run till the end of the source file and not to wait for user interaction on errors.

Can you try out which if these two options causes the error ?

• okay, i have taken another look at the output of the pdflatex -version run.
You are using miktex 2.5 which is "ancient" (released in 2006).
I suppose your pdflatex does not understand the option -synctex=1.
Could you update to a more modern version of miktex ?

• Yes, this is exaclty what caused the problem.

I had figured this out also yesterday, but could not post it here because my
WLAN turns itself off at 11 pm to remind me to go to bed... ;-)
Thanks for all the efforts - With the most recent miktex it works...

• Slo Down
2013-02-28

Hello,

i did get the same problem with the pdflatex.exe and those two options.
And yes i did get the newest miktex version with all new updates.

Hmm i don't understand i do have the complete mixtek version and when i tried to compile over cmd the program wants to download amsmath and the ther is an error option clash for package xcolor.

any suggestens, thanks

• Tim Hoffmann
2013-02-28

So this is a LaTeX issue, not a TXS one. Likely, you'll get better help in dedicated LaTeX forums like e.g. http://tex.stackexchange.com

Last edit: Tim Hoffmann 2013-02-28