pyconレクサーでmintedescapeinsideオプションを使用する

Aug 21 2020

何が起きてる?

\documentclass{article}
\usepackage{minted}

\begin{document}

% I want to show the output as latex, this is a minimal repro without any output at all
\begin{minted}[escapeinside=QQ,python3=true]{pycon}
>>> g = str('e_x e_y e_z')
\end{minted}

% works fine otherwise
\begin{minted}[python3=true]{pycon}
>>> g = str('e_x e_y e_z')
\end{minted}

\end{document}

与える

なぜg = str(削除されたのですか?

回答

1 Eric Aug 20 2020 at 23:19

これはpygmentsバグであり、制御不能ですminted。https://github.com/pygments/pygments/issues/1516。

編集:ここでこれを修正するためのPR: https://github.com/pygments/pygments/pull/1517