Sweet! Alex and M.P. many thanks to both of you. I used Alex's suggestion but also tried M.P's suggestion as it helps me find the scope when I don't know it.
Thanks again. I really appreciate it.
What I do to know the exact name of any scope in a given document in TextMate:
On Nov 7, 2008, at 12:49 PM, Want to Learn wrote:
Hi,
I am using textmate for Latex. I was wondering if there is a way I could customize highlighting of document parts in Latex. For example, currently the footnotes are not highlighted, but any math input between two $ signs is highlighted in green. Suppose I want everything that appears between \footnote{ and } in gray color or add a background color. Is there a way to do that?
Thanks very much for your help.
In your theme, add a rule for meta.footnote.latex. Go to preferences, find the fonts & colors tab, click the "plus" sign to add a new rule. set the scope selector to meta.footnote.latex. Give the rule a name, and add a color. That's it!
—Alex
(in the above case: meta.footnote.latex AND support.function.footnote.latex)
I use the 'Bundle Development' Bundle which has a Copy Scope command clickable in a menu item in: Bundles > Bundle Development > Copy Scope,
as follows:
First place cursor in the middle of the desired word, here it was \footnote{};
then ckick menu item 'Copy Scope';
then paste it in the text;
then copy the line of interest, here it's 'support.function.footnote.latex' into the color prefs like previously stated by Alex;
then do the same with the scope you get at '{My footnote here}' , it was: 'meta.footnote.latex'.
Probably there's a shorter way, but this is what I do and I can know about (and customize) every scope in a Latex doc, or any other type of doc for that matter.
I wish the Latex Bundle could just add this simple Copy Scope command in its next update. It's just this:
tr <<< "$TM_SCOPE" ' ' '\n'|pbcopy
Best regards,
M.P.
_______________________________________________
textmate mailing list
textmate@lists.macromates.com
http://lists.macromates.com/listinfo/textmate