I am trying to renew \overline into \bar in a Xelatex document but Xelatex does not compile and I do not understand why I get the error "\bar is already defined".
Here is my Xelatex code :
\documentclass{book}
\usepackage{polyglossia}
\setmainlanguage{french}
\renewcommand{\bar}{\overline}
\begin{document}
$\bar{ABCD}$\\
$\overline{ABCD}$
\end{document}
But when I am in normal Latex mode, this code compiles perfectly :
\documentclass{book}
\usepackage[francais]{babel}
\usepackage[T1]{fontenc}
\renewcommand{\bar}{\overline}
\begin{document}
$\bar{ABCD}$\\
$\overline{ABCD}$
\end{document}
I have been searching a related topic but so far, I have not found any solution.
( The answer here : Problem with renewcommand? did not work for bar )
Thank you for your help.
\let\bar\overlineinstead or\AtBeginDocument{\renewcommand{\bar}{\overline}}but I doubt the usefulness of the idea at all – Apr 18 '17 at 20:33\AtBeginDocument{...}however. – Apr 18 '17 at 20:41