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

A small bug of KaTeX plugin #2500

Closed
yuzijie opened this issue Jul 18, 2016 · 12 comments
Closed

A small bug of KaTeX plugin #2500

yuzijie opened this issue Jul 18, 2016 · 12 comments

Comments

@yuzijie
Copy link

yuzijie commented Jul 18, 2016

Hi, I have found a small bug of KaTeX plugin which is the vector symbol cannot be displayed.

From KaTeX official website
katex

From Tiddlywiki KaTeX demo page
tiddlywiki

@Jermolene
Copy link
Member

Thanks @yuzijie I'm investigating. One issue is that the demo on the KaTeX site actually wraps the text you enter into the string \displaystyle{<typedformula>}. After allowing for that I'm finding that TW and the KaTeX demo are generating exactly the same HTML, so I think it might be a fonts issue. Will continue investigating.

@Jermolene
Copy link
Member

Hi @yuzijie what browser are you using? After a bit more investigation, I think this might be a Chrome bug; in my tests, TiddlyWiki renders correctly in Firefox:

screenshot 2016-07-19 16 04 02

It's not clear why the KaTeX demo site isn't encountering the same bug, I'll continue investigations.

@yuzijie
Copy link
Author

yuzijie commented Jul 20, 2016

Hi @Jermolene, It is indeed a Webkit bug! I never use Firefox, so I assumed that all browsers should have the same problem. However, I did some investigation today, and found that this bug is related to webkit browsers only, except for Safari, which doesn’t apply the correct length of the arrow. Then accidentally, I found this weird thing:

bug

It proves my point.

@yuzijie
Copy link
Author

yuzijie commented Jul 21, 2016

I think the best solution for this is to add text-rendering: auto; in .katex class.

@Jermolene
Copy link
Member

Thank you @yuzijie for your brilliant detective work, the fix works for me.

@ghost
Copy link

ghost commented Nov 20, 2018

Hi,

I am having this problem with my TiddlyWiki. Vector arrows do not display, whether I open it in Chrome, Edge, Internet Explorer or Firefox.

I am using the latest version, 5.1.17, of both TiddlyWiki and the KaTeX plugin.

I tried to switch from "text-rendering: optimizeLegibility;" to "text-rendering: auto;" within all the KaTeX parts of the .html file, but it didn't help. @yuzijie : What exact part of the .html file is the .katex class you mention, in which I should add "text-rendering: auto;"?

Is nobody else still experiencing this?

Sincerely,

@eguiraud
Copy link

eguiraud commented May 6, 2019

Hi, still experiencing this (I'm on firefox).

I created a new tiddler KatexStylesheet with tag $:/tags/Stylesheet and content

.katex {
    text-rendering: auto;
}

and, although it seems that the CSS is being picked up (checked e.g. by changing katex background to red), I still cannot see any arrows over \vec{x}.

@pmario
Copy link
Member

pmario commented May 7, 2019

@bluehood ... The problem seems to be from SVG max-width definition from TW.

.katex svg {
  max-width: initial;
}

This does the trick for me in FF. .. The text-rendering: auto; imo isn't needed, since it is applied already that way.

@pmario
Copy link
Member

pmario commented May 7, 2019

I was testing with: https://tiddlywiki.com/plugins/tiddlywiki/katex/

So if you did include other plugins, which include CSS settings it may be different results!

@pmario
Copy link
Member

pmario commented May 7, 2019

@Jermolene ... IMO this bug should be reopened an fixed.

@eguiraud
Copy link

eguiraud commented May 7, 2019

@pmario thank you so much, max-width: initial did the trick!

Jermolene added a commit that referenced this issue May 11, 2019
@Jermolene
Copy link
Member

Thanks @bluehood @pmario I've pushed a fix for v5.1.20 -- 94d18a2

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

4 participants