TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the url package. Now, I have some some url with a percent sign in it and want to place it in a footnote. When I let the % where it is, I get a comment, and the whole thing fails to compile because of some unmatched brackets. When it's at the end of a line, it doesn't show up at all in the result. When I write \% instead, this gets literally into the output—but I want the url to be displayed correctly.

What could I do?

share|improve this question
What are you using to create URLs? \url{foo%.com} works fine for me with the url package – Seamus Feb 27 '11 at 16:56
pdfLaTeX, on miktex – user3872 Feb 27 '11 at 16:59
@phg I meant, are you using the url package (\usepackage{url} in your preamble) or some other package that defines a \url{} command? – Seamus Feb 27 '11 at 17:01
Yeah, I was using \usepackage{url}, but I just saw I screwed it up somewhere else, because I was using it inside a footnote and then the error was kept somehow. Im sorry, problem solved... but thanks for really fast help. – user3872 Feb 27 '11 at 17:06
@Seamus: Could you post this as an answer. – Caramdir Feb 27 '11 at 17:35

For URLs in footnotes or inside other macro arguments use \urldef to define it first as a macro:

text\footnote{WWW: \myurl}
share|improve this answer
This doesn't work for long URLs - svn.ggy.bris.ac.uk/websvn/… will print correctly in the document, but the link doesn't work as it's only half complete. – user8875 Oct 27 '11 at 12:32
@user8875 This method does work for long url's too, just make sure you don't break it in the definition. To get an active link, load the hyperref package. – Andrew Swann Oct 16 '13 at 13:33

The easiest way is to simply escape it.

share|improve this answer
Yes, I found that adding a "\" in front of the "%" in the URL produces a working URL. – Kurt Peek Mar 25 at 17:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.