[Tex/LaTex] Minted Error “Undefined control sequence. \PYG” with TeXmaker

mintedpygmentstexmaker

I have a Windows 10 computer and try to use the minted package to insert vhdl code into my LaTeX file. I did install Python and Pygments and added Python/scripts to the path. I also change the command lines of TeXmaker with -shell-escape. When I try to run a little example like this :

\documentclass[%
    a4paper,            % Papierformat
    oneside,            % einseitiger Druck
    %twoside,           % zweiseitiger Druck
    12pt,               % Schriftgröße
    onecolumn,          % einspaltiger Text
    %twocolumn,         % zweispaltiger Text
    openright,          % Kapitel dürfen nur auf einer rechten Seite beginnen
    openany,            % Kapitel dürfen rechts oder links beginnen
    parskip=half,       % eine halbe Zeile Abstand zw. Absätzen
    headsepline,        % Kopfzeilenlinie
    footsepline,        % Fußzeilenlinie
    bibliography=totoc, % Bibliographie im Inhaltsverzeichnis
    %idxtotoc           % Index im Inhaltsverzeichnis
    ]{scrbook}
\usepackage{minted}
\begin{document}
\begin{minted} {vhdl}
process
begin
  CLK <= '1'; wait for 10 NS;
  CLK <= '0'; wait for 10 NS;
end process;
\end{minted}
\end{document}

I get the error…

Undefined control sequence. \PYG #1#2->\FV@PYG
{#1}{\FancyVerbBreakStart #2\FancyVerbBreakStop } l.2 \PYG{k}{process}
The control sequence at the end of the top line of your error message
was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I'
and the correct spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Best Answer

I had a similar issue in Linux and removing _minted* directory solved the problem. Another option could be to include the minted package with the option cache=false. You can do this by using \usepackage[cache=false]{minted} instead of \usepackage{minted}.

Source: Github issue

Related Question