diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..082b194 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "makefile.configureOnOpen": false +} \ No newline at end of file diff --git a/businesscard-qrcode.cls b/businesscard-qrcode.cls index 8c04402..562bb6b 100644 --- a/businesscard-qrcode.cls +++ b/businesscard-qrcode.cls @@ -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}{}% } } diff --git a/examples/background-color-example.pdf b/examples/background-color-example.pdf index 10e6c60..65bbb4f 100644 Binary files a/examples/background-color-example.pdf and b/examples/background-color-example.pdf differ diff --git a/examples/background-image-example.pdf b/examples/background-image-example.pdf index 9f402e1..21c262b 100644 Binary files a/examples/background-image-example.pdf and b/examples/background-image-example.pdf differ diff --git a/examples/example.pdf b/examples/example.pdf index 2810671..bae990b 100644 Binary files a/examples/example.pdf and b/examples/example.pdf differ diff --git a/examples/john-doe-hongkong.pdf b/examples/john-doe-hongkong.pdf index 34b3ecf..eb60efb 100644 Binary files a/examples/john-doe-hongkong.pdf and b/examples/john-doe-hongkong.pdf differ diff --git a/examples/makefile.am b/examples/makefile.am index fe4b78b..4dfc9c4 100644 --- a/examples/makefile.am +++ b/examples/makefile.am @@ -16,5 +16,5 @@ dist_examples_DATA = $(EXAMPLES:%=%.tex) $(EXAMPLES:%=%.pdf) %.pdf:%.tex xelatex -synctex=1 -interaction=nonstopmode $< -CLEANFILES = $(EXAMPLES:%=%.aux) $(EXAMPLES:%=%.log) $(EXAMPLES:%=%.synctex.gz) $(EXAMPLES:%=%.fdb_latexmk) $(EXAMPLES:%=%.fls) $(EXAMPLES:%=%.xdv) +CLEANFILES = $(EXAMPLES:%=%.aux) $(EXAMPLES:%=%.pdf) $(EXAMPLES:%=%.log) $(EXAMPLES:%=%.synctex.gz) $(EXAMPLES:%=%.fdb_latexmk) $(EXAMPLES:%=%.fls) $(EXAMPLES:%=%.xdv) MAINTAINERCLEANFILES = makefile.in diff --git a/examples/peter-muster-example-company-zuerich.pdf b/examples/peter-muster-example-company-zuerich.pdf index 9182f95..94c0d5d 100644 Binary files a/examples/peter-muster-example-company-zuerich.pdf and b/examples/peter-muster-example-company-zuerich.pdf differ diff --git a/examples/photo-example.pdf b/examples/photo-example.pdf index 8309d0e..ea8fc03 100644 Binary files a/examples/photo-example.pdf and b/examples/photo-example.pdf differ diff --git a/examples/photo-in-qr-example.pdf b/examples/photo-in-qr-example.pdf index 9e2043c..375d2cd 100644 Binary files a/examples/photo-in-qr-example.pdf and b/examples/photo-in-qr-example.pdf differ diff --git a/examples/photo-in-qr-example.tex b/examples/photo-in-qr-example.tex index a851ff1..4be1e5f 100644 --- a/examples/photo-in-qr-example.tex +++ b/examples/photo-in-qr-example.tex @@ -1,9 +1,9 @@ % !TeX program = xelatex -\documentclass[logoinqr,qrlogoscale=0.4,qreclevel=H]{businesscard-qrcode} +\documentclass[qrbgopacity=0.5]{businesscard-qrcode} \type{home} \givennames{Lisa\ Linda} -\familynames{Doe} +\familynames{Döë} \company{Example\ Company} \street{Main\ Street\ 123} \city{New\ York} @@ -12,7 +12,9 @@ \phone{+1 234 567 8900} \email{ldoe@example.com} \homepage{example.com} -%\logo{photo.png} % uncomment if photo.png exists +\logo{photo.png} +\qrlogo[scale=.6]{logo.png} +\background[opacity=0.5,scale=1.2]{background.png} \begin{document} \drawcard diff --git a/examples/photo-large-example.pdf b/examples/photo-large-example.pdf index 0e1c13c..657848d 100644 Binary files a/examples/photo-large-example.pdf and b/examples/photo-large-example.pdf differ diff --git a/examples/special-papersize.pdf b/examples/special-papersize.pdf index 23bd05e..8c2530b 100644 Binary files a/examples/special-papersize.pdf and b/examples/special-papersize.pdf differ diff --git a/examples/test-country-short.pdf b/examples/test-country-short.pdf index 6f67f55..defcd4f 100644 Binary files a/examples/test-country-short.pdf and b/examples/test-country-short.pdf differ diff --git a/examples/texstudio_d30266.pdf b/examples/texstudio_d30266.pdf index c90270e..925c303 100644 Binary files a/examples/texstudio_d30266.pdf and b/examples/texstudio_d30266.pdf differ diff --git a/screenshots/example.png b/screenshots/example.png index b6e65ba..916cfbe 100644 Binary files a/screenshots/example.png and b/screenshots/example.png differ diff --git a/screenshots/john-doe-hongkong.png b/screenshots/john-doe-hongkong.png index c3ce53c..c25580c 100644 Binary files a/screenshots/john-doe-hongkong.png and b/screenshots/john-doe-hongkong.png differ diff --git a/screenshots/peter-muster-example-company-zuerich.png b/screenshots/peter-muster-example-company-zuerich.png index df8cbc5..faace92 100644 Binary files a/screenshots/peter-muster-example-company-zuerich.png and b/screenshots/peter-muster-example-company-zuerich.png differ diff --git a/screenshots/photo-example.png b/screenshots/photo-example.png index d7ea540..fce1677 100644 Binary files a/screenshots/photo-example.png and b/screenshots/photo-example.png differ diff --git a/screenshots/photo-in-qr-example.png b/screenshots/photo-in-qr-example.png index 072f029..36ffd4b 100644 Binary files a/screenshots/photo-in-qr-example.png and b/screenshots/photo-in-qr-example.png differ diff --git a/screenshots/special-papersize.png b/screenshots/special-papersize.png index 4f7cd89..74317a2 100644 Binary files a/screenshots/special-papersize.png and b/screenshots/special-papersize.png differ diff --git a/screenshots/texstudio_d30266.png b/screenshots/texstudio_d30266.png index e307f7c..23e4e3a 100644 Binary files a/screenshots/texstudio_d30266.png and b/screenshots/texstudio_d30266.png differ