jankapunkt / latexcv

:necktie: A collection of cv and resume templates written in LaTeX. Leave an issue if your language is not supported!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

\hyperref links do not work with sidebar cv template

Gunner62 opened this issue · comments

Hi Jan, really appreciate the work you do with the templates. I have been trying to add links to the sidebar using the \hyperref package but it seems like the links do not work when I put them into \icontext. My code block looks like:
\icontext{Icon}{12}{\href{link}{description}}{white}
I also included the hyperref package as the last package like it recommends. Do you have any ideas on how to fix this?
Thanks a ton 😄

The command \icontext is just a custom command, which is defined in line 281 and breaks down to the following code:

% at this point we simplify our icon-embedding by simply referring to a set of png images.
% if you find a good way of including svg without conflicting with other packages you can
% replace this part
\newcommand{\icon}[3]{\makebox(#2, #2){\textcolor{#3}{\csname fa#1\endcsname}}}	%icon shortcut
\newcommand{\icontext}[4]{  %icon with text shortcut
	\vcenteredhbox{\icon{#1}{#2}{#4}} \vcenteredhbox{\textcolor{#4}{#3}}
}

Here you can try to wrap hyperlinks around parameters #3 and #4 in the part \vcenteredhbox{\textcolor{#4}{#3}} or extend this command with a new parameter #5.

If you got it running you can create a PR if you like.

Hey Jan, I figured out how to make it work:
First make sure the package

\usepackage{hyperref}

is the final package being included

Then I wrote some new commands for email and urls shown below:

\newcommand{\iconhref}[5]{ 						%icon with website url
    \vcenteredhbox{\icon{#1}{#2}{#5}} \href{#4}{\textcolor{#5}{#3}}
}

\newcommand{\iconemail}[5]{ 						%icon with email link
    \vcenteredhbox{\icon{#1}{#2}{#5}} \href{mailto:#4}{\textcolor{#5}{#3}}
}

It is also possible to just write the links wherever text could normally be.
I'll try to make a pull request soon when I figure out how it works, I haven't made one before

merged vi #13