tex SciMax Toolbox third

SciMax Toolbox >> texput

texput

Maxima Function

Calling Sequence

texput (a, s)
texput(a,s,operator_type)
texput(a,[s_1,s_2],matchfix)
texput(a,[s_1,s_2,s_3],matchfix)

Description

Assign the TeX output for the atom a, which can be a symbol or the name of an operator.

texput (a, s) causes the tex function to interpolate the string s into the TeX output in place of a.

texput (a, s, operator_type), where operator_type is prefix, infix, postfix, nary, or nofix, causes the tex function to interpolate s into the TeX output in place of a, and to place the interpolated text in the appropriate position.

texput (a, [s_1, s_2], matchfix) causes the tex function to interpolate s_1 and s_2 into the TeX output on either side of the arguments of a. The arguments (if more than one) are separated by commas.

texput (a, [s_1, s_2, s_3], matchfix) causes the tex function to interpolate s_1 and s_2 into the TeX output on either side of the arguments of a, with s_3 separating the arguments.

Examples:

Assign TeX output for a variable.

(%i1) texput (me,"\\mu_e");
(%o1)                         \mu_e
(%i2) tex (me);
$$\mu_e$$
(%o2)                         false

Assign TeX output for an ordinary function (not an operator).

(%i1) texput (lcm, "\\mathrm{lcm}");
(%o1)                     \mathrm{lcm}
(%i2) tex (lcm (a, b));
$$\mathrm{lcm}\left(a , b\right)$$
(%o2)                         false

Assign TeX output for a prefix operator.

(%i1) prefix ("grad");
(%o1)                         grad
(%i2) texput ("grad", " \\nabla ", prefix);
(%o2)                        \nabla
(%i3) tex (grad f);
$$ \nabla f$$
(%o3)                         false

Assign TeX output for an infix operator.

(%i1) infix ("~");
(%o1)                           ~
(%i2) texput ("~", " \\times ", infix);
(%o2)                        \times
(%i3) tex (a ~ b);
$$a \times b$$
(%o3)                         false

Assign TeX output for a postfix operator.

(%i1) postfix ("##");
(%o1)                          ##
(%i2) texput ("##", "!!", postfix);
(%o2)                          !!
(%i3) tex (x ##);
$$x!!$$
(%o3)                         false

Assign TeX output for a nary operator.

(%i1) nary ("@@");
(%o1)                          @@
(%i2) texput ("@@", " \\circ ", nary);
(%o2)                         \circ
(%i3) tex (a @@ b @@ c @@ d);
$$a \circ b \circ c \circ d$$
(%o3)                         false

Assign TeX output for a nofix operator.

(%i1) nofix ("foo");
(%o1)                          foo
(%i2) texput ("foo", "\\mathsc{foo}", nofix);
(%o2)                     \mathsc{foo}
(%i3) tex (foo);
$$\mathsc{foo}$$
(%o3)                         false

Assign TeX output for a matchfix operator.

(%i1) matchfix ("<<", ">>");
(%o1)                          <<
(%i2) texput ("<<", [" \\langle ", " \\rangle "], matchfix);
(%o2)                [ \langle ,  \rangle ]
(%i3) tex (<<a>>);
$$ \langle a \rangle $$
(%o3)                         false
(%i4) tex (<<a, b>>);
$$ \langle a , b \rangle $$
(%o4)                         false
(%i5) texput ("<<", [" \\langle ", " \\rangle ", " \\, | \\,"],
      matchfix);
(%o5)           [ \langle ,  \rangle ,  \, | \,]
(%i6) tex (<<a>>);
$$ \langle a \rangle $$
(%o6)                         false
(%i7) tex (<<a, b>>);
$$ \langle a \, | \,b \rangle $$
(%o7)                         false
tex SciMax Toolbox third