# ! LaTeX Error: Command \url already defined

After compiling my tex file, I had the following message in the log file:

! LaTeX Error: Command \url already defined.
Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
...

l.103 \newcommand\url{\begingroup \Url}


This last command exists in the url.sty file

Thank you,

Haykel

## bumped to the homepage by Community♦3 hours ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

• Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including \documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. – user36296 Dec 25 '18 at 22:10
• The url.sty file doesn't contain \newcommand\url{\begingroup\Url} – egreg Dec 25 '18 at 22:22
• For the record: url.sty issues \def\url{\leavevmode\begingroup \Url} via \def\DeclareUrlCommand#1#2{\def#1{\leavevmode\begingroup #2\Url}}and then \DeclareUrlCommand\url{}. Where does the \newcommand\url{\begingroup \Url} come from? – moewe Dec 26 '18 at 7:34
• Thank you moewe, but that command exists, if I can take a photo, I can show you. but maybe the file is not updated or I have an old version. It is written at the beginning of the file the following two comments: % url.sty ver 1.5 28-Mar-1999 Donald Arseneau asnd@triumf.ca % Copyright 1996-1999 Donald Arseneau, Vancouver, Canada. – Haykel Elabidi Dec 26 '18 at 16:18
• I download a new one (url.sty) which does not contain that command, during the compilation, I received the message that the file "xcolor.sty" is not found; – Haykel Elabidi Dec 26 '18 at 16:34


\documentclass{article}

\usepackage{url}
\renewcommand\url{\begingroup \Url}

\begin{document}
%
Welcome to  \url{http://tex.stackexchange.com} for all your \LaTeX-related needs.
%
\end{document}