1

MWE:

\documentclass[10pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
\name{Short}{LongName}
\email{[email protected]}
\phone[mobile]{+1123456789}
 \homepage{www.johndoe.com}
\social[linkedin]{asdf}
 \social[twitter]{asdf}
\social[github]{asdf}
\social[gitlab]{asdf}

\begin{document}
    \makecvtitle
\end{document}

But it works for all other styles - casual, banking, oldstyle, fancy.

My system is Arch Linux and my editor is TexStudio

1 Answer 1

2

In the classic style you can enter the Gitlab icon and link using the three-argument version of \social, with a second optional argument for the full url.

The icons in the classic style are found in the marvosym package, whereas the other styles use fontawesome for the icons. Marvosym does not have a Gitlab icon, so if you want this icon in the classic style then you need to load fontawesome and define the icon command for moderncv.

MWE:

\documentclass[10pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
% load fontawesome icons
\usepackage{fontawesome}
% set the moderncv command for the Gitlab icon
% create command if it does not exist
\providecommand*{\gitlabsocialsymbol}{}
% set command to \faGitlab from fontawesome
\renewcommand*{\gitlabsocialsymbol}{{\scriptsize\faGitlab}~}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
\name{Short}{LongName}
\email{[email protected]}
\phone[mobile]{+1123456789}
 \homepage{www.johndoe.com}
\social[linkedin]{asdf}
\social[twitter]{asdf}
\social[github]{asdfhub}
% set full url for the link
\social[gitlab][www.gitlab.com/asdflab]{asdflab}

\begin{document}
    \makecvtitle
\end{document}

Result:

enter image description here

2
  • This is amazing. Thank you. :) Just FYI, \newcommand gave me an error - Command \gitlabsocialsymbol already defined. ...tlabsocialsymbol}{{\scriptsize\faGitlab}~} I fixed it using \renewcommand Aug 20, 2020 at 16:21
  • Thanks for the comment. I've edited to answer to work both when then command is initially undefined and if it was defined before.
    – Marijn
    Aug 20, 2020 at 16:56

You must log in to answer this question.

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