Skip to content

Conversation

@dpvc
Copy link
Member

@dpvc dpvc commented Apr 13, 2018

This PR finishes the CommonHTML output for mfrac. It implements the bevelled attribute, implements linethickness, and in particular support for linethickness="0" which requires a different layout (in the TeXBook appendix G), and adds support for numalign and denomalign attributes.

As a side effect, the createMo() method has been moved from msqrt.ts to the base Wrapper.ts file, since it is needed for the bevelled fractions, and will be needed for mfenced in the future.

@dpvc dpvc requested a review from zorkow April 14, 2018 13:19
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.

Two minor things.

const fparam = this.font.params;
if (t !== .06) {
const a = fparam.axis_height;
const tEm = this.em(t), T = (display ? 3.5 : 1.5) * t;
Copy link
Member

Choose a reason for hiding this comment

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

Two lines.

const a = fparam.axis_height;
const T = (display ? 3.5 : 1.5) * t;
bbox.combine(nbox, 0, a + T + Math.max(nbox.d * nbox.rscale, (display ? fparam.num1 : fparam.num2) - a - T));
bbox.combine(dbox, 0, a - T - Math.max(dbox.h * dbox.rscale, (display ? fparam.denom1 : fparam.denom2) + a - T));
Copy link
Member

Choose a reason for hiding this comment

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

Some computations are the same as in makeFraction (a and second args of Math.max).
Could they be combined into an aux method, thereby shortening some of these lines?

@zorkow
Copy link
Member

zorkow commented May 2, 2018

I've just realised that you are using texWithDelims now, instead of withDelims.
I don't mind either way, I just need to know to use the correct property.

@zorkow
Copy link
Member

zorkow commented May 2, 2018

I found the relevant discussion for texWithDelims:

#53 (comment)

@dpvc
Copy link
Member Author

dpvc commented May 3, 2018

I've fixed the issues, including withDelims, and am merging.

@dpvc dpvc merged commit 3fdcaa9 into master May 3, 2018
@dpvc dpvc deleted the mfrac-attributes branch May 3, 2018 16:23
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