Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
fix: mathjax not work
Browse files Browse the repository at this point in the history
  • Loading branch information
EYHN committed Aug 25, 2017
1 parent f23d310 commit 3d23e82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions layout/_partials/import_js/now.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<% } %>
</script>

When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

<% // js in post and custom page
if (!is_home() && !is_archive() && !is_year() && !is_month() && !is_category() && !is_tag() && page.path !== 'search/index.html' && page.layout !== 'galleries' && page.layout !== 'gallery' && page.layout !== 'friends')
{ %>
Expand Down
4 changes: 2 additions & 2 deletions layout/_widget/post_mathjax.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% if (theme.location === 'cn') { %>
<script type="text/javascript" src="https://cdn.bootcss.com/mathjax/2.7.0/MathJax.js"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML-full"></script>
<% } else { %>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML-full"></script>
<% } %>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({"HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"], linebreaks: { automatic:true }, EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50) }, tex2jax: { inlineMath: [ ["$", "$"], ["\\(","\\)"] ], processEscapes: true, ignoreClass:
Expand Down

7 comments on commit 3d23e82

@yangchuansheng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请问一下这个是要先安装hexo-math插件吗

@Halyul
Copy link
Owner

@Halyul Halyul commented on 3d23e82 Aug 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yangchuansheng 不需要 迟一点我合进master分支您就可以使用了

@yangchuansheng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只需要在font-matter里面启用就行了是吧

@Halyul
Copy link
Owner

@Halyul Halyul commented on 3d23e82 Aug 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yangchuansheng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

layout/_partials/import_js/now.ejs这个文件修改的好像有问题,修改后页面底部变成这样了:
image

@Halyul
Copy link
Owner

@Halyul Halyul commented on 3d23e82 Aug 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yangchuansheng 对 是有问题 所以我还在询问@EYHN

@yangchuansheng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那个文件不用修改,只改下面那个文件就行了

Please sign in to comment.