Skip to content

Conversation

MdSaifAliMolla
Copy link

@MdSaifAliMolla MdSaifAliMolla commented Oct 12, 2025

closes #1673
To reduce the gap between line and text, I used CustomPainter.

Web Mobile

@gnprice gnprice added the maintainer review PR ready for review by Zulip maintainers label Oct 14, 2025
Copy link
Member

@rajveermalviya rajveermalviya left a comment

Choose a reason for hiding this comment

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

Thanks @MdSaifAliMolla! This will also need updates to the KaTeX widget tests, and also please update the description with screenshots comparing both web and mobile.


static final overline = KatexExample.block(
r'overline: \overline{a}',
r'\overline{a}',
Copy link
Member

Choose a reason for hiding this comment

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

Please add a link to a test message in #test here channel, matching other tests.

Copy link
Author

Choose a reason for hiding this comment

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

done.

Comment on lines 640 to 652
case 'overline':
// .overline { border-top: 0.04em solid; }
borderStyle = KatexBorderStyle(
position: KatexBorderPosition.top,
widthEm: 0.04,
color: KatexSpanColor(0, 0, 0, 255),
);

case 'underline':
// .underline { border-bottom: 0.04em solid; }
borderStyle = KatexBorderStyle(
position: KatexBorderPosition.bottom,
widthEm: 0.04,
color: KatexSpanColor(0, 0, 0, 255),
);
Copy link
Member

Choose a reason for hiding this comment

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

These don't seem to match an existing class in katex.scss. Can please you provide the reference for these styles?

Copy link
Author

Choose a reason for hiding this comment

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

i didn't find any related class in katex.scss, but i found that the border-width is given 0.04em or 0.049em in some places.
Mostly did trial and error and whatever pleases the eye😔.

.angl { // from package actuarialangle, which is always used in a subscript. box-sizing: border-box; border-top: 0.049em solid; // defaultRuleThickness in scriptstyle border-right: 0.049em solid; // ditto margin-right: 0.03889em; // 1 mu }
also this
.fcolorbox { box-sizing: border-box; border: 0.04em solid; // \fboxrule = 0.4pt }

@MdSaifAliMolla
Copy link
Author

@rajveermalviya take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer review PR ready for review by Zulip maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle borders (e.g. for overline) in KaTeX

3 participants