Atom-LaTeX icon indicating copy to clipboard operation
Atom-LaTeX copied to clipboard

Support highlighting minted listings

Open YtvwlD opened this issue 4 years ago • 3 comments

Code inside a lstlisting block is highlighted as code. It would be nice if this would work for minted as well.

YtvwlD avatar Oct 25 '20 15:10 YtvwlD

Could check if adding minted directly here works? (so replace lstlisting with minted in your local latex.cson)

https://github.com/ashthespy/Atom-LaTeX/blob/0f4da57ea3760374934f6c778d5033191634549b/grammars/latex.cson#L160-L206

PS: You can directly edit your package files by going to settings>packages>Atom-Latex>View Code, and relaunch atom with ctrl+shift+f5

ashthespy avatar Oct 26 '20 18:10 ashthespy

It works to some extend. But it requires me to write \begin{minted} % Python instead of \begin{minted}{Python}, so minted doesn't get the language anymore. (And it also only works for a few languages, but that's the same as with lstlistings.)

YtvwlD avatar Oct 27 '20 12:10 YtvwlD

@YtvwlD if you are up to test and open up a PR, you could try porting (well copy pasting) https://github.com/yudai-nkt/language-tex/pull/5

ashthespy avatar Oct 27 '20 22:10 ashthespy