4
$\begingroup$

I try to run:

wolframscript -code "TeXForm[""2+2""]"

But I end up with:

TeXForm[2+2]

I am using Windows.

From my research, I understand that Mathematica can't display this properly on the command line. I also understand that I need to do something tricky, but I have no idea how Linux, or "xvfb-run" works.

Can someone please provide step-by-step instructions on how to solve this issue for us poor Windows users?

$\endgroup$
1
  • $\begingroup$ It is spelled TeXForm but one set of quotes is enough. $\endgroup$
    – Bill Watts
    Jan 30, 2019 at 7:53

2 Answers 2

5
$\begingroup$

try this?

 wolframscript -code HoldForm[1+1] -format TeXForm

 wolframscript -code Range@10 -format TeXForm

 wolframscript -c ConstantArray[0,{10,10}] -format TeXForm

enter image description here

if on Windows, the Command Line cmd should be run as Administrator to have wolframscript executed. get more info on how to use wolframscript under Windows by this way.

enter image description here

$\endgroup$
1
$\begingroup$

TeXForm seems to work on the FrontEnd level so we cannot use it in the command line. Instead, codes below:

wolframscript.exe -code "Covert``TeX``ExpressionToTeX @
Inactive[Integrate][Sin[x], {x, 0, 1}]
"

does work.

Cause ` is an escape character of PowerShell, I wrote `` to get a single backquote. In other (most) shell-langs, Covert`TeX`ExpressionToTeX is just enough.

Try:

Information["Convert`*TeX*"]

in Mathematica to get more symbols about *-TeX Convert.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.