Skip to content

Conversation

@dlesbre
Copy link
Contributor

@dlesbre dlesbre commented Nov 18, 2025

Previously, if you defined a macro using \gdef in a math block, that macro would only be scoped to that block in the HTML KaTeX render. This PR adds persistent macros, allowing you to reuse that same macro in all subsequent math blocks.

Locally scoped macros are still possible using the \def command.

This is in accordance to the KaTeX documentation on macros:

Macros defined by \gdef, \xdef, \global\def, \global\edef, \global\let, and \global\futurelet will persist between math expressions.

The solution I used here is explained in the KateX API documentation.

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.

1 participant