Tangent in LaTeX (\tan)
- LaTeX command
\tan- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Tangent function, the ratio of sine to cosine, typeset upright.
Defined as \tan\theta = \frac{\sin\theta}{\cos\theta}, it is undefined where \cos\theta = 0, at odd multiples of \pi/2. Slopes in geometry are tangents of inclination angles, and the identity 1 + \tan^2\theta = \sec^2\theta comes from dividing the Pythagorean identity by \cos^2\theta. Some European texts write tg instead, which has no built-in command; use \operatorname{tg} if you need it. The angle addition formula \tan(a+b) = \frac{\tan a + \tan b}{1 - \tan a\tan b} is a common display equation.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Tangent: $\tan$
\[ \tan(a + b) = \frac{\tan a + \tan b}{1 - \tan a \tan b} \]
\end{document}Related symbols
All Trigonometri →Frequently asked questions
- How do I write Tangent in LaTeX?
- Type \tan in math mode, for example $\tan(a + b) = \frac{\tan a + \tan b}{1 - \tan a \tan b}$. It works in plain LaTeX without loading any package.
- Which package do I need for \tan?
- None. \tan is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \tan in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\tan$ in running text.
Editor LaTeX AI Terbaik, Alternatif Overleaf
Octree membantu penyelidik dari 15+ universiti menulis kertas penyelidikan dengan lebih cepat menggunakan AI
- Jana diagram TikZ yang cantik menggunakan AI
- Muat naik imej dan tukar ke LaTeX dengan lancar
- Dapatkan bantuan segera untuk menulis dan memformat kertas penyelidikan