Closed muzimuzhi closed 1 month ago
I don't know if there is an easy way to fix this. The current system for working with pygmentize
is based on the assumption that later options override earlier ones instead of combining. So one solution would involve a complete redesign of pygmentize
option handling. Another possibility is to do gobble
in LaTeX when writing the code to the temp file. That is possible, but will require special handling of UTF-8 code points for pdflatex.
I expect that there are other bugs related to pygmentize
options combining rather than overriding, so even if it's possible to fix this by switching the processing to the LaTeX side, the pygmentize
processing probably needs to be reimplemented anyway.
So one solution would involve a complete redesign of
pygmentize
option handling.
+1 to a general fix for \minted@def@optcl
.
This is fixed in minted
v3.0, which is available as a beta on GitHub and will have a final release soon.
The total effect of
\setminted{gobble=1, gobble=2}
isgobble=3
, but the expected isgobble=2
.From https://tex.stackexchange.com/q/650135
Example:
Currently
gobble
is defined by https://github.com/gpoore/minted/blob/d46f1ba2d248f2f3504bcc795dd39c613bd3c5a0/source/minted.dtx#L2662-L2664 Hence\setminted{gobble=1, gobble=2}
will becomepygmentize
options-F gobble:n=1 -F gobble:n=2
.