Space below display equations

23 views
Skip to first unread message

Ramakrishna Salagrama

unread,
Dec 11, 2019, 3:22:28 AM12/11/19
to MathJax Development
When I use $$ sign, the space below the display equation is very high and looking ugly.  How can I reduce the space below equations?  site name: www.campusgate.co.in 
I am already using the following two lines inline equation spacing. 

styles: {'.mjx-chtml': {padding: '6px 0'}},
       matchFontHeight: false,

display_spacebelow.png


Murray Bourne

unread,
Dec 11, 2019, 8:56:47 PM12/11/19
to MathJax Development
Ramakrishna

The <br> that you have below each equation is causing the extra space. You've set padding as 6px and the <br> is 16 pixels high, so the total is 22px.

Remove the <br> below the equations and I believe you'll get what you are looking for:

Capture.PNG


You may find it looks better with 10px.

Regards
Murray

Ramakrishna Salagrama

unread,
Dec 11, 2019, 11:05:11 PM12/11/19
to MathJax Development
Check the following code.  If the equation is inline, the <br> is not causing any problem. This is just a normal line break. Please check 6th question answer. https://www.campusgate.co.in/2019/12/chain-rule.html
$\therefore \dfrac{{36 \times 6 \times 18}}{{27 \times 8 \times x}} = \dfrac{{1}}{1}$ 
$\Rightarrow \require{cancel}\dfrac{{\cancel{36}^4 \times {6} \times {18}}}{{\cancel{27}_3\times {8} \times {x}}} = \dfrac{{1}}{1}$
$\Rightarrow \require{cancel}\dfrac{{\cancel{36}^\cancel{4} \times {6} \times {18}}}{{\cancel{27}_3\times \cancel{8}_2\times {x}}} = \dfrac{{1}}{1}$
$\Rightarrow \require{cancel}\dfrac{{\cancel{36}^\cancel{4} \times \cancel{6} \times {18}}}{{\cancel{27}_\cancel3\times \cancel{8}_\cancel2\times {x}}} = \dfrac{{1}}{1}$
$\Rightarrow x = 18$

But I wonder from where this extra <br> is coming from. 

Murray Bourne

unread,
Dec 12, 2019, 1:26:20 AM12/12/19
to MathJax Development
The extra <br> is coming from the Wordpress text editor you are using. It assumes (rightly) that a line break in your text should be replaced with a <br> in the final markup. (You mentioned you were using $$ signs, but actually, the displayStyle is coming from the fact you are using \tags in those equations.)

One way out of this is to not have any line break after each line involving \tag, like this.

$\therefore \dfrac{{30 \times m \times 18 \times 7}}{{45 \times w \times d \times 9}} = \dfrac{{12t}}{{32c}} \tag{1}$ It is given, 4 men can make 3 tables in the same time as 3 women can make 4 chairs.

That is not so satisfactory. It may be too late for your situation, but I feel it's always better to use <p> tags rather than <br> for line breaks, and also to use margin rather than padding between lines. Then (for example) the (default) 1em margin at the bottom of the first <p> (the one with an equation) would "merge" with the (default) 1em margin at the top of the second paragraph (the one with text), resulting in a (nicer) 1 em spacing between lines.

Then you would have spacing that is easier to read (where lines within paragraphs have a single line space, and between paragraphs have a double line space), like this:

We cannot directly apply chain rule here as work is different in both cases as well as on the first job men are working and on the second women are working. ...Filler text. Filler text. Filler text. Filler text. Filler text. Filler text....
 
Let the efficiency of a man = m, Woman = w

Most WYSIWYG editors produce a <p> tag if you do 2 <enter>s at the end of a line (and a <br> for only one). Try it with 2 and check it gives <p>s, and see how it looks. You may need to change your CSS to suit.

Regards
Murray 

Ramakrishna Salagrama

unread,
Dec 12, 2019, 1:59:35 AM12/12/19
to MathJax Development
I kept <p> tags around the equations with $$ sign and space got removed.  I will continue doing like this whenever there is a need to centre equations. btw, I am using blogger and for line break, we have to press enter and <br> sign is automatically inserted into text and it is not visible till parsing.  Thanks for your help. 


On Wednesday, 11 December 2019 13:52:28 UTC+5:30, Ramakrishna Salagrama wrote:
Reply all
Reply to author
Forward
0 new messages