Problem with texput and transpose



On 12/25/11, Emmanuel Charpentier <emm.charpentier at free.fr> wrote:

> Does someone has a suggestion on how to trigger a user-defined function
> in the TeXing of a noun ?

Well, nounify(foo) is the noun symbol corresponding to foo.
e.g.: texput (nounify (foo), "\\mathrm{foo}");
tex (foo (x));
 => $${\it foo}\left(x\right)$$
tex ('foo (x));
 => $$\mathrm{foo}\left(x\right)$$

I suspect verbs and nouns should have the same TeX properties,
by default at least. Sorry for the confusion; we are still figuring things out.

About lcm and transpose, there are simpler ways, I believe,
to get what you are looking for ...

texput (lcm, "\\mathrm"); /* no need to specify the whole enchilada */
tex (lcm (a/b, c));
 => $$\mathrm{lcm}\left({{a}\over{b}} , c\right)$$

texput (nounify (transpose), lambda ([e], tex1 (first (e) ^ ' T)));
tex (transpose (A . B));
 => $$B^{T}\cdot A^{T}$$

There's an opportunity for trouble above since the "^" is going to
be simplified before tex1 is called, which can simplify away the
exponent for some values of the base (e.g. 0, 1).
But transpose(x) => x for those same values, so I don't know if
the texput lambda can be called in those cases. Anyway if that's
a problem, I have an idea about how to deal with it.

HTH,

Robert Dodier