# Difference between - and -​- in compiling options

In running MiKTeX

1. What is the difference between -shell=escape and --shell-escape
2. What is the difference between -synctex=1, --synctex=1, and --synctex=-1
-
Following GNU conventions, "long" options should be prefixed by --, in order to distinguish them from "short" options like in ls -l. However, all TeX distributions allow long options to be prefixed by - (and abbreviated as long as they remain unambiguous). – egreg Dec 8 '11 at 13:29
@Andrey: Is that a zero width non breaking space? I was considering doing the same, but now searching for -- won't return this question, will it? I guess this would be a case for a request on TeX - LaTeX Meta to turn off auto-conversion of -- to a dash, at least in titles. I haven't encountered it in post bodies, where it actually might make sense, except for code, of course. But since there's no code markup in titles ... – doncherry Mar 17 '12 at 17:17
@doncherry: Yes, it's a ZWSP. It also seems that -- does not work in search altogether. – Andrey Vihrov Mar 17 '12 at 17:25

-shell=escape is invalid.

The correct syntax is the one starting with two hyphens. The versions with one hyphen (-shell-escape) often works too. But as Christian Schenk, the maintainer of MiKTeX, once wrote:

Please note that the single '-' prefixes a sequence of single-letter options (aka short options). That is, if you specify -unre, you are actually invoking these options:

--update-fndb  --print-only  --user-roots

I would recommend, tha you always specify the "long options" (prefixed by two '-'). The short options (one '-') are only for backward compatibility.

-
For a second, I was wondering who Christian was, then I think I remembered. Hope my edit is correct. – doncherry Mar 17 '12 at 16:59

With regard to question no. 2: --synctex=1 creates a compressed SyncTeX file, while --synctex=-1 creates an uncompressed one. (--synctex=0 would create no SyncTeX file at all.)

-

From the command line help:

-synctex=N Generate SyncTeX data for previewers if nonzero.

-synctex and --synctex are both accepted, so all three variants enable the generation of SyncTeX data.

-shell is an unknown command-line option and produces an error.

--shell-escape seems to be silently accepted. However with MiKTeX 2.9 it is not on the list of options any more. Packages like epstopdf need to be able to “escape to a shell”. In TeX this is done via the \write18 feature. In MiKTeX it is only partially enabled by default to avoid security problems: only well known commands are allowed. You fully enable the feature by specifying --enable-write18 on the TeX command-line.

-
@egreg Yes, that is my understanding too but as uli points out I'm not sure if it is documented – Joseph Wright Dec 8 '11 at 13:47
@uli I believe that MiKTeX 2.9 accepts --shell-escape as well as its traditional --enable-write18, for compatibility with TeX Live. – egreg Dec 8 '11 at 13:52