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

Add KaTeX rendering for Org-mode files #21630

Open
tecosaur opened this issue Oct 30, 2022 · 6 comments
Open

Add KaTeX rendering for Org-mode files #21630

tecosaur opened this issue Oct 30, 2022 · 6 comments
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@tecosaur
Copy link

tecosaur commented Oct 30, 2022

Feature Description

Now that KaTeX rendering for Markdown has been merged, it would be nice to extend that to Org documents too.

I've made a quick test/about document on try.gitea: https://try.gitea.io/tecosaur/testing/src/branch/main/gitea-maths-test.org

The short version is that it seems like go-org (which gitea currently uses) already identifies maths, but nothing is done with it. I would recommend targeting the following constructs:

  • \( inline maths \)
  • \[ display maths \]
  • \begin{env} latex env \env{env}

Screenshots

No response

@tecosaur tecosaur added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Oct 30, 2022
@eeyrjmr
Copy link
Contributor

eeyrjmr commented Oct 30, 2022

I guess the proposal should be more for Katex to work in md files not just comments.

@delvh
Copy link
Member

delvh commented Oct 30, 2022

I think that is exactly what this issue is trying to say, but you need the knowledge what go-org is…

@tecosaur
Copy link
Author

I'm not sure about the support for LaTeX constructs in other plaintext markup formats Gitea supports, I just know that go-org (https://github.com/niklasfasching/go-org) is used for Org (.org files), and it recognises them.

@holocronweaver
Copy link

FWIW for org-mode latex I typically use dollar signs for inline ($) and display ($$), though the single-dollar has some slightly wonky rules for recognition.

Would be happy to see any support though, especially for \( and \[.

@tecosaur
Copy link
Author

Yea, $ are soon to be recommended against in the official manual, there's even been talk of removing them from the syntax on the mailing list (not going to happen due to backwards compatibility concerns). So, I'd consider supporting \( and \[ much more important than $/$$.

@holocronweaver
Copy link

$ are soon to be recommended against in the official manual

That's unfortunate, though I can understand why, parsing would be wonky. Still, in my limited experience $ is fairly common in the wild, and as you said it isn't going away anytime soon, so would be nice to have it for compatibility. But I agree \( and \[ should have higher priority, though wide compatibility is pretty important too so having $ support would still be great.

@delvh delvh changed the title Add KaTeX rendering for Org Add KaTeX rendering for markdown files Apr 5, 2023
@tecosaur tecosaur changed the title Add KaTeX rendering for markdown files Add KaTeX rendering for Org-mode files Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

4 participants