Add Title Role
This commit is contained in:
+63
-22
@@ -104,7 +104,9 @@
|
||||
\registerData{honoricprefix}
|
||||
\registerData{honoricsuffix}
|
||||
\registerData{company}
|
||||
\registerData{additionalnames}
|
||||
\registerData{pobox}
|
||||
\registerData{role}
|
||||
\registerData{extaddr}
|
||||
\registerData{street}
|
||||
\registerData{city}
|
||||
@@ -133,6 +135,14 @@
|
||||
\registerData{pgpurl}
|
||||
\registerData{pgpfingerprint}
|
||||
|
||||
% Override document \title to capture card title (original available via \carddocumenttitle)
|
||||
\let\BCQ@documenttitle\title
|
||||
\renewcommand\title[1]{%
|
||||
\def\Xtitle{#1}%
|
||||
}
|
||||
\newcommand\carddocumenttitle[1]{%
|
||||
\BCQ@documenttitle{#1}%
|
||||
}
|
||||
% Special commands with optional parameters
|
||||
% \logo[height=...]{file} - logo next to name, overrides logoheight option
|
||||
\define@key{BCQ@logo}{height}{\def\BCQ@logoheight@local{#1}}
|
||||
@@ -193,11 +203,21 @@
|
||||
\newlength{\BCQ@reservedheight}
|
||||
\newlength{\BCQ@heightscale}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% name - assemble full name from the parts, such as Xgivennames and Xfamilynames
|
||||
\newcommand\personalname{%
|
||||
\ifexists{Xhonoricprefix}{\Xhonoricprefix\ }%
|
||||
\ifexists{Xgivennames}{\Xgivennames\ }%
|
||||
\ifexists{Xadditionalnames}{\Xadditionalnames\ }%
|
||||
\ifexists{Xfamilynames}{\Xfamilynames}%
|
||||
\ifexists{Xhonoricsuffix}{\ \Xhonoricsuffix}%
|
||||
}
|
||||
|
||||
% heightscale - calculate available height for text/QR
|
||||
% Uses actual logo height if logo is taller than default reserved space
|
||||
% This is computed as a length and stored, not a macro
|
||||
\newcommand\computeheightscale{%
|
||||
\setlength{\BCQ@reservedheight}{\dimexpr\ifcsempty{name}{0em}{2em}+\ifcsdef{Xcompany}{2em}{0em}\relax}%
|
||||
\setlength{\BCQ@reservedheight}{\dimexpr\ifcsempty{personalname}{0em}{2em}+\ifcsdef{Xcompany}{2em}{0em}\relax}%
|
||||
\ifdim\BCQ@logoheightdimen>\BCQ@reservedheight
|
||||
\setlength{\BCQ@heightscale}{\dimexpr\textheight-\BCQ@logoheightdimen-\ifcsdef{Xpgpfingerprint}{2em}{0em}\relax}%
|
||||
\else
|
||||
@@ -206,9 +226,31 @@
|
||||
}
|
||||
\newcommand\heightscale{\BCQ@heightscale}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% name - assemble full name from the parts, such as Xgivennames and Xfamilynames
|
||||
\newcommand\name{\ifexists{Xhonoricprefix}{\Xhonoricprefix\ }\ifexists{Xgivennames}{\Xgivennames\ }\ifexists{Xfamilynames}{\Xfamilynames}\ifexists{Xhonoricsuffix}{\ \Xhonoricsuffix}}
|
||||
\newcommand\companyrolestring{%
|
||||
\ifcsdef{Xcompany}{%
|
||||
\ifcsdef{Xtitle}{%
|
||||
\Xtitle%
|
||||
\ifcsdef{Xrole}{, \Xrole}{}%
|
||||
\ \Xcompany%
|
||||
}{%
|
||||
\ifcsdef{Xrole}{%
|
||||
\Xrole\ \Xcompany%
|
||||
}{%
|
||||
\Xcompany%
|
||||
}%
|
||||
}%
|
||||
}{}%
|
||||
}
|
||||
\newcommand\name{%
|
||||
\personalname
|
||||
\ifcsdef{Xcompany}{%
|
||||
\ifcsempty{personalname}{%
|
||||
\companyrolestring
|
||||
}{%
|
||||
\ (\companyrolestring)%
|
||||
}%
|
||||
}{}%
|
||||
}
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
@@ -222,8 +264,11 @@
|
||||
% vcard assembly (version 4.0 retained). CRLF improves iOS import robustness.
|
||||
\newcommand\vcard{BEGIN:VCARD\BCQ@nl
|
||||
VERSION:4.0\BCQ@nl
|
||||
N:\cond{Xfamilynames};\cond{Xgivennames};\cond{Xcompany};\cond{Xhonoricprefix};\cond{Xhonoricsuffix}\BCQ@nl
|
||||
FN:\name\ifexists{Xcompany}{\ifcsempty{name}{} { }\Xcompany}\BCQ@nl
|
||||
N:\cond{Xfamilynames};\cond{Xgivennames};\cond{Xadditionalnames};\cond{Xhonoricprefix};\cond{Xhonoricsuffix}\BCQ@nl
|
||||
FN:\name\BCQ@nl
|
||||
\ifexists{Xcompany}{ORG:\Xcompany\BCQ@nl}
|
||||
\ifexists{Xtitle}{TITLE:\Xtitle\BCQ@nl}
|
||||
\ifexists{Xrole}{ROLE:\Xrole\BCQ@nl}
|
||||
\ifexists{printaddress}{ADR\ifexists{Xtype}{;TYPE=\Xtype}:\cond{Xpobox};\cond{Xextaddr};\cond{Xstreet};\cond{Xcity};\cond{Xregion};\cond{Xzip};\cond{Xcountry}\BCQ@nl}
|
||||
\ifexists{Xphone}{TEL;VALUE=uri;TYPE=\ifexists{Xtype}{\Xtype,}voice,text:tel:\Xphone\BCQ@nl}
|
||||
\ifexists{Xemail}{EMAIL\ifexists{Xtype}{;TYPE=\Xtype}:\Xemail\BCQ@nl}
|
||||
@@ -273,12 +318,16 @@ END:VCARD\BCQ@nl}
|
||||
}%
|
||||
% Output country
|
||||
\ifdefstring{\BCQ@shouldinline}{true}{%
|
||||
\Xcountry\ \textemdash\ %
|
||||
\Xcountry\ \textemdash\ \cond{Xzip} \cond{Xcity}%
|
||||
}{%
|
||||
\cond{Xzip} \cond{Xcity}
|
||||
|
||||
\Xcountry
|
||||
|
||||
}%
|
||||
}{}%
|
||||
}{
|
||||
\cond{Xzip} \cond{Xcity}
|
||||
}%
|
||||
}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
@@ -291,7 +340,7 @@ END:VCARD\BCQ@nl}
|
||||
|
||||
\cond{Xstreet}
|
||||
|
||||
\formatcountry\cond{Xzip} \cond{Xcity}
|
||||
\formatcountry
|
||||
|
||||
\cond{Xregion}
|
||||
|
||||
@@ -381,7 +430,7 @@ END:VCARD\BCQ@nl}
|
||||
% insertname - insert the name on the top
|
||||
\newcommand\insertname{
|
||||
% typeset name into box for measurement
|
||||
\sbox{\BCQ@namebox}{\bfseries\cond{name}\ifexists{Xcompany}{\ifcsempty{name}{} { }\Xcompany}}%
|
||||
\sbox{\BCQ@namebox}{\bfseries\cond{name}}%
|
||||
% Set default logoheight if not specified: 4em with company, 2em without
|
||||
\ifx\BCQ@logoheight\@empty
|
||||
\ifcsdef{Xcompany}{\def\BCQ@logoheight{4em}}{\def\BCQ@logoheight{2em}}%
|
||||
@@ -410,22 +459,14 @@ END:VCARD\BCQ@nl}
|
||||
\begin{minipage}[c]{0.67\textwidth}% name column
|
||||
\ifBCQ@rightalign\raggedleft\fi% apply alignment
|
||||
{\bfseries\cond{name}}%
|
||||
% Show companylogo if set (only logo), otherwise show company text
|
||||
\ifcsdef{Xcompanylogo}{%
|
||||
\\\Xcompanylogo% only show logo
|
||||
}{%
|
||||
\ifexists{Xcompany}{\\\Xcompany}% show company text
|
||||
}%
|
||||
% Optional company logo below name
|
||||
\ifcsdef{Xcompanylogo}{\\\Xcompanylogo}{}%
|
||||
\end{minipage}
|
||||
\end{minipage}
|
||||
}{% no logo: just name
|
||||
{\bfseries\cond{name}}%
|
||||
% Show companylogo if set (only logo), otherwise show company text
|
||||
\ifcsdef{Xcompanylogo}{%
|
||||
\\\Xcompanylogo% only show logo
|
||||
}{%
|
||||
\ifexists{Xcompany}{\\\Xcompany}% show company text
|
||||
}%
|
||||
% Optional company logo below name
|
||||
\ifcsdef{Xcompanylogo}{\\\Xcompanylogo}{}%
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user