Fix invalid LaTeX macros for mu, nu, tau, and down-arrow in equation conversion - #2228
Merged
Merged
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree |
Member
|
Merged! Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes typo'd LaTeX macros in
converter_utils/docx/math/latex_dict.pythat produced invalid LaTeX output when converting Word equations
containing certain symbols.
Bugs fixed
\m→\mu(U+1D707, mathematical italic mu)\n→\nu(U+1D708, mathematical italic nu)\ta→\tau(U+1D70F, mathematical italic tau)\downright→\downarrow(U+2193, downwards arrow)\m,\n,\ta, and\downrightare not valid LaTeX commands. Any.docx file with an equation containing μ, ν, τ, or ↓ would produce
broken/invalid LaTeX in the converted markdown output.
How I found it
Ran
ruffstatic analysis over the codebase, which flagged aduplicate dict key warning near these entries. Manual review of the
surrounding Unicode-to-LaTeX mappings revealed the typos.
Testing
T['\U0001d707'] == '\\mu ', etc.test_docx_equationstest intest_module_misc.pystillpasses.
regressing in future.