Vertical space between lines

298 views
Skip to first unread message

Prof. Caju

unread,
Jan 12, 2017, 8:24:28 PM1/12/17
to MathJax Users
Hello all,

I run a math forum and I am using MathJax as the software to allow the users to post math equations.

The problem I am facing is with the vertical space between two consecutive lines when there is an equation in both lines.

You can see an example in the image below:


The code that generated this post, is this:

[tex3]\frac{2^{y+1}\cdot 2^{y-1}-7+2^{y-2}\cdot 2^{y-1}}{2^{y-1}}=\frac{1}{2^{y-2}}[/tex3]
[tex3]\frac{2^{2Y}-7+2^{2y-3}}{2^{y-1}}=\frac{1}{2^{y-2}}[/tex3]
[tex3]\frac{2^{2y}+2^{2y-3}-7}{2^{y-1}}=\frac{1}{2^{-1}(2^{y-1})}[/tex3]
[tex3]2^{2y}+2^{2y-3}-7=2[/tex3]
[tex3]2^{2y}(1+2^{-3})=9[/tex3]
[tex3]2^{2y}=8 \rightarrow 2^{2y}=2^3[/tex3]

tex3 is the tag I use for inline math.

As you can see, two consecutive line are two near one from another.

I'd like to have a code to insert in my MathJax.Hub.Config that always put a vertical space between this lines.

I've tried the following without success:

MathJax.Hub.Config({
    "HTML-CSS": {
        styles
: {
           
".MathJax": {
                padding
: "0.2em 0"
           
},
       
}
   
},
});

I know that the example I gave could be fixed using only one tag surrounding all equations and putting something like \\[20px] in the end of each line to achieve the vertical space, or other coding practices in the code directly, but this is not what I am asking for. I need a MathJax.Hub.Config that will do this in all messages my forum has (there are tons of messages just like this one I've shown).

Kind regards

Davide Cervone

unread,
Jan 15, 2017, 5:02:34 PM1/15/17
to mathja...@googlegroups.com
Inline math is supposed to interfere with the line spacing as little as possible.   Larger equations, like the ones you are using, are better handle via displayed equations.  If you must use in-line equations, then the fractions might be better rendered using horizontal rather than vertical fractions (e.g., x/y rather than \frac{x}{y}.)  If you modify the amount of vertical padding for inline equations, you will force lines of a paragraph to be farther apart even when that is not necessary (e.g., when the lines only contain things like x and y rather than fractions).

The reason the CSS padding that you are trying to apply isn't working is because the .MathJax elements are inline elements, and vertical paddies is only for block elements.  You could use

MathJax.Hub.Config({
    "HTML-CSS": {
        styles: {
            ".MathJax": {
                padding: "0.2em 0",
display: "inline-block"
            }
        }
    }
});

to force it to apply, but that may cause other layout problems with more sophisticated math alignments in some instances.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages