Before Submitting
Bug Summary
In WYSIWYG mode, the equation number produced by KaTeX \tag{...} overlaps the rightmost part of a short display equation instead of being positioned at the right edge of the display block.
Operating System
macOS 26.6.2 (Build 25G83)
VMark Version
0.9.61 (runtime reproduction). The relevant math rendering and CSS rules appear unchanged in 0.9.65/current main.
Install Method
Homebrew
Steps to Reproduce
-
Open a Markdown document in WYSIWYG mode.
-
Add this display-math block:
$$
[H][\Delta P_T]=[\Delta V] \tag{9}
$$
-
Leave math editing mode so the rendered preview is shown.
Expected Behavior
The equation is centered and (9) is placed at the right edge of the display-math area without overlapping the equation.
Actual Behavior
(9) is positioned at the right edge of the equation's shrink-wrapped content box and overlaps the final term, visually resembling [\Delta V(9)].
Logs, Screenshots, or Repro
Minimal repro is included above. No error is logged; this is a deterministic layout issue.
Additional Context
KaTeX supports \tag in display mode, and VMark correctly calls renderToString with displayMode: true.
The likely cause is the block-preview layout:
.math-block-preview {
display: flex;
align-items: center;
justify-content: center;
overflow-x: auto;
}
.math-block-preview .katex-display {
margin: 0;
}
As a centered flex item, .katex-display shrink-wraps to the equation content instead of occupying the available row width. KaTeX positions the tag relative to that display box, so the tag lands on the equation's right edge.
The relevant rules are identical in v0.9.61 and current main. A fix should make short display equations use the available row width so tags have a real right margin, while preserving horizontal scrolling for intrinsically wide equations (for example, large matrices) and keeping the equation plus tag together as one scrollable unit.
Before Submitting
main.Bug Summary
In WYSIWYG mode, the equation number produced by KaTeX
\tag{...}overlaps the rightmost part of a short display equation instead of being positioned at the right edge of the display block.Operating System
macOS 26.6.2 (Build 25G83)
VMark Version
0.9.61 (runtime reproduction). The relevant math rendering and CSS rules appear unchanged in 0.9.65/current
main.Install Method
Homebrew
Steps to Reproduce
Open a Markdown document in WYSIWYG mode.
Add this display-math block:
Leave math editing mode so the rendered preview is shown.
Expected Behavior
The equation is centered and
(9)is placed at the right edge of the display-math area without overlapping the equation.Actual Behavior
(9)is positioned at the right edge of the equation's shrink-wrapped content box and overlaps the final term, visually resembling[\Delta V(9)].Logs, Screenshots, or Repro
Minimal repro is included above. No error is logged; this is a deterministic layout issue.
Additional Context
KaTeX supports
\tagin display mode, and VMark correctly callsrenderToStringwithdisplayMode: true.The likely cause is the block-preview layout:
As a centered flex item,
.katex-displayshrink-wraps to the equation content instead of occupying the available row width. KaTeX positions the tag relative to that display box, so the tag lands on the equation's right edge.The relevant rules are identical in v0.9.61 and current
main. A fix should make short display equations use the available row width so tags have a real right margin, while preserving horizontal scrolling for intrinsically wide equations (for example, large matrices) and keeping the equation plus tag together as one scrollable unit.