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

Support for LaTeX? #559

Open
koyuawsmbrtn opened this issue Dec 9, 2022 · 4 comments
Open

Support for LaTeX? #559

koyuawsmbrtn opened this issue Dec 9, 2022 · 4 comments
Labels
suggestion Suggestion for future consideration

Comments

@koyuawsmbrtn
Copy link

Just thought it'd be nice for our scientists

@skyjake skyjake added the suggestion Suggestion for future consideration label Dec 10, 2022
@skyjake
Copy link
Owner

skyjake commented Dec 10, 2022

The general issue here is embedding non-Gemtext syntax into a Gemtext file, and that is largely inadvisable due to compatibility issues. One should be able to view the document with any client, even those that don't support LaTeX.

One way would be to detect "application/x-latex" MIME type and render it as an image, so that those could then appear as inline images on the page. This is at least in theory doable with Lagrange's MIME hooks feature, but requires one to have a fully functional LaTeX system already installed. Such images are best pre-generated on serverside so the client doesn't have to worry about it.

My personal recommendation is to use Unicode math symbols and box drawing characters in a preformatted block, like so:

   n!      ╭ n ╮                 
──────── = │   │   for 0 ≤ k ≤ n 
k!(n-k)!   ╰ k ╯                 

However, creating these would likely require manual work as there isn't a trivial 1:1 conversion from a LaTeX equation into the corresponding Unicode representation. One has to take some artistic license to achieve the desired result... The benefit here is that any Gemini client can be expected to show the equation just fine without any special processing.

@bleonard252
Copy link

I thought OP was asking about using it as its own document type, instead of embedded.

@skyjake
Copy link
Owner

skyjake commented Jan 2, 2023

I thought OP was asking about using it as its own document type, instead of embedded.

@bleonard252 There is no fundamental technical difference when it comes to implementing that. The MIME hooks approach would work for entire documents as well. However, I don't really see a point in adding support for viewing new document formats as a built-in feature... Much better to rely on external full-featured viewers (#135).

@CyberTailor
Copy link
Contributor

TeX is just too huge to use in browsers. If you need math, modern web provides tools like MathML

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

No branches or pull requests

4 participants