Overline in LaTeX (\overline{xyz})
- LaTeX command
\overline{xyz}- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Draws a line over an entire expression, for conjugates, closures, repeating decimals or segment names.
Unlike \bar, the \overline rule stretches to the full width of its argument, so it suits \overline{z_1 z_2} = \bar{z}_1 \bar{z}_2, the closure \overline{A \cup B}, Boolean negation \overline{A + B}, the line segment \overline{AB}, and repeating decimals like 0.\overline{3}. Nested overlines stack at increasing heights, which can look uneven next to each other; adding a \vphantom of the tallest content to each helps align them. In text mode an over-rule is not available directly; wrap it in math. Its counterpart for underlining is \underline.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Overline: $\overline{xyz}$
\[ \overline{z_1 + z_2} = \overline{z_1} + \overline{z_2} \]
\end{document}Related symbols
- Underline
\underline{xyz} - Bar
\bar{x} - Vector Arrow
\vec{x} - Triple Dot
\dddot{x} - Wide Vector
\overrightarrow{AB} - Double Dot
\ddot{x}
Frequently asked questions
- How do I write Overline in LaTeX?
- Type \overline{xyz} in math mode, for example $\overline{z_1 + z_2} = \overline{z_1} + \overline{z_2}$. It works in plain LaTeX without loading any package.
- Which package do I need for \overline{xyz}?
- None. \overline{xyz} is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \overline{xyz} in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\overline{xyz}$ 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