Skip to content
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

Wrong spacing between bold italic math letter and punctuation #631

Open
ywwry66 opened this issue Feb 22, 2024 · 4 comments
Open

Wrong spacing between bold italic math letter and punctuation #631

ywwry66 opened this issue Feb 22, 2024 · 4 comments

Comments

@ywwry66
Copy link

ywwry66 commented Feb 22, 2024

Description

As the title suggests, the spacing between a bold italic math letter and a punctuation is extremely small.

Add info or delete as appropriate:

  • Relevant for LuaTeX

Minimal example demonstrating the issue

With unicode-math:

\documentclass{article}
\usepackage{unicode-math}

\begin{document}
\(\symbfit{F}\):
\end{document}
Screenshot 2024-02-22 at 12 15 03 PM

Without unicode-math:

\documentclass{article}
\usepackage{bm}

\begin{document}
\(\bm{F}\):
\end{document}
Screenshot 2024-02-22 at 12 14 20 PM

Further details

Thanks for developing and maintaining unicode-math.

@davidcarlisle
Copy link
Member

This is a luatex-engine feature rather than unicode-math, luatex only adds the final italic correction in certain modes. Unfortunately different fonts require different settings

image

\documentclass{article}
\usepackage{unicode-math}

\begin{document}
\mathitalicsmode=0
\(\symbfit{F}\):
\mathitalicsmode=1
\(\symbfit{F}\):
\mathitalicsmode=2
\(\symbfit{F}\):
\mathitalicsmode=3
\(\symbfit{F}\):
\end{document}

@ywwry66
Copy link
Author

ywwry66 commented Feb 22, 2024

Thanks for the quick response. It is very helpful that you pointed out the parameter \mathitalicsmode, which I did't know as a new luatex user. Now that I have played around a bit with this parameter, I found it difficult to get some universally good result, even with the default latin modern font. I guess this is the same situation as in https://tex.stackexchange.com/questions/697498/luatex-unicode-math-and-italic-correction?newreg=3a41de22bad0468193ef5b1051d9346f.

Since this is less of a unicode-math issue as you mentioned, I am going to close it and hopefully italic correction will become more robust with luatex and opentype fonts.

@ywwry66 ywwry66 closed this as completed Feb 22, 2024
@wspr
Copy link
Collaborator

wspr commented Feb 22, 2024

Thanks for the comments. I think it would be good if unicode-math could provide a setting for this feature, so re-opening the issue to track it.

@wspr wspr reopened this Feb 22, 2024
@ywwry66
Copy link
Author

ywwry66 commented Feb 23, 2024

Thanks. Previously I was going to file another issue, but now I think that may also be relevant here. For the record, let me just add to this issue.

This one is about \widehat, the default result is very weird that smaller size letter gets a larger hat and vice versa. But after adjusting \mathitalicsmode, I got perfect result. Here is a MWE:

\documentclass{article}
\usepackage{unicode-math}

\begin{document}
\(\widehat{S}_{\widehat{S}}\)
\end{document}
Screenshot 2024-02-22 at 9 29 03 PM
\documentclass{article}
\usepackage{unicode-math}

\begin{document}
\mathitalicsmode=2
\(\widehat{S}_{\widehat{S}}\)
\end{document}
Screenshot 2024-02-22 at 9 29 31 PM

There are many questions about \widehat and \widetilde on stackexchange, but I am not sure I have found a satisfactory answer. If this should belong to a new issue, I can definitely open one.

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

No branches or pull requests

3 participants