Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
0 votes

Why do the following two nearly identical pieces of code get different results?

\tr{#}::LaTeXForm("{\rm Tr}").
\tr{#}::Trace.
ex:=\tr{-A+B};
distribute(_);

\tr{A??}::LaTeXForm("\langle ",A??,"\rangle").
\tr{#}::Trace.
ex:=\tr{-A+B};
distribute(_);
asked in General questions by (840 points)

1 Answer

0 votes

Well spotted. LaTeXForm wasn't handling the multiplier attribute correctly. A fix is on github now (2.3.1.8).

answered by (57.2k points)

By the way, why does the following code report an error?

\comm{A??}{B??}::LaTeXForm("\commutator{",A??,"}{",B??,"}").
ex:=\comm{A}{B};
...