[Tex/LaTex] All LaTeX commands list

tex-core

I'm writing a LaTeX commands highlighter in C#, for this I need all or most of the LaTeX commands.
I've searched the web and found many lists of commands but all of them are with comments and explanations that I don't need. Before I'll spend entire week deleting the unnecessary comments leaving only the commands.
I would like to ask you, is there somewhere a simple text list of the commands, like this:

...
\backslash
\bar
\baselineskip
\baselinestretch
... 

Best Answer

While it is possible to list all TeX primitives or all LaTeX kernel commands, there is no list of all possible LaTeX commands as new ones can be added by packages. As such, most people use an approach of searching for the same pattern as TeX does: \ followed by either one non-letter or one or more letters: this is the pattern for 'document commands'.

(It is possible for commands not to start with \, but this is used for internal coding and not in documents. Similarly, internal commands often use one or more extra 'letters': @ is traditional while LaTeX3 uses _ and :. However, for the purposes of highlighting in a document these cases can be ignored.)

Related Question