linjer / jekyll-katex

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

Liquid syntax error: Unknown tag 'katex' #22

Closed Harrypotterrrr closed 5 years ago

Harrypotterrrr commented 5 years ago

I have followed your instructions:

  1. Add the plugin to _config.yml, e.g.:
    plugins:
      - jekyll-katex
  2. Add jekyll-katex to your Gemfile plugin block:
    group :jekyll_plugins do
      gem 'jekyll-katex'
    end
  3. Add KaTeX CSS and Fonts. Put the following in my page headers:
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">

but when I use bundle exec jekyll build the following error appears: Liquid Exception: Liquid syntax error (line 23): Unknown tag 'katex' in I am a freshman in front-end field, so could you help me with this problem? Thank you in advance!

awnumar commented 5 years ago

Did you run bundle install?

And it's probably sufficient to put just gem 'jekyll-katex' in your Gemfile. Mine looks like:

source "https://rubygems.org"
gem "jekyll"
gem "jekyll-feed"
gem "jekyll-katex"
gem "jekyll-sitemap"
Harrypotterrrr commented 5 years ago

@awnumar Thank you for your help sincerely! I have used bundle install before but failed for the following error:

Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

I struggled to deal with this problem for a long time, and now I worked it out by adding gem 'therubyracer' to the Gemfile.

awnumar commented 5 years ago

You can get a JavaScript runtime by installing node: apt-get update && apt get install nodejs.

Harrypotterrrr commented 5 years ago

@awnumar Hi, I have met a serious problem when I deploy my project to Github. It emailed me that it failed to build because of Page build failed: Unknown tag error. I succeed in running my code locally, but I don't know what I should do to make it work on Github. Could you help me with that?