[TxMt] Re: LaTeX Syntax coloring problem (Cont.)

Charilaos Skiadas cskiadas at gmail.com
Mon Oct 27 18:53:13 UTC 2008


Hi mapcdi,

This is indeed a quite unsatisfactory situation with the  
newenvironment commands. The correct solution would indeed be to add  
a rule for parsing \newenvironment and \renewenvironment specially.  
It would likely offer a very limited highlighting of the arguments,  
but should sort of work otherwise. I am pretty sure however that I  
won't have time to work on it myself in the foreseeable future,  
perhaps one of the other maintainers has more time for it. Patches  
are of course always welcome.

As a temporary solution, I would suggest creating a separate file  
with all these \newenvironment definitions, and then just using  
\input to include that file at the appropriate place. I.e. have most  
of the preamble as a separate file. This has the extra benefit that  
you can easily include it in multiple other documents as well.

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College

On Oct 27, 2008, at 2:31 PM, mapcdi at mac.com wrote:

> To continue with the previous ( & unresolved) post; see: http:// 
> lists.macromates.com/textmate/2008-May/025441.html
>
>
> With this \newenvironment the scope never closes braces or the list  
> environment, and so the syntax color scheme is forever wrong in the  
> rest of the document:
>
> %preamble(fold)
> ......
> %create new list environment (bullets - named buls)(fold)
> \newcommand{\bu}{\ensuremath{\bullet}{ }}
> \newenvironment{buls}
> {\begin{list}{\bu}
> {
> \setlength{\topsep}{3pt}
> \setlength{\parsep}{0pt}
> \setlength{\itemsep}{2pt}
> \setlength{\labelsep}{0pt}
> \setlength{\itemindent}{10pt}
> \setlength{\leftmargin}{40pt}
> \setlength{\rightmargin}{0pt}
> \normalfont\upshape
> }}
> {\end{list}}
> %create new list environment (bullets - named buls)(end)
> .....
> %preamble(end)
>
> \begin{document}.....
>
>
> some text here ****the scope here is:
>
> 		text.tex.latex
> 		meta.group.braces.tex
> 		meta.function.environment.list.latex
>
>
> ___when it should just be (and in fact is without
> 	the previous \newenvironment definition):
>
> 		text.tex.latex
>
> ....\end{document}
>
>
> It seems to be a bug in the Language definitions of these scopes  
> (tex and/or latex).
> Can this be solved (and maybe the bundle updated with the correction)?
>
> Thanks,
>







More information about the textmate mailing list