Skip to content

Conversation

@A-moment096
Copy link
Contributor

Just a minor fix about the math render for table of contents.

From the most recent release, #1103 introduced a change to restrict the math render region from the whole document to the element ".main-article". This enables LaTeX rendering provided by comment systems.

However, this prevents rendering of math formulae in the table of contents. So a quick fix can be just add the toc elements into the render list. Maybe in the furture some others can add their math-living elements to be rendered in that list as well.

Here's a comparsion between changing it or not.

Before: After:
image image

Hope this can help someone writes math formulae in (sub)titles as well!

Add element (.widget--toc) to be rendered by KaTeX
Copy link
Owner

@CaiJimmy CaiJimmy left a comment

Choose a reason for hiding this comment

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

Thanks!!

@CaiJimmy CaiJimmy changed the title Render math formula for the table of contents feat: render math formula for the table of contents Nov 1, 2025
@CaiJimmy CaiJimmy merged commit dd3bb1e into CaiJimmy:master Nov 1, 2025
4 of 5 checks passed
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.

2 participants