jeffreytse / jekyll-spaceship

🚀 A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, mermaid, emoji, video, audio, youtube, vimeo, dailymotion, soundcloud, spotify, etc.
MIT License
626 stars 67 forks source link

Is the mathjax configuration hard-coded? #26

Closed danielluehr closed 4 years ago

danielluehr commented 4 years ago

Hi,

the plugin is just great, thank you very much for the good work. I am not sure if this is the correct place to ask, I hope it is.

I am quite new to jekyll and ruby in particular, but I have more experience with another SSG and programming languages.

I added jekyll-spaceship, because it was the easiest way to add mathjax support to a project based on jekyll to which I just started contributing. Also, the additional functionality might come handy soon enough. However, I would like to configure mathjax options beyond the default ones.

I added a section in _config.yml with the additional settings, however they are not included in the generated code. Just for testing I tried to override one of the default settings, but the generated code still used the default values.

By looking at the code, I think the configuration script for mathjax is hardcoded, although I might be wrong, considering I am not that familiar with ruby.

I am currently using version 0.9.2 of the plugin.

This is the section I added to _config.yml (to enable equation numbering)

jekyll-spaceship:
  mathjax-processor:
    config:
      tex:
        tags: 'ams'

So, is it possible to configure MathJax at all? If so, what is the correct way to do it?

Thanks you very much

jeffreytse commented 4 years ago

Hi @danielluehr

Thanks for your good question about the mathjax-processor configuration. It could be customized by the _config.yml, it's not hard-code, it has a default config of Mathjax v3. And the Mathjax config structure is the same as the official, but the format is in yaml. Here is the latest doc for ams for your reference.

Thanks and regards.

danielluehr commented 4 years ago

Thanks a lot,

It seems my original _config.yml was not ok, for some reason. I copied the configuration "tree" straight from your README's example and added the configuration setting I was testing. Now it works as expected.

Regards