Line Segment in LaTeX (\overline{AB})

AB‾\overline{AB}
LaTeX command
\overline{AB}
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Bar over AB, the standard notation for the line segment between points A and B.

Geometry texts write \overline{AB} for the segment and plain AB for its length, so \overline{AB} \cong \overline{CD} pairs with AB = CD. The bar stretches over the whole argument, unlike \bar{x}, which is a fixed-width accent for a single letter. Other meanings of \overline include the complex conjugate \overline{z}, the closure of a set \overline{A}, and negation in Boolean algebra, \overline{A \cdot B}. Rays and lines use \overrightarrow{AB} and \overleftrightarrow{AB}, which mark direction or infinite extent.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

AB‾≅CD‾\overline{AB} \cong \overline{CD}
\documentclass{article}
\begin{document}
Line Segment: $\overline{AB}$

\[ \overline{AB} \cong \overline{CD} \]
\end{document}

Related symbols

All الهندسة →

Frequently asked questions

How do I write Line Segment in LaTeX?
Type \overline{AB} in math mode, for example $\overline{AB} \cong \overline{CD}$. It works in plain LaTeX without loading any package.
Which package do I need for \overline{AB}?
None. \overline{AB} is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \overline{AB} in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\overline{AB}$ in running text.
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث