[TxMt] adding to or modifying the symbol list for LaTeX?

Gary L. Gray gray at engr.psu.edu
Sun Jan 22 21:18:43 UTC 2006


On Jan 22, 2006, at 3:54 PM, Charilaos Skiadas wrote:

> On Jan 22, 2006, at 2:37 PM, Gary L. Gray wrote:
>
>> 		s/(?<=\\|sub)sub/ /g;             # replace all leading "sub"  
>> with an em-space
>
> Try to replace the s in the first sub with (s|S)
> This tells the regexp engine to match either an s or an S at that  
> point.
> Have a look at this document for more on regular expressions used  
> in textmate:
> http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt

Thank you. Though this doesn't seem to matter (see below).

> Then you also need to change the latex syntax to recognize your  
> (sub)sections as having scope meta.section.latex

What does that mean? What does that do for me? Again, see below.

> In particular, in the LaTeX language file, you will find the line:
>
> begin = '((\\(?:(?:sub)*section|chapter|paragraph|part))(\*?)(?:(\[) 
> [^\[]*?(\]))??(\{))';
>
> near the top.If you change the first "s" there to (s|S) instead,  
> that might do it (haven't tested it).

Interestingly, I only made the second change and it appeared to  
recognize my sectioning commands without making the first. That is, I  
made the change to the LaTeX language file as:

begin = '((\\(?:(?:(s|S)ub)*section ...

and the function pop-up now shows (I hope attachments are ok):

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Picture 1.png
Type: image/png
Size: 142055 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20060122/44171554/attachment.png>
-------------- next part --------------

which is, I suppose, what I would expect. It doesn't seem to change  
anything if I include the change in the symbol list.

In fact, I just did a test and made the change only in the symbol  
list and then the function pop-up does not find my sectioning  
commands that start with an upper-case "s". See:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Picture 2.png
Type: image/png
Size: 101053 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20060122/44171554/attachment-0001.png>
-------------- next part --------------

> This will also be matching stuff like \SubSubsection, I hope that's  
> alright.

That is no problem, though I must admit to being a bit confused at  
this point. :-)

-- Gary
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2363 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20060122/44171554/attachment.p7s>


More information about the textmate mailing list