-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid Latex output for double subscript #313
Comments
Ooh. Tricky one. We could fix it so this outputs the same as |
I would just add parenthesis around the output for the inner expression, so that Latex knows to what the indices refer: ${x_{:\left( 1, 2 \right)}}_{1}$ |
I misread your comment, but I agreed with the version I read so, my suggestion is See PR #316. |
Yes, the new output with PR #316 looks good: julia> latexify(:(x[1:2][1]); index = :subscript)
L"$\left( x_{:\left( 1, 2 \right)} \right)_{1}$" Renders as Thank you! |
Btw: a similar problem exist when using a variable name that already contains a subscript: latexify(:(x₁[2]); index = :subscript)
L"$x_1_{2}$" And similar with superscripts: latexify(:(x²^2))
L"$x^2^{2}$" I didn't check if PR #316 also fixes those. |
That's a separate issue. Not sure I think they are worth the effort, but if you open an issue for it, some kind soul might turn up with a PR :) |
The LaTeX-output of
latexify
for something with double subscripts does not compile. For example:The returned Latex does not compile correctly: see http://www.texrendr.com/?eqn=x_%7B%3A%5Cleft(%201%2C%202%20%5Cright)%7D_%7B1%7D.
This issue comes up in ModelingToolkit when indexing sub-arrays (see JuliaSymbolics/Symbolics.jl#1288).
The text was updated successfully, but these errors were encountered: