minted icon indicating copy to clipboard operation
minted copied to clipboard

'latexminted' is not recognized as an internal or external command, operable program or batch file.

Open ArsaiGit opened this issue 4 months ago • 3 comments

I know that this problems has been come up in somewhat similiar forms in other issues, but none of the fixes mentioned seem to work anymore and I'm unsure what exactly is the problem. Any ideas, tipps or hints are greatly appreciated.

Problem in short

I'm using MikTeX and LuaLaTeX on Windows 10 and can't get minted to run on a new system, despite successfully using it in this constellation in the past. I think I have adhered to all instructions (hopefully) for minted v3.x, but am still not getting anywhere

  • minted version 3.7.0 is installed via MikTeX
  • python version 3.13.5 is installed via miniconda and available through PATH

In order to try some of the common workaround, also:

  • pygmentize version 2.19.1 is installed via pip and available through PATH
  • latexminted version 0.6.0 is installed via pip and avialable through PATH

Errors and MWE

I can reproduce the problem consistently with as little as the following MWE (compiled with LuaLaTeX):

\documentclass{scrarticle}
\usepackage{minted}

\begin{document}
	
	\begin{minted}{latex}		
		Your Code here
	\end{minted}
	
\end{document}

Each time I am greeted by several different error messages, all amounting to a similar problem:

  • Package minted Error: Cannot highlight code (minted executable is unavailable or disabled); attempting to typeset without highlighting. \end{minted}
  • Package minted Error: minted v3+ executable is not installed, is not added toTORY environment variable. \end{minted}

Possible Solutions

Compiling with --shell-escape enabled to go through pythons latexminted yield the same errors, with the additional compilation message

'latexminted' is not recognized as an internal or external command, operable program or batch file.

and the slight change of the second error message to Package minted Error: minted v3+ executable is not installed or is not added ut setting a TEXMF_OUTPUT_DIRECTORY environment variable. \end{minted}

I do understand the implications of the errors, but they don't make sense to me. All required executables are available through PATH, are they not?

I am aware that issue https://github.com/gpoore/minted/issues/419 mentiones something about the TEXMF_OUTPUT_DIRECTORY environment variable. However, this compilation does not utilize --aux-directory or --output-directory or similar, so this shouldn't be needed from my understanding? Even though, I don't know how the set this variable properly anyway...


TL;DR: I can't get minted to work with MikTeX and LuaLaTeX on Windows 10. Probably it is something silly I missed or got wrong, but I'm kind of at the end of my rope and thankful for any advice.

Cheers

ArsaiGit avatar Aug 10 '25 00:08 ArsaiGit

I'd suggest checking to make sure that the latexminted that you installed has precedence on PATH over the latexminted that MiKTeX creates.

MiKTeX has never packaged minted v3 properly because it omits the bundled Python libraries that make it unnecessary to do any separate Python installation (there was an issue in the MiKTeX repo, but it was automatically closed). As a result, installing minted with MiKTeX correctly installs the minted LaTeX package (minted.sty), but also creates a non-functional latexminted executable. So you have to install latexminted yourself and make sure it has precedence on PATH.

gpoore avatar Aug 11 '25 14:08 gpoore

Thank you very much for your answer and suggestions. Sadly, any modifications to the PATH variable priority order did not have any effect at all, with identical problems to before.

However on the bright side, I found a workaround: copying the latexminted.exe executable installed by pip from it's python-location (in my case \miniconda3\Scripts\) into the MikTeX binary folder (in my case buried in \AppData\Local\Programs\MiKTeX\miktex\bin\x64\) somehow solved the issue. It seems not even the broken executable was present in the folder it's supposed to be in.

Now all files compile, provided of course --shell-escape is still used, and seem to be fine from what I can tell. I don't know if this is a reproducable fix or if something in my installation just went really wrong, either way I hope it will maybe help someone else with a similar problem.

On a semi-related note: do you think it's worthwhile opening a new issue at MikTeX to try to get them to fix it permanently? You mentioned a previous one just getting auto-closed.

ArsaiGit avatar Aug 11 '25 23:08 ArsaiGit

I'm glad you got it working. It sounds like there may have been some strange issues related to PATH.

It might be worth opening a new MiKTeX issue...the last time I looked, a lot of issues were being closed automatically, so I haven't tried again myself yet.

gpoore avatar Aug 12 '25 00:08 gpoore