Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mathjax - scale options for inline/block

Tags:

scale

mathjax

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: [ ['$$','$$'], ["\\[","\\]"] ],
},
});
like image 334
simapa Avatar asked Dec 17 '11 11:12

simapa


People also ask

Is MathJax the same as LaTeX?

MathJax can display mathematical notation written in LaTeX or MathML markup. Because MathJax is meant only for math display, whereas LaTeX is a document layout language, MathJax only supports the subset of LaTeX used to describe mathematical notation.

Is MathJax slow?

I found that MathJax is extremely slow. Is there a better, lighter and faster Javascript library that can render mathematical notation equally well? It may be your browser that is slow.


1 Answers

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.

like image 171
Davide Cervone Avatar answered Sep 30 '22 18:09

Davide Cervone