PRINTPOL
- This function prints a non-commutative polynomial as an input to a tex file.
PRINTPOL:=function(pol)
local polstrg, ind;
polstrg:=String(pol);
if polstrg = "0" then
Print(polstrg);
#return polstrg;
else
polstrg:=SplitString(polstrg, "+");
Sort(polstrg, ORDERING);
polstrg:=Reversed(polstrg);
for ind in [1..Size(polstrg)] do
if EvalString(COEF_STRG(polstrg[ind])) < 0 or ind =1 then
PrintNP(GP2NP(EvalString(polstrg[ind])));
else
Print("+");PrintNP(GP2NP(EvalString(polstrg[ind])));
fi;
od;
fi;
end;