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?

  • There is no need to kick something out ;-) \url should work. Welcome to TeX.SX! – user31729 Apr 25 '15 at 20:40
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}}
|improve this answer|||||
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}
|improve this answer|||||
  • Sure, it works. Thanx – Pablo AR Apr 25 '15 at 20:45
  • ... I have to say that it keeps reading it as a comment... I tried verbatim but is a mess – Pablo AR Apr 25 '15 at 20:59
  • @LyonBuster: You did not write that it's inside a comment – user31729 Apr 25 '15 at 21:26
  • is not a comment, it was a large hyperref which have that % – Pablo AR Apr 25 '15 at 21:27
  • also, \% works perfectly – Pablo AR Apr 25 '15 at 21:28

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.