几个月来我一直在使用 Anki 和 MathJax,但是在桌面上字体大小非常小(不过在 AnkiDroid 上很好)。我每次使用 MathJax 时都使用 \huge 来解决它,但这显然不是最好的解决方案。它还使移动设备上的所有内容都变得太大。
我的 MathJax 配置如本文所述。我已经搜索了如何编辑 MathJax 的缩放比例和字体大小,但没有任何效果(例如),它大多只是破坏了它。
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>