Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic LaTeX support #18

Open
AdrianoFerrari opened this issue Jan 16, 2018 · 5 comments
Open

Basic LaTeX support #18

AdrianoFerrari opened this issue Jan 16, 2018 · 5 comments
Labels
feature planned Feature or improvement that has been accepted. help wanted

Comments

@AdrianoFerrari
Copy link
Contributor

No description provided.

@AdrianoFerrari AdrianoFerrari added the feature planned Feature or improvement that has been accepted. label Jan 16, 2018
@AdrianoFerrari
Copy link
Contributor Author

Investigating how MathJax works, it seems that it's unlikely that we'll be able to use it without losing the power and simplicity of Elm's virtual DOM. Mathjax v3 will allow more options for this, but it's in pre-alpha.

Packages exist for other LaTeX rendering engines (e.g. bsouthga/elm-katex), but they are not compatible with elm-markdown, and generally not mature yet.

Will revisit this later.

@cben
Copy link

cben commented Mar 27, 2018

[Hi. Coming here from your announcement. I've long liked the idea of Gingko though to be honest don't remember why I didn't stick with it, didn't try the new one yet but looking forward to it!]

I'm not familiar with Elm but I suppose what you'd like best is a pure function from latex string to DOM?
MathJax has 2 major problems here:

  1. It wants to measure width/heights of parts to layout the whole. It does this by adding invisible parts to page (in batches) and making browser layout them.
    But nowdays in CHTML and possibly SVG mode, it can work "headless", producing fixed HTML.
  2. It's inherently async. You queue typesetting, then a callback. I think this originated because (1) was necessary anyway, but they also use it extensively to load things on demand.

KaTeX aviods both problems.

https://github.com/evancz/elm-markdown says it's based on marked — it might be easy to drop in https://github.com/GitbookIO/kramed, a fork of marked that includes kramdown-like math?? (I really don't know what I'm talking about here! :) Better yet, someone already started replacing it with markdown-it, for which numerous math plugins exist: evancz/elm-markdown#19

ref mathjax/MathJax#1763 (which I guess you saw), https://github.com/andre-dietrich/elm-mathjax to watch (currently empty), https://hackernoon.com/towards-latex-in-the-browser-2ff4d94a0c08 (not sure if relevant)

@AdrianoFerrari
Copy link
Contributor Author

Thanks for your research on this, @cben .

Yes, a pure "latex string to DOM" JS function would be ideal. There might be a way to hack something with that as a starting point.

But, I won't (and don't recommend) starting on that path yet. Elm 0.19 is going to be coming out, and my understanding is that it'll be disallowing JS in elm packages, so that'll likely be a dead end.

I'll have a closer look at https://github.com/jxxcarlson/minilatex though. @jxxcarlson has been working hard on getting Elm and LaTeX to work together, and has been in contact with the creator of Elm, so he's on the leading edge of this.

@heteloo
Copy link

heteloo commented Apr 14, 2022

Are you working on implementing latex...???

@rmfkdehd
Copy link

rmfkdehd commented Aug 6, 2023

What are the top priorities on your roadmap?
How important a goal is LATEX support?
Latex loading on gingkoapp.com is too slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature planned Feature or improvement that has been accepted. help wanted
Projects
None yet
Development

No branches or pull requests

4 participants