On Thursday, 26 October 2023 at 16:03:27 UTC-7 Eric Majzoub wrote:

I would like to debug the latex printing of an expression that ambiguous.

To reproduce it:
t = var('t')
x = function('x')(t)
latex( diff(x,t)^2 )

This produces ambiguous output, essentially:

partial_t x^2

instead of

(partial_t x)^2

I have tried:
from sage.misc.trace import trace
trace("latex( diff(x,t)^2 )")

but I can't understand in which .py file the translation of "diff" occurs. 
As I understand the source code, there should be a _latex_(self) for every 
object or method to display latex code, but I can't seem to find it here. 


It happens here:

https://github.com/sagemath/sage/blob/07a2afd65fb4b0a1c9cbc43ede7d4a18c921a000/src/sage/symbolic/pynac_impl.pxi#L691

However, the code deciding whether the base of an exponential expression 
needs parentheses is elsewhere.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/92e62d2d-4b88-49c3-981d-dab6f01925e8n%40googlegroups.com.

Reply via email to