Latex 更改MathJax';Anki上的字体大小
我已经在MathJax中使用Anki几个月了,但是桌面上的字体大小非常小(不过在AnkiDroid上也可以)。每次使用MathJax时,我都会使用\maging来解决这个问题,但这显然不是最好的解决方案。这也使得手机上的一切都太大了 My MathJax的配置如中所示。我搜索了如何编辑MathJax的缩放比例和字体大小,但没有任何效果(),结果大多是破坏了它Latex 更改MathJax';Anki上的字体大小,latex,mathjax,anki,Latex,Mathjax,Anki,我已经在MathJax中使用Anki几个月了,但是桌面上的字体大小非常小(不过在AnkiDroid上也可以)。每次使用MathJax时,我都会使用\maging来解决这个问题,但这显然不是最好的解决方案。这也使得手机上的一切都太大了 My MathJax的配置如中所示。我搜索了如何编辑MathJax的缩放比例和字体大小,但没有任何效果(),结果大多是破坏了它 MathJax.Hub.processSectionDelay = 0; MathJax.Hub.Config({ extensions:
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;
}
默认大小(太小)和\大(更合理):
我知道这应该很容易。如果可能的话,可能会大大减少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>
MathJax.Hub.processSectionDelay=0;
MathJax.Hub.Config({
messageStyle:'无',
showProcessingMessages:false,
tex2jax:{
inlineMath:[['$','$']],
displayMath:[['$','$$']],
processEscapes:正确
},
SVG:{
比例:(!!navigator.userAgent.match(/(mac)|(mobile)/i)?100:180)
}
});
(功能(){
if(window.MathJax!=null){
var card=document.querySelector('.card');
队列(['Typeset',MathJax.Hub,card]);
返回;
}
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(脚本);
})();
以下是迄今为止对我有效的方法:
?config=TeX-MML-AM_SVG
,如链接中所述<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>
MathJax.Hub.processSectionDelay=0;
MathJax.Hub.Config({
messageStyle:'无',
showProcessingMessages:false,
tex2jax:{
inlineMath:[['$','$']],
displayMath:[['$','$$']],
processEscapes:正确
},
SVG:{
比例:(!!navigator.userAgent.match(/(mac)|(mobile)/i)?100:180)
}
});
^这里100是Ankidroid和macOS的百分比比例,180是Windows的百分比比例。请选择Live示例。抱歉,我不知道如何操作。但是我包括了一张图片。你有一个到实时页面的链接吗?这很可能是一个特定环境的问题。这真的很好。按计划工作。另外,MathJax正在加载,所以我忽略了他提到SVG的部分。。。