Skip to content

Fix KaTeX equation numbering in notebook preview#156276

Merged
mjbvz merged 1 commit intomicrosoft:mainfrom
pingren:fix/markdown-katex-line-no
Nov 2, 2022
Merged

Fix KaTeX equation numbering in notebook preview#156276
mjbvz merged 1 commit intomicrosoft:mainfrom
pingren:fix/markdown-katex-line-no

Conversation

@pingren
Copy link
Contributor

@pingren pingren commented Jul 26, 2022

Fixes #155888

Explanation

the KaTex has a stylesheet

https://github.com/KaTeX/KaTeX/blob/9164a15ef817161aa8f33beb0688e660fff87dd2/src/katex.less#L677

body {
	counter-reset: katexEqnNo mmlEqnNo;
}

which will compile into vscode/extensions/markdown-math/notebook-out/katex.min.css

However, the body style is not effective inside shadow-root element and will cause #155888.

CleanShot 2022-07-26 at 18 45 19

Adding this styles to shadow root explicitly will fix the issue.

Before:
CleanShot 2022-07-26 at 17 53 02

After:
CleanShot 2022-07-26 at 17 58 35

@mjbvz mjbvz added this to the November 2022 milestone Nov 2, 2022
@mjbvz mjbvz enabled auto-merge (squash) November 2, 2022 08:09
Copy link
Collaborator

@mjbvz mjbvz left a comment

Choose a reason for hiding this comment

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

Thanks!

@mjbvz mjbvz merged commit 7fbec6d into microsoft:main Nov 2, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Equation numbering in notebooks is broken. All equation numbers are "(1)".

3 participants