Kolaru / MathTeXEngine.jl

A latex math mode engine in pure Julia.
MIT License
96 stars 20 forks source link

`\int` has incorrect character displayed #44

Closed davibarreira closed 2 years ago

davibarreira commented 2 years ago

The integral symbol is not properly recognized. Running:

sentence = generate_tex_elements(L"\int")

Returns:

1-element Vector{Any}:
 (TeXChar 'Z' [U+005A in cmex10 - Regular], [0.0, 1.326583981513977], 1.0)

I'm running on Julia 1.6.3, LaTeXStrings v1.3.0.

davibarreira commented 2 years ago

My bad, I realized that this character is correct for cmex10.

Kolaru commented 2 years ago

Nope you were right, the symbol displayed here should be the integral, e.g. for sum we have:

julia> (sum_char, _), = generate_tex_elements(L"\sum")
1-element Vector{Any}:
 (TeXChar '∑' [U+0058 in cmex10 - Regular], [0.0, 0.91552734375], 1.0)

julia> sum_char
TeXChar '∑' [U+0058 in cmex10 - Regular]

julia> sum_char.represented_char
'∑': Unicode U+2211 (category Sm: Symbol, math)

julia> sum_char.char
'X': ASCII/Unicode U+0058 (category Lu: Letter, uppercase)

That is the code given is the codepoint in the font, but the character displayed should be the one meant.

Kolaru commented 2 years ago

Fixed by #67