Closed pabloemontes closed 1 year ago
This is really tricky to do right. But there is a keyword argument safescripts
, so latexify(ex; safescripts=true) == L"$v{^0}^{2}$"
might do what you want. Just as long as you don't expect the code to be semantically meaningful :)
This is really tricky to do right. But there is a keyword argument
safescripts
, solatexify(ex; safescripts=true) == L"$v{^0}^{2}$"
might do what you want. Just as long as you don't expect the code to be semantically meaningful :)
Thanks for the answer, this is what I was looking for.
I am trying to work with symbolic vectors and tensors using the Einstein notation. I want to have variables that have a superscript, for example v⁰, v¹, v², v³. My problem arises when manipulating expressions that involve powers of these variables. I would like to end up with a latex expression of the form ${v^a}^2$ or $(v^{a})^2$, with $a = 0, 1, 2, 3$.
However, the following doesn't work:
´´´ using Latexify ex = :(v⁰^2) latexify(ex) ´´´
since I get the error ParseError: KaTeX parse error: Double superscript at position 4: v^0^̲{2}. This is because the latex expression ends up being v^0^2, which has a double superscript, and gives a latex render error. Is there a way to force it to write (v^0)^2, or {v^0}^2?