Add bold symbol support#159
Open
AshtonSBradley wants to merge 1 commit into
Open
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #159 +/- ##
==========================================
+ Coverage 79.93% 84.13% +4.19%
==========================================
Files 10 10
Lines 658 914 +256
==========================================
+ Hits 526 769 +243
- Misses 132 145 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
\boldsymbol#107 by adding parser and layout support for\boldsymbol{...}.\bm{...}as an alias for the same bold-symbol layout path.\mathbf{...}and\boldsymbol{...}use bold font glyphs for any special math symbol whose selected bold font provides a glyph.Explanation
Previously,
\boldsymbol{\nabla}failed at parse time because\boldsymbolwas not registered as a command. This PR registers\boldsymboland\bmas one-argument commands and lays them out by reusing the existing:bffont modifier path.The font lookup change keeps the existing NewComputerModern special glyph table for unmodified math symbols, preserving current layout behavior. When a font modifier such as
\mathbfor\boldsymbolis active, MathTeXEngine now tries the requested modified font first and falls back to the special glyph table only if that font does not contain the character.This is a general font-selection rule, not a hard-coded list of supported symbols. The regression test checks every NewComputerModern special math symbol that actually has a glyph in the selected bold font, through both the
\mathbf/:bfpath and the\boldsymbolpath. The reference examples are generated fromFontFamily().special_charsusing the same glyph-availability check.For NewComputerModern this means bold Greek letters such as
ε,ϵ,α, andωuseNewCM10-Bold. The bundled bold font does not contain∇, so\boldsymbol{\nabla}now parses and renders, but falls back to the regular math glyph for nabla.Tests
julia --project=@runic -m Runic --check src/parser/commands_registration.jl src/engine/fonts.jl src/engine/layout.jl src/engine/texelements.jl test/parser.jl test/layout.jl reference/references.jl reference/data/bold_symbols.jlgit diff --checkjulia --project=. test/runtests.jllength(BOLD_SYMBOLS) = 10Notes
test/parser.jl.