On Sep 11, 2007, at 6:40 PM, Alain Matthes wrote:
Le 11 sept. 07 à 23:57, Charilaos Skiadas a écrit :
There is a difference between "something being preferable" and "something being invalid". If using TeX macros in LaTeX is *valid*, then our grammar should (try to) support them, regardless of whether it is recommended to do so or not. We are not trying to force users to use good code, we are merely trying to color their code as best as possible. That's why we are including the TeX grammar.
Yes I understand this point of view
The first answer is the syntax, the second, some macros TeX are different with the same name in tex and latex.
For example tex : newcount latex : \newcounter{} tex : newdimen latex \newlength{}
Ok, we need to include it then, it shouldn't be hard to do. Where would I find its documentation?
Latex Companion version II
Well, I have that, does it offer an exhaustive list of all the commands in the package, and their syntax? Where would I look?
The other question also is, what would you want the grammar to do, more than what happens now? In your example below, the functions are matched and colored (albeit they all get the same color). What else would you like to see?
Just send them as an attached file, any format you choose will be fine, ideally make it clear what package each command is in,
Ok i will make this for the next week
Regarding a different grammar for each package: Most packages will really add a very small number of lines, i.e. they would have a list of commands and that's it. I'm not even sure we need a different rule for each package really in most cases.
Yes you are right but only two packages are very long (pstricks, pgf/tikz) with a syntax very different and sometimes complicated.
Perhaps we could have those two as separate grammars, and include them via the include mechanism.
look at this code of my next package and look at it with the actual syntax. It's not very fine...
ouch!
In any case, I really think we need a dedicated grammar for package files, that would include the LaTeX grammar.
At some point I need to sit down and have a look at all this wonderful work you've been doing with pgf/tikz.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \define@cmdkey [TKZ] {Compass} {style}{} \define@cmdkey [TKZ] {Compass} {lw}{} \define@cmdkey [TKZ] {Compass} {color}{} \define@cmdkey [TKZ] {Compass} {delta}{} \define@boolkey[TKZ] {Compass} {clock}[true]{} \presetkeys [TKZ] {Compass} {% style = solid,% lw = .4pt,% color = black,% delta = 10,% clock = false}{}
\newcommand*{\tkzCompass}[1][]{\tkz@Compass[#1]}% \def\tkz@Compass[#1](#2,#3){% \setkeys[TKZ]{Compass}{#1}% \pgfpointdiff{\pgfpointanchor{#2}{center}} {\pgfpointanchor{#3}{center}} \tkz@ax=\pgf@x% \tkz@ay=\pgf@y% \pgfmathveclen{\pgf@x}{\pgf@y} \edef\tkztempLen{\pgfmathresult}% \pgfpointnormalised{\tkz@ax,\tkz@ay} \pgfmathparse{atan(\pgf@y/\pgf@x)} \edef\tkz@GammaD{\pgfmathresult}% \ifTKZ@Compass@clock% \pgfmathparse{\tkz@GammaD+180}\edef\tkz@GammaD{\pgfmathresult} \fi \draw[shift ={(#2)},% \cmdTKZ@Compass@style,% \cmdTKZ@Compass@color,% line width = \cmdTKZ@Compass@lw]% (\tkz@GammaD-\cmdTKZ@Compass@delta:\tkztempLen pt)% arc (\tkz@GammaD-\cmdTKZ@Compass@delta:% \tkz@GammaD+\cmdTKZ@Compass@delta:% \tkztempLen pt); } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Regards Alain
Haris Skiadas Department of Mathematics and Computer Science Hanover College