[TxMt] Re: Highlighting in Textmate - Latex

mapcdi at mac.com mapcdi at mac.com
Fri Nov 7 15:24:53 UTC 2008


A non-text attachment was scrubbed...
Name: Image 1.png
Type: image/png
Size: 43637 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20081107/11b562da/attachment.png>
-------------- next part --------------



> 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

What I do to know the exact name of any scope in a given document in  
TextMate:
(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.


More information about the textmate mailing list