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

Arabic RTL isn't displaying \hat{u} correctly when part of an equation #28

Open
jonhaddow opened this issue Nov 11, 2021 · 3 comments
Open

Comments

@jonhaddow
Copy link

When displaying in Arabic, the following equation renders the \hat{u} on the right side but the character isn't inverted.

\[ \hat{u} = x \]

However the equation \[ \hat{u} \] is the inverted character.

I believe this is due to the mfliph being applied on multiple layers on the first example.

CodePen: https://codepen.io/jonhaddow/pen/yLoqRxy

@OmarIthawi
Copy link
Owner

Thanks @jonhaddow. The behavior indeed looks buggy and it's not intended. My guess is that I never intended to support \hat, so it's now flaky.

Would you mind sharing more about the test case and how do you think a correct fix should be?

@jonhaddow
Copy link
Author

I'm not too familiar with how the character should be represented, however I would expect both equations to display the same.

I also haven't reviewed the library much but would like to think that if all equations are flipped at the top level wrapping element then we probably don't need to flip each character as well.

Is there a way to prevent the horizontal flip for this particular symbol at the character level?

@OmarIthawi
Copy link
Owner

I'm not too familiar with how the character should be represented, however I would expect both equations to display the same.

I think it should either be flipped, or not flipped at all. My suggestion is to provide custom mapping to map u to و and it should work as expected. Please see the following file for providing custom mappings:

I also haven't reviewed the library much but would like to think that if all equations are flipped at the top level wrapping element then we probably don't need to flip each character as well.

Before reviewing the library, I'd recommend looking at the test cases to understand both capabilities and limits of the library:

Is there a way to prevent the horizontal flip for this particular symbol at the character level?

I honestly forgot. It's been a very long time since I've written this library. However, if you're really determined, you could use the following low-level \transx to control how the character is displayed in both languages:

\transx{\hat{u}}{\fliph{\hat{u}}}

image

It seems to be working well on both HTML-CSS and Common-HTML outputs.

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

2 participants