Luxor.jl
Luxor.jl copied to clipboard
Incorrect rendering of Latex string with braces
Hi, I'm trying to render this (simple) Latex string with Luxor : L"\{42\}":
using Luxor
using MathTeXEngine
d = @draw begin
fontsize(30)
text(L"\{42\}", O)
end
display(d)
but the result is incorrect:
It seems to me that the problem is coming from this line: https://github.com/JuliaGraphics/Luxor.jl/blob/0a9c129c3adbcb7cee5930181403b31ef1906924/ext/latex.jl#L205
Commenting this line leads to the correct (and expected) result. Could you please explain me why there is such a treatment for the braces? I won't dare to suggest removing it since I guess it was introduced for a good reason...
Hi! Thanks ! I didn’t do any of the LaTEX stuff (since I don’t know LaTEX) so I can’t explain, and I can only assume this was an adjustment required for one use of curly braces that doesn’t work for others. Perhaps it’s a font-related thing?
If you can improve any of the LaTeX-handling code, it would be appreciated!
Well I could submit a PR where this elseif bloc is removed but that wouldn't be a good idea if we don't know why the author of these lines wrote them...
I’ll risk a ping - @davibarreira - sorry! Can you remember?
Hey, folks! So this is based on MathTeXEngine.jl, which pretty much takes the latex string and returns the information for each character, such as placement and size. When I wrote the code, I used a specific version of MathTeXEngine, which had some issues depending on the character. Hence the manual corrections you see. If commenting this line makes it work, it is probably cause the character is now working "out of the box"! So feel free to modify.
@davibarreira Thanks for revisiting Luxor!
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.