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

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(_);
in General questions by (2.2k points)

1 Answer

+1 vote

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

by (82.6k points)

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

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