如何在Kivy Python中显示数学文本? [英] How to display math-text in Kivy Python?
本文介绍了如何在Kivy Python中显示数学文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想问一下如何在 kivy
应用中显示数学文本吗?例如:如何在LaTeX中执行与 $ \ frac {1} {2} $
或 $ 2 ^ {3} $
相同的操作(省略字体类型),只要它是数学可读的).
我知道在 matplotlib.pyplot
模块中,我可以使用字符串: r'$ \ frac {1} {2} $'
或 r'$ 2 ^ {3} $'
生成数学文本.但这不会在 kivy
中产生期望的结果:
标签(文本= r'$ \ frac {1} {2} $')
将重现 $ \ frac {1} {2} $ .
谢谢.
解决方案
请查看 解决方案
Please Take a look at the sympy module, then in your label you must use a font_name
that can display math-text
but If you want to use Latex formula then you have to find a font_name that can display those formula like you want
Update: Otherwise you can generate your Latex in a png then integrate it in your kivy app
这篇关于如何在Kivy Python中显示数学文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文