16

I am using moderncv to compose my CV and cover letters. I have a LinkedIN profile that I would like to link via

\social[linkedin]{...}

however line 257 of modencv.cls defaults the beginning of the link to www.linkedin.com/in/:

\ifthenelse{\equal{#1}{linkedin}}{\collectionadd[linkedin]{socials}{\protect\httplink[#3]{www.linkedin.com/in/#3}}}{}%

In my case, instead, the prefix and the suffix are respectively www.linkedin.com/pub/ and stefano-bragaglia/51/22/b43/ (instead of stefano.bragaglia, as suggested by the template).

In practice the base link should be changed in www.linkedin.com/ and the 2nd parameter of \social should be modified in pub/stefano-bragaglia/51/22/b43/. At the moment I have created a copy of moderncv with the appropriate changes in my local repository, but I wonder whether it is better to include an appropriate \renewcommand (or similar) in the preamble of the file (what should I write) or just notify the author and ask for a fix.

If you need a minimal working example, just use the default template of moderncv. Thanks in advance!

3
  • It's better if you provide a MWE here.
    – egreg
    Sep 5, 2013 at 20:48
  • You can customize your profile URL: linkedin.com/help/linkedin/answer/87 After doing that, it will become of the form www.linkedin.com/in/xxx where you can choose xxx
    – Ilya Popov
    Oct 13, 2017 at 14:55
  • It only works if you have a nominal url (something like linkedin.com/in/______) but not with standard urls (i.e.: linkedin.com/pub/____-____/dd/dd/wdd). Moreover, if you have a localised linkedin (i.e.: linkedin.it/pub/ etc etc) it won't work as well. Oct 13, 2017 at 15:48

1 Answer 1

27

I think, in this case, you don't really need any redefinitions; the author/maintainer of moderncv has provided a second optional argument for \social that can be used, for example, in cases in which the prefixes/suffixes are different from the ones provided by default (when this second argument is not used). In this concrete case, you could say

\social[linkedin][www.linkedin.com/pub/stefano-bragaglia/51/22/b43/]{stefano-bragaglia}

A complete example:

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}

\name{John}{Doe}
\social[linkedin][www.linkedin.com/pub/stefano-bragaglia/51/22/b43/]{stefano-bragaglia}


\begin{document}

\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}

\end{document}

An image of the resulting httplink and its associated address:

enter image description here

Some of the LinkedIn adresses have /in, some others /pub, so I guess the maintainer chose one by default, and provided the second optional argument for the other cases.

5
  • Hi @Gonzalo, amazing! Thanks for the explanation! By the way, where is the documentation for the class? I wasn't able to find on CTAN... my fault? Sep 6, 2013 at 11:59
  • 3
    @StefanoBragaglia Hi! You're welcome! No, it's not your fault; moderncv still doesn't have a user documentation, besides the information you find in the templates. Unfortunately, some features are not mentioned there (this second optional argument for \social, for example). I had to go to the definitions in moderncv.cls to find out about this possibility. Sep 6, 2013 at 13:35
  • @GonzaloMedina hello, does it work for twitter, github also ? Like \social[twitter][www.twitter.com/]{stefano-bragaglia} \social[github][www.github.com/sb.git]{stefano-bragaglia}
    – royki
    Oct 22, 2015 at 14:19
  • I added twitter using the following line (I had to escape the '_'): \social[twitter][twitter.com/bioinfo_mark]{@bioinfo\_mark} Oct 21, 2019 at 18:25
  • is there any trick to add them all in one line separated with | for instance? May 2, 2020 at 11:02

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.