Overline in LaTeX (\overline{xyz})

xyz‾\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.

z1+z2‾=z1‾+z2‾\overline{z_1 + z_2} = \overline{z_1} + \overline{z_2}
\documentclass{article}
\begin{document}
Overline: $\overline{xyz}$

\[ \overline{z_1 + z_2} = \overline{z_1} + \overline{z_2} \]
\end{document}

Related symbols

All アクセント・修飾子 →

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.
Math poweredAIでLaTeXを書く

最高のAI LaTeXエディタ、Overleaf代替

Octreeは15以上の大学の研究者がAIを使って論文をより速く書くのを支援

  • AIで美しいTikZダイアグラムを生成
  • 画像をアップロードしてシームレスにLaTeXに変換
  • 論文の執筆とフォーマットに即座にサポートを取得