Problem with texput and transpose



Dear Robert, dear list,

On Sun, 25 Dec 2011 11:18:17 -0700, Robert Dodier wrote?:

> 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

Thank you ! This is, indeed a great help.

It reminds me of another problem I have, but I'll make another post later 
(after taking a little more time to think about it...).

Sincerely yours,

                                          Emmanuel Charpentier