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

Charilaos Skiadas cskiadas at uchicago.edu
Sun Jan 22 22:31:26 UTC 2006


Let me try to make some points that might clarify things:

1. Changes in the preferences and language files might not take  
effect immediately. for the language file, you should press the  
"test" button after the changes you make. In either case, closing the  
window helps register the change.

2. The language file determines what parts of the text match to what  
scope. In your case, this needs to change, because otherwise your  
commands \Subsection and \Subsubsection are not being understood as  
meta.section.latex.
You could optionally catch them as some other scope of your own, and  
do other stuff to them, but my understanding is that you want them to  
behave like the uncapitalized commands.

3. The preferences file (called "symbol list" here, but that is not  
important) tells TM the following:
a) take the things from the text that have scope meta.section.latex  
(This is what the scope selector being "text.latex  
meta.section.latex" does), and use those for the symbol list (that's  
what the "showInSymbolList=1" does.
b) Before showing them, perform a transformation to them. In this  
case, the transformation desired has the effect of replacing the  
subsection/section etc parts by appropriately lengthed spaces, so  
that it shows nicely nested. For instance, the following text:

\section{1st section}
\subsection{1st subsection}
\subsection{2nd subsection}
\subsubsection{1st subsubsection}
\section{2nd section}

will show up in the symbols list as:
1st section
   1st subsection
   2nd subsection
     1st subsubsection
2nd section

Notice the extra spaces. Due to some error in our part, the line with  
the subsubsection will actually have one of the sub's replaced by  
spaces, but in general this will work as described above.

This is all accomplished by the "symbolTransformation" lines.

So the change in the language file will in fact have the desired  
effect of adding these \Subsection lines to the symbol popup, but if  
you want them to look nice as above, you need to make the analogous  
change in the "symbol list" preferences file.

I hope this helps. Let me know if you are still having problems with it.

Haris





More information about the textmate mailing list