I have tried my best, but don't seem to get this one right. How do I enable shell escape in MikTeX?
Why XeLaTeX comes with a default for shell escape but not LaTeX?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityA similar question came up recently in a German user forum. The user found the answer in the end with help of this link
You can enable write18 by writing
initexmf --edit-config-file=miktex\config\pdflatex.ini
in DOS. You can get to the DOS window by hitting the windows Start button, click on "run" and write "cmd" (without the quotes obviously, this might also be slightly different for win7, I think there you can write cmd right in the search line that comes up after hitting the start button).
It might as well also work to do Start->run and then paste the above line right into this little run window (see below)
the pdflatex.ini
should open in an editor and you can enter
EnableWrite18=t
save and close the file. Now it should be permanently enabled with pdflatex.
Another way is to pass -enable-write18
to pdflatex. This can usually be done in the editor of your choice. For example in TeXnicCenter it looks something like:
Path of the compiler:
C:\...\pdflatex.exe
(this is set already)
Arguments passed to the compiler
-interaction=nonstopmode -enable-write18 %tm
To do this on WinEdt, do the following:
Go to Options
and click on Execution Modes
(See image below)
Enter --enable-write18
under the pdflatex
Accessories under switches
as shown in the diagram below.
In Windows + TexWorks, when using texify
, I have to add:
--tex-option=--shell-escape
To the tool configuration window:
--shell-restricted
, and to add the executable you want to run to the configuration file.
latex
andxelatex
?-shell-escape
(or whatever MikTeX has for it as a command line option)--shell-escape
or--enable-write18
.preferences
dialog, as described here. So you can add the option-shell-escape
or-enable-write18
to a new command that you are defining. I remember reading somewhere that the-shell-escape
option is not safe (maybe someone can elaborate on this), but I'm not sure and can't find that statement. So, maybe, putting it by default is not a good idea.