How can I render markdown math formula properly? #1866
Replies: 2 comments 1 reply
-
<!-- index.html -->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/vue.css">
<title>Docsify Demo</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
- <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
- <!-- CDN files for docsify-katex -->
- <script src="//cdn.jsdelivr.net/npm/docsify-katex@latest/dist/docsify-katex.js"></script>
<!-- or <script src="//cdn.jsdelivr.net/gh/upupming/docsify-katex@latest/dist/docsify-katex.js"></script> -->
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"/>
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
el: "#app",
repo: 'https://github.com/LiuCMU/ML_courses',
loadSidebar: true,
plugins: [
// mathjax
function (hook) {
hook.doneEach(function () {
if (typeof MathJax !== 'undefined') {
MathJax.Hub.Queue(["Typeset", MathJax.Hub])
}
})
}
]
}
</script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
<script src="guide/js/search.min.js"></script>
<script src="guide/js/prism-java.min.js"></script>
<script src="guide/js/emoji.min.js"></script>
<script src="guide/js/zoom-image.min.js"></script>
<script src="guide/js/docsify-copy-code.js"></script>
<script src="guide/js/docsify-sidebar-collapse.min.js"></script>
<script src="guide/js/docsify-plugin-flexible-alerts.js"></script>
<script src="guide/js/vanilla-back-to-top.min.js"></script>
<script src="guide/js/docsify-darklight-theme.js"></script>
+ <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+ <!-- CDN files for docsify-katex -->
+ <script src="//cdn.jsdelivr.net/npm/docsify-katex@latest/dist/docsify-katex.js"></script>
<!-- 支持数学公式 -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']], processClass: 'math', processEscapes: true },
TeX: {
equationNumbers: { autoNumber: ['AMS'], useLabelIds: true },
extensions: ['extpfeil.js', 'mediawiki-texvc.js'],
Macros: {bm: "\\boldsymbol"}
},
'HTML-CSS': { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } }
});
</script>
<script src="https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-AMS-MML_HTMLorMML&v=20200504"></script>
</body>
</html> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
LiuCMU
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I used docsify and GitHub Pages to host a website to summarize some ML concepts. The math formulas were written in Markdown, but they are not rendered in the webpage. Does someone know how to let the website support Markdown formulas? Thank you very much!
Here is the website: https://liucmu.github.io/ML_courses/#/./10-701/lecture3 The formulas are not rendered in the website:
But in markdown, the formulas look fine.
Here is my index.html: https://github.com/LiuCMU/ML_courses/blob/main/index.html
I already tried to include MathJax in it. Thanks again!
Beta Was this translation helpful? Give feedback.
All reactions