[TxMt] LaTeX grammer for subscript

Guido Governatori guido at itee.uq.edu.au
Mon Nov 12 05:17:51 UTC 2007


On 12/11/2007, at 2:35 PM, Allan Odgaard wrote:

> On 11 Nov 2007, at 22:46, Guido Governatori wrote:
>
>> [...]
>> The above language seems to work properly in LaTeX math and LaTeX  
>> math environnments. However, the scope is not recognised in plain  
>> TeX math, that is in cases like $X_{as}$ shift-ctrl-P does not  
>> show the newly defined scope in the tooltip.
>
> How exactly are you using this, do you change your top-level  
> language to your new grammar, or do you include the grammar from  
> the default LaTeX grammar?

I change the top-level grammar to my new one.

Now if I have \(X_{as}\) the subscript scope defined by the new  
grammar is shown correctly (same in other math construct), but not in  
$x_{as}$.

I have an include to text.tex.latex.

I have inserted in the new grammar the definition from  
string.other.math.tex, and then $X_{as}$ seems to recognised the  
subscript scope. However, as far as I have seen, it does not  
recognised in inside section headings.

> Either way, I don’t think this can simply be done by adding a new  
> grammar and some includes, instead the existing grammar needs to be  
> changed to support this (but I didn’t look closer into this).

Maybe I have not understood how include, but if I write a grammar  
where patterns contains only an include statement, don't I "create a  
copy" of the included grammar under a different name?

All the best

Guido
--
Dr Guido Governatori
School of Information Technology and Electrical Engineering
The University of Queensland
Brisbane, Queensland, 4072, Australia
Phone: +61-(0)7-336 52907
Fax: +61-(0)7-336 54999
http://www.governatori.net/TextMate
http://www.defeasible.org






More information about the textmate mailing list