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


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

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


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.:

|improve this answer|||||

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





|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.