7

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).

5

1 Answer 1

11

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

Example code:

\documentclass{article}
\usepackage{amsmath}

\DeclareMathOperator{\taninv}{tan\,inverse}

\begin{document}

\begin{equation*}
\theta=\taninv\frac{x}{y}
\end{equation*}

\end{document}

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

\DeclareMathOperator{\taninv}{arctan}

or

\newcommand{\taninv}{\tan^{-1}}
7
  • 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
    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
    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
    Jul 12, 2019 at 14:48
  • @JohnDoe \tan is an operator and remains such if you append a superscript.
    – egreg
    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
    Jul 12, 2019 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.