# Question on the syntax of the options of pdflatex, latex, etc.: difference between -shell-escape and --shell-escape?

What is the difference between

pdflatex -shell-escape myFile.tex

and

pdflatex --shell-escape myFile.tex

?

-
For TeX Live nothing, but in general it depends on the program (see). Some programs use - for short options and -- for long options. –  StrongBad Apr 9 at 16:52

# TeX Live

TeX Live is based on Web2C, from its documentation:

3.1 Option conventions

To provide a clean and consistent behavior, we chose to have all these programs use the GNU function getopt_long_only to parse command lines. However, we do use in a restricted mode, where all the options have to come before the rest of the arguments. As a result, you can:

• use - or -- to start an option name;

• use any unambiguous abbreviation for an option name;

• separate option names and values with either = or one or more spaces;

• use filenames that would otherwise look like options by putting them after an option --.

By convention, non-option arguments, if specified, generally define the name of an input file, as documented for each program.

If a particular option with a value is given more than once, it is the last value that counts.

For example, the following command line specifies the options foo, bar, and verbose; gives the value baz to the abc option, and the value xyz to the quux option; and specifies the filename -myfile-.

-foo --bar -verb -abc=baz -quux karl --quux xyz -- -myfile-

# MiKTeX

MiKTeX uses -- in the option descriptions for TeX, from the documentation:

--enable-write18

Fully enable the \write18{command} construct. [...]

• Also the single hyphen form - works. The documentation even contains an instance of the single hyphen form (unless it's a typo):

When called as initex (or when the -initialize option is given)

• MiKTeX uses different option names in many cases, however the TeX LaTeX equivalents work mostly (I have not tested all cases). AFAIK this is an undocumented feature. Examples for mappings from TeX Live to MiKTeX names:

• --shell-escape--enable-write18

• --shell-restricted--restrict-write18

• --no-shell-escape--disable-write18

-

If I run pdflatex -help on a machine with TeX Live, I get

Usage: pdftex [OPTION]... [TEXNAME[.tex]] [COMMANDS]
or: pdftex [OPTION]... \FIRST-LINE
or: pdftex [OPTION]... &FMT ARGS
Run pdfTeX on TEXNAME, usually creating TEXNAME.pdf.
Any remaining COMMANDS are processed as pdfTeX input, after TEXNAME is read.
If the first line of TEXNAME is %&FMT, and FMT is an existing .fmt file,
use it.  Else use `NAME.fmt', where NAME is the program invocation name,
most commonly `pdftex'.

Alternatively, if the first non-option argument begins with a backslash,
interpret all non-option arguments as a line of pdfTeX input.

Alternatively, if the first non-option argument begins with a &, the
next word is taken as the FMT to read, overriding all else.  Any
remaining arguments are processed as above.

If no arguments or options are specified, prompt for input.

-draftmode              switch on draft mode (generates no output PDF)
-enc                    enable encTeX extensions such as \mubyte
-etex                   enable e-TeX extensions
[-no]-file-line-error   disable/enable file:line:error style messages
-fmt=FMTNAME            use FMTNAME instead of program name or a %& line
-halt-on-error          stop processing at the first error
-ini                    be pdfinitex, for dumping formats; this is implicitly
true if the program name is `pdfinitex'
-interaction=STRING     set interaction mode (STRING=batchmode/nonstopmode/
scrollmode/errorstopmode)
-ipc                    send DVI output to a socket as well as the usual
output file
-ipc-start              as -ipc, and also start the server at the other end
-jobname=STRING         set the job name to STRING
-kpathsea-debug=NUMBER  set path searching debugging flags according to
the bits of NUMBER
[-no]-mktex=FMT         disable/enable mktexFMT generation (FMT=tex/tfm/pk)
-mltex                  enable MLTeX extensions such as \charsubdef
-output-comment=STRING  use STRING for DVI file comment instead of date
(no effect for PDF)
-output-directory=DIR   use existing DIR as the directory to write files in
-output-format=FORMAT   use FORMAT for job output; FORMAT is `dvi' or `pdf'
[-no]-parse-first-line  disable/enable parsing of first line of input file
-progname=STRING        set program (and fmt) name to STRING
-recorder               enable filename recorder
[-no]-shell-escape      disable/enable \write18{SHELL COMMAND}
-shell-restricted       enable restricted \write18
-src-specials           insert source specials into the DVI file
-src-specials=WHERE     insert source specials in certain places of
the DVI file. WHERE is a comma-separated value
list: cr display hbox math par parend vbox
-synctex=NUMBER         generate SyncTeX data for previewers if nonzero
-translate-file=TCXNAME use the TCX file TCXNAME
-8bit                   make all characters printable by default
-help                   display this help and exit
-version                output version information and exit

Email bug reports to pdftex@tug.org.

This shows that options can be specified starting with a single hyphen; two are legal, though, in order to conform to GNU guidelines. You see that there's no one letter option, so it's not important to distinguish between “short” and “long” options.

Options can be abbreviated as long as they are unambiguous. So

pdflatex -shell-e

is equivalent to

pdflatex -shell-escape
-