Hi list,
The comment/decomment command (apple-/) has a different effect in LaTeX files (correctly prepends %) than in TeX files (incorrectly prepends #).
To fix that: < ciaran> cDlm: ok, if you go into the bundle editor, change the dropdown at top left to select Preferences, and then look for the "Comments" item in the LaTeX bundle < ciaran> and change where it says "text.tex.latex" at the bottom right to be "text.tex"
Also here are the conclusions of the IRC discussion with ciaran and allan: - the TeX grammar is not meant to be use per se (then it shouldn't appear in the mode menu at the bottom of buffers) - .sty files are claimed by the TeX grammar (LaTeX would be better)
On Jun 17, 2008, at 11:07 AM, Damien Pollet wrote:
Hi list,
The comment/decomment command (apple-/) has a different effect in LaTeX files (correctly prepends %) than in TeX files (incorrectly prepends #).
To fix that: < ciaran> cDlm: ok, if you go into the bundle editor, change the dropdown at top left to select Preferences, and then look for the "Comments" item in the LaTeX bundle < ciaran> and change where it says "text.tex.latex" at the bottom right to be "text.tex"
Thanks, I just committed a fix.
Also here are the conclusions of the IRC discussion with ciaran and allan:
- the TeX grammar is not meant to be use per se (then it shouldn't
appear in the mode menu at the bottom of buffers)
Well, for people working in plain TeX mode, that would be the language to choose. Not sure how many those people are however. That is why we don't have a shortcut for it. Actually TeX Math is the one that should definitely not appear there. But I suppose if noone uses the TeX bundle, we can take that out of there as well. How do we make it not appear there though, and still exist?
- .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?
-- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet
Haris Skiadas Department of Mathematics and Computer Science Hanover College
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
On Jun 18, 2008, at 12:59 AM, Will Robertson wrote:
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!)
Correct, the LaTeX bundle inherits the TeX grammar. The reason they are different is to allow for things like ConTeXt.
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" :)
You are correct, there does need to be a separate grammar for code files, extending the LaTeX bundle. It's simply a question of who is going to write it. I personally don't write such files, so I never had any interest in doing something like that. I would be happy to help anyone who wants to undertake the task however.
And yeah, it sounds like it should be extending the LaTeX grammar. Any volunteers?
Cheers, Will
Haris Skiadas Department of Mathematics and Computer Science Hanover College