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: 78
Joined: Tue Jan 16, 2018 1:05 am

How to display math formula or symbol in wxWidgets?

Post by shawnee »

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: 7479
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

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

Post by ONEEYEMAN »

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: 78
Joined: Tue Jan 16, 2018 1:05 am

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

Post by shawnee »

I mean this kind of math formula or express:
https://upload.wikimedia.org/wikipedia/ ... ession.png
Kvaz1r
Super wx Problem Solver
Super wx Problem Solver
Posts: 357
Joined: Tue Jun 07, 2016 1:07 pm

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

Post by Kvaz1r »

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 438
Joined: Fri Dec 12, 2008 10:31 am

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

Post by ollydbg23 »

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 438
Joined: Fri Dec 12, 2008 10:31 am

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

Post by ollydbg23 »

https://github.com/NanoMichael/cLaTeXMath

I found another good latex render library.
shawnee
Experienced Solver
Experienced Solver
Posts: 78
Joined: Tue Jan 16, 2018 1:05 am

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

Post by shawnee »

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 438
Joined: Fri Dec 12, 2008 10:31 am

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

Post by ollydbg23 »

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