Closed mikldk closed 4 years ago
Maybe this is a global fix:
# texform.rep/code.ys
// generic math functions of one argument
- 120 # TeXForm(expr_IsFunction, _p) _ (NrArgs(expr)=1 And Contains(AssocIndices(TeXFormMathFunctions), Type(expr)) ) <-- TeXFormBracketIf(p<OpPrecedence("*"), ConcatStrings(TeXFormMathFunctions[Type(expr)], TeXForm( Listify(expr)[2], OpPrecedence("*")) ) );
+ 120 # TeXForm(expr_IsFunction, _p) _ (NrArgs(expr)=1 And Contains(AssocIndices(TeXFormMathFunctions), Type(expr)) ) <-- TeXFormBracketIf(p<OpPrecedence("*"), ConcatStrings(TeXFormMathFunctions[Type(expr)], TeXForm( Listify(expr)[2], OpPrecedence("^")) ) );
I.e. replacing the last OpPrecedence("*")
with OpPrecedence("^")
. Can I somehow override such a rule in my local session? Or maybe make it an an option somewhere?
Hi,
I've just committed a fix based on your idea, only with a new parameter TeXForm'FuncPrec. It allows for setting the precedence without modifying the rule.
Cheers, Grzesiek
Thanks!
Should it check for a positive number instead of just a number?
Hi,
I'd rather not silently override user settings, even if silly. In principle I should have checked if it evaluates to anything other than itself, checking for a number is already cheating 😉
Grzesiek
TeXForm(Sin(a*x))
gives me\sin a x
. Can I somehow instructyacas
to put brackets to obtain\sin \left ( a x \right )
? I know there is various opinions, but in this case I need it. So I am not seeking a change inyacas
but maybe ayacas
rule or option to get what I need for my current session.