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

\mathbf produces bolditalic instead of bold (LaTeX vs ISO standard) #94

Open
manuelbb-upb opened this issue Dec 14, 2022 · 1 comment
Open

Comments

@manuelbb-upb
Copy link

Currently, L"\mathbf{x} gets parsed to TeXChar 'x' [index 89 in NewComputerModern - 10 Bold Italic].
This deviates from the standard LaTeX behavior, where we would expect an upright bold character.

In fact, the LaTeX package unicode-math offers options (math-style and bold-style) to conform to different notational standards. MathTeXEngine currently mostly adheres to the "ISO" style (except for Greek letters, as per #87).
I guess, this is due to _default_font_mapping[:char]=:italic?
I think, in the long run it would be great to also enable the user to choose either norm (like unicode-math does) or be consistent with the LaTeX style.

I tried

__default_font_modifiers = deepcopy(_default_font_modifiers)
__default_font_modifiers[:bf] = Dict(
	:italic => :bold, 
	:regular => :bold
)
MYFONT = FontFamily(
        _new_computer_modern_fonts,
        _default_font_mapping,
        __default_font_modifiers,
        _symbol_to_new_computer_modern,
        13,
        0.0375
)

as a quick hack, which indead works as expected: generate_tex_elements(L"\mathbf{x}", MYFONT)[1][1]
gives TeXChar 'x' [index 89 in NewComputerModern - 10 Bold].
Unfortunately, it seems that I cannot pass my MYFONT down to be used with labels in Makie.

@manuelbb-upb manuelbb-upb changed the title \mathbf produces bolditalic instead of italic (LaTeX vs ISO standard) \mathbf produces bolditalic instead of bold (LaTeX vs ISO standard) Dec 14, 2022
@aniolm9
Copy link

aniolm9 commented Dec 19, 2023

Another hack that I'm using is generate_tex_elements(L"\mathrm{\mathbf{x}}"), but I agree that this should be fixed.

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