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

未关闭
#94 1 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
julia

调研方向

从 _default_font_mapping、_default_font_modifiers、FontFamily 和 generate_tex_elements 开始,使用报告中的 \mathbf{x} 示例。跟踪自定义 FontFamily 如何到达 Makie 标签,然后确定应如何公开 LaTeX 和 ISO 粗体样式选项。完成的标准是:在选定样式下,\mathbf 生成直立粗体字符,并且该行为对标签有效。

由索引模型根据 Issue 内容生成。

描述

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

__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.

主要语言
Julia
星标
106
派生
25
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Kolaru/MathTeXEngine.jl 的其他 Issue

查看 Kolaru/MathTeXEngine.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。