0

I am using komacv in an attempt to typeset a CV which I originally wrote with moderncv. As far as I can tell hyperref gets loaded by komacv, which in turn causes url to be loaded. But I don't know which of the two may be responsible for the behavior.

Consider the following MWE:

\documentclass[paper=A4]{komacv}
\renewcommand*{\firstname}{John}
\renewcommand*{\familyname}{Doe}
\renewcommand*{\homepage}{tex.stackexchange.com}
\hypersetup{hidelinks}
\setkomafont{addressfont}{\scriptsize\sffamily}
\begin{document}
\maketitle
\end{document}

When generating a PDF from this, the tex.stackexchange.com will point to http://tex.stackexchange.com. So evidently there is a mechanism to cause a host name without URL scheme to be converted to a link using http:// as its default URL scheme (i.e. protocol). How can I change this to point to https://tex.stackexchange.com instead?

I realize that in many cases the http:// address will redirect to https:// but that's merely a convention and so it would be desirable to influence the automatism embedded in either hyperref or url.

  • What if you type https://tex.stackexchange.com in your document instead of tex.stackexchange.com? Wouldn't this solve the problem directly? – Superuser27 Mar 26 at 19:02
  • 1
    @Superuser27 not really, because aesthetically that be inferior (it's longer and more clutter in a CV). Technically it would be one pragmatic solution, though, agreed. – 0xC0000022L Mar 26 at 19:24
1

enter image description here

\documentclass[paper=A4]{komacv}
\renewcommand*{\firstname}{John}
\renewcommand*{\familyname}{Doe}
\renewcommand*{\homepage}{tex.stackexchange.com}
\hypersetup{hidelinks}

%re-renew the relevant cv definition
\renewcommand*{\httplink}[2][]{%
\ifstrempty{#1}{%
\href{https://#2}{\usefontofkomafont{httplinkfont}#2}}{%
\href{https://#2}{\usefontofkomafont{httplinkfont}#1}}%
}

\setkomafont{addressfont}{\scriptsize\sffamily}
\begin{document}

\maketitle

\end{document}

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.