Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Texput Calculator

Texput

Function: texput (<a>, <s>)

Function: texput (<a>, <f>)

Function: texput (<a>, <s>, <operator_type>)

Function: texput (<a>, [<s_1>, <s_2>], matchfix)

Function: texput (<a>, [<s_1>, <s_2>, <s_3>], matchfix) 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>, <f>) causes the tex function to call the function <f> to generate TeX output. <f> must accept one argument, which is an expression which has operator <a>, and must return a string (the TeX output). <f> may call tex1 to generate TeX output for the arguments of the input expression.

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

Call a function to generate TeX output.

          (%i1) texfoo (e) := block ([a, b], [a, b] : args (e),
            concat ("\\left[\\stackrel{", tex1 (b), "}{", tex1 (a), "}\\right]"))$
          (%i2) texput (foo, texfoo);
          (%o2)                        texfoo
          (%i3) tex (foo (2^x, %pi));
          $$\left[\stackrel{\pi}{2^{x}}\right]$$
          (%o3)                         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

(%o1)                                true
(%i2) 

Texput Example

Related Examples

texput

texput(%i, "j");

tex(I+theta);

Calculate

texput

texput(theta, "\\thet...

tex(I+theta);

Calculate

texput

texput(theta, "j");

tex(I+theta);

Calculate

texput

texput(theta, "\theta");

tex(I+theta);

Calculate

texput

texput(%i, "j");

tex(I+theta);

Calculate

texput

texput(theta, "\\thet...

tex(I+theta);

Calculate

texput

texput(theta, "j");

tex(I+theta);

Calculate

texput

texput(theta, "\theta");

tex(I+theta);

Calculate