area / language-latex

Syntax highlighting for LaTeX for Atom.
Other
79 stars 47 forks source link

Stops highlighting in long paragraphs #210

Open leosenko opened 4 years ago

leosenko commented 4 years ago

Prerequisites

Description

Steps to reproduce & Minimum working example

1.

In latex source, create a paragraph of: Isdadsa sdadas \cite{ds231} sadasds Fig.~\ref{fig:sss} by \cite{sdads12} dasda \SI{23}{\celsius}, dsad \SI{22222}{\celsius} adasd sad asd asd asd sa \SI{22222}{\celsius} dsadsa dnd \ce{Mg^2+} sds. \cite{sd223aa} sd \SI{21323123232}{\celsius} dsad \gls{sss} dasda \SI{2123322}{\celsius}.

The last \SI is not highlighted. If you delete/shorten the first cite to \cite{31}, it becomes highlighted.



#### Expected behaviour
all the primitives should be highligeted

#### Actual behaviour
After some amount of text, highlighting stops working.

### Additional information
Atom 1.46.0 x64 OSX 10.14.6
AOS55 commented 4 years ago

Also getting this problem, stays highlighted after math mode. For example after second inline math $ all is highlighted in $$, colour.

Conveniently $\frac{\nabla_{\bm{\theta}} \pi(A_{t}|S_{t}; \bm{\theta})}{\pi(A_{t}|S_{t}; \bm{\theta})}$ from equation\ref{eq:deriveScore} is the score function $\nabla_{\bm{\theta}} \ln(\pi(A_{t}|S_{t}; \bm{\theta}))$. This forms the basis of the REINFORCE algorithm \cite{RL41} and the update step samples $G_{t} \nabla_{\bm{\theta}} \ln(\pi(A_{t}|S_{t}; \bm{\theta}))$. If the return $G_{t}$ increases then the weight of the parameter is increased, therefore weighting policys with higher return. But reduces the size of the update if the probability of selecting an action is high, discounting policies that suffer from maximisation bias. REINFORCE is shown in algorithm \ref{algo:T-REINFORCE}, and best thought of as a parameterised MC method because the return is calculated based on the discounted sum for the whole episode.

AOS55 commented 4 years ago

I am also in OSX 10.15.4 atom is latest version 1.48.0 x64

bbgra commented 4 years ago

I experience the same two issues in similar scenarios! Atom version 1.48.0 x64 on Windows 10.

bbgra commented 4 years ago

Some googling helped me solve the issue.

It appears that Atom has a maximum number of tokens per line (100), see https://github.com/atom/atom/issues/1667 There is a package, allowing you to change the number of tokens per line, https://github.com/postcasio/atom-grammar-token-limit This restores the syntax highlighting.

Hope that helps you fix your issues is as well!