1

I'm currently trying to install Minted on Windows 10 and TexMaker. To do this, I'm following the installation instructions here. My current issue is that I followed these instructions, and when attempting to compile a small file to verify the installation is correct, TexMaker hangs (and doesn't even throw an error).

\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}[mathescape,
               linenos=false,
               numbersep=5pt,
               gobble=2,
               %showspaces,
               frame=lines,
               framesep=2mm,
               %fontfamily=
               %fontsize=\tiny{matlab}
               ]{Matlab} 
     for i=1:10 
        i=i+1;
     end
 \end{minted}
\end{document}

I'm aware to compile a file using minted one has to invoke -shell-escape. I ran pdflatex -shell-escape | pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex to compile it. When I run with TexMaker's QuickBuild (which I have setup as "PdfLaTex+View PDF", I quickly get the following errors:

! Package minted Error: You must invoke LaTeX with the -shell-escape flag.See the minted package documentation for explanation.Type H <return> for immediate help.... \begin

! Emergency stop.<read 2> \begin{document}

! ==> Fatal error occurred, no output PDF file produced!

I also get the warning:

Package ifplatform Warning:shell escape is disabled, so I can only detect \ifwindows.

I've verified I have python version 3.4.3 installed, and running pip install Pygments outputs Requirement already satisfied, along with the directory Pygments is installed in. I've verified Pygments is updated using pip and --upgrade (although it just tells me it's up to date, and not which version).

I've also checked that I have all the correct packages installed using \IfFileExists{foobar.sty}{true}{false} as suggested in this question. I get true for each package except for shellesc.sty, which I'll look into after posting this (I'm unsure if I need it yet).

Finally, I've used the above method to check if minted.sty is installed, which it is.

Does anyone know what might be causing TexMaker to hang, or further things I can try to at least get it to give me an error?

EDIT: While attempting to check if I'm compiling through LuaTex (which I believe I'm not, but haven't verified yet), I've found that my --shell-escape build was causing TexMaker to hang even when attempting to compile a file without minted.sty. This leads me to believe that running pdflatex -shell-escape | pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex is causing the issue.

1 Answers1

1

It appears that pdflatex -shell-escape %.tex|pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex works. This doesn't open up the compiled document in the internel PDF viewer, but adding "C:/Program Files (x86)/Adobe/Reader 11.0/Reader/AcroRd32.exe" %.pdf onto the end of it seems to. I'll leave this question up for a few hours in case I'm doing something egregiously wrong, but this appears to solve my problem.

  • 4
    I don't see why you use a pipe. pdflatex -synctex=1 -interaction=nonstopmode -shell-escape (or --enable-write18 under MiKTeX) %.tex works fine. Comment aside: Acrobat Reader locks .pdf files, and you have to close it before making a new compilation. You'd better use the much lighter and faster SumatraPDF. – Bernard Aug 25 '16 at 22:57
  • For your suggestion, do I use --enable-write18 in place of -shell-escape, or which part? – Mark Schultz-Wu Aug 25 '16 at 23:01
  • Your distribution is MiKTeX? Personally, I have --enable-write18 because I read so once, but I think it understands both (I use it for auto-pst-pdfwith pstricks files). – Bernard Aug 25 '16 at 23:45
  • I'm on MiKTex. It seems like both of them likely work and serve a similar purpose. – Mark Schultz-Wu Aug 25 '16 at 23:52