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

wrong colors #253

Open Dario-Rosa85 opened 4 years ago

Dario-Rosa85 commented 4 years ago

Could you help me in detecting why, after the following command

\newcommand{\be}{\begin{equation}}

the color palette becomes wrong, with the plain text becoming green? I attach a screenshot to show what I mean.

2020-06-26

ashthespy commented 4 years ago

The current syntax highlighting is accomplished using a set of regex rules

So when you define your \begin{equation} as it doesn't find a corresponding \end{equation} it highlights the rest of the document as an "equation" - hence green. If I were you, I wouldn't use such commands, and use the autocomplete functionality baked into the package to do this.

Dario-Rosa85 commented 4 years ago

Thank you! now it works

Dario-Rosa85 commented 4 years ago

sorry. I have another example of weird highlighting: why after $\hat \gamma^i$ it remains in equation mode until the end of the period?

2020-06-30 (1)

Aerijo commented 4 years ago

That is unrelated; for this kind of grammar Atom limits the number of syntax tokens per line, as well as the parsed line length for performance reasons. These limits can be changed (see grammar-token-limit package), or you can split the content across multiple source lines.

Dario-Rosa85 commented 4 years ago

Thank you, @Aerijo. I did not know. I will split the lines.