2

This question explains how to set the tex output for a function to be handled analogously to powers on trigonometric functions; however, I was wondering how it would have to be modified if one wanted to change the actual commands used for the parentheses?

\cos \left( <arg> \right)

introduces an inappropriate space between the cos and the first parenthesis. This can be compensated for by inserting \mathopen{} between \cos and \left(, i.e.:

\cos\mathopen{} \left( <arg> \right)

However, while texput(cos, lambda([e], [a]:args(e), printf(false, "\\cos \\mathopen{} \\left( ~a \\right)", tex1(a)))) renders the desired adjustment for something like cos(<arg>), anything involving powers, such as cos(<arg>)^2 returns to the default handling of cos.

Because cos is already in the list of *tex-mexpt-trig-like-fns*, I wasn't certain how to get the desired handling for parentheses, when there are exponents.

Rax Adaam
  • 790
  • 3
  • 11
  • 1
    I think this stuff exposes at least one bug in the TeX output for trig functions. I think I've worked on that, but I don't see anything in the log history, so that probably means I haven't pushed the commits yet. I will try to update soon, it might be later today. By the way, how do you feel about building Maxima from source code? Are you or someone on your team comfortable working with Git? – Robert Dodier Mar 09 '21 at 16:47
  • Thanks Robert, that'll be a nice update to their handling. RE: Git -- I have just started dipping my toes there; however, my wife is very comfortable with it, and obviously our lead programmer is, as well, so I'm sure they could help get me set up. Obviously I'd be more than happy to help -- just let me know what you had in mind :) – Rax Adaam Mar 09 '21 at 17:09

0 Answers0