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

Export the original latex format in html #264

Open
Eggslegend opened this issue Nov 21, 2024 · 3 comments
Open

Export the original latex format in html #264

Eggslegend opened this issue Nov 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Eggslegend
Copy link

I'm wondering if the latex format can be saved and shown correctly when exporting to html.
Here are the examples.
ChatGPT-ChatGPT
ChatGPT-Sine_Formula_Explanation.json

@pionxzh pionxzh added the enhancement New feature or request label Nov 24, 2024
@pionxzh
Copy link
Owner

pionxzh commented Nov 24, 2024

I think we can try to include latex.js or generate the image embedded. Are you interested in submitting a PR?

@moonmd
Copy link

moonmd commented Dec 5, 2024

The new commit is a70a8b1 feat: html enhancements: toggle width & latex rendering
There are new package requirements and some modest upgrades in this commit.
I did clone a clean repo and verified the build and functional tests.

Text from the original PR:

  1. Added a second toggle for widescreen view
  2. Added katex to template.html to render latex. (This is the same engine OpenAI uses.)

The default render was not very readable but after some experimentation I found a format close to the original by adding \displaystyle and \large macros to the preprocessor.

Bare css was not able to center the display math (vs. inline) because identical css is generated for both. I check the nodes on either side of the latex parent for text to determine if it is inline and apply the proper formatting.

@moonmd
Copy link

moonmd commented Dec 8, 2024

Final PR #275

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

No branches or pull requests

3 participants