Skip to content

Conversation

@dpvc
Copy link
Member

@dpvc dpvc commented Sep 20, 2017

Make fractions conform to TeX spacing, for all styles (display, text, script, and scriptscript). Also, properly handle \large and other sizing macros. Still need to handle linethickness (particularly linethickness=0), and beveled fractions, but good enough for now.

This also includes a change to the CHTMLWrapper's handleScale() which allows you to set the scale on any node (not just the top-level one). This was originally going to be needed for the struts that enforce some spacing rules, but it ended up not being needed. But I left the change in since it might be useful to break out the setting of the scale as a separate function.

Some of the constants used in the bounding box computation should be taken from the font parameters, but for now those values are hard-coded into the CSS, so I've hard coded them into the BBox computation as well. Eventually, that will need to be fixed.

dpvc added 3 commits October 10, 2017 06:24
… script, and scriptscript). Still need to handle linethickness (particularly linethickness=0), and beveled fractions, but good enough for now.
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my email.

bbox.combine(nbox, pad, a + 1.5 * t + Math.max(nbox.d, .25));
bbox.combine(dbox, pad, a - 1.5 * t - Math.max(dbox.h, .75));
bbox.w += pad + .2;
const T = (display ? 3.5 : 1.5) * this.font.params.rule_thickness;;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove ;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

* @override
*/
public toCHTML(parent: HTMLElement) {
this.chtml = this.standardCHTMLnode(parent);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit confused what the difference between chtml and CHTML is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHTML is my shorthand for CommonHTML. toCHTML() is the function that creates the CommonHTML version of the internal MathML nodes (as a tree of HTML elements). this.chtml is a cached pointer to the subtree for this (wrapped) internal MathML node.

@dpvc
Copy link
Member Author

dpvc commented Oct 28, 2017

I've made the requested changes.

@zorkow
Copy link
Member

zorkow commented Nov 17, 2017

Lgtm

dpvc added 2 commits December 6, 2017 08:44
Add support for munder/mover/munderover
Add support for mub/msup/msubsup
@dpvc dpvc merged commit ccea021 into misc-fixes Dec 6, 2017
@dpvc dpvc deleted the mfrac-improvements branch December 6, 2017 13:47
sudhansubhushanmishra added a commit to sudhansubhushanmishra/MathJax-src that referenced this pull request Jun 14, 2021
Line mathjax#48 had a typo, of {OptionLis} instead of {OptionList}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants