jgm/texmath — pull request #12 by rekka (2012-05-19 03:06:40+00:00)
Title: Treat \ commands as tex tokens in arguments

This is a simple fix of a problem when parsing command arguments not surrounded by braces that are themselves \ commands:

```latex
\tilde\phi
```

This gets currently interpreted as
```latex
\tilde{\}phi
```
while the correct tex behavior is
```latex
\tilde{\phi}
```

This patch just adds `texSymbol` parser as an option of the `texToken` parser. In my opinion, this is the intended behavior. Now all commands, including unary (`\sqrt`), binary (`\frac`) and custom commands work properly with \ command arguments; see `tests/tokens.tex`.

_Remark._ Note that there is still some inconsistency with the way texmath parses arguments of sub/superscript using the `expr1` parser. I think this should be replaced by `texToken` parser, for consistency with latex, but I haven't touched that.

All tests pass.