2

This is a follow-up question to Fixing the '\social' command of 'moderncv' for LinkedIN (intl profile)


Is there a way to show the LinkedIn link with symbol at the sender address on the cover letter? Maybe be redefining \makelettertitle? I believe it should be possible by adding something like

\ifthenelse{\isundefined{\@linkedin}}{}{\makenewline\linkedinsocialsymbol\httplink{\@linkedin}}%

or

 \def\socialsdetails{}%
  \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
    \protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
      \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict

at the \makelettertitle-Definition. But with the socials-collection from moderncv.cls I can't get it to work. Moreover, is it by any means possible to insert the LinkedIn link with symbol at any chosen point in a moderncv document?

From moderncvstyleclassic.sty:

\renewcommand*{\makelettertitle}{%   % recompute lengths (in case we are switching from letter to resume, or vice versa)   \recomputeletterlengths%   % sender contact info   \hfill%   \begin{minipage}{.5\textwidth}%
\raggedleft%
\addressfont\textcolor{color2}{%
  {\bfseries\upshape\@firstname~\@lastname}\@firstdetailselementfalse%
  \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
    \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
    \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
  \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
    \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%
  \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
  \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
  \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}%
\end{minipage}\\[1em]   % recipient block   \begin{minipage}[t]{.5\textwidth}
\raggedright%
\addressfont%
{\bfseries\upshape\@recipientname}\\%
\@recipientaddress%   \end{minipage}   % date   \hfill% US style %  \\[1em]% UK style   \@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900"   % opening   \raggedright%   \@opening\\[1.5em]%   % ensure no extra spacing after \makelettertitle due to a possible blank line %  \ignorespacesafterend% not working   \hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}}

From moderncv.cls:

\collectionnew{socials}
\NewDocumentCommand{\social}{O{}O{}m}{%
  \ifthenelse{\equal{#2}{}}%
    {%
      \ifthenelse{\equal{#1}{linkedin}}{\collectionadd[linkedin]{socials}{\protect\httplink[#3]{www.linkedin.com/in/#3}}}{}%
      \ifthenelse{\equal{#1}{twitter}} {\collectionadd[twitter]{socials} {\protect\httplink[#3]{www.twitter.com/#3}}}    {}%
      \ifthenelse{\equal{#1}{github}}  {\collectionadd[github]{socials}  {\protect\httplink[#3]{www.github.com/#3}}}     {}%
    }
    {\collectionadd[#1]{socials}{\protect\httplink[#3]{#2}}}}
0

1 Answer 1

2

I think I just solved it myself by adding

\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}%

to the \makelettertitle definition in moderncvstyleclassic.sty. The same (without \makenewline) can be used at any place in the document:

\collectionloop{socials}{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}

You must log in to answer this question.

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