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,


put on hold as unclear what you're asking by egreg, Raaja, Sebastiano, The old JouleV, Phelype Oleinik 3 hours ago

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 9
    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
  • 4
    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

Just need to replace the \newcommand with \renewcommand if the command already exists.


\renewcommand\url{\begingroup \Url}

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


Not the answer you're looking for? Browse other questions tagged or ask your own question.