Closed davibarreira closed 2 years ago
Can confirm that I get this error as well given a L""
string like: L"ℝ"
That square appears which @davibarreira was discussing.
Further if I try generate_tex_elements
per Davi, I get that error as well
@Kolaru , do you have any idea why this might be happening? I'm willing to try to fix it :) My guess is that this is actually an issue with CMU font.
There are two problems.
First, the canonical form for these commands is not defined. Both version should be parse the same way, but they are not:
julia> texparse("ℝ")
TeXExpr :expr
└─ TeXExpr :symbol
└─ 'ℝ'
julia> texparse(L"\mathbb{R}")
TeXExpr :expr
└─ TeXExpr :font
├─ :bb
└─ TeXExpr :char
└─ 'R'
This normalization is done by adding the rule in command_registration.jl
. There are some more details about the concept in src/parser/README.md
.
Then, the layout system needs to know which font and charcter it needs to grab for it. For these, the correct charcters need to be found in the many font files of the CM family, added to assets/
and loaded.
I think the easiest representation is TeXExpr(:symbol, 'ℝ')
, then adding the char data in src/engine/computer_modern_data.jl
would be enough.
On the other hand, that's a bunch of new rules, so if the characters are stored in a reasonnable way in their own font, using the font modifier system may make more sense.
It is now supported if you use unicode input.
\mathbb{R}
is not there yet though.
I've tried using:
And I get an error:
If I try to use the unicode directly, it does seem to return the correct character. But when I try to visualize it in the screen, I get a blanket square, like if the character does not exist for that font.