[TxMt] Re: comments in LaTeX bundle, wrong with TeX grammar

Will Robertson wspr81 at gmail.com
Wed Jun 18 04:59:42 UTC 2008


On 18/06/2008, at 12:51 AM, Charilaos Skiadas wrote:

>> - .sty files are claimed by the TeX grammar (LaTeX would be better)
>
> IIRC, sty files often don't look too good on the LaTeX syntax
> coloring, but perhaps I am misremembering. Do you write sty files,
> and in that case would you rather have LaTeX as the grammar for them?

Tricky question. Neither is particularly appropriate, since they are  
designed for user-level documents; there ought to be a "LaTeX code"  
grammar to be used for .sty, .cls, and (more importantly) .dtx files.

The most glaring example need for this I could see is that in neither  
the TeX nor LaTeX grammar should "@" count as a control sequence  
letter, but it should in a LaTeX code grammar. E.g., a control  
sequence like \@ifnextchar should be highlighted in a .sty/.cls/.dtx  
file but not in a .tex or .ltx file unless between \makeatletter... 
\makeatother.

In other respects, a LaTeX code grammar should, roughly speaking, be a  
superset of the TeX and LaTeX grammars. (If the LaTeX grammar is a  
superset of the TeX grammar already, then the LaTeX grammar is the  
right choice -- sorry, I haven't compared the two in any detail yet!)

Since LaTeX package authoring is rather a niche audience, I'm not at  
all surprised that this issue hasn't come up before and it's certainly  
not essential to add all these sorts of features. Your question above  
just needed a longer answer than "yes" or "no" :)

Cheers,
Will
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2415 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20080618/81efb938/attachment.p7s>


More information about the textmate mailing list