gpoore / minted

minted is a LaTeX package that provides syntax highlighting using the Pygments library. Highlighted source code can be customized using fancyvrb.
1.76k stars 128 forks source link

Windows 10, Miktex 24.4 minted issue results in unknown keys #425

Open nick-petrovsky opened 4 days ago

nick-petrovsky commented 4 days ago

Dear Community,

I am experiencing an issue where the Minted package has stopped functioning on Windows 10 with MikTeX 24.4, resulting in an unusual error code. I have included a minimal example below for your reference.

Package versions (PATH variable is correct and where command locates right executables):

>>python --version
Python 3.10.11
>>mpm --version
MiKTeX Package Manager 4.5 (MiKTeX 24.4
>>pygmentize -V
Pygments version 2.18.0, (c) 2006-2024 by Georg Brandl, Matthäus Chajdas and contributors.
>>latexminted --version
latexminted 0.2.0
Python executable for the LaTeX minted package
Libraries: latex2pydata 0.4.0, latexrestricted 0.5.0, pygments 2.18.0
Repository: https://github.com/gpoore/minted
CTAN: https://ctan.org/pkg/minted
PyPI: https://pypi.org/project/latexminted

Minimal example:

\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}{python}
import numpy
\end{minted}
\end{document}
>> xelatex --shell-escape --halt-on-error test.tex

runsystem(latexminted config  --timestamp 20241125150302 098F6BCD4621D373CADE4E
832627B4F6)...executed.

 (_098F6BCD4621D373CADE4E832627B4F6.config.minted)
runsystem(latexminted cleanconfig  --timestamp 20241125150302 098F6BCD4621D373C
ADE4E832627B4F6)...executed.

(_minted/default.style.minted)
\openout4 = `_098F6BCD4621D373CADE4E832627B4F6.data.minted'.

runsystem(latexminted highlight  --timestamp 20241125150302 098F6BCD4621D373CAD
E4E832627B4F6)...executed.

(_098F6BCD4621D373CADE4E832627B4F6.message.minted)

! Package minted Error: Key "extrakeywords" is unknown and will be ignored.

See the minted package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.6 \end{minted}

Any advices?

gpoore commented 4 days ago

Your minted latex package is up-to-date, but latexminted is 0.2.0 instead of 0.3.x. If latexminted is bundled in MiKTeX, then there is an issue with the MiKTeX packaging. Otherwise, if latexminted is installed manually, then it needs to be updated in the same way it was installed.

There is a check for compatibility on the LaTeX side, but it looks like I missed updating that for 0.3.x in the last minted release, so you're seeing a raw error instead of a compatibility error.

nick-petrovsky commented 4 days ago

Thank you for the clarification! In my case, latexminted is installed separately from the MikTeX distribution. As a temporary solution, it is possible to simply reinstall the latest version using pip by running the following command: pip install --force-reinstall latexminted.