Closed Aerijo closed 5 years ago
@Aerijo Just FYI, I am going to go after \ExplSyntaxOn
next.
@Aerijo I've checked off \bf
, \it
, \backmatter
and any zero parameter control sequences off this list. They can all be captured in Atom with match
.
There are two different comment environments. In the base there is a verbatim comment environment that always excludes the text and there is the comment package which defines a non-verbatim environment named comment
plus the ability to define new environments. Supporting the latter would be difficult and I am not sure what the advantage would be since these environments are just regular text environments.
Therefore, I'll add support for the base's verbatim environment.
@Aerijo Do you know of any LaTeX specific syntax packages? Specifically I am wondering about support for tabular
, itemize
, etc. I'm not sure about adding a whole bunch of specific parsing code for these environments when I suspect that text_env
probably covers them or at a minimum a simple variation of text_env
with some arguments on the begin.
@yitzchak You mean Tree-sitter? Either way, no. I never even got round to it in my own grammar. I don't know the syntax well enough, and haven't seen what users do with it (as we don't want anything to be too rigid).
On a different note, I think I've got the JSON communication working between Atom and my language server, so that's nice. C++ is a pain, but hopefully it will pay off. I am planning to use this parser there once it's ready (it doesn't actually do anything yet).
@Aerijo Sorry, I meant the Atom syntax packages. language-latex
seems to make tabular very complex and so I was wondering if anyone is actually using that in a syntax package for highlighting. Currently alignment tabs and newlines are not excluded from appearing in regular text, so attempting to parse cells seems kind of silly.
In other words, have tabular parse as:
(tabular_env
(begin (cs) (group) (brack_group) (group))
(text_mode)
(end (cs) (group)))
As a side node, I just got shortvrb
to work based on your \verb
code.
@Aerijo Also, cool on your language server!
@Aerijo I think this is just about ready for a v0.1.0 release. I am going to add a few more LaTeX classs commands (CheckCommand
, IfFileExists
, etc) then it should have minimal functionality.
The following are things that I am probably going to push off to v0.2.0 that are supported by the legacy grammar.
\Sexpr
- this is usually a pseudo LaTeX command for Sweave/knitr.@thomasjo FYI
@Aerijo published v.0.1.0 as @dicy/tree-sitter-latex
A list of things the TextMate grammar supports that should be checked off to minimise shock to end users. I've added things that should / can be done on the Atom side too so we don't forget about them.
In
latex.cson
\include
/\input
\ExplSyntaxOn
\ProvidesExplPackage
minted
,lstlisting
, etc.luacode
alltt
aligned
,gathered
, etc.alignat
environment (and similar)\begin{alignat}{3}
where the number specifies columns. Possibly not needed here, but would like confirmation (Note:language-latex
does require the argument)array
,table
,tabular[xy]
, etc.itemize
,description
,enumerate
\item
tikzpicture
comment
(the environment)\(re)?new|provide)command
\Declare(?!OptionX?\\b)([A-Z][a-zA-Z]*)\\b
\bf
,\it
, etc.\marginpar
\textsterling
In
tex.cson
\backmatter
, etc.match
\def
, etc\catcode
%:
)\$
,\%
)