On 07/11/2005, at 1.52, Charilaos Skiadas wrote:
[...] Then I would expect something like: \double{$x^2+1=0$} to recognize $x^2+1=0$ as math, which it does at the moment. The problem is that these commands are caught by the TeX syntax, so of course can only see stuff from the TeX syntax. Maybe an option would be to have them be caught by the LaTeX syntax also? It would be duplicating code, that's why I don't particularly like it as an approach
What can be done is to let the TeX syntax include "$base" for the command argument, that will include the base syntax file, so that'd be LaTeX when the document is marked up as LaTeX, and TeX when the document is TeX.
We use this e.g. in the C grammar, which has a few recursive rules, and is (sometimes) included by the C++ or Objective-C grammar.
Though not sure if there are other problems using the LaTeX grammar recursively (as I got the impression of, from Brads comment).