1

I want to pick up an hyperref with the drawback that it contains %

http://es.wikipedia.org/wiki/Lept%C3%B3n

Is there a way to kick % out?

1
  • There is no need to kick something out ;-) \url should work. Welcome to TeX.SX!
    – user31729
    Apr 25, 2015 at 20:40

2 Answers 2

3

The macros \href and \url change the category code of % to get of its comment behavior:

\url{http://es.wikipedia.org/wiki/Lept%C3%B3n}
\href{http://es.wikipedia.org/wiki/Lept%C3%B3n}{Lept\'on}

But inside the argument of another macro, this will not work, because then the percent is already read as comment char, before the inner \url or \href is executed. Since the argument is already read, the category changes will come too late. Therefore hyperref also provides \% to get the percent character in the URL, e.g.:

\footnote{\url{http://es.wikipedia.org/wiki/Lept\%C3\%B3n}}
0
2

The \url and other commands from the hyperref package take care of its input paths and the characters. So % should be no problem.

\documentclass{article}

\usepackage{hyperref}

\begin{document}

\url{http://es.wikipedia.org/wiki/Lept%C3%B3n}

\end{document}
6
  • Sure, it works. Thanx
    – PARCB
    Apr 25, 2015 at 20:45
  • ... I have to say that it keeps reading it as a comment... I tried verbatim but is a mess
    – PARCB
    Apr 25, 2015 at 20:59
  • @LyonBuster: You did not write that it's inside a comment
    – user31729
    Apr 25, 2015 at 21:26
  • is not a comment, it was a large hyperref which have that %
    – PARCB
    Apr 25, 2015 at 21:27
  • also, \% works perfectly
    – PARCB
    Apr 25, 2015 at 21:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .