2

Further to Caramdir's (User 3872) 2011 question; I have a similar MWE as in that question, hence:

\documentclass{book}
\usepackage{hyperref}
\usepackage{url}
\urldef{\eur50}\url{http://www.google.com/finance/historical?q=INDEXSTOXX%3ASX5E&ei=Pj9GVMD5FuH4wgO_zoGIDg}
\begin{document}
text\footnote{\eur50}
\end{document}

This works for me with other url's in footnote. This example, however, seems too long and breaks by the % sign (shown here in grey).

Q:How can one load the long url with the % sign included as it is in the url? (so without \ in front).

  • Hello, LION! :-) – Przemysław Scherwentke Oct 21 '14 at 12:02
  • Have you tried \@? – 1010011010 Oct 21 '14 at 12:12
  • 4
    \eur50 is an illegal name for the URL. I get several errors with the example, so the output is incorrect. Use \eurl or anything else provided it's letters only. – egreg Oct 21 '14 at 12:13
  • Could you please show which question do you refer to? I wasn't able to find it. – yo' Oct 21 '14 at 12:24
  • 1
    With egreg's suggested change your code works fine for me. – Andrew Swann Oct 21 '14 at 12:34
2

Only letters are allowed in the commands defined with \urldef, so \eur50 is illegal and, indeed, several errors appear when processing your example.

The problem is described in this TeX FAQ; basically \newcommand{\eur50}{...} is not legal.

You could use digits by using a different strategy:

\documentclass{book}
\usepackage{hyperref}

\newcommand{\namedurldef}[1]{%
  \expandafter\urldef\csname#1\endcsname
}
\newcommand{\namedurl}[1]{\csname#1\endcsname}


\namedurldef{eur50}\url{http://www.google.com/finance/historical?q=INDEXSTOXX%3ASX5E&ei=Pj9GVMD5FuH4wgO_zoGIDg}
\begin{document}
text\footnote{\namedurl{eur50}}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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