# How do I get TexForm to work on the command line? (Windows only)

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?

• It is spelled TeXForm but one set of quotes is enough. Jan 30, 2019 at 7:53

try this?

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

wolframscript -code Range@10 -format TeXForm

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


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.

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

wolframscript.exe -code "CovertTeXExpressionToTeX @
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, CovertTeXExpressionToTeX is just enough.

Try:

Information["Convert*TeX*"]


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