### The Maxima on-line user's manual

Algebra Calculator

#### Tex

Function: tex (<expr>)

Function: tex (<expr>, <destination>)

Function: tex (<expr>, false)

Function: tex (<label>)

Function: tex (<label>, <destination>)

Function: tex (<label>, false) Prints a representation of an expression suitable for the TeX document preparation system. The result is a fragment of a document, which can be copied into a larger document but not processed by itself.

tex (<expr>) prints a TeX representation of <expr> on the console.

tex (<label>) prints a TeX representation of the expression named by <label> and assigns it an equation label (to be displayed to the left of the expression). The TeX equation label is the same as the Maxima label.

<destination> may be an output stream or file name. When <destination> is a file name, tex appends its output to the file. The functions openw and opena create output streams.

tex (<expr>, false) and tex (<label>, false) return their TeX output as a string.

tex evaluates its first argument after testing it to see if it is a label. Quote-quote forces evaluation of the argument, thereby defeating the test and preventing the label.

See also texput.

Examples:

          (%i1) integrate (1/(1+x^3), x);
2 x - 1
2            atan(-------)
log(x  - x + 1)        sqrt(3)    log(x + 1)
(%o1)      - --------------- + ------------- + ----------
6             sqrt(3)          3
(%i2) tex (%o1);
$$-{{\log \left(x^2-x+1\right)}\over{6}}+{{\arctan \left({{2\,x-1 }\over{\sqrt{3}}}\right)}\over{\sqrt{3}}}+{{\log \left(x+1\right) }\over{3}}\leqno{\tt (\%o1)}$$
(%o2)                          (\%o1)
(%i3) tex (integrate (sin(x), x));
$$-\cos x$$
(%o3)                           false
(%i4) tex (%o1, "foo.tex");
(%o4)                          (\%o1)

tex (<expr>, false) returns its TeX output as a string.

          (%i1) S : tex (x * y * z, false);
(%o1) $$x\,y\,z$$
(%i2) S;
(%o2) $$x\,y\,z$$

There are also some inexact matches for tex. Try ?? tex to see them.

(%o1)                                true
(%i2) 

### Related Examples

##### tex

tex(R_pr=10^2/8*6.2);

Calculate

##### tex

tex(f(x,y) := x^2+y^3...

tex(g(x,y) := 2*y+x^3...

tex(f(-1,-1)/g(-1,-1));

Calculate

eq1:x*4+y-2=y;

eq2:x+2=y;

eq3=eq1 * eq2;

Calculate

##### tex

log10(x):= log(x)/log...

tex(%);

Calculate

f1:[1,2,3,4];

f2:[2,5,7,-2];

f3:[-1,5,6,7];

Calculate

tex(\\infty);

Calculate

##### tex

tex((1/2*x^3-1/6*x^2*...

eq2:(1/2*x^3-1/6*x^2*...

Calculate

r1:[a,b];

r2:[c, d];

r1:r1*(a^x);

Calculate

##### tex

h(alpha) := (1/9)*(8*...

tex(%o1);

Calculate

##### tex

tex( A = ([1,0,1],[1,...

Calculate