I want to write tan inverse function in my latex. I need to write tan inverse as it is and not as arctan. what is the code for that? I need to write an equation theta = tan inverse (x/y).


1 Answer 1


With amsmath, add \DeclareMathOperator{\taninv}{tan\,inverse} in the preamble and in the text use \taninv.

Example code:






enter image description here

I've never seen such a notation. However, if you later want to stick to more common notation, it's sufficient you change the line into



  • If I use \DeclareMathOperator{\taninv}{tan^{-1}}, then the -1 bit appears as it would in text mode rather than in math mode (so it minus is a bit short, like a dash). Is there a way to fix this so the minus sign appears as it would in math mode?
    – John Doe
    Commented Jul 12, 2019 at 12:15
  • 1
    @JohnDoe Ah! Another reason for not using “tan^{-1}”, which is also mathematically wrong. I'll fix the code.
    – egreg
    Commented Jul 12, 2019 at 14:08
  • Ahh, that's not actually the mistake I was referring to! This is what I mean. In the first one, I uses \taninv where \taninv is defined as \tan^{-1}. In the second one, I just wrong \tan^{-1} in the document (without defining a new operator). My question is, is there a way to replicate the second one by defining the an operator?
    – John Doe
    Commented Jul 12, 2019 at 14:48
  • @JohnDoe \tan is an operator and remains such if you append a superscript.
    – egreg
    Commented Jul 12, 2019 at 14:58
  • 2
    @JohnDoe Doesn't \newcommand{\atan}{\tan^{-1}} do what you're looking for? With it, typing \atan or \tan^{-1} will yield the same exact result.
    – egreg
    Commented Jul 12, 2019 at 16:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .