Message Boards Message Boards

Can ToExpression["<math>....</math>",MathMLForm] work without display set?

Posted 8 years ago

Is it possible to convert a mathML string to an expression from a Mathematica kernel with no front end and without having to set up a display environment (this is in linux)? Thanks, - Elaine

POSTED BY: Elaine Kant
5 Replies

Thanks. We have looked at that documentation, but it is rather out of date and not as useful as one might hope. We will make it work one way or another. We already have it working on some machines, but we were just hoping for a simpler or more standardizable solution.

POSTED BY: Elaine Kant

Thanks. We have looked at that documentation, but it is rather out of date and not as useful as one might hope. We will make it work one way or another. We already have it working on some machines, but we were just hoping for a simpler or more standardizable solution.

POSTED BY: Elaine Kant

Yes, that's right. My example above was flawed since the Linux server I ssh'ed into wasn't actually headless.

For now, it will be necessary to have a display, however it can be a virtual one provided e.g. by Xvnc or Xvfb. Both of these programs should be readily available on Linux. See also the documentation.

POSTED BY: Ilian Gachevski

Thanks, but I'm afraid that at least under linux, you have to have a Display set up even if it isn't used for displaying anything. Wolfram support said they didn't know any way around it, but I was hoping someone did. We were trying to make this work with a math kernel running under WebMath in such a way that could easily be ported to any machine, and setting up the Display stuff properly isn't easy because it is OS dependent.

POSTED BY: Elaine Kant

Yes, it should be possible. For example, in a standalone kernel terminal session

In[1]:= ToExpression["<math><msup><mi>x</mi><mn>2</mn></msup></math>", MathMLForm]

         2
Out[1]= x
POSTED BY: Ilian Gachevski
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract