Fold email handling into \social

This commit is contained in:
Łukasz Dobrowolski 2025-09-15 01:23:49 +02:00
commit 8badf2b0dc
14 changed files with 7 additions and 31 deletions

View file

@ -233,10 +233,6 @@
% usage: \born{date, place}
\newcommand*{\born}[1]{\def\@born{#1}}
% defines one's email (optional)
% usage: \email{<email address>}
\newcommand*{\email}[1]{\def\@email{#1}}
% defines one's home page (optional)
% usage: \homepage[<optional protocol>]{<url>}
% where <optional protocol> should be either "https" (default) or "http"
@ -257,6 +253,7 @@
\def\SplitMyMacro#1/#2{#2}
% Define links for different social networks
\newcommand{\emaillink}[2]{\protect\href{mailto:#2}{#1}}
\newcommand{\linkedinlink}[2]{\protect\httpslink[#1]{www.linkedin.com/in/#2}}
\newcommand{\xinglink}[2]{\protect\httpslink[#1]{www.xing.com/profile/#2}}
\newcommand{\twitterlink}[2]{\protect\httpslink[#1]{twitter.com/#2}}
@ -351,7 +348,7 @@
\newcommand*{\mobilephonesymbol} {}
\newcommand*{\fixedphonesymbol} {}
\newcommand*{\faxphonesymbol} {}
\newcommand*{\emailsymbol} {}
\newcommand*{\emailsocialsymbol} {}
\newcommand*{\homepagesymbol} {}
\newcommand*{\linkedinsocialsymbol} {}
\newcommand*{\xingsocialsymbol} {}
@ -610,13 +607,6 @@
{\href{https://#2}{#2}}%
{\href{https://#2}{#1}}}}
% makes an email hyperlink
% usage: \emaillink[optional text]{link}
\newcommand*{\emaillink}[2][]{%
\ifthenelse{\equal{#1}{}}%
{\href{mailto:#2}{#2}}%
{\href{mailto:#2}{#1}}}
% makes a tel hyperlink
% usage: \tellink[optional text]{link}
\newcommand*{\tellink}[2][]{%

View file

@ -88,7 +88,6 @@
\ifthenelse{\isundefined{\@born}}{}{\addtofoot{\bornsymbol\@born}\flushfoot\@firstfootelementtrue\\}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\addtofoot{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@email}}{}{\addtofoot{\emailsymbol\emaillink{\@email}}}%
\ifthenelse{\isundefined{\@homepage}}{}{\addtofoot{\homepagesymbol%
\ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
@ -121,7 +120,6 @@
\ifthenelse{\isundefined{\@born}}{}{\addtofoot{\bornsymbol\@born}\flushfoot\@firstfootelementtrue\\}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\addtofoot{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@email}}{}{\addtofoot{\emailsymbol\emaillink{\@email}}}%
\ifthenelse{\isundefined{\@homepage}}{}{\addtofoot{\homepagesymbol%
\ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link

View file

@ -87,7 +87,6 @@
\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
\ifthenelse{\isundefined{\@born}}{}{\makenewline\bornsymbol\@born}%
\phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict
\ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol%
\ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}%
\socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict
@ -177,7 +176,6 @@
\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%
\ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link

View file

@ -143,7 +143,6 @@
\ifthenelse{\isundefined{\@born}}{}{\addtomakeheaddetails{\bornsymbol\@born}}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\addtomakeheaddetails{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@email}}{}{\addtomakeheaddetails{\emailsymbol\emaillink{\@email}}}%
\ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol%
\ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link

View file

@ -96,7 +96,6 @@
\ifthenelse{\isundefined{\@born}}{}{\addtomakeheaddetails{\bornsymbol\@born}}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\addtomakeheaddetails{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@email}}{}{\addtomakeheaddetails{\emailsymbol\emaillink{\@email}}}%
\ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol%
\ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
@ -156,7 +155,6 @@
\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%
\ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link

View file

@ -112,7 +112,6 @@
\ifthenelse{\isundefined{\@born}}{}{\makenewline\hbox to 1.0em{\bornsymbol}~\@born}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\makenewline\hbox to 1.0em{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}%
\ifthenelse{\isundefined{\@email}}{}{\makenewline\hbox to 1.0em{\emailsymbol}~\emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~%
\ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
@ -161,7 +160,6 @@
\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\makenewline\hbox to 1.0em{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}%
\ifthenelse{\isundefined{\@email}}{}{\makenewline\hbox to 1.0em{\emailsymbol}~\emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~%
\ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link

View file

@ -84,7 +84,6 @@
\ifthenelse{\isundefined{\@born}}{}{\makenewline\bornsymbol~\@born}%
\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~%
\ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
@ -157,7 +156,6 @@
\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%
\ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link

View file

@ -117,7 +117,6 @@
\ifthenelse{\isundefined{\@born}}{}{\addtomakeheaddetails{\bornsymbol\@born}}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\addtomakeheaddetails{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@email}}{}{\addtomakeheaddetails{\emailsymbol\emaillink{\@email}}}%
\ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol%
\ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link

View file

@ -94,7 +94,6 @@
\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
\ifthenelse{\isundefined{\@born}}{}{\makenewline\bornsymbol\@born}%
\phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict
\ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
\socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
@ -198,7 +197,6 @@
\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}}%
\phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict
\ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
\end{tabular}%

View file

@ -41,7 +41,7 @@
%\newcommand*{\mobilephonesymbol} {}
%\newcommand*{\fixedphonesymbol} {}
%\newcommand*{\faxphonesymbol} {}
%\newcommand*{\emailsymbol} {}
%\newcommand*{\emailsocialsymbol} {}
%\newcommand*{\homepagesymbol} {}
%\newcommand*{\linkedinsocialsymbol} {}
%\newcommand*{\xingsocialsymbol} {}

View file

@ -69,7 +69,7 @@
\renewcommand*{\mobilephonesymbol} {{\color{mobilephone}\small\faMobile*}~} % alternative: \faMobile (solid style)
\renewcommand*{\fixedphonesymbol} {{\color{fixedphone}\small\faPhone*}~} % alternative: \faPhone (reversed)
\renewcommand*{\faxphonesymbol} {{\color{faxphone}\small\faFax}~} % alternative: \faPrint
\renewcommand*{\emailsymbol} {{\color{email}\small\faEnvelope[regular]}~} % alternative: \faInbox, \faEnvelope (solid style)
\renewcommand*{\emailsocialsymbol} {{\color{email}\small\faEnvelope[regular]}~} % alternative: \faInbox, \faEnvelope (solid style)
\renewcommand*{\homepagesymbol} {{\color{homepage}\small\faGlobeAmericas}~} % alternative: \faHome, \faGlobe, \faGlobeEurope, \faGlobeAfrica, \faGlobeAsia
\renewcommand*{\linkedinsocialsymbol} {{\color{linkedin}\small\faLinkedinIn}~} % alternative: \faLinkedin
\renewcommand*{\xingsocialsymbol} {{\color{xing}\small\faXing}~} % alternative: \faXingSquare

View file

@ -26,7 +26,7 @@
\renewcommand*{\mobilephonesymbol} {\textbf{M}~}
\renewcommand*{\fixedphonesymbol} {\textbf{T}~}
\renewcommand*{\faxphonesymbol} {\textbf{F}~}
\renewcommand*{\emailsymbol} {\textbf{E}~}
\renewcommand*{\emailsocialsymbol} {\textbf{E}~}
\renewcommand*{\homepagesymbol} {\textbf{W}~}
\renewcommand*{\linkedinsocialsymbol} {\textbf{in}~}
\renewcommand*{\xingsocialsymbol} {\textbf{xi}~}

View file

@ -22,7 +22,7 @@
\renewcommand*{\mobilephonesymbol} {\marvosymbol{72}~}
\renewcommand*{\fixedphonesymbol} {\marvosymbol{84}~}
\renewcommand*{\faxphonesymbol} {\marvosymbol{117}~}
\renewcommand*{\emailsymbol} {\marvosymbol{66}~}
\renewcommand*{\emailsocialsymbol} {\marvosymbol{66}~}
\renewcommand*{\homepagesymbol} {{\Large\marvosymbol{205}}~}
\endinput

View file

@ -60,7 +60,7 @@
\phone[mobile]{+1~(234)~567~890} % optional, remove / comment the line if not wanted; the optional "type" of the phone can be "mobile" (default), "fixed" or "fax"
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{john@doe.org} % optional, remove / comment the line if not wanted
\social[email]{john@doe.org} % optional, remove / comment the line if not wanted
\homepage{www.johndoe.com} % optional, remove / comment the line if not wanted
% Social icons