I want to use the LaTeX package getmap to create maps in my pdf-documents. I use Windows 10, MikTex 2.9, and the editor TexWorks in XeLaTeX mode. The getmap manual (p.12) tells me I have to enable \write18 by using the command --enable-write18 in MikTex.

Unfortunately, I have not clue as to how to add this command to my system.

How do I add the command?

Can it be added permanently?

Will getmap work with XeLaTeX?

  • 2
    do not add it permanently. It is disabled by default with good reason. If you run with shell escape enabled and you run any tex document that you find on the internet (eg this site) then it could do anything that you could do on the machine. delete all your files, mail your files to some other site.... – David Carlisle Apr 12 '19 at 15:41
  • 2
    in the texworks properties, tab "typesetting" (or something like that) create a new profile e.g. xelatex-shell-escape, copy the settings from the existing xelatex profile and add --shell-escape to the arguments. – Ulrike Fischer Apr 12 '19 at 15:43
  • Once -shell-escape is active the getmapdl (map downloader) application should be available to use from any file format. To test if it is an active package in MiKTeX run MiKTeX-console and look for the package installed date also there will be an example tex file in the MiKTeX texmfs\install\doc\latex\getmap folder to copy then play with – user170109 Apr 23 '19 at 13:18

Yes getmap example will work with XeLaTeX (as stated by the author Josef in comments below it should work with all engines not just pdfLaTeX) so here is the package example that was processed by XeLaTeX and a string of instructions to add shell escape to existing typesetting choices (note David Carlisle's warning to NOT USE these elevated compilation commands on files or links you do not trust)

I show how to modify both pdfLaTeX and XeLaTeX in image below but you only need to modify XeLaTeX as desired.

Sorry after posting I found the TeXworks editor modifies your existing commands NOT added a new one so you need to do as Ulrike mentioned add a new "Tool Configuration" and copy the XeLaTeX settings WITHOUT shell escape (slowly/carefully) so you have a choice of both.

enter image description here

  • As author of getmap, I just want to add that there is no implicit recommendation to use pdflatex! Read the hint in the example as 'You must use the --shell-escape switch'. The download of maps will work will all engines. Otherwise nice answer! ;-) +1 – Josef Apr 13 '19 at 9:30
  • Thanks! I will test out your solution. – myotis Apr 23 '19 at 10:43
  • if a add \usepackage{getmap} the compilation process stops at this point: ("C:\Users\esdo\AppData\Local\Programs\MiKTeX 2.9\tex/latex/oberdiek\rerunfilec heck.sty")). What can be wrong? I am using windows10, and TexWorks – myotis Apr 23 '19 at 11:49
  • Generally had no issues so need to doublecheck how you configured and what file commands you are running I see no evidence of running that sty file so which tex file are you running if it is one of your own we would need a small version in the question with a preamble to see what triggers that sty file – user170109 Apr 23 '19 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.