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 think texcomments is the only thing that I am still missing, everything else works perfectly for me now. I have tried playing around with the code a little, but not luck so far.
How would I detect if content is inside a comment or not?
How would I detect if content is inside a comment or not?
The result of the call to highlighter.codeToThemedTokens() includes not only the color with which to highlight a token, but also an explanation. This explanation tells you the kind of token, which in Visual Studio Code lingo is called a scope. You can inspect the scope to determine if a token is a comment.
To learn more about this, you can play around in Visual Studio Code: open a file, hit ⌘⇧P, activate the option Developer: Inspect Editor Tokens and Scopes, and move your cursor around:
That said, I must admit that when I implemented the support for mathescape I did none of this. I don’t check whether a token is a comment; I simply check if a token contains $, which is a hack that works most of the time.
#6 (comment)
stripnl
See formatter options at https://pygments.org/docs/formatters/#LatexFormatter
The text was updated successfully, but these errors were encountered: