【发布时间】:2018-12-09 23:16:04
【问题描述】:
我已经使用 Anki 和 MathJax 几个月了,但是在桌面上字体大小非常小(不过在 AnkiDroid 上很好)。我每次使用 MathJax 时都使用 \huge 来解决它,但这显然不是最好的解决方案。它还使移动设备上的所有内容都变得太大。
我的 MathJax 配置为 this post。我已经搜索了如何编辑 MathJax 的缩放和字体大小,但没有任何效果(e.g.),它大多以破坏它而告终。
MathJax.Hub.processSectionDelay = 0;
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
showProcessingMessages:false,
tex2jax:{
inlineMath: [['$','$']],
displayMath:[['$$','$$']],
processEscapes:true
}
});
另外,我的卡的设置:
.card {
font-family: arial;
font-size: 20px;
text-align: center;
color: black;
background-color: white;
}
.cloze {
font-weight: bold;
color: blue;
}
默认大小(太小)和\huge(更合理):
我知道这应该很容易。如果可能的话,也许会大大降低 MathJax 的缩放比例。
编辑:Alistair Martin 基本上解决了它(桌面和 AnkiDroid 都很好)。它是这样工作的:
<script type="text/x-mathjax-config">
MathJax.Hub.processSectionDelay = 0;
MathJax.Hub.Config({
messageStyle: 'none',
showProcessingMessages: false,
tex2jax: {
inlineMath: [['$', '$']],
displayMath: [['$$', '$$']],
processEscapes: true
},
SVG: {
scale: (!!navigator.userAgent.match(/(mac)|(mobile)/i) ? 100 : 180)
}
});
</script>
<script type="text/javascript">
(function() {
if (window.MathJax != null) {
var card = document.querySelector('.card');
MathJax.Hub.Queue(['Typeset', MathJax.Hub, card]);
return;
}
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_SVG';
document.body.appendChild(script);
})();
</script>
【问题讨论】:
-
请提供现场样品。
-
抱歉,我不知道该怎么做。但我附上了一张图片。
-
您有指向实时页面的链接吗?这很可能是特定上下文的问题。