pressbooks / pb-mathjax

A replacement for wp.com/latex.php but instead of LaTeX, it uses MathJax.
GNU General Public License v3.0
4 stars 1 forks source link

MathML is always displaying on a new line, can't be used inline #19

Open beckej13820 opened 5 years ago

beckej13820 commented 5 years ago

Playing with the new MathML coverage, I can't get MathML to display inline. It always creates a line break.

Asking on the forums, it appears Abby Elder is having the same problems, and Steel actually replicated it in his webbook when he cut and paste a source with MathML. Line breaks are being added before and after every MathML equation.

Screen Shot 2019-07-23 at 9 02 22 PM

https://integrations.pressbooks.network/testbookfun/chapter/three-popular-data-displays/

dac514 commented 5 years ago

Test case:

<p class="para block" id="fwk-shafer-ch02_s01_s03_p01">In our example of the exam scores in a statistics class, five students scored in the 80s. The number 5 is the <em class="emphasis">frequency</em> of the group labeled “80s.” Since there are 30 students in the entire statistics class, the proportion who scored in the 80s is 5/30. The number 5/30, which could also be expressed as <span class="inlineequation" id="shafer-20121106-125753-084206"><math xml:id="fwk-shafer-ch02-m0003" display="inline"><mn>0.1</mn><mrow><mover accent="true"><mn>6</mn><mo stretchy="true">-</mo></mover></mrow><mo>≈</mo><mo>.</mo><mn>1667</mn></math></span>, or as 16.67%, is the <span class="margin_term"><a class="glossterm">relative frequency</a><span class="glossdef">Of a class of measurements, the proportion of all measurements in the data set that are in the class.</span></span> of the group labeled “80s.” Every group (the 70s, the 80s, and so on) has a relative frequency. We can thus construct a diagram by drawing for each group, or class, a vertical bar whose length is the relative frequency of that group. For example, the bar for the 80s will have length 5/30 unit, not 5 units. The diagram is a <span class="margin_term"><a class="glossterm">relative frequency histogram</a><span class="glossdef">A graphical device showing how data are distributed across the range of their values by collecting them into classes and indicating the proportion of measurements in each class.</span></span> for the data, and is shown in <a class="xref" href="#fwk-shafer-ch02_s01_s03_f01">Figure 2.4 "Relative Frequency Histogram"</a>. It is exactly the same as the frequency histogram except that the vertical axis in the relative frequency histogram is not frequency but relative frequency.</p>

In webbook, turns into:

<p class="para block" id="fwk-shafer-ch02_s01_s03_p01">In our example of the exam scores in a statistics class, five students scored in the 80s. The number 5 is the <em class="emphasis">frequency</em> of the group labeled “80s.” Since there are 30 students in the entire statistics class, the proportion who scored in the 80s is 5/30. The number 5/30, which could also be expressed as <span class="inlineequation" id="shafer-20121106-125753-084206"></p>
<math xml:id="fwk-shafer-ch02-m0003" ... snip ...

Specifically:

</p><math

dac514 commented 5 years ago

It’s a WordPress bug:

https://core.trac.wordpress.org/ticket/13340

If I apply this patch it fixes the issue:

https://core.trac.wordpress.org/attachment/ticket/13340/13340.diff

For obvious reasons, I can’t simply patch wp-includes/formatting.php, WordPress must do it…

dac514 commented 5 years ago

Left a Trac comment:

https://core.trac.wordpress.org/ticket/13340#comment:15