ashthespy / Atom-LaTeX

The only LaTeX package you need for typesetting with Atom.
https://atom.io/packages/atom-latex
MIT License
22 stars 9 forks source link

Support highlighting minted listings #260

Open YtvwlD opened 3 years ago

YtvwlD commented 3 years ago

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

ashthespy commented 3 years ago

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

YtvwlD commented 3 years ago

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.)

ashthespy commented 3 years ago

@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