LaTeX over or under line like vector

Symbol Command
$\overline{AB}$ \overline{AB}
$\underline{AB}$ \underline{AB}
$\underbar{AB}$ \underbar{AB}
$\overlinesegment{AB}$ \overlinesegment{AB}
$\underlinesegment{AB}$ \underlinesegment{AB}

LaTeX vector

LaTeX