jekyll没有将从org-mode导出的乳胶渲染为html

时间:2016-03-29 16:25:27

标签: export latex jekyll org-mode mathjax

我想问一个关于jekyll和org-mode集成的问题,特别是在创建包含乳胶和数学公式的博客文章时。

问题: Jekyll似乎没有正确地呈现乳胶代码,因为每当我访问我的博客文章时它显示为未呈现。

请查看下面的图片,了解网页上的内容。

latex not rendered properly

这就是我在.org文件中写的内容。

latex as it was written in the .org file

这是.org-mode中用于导出到html的配置

(require 'ox-publish)
(require 'ox-html)
(setq org-publish-project-alist
    '(("org-posts"
     ;; Path to your org files.
     :base-directory "~/path/to/org/files/"
     :base-extension "org"
     ;; Path to your Jekyll project.
     :publishing-directory "~/path/to/blog/root/dir/"
     :recursive t
     :publishing-function org-html-publish-to-html
     :headline-levels 4
     :html-extension "html"
     :body-only t
     :table-of-contents nil
     :html-mathjax "path \"https://cdn.mathjax.org/mathjax/latest/MathJax.js\""
    )

    ("org-imgs"
     :base-directory "~/path/to/org/files"
     ;:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|php"
     :base-extension "jpg\\|gif\\|png\\|jpeg"
     :publishing-directory "~/path/to/blog/assets/images/"
     :recursive t
     :publishing-function org-publish-attachment
     :table-of-contents nil
     :html-mathjax "path \"https://cdn.mathjax.org/mathjax/latest/MathJax.js\""
     )

    ("blog" :components ("org-posts" "org-imgs"))))

这是我在~/path/to/blog/_includes/head.html关于mathjax引擎的内容。

<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
        tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"] ],
        processEscapes: true
        }
    });
</script>

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    </head>
<body>

我在做什么?我一整天都在敲打我的脑袋,仍然没有找到任何解决方案。我已经尝试过我在互联网上找到的大部分内容,但似乎没有任何效果。

我还试图在博客根目录和head.html中包含所有jsMath文件夹,其中包含用于解析latex的渲染引擎,我指向从jsMath文件夹中获取javascript引擎但不幸的是没有好运,再次。

请建议如何解决此问题。

提前致谢。

0 个答案:

没有答案