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

LaTeX support #86

Closed
tecosaur opened this issue Aug 1, 2022 · 6 comments
Closed

LaTeX support #86

tecosaur opened this issue Aug 1, 2022 · 6 comments

Comments

@tecosaur
Copy link

tecosaur commented Aug 1, 2022

It would be nice to have support for LaTeX, namely:

  • Inline maths, i.e. \( ... \)
  • Display shorthand, i.e. \[ ... \]
  • LaTeX blocks, e.g.
\begin{alignat*}{2}
k(t) &= {\frac {x_{1}'(t)\,x_{2}''(t)-x_{1}''(t)\,x_{2}'(t)}{\left(x_{1}'\left(t\right)^{2}+x_{2}'\left(t\right)^{2}\right)^{{3}/{2}}}},\qquad &&N(t) ={\frac {1}{\|\gamma '(t)\|}}{\begin{bmatrix}-x_{2}'(t)\\x_{1}'(t)\end{bmatrix}} \\
R(t) &= \left|{\frac {\left(x_{1}'\left(t\right)^{2}+x_{2}'\left(t\right)^{2}\right)^{{3}/{2}}}{x_{1}'(t)\,x_{2}''(t)-x_{1}''(t)\,x_{2}'(t)}}\right|\qquad {\text{and}}\qquad &&Q(t)=\gamma (t)+{\frac {1}{k(t)\|\gamma '(t)\|}}{\begin{bmatrix}-x_{2}'(t)\\x_{1}'(t)\end{bmatrix}}\,.
\end{alignat*}
@niklasfasching
Copy link
Owner

Could you add some more detail on what should be happening and what you're observing? i.e. is this related to #55 ?

@tecosaur
Copy link
Author

tecosaur commented Aug 1, 2022

Going off https://niklasfasching.github.io/go-org/, it appears that LaTeX isn't recognised at all? Looking at #55 though it sounds like I may be mistaken.

image

@niklasfasching
Copy link
Owner

niklasfasching commented Aug 1, 2022

Thx, i think i get it now.

The plan is to recognize latex and output it raw, without any rendering - #55 describes a bug in that logic.

Given that, it would be possible to use e.g. mathjax to actually render the latex source. I don't think rendering latex is something that's in scope for this library - sounds like a huge undertaking. But we could e.g. provide hooks for latex rendering as we do for source highlighting if that would help.

What's the use case / is mathjax enough?

also see https://orgmode.org/manual/Math-formatting-in-HTML-export.html

@tecosaur
Copy link
Author

tecosaur commented Aug 1, 2022

Ah, I'm mostly concerned with helping applications using this package support LaTeX rendering in Org. It seems like the situation is much better than I guessed from the preview 👍. A fix to the logic for environments (#55) would be great. I'm not directly writing anything using go-org myself, but I use a few things like Gitea that render Org with go-org and I'm hoping that they'll support LaTeX rendering well since it's currently being discussed for Markdown (see go-gitea/gitea#20571).

@niklasfasching
Copy link
Owner

Sounds good :). I've been busy with other projects but I should be able to take another look at #55 in the next weeks. Closing in favor of #55 then and feel free to ping again if i end up forgetting about this 😁

@tecosaur
Copy link
Author

tecosaur commented Aug 1, 2022

Cool, thanks for getting back to me on this 🙂.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants