Kolaru / Kolaru/MathTeXEngine.jl

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

Open
#94 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
106
Forks
25
PR merge metrics
No merged PRs in 30d

Description

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 https://github.com/Kolaru/MathTeXEngine.jl/issues/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
```julia
__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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.