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

suggestion: support latex math expressions using remark-math and rehype-katex #150

Open
gyunseo opened this issue Oct 15, 2023 · 5 comments

Comments

@gyunseo
Copy link

gyunseo commented Oct 15, 2023

I think support latex math expression in markdown is a good option like the following image.
image

Thank you
Best Regards
@gyunseo

@satnaing
Copy link
Owner

Appreciate your suggestion and effort.
However, I'm thinking of adding a how-to blog post for adding support latex math expressions. This is because AstroPaper is aimed to be as minimal as possible; and, besides, not everyone using AstroPaper would need this feature. But if someone does, they can opt in this feature by following the how-to blog post guide.

@andreyyao
Copy link

I tried adding katex using the same process you described, and it worked quite well, except that the colors are messed up in dark mode:
image

As you can see, the math text is very very faint. Does anyone have any idea how to fix this?

@caleb-shelton
Copy link

I followed this tutorial and didn't have this issue @andreyyao https://blog.alexafazio.dev/blog/render-latex-in-astro/

@andreyyao
Copy link

andreyyao commented Dec 21, 2023

@caleb-shelton I just did a fresh install, and it's the same issue. Which version of remark-math and rehype-katex are you using?

EDIT: Upon further inspection, I think tailwindcss or the dark mode toggle is not playing right with the katex expressions. I got a temporary fix working by overwriting this css in layouts/PostDetails.astro:

 /* This is fixing the dim color of katex in dark mode */
 .prose {
     color: var(--color-text-base);
 }

@gyunseo
Copy link
Author

gyunseo commented Dec 23, 2023

@andreyyao I didn't know that issue since I always use light mode. I've found the same issue with yours on my blog. I fixed it using your modification on layouts/PostDetails.astro. thanks so much! :D

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 a pull request may close this issue.

4 participants