[TxMt] Latex Bundle grammar

Alain Matthes alain.matthes at mac.com
Wed Sep 12 21:52:00 UTC 2007


Le 12 sept. 07 à 12:59, Charilaos Skiadas a écrit :

> On Sep 12, 2007, at 1:20 AM, Alain Matthes wrote:
>
>> In a first time, we can forget the packages like pstricks and pgf.  
>> The problem actually is all the functions have the same colour.
>
> The problem of the color is a slightly different one. They are the  
> same color because, syntactically, they are the same thing. Even if  
> we distinguish them among their different packages, we will also  
> need to customize the various themes to make the functions have  
> different color depending on what package they are from.
>
> You see, the problem is that LaTeX goes in some sense against TM's  
> syntax coloring philosophy. TM tends to color things depending on  
> their syntactic meaning. In LaTeX most everything is a function, so  
> they are of course all colored as functions ;).
>
> So we will need to figure out what principle we want to follow when  
> coloring functions different from each other. I.e. how will we  
> group the functions together? Should all functions in a package  
> have the same color? Is there another division more meaningful?
>
>

Yes all that you write  is right but i'm not enough correct with some  
expressions :

When I write ll the functions have the same colour, I think : latex  
functions , tex functions.

We can examine the functions :

Actually, we have the same color for specific tex macro and specific  
latex macros.

\edef \let for tex \newpage \newcommand for latex.


I) The tex macros are very specific with a particular syntax but
I think we need a particular color for them : two colors (minimum)

a) one for the keyword.control  if else fi and ifx ifdim.  Actually  
this works fine !

b) and a second color for other keywords \def \global \let \hskip  
\vskip. It's possible to make
   several categories but only if you want to make a specific bundle  
dor "TeX" users. I mean someone who works
  only with TeX \hskip and \vskip  or \def and \edef or \hbox and  
\vbox  do not have the same significance.


in my tex grammar, I add

		{	name = 'storage.type.function.tex';
			match = '(\\)(let|def|edef|xdef|gdef)\b';
			captures = { 1 = { name =  
'punctuation.definition.function.latex'; }; };
		},



II)  Latex functions :

environments  \begin{} \end{} etc ... for lists,  pictures

math environments $..$ and \[... \] we have the same with \begin and  
\end

Special math (latex and amsmath) : matrix, align

We need  some categories:

storage : we have

		{	name = 'storage.type.function.latex';
			match = '(\\)(newcommand|renewcommand)\b';
			captures = { 1 = { name =  
'punctuation.definition.function.latex'; }; };
		},
it's only a  problem of esthetics but there are also newcommand* and  
renewcommand* and DeclareRobustCommand*, \provideCommand*

I try 		{	name = 'storage.type.function.latex';
			match = '(\\)((re)?(newcommand)(\*)?)';

this works well but match = '(\\)((re)?(newcommand)(\*)?)'; but I  
can't place \b



1) length and sapce :

unit : cm, pt,em, ex cm, mm

\fill \stretch \newlength \setlength \addtolength \settowidth

\hspace, \hspace*,  \vspace , \vspace * , \medskip, \bigskip  
\smallskip \addvspace

2) Boxes \mbox \makebox \fbox \framebox \usebox etc ...

3) page breaking

\pagebreak \nopagebreak \newpage \clearpage

4) Cross Reference \label \ref  but that is already done

5) Numbering \newcounter \setcounter \addtocounter \stepcounter  
\refstepcounter\value

  Numbering commands \arabic \roman \Roman \alph \the (counter)

etc....

I make  some files with  macros of some packages

Regards Alain



  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: macros.zip
Type: application/zip
Size: 10205 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20070912/264f4e90/attachment.zip>


More information about the textmate mailing list