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

feat: latex rendering with katex #275

Merged
merged 1 commit into from
Dec 8, 2024
Merged

Conversation

moonmd
Copy link

@moonmd moonmd commented Dec 8, 2024

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.

@pionxzh pionxzh merged commit 972175e into pionxzh:master Dec 8, 2024
1 check passed
@pionxzh
Copy link
Owner

pionxzh commented Dec 8, 2024

I will do some test tmr and release a new version. Thanks.

@moonmd
Copy link
Author

moonmd commented Dec 8, 2024

Not sure if it is a glitch, but there is a ':' appended to the link.
https://registry.npmjs.org/pnpm:
It passed in my repo actions after I pulled your checkin, so I ran it again with debug here:
https://github.com/moonmd/chatgpt-exporter/actions/runs/12224698563/job/34098442377

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

Successfully merging this pull request may close these issues.

2 participants