I have code like this:
\documentclass[11pt]{report}
\usepackage{minted}
\usepackage{listings}
\begin{document}
\begin{listing}[ht]
\begin{minted}{csharp}
private static string Abc() =>
\$"Abc";
\end{minted}
\caption{Abc}
\label{listing:Abc}
\end{listing}
\end{document}
and i have frame like this (compiled on overleaf):
With Only "$":
How can I get rid of the red frame?
Best Answer
Firstly, you don't need to escape the
$
.This is a
pygments
bug relating to its C# lexer, see https://github.com/pygments/pygments/issues/1573, which has been fixed inpygments
2.10.0, released on August 15th, 2021.Jun 12, 2022 updates:
Unfortunately, Overleaf.com's texlive 2021 still provides
pygments
v2.9.0. You can check by compiling the example below on overleaf:How I find the above info
pygments
parsing error, indicating it's apygments
issue.$
). I also checked$"string"
is a valid C# syntax. All that suggest it's a fixedpygments
issue.pygments
' changelog and search for "c#/csharp". This gives#1573
and found it's exactly the same issue OP encountered.CHANGE
).