Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Rendering expression from latex syntax  (Read 3066 times)

0 Members and 1 Guest are viewing this topic.

barnack

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Rendering expression from latex syntax
« 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
Re: Rendering expression from latex syntax
« Reply #1 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. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

barnack

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: Rendering expression from latex syntax
« Reply #2 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.  :-\
« Last Edit: June 22, 2018, 01:30:17 pm by barnack »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
Re: Rendering expression from latex syntax
« Reply #3 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything