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

Odd Katex rendering #671

Open
mtseng15 opened this issue Dec 15, 2024 · 4 comments
Open

Odd Katex rendering #671

mtseng15 opened this issue Dec 15, 2024 · 4 comments

Comments

@mtseng15
Copy link

Hello Everyone,

First of all, I wanted to say THANK YOU for this lovely theme and excellent documentation. This is awesome work and I am very grateful.

This may be a weird configuration thing on my side, but I noticed that some of my latex equations are rendering oddly. Specifically, there is something with the vertical margins on overlines, underlines and super scripts. For example, the equation:

\overline{x}'(t) = \underline{A}\overline{x}(t), \;\; \overline{x}(0) = \overline{b}

renders just fine in the online Katex demo

Screenshot 2024-12-14 at 6 46 20 PM

But in the book theme it looks like:

Screenshot 2024-12-14 at 6 42 03 PM

where the overlines are too low and the underlines are too high.

Does anyone have any ideas how I can fix this? It looks this could be a different font and I know Katex supports three different fonts so it makes me wonder if that is it.

I should also add this is my first time using Hugo and I'm still a little shaky on how all the templating works.

Thanks a lot!

@alex-shpak
Copy link
Owner

Hi! Do you have any CSS overrides? I tried your snipped, and got this
Image

@mtseng15
Copy link
Author

mtseng15 commented Jan 31, 2025

@alex-shpak Thank you for responding and your awesome theme!

Interesting! So I started from scratch again and added pieces back in. I found that following the instructions here to let $$ and $ be used to denote equations is what caused the issue. I'm still very new do Hugo so I have no clue why it is affecting it.

Do you have any thoughts? Or advise? I would really like to use $$ and $ to denote equations since that's what I'm used to in my normal note taking.

I would also appreciate an explanation on why it is happening too for my own education and learning.

Thanks a lot!
Micah

@alex-shpak
Copy link
Owner

Hm, try this:

  1. put {{<katex />}} at the beginning of the page
  2. use $$\overline{x}'(t) = \underline{A}\overline{x}(t), \;\; \overline{x}(0) = \overline{b}$$

@alex-shpak
Copy link
Owner

I will take a look at passthrough, might be a plug-and-play replacement

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

No branches or pull requests

2 participants