output formatting - Can one prevent operators like `Factor` or `Apart` from changing full form of some algebraic expressions?
In this question I will talk about a toy example, it should be clear what do I actually mean in general. Also, not only Factor
but also Apart
and several other important operators have this behavior.
Say, Factor[1/(1 - t)]
produces -(1/(-1 + t))
which is not just formatting but full form change: FullForm[1/(1 - t)]
is
Power[Plus[1,Times[-1,t]],-1]
while FullForm[Factor[1/(1 - t)]]
gives
Times[-1,Power[Plus[-1,t],-1]]
which I find sort of inconvenient sometimes. Not that I care about internals of representing objects, most probably it is optimized in some way, but when I need to work with such expressions, introduction of redundant extra minus signs, etc. is which I find inconvenient.
What would be the correct way to deal with this? One related question I found is How to put terms in lexicographic order? where one of possibilities named was to issue
$PrePrint = PolynomialForm[#, TraditionalOrder -> True] &;
but some adverse effects of it were also mentioned. And in fact, TraditionalOrder
is not what I would need anyway, it gives something still different, namely (in this particular case) -(1/(t-1))
.
Also, after having posted the question, I discovered in the Related column to the right another one, How do I prevent Mathematica from reformatting the expressions that I copy as LaTeX?, but also in this case I cannot really figure out whether I can use answers there for my purposes.
As suggested by bbgodfrey here is a more illustrative example. Issuing
gives
while what I would like to see is
Comments
Post a Comment