gettalong / kramdown

kramdown is a fast, pure Ruby Markdown superset converter, using a strict syntax definition and supporting several common extensions.
http://kramdown.gettalong.org
Other
1.72k stars 275 forks source link

kath math engine render problem #531

Closed jiangnanhugo closed 6 years ago

jiangnanhugo commented 6 years ago

Dear, I have tried to follow the document on kramdown with katex, but it just failed. So could you please share any possible demo jekyll website for showing what is the right configuration steps.

note: I used the lastest version of kramdown, jekyll and related dependices..

logs:

$ bundle exec jekyll serve --trace --incremental
Configuration file: /mnt/d/Data/jiangnanhugo.github.io/_config.yml
            Source: ./
       Destination: ./_site
 Incremental build: enabled
      Generating...
  Conversion error: Jekyll::Converters::Markdown encountered an error while converting '_posts/2017/2017-05-24-the-perplexity-of-neural-language-model.markdown':
                    can't modify frozen String
bundler: failed to load command: jekyll (/usr/local/bin/jekyll)
FrozenError: can't modify frozen String
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/math_engine/katex.rb:30:in `insert'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/math_engine/katex.rb:30:in `call'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/base.rb:221:in `format_math'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/html.rb:320:in `convert_math'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/html.rb:70:in `block in inner'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/html.rb:69:in `each'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/html.rb:69:in `inner'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/html.rb:88:in `convert_p'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/html.rb:70:in `block in inner'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/html.rb:69:in `each'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/html.rb:69:in `inner'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/html.rb:341:in `convert_root'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/html.rb:57:in `convert'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/converter/base.rb:105:in `convert'
  /var/lib/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/document.rb:117:in `method_missing'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/converters/markdown/kramdown_parser.rb:40:in `convert'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/converters/markdown.rb:77:in `convert'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/renderer.rb:101:in `block in convert'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/renderer.rb:99:in `each'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/renderer.rb:99:in `reduce'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/renderer.rb:99:in `convert'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/renderer.rb:83:in `render_document'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/renderer.rb:62:in `run'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/site.rb:479:in `render_regenerated'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/site.rb:464:in `block (2 levels) in render_docs'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/site.rb:463:in `each'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/site.rb:463:in `block in render_docs'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/site.rb:462:in `each_value'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/site.rb:462:in `render_docs'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/site.rb:191:in `render'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/site.rb:71:in `process'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/command.rb:28:in `process_site'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/commands/build.rb:65:in `build'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/commands/build.rb:36:in `process'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/commands/serve.rb:93:in `block in start'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/commands/serve.rb:93:in `each'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/commands/serve.rb:93:in `start'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
  /var/lib/gems/2.5.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
  /var/lib/gems/2.5.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
  /var/lib/gems/2.5.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
  /var/lib/gems/2.5.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
  /var/lib/gems/2.5.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
  /var/lib/gems/2.5.0/gems/jekyll-3.8.3/exe/jekyll:15:in `<top (required)>'
  /usr/local/bin/jekyll:23:in `load'
  /usr/local/bin/jekyll:23:in `<top (required)>'
gettalong commented 6 years ago

Issue creator solved his problem