0

Any idea how can I automatically invoke Mathtype from texstudio using macro (javascript) and put the formula back onto texstudio automatically. It can be done manually, but I want to know is it possible to do this in an automated manner like when invoking mathtype from word.

  • If it can be done with help of batch files, you can build your own command. Then add a button to your toolbar or use a keyboard shortcut. I don't know Mathtype ... sorry. – gilu Jul 26 '16 at 6:55
1

I don't know Mathtype, but if it can export to the clipboard, you can use the following macro (I just use notepad.exe as an example external application):

%SCRIPT
proc = system("c:/windows/notepad.exe")
proc.waitForFinished()
// as a user you can now work in the external application
// when you're done, copy the required content to the clipboard
// and close the external application
editor.paste()
  • Presumably this is a Windows-only technique, although you don't say so? – cfr Jul 27 '16 at 3:26
  • This script works independent of the OS. system() starts a new process. Of course, you wouldn't have notepad.exe on other OSs but that's just an example anyway. Just replace it by the desired program. – Tim Hoffmann Jul 28 '16 at 6:20
  • The notepad version worked but my alteration for Mathtype doesn't work. The code is like: proc = system("MathType.exe", workingDirectory="c:/Program Files (x86)/MathType/") I think the problem is with the system(). Is there any other command which I can use instead of it. proc.waitForFinished() editor.paste() – Hamid Aug 6 '16 at 1:11
  • Try specifying the complete path to MathType.exe. – Tim Hoffmann Aug 7 '16 at 8:47
  • Have been tried not working. seems that the directory is not accessible. – Hamid Aug 12 '16 at 23:04

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.