Mathjax - 内联/块的缩放选项

发布于 2024-12-21 19:35:50 字数 316 浏览 1 评论 0原文

您好,内联方程和块方程可以有不同的比例吗? 由于内联 eq,我的缩放比例为 150%。 - 我需要它们大。但是块中的方程太大了。

我可以为内联和块单独设置缩放吗? 对于 $ \tech $ 来说,它会比 $$ \tech $$ 更大

MathJax.Hub.Config({
"HTML-CSS": {
scale: 150,
},
tex2jax: {
  inlineMath: [ ['$','$'], ["\\(","\\)"] ],
  displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
},
});

Hello is it possible to have different scale for inline equations and block equations?
I have scale at 150 % because of inline eq. - I need them big. But then equations that are in block are a way too large.

Can I set scalling individually for inline and block?
For $ \tech $ it would be bigger then for $$ \tech $$

MathJax.Hub.Config({
"HTML-CSS": {
scale: 150,
},
tex2jax: {
  inlineMath: [ ['
,'
], ["\\(","\\)"] ],
  displayMath: [ ['$','$'], ["\\[","\\]"] ],
},
});

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

╭ゆ眷念 2024-12-28 19:35:50

没有为此内置任何内容,但您可以使用类似

<script type="text/x-mathjax-config">
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
  var TEX = MathJax.InputJax.TeX;
  var PREFILTER = TEX.prefilterMath;
  TEX.Augment({
    prefilterMath: function (math,displaymode,script) {
      if (!displaymode) {math = "\\large{"+math+"}"}
      return PREFILTER.call(TEX,math,displaymode,script);
    }
  });
});
</script>

在每个内联数学表达式前面添加 \large 之类的内容(并将缩放比例设置回 100%)。

如果内联数学不够大,那么可能是 CSS 或字体设置中的某些问题导致了这种情况。例如,如果您必须在数学周围使用 来防止您的数学被某些标记引擎篡改,则与 关联的字体code> 元素将控制数学的大小(而不是它周围的文本)。这可以由代码块的 CSS 控制,但也可以在大多数浏览器中设置为单独的字体。似乎大多数浏览器配置的字体都小于常规字体(我不太明白为什么),因此这也可能会导致您的问题。

There is nothing built in for this, but you could use something like

<script type="text/x-mathjax-config">
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
  var TEX = MathJax.InputJax.TeX;
  var PREFILTER = TEX.prefilterMath;
  TEX.Augment({
    prefilterMath: function (math,displaymode,script) {
      if (!displaymode) {math = "\\large{"+math+"}"}
      return PREFILTER.call(TEX,math,displaymode,script);
    }
  });
});
</script>

to add \large in front of every in-line math expression (and set the scaling back to 100%).

If the in-line math isn't large enough, then then may be something in your CSS or your font settings that is causing that. For example, if you are having to use <code> around the math to prevent your mathematics from being tampered with by some markup engine, then the font associated with <code> elements will be the one that controls the size of the math (rather than the text that surrounds it). That could be controlled by the CSS for code blocks, but it can also be set in most browsers as a separate font. It seems that most browsers are configured with that font being smaller than the regular font (I don't really understand why) and so that could be causing your problem as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文