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

Charilaos Skiadas cskiadas at uchicago.edu
Wed Jun 7 13:37:14 UTC 2006


On Jun 7, 2006, at 8:14 AM, Matthias Damm wrote:
>
> Hi,
>
> I'd like to reactivate this old thread, since there seems to be a  
> small problem with the symbol list in the LaTeX mode.
> The display of section titles does not work properly if the contain  
> markup such als \emph{} or \textit{}.
>
> 	\section{Heading with \empf{markup} in it}
>
> will be displayed as
>
> 	markup in it
>
> Would it be possible to fix this problem?

Hm, I don't remember this old thread, at all.
Anyway I just committed a fix for it, hopefully I didn't break  
anything else. The problem was that there are a series of  
transformations performed to create this list, and they are all  
performed in order. Two of those transformations were:

s/^\\section\*?(?:\[[^]]*\])?\{(.+)\}/  $1/; # \section

s/^.*\{(.+)\}/$1/;     # take care of everything else

The point of the second transformation was to catch all other  
commands in case people name things in their own way. Problem was  
that the second command was a bit too strong. So after the section  
transformation transformed your section to:
"Heading with \emph{markup} in it"
the second substitution matched:
"Heading with \emph{markup}"
  and replaced it with "markup", hence the resulting "markup in it".
I changed the second command to:
s/^\\.*\{(.+)\}/$1/;     # take care of everything else
which will only match if the section text starts with \. So in your  
case it will leave it as is, but if instead you had:
"\emph{Heading with markup} in it"
it should now show as "Heading with markup in it", which I think is  
an acceptable casualty.
Hm, come to think of it, one could, if so desiring, have (almost) all  
commands removed by changing the command to:
s/\\.*\{(.+)\}/$1/;     # take care of everything else

This will turn your original section title to "Heading with markup in  
it" as well. I guess that's a matter of taste.

> Thanks in advance,
> best regards
>
> Matthias

Haris





More information about the textmate mailing list