Fix nested \dfrac (#1825)

* Fix nested \dfrac

* Update screen shots
This commit is contained in:
Ron Kok
2019-03-20 11:20:01 -07:00
committed by Erik Demaine
parent f35c77a544
commit 64d1c4e590
4 changed files with 8 additions and 5 deletions

View File

@@ -17,7 +17,9 @@ const htmlBuilder = (group, options) => {
// function used
let style = options.style;
if (group.size === "display") {
style = Style.DISPLAY;
// Get display style as a default.
// If incoming style is sub/sup, use style.text() to get correct size.
style = style.id > 3 ? style.text() : Style.DISPLAY;
} else if (group.size === "text" &&
style.size === Style.DISPLAY.size) {
// We're in a \tfrac but incoming style is displaystyle, so:
@@ -69,7 +71,7 @@ const htmlBuilder = (group, options) => {
let numShift;
let clearance;
let denomShift;
if (style.size === Style.DISPLAY.size) {
if (style.size === Style.DISPLAY.size || group.size === "display") {
numShift = options.fontMetrics().num1;
if (ruleWidth > 0) {
clearance = 3 * ruleSpacing;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -115,9 +115,10 @@ ExtensibleArrows: |
\end{array}
FractionTest: |
\begin{array}{l}
\dfrac{a}{b}\frac{a}{b}\tfrac{a}{b}\;-\dfrac12\;1\tfrac12\;{1 \atop 2}\; \cfrac{1}{1+\cfrac{1}{x}} \\[2.5em]
{a \brace b} \; {a \brack b} \; \genfrac \{ ]{0.8pt}{0}{a}{b}
\; {a \above1.0pt b}
\dfrac{a}{b}\frac{a}{b}\tfrac{a}{b}\;-\dfrac12\;1\tfrac12\;{1 \atop 2}
\; {a \brace b} \; {a \brack b} \\[1em]
\genfrac \{ ]{0.8pt}{0}{a}{b} \; {a \above1.0pt b} \; \cfrac{1}{1+\cfrac{1}{x}}
\xrightarrow[\dfrac g h]{\displaystyle\frac g h} \; \xrightarrow [2.\, \dfrac c d] {1.\, \displaystyle\frac c d}
\end{array}
Functions: \sin\cos\tan\ln\log
Gathered: |