What are some simplifications I can make in order to parse LaTeX strings in category theory, in a useful way?

94 Views Asked by At

Here's a screenshot of a PyQt5 app I'm making. It renders LaTeX by calling latex and dvipng from a MikTeK installation.

enter image description here

I want to make this diagram tool that acts as a notebook and perhaps diagram chasing tool.

There's a problem though. How does the user specify the math symbols? Clearly the set of possible strings from a category theory book is much different from general math.

The app will have to do at least some category theory in order to be a tool you'd want to use. However representing all possible objects that would occur in a book seems daunting and error-prone.

I was thinking, maybe a \cdot could always mean that's where some morphism or functor composes, so in order to take the functor of a diagram, it's simple text replacement processing. That is an example of a simplifying assumption.

Please give me some ideas of what I could do as general mathematical language processing is way too difficult.

1

There are 1 best solutions below

3
On

Perhaps you could work with the macros in the 'diagrams' package collection? Either have the user enter the relevant macros directly, or create an interface on top of those macros.