linjer/jekyll-katex

Problems with katexmm

Closed this issue · 4 comments

Hey there,

I'm trying to use this plugin to integrate katex in my personal page.
The {$ katexmm $} looked quite appealing such that I can write latex-style math-mode triggers in markdown files.

However, bundle exec jekyll serve yields

  Liquid Exception: Liquid syntax error (line 8): Unknown tag 'katexmm' in /_layouts/post.html                                                                                                                   

as soon as I put {% katexmm %} ... {$ endkatexmm $} into some html file.

The other {% katex display %} and {% katex %} environments work perfectly fine.

Context: I added the jekyll-katex plugin via Gemfile and bundle install. I included the katex css in the headers.

Did I miss anything?

@lgalke Thank you for reporting this issue. It's hard for me to tell what the core issue is without more detail. I'd like to clarify that the katexmm tag should only be available in version 0.3.0+ (I need to add this to the documentation somewhere).

Assuming you are using 0.3.0, I think it would be helpful if I could reproduce the issue locally. Do you have a project I could access for this?

@lgalke I just realized - did you put - jekyll-katex under plugins: in your _config.yml? Forgetting this step will give the you error of a tag not being registered and seems to be missing from your context.

However, I would expect {% katex %} and {% katex display %} to also not work.

I tested this on a freshly generated jekyll site and it seems to work on my end.

Good points. So far, I only had jekyll-katex (0.1.4) installed. Upon bundle exec gem install jekyll-katex, I encountered:

> bundle exec gem install jekyll-katex
ERROR:  Error installing jekyll-katex:
        The last version of jekyll-katex (>= 0) to support your Ruby & RubyGems was 0.1.4. Try installing it with `gem install jekyll-katex -v 0.1.4`
        jekyll-katex requires Ruby version >= 2.5.1. The current ruby version is 2.5.0.

(bundle install did silently install 0.1.4 before)

So, apparently my ruby version (2.5.0) does not support anything higher than 0.1.4. I'll try again with a newer version of ruby. Guess this will resolve the problems.

Thanks for mentioning that putting jekyll-katex also in _config.yml is mandatory. Jekyll docs state that the two ways (config.yml and Gemfile) of installing plugins are alternative to each other. Thus, I preferred to have everything in the same place. Now, I know better.

Until now, I was using system ruby for jekyll (2.5.0), which did not allow installing jekyll-katex 0.3.0 but only some old version (0.1.4). After fiddling a little with rbenv, I set up ruby 2.5.1 and it works:

Fetching jekyll-katex 0.3.0 (was 0.1.4)
Installing jekyll-katex 0.3.0 (was 0.1.4)

Note that I still did not add jekyll-katex to _config.yml but relied on the Gemfile. Still, the {% katexmm %} ... {% endkatexm %} environment works nicely.

I'd like to clarify that the katexmm tag should only be available in version 0.3.0+ (I need to add this to the documentation somewhere).

Yes, that might make sense.

Thanks again for your help.