-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add LaTeX #2306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LaTeX #2306
Conversation
First question: Is this different than: https://github.com/highlightjs/highlight.js/blob/master/src/languages/tex.js |
Oh, I didn't see it until now! Well, I think we can close this PR 😢 |
Reverting my choice, the actual implementation is not that great, I tried to fit the same highlighting as GitHub does for LaTeX files. This can be discussed tho. |
Our tex grammar looks a bit more complex than yours. What does it NOT handle properly if you run the included sample tests against it? |
It does not properly handle text inside |
Exactly! Unless it's VERY VERY badly broken, indeed... but still the PR would need to be change against the existing source, not a whole new file... And I think we probably could add "latex" as an alias here also (if you're going to submit a new PR). Closing this PR. Another one that modifies the existing grammar would be great! |
I'll work on it! |
Should I assume you actually use Latex in a career or hobby? Is Latex the more popular naming vs "Tex"? |
I use it for both career and hobby! |
Yes, I googled since then... though for practical purposes I'm still thinking perhaps Tex/Latex as a single language makes more sense here, what do you think? Latex is really a super-set of Tex (or a library built on top of it, etc), yes? |
LaTeX seems more like a package for the Tex language since it only introduce macros ( We can compare it to the JavaScript, we could say "ECMAScript" but we say "JavaScript". |
Right, so LaTex would cover both Tex and Latex... but Tex wouldn't include Latex. (if we're being technical). We have precedent already for using supersets... like using JSON for Json + Comments, and using INI for INI + TOML, etc... |
Most LaTeX highlighters call the language "LaTeX" so yeah, it would include TeX and LaTeX coloration if we would make it perfect (italic text for When I have time I'll work on an upgrade of the current version in hightlight.js. |
I use LaTeX too. There are couple of other systems built on top of TeX, like XeTeX and LuaTeX, but looks like LaTeX is most popular. AFAIK no one uses bare TeX these days. |
Add basic LaTeX language highlighting.