3

I was trying to embed a link (which contains both upper-case and lower-case letters) on a text. Here is the code snippet:

\documentclass{article}

\usepackage[hidelinks]{hyperref}

\begin{document}

\href{http://goo.gl/maps/vcZfr}{Publications}

%% The above embedding could not redirect me to the correct link. 
%% Instead it led me to https://goo.gl/MAPS/VCZFR
\end{document}

Could you help me out with why some letters got capitalized?

Werner
  • 603,163
  • 1
    I have no problem finding Gloria Jean's Coffees... – Werner Oct 24 '15 at 17:58
  • 6
    I'm voting to close this question as off-topic because the minimal example doesn't reflect the suggested output. Based on the OP's comment, the \href was placed inside a sectional unit which reformatted the link. – Werner Oct 24 '15 at 18:15

1 Answers1

8

hyperref does not do anything like this. The MWE of the question gives the following in the PDF file (pdflatex):

/Subtype/Link/A<</Type/Action/S/URI/URI(http://goo.gl/maps/vcZfr)>>

The URL is unchanged. Maybe the \href is inside an argument, which is uppercased later (e.g. via \MakeUppercase).

A workaround is a protected macro, which is not affected by \MakeUppercase or \uppercase:

\documentclass{article}

\usepackage[hidelinks]{hyperref}

\protected\def\hrefvcZfr{\href{http://goo.gl/maps/vcZfr}}

\begin{document}

\href{http://goo.gl/maps/vcZfr}{Publications}
\MakeUppercase{\hrefvcZfr{Publications}}

\end{document}
Heiko Oberdiek
  • 271,626
  • Yes I just found it. I was just going to delete the question.

    The thing was the class file I was using capitalizes the header of the section. Publication was the section header. And I wanted to embed a link onto that.

    Anyways thanks.

    – Emroz Khan Oct 24 '15 at 18:05