# Insert Special Symbols in \url

I have the following URL

http://www.wolframalpha.com/input/?i=density+destilled+water+23°C


Trying to insert this as a \footnote with \url I got an error. The same with

\footnote{\url{http:// [...] 23^{\circ}C}}


I hope you can help me!

• \url{http://www.wolframalpha.com/input/?i=density+distilled+water+23%C2%B0C} Jun 13, 2015 at 18:52
• @giordano Not enough in the case of a footnote. \urldef will also have to be used. Jun 13, 2015 at 19:00
• Dec 19, 2021 at 15:33

When URLs contain special characters, and you want to use them in an argument (even in a moving argument), the standard approach is yo use \urldef. Below I give to two options:

1. Use \urldef:

\documentclass{amsart}
\usepackage{hyperref}

\urldef{\wxxiii}\url{http://www.wolframalpha.com/input/?i=density+destilled+water+23°C }

\begin{document}

\footnote{\wxxiii}

\end{document}


The resulting footnote:

2. Use

http://www.wolframalpha.com/input/?i=density+destilled+water+23%C2%B0C


(which you can get with the help of your browser) and \urldef:

\documentclass{amsart}
\usepackage{hyperref}

\urldef{\wxxiii}\url{http://www.wolframalpha.com/input/?i=density+destilled+water+23%C2%B0C}

\begin{document}

\footnote{\wxxiii}

\end{document}


The resulting footnote text:

• Thank You! My Browser (Safari) shows the "°" in the URL. Jun 13, 2015 at 19:29
• The first option results in a wrong URL. Jun 14, 2015 at 16:55
• @giordano No. At least not for me using TeXworks' viewer, Evince, Acrobat Reader or Okular. In which PDF viewer do you get the wrong URL? Jun 14, 2015 at 17:38
• Okular 0.20.2. The URL I get is wolframalpha.com/input/… Instead, TeXstudio viewer read wolframalpha.com/input/?i=density+destilled+water+23%EF%BF%BDC Jun 14, 2015 at 17:43
• @giordano So it seems more like a viewer problem? Jun 14, 2015 at 17:47