Skip to content

Conversation

@edemaine
Copy link
Member

@edemaine edemaine commented Jul 9, 2020

Fix #2225: \boldsymbol{\Omega} will now produce a bold upright Omega instead of a bold italic Omega. This only affects textord symbols within \boldsymbol, mimicking the no-font case in makeOrd which distinguishes textord from mathord in a similar way.

Demo

\Omega\boldsymbol{\Omega}\mathnormal{\Omega}\mathit{\Omega}

LaTeX (via quicklatex):
image
With this PR:
image
Without this PR:
image

Changed screenshot

Here's the diff on the changed screenshot BoldSymbol (red is old, green is new):
image

Here's the same example rendered by LaTeX, to confirm this is a fix:
image

Related PRs

This conflicts slightly with a one-line edit in #2156. But it actually replaces that explicit check for /[0-9]/, because these characters are already textords. So it makes that nice PR even more beautiful.

edemaine added 2 commits July 9, 2020 09:46
Fix KaTeX#2225: `\boldsymbol{\Omega}` will now produce a bold upright Omega
instead of a bold italic Omega.  This only affects `textord` symbols within
`\boldsymbol`, mimicking the no-font case in `makeOrd` which distinguishes
`textord` from `mathord` in a similar way.
@edemaine edemaine mentioned this pull request Jul 9, 2020
12 tasks
Copy link
Collaborator

@ronkok ronkok left a comment

Choose a reason for hiding this comment

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

I may be stepping a bit out of my lane here, reviewing other people's code, but this looks good to me.

I have also verified that the MathML has made the correct change. Before this PR, KaTeX returned <span style="margin-right: 0.04835em;" class="mord boldsymbol">Ω</span>. Now it returns <span class="mord mathbf">Ω</span>.

@ronkok ronkok merged commit 7523e97 into KaTeX:master Jul 9, 2020
@edemaine
Copy link
Member Author

edemaine commented Jul 9, 2020

Thanks for the review! Luckily it's just a one-line change, and can only affect \boldsymbol, and it's still not perfect (#2291), but I think this is a strict improvement. I see this Greek upright issue a lot in the wild (in my project), so I'm happy to see it fixed!

@ronkok
Copy link
Collaborator

ronkok commented Jul 9, 2020

coauthor looks like a neat project. Real-time collaboration is a powerful thing.

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.

\boldsymbol{\Omega} shouldn't be italic

2 participants