latex parser: environment validation (mode and nesting), differentiating between math mode and math environments, only AMS math environs are autoNumbered (MathJax)