Group Abstract Group Abstract

Message Boards Message Boards

0
|
9.2K Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Command line conversion from LaTeX to Wolfram Language

Posted 9 years ago

Hi,

on my RaspPi I've tried to convert a LaTeX-Expression to Wolfram Language with the command ToExpression. Sadly the output doesn't give me the expression in Wolfram Language but tries to give a graphic which is not good because I'm just operating from the command line.

In[1] := ToExpression["\\sqrt{xy}",TeXForm]
can't open display ":25"  <-- here I expect: Out[1] := Sqrt[xy]

Is there any way to convert LaTeX-Expressions to Wolfram Language?

Best regards,

Tom

POSTED BY: Tom Alder
5 Replies

The same question has been asked here:

The answer is that certain operations require the Front End, and the Front End requires an X server. In cases when there are no screens connected, I usually use Xvfb. This is usually needed on HPC clusters (or other servers) which I connect to using SSH. However, on a Raspberry Pi I am typically running a VNC server which means that X is already available and I do not need Xvfb.

Also relevant: http://reference.wolfram.com/webMathematica/tutorial/InstallationXWindows.html

POSTED BY: Szabolcs Horvát

woops! I thought it was something more basic...

POSTED BY: Sander Huisman
Posted 9 years ago

Thank you for the link.

So, sadly, there is no way to run this command with a command-line-only interface :(

POSTED BY: Tom Alder

So, sadly, there is no way to run this command with a command-line-only interface :(

Tom, if you read the link I posted carefully, you will see that it is entirely possible to use this command with a command-line-only interface. However, do you need an X server running.

You do not need a screen, you do not need a desktop environment, and you do not need the Mathematica GUI shown in a windows. However, you do need an X server. There are command line programs which render images which cannot be run without an X server. The purpose of Xvfb is to let these programs access an X server without a screen (and without graphical user-interaction).

POSTED BY: Szabolcs Horvát

I don't have a raspberry pi, but I guess you can wrap InputForm around it?

InputForm[ToExpression["\\sqrt{xy}",TeXForm]]

you might need an explicit multiplication between x and y as well....

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard