wxMaxima-developers / wxmaxima

A gui for the computer algebra system Maxima built with wxWidgets
https://wxMaxima-developers.github.io/wxmaxima/
Other
472 stars 98 forks source link

TeX cell: render text cells as LaTeX #932

Open ponyatov opened 7 years ago

ponyatov commented 7 years ago

Are any attempts in development was made to add LaTeX into wx interface? It will be good to render TextCell as LaTeX or add special cell type.

gunterkoenigsmann commented 7 years ago

I thought about a MathML-to-maxima-translator, too.

The problem is that both LaTeX and MathML allow for a very big range of ways to visualize something. Is a big centered dot above a variable a sign that you want to use diff(x,t)? Is a apostrophe after a variable a diff(x,t)? Is a "^T" a transpose()? Or does it really mean (^T)? ...And there are a thousand ways of creating these things: \stackrel for example for the dot and various dot symbols, for the ^T a M^{T}, a {M}^T, a {M}^{T} etc... ...also a matrix can be created by several TeX environments...

=> creating a rough TeX-to-maxima-converter would be possible. But it only would work in special cases. Don't know if it would be really useful this way.

gunterkoenigsmann commented 6 years ago

Wait: I think I misunderstood the ticket:

There already is a "copy as LaTeX" right-click menu for text cells. Is this what you wanted?

DanteCpp commented 6 years ago

I believe @ponyatov meant to render LaTeX inputs entered in the textCells. In other words, the possibility to write formulas in the text comments without actually the need of parsing and executing them with maximal. I think it would be a useful feature.

gunterkoenigsmann commented 6 years ago

That would be immensely useful. But writing a full TeX parser is loads of work and getting TeX output text that matches the size of the text in the GUI and finding a way of deciding if the user wants to see the TeX output or its input, currently, and handling linebreaks in TeX depending on how much space remains in the current line would be hard, too => I don't expect to be able to resolve this feature in the next few months. But I do understand what it means.

DanteCpp commented 6 years ago

I understand that's a lot of work! A possible solution for deciding if the user wants to render the output rather than display the LaTeX input is the classical method $$. By the way, I suppose there are tons of opensource LaTeX parsers written in c++ that may be easily integrated.

mirekslouf commented 6 years ago

As far as I understand, the question is how to combine LaTeX and wxMaxima in an easy way. If yes, then the following www-site shows the answer:

ederag commented 2 years ago

Thanks for wxMaxima, great tool ! https://sourceforge.net/projects/texmaths/ is awesome to include LaTeX into libreoffice (writer and impress). It uses the system LaTeX distribution to render svg or png images and inline them where appropriate. One huge advantage is that you can use your preferred packages (with the appropriate header).

Not easy, but that might be a source of inspiration ?

By the way, copy/paste from impress is a workaround (except it is displayed as a "Figure", and not inline).

gunterkoenigsmann commented 2 years ago

If you copy your maths as RTF LibreOffice should include it as a real equation without having to resort to static images that cannot be edited by hand if maxima expresses an equation slightly different to what you want it to. I always hoped that this is way more useful than rendering maths using LaTeX

ederag commented 2 years ago

@gunterkoenigsmann Like the OP, I'm talking about putting LaTeX equations inside wxMaxima. Not from wxMaxima to anywhere else.

Libreoffice was just an example where svg generated by LaTeX works very well, can be inlined, and edited (just click on the image, hit the texmath button, edit, render).

Most if not all the difficulties you correctly mentioned in https://github.com/wxMaxima-developers/wxmaxima/issues/932#issuecomment-360974453 have been solved there. Perhaps some of it could be transposed here. That's why I gave this example.

w568w commented 2 years ago

Since it is able to copy as TeX from wxMaxima, it would be pretty nice to paste TeX eqns to wxMaxima. I have seen that commercial softwares like Mathematica are equipped with such a feature, by which only simple expressions are supported, though.

Maybe this repository can function as a feature or plugin?