The label on an mhchem arrow is no longer clipped - #750
Merged
Conversation
.katex-display hides vertical overflow so a wide formula's horizontal scrollbar does not bring a vertical one. KaTeX sizes the block from its own font metrics and has none for CJK, so the label in ->[燃烧] drew taller than the box and lost its top. Padding gives the headroom; the margin gives it back, so spacing to neighbours is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
Follow-up to #747, which I pushed to that branch after it had been merged, so it never landed. Once
\cerendered, the reporter's second example\ce{CH4 + 2O2 ->[燃烧] CO2 + 2H2O}showed the label above the arrow with its top cut off (seen by @PathGao on a build; ref #745).Mechanism
.katex-displaysetsoverflow-y: hiddenso a wide formula's horizontal scrollbar does not bring a vertical one, and hidden overflow clips at the padding edge. KaTeX sizes the block from its own font metrics and has none for CJK, so a CJK label is set in the fallback font and draws taller than the box. The block now carries0.4emof vertical padding as headroom, and the margin drops from1.5emto1.1em, so the distance to the neighbouring blocks is unchanged.Scope
One CSS rule. No test — a layout fact, checked on a build: clipped on the build before this change, whole after it.
Verification