[texhax] Can I do it more simple (building .sty)?
uwe.lueck at web.de
Wed Jun 24 18:32:36 CEST 2009
At 13:26 24.06.09, wawan wrote:
>I build .sty having a lot of newcommand like below, can I do it more simple
This looks fine, congratulations!
You asked about \def earlier, by which you could replace the former with
This is shorter, but \newcommand saves you from mistakes -- just to answer
your earlier question.
You might do
etc. to save space, then you could type several definitions in one code line.
I wonder about the extra *braces* in the definitions, this is not my field
(Hope *real wizards* see this!)
The braces are useful here when another number follows.
But you could use octal or hexadecimal notation,
would overcome the parsing problem I alluded to; it may even be more
helpful with font tables.
Another possibility is
which, however, doesn't do the check that \newcommand does.
(It is more efficient regarding memory.)
On p. 356 of the TeXbook there are some things with \chardef, some with
\def, some with extra braces, I don't know why. I find it somewhat
difficult to find the corresponding things in LaTeX.
What language are you implementing? This might be really interesting.
More information about the texhax