【发布时间】:2020-06-26 03:31:23
【问题描述】:
我正在使用 nbconvert 将我的 jupyter notebook 转换为 html by
jupyter nbconvert my.ipynb --to html
然后它说:
[NbConvertApp] 将笔记本 my.ipynb 转换为 html [NbConvertApp] 将 407497 字节写入 my.html
然后在生成的my.html中,可以看到需要custom.css:
<!-- Custom stylesheet, it must be in the same directory as the html file -->
<link rel="stylesheet" href="custom.css">
<!-- Loading mathjax macro -->
<!-- Load mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS_HTML"></script>
<!-- MathJax configuration -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true,
processEnvironments: true
},
// Center justify equations in code and markdown cells. Elsewhere
// we use CSS to left justify single line equations in code cells.
displayAlign: 'center',
"HTML-CSS": {
styles: {'.MathJax_Display': {"margin": 0}},
linebreaks: { automatic: true }
}
});
</script>
信息:
nbconvert 版本为5.6.1
谢谢
【问题讨论】:
标签: html css jupyter-notebook nbconvert