-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
report unsupported macros by katex and expand user-define commands #99
Conversation
packages/unified-latex-to-pretext/libs/report-and-expand-macros.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/libs/report-and-expand-macros.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/libs/report-and-expand-macros.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/libs/report-and-expand-macros.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/tests/unified-latex-macro.test.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/tests/unified-latex-macro.test.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/tests/unified-latex-macro.test.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/tests/report-unsupported-macro-katex.test.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/tests/report-unsupported-macro-katex.test.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/tests/report-unsupported-macro-katex.test.ts
Show resolved
Hide resolved
packages/unified-latex-to-pretext/libs/expand-user-defined-macros.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/libs/expand-user-defined-macros.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/libs/expand-user-defined-macros.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/libs/expand-user-defined-macros.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/libs/expand-user-defined-macros.ts
Outdated
Show resolved
Hide resolved
packages/unified-latex-to-pretext/libs/expand-user-defined-macros.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code visits all the nodes and returns a list of macros' content which are not supported by katex in math mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the unsupported macro which is being pushed to the list, is it just the name of the macro or as well as its parameters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code returns macros that is newly defined by the user and expands them. macroInfo collects the information of the anything that is of new commends, which is implmented as part of the "../uified-latex-util-macros". is Object.fromEntries used to integrate everything into a string? The needToExpand function visits all the nodes and checks if it has nodes and if the content match, why is that?
The reportMacrosUnsupportedByKatex function will return a list of all macros in math mode that aren't supported by Katex within the AST passed in as input. The ExpandUserDefinedMacros function will expand user-defined commands such as from
\newcommand
,\renewcommand
, etc., modifying the AST passed in as input.