linjer / jekyll-katex

[DEPRECATED] Jekyll plugin for easy server-side math rendering via KaTeX
MIT License
96 stars 8 forks source link

Katexmm display mode does not work #29

Open varunagrawal opened 4 years ago

varunagrawal commented 4 years ago

I followed the instructions in the README

  1. Gemfile looks like this

    group :jekyll_plugins do
    gem "github-pages"
    gem "jekyll-feed", "~> 0.6"
    gem "jekyll-katex", "~> 1.0.0"
    end
  2. I ran bundle install

    Using github-pages 200
    Using jekyll-katex 1.0.0 (was 0.1.2)
  3. I added the CSS file in my header.

  4. Added {% katexmm %} {{content}} {% endkatexmm %} in my default.html.

  5. Inline mode $ with renders great, but display mode with $$ gives me blank.

Any idea what may be up?

varunagrawal commented 4 years ago

I inspected the webpage and it shows

<script type="math/tex; mode=display">\sum_i w(r_i) r_i \frac{\delta r_i}{\delta p_j} = 0</script>

which seems like Mathjax doing something. I tried setting math_engine: nil in the _config.yml but that doesn't seem to have any effect. Any ideas what I may try?

linjer commented 4 years ago

@varunagrawal Thanks for the report! The easiest thing for me would be to reproduce the issue.

Is there a simple example that I can use to reproduce locally?

varunagrawal commented 4 years ago

You could try this website: https://github.com/borglab/gtsam.org

It was the one I was trying to update.

A6GibKm commented 4 years ago

I have the same issue,

{% katexmm %} {{content}} {% endkatexmm %}

On my blog layout does not work, but adding the {% katexmm %} tag inside the actual post does work.

jamesking commented 3 years ago

The source of this problem is that the Kramdown markdown parser in Jekyll is already attempting to apply a math transformation to $$ blocks.

The solution is to add this to your config:

kramdown:
  math_engine: null

This allowed $$ display blocks inside {% katexmm %} liquid tags to work correctly for me.