[Tex/LaTex] How to show a wide bar over a letter

amsmathmath-modemath-operators

I want to have a wide bar over XY but it just shows a small bar. Any idea?
enter image description here

\item In the standard $(x,y)$ coordinate plane, point $X$ has coordinates $(-4,0)$ and point $Y$ has coordinates $(0,-8)$. What is the coordinates of the midpoint of $\bar{XY}$?\hfill
    \begin{enumerate}
    \item $(-6,-1)$     
    \item $(-2,-4)$ 
    \item $(0,2)$ 
    \item $(2,4)$ 
    \item $(6,-1)$          
    \end{enumerate} 

Best Answer

To get an overline, well, just use the \overline macro!

\overline{XY}

You might want to add some semantic meaning. E.g., define a macro

\newcommand*\midpoint[1]{\overline{#1}}

and use as

\midpoint{XY}

or something similar.