How to support latex in github-pages?

前端 未结 4 1380
孤城傲影
孤城傲影 2020-12-22 16:04

I use jekyll to write post and show it in github-pages. My source file is writen with markdown.

How can I insert formula into the markdown file?

4条回答
  •  猫巷女王i
    2020-12-22 16:34

    The easiest way to do this right now is to use the KaTeX auto-render extension.

    Simply drop the following into your :

    
    
    
    

    Note that this assumes the following delimiters appear in your HTML:

    $$\LaTeX code$$   (for display)
    \\[\LaTeX code\\] (also for display)
    \\(\LaTeX code\\) (for inline)
    

    Note, if using Jekyll, you will need to have the following in your _config.yml:

    markdown: kramdown
    kramdown:
        math_engine: katex
    

    WARNING: Do not use math_engine: mathjax. It will break this by automatically removing the LaTeX delimiters.

提交回复
热议问题