6
$\begingroup$

I am using WolframAlpha app on my iPad and would like to confirm that there is no way to convert its output to $\LaTeX$ form?

It would be nice to have this feature so as to copy it to Stack Exchange for questions. I do not have Wolfram Mathematica

Thanks

$\endgroup$

2 Answers 2

7
$\begingroup$

You can do the following. Once you get the output in Wolfram Alpha web page, say you have typed solve y'+x=0, then in the output window, hover the mouse there, and select plain text option

enter image description here

Then in the window which opens, select continue in computable notebook

enter image description here

Then a Wolfram Alpha notebook now opens showing the commands it used to generate the output on the web page. Like this

enter image description here

The commands are not evaluated. To evaluate them, hit the enter key in the first cell. This will now generate the output you saw at the Wolfram web page.

Then below the output cell, now type the command TeXForm[%] to generate the Latex, like this

enter image description here

Then copy the Latex to clipboard and paste the latex to your Latex editor.

$\endgroup$
3
  • $\begingroup$ Strange...I get output as "0.01 TeXForm" $\endgroup$ Feb 11, 2021 at 13:22
  • $\begingroup$ @user9106985 did you evaluate the CELL and type TeXForm[%] in new cell below it? $\endgroup$
    – Nasser
    Feb 11, 2021 at 16:11
  • $\begingroup$ got it! Thanks a lot! $\endgroup$ Feb 11, 2021 at 16:40
2
$\begingroup$

You can copy the plain text and use http://asciimath.org/ to convert it to MathML, and then on https://npm.runkit.com you can do:

const Mathml2latex = require('mathml-to-latex');

const mathml = `
<math xmlns="http://www.w3.org/1998/Math/MathML">
.
.
.
</math>
      `;
 
Mathml2latex.convert(mathml);

And then run it

enter image description here

Or alternatively paste it to a text file, save as mathml.xml, download the XSLT MathML library, download an XSLT processor like saxon on the XML file, and then put it all in the same folder and execute:

enter image description here

Alternatively you can sign up at https://www.wolframcloud.com and then go to https://www.wolframcloud.com and create a new notebook and then paste in the wolfram language code for the computation and then press shift enter and then type in TeXForm[%] and then shift enter as Nasser says.

enter image description here

$\endgroup$

Your Answer

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

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