How to display math formula or symbol in wxWidgets? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
shawnee
Experienced Solver
Experienced Solver
Posts: 67
Joined: Tue Jan 16, 2018 1:05 am

How to display math formula or symbol in wxWidgets?

Post by shawnee » Sun Mar 22, 2020 3:58 am

Hi there,

How can I display math formula or symbol in wxWidgets? I don't want image method, it's not flexible to change in codes.
Is there any better way? or a kind of Tex render for wxWidgets?

Thanks a lot!

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4243
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to display math formula or symbol in wxWidgets?

Post by ONEEYEMAN » Sun Mar 22, 2020 4:32 am

Hi,

Code: Select all

dc.DrawText();
?

Check wxDC documentation for proper parameters to the function...

Also, depending where do you want the formula to appear (wxRTC, wxTextCtrl, wxSTC), you might be using a special functions.

Thank you.

shawnee
Experienced Solver
Experienced Solver
Posts: 67
Joined: Tue Jan 16, 2018 1:05 am

Re: How to display math formula or symbol in wxWidgets?

Post by shawnee » Sun Mar 22, 2020 7:06 am

I mean this kind of math formula or express:
https://upload.wikimedia.org/wikipedia/ ... ession.png

Kvaz1r
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 216
Joined: Tue Jun 07, 2016 1:07 pm

Re: How to display math formula or symbol in wxWidgets?

Post by Kvaz1r » Sun Mar 22, 2020 8:07 am

I don't know any C or C++ library for converting from LATEX to image, except latexpp , so you can try to use it. As an alternative you can find some utility for convertation and call it from your application.

ollydbg23
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 200
Joined: Fri Dec 12, 2008 10:31 am

Re: How to display math formula or symbol in wxWidgets?

Post by ollydbg23 » Sun Mar 22, 2020 8:54 am

Kvaz1r wrote:
Sun Mar 22, 2020 8:07 am
I don't know any C or C++ library for converting from LATEX to image, except latexpp , so you can try to use it. As an alternative you can find some utility for convertation and call it from your application.
This github project looks good.

From my point of view, there are two methods (which I think [latexpp](https://github.com/goldsborough/latexpp) covers those two methods)
1, use the pipe, and send command to the latex engine, and get the result image(such as a png image), and load the png image in the wx based application.

2, use some javascript library, which need a wxWidget based web(html) render supporting javascripts(such as Katex or Mathjax).

I think method 1 is much simpler than method 2.
But I think method 2 can be more dynamic, anyone has any experience about method 2?
Thanks.

ollydbg23
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 200
Joined: Fri Dec 12, 2008 10:31 am

Re: How to display math formula or symbol in wxWidgets?

Post by ollydbg23 » Tue Mar 24, 2020 12:57 am

https://github.com/NanoMichael/cLaTeXMath

I found another good latex render library.

shawnee
Experienced Solver
Experienced Solver
Posts: 67
Joined: Tue Jan 16, 2018 1:05 am

Re: How to display math formula or symbol in wxWidgets?

Post by shawnee » Tue Apr 07, 2020 7:33 am

ollydbg23 wrote:
Tue Mar 24, 2020 12:57 am
https://github.com/NanoMichael/cLaTeXMath

I found another good latex render library.
Thank you, ollydbg23!
It looks good.

ollydbg23
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 200
Joined: Fri Dec 12, 2008 10:31 am

Re: How to display math formula or symbol in wxWidgets?

Post by ollydbg23 » Wed Apr 08, 2020 7:08 am

shawnee wrote:
Tue Apr 07, 2020 7:33 am
ollydbg23 wrote:
Tue Mar 24, 2020 12:57 am
https://github.com/NanoMichael/cLaTeXMath

I found another good latex render library.
Thank you, ollydbg23!
It looks good.
Please note that the cLaTeXMath project doesn't have a wxWidgets port, so you have to implement it yourself. Show us the progress if you have any good work. :D

Post Reply