16

I'm trying to include a hyperlink in my CV in TeX that contains the character "%", which results in TeX making the part of the hyperlink following % as comments. Advice on how to fix this would be greatly appreciated!

7
  • 2
    Welcome to TeX.SX! Please show us a minimal but compilable example of what you are trying to do. How are you typing hyperlinks in your document? Which package do you use for that?
    – LaRiFaRi
    Commented Nov 10, 2014 at 15:55
  • Does \documentclass{article} \usepackage{hyperref} \begin{document} \url{http://tex.stackexchange.com/questions/211495/hyperlink-containing%} \end{document} work for you?
    – LaRiFaRi
    Commented Nov 10, 2014 at 15:58
  • I'm using \include{structure} which has various commands starting with \usepackage[margin=0.75in]{geometry} % Adjusts the margins \usepackage{multicol} %
    – Rachel
    Commented Nov 10, 2014 at 15:59
  • The command I'm having trouble with is \href. I just tried \usepackage{hyperref} \url you suggested, but it didn't work
    – Rachel
    Commented Nov 10, 2014 at 16:00
  • \href{tex.stackexchange.com/questions/211495/hyperlink-containing%}{some text} with hyperref works for me.
    – LaRiFaRi
    Commented Nov 10, 2014 at 16:04

1 Answer 1

5

Use % in the first argument (the link destination) and \% in the second (which is typeset).

\documentclass{article}
\usepackage[colorlinks=true]{hyperref}
\begin{document}
\href{http://example.com/test%281%29.html}{http://example.com/test\%281\%29.html}
\end{document}
2
  • 10
    % still making the rest as a comment, what to do?
    – AlFagera
    Commented Feb 21, 2017 at 15:21
  • @AlFagera --- the above example works for me. I suggest you ask a new question, because your case must be different. Commented Feb 21, 2017 at 20:07

You must log in to answer this question.

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