You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i inspected the _minted-* directory of my existing project
I saw these terms at line start of .pygtex files \PYG{g+gp} for prompt Generic.Prompt, and \PYG{g+go} before output lines Generic.Output, or
sometimes even this \PYG{l+s+s1} before Bye lol Literal + String + ?
i noticed that \PYGZ*{} is just like x/html character entities, so, gt >, hy -, bs \, sq ' (single quotes)
i created a Minimal working example
actually, it was for asking the question, but it immediately led myself to discover the hack
i inspected the same _minted-* dir of this MWE and
noticed the files bw.pygstyle default.pygstyle *.pygtex
i immediately opened both style files and searched for go and found this following line in default.pygstyle defining the grayscale color (all 3 arguments to color of same value)
I guarded this inside \makeat* and pasted in my preamble. and voilla, it worked :)
@goyalyashpal Thanks for the nice idea to make style modifications from within the latex file! That's indeed very helpful if one would like other people to be able to compile the document, e.g. a package docu to be submitted to ctan or a journal article.
I think you were lucky that the bw style doesn't change \PYG@tok@go. Otherwise the style might have overwritten your changes. You can avoid this problem by smuggling your changes in later:
Prelude
I am using
console
orpsql
)style=bw
i wanted to make the output tokens from style=bw to appear just like they do in default style i.e. light gray, since:
style=bw
, the output is not differentiated from the command line (prompt + command) in any way,Details
So,
_minted-*
directory of my existing project.pygtex
files\PYG{g+gp}
for promptGeneric.Prompt
, and\PYG{g+go}
before output linesGeneric.Output
, orsometimes even this
\PYG{l+s+s1}
beforeBye
lolLiteral
+String
+ ?\PYGZ*{}
is just like x/html character entities, so,gt >
,hy -
,bs \
,sq '
(single quotes)actually, it was for asking the question, but it immediately led myself to discover the hack
_minted-*
dir of this MWE andbw.pygstyle default.pygstyle *.pygtex
go
and found this following line indefault.pygstyle
defining the grayscale color (all 3 arguments to color of same value)\makeat*
and pasted in my preamble. and voilla, it worked :)Cons and Alternates
bw.pygstyle
but it would be very volatile and not very "setup once & forget" methodmakeat
inside the\newmintedfile
's body, but it didn't compilebut anyhow, What better way of doing this would you suggest? 😃
MWE source
Screenshots
original screenshot
screenshot after modification:
References:
minted/source/minted.sty
Line 494 in 13e25d0
The text was updated successfully, but these errors were encountered: