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

Unable to enable KaTeX #2174

Closed
jluttine opened this issue Nov 16, 2015 · 7 comments
Closed

Unable to enable KaTeX #2174

jluttine opened this issue Nov 16, 2015 · 7 comments
Assignees
Milestone

Comments

@jluttine
Copy link

I'm not able to use KaTeX for some reason. In my conf.py, I set:

EXTRA_HEAD_DATA = """
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css">
"""
USE_KATEX = True

But still math formulas are rendered with MathJax. I've tried adding mathjax tag and nikola clean, nikola forget but no effect. I'm using this theme as a parent: https://themes.getnikola.com/#ipython

Any ideas what could be wrong?

@Kwpolska
Copy link
Member

Have you tried with the default bootstrap3 theme?

IIRC, the ipython theme is useless now as all the changes were merged into base/bootstrap3. If base/bootstrap3 work fine (mind testing?), we should delete the ipython theme.

@Kwpolska Kwpolska added this to the v7.7.4 milestone Nov 16, 2015
@Kwpolska Kwpolska self-assigned this Nov 16, 2015
@jluttine
Copy link
Author

Thanks for the reply! I tested a little bit: switching to bootstrap3 broke even MathJax, but I got it fixed by using \\[ ... \\] instead of $$ ... $$ and by adding a tag mathjax to the post. However, I still didn't get KaTeX to work. But at least it doesn't now render with MathJax, it doesn't render at all, so it looks like it's now at least trying to do something else than use MathJax. Continuing testing...

@Kwpolska
Copy link
Member

  1. You can still use $$ syntax if you reconfigure MathJax, a snippet is in the config.
  2. The mathjax tag is required for posts that use it, unless they are written using ipynb.
  3. I got KaTeX to work with $a$, \\(a\\) and \\[a\\] in bootstrap3, with a mathjax tag. (the equation* environment produced by reST is not supported)
  4. The ipython theme is woefully broken.

@jluttine
Copy link
Author

I created a simple new Nikola site and there I got KaTeX working. So at least my system makes it possible to use KaTeX. Now I just need to find the configuration that breaks KaTeX in my actual blog. I'll report if I find something relevant.

@ralsina
Copy link
Member

ralsina commented Nov 16, 2015

KaTeX support is not very well tested, and running it puts a large brick on
top of a very tall pile of Javascript Jenga. The JS console debugger may
help you there, it's probably crashing on something before running it.

On Mon, Nov 16, 2015 at 12:43 PM Jaakko Luttinen notifications@github.com
wrote:

I created a simple new Nikola site and there I got KaTeX working. So at
least my system makes it possible to use KaTeX. Now I just need to find the
configuration that breaks KaTeX in my actual blog. I'll report if I find
something relevant.


Reply to this email directly or view it on GitHub
#2174 (comment).

@jluttine
Copy link
Author

@ralsina Thanks for the tip! I solved it from the console easily. The problem was that KaTeX didn't recognize '\mathcal':

Error: KaTeX parse error: Expected 'EOF', got '\mathcal' at position 9:

Removing that, and everything renders just fine with KaTeX. Thanks for your help. Should I report this to KaTeX?

@ralsina
Copy link
Member

ralsina commented Nov 16, 2015

@jluttine probably, yes. At least so they confirm if it's expected behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants