SFML community forums

General => General discussions => Topic started by: barnack on June 18, 2018, 09:14:32 am

Title: Rendering expression from latex syntax
Post by: barnack on June 18, 2018, 09:14:32 am
Greetings,
is anyone interested in working together on code that takes as input a latex math expression and gives as output the image of that expression, without relying on outside code?

I'd like to work on that but probably some help would benefit; still not sure if using lex/yacc for parsing or doing it manually, but i've always used such tools for simple (and sample) code at university, never used them for anything more serious.
Title: Re: Rendering expression from latex syntax
Post by: eXpl0it3r on June 18, 2018, 09:50:55 am
Writing a LaTeX engine is no trivial task at all.

Personally I'd suggest to just use an existing library and the use the generated raster graphics in SFML. Quickly googling I found thia library: https://github.com/goldsborough/latexpp

Even if you want to write your own, I suggest to at least check latexpp's source code to get a feel of the complexity. ;)
Title: Re: Rendering expression from latex syntax
Post by: barnack on June 22, 2018, 01:27:57 pm
Well i'm not aiming to full latex syntax, i'd rather focus on expressions only, which already excludes a lot of weird latex things.
(nevermind i just noticed that your library focuses on expressions only as well)
Also making it in an SFML-like manner, sharing fonts, coordinate types etcc would allow to inset it in an SFML code nicely.

________________________________________
Quote
latexpp uses KaTeX to render LaTeX to HTML. Because KaTeX is a JavaScript library, latexpp uses Google's V8 engine to write JavaScript from C++. Image output is enabled by the wkhtmltox C library.
This thing though smells so much overhead-ish.  :-\
Title: Re: Rendering expression from latex syntax
Post by: eXpl0it3r on June 22, 2018, 01:37:24 pm
Haha, actually looking closer at latexpp, don't use that :D
They actually just use katex which is a JavaScript library to render TeX math and then they pull in Google's V8 engine to run JavaScript to render LaTeX.... :o

Maybe you'll find someone who's willing to help, but I wouldn't invest my time into writing such code, when there are already existing libraries out there that implement that complex system.