I've got a simple script which runs in bash some code - I want now to get an answer in TeX Form. If I would run Mathematica code inside the interpreter, it would be easy:
Mathematica 10.0 for Linux x86 (64-bit)
Copyright 1988-2014 Wolfram Research, Inc.
In[1]:= V=(m w^2x^2)/2
2 2
m w x
Out[1]= -------
2
In[2]:= TeXForm[V]
Out[2]//TeXForm= \frac{1}{2} m w^2 x^2
But when I want to run it like a bash script ( ./code.m ), I type something like:
#!/usr/local/bin/math -script
VO= (m w^2x^2)/2
Print[VO]
Print[TeXForm[VO]
I get:
(m*w^2*x^2)/2
TeXForm[(m*w^2*x^2)/2]
How to get proper TeXForm printing output?