I am attempting make life easier, and, instead of using Mathematica at the same time that I'm using LyX (a front end for LaTeX), I was hoping that I could just use LyX and use the CAS option to do some of the simple algebraic computations that Mathematica can handle so powerfully.

Of course, this has been a headache for me, as I am not very comfortable with anything Unix related. I already know where to locate Mathematica, its absolute path name, and can put it inside the "PATH prefix" that LyX demands of me. But, even doing that, I cannot get an output on the simplest of computations.

Path for Mathematica's kernel that I entered in LyX

Is anyone familiar with this, because I'm up against a wall. I have no idea what to do. I've been trying for hours.

By the way, as is evident from the picture, I am on a Mac, I don't know if that makes a significant difference.



Here is some more information about something that I'm asking LyX to do, in a picture:

The Option to Use Mathematica

LyX Tries to Communicate with LyX and Fails to Produce an Answer to a Simple Addition

  • $\begingroup$ Would you elaborate ? Because I don't really see a question being asked here.. Also, any kind of error log is more than welcome :) $\endgroup$
    – Sektor
    Feb 23, 2014 at 21:51
  • 1
    $\begingroup$ Certainly. I'm wondering why LyX and Mathematica aren't communicating. I've pointed LyX (with what I assume is the correct path) towards Mathematica and basically said, 'OK, now do some basic calculations when I ask you to.' But, this is not the case, LyX and Mathematica don't seem to understand that I wish for them to interact. Whenever I make LyX do a calculation with Mathematica, nothing happens. LyX says that it is going to get Mathematica, it pops up saying "math-extern Mathematica", but nothing happens! Even though I've pointed LyX towards Mathematica! So that's where the issue lies. :) $\endgroup$
    – Matthew
    Feb 23, 2014 at 22:05
  • $\begingroup$ These posts might be useful, they mention a batch script to set the path (they don't actually mention when to run it though). link $\endgroup$
    – Ymareth
    Feb 24, 2014 at 9:08

1 Answer 1


There is a solution described here, where the relevant part is:

...define a wrapper script in your PATH, e.g., /usr/local/bin/math. In this executable script, I have only two lines:

/Applications/Mathematica.app/Contents/MacOS/MathKernel "$@"

I have Mathematica 9.0.1 and Lyx on OS X 10.9.1, and after creating the above "math" script in /usr/local/bin (BTW, I had to do "chmod 755 math" as well) I tested it using the following steps in Lyx:

  1. Insert / Math / Inline Formula
  2. Type "Expand[(x+y)^2]" - then leave the cursor just after the "]"
  3. Edit / Math / Use Computer Algebra System / Mathematica

Lyx and Mathematica then cooperate to fill in the rest of the equation to give "Expand[(x+y)^2] = x^2 + 2 x y + y^2".

  • $\begingroup$ Is there any similar solution for those who work in windows 10? $\endgroup$
    – Yorgos
    Jan 30, 2018 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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