diff --git a/README.md b/README.md index dbdc73c..b9673e5 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,7 @@ Note: direct commands like `\paperwidth{...}` or `\color{...}` would clash with - `header` / `noheader`: show/hide top name block + separator line, default `header` - `qr` / `noqr`: show/hide QR block, default `qr` - `layout=`: `standard` (default) or `centered` +- `headeremphasis=`: `person` (default), `company`, or `balanced` - `rightalign` / `leftalign`: text alignment, default `rightalign` - `iconleft` / `iconright`: icon side, default `iconleft` - `fill` / `nofill`: fill space between icon and text, default `fill` @@ -199,6 +200,7 @@ What Influences What (Standard Layout) - `paperwidth/paperheight/contentwidth/contentheight/padding`: define the outer geometry of the whole card. - `header/noheader`: enables/disables the complete top block (name/logo/company line + separator line). +- `headeremphasis=person|company|balanced`: controls relative visual weight in the header (`person`: name larger, `company`: company line larger, `balanced`: same size). - `logo` + `logoheight`: affects header composition and reserved vertical space. - `company[height=...]` / `companylogo[height=...]`: affects second header line and reserved space. - `textwidth` and `qrwidth`: define horizontal split of body columns. @@ -304,7 +306,7 @@ Recognized Commands ### Command-Style Setters for Layout Options - geometry: `\setpaperwidth`, `\setpaperheight`, `\setcontentwidth`, `\setcontentheight`, `\setpadding`, `\setcutdist`, `\setcutlen` -- layout/typography: `\setfontsize`, `\settextwidth`, `\setqrwidth`, `\setqreclevel`, `\setqrlogoscale`, `\setqrlogoborder`, `\setlogoheight`, `\setlayout` +- layout/typography: `\setfontsize`, `\settextwidth`, `\setqrwidth`, `\setqreclevel`, `\setqrlogoscale`, `\setqrlogoborder`, `\setlogoheight`, `\setlayout`, `\setheaderemphasis` - booleans (`true`/`false`): `\setcrlf`, `\setaddress`, `\sethint`, `\seticon`, `\setrightalign`, `\seticonleft`, `\setfill`, `\setqrfirst`, `\setheader`, `\setqr`, `\sethttps` - colors/language/format: `\setlang`, `\setcardcolor`, `\setqrcolor`, `\setcountryformat`, `\setbgscale`, `\setbgopacity`, `\setqrbgopacity` - convenience toggles: `\noheader`, `\withheader`, `\noqr`, `\withqr`, `\standardlayout`, `\centeredlayout` @@ -360,6 +362,16 @@ Equivalent using setter commands: \drawcard ``` +Header emphasis example: + +```latex +\cardsetup{headeremphasis=company} +% or: +\setheaderemphasis{company} +% optional short alias: +\headeremphasis{balanced} +``` + If you want to keep most data and only remove selected fields: ```latex diff --git a/businesscard-qrcode.cls b/businesscard-qrcode.cls index 98df10e..cee9361 100644 --- a/businesscard-qrcode.cls +++ b/businesscard-qrcode.cls @@ -53,6 +53,7 @@ \DeclareComplementaryOption{www}{https} \DeclareStringOption[standard]{layout} % standard, centered \DeclareStringOption[auto]{countryformat} % auto: <4 chars inline with mdash, >=4 separate line; inline: always inline; below: always separate line +\DeclareStringOption[person]{headeremphasis} % person, company, balanced \DeclareDefaultOption{\@unknownoptionerror} \ProcessKeyvalOptions* @@ -138,6 +139,7 @@ \define@key{BCQ@runtime}{qrcolor}{\def\BCQ@qrcolor{#1}} \define@key{BCQ@runtime}{countryformat}{\def\BCQ@countryformat{#1}} \define@key{BCQ@runtime}{layout}{\def\BCQ@layout{#1}} +\define@key{BCQ@runtime}{headeremphasis}{\def\BCQ@headeremphasis{#1}} \define@key{BCQ@runtime}{crlf}[true]{\BCQ@setbool{crlf}{#1}} \define@key{BCQ@runtime}{nocrlf}[true]{\BCQ@setbool{crlf}{false}} \define@key{BCQ@runtime}{address}[true]{\BCQ@setbool{address}{#1}\ifBCQ@address\def\printaddress{}\else\csundef{printaddress}\fi} @@ -186,6 +188,8 @@ \newcommand\setqrcolor[1]{\setoption{qrcolor}{#1}} \newcommand\setcountryformat[1]{\setoption{countryformat}{#1}} \newcommand\setlayout[1]{\setoption{layout}{#1}} +\newcommand\setheaderemphasis[1]{\setoption{headeremphasis}{#1}} +\newcommand\headeremphasis[1]{\setoption{headeremphasis}{#1}} \newcommand\setcrlf[1]{\setoption{crlf}{#1}} \newcommand\setaddress[1]{\setoption{address}{#1}} \newcommand\sethint[1]{\setoption{hint}{#1}} @@ -637,6 +641,18 @@ \newcommand\displayname{% \ifhaspersonalname{\personalname}{\companybrandingline}% } +\newcommand\BCQ@headernameformat[1]{% + \ifdefstring{\BCQ@headeremphasis}{company}{\bfseries #1}{% + \ifdefstring{\BCQ@headeremphasis}{balanced}{{\bfseries #1}}{% + {\large\bfseries #1}% + }% + }% +} +\newcommand\BCQ@headercompanyformat[1]{% + \ifdefstring{\BCQ@headeremphasis}{company}{{\large #1}}{% + \ifdefstring{\BCQ@headeremphasis}{balanced}{#1}{#1}% + }% +} \newcommand\BCQ@appendvcardposition{% \ifhaspersonalnamevcard{% \ (\companyrolestringvcard)% @@ -916,16 +932,16 @@ END:VCARD\BCQ@nl} \hspace{\BCQ@logosepused} \begin{minipage}[c]{\BCQ@namewidth}% name column \ifBCQ@rightalign\raggedleft\fi% apply alignment - {\bfseries\cond{displayname}}% + \BCQ@headernameformat{\cond{displayname}}% \ifhaspersonalname{% - \ifhaspositionblock{\\\companybrandingline}{}% + \ifhaspositionblock{\\[0.7ex]\BCQ@headercompanyformat{\companybrandingline}}{}% }{}% \end{minipage} \end{minipage} }{% no logo: just name - {\bfseries\cond{displayname}}% + \BCQ@headernameformat{\cond{displayname}}% \ifhaspersonalname{% - \ifhaspositionblock{\\\companybrandingline}{}% + \ifhaspositionblock{\\[0.7ex]\BCQ@headercompanyformat{\companybrandingline}}{}% }{}% } } diff --git a/examples/businesscard-qrcode.cls b/examples/businesscard-qrcode.cls new file mode 100644 index 0000000..42094d1 --- /dev/null +++ b/examples/businesscard-qrcode.cls @@ -0,0 +1,4 @@ +% Local forwarder for compiling examples from this repository checkout. +% Ensures examples use ../businesscard-qrcode.cls instead of a globally installed class. +\input{../businesscard-qrcode.cls} +\endinput diff --git a/examples/centered-backside-example.pdf b/examples/centered-backside-example.pdf new file mode 100644 index 0000000..b41e6d6 Binary files /dev/null and b/examples/centered-backside-example.pdf differ diff --git a/examples/centered-backside-example.tex b/examples/centered-backside-example.tex new file mode 100644 index 0000000..0a39a88 --- /dev/null +++ b/examples/centered-backside-example.tex @@ -0,0 +1,29 @@ +\documentclass[textwidth=0.58,qrwidth=0.35,qrfirst]{businesscard-qrcode} + +\type{work} +\givennames{John} +\familynames{Doe} +\title{CEO} +\company{My\ Company\ LTD} +\email{john.doe@mycompany.ltd} +\homepage{mycompany.ltd} +\phone{+41\ 44\ 123\ 45\ 67} +\street{Example\ Street\ 1} +\zip{8000} +\city{Z\"urich} +\country{Switzerland} + +\begin{document} + % Front side: standard layout with QR + \drawcard + + % Back side: centered text-only layout + \newcard + \centercontent{% + {\Large\bfseries My\ Company\ LTD}\par + \vspace{0.8em} + john.doe@mycompany.ltd\par + mycompany.ltd + } + \drawcard[layout=centered,noqr,noheader] +\end{document} diff --git a/examples/john-doe-hongkong.pdf b/examples/john-doe-hongkong.pdf index c7e5156..2da072b 100644 Binary files a/examples/john-doe-hongkong.pdf and b/examples/john-doe-hongkong.pdf differ diff --git a/examples/mrw-test.pdf b/examples/mrw-test.pdf index 51eadfa..bdcad75 100644 Binary files a/examples/mrw-test.pdf and b/examples/mrw-test.pdf differ diff --git a/screenshots/centered-backside-example-0.png b/screenshots/centered-backside-example-0.png new file mode 100644 index 0000000..da54da0 Binary files /dev/null and b/screenshots/centered-backside-example-0.png differ diff --git a/screenshots/centered-backside-example-1.png b/screenshots/centered-backside-example-1.png new file mode 100644 index 0000000..b339743 Binary files /dev/null and b/screenshots/centered-backside-example-1.png differ diff --git a/screenshots/centered-backside-example-2.png b/screenshots/centered-backside-example-2.png new file mode 100644 index 0000000..02a99df Binary files /dev/null and b/screenshots/centered-backside-example-2.png differ diff --git a/screenshots/layout-standard.svg b/screenshots/layout-standard.svg new file mode 100644 index 0000000..d207a71 --- /dev/null +++ b/screenshots/layout-standard.svg @@ -0,0 +1,68 @@ + + + + + + + + Standard Layout (Normalfall: header + qr + qrfirst) + + + + + + Header Block + + + Optional Name-Logo + \logo{...} + + + Name Line: honoricprefix + givennames + additionalnames + familynames + honoricsuffix + + + Second line: title/role + [companylogo] + company + + + Separator line (only if header=true) + + + + Main Body Block + + + QR Column (qrwidth) + + QR code + optional \qrlogo + + + Text Column (textwidth) + + + Address block (optional) + Map icon + address lines (hidden if no visible address) + + + Contact/Social lines + icon | hint | value formatting options + + + + Optional Footer: pgpfingerprint + + + Swap sides with textfirst. Remove QR with noqr. Remove header with noheader. + diff --git a/screenshots/photo-example-0.png b/screenshots/photo-example-0.png new file mode 100644 index 0000000..76986e8 Binary files /dev/null and b/screenshots/photo-example-0.png differ diff --git a/screenshots/photo-example-1.png b/screenshots/photo-example-1.png new file mode 100644 index 0000000..3db4790 Binary files /dev/null and b/screenshots/photo-example-1.png differ diff --git a/screenshots/photo-in-qr-example-0.png b/screenshots/photo-in-qr-example-0.png new file mode 100644 index 0000000..7a1abdf Binary files /dev/null and b/screenshots/photo-in-qr-example-0.png differ diff --git a/screenshots/photo-in-qr-example-1.png b/screenshots/photo-in-qr-example-1.png new file mode 100644 index 0000000..ba2ff2b Binary files /dev/null and b/screenshots/photo-in-qr-example-1.png differ diff --git a/screenshots/special-papersize-0.png b/screenshots/special-papersize-0.png new file mode 100644 index 0000000..f92fbe1 Binary files /dev/null and b/screenshots/special-papersize-0.png differ diff --git a/screenshots/special-papersize-1.png b/screenshots/special-papersize-1.png new file mode 100644 index 0000000..c1e65e4 Binary files /dev/null and b/screenshots/special-papersize-1.png differ diff --git a/screenshots/texstudio_d30266-0.png b/screenshots/texstudio_d30266-0.png new file mode 100644 index 0000000..0140452 Binary files /dev/null and b/screenshots/texstudio_d30266-0.png differ diff --git a/screenshots/texstudio_d30266-1.png b/screenshots/texstudio_d30266-1.png new file mode 100644 index 0000000..43ec94a Binary files /dev/null and b/screenshots/texstudio_d30266-1.png differ