How to use the latex2mathml.converter function in latex2mathml

To help you get started, weโ€™ve selected a few latex2mathml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tsengwoody / Access8Math / addon / globalPlugins / MathMlReader / __init__.py View on Github external
def onLatexAdd(self, evt):
		import latex2mathml.converter
		from dialogs import LatexEntryDialog
		entryDialog = LatexEntryDialog(gui.mainFrame)
		if entryDialog.ShowModal() == wx.ID_OK:
			latex = entryDialog.GetValue()
			mathml = latex2mathml.converter.convert(latex)
			if sys.version_info.major == 2:
				import HTMLParser
				mathml = HTMLParser.HTMLParser().unescape(mathml)
			elif sys.version_info.major >= 3:
				import html
				mathml = html.unescape(mathml)

			MathMlReaderInteraction(mathMl=mathml, interaction_frame=True)