diff --git a/businesscard-qrcode/README.md b/businesscard-qrcode/README.md index 7bcb9ae..4fa0a81 100644 --- a/businesscard-qrcode/README.md +++ b/businesscard-qrcode/README.md @@ -1,9 +1,9 @@ Businesscard with QR-Code ========================= -What happens, if you give your visitin card to someone? Either he manually types the text into his computer or mobilefone, or it will end up in a box and be forgotten. Nowadays data is required electronically, not on paper. Here is the solution: A visiting card with QR-Code that contains a full [vcard], so that it can be scanned with an [app] on the mobilefone and therefore automatically imported into the electronic contacts. This also works well, when you are offline and bluetooth transfer fails. So here is the highly configurable businescard or visitingcards with full [vcard] as QR-Code, ready to send to online printers. +What happens, if you give your visiting card to someone? Either he manually types the text into his computer or mobilefone, or it will end up in a box and be forgotten. Nowadays data is required electronically, not on paper. Here is the solution: A visiting card with QR-Code that contains a full [vcard], so that it can be scanned with an [app] on the mobilefone and therefore automatically imported into the electronic contacts. This also works well, when you are offline and bluetooth transfer fails. So here is the highly configurable businescard or visitingcards with full [vcard] as QR-Code, ready to send to online printers. You can specify the exact size of the paper and the content within the paper, inluding generation of crop marks. -Other available visitingcard templates, such as [mschlenker] distribute the cards on an A4 paper. But if you want a professional printer, such as [onlineprinters], then you need to be able to generate a PDF with exactly one card, an exactly defined border and crop marks. That's why I wrote this template: You can specify the exact size of the paper and the content within the paper, inluding generation of crop marks. +Other available visitingcard templates, such as [mschlenker] distribute the cards on an A4 paper. But if you want a professional printer, such as [onlineprinters], then you need to be able to generate a PDF with exactly one card, an exactly defined border and crop marks. [![Example: John Doe from Hongkong](screenshots/john-doe-hongkong.jpg)](examples/john-doe-hongkong.tex) [![Example: Businesscard of Peter Muster from Zürich](screenshots/peter-muster-example-company-zuerich.jpg)](examples/peter-muster-example-company-zuerich.tex) @@ -11,7 +11,7 @@ Other available visitingcard templates, such as [mschlenker] distribute the card Features --------- +======== - all information is in the QR-Code - full privacy control: input is optional, specify only what you need, you decide what information to share, e.g. I print three cards, with phone and address, without address and only with electronical contacts, no phone nor address @@ -27,61 +27,62 @@ Features - supports [nextcloud federation id] -Usage Example -------------- +Usage +===== + +Installation +------------ + +Copy `businesscard-qrcode/businesscard-qrcode.cls` to your LaTeX class path. Simplest way for installation on Linux: + +```bash +mkdir ~/texmf/tex/latex/businesscard-qrcode +cp businesscard-qrcode/businesscard-qrcode.cls ~/texmf/tex/latex/businesscard-qrcode/ +``` + + +Compilation +------------ **Important:** You must use **`xelatex`** for compilation, because `xelatex` properly supports UTF-8 (e.g. needed for german umlauts or chinese characters). The package `inputenc` messes up with package `qrcode`. -Include the documentclass, define your date and add the document part: + +Document Structure +------------------ ```latex -\documentclass{businesscard-qrcode} +\documentclass[]{businesscard-qrcode} -\def\type{home} -\def\printaddress{} -\def\givennames{An} -\def\familynames{Example} -\def\street{Einbahnstrasse 84} -\def\city{Irgendwo} -\def\zip{1001} -\def\country{Switzerland} -\def\homepage{example.com} -\def\email{name@example.com} + \begin{document} \drawcard \end{document} ``` -Save it as file [texstudio_d30266.tex] and compile it to get [texstudio_d30266.pdf]: - - xelatex -synctex=1 -interaction=nonstopmode texstudio_d30266.tex - -The result:\\ -![the resulting visiting card](screenshots/texstudio_d30266.jpg) - -See [examples] for more examples. +where `` and `` are explained below. -Documentclass Options ---------------------- +Layout Options +-------------- Layout options are set as options to the `\documentclass`, e.g.: \documentclass[textwidth=0.7,qrwidth=0.25,www,nofill,iconright,rightalign,hint,icon,textfirst]{businesscard-qrcode} -Available options: -- `paperwidth`: width of the physical paper where the card is printed on (incl. border), default: `89mm` -- `paperheight`: height of the physical paper where the card is printed on (incl. border), default: `59mm` -- `contentwidth`: width of the card's content without the border that is cut, default: `85mm` -- `contentheight`: height of the card's content without the border that is cut, default: `55mm` -- `fontsize`: any fontsize allowed in `extarticle`, that are `8pt`, `9pt`, `10pt`, `11pt`, `12pt`, `14pt`, `17pt` and `20pt`, default: `8pt` -- `padding`: padding within the card's content, default: `2mm` -- `cutdist`: distance in `mm` where the cut marks are set, default: `2` -- `cutlen`: length of the cut marks in `mm`, default: `1` -- `textwidth`: relative width of the text block `1` means full width, so `qrwidth` plus `textwidth` should be smaller than `1` the remainig space is left empty between the text and QR-Code, default: `0.55` (that's 55% of the available space) -- `qrwidth`: relative width of the QR-Code `1` means full width, so `qrwidth` plus `textwidth` should be smaller than `1` the remainig space is left empty between the text and QR-Code, default: `0.40` (that's 40% of the available space) -- `lang`: language of the wikipedia page, will be prepended before `wikipedia.org`, e.g. `de.wikipedia.org`, default: `de` +### Available Options: + +- `paperwidth=`: width of the physical paper where the card is printed on (incl. border), default: `89mm` +- `paperheight=`: height of the physical paper where the card is printed on (incl. border), default: `59mm` +- `contentwidth=`: width of the card's content without the border that is cut, default: `85mm` +- `contentheight=`: height of the card's content without the border that is cut, default: `55mm` +- `fontsize=`: any fontsize allowed in `extarticle`, that are `8pt`, `9pt`, `10pt`, `11pt`, `12pt`, `14pt`, `17pt` and `20pt`, default: `8pt` +- `padding=`: padding within the card's content, default: `2mm` +- `cutdist=`: distance in `mm` where the cut marks are set, default: `2` +- `cutlen=`: length of the cut marks in `mm`, default: `1` +- `textwidth=`: relative width of the text block `1` means full width, so `qrwidth` plus `textwidth` should be smaller than `1` the remainig space is left empty between the text and QR-Code, default: `0.55` (that's 55% of the available space) +- `qrwidth=`: relative width of the QR-Code `1` means full width, so `qrwidth` plus `textwidth` should be smaller than `1` the remainig space is left empty between the text and QR-Code, default: `0.40` (that's 40% of the available space) +- `lang=`: language of the wikipedia page, will be prepended before `wikipedia.org`, e.g. `de.wikipedia.org`, default: `de` - `address`or `noaddress`: disable rendering of the address in text and QR-Code, default: address - `hint` or `nohint`: show the little text hints, default: `hint` - `icon` or `noicon`: show the icons, default: `icon` @@ -95,58 +96,112 @@ Available options: Data Definitions ---------------- -Your data is entered as definitions in the document, e.g.: - - \def\email{name@example.com} - -Please note, that spaces must be escaped, otherwise they do not appear in the QR-Code. You may not escape the spaces in your phone number, if you want them in the text, but not in the QR-Code, e.g.: - - \def\givennames{Juan\ Pablo} - \def\familynames{Martínez\ Escudero} - \def\phone{+41 52 123 45 67} - -Recognized definitions: -- `type`: either `home` or `work` for personal or business cards -- `givennames`: your first name and eventual middle names -- `familynames`: your family names -- `honoricprefix`: honorix name prefixes, e.g. academic titles -- `honoricsuffix`: honoric name suffixes -- `additionalnames`: additionl names — I use it for the company name in business cards -- `pobox`: post office box -- `extaddr`: address extension, e.g. name of a building or floor number -- `street`: street and number of the address -- `city`: name of the address location -- `region`: region of the address -- `zip`: zip code of the address -- `country`: full name of country of the address in the language of the card -- `phone`: your phone number, the phone is marked as mobile, so to be used for voice and text (SMS) -- `email`: your email address -- `jabber`: your [jabber] or xmpp chat address -- `matrixorg`: your [matrix] chat addres, hint: use [riot] messenger for [matrix] -- `cloud`: your [nextcloud federation id] — the url is prepended automatically -- `homepage`: url to a web site with «home» icon — without `https://` not `www` (unless it is required), this is prepended automatically -- `world`: url to a web site with «world» icon — without `https://` not `www` (unless it is required), this is prepended automatically -- `link`: url to a web site with «link» icon — without `https://` not `www` (unless it is required), this is prepended automatically -- `wordpress`: url to a web site with «wordpress» icon — without `https://` not `www` (unless it is required), this is prepended automatically -- `drupal`: url to a web site with «» icon — without `https://` not `www` (unless it is required), this is prepended automatically -- `joomla`: url to a web site with «joomla» icon — without `https://` not `www` (unless it is required), this is prepended automatically -- `wikipedia`: if you or your company have a [wikipedia] entry, specify documentclass option `lang` for the language of you entry and use this definition for the name of your page — the url is prepended automatically -- `git`: the url of your [git] repository — without `https://` not `www` (unless it is required), this is prepended automatically -- `gitea`: the url of your [gitea] project page, you can use this tag also for other project management sites, such as [gogs] — without `https://` not `www` (unless it is required), this is prepended automatically -- `github`: your account name on [github] — only the name of the account, the url is prepended automatically -- `facebook`: your account name on [facebook] or the name of your page — only the name of the account or page, the url is prepended automatically -- `twitter`: your account name on [twitter] — only the name of the account, the url is prepended automatically -- `youtube`: your account name on [youtube] — only the name of the account, the url is prepended automatically -- `google`: your account name on [google+] — only the name of the account, the url is prepended automatically -- `pgpurl`: the full url to your pgp public key (only added to the QR-Code, not shown in the text) -- `pgpfingerprint`: the fingerprint of your pgp public key +Your data is entered with commands in the document, e.g.: + + \email{name@example.com} + +**Important:**: Spaces *must* be escaped by a backslash `\` in all data definitions, if they should be kept in the QR-Code. This is a limitation of the `qrcode`-package- Without escaping `\`, spaces are show in the text block, but not in the QR-Code. You may make use of this feature, if you do not escape the spaces in `\phone` and `\pgpfingerprint`, but everywhere else. This way, phone number and pgp fingerprint are condensed in the QR-Code. + +See this example_ + + \givennames{Juan\ Pablo} + \familynames{Martínez\ Escudero} + \additionalnames{Example\ Company\ Ltd.} + \street{Im\ Stutz\ 123} + \pobox{Postfach\ 4567} + \phone{+41 52 123 45 67} + \pgpurl{https://pgp.mit.edu/pks/lookup?op=get\&search=0xF62315D04D4C0C62} + +### Recognized Commands: + +- `\type`: either `home` or `work` for personal or business cards +- `\givennames`: your first name and eventual middle names +- `\familynames`: your family names +- `\honoricprefix`: honorix name prefixes, e.g. academic titles +- `\honoricsuffix`: honoric name suffixes +- `\additionalnames`: additionl names — I use it for the company name in business cards +- `\pobox`: post office box +- `\extaddr`: address extension, e.g. name of a building or floor number +- `\street`: street and number of the address +- `\city`: name of the address location +- `\region`: region of the address +- `\zip`: zip code of the address +- `\country`: full name of country of the address in the language of the card +- `\phone`: your phone number, the phone is marked as mobile, so to be used for voice and text (SMS) +- `\email`: your email address +- `\jabber`: your [jabber] or xmpp chat address +- `\matrixorg`: your [matrix] chat addres, hint: use [riot] messenger for [matrix] +- `\cloud`: your [nextcloud federation id] — the url is prepended automatically +- `\homepage`: url to a web site with «home» icon — without `https://` not `www` (unless it is required), this is prepended automatically +- `\world`: url to a web site with «world» icon — without `https://` not `www` (unless it is required), this is prepended automatically +- `\link`: url to a web site with «link» icon — without `https://` not `www` (unless it is required), this is prepended automatically +- `\wordpress`: url to a web site with «wordpress» icon — without `https://` not `www` (unless it is required), this is prepended automatically +- `\drupal`: url to a web site with «» icon — without `https://` not `www` (unless it is required), this is prepended automatically +- `\joomla`: url to a web site with «joomla» icon — without `https://` not `www` (unless it is required), this is prepended automatically +- `\wikipedia`: if you or your company have a [wikipedia] entry, specify documentclass option `lang` for the language of you entry and use this definition for the name of your page — the url is prepended automatically +- `\git`: the url of your [git] repository — without `https://` not `www` (unless it is required), this is prepended automatically +- `\gitea`: the url of your [gitea] project page, you can use this tag also for other project management sites, such as [gogs] — without `https://` not `www` (unless it is required), this is prepended automatically +- `\github`: your account name on [github] — only the name of the account, the url is prepended automatically +- `\facebook`: your account name on [facebook] or the name of your page — only the name of the account or page, the url is prepended automatically +- `\twitter`: your account name on [twitter] — only the name of the account, the url is prepended automatically +- `\youtube`: your account name on [youtube] — only the name of the account, the url is prepended automatically +- `\google`: your account name on [google+] — only the name of the account, the url is prepended automatically +- `\pgpurl`: the full url to your pgp public key (only added to the QR-Code, not shown in the text) +- `\pgpfingerprint`: the fingerprint of your pgp public key + + +Print the Card +============== + +The card is designed for professional printing service, such as [onlineprinters]. Please *check* the card and the *QR-Code* well before you pay money for printing! Choose a format, default is `89mm×59mm` with 2mm boder, so the card content is `85mm×55mm`. But the card can be adapted to any other printing format. To print cards of size `10cm×5cm` with `2mm` cut, you specify, [e.g.](examples/special-papersize.tex): + + \documentclass[paperheight=5.4cm,paperwidth=10.4cm, + contentheight=5cm,contentwidth=10cm, + cutdist=2] + {businesscard-qrcode} + +![example with special paper size](screenshots/special-papersize.jpg) + + +Usage Example +============= + +Include the documentclass, define your data and add the document environment: + +```latex +\documentclass{businesscard-qrcode} + +\type{home} +\givennames{An} +\familynames{Example} +\street{Einbahnstrasse\ 84} +\city{Irgendwo} +\zip{1001} +\country{Switzerland} +\homepage{example.com} +\email{name@example.com} + +\begin{document} + \drawcard +\end{document} +``` + +Save it as file [texstudio_d30266.tex] and compile it to get [texstudio_d30266.pdf]: + + xelatex -synctex=1 -interaction=nonstopmode texstudio_d30266.tex + +![the visiting card resulting from the usage example](screenshots/texstudio_d30266.jpg) + +See [examples] for more examples. Need More ---------- +========= If you are missing a feature or a configuration option, just open a [ticket] and I will care about it. + + [ticket]: https://mrw.sh/templates/latex/issues "open issues and tickets for my LaTeX-templates project" [examples]: examples "more examples" [vcard]: https://tools.ietf.org/html/rfc6350 "RFC 6350, vCard Format Specification Version 4.0" diff --git a/businesscard-qrcode/autogen.sh b/businesscard-qrcode/autogen.sh new file mode 100755 index 0000000..2395229 --- /dev/null +++ b/businesscard-qrcode/autogen.sh @@ -0,0 +1,4 @@ +#!/bin/bash -e +aclocal +automake --add-missing +autoconf diff --git a/businesscard-qrcode/businesscard-qrcode.cls b/businesscard-qrcode/businesscard-qrcode.cls index b036751..b25b464 100644 --- a/businesscard-qrcode/businesscard-qrcode.cls +++ b/businesscard-qrcode/businesscard-qrcode.cls @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{businesscard-qrcode}[2018/08/13 cleanup and bug fixes] +\ProvidesClass{businesscard-qrcode}[2018/08/14 version 1.0 ready for ctan] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % option evaluation @@ -74,6 +74,49 @@ \setlength{\fboxsep}{0pt} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% data registration +\newcommand\registerData[1]{ + \expandafter\newcommand\csname #1\endcsname[1]{ + \expandafter\def\csname X#1\endcsname{##1} + } +} +\registerData{type} +\registerData{givennames} +\registerData{familynames} +\registerData{honoricprefix} +\registerData{honoricsuffix} +\registerData{additionalnames} +\registerData{pobox} +\registerData{extaddr} +\registerData{street} +\registerData{city} +\registerData{region} +\registerData{zip} +\registerData{country} +\registerData{phone} +\registerData{email} +\registerData{jabber} +\registerData{matrixorg} +\registerData{cloud} +\registerData{homepage} +\registerData{wordpress} +\registerData{drupal} +\registerData{joomla} +\registerData{wikipedia} +\registerData{link} +\registerData{world} +\registerData{git} +\registerData{gitea} +\registerData{github} +\registerData{facebook} +\registerData{twitter} +\registerData{youtube} +\registerData{google} +\registerData{pgpurl} +\registerData{pgpfingerprint} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % auxiliary commands \newcommand\enforceright{\leftskip0pt plus 1fill\rightskip0pt} @@ -90,42 +133,42 @@ \newcommand\ifboth[3]{\ifcsdef{#1}{\ifcsdef{#2}{#3}{}}{}} \newcommand\ifany[3]{\ifcsdef{#1}{#3}{\ifcsdef{#2}{#3}{}}} \newcommand\cond[1]{\ifcsdef{#1}{\exec{#1}}{}} -\newcommand\heightscale{\dimexpr\textheight-\ifcsempty{name}{0em}{2em}-\ifcsdef{pgpfingerprint}{2em}{0em}-\ifcsdef{additionalnames}{2em}{0em}\relax} +\newcommand\heightscale{\dimexpr\textheight-\ifcsempty{name}{0em}{2em}-\ifcsdef{Xpgpfingerprint}{2em}{0em}-\ifcsdef{Xadditionalnames}{2em}{0em}\relax} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% name - assemble full name from the parts, such as givennames and familynames -\newcommand\name{\ifexists{honoricprefix}{\honoricprefix\ }\ifexists{givennames}{\givennames\ }\ifexists{familynames}{\familynames}\ifexists{honoricsuffix}{\ \honoricsuffix}} +% 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}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % vcard - the content of the vcard \newcommand\vcard{BEGIN:VCARD^^J VERSION:4.0^^J -N:\cond{familynames};\cond{givennames};\cond{additionalnames};\cond{honoricprefix};\cond{honoricsuffix}^^J -FN:\name\ifexists{additionalnames}{\ifcsempty{name}{}{\ }\additionalnames}^^J -\ifexists{printaddress}{ADR\ifexists{type}{;TYPE=\type}:\cond{pobox};\cond{extaddr};\cond{street};\cond{city};\cond{region};\cond{zip};\cond{country}^^J} -\ifexists{phone}{TEL;VALUE=uri;TYPE=\ifexists{type}{\type,}voice,text:tel:\phone^^J} -\ifexists{email}{EMAIL\ifexists{type}{;TYPE=\type}:\email^^J} -\ifexists{jabber}{IMPP;TYPE=XMPP:\jabber^^J} -\ifexists{matrixorg}{IMPP;TYPE=MATRIX:\matrixorg^^J} -\ifexists{cloud}{URL:https://nextcloud.com/federation/\#\cloud^^J} -\ifexists{homepage}{URL:https://\homepage^^J} -\ifexists{wordpress}{URL:https://\wordpress^^J} -\ifexists{drupal}{URL:https://\drupal^^J} -\ifexists{joomla}{URL:https://\joomla^^J} -\ifexists{wikipedia}{URL:https://\lang.wikipedia.org/wiki/\wikipedia^^J} -\ifexists{link}{URL:https://\link^^J} -\ifexists{world}{URL:https://\world^^J} -\ifexists{git}{URL:https://\git^^J} -\ifexists{gitea}{URL:https://\gitea^^J} -\ifexists{github}{URL:https://github.com/\github^^J} -\ifexists{facebook}{URL:https://facebook.com/\facebook^^J} -\ifexists{twitter}{URL:https://twitter.com/\twitter^^J} -\ifexists{youtube}{URL:https://youtube.com/user/\youtube^^J} -\ifexists{google}{URL:https://plus.google.com/+\google^^J} -\ifexists{pgpurl}{KEY;MEDIATYPE=application/pgp-keys:\pgpurl^^J} -\ifexists{pgpfingerprint}{KEY:data:application/x-pgp-fingerprint,\pgpfingerprint^^J} +N:\cond{Xfamilynames};\cond{Xgivennames};\cond{Xadditionalnames};\cond{Xhonoricprefix};\cond{Xhonoricsuffix}^^J +FN:\name\ifexists{Xadditionalnames}{\ifcsempty{name}{}{\ }\Xadditionalnames}^^J +\ifexists{printaddress}{ADR\ifexists{Xtype}{;TYPE=\Xtype}:\cond{Xpobox};\cond{Xextaddr};\cond{Xstreet};\cond{Xcity};\cond{Xregion};\cond{Xzip};\cond{Xcountry}^^J} +\ifexists{Xphone}{TEL;VALUE=uri;TYPE=\ifexists{Xtype}{\Xtype,}voice,text:tel:\Xphone^^J} +\ifexists{Xemail}{EMAIL\ifexists{Xtype}{;TYPE=\Xtype}:\Xemail^^J} +\ifexists{Xjabber}{IMPP;TYPE=XMPP:\Xjabber^^J} +\ifexists{Xmatrixorg}{IMPP;TYPE=MATRIX:\Xmatrixorg^^J} +\ifexists{Xcloud}{URL:https://nextcloud.com/federation/\#\Xcloud^^J} +\ifexists{Xhomepage}{URL:https://\Xhomepage^^J} +\ifexists{Xwordpress}{URL:https://\Xwordpress^^J} +\ifexists{Xdrupal}{URL:https://\Xdrupal^^J} +\ifexists{Xjoomla}{URL:https://\Xjoomla^^J} +\ifexists{Xwikipedia}{URL:https://\lang.wikipedia.org/wiki/\Xwikipedia^^J} +\ifexists{Xlink}{URL:https://\Xlink^^J} +\ifexists{Xworld}{URL:https://\Xworld^^J} +\ifexists{Xgit}{URL:https://\Xgit^^J} +\ifexists{Xgitea}{URL:https://\Xgitea^^J} +\ifexists{Xgithub}{URL:https://github.com/\Xgithub^^J} +\ifexists{Xfacebook}{URL:https://facebook.com/\Xfacebook^^J} +\ifexists{Xtwitter}{URL:https://twitter.com/\Xtwitter^^J} +\ifexists{Xyoutube}{URL:https://youtube.com/user/\Xyoutube^^J} +\ifexists{Xgoogle}{URL:https://plus.google.com/+\Xgoogle^^J} +\ifexists{Xpgpurl}{KEY;MEDIATYPE=application/pgp-keys:\Xpgpurl^^J} +\ifexists{Xpgpfingerprint}{KEY:data:application/x-pgp-fingerprint,\Xpgpfingerprint^^J} END:VCARD^^J} @@ -133,15 +176,15 @@ END:VCARD^^J} % address - the address as shown in the textbox \newcommand\address{ - \cond{pobox} + \cond{Xpobox} - \cond{extaddr} + \cond{Xextaddr} - \cond{street} + \cond{Xstreet} - \cond{zip} \cond{city} + \cond{Xzip} \cond{Xcity} - \cond{region} \cond{country} + \cond{Xregion} \cond{Xcountry} } @@ -174,7 +217,7 @@ END:VCARD^^J} \vspace{1em} } - \insa[tel:]{phone}{faMobile}\insa[mailto:]{email}{Email}\insa[xmpp]{jabber}{faCommentsO}\insa[matrix.org]{matrixorg}{faCommentsO}\insa[nextcloud-id]{cloud}{faCloud}\insa[\protdisplay]{homepage}{faHome}\insa[\protdisplay]{wordpress}{faWordpress}\insa[\protdisplay]{drupal}{faDrupal}\insa[\protdisplay]{joomla}{faJoomla}\insa[{\protprefix}\lang.wikipedia.org/wiki/]{wikipedia}{faWikipediaW}\insa[\protdisplay]{link}{faLink}\insa[\protdisplay]{world}{faGlobe}\insa[\protdisplay]{git}{faGit}\insa[\protdisplay]{gitea}{faGithubAlt}\insa[{\protprefix}github.com/]{github}{faGithub}\insa[{\protprefix}facebook.com/]{facebook}{faFacebook}\insa[{\protprefix}twitter.com/]{twitter}{faTwitter}\insa[{\protprefix}youtube.com/user/]{youtube}{faYoutube}\insa[{\protprefix}plus.google.com/+]{google}{faGooglePlus} + \insa[tel:]{Xphone}{faMobile}\insa[mailto:]{Xemail}{Email}\insa[xmpp]{Xjabber}{faCommentsO}\insa[matrix.org]{Xmatrixorg}{faCommentsO}\insa[nextcloud-id]{Xcloud}{faCloud}\insa[\protdisplay]{Xhomepage}{faHome}\insa[\protdisplay]{Xwordpress}{faWordpress}\insa[\protdisplay]{Xdrupal}{faDrupal}\insa[\protdisplay]{Xjoomla}{faJoomla}\insa[{\protprefix}\lang.wikipedia.org/wiki/]{Xwikipedia}{faWikipediaW}\insa[\protdisplay]{Xlink}{faLink}\insa[\protdisplay]{Xworld}{faGlobe}\insa[\protdisplay]{Xgit}{faGit}\insa[\protdisplay]{Xgitea}{faGithubAlt}\insa[{\protprefix}github.com/]{Xgithub}{faGithub}\insa[{\protprefix}facebook.com/]{Xfacebook}{faFacebook}\insa[{\protprefix}twitter.com/]{Xtwitter}{faTwitter}\insa[{\protprefix}youtube.com/user/]{Xyoutube}{faYoutube}\insa[{\protprefix}plus.google.com/+]{Xgoogle}{faGooglePlus} \ifBCQ@rightalign\end{flushright}\fi \end{minipage} @@ -204,7 +247,7 @@ END:VCARD^^J} \cond{name} - \cond{additionalnames} + \cond{Xadditionalnames} } %\end{minipage} @@ -226,12 +269,12 @@ END:VCARD^^J} \hfill \insertqrcode \fi - \ifexists{pgpfingerprint}{ + \ifexists{Xpgpfingerprint}{ \vfill \ifBCQ@iconleft - \faLock\ifBCQ@hint{\tiny\ pgp}\fi\hfill{\small\pgpfingerprint} + \faLock\ifBCQ@hint{\tiny\ pgp}\fi\hfill{\small\Xpgpfingerprint} \else - {\small\pgpfingerprint}\hfill\ifBCQ@hint{\tiny{pgp\ }}\fi\faLock + {\small\Xpgpfingerprint}\hfill\ifBCQ@hint{\tiny{pgp\ }}\fi\faLock \fi } \ifBCQ@rightalign\end{flushright}\fi diff --git a/businesscard-qrcode/configure.ac b/businesscard-qrcode/configure.ac new file mode 100644 index 0000000..4dc1c25 --- /dev/null +++ b/businesscard-qrcode/configure.ac @@ -0,0 +1,26 @@ +#AC_PREREQ([2.69]) +AC_INIT([businesscard-qrcode], [1.0], [marc@waeckerlin.org]) +AM_INIT_AUTOMAKE([1.9 tar-pax]) + +AC_ARG_WITH([latexdir], + [AS_HELP_STRING([--with-latexdir=DIR], [latex template files])], + [latexdir=$withval], + [latexdir='${datadir}/texlive/texmf-dist/tex/latex/@PACKAGE_NAME@']) +AC_SUBST([latexdir], [$latexdir]) + +# Checks for programs. +AC_CHECK_PROG([pandoc]) +AC_CHECK_PROG([convert]) +AC_CHECK_PROG([xelatex]) + +EXAMPLES="example john-doe-hongkong \ + peter-muster-example-company-zuerich special-papersize \ + texstudio_d30266" + +AC_SUBST(EXAMPLES) + +AC_CONFIG_FILES([examples/makefile + makefile + screenshots/makefile]) + +AC_OUTPUT diff --git a/businesscard-qrcode/examples/example.pdf b/businesscard-qrcode/examples/example.pdf index 68f7925..c9c8d74 100644 Binary files a/businesscard-qrcode/examples/example.pdf and b/businesscard-qrcode/examples/example.pdf differ diff --git a/businesscard-qrcode/examples/example.tex b/businesscard-qrcode/examples/example.tex index faaf6a1..cab94ff 100644 --- a/businesscard-qrcode/examples/example.tex +++ b/businesscard-qrcode/examples/example.tex @@ -1,34 +1,34 @@ \documentclass[noaddress,textwidth=0.58,qrwidth=0.35,https,fill,iconright,leftalign,hint,icon,textfirst]{businesscard-qrcode} -\def\phone{+12 34 567 89 00} -\def\type{home} -\def\honoricprefix{MSc ETH} -\def\givennames{Marc} -\def\familynames{Wäckerlin} -\def\homepage{marc.wäckerlin.ch} -%\def\link{marc.wäckerlin.ch} -%\def\git{mrw.sh} -\def\gitea{mrw.sh} -\def\github{mwaeckerlin} -\def\cloud{name@nextcloud.org} -\def\world{mrw.world} -%\def\wordpress{marc.wäckerlin.ch} -%\def\wikipedia{Marc\_Wäckerlin} -%\def\drupal{religionsfrei.info} -%\def\joomla{postsuisseid.ch} -%\def\youtube{WintiPirat} -\def\facebook{marc.waeckerlin} -%\def\google{MarcWäckerlin} -\def\twitter{GGR\_Winti} -\def\email{name@example.com} -\def\matrixorg{@name:matrix.org} -\def\street{Irgendwiestrasse\ 84} -\def\city{Irgendwo} -\def\zip{1001} -\def\country{Switzerland} -\def\pgpfingerprint{4C8B 41AF FEC4 ED9D 3AF9 8500 F623 15D0 4D4C 0C62} -\def\pgpurl{https://pgp.mit.edu/pks/lookup?op=get\&search=0xF62315D04D4C0C62} -%\def\jabber{\email} +\phone{+12 34 567 89 00} +\type{home} +\honoricprefix{MSc\ ETH} +\givennames{Marc} +\familynames{Wäckerlin} +\homepage{marc.wäckerlin.ch} +%\link{marc.wäckerlin.ch} +%\git{mrw.sh} +\gitea{mrw.sh} +\github{mwaeckerlin} +\cloud{name@nextcloud.org} +\world{mrw.world} +%\wordpress{marc.wäckerlin.ch} +%\wikipedia{Marc\_Wäckerlin} +%\drupal{religionsfrei.info} +%\joomla{postsuisseid.ch} +%\youtube{WintiPirat} +\facebook{marc.waeckerlin} +%\google{MarcWäckerlin} +\twitter{GGR\_Winti} +\email{name@example.com} +\matrixorg{@name:matrix.org} +\street{Irgendwiestrasse\ 84} +\city{Irgendwo} +\zip{1001} +\country{Switzerland} +\pgpfingerprint{4C8B 41AF FEC4 ED9D 3AF9 8500 F623 15D0 4D4C 0C62} +\pgpurl{https://pgp.mit.edu/pks/lookup?op=get\&search=0xF62315D04D4C0C62} +%\jabber{\email} \begin{document} \drawcard diff --git a/businesscard-qrcode/examples/john-doe-hongkong.pdf b/businesscard-qrcode/examples/john-doe-hongkong.pdf index b17a0ad..d6c1298 100644 Binary files a/businesscard-qrcode/examples/john-doe-hongkong.pdf and b/businesscard-qrcode/examples/john-doe-hongkong.pdf differ diff --git a/businesscard-qrcode/examples/john-doe-hongkong.tex b/businesscard-qrcode/examples/john-doe-hongkong.tex index 2f76b70..0865987 100644 --- a/businesscard-qrcode/examples/john-doe-hongkong.tex +++ b/businesscard-qrcode/examples/john-doe-hongkong.tex @@ -1,16 +1,17 @@ \documentclass[nofill,leftalign,nohint,fontsize=9pt]{businesscard-qrcode} -\def\givennames{John} -\def\familynames{Doe} -\def\extaddr{20/F.,\ One\ Kowloon} -\def\city{Kowloon Bay} -\def\street{1\ Wang\ Yuen\ Street} -\def\country{Hongkong} -\def\phone{(852)\ 1234-5678} -\def\homepage{example.com} -\def\email{name@example.com} - +\type{home} +\givennames{John} +\familynames{Doe} +\extaddr{20/F.,\ One\ Kowloon} +\city{Kowloon Bay} +\street{1\ Wang\ Yuen\ Street} +\country{Hongkong} +\phone{(852)\ 1234-5678} +\homepage{example.com} +\email{name@example.com} \begin{document} + %\StrSubstitute{John}{hn}{e} \drawcard \end{document} diff --git a/businesscard-qrcode/examples/makefile.am b/businesscard-qrcode/examples/makefile.am new file mode 100644 index 0000000..54278db --- /dev/null +++ b/businesscard-qrcode/examples/makefile.am @@ -0,0 +1,8 @@ +examplesdir = ${docdir}/examples +dist_examples_DATA = $(EXAMPLES:%=%.tex) $(EXAMPLES:%=%.pdf) + +%.pdf:%.tex + xelatex -synctex=1 -interaction=nonstopmode $< + +CLEANFILES = $(EXAMPLES:%=%.aux) $(EXAMPLES:%=%.log) $(EXAMPLES:%=%.synctex.gz) +MAINTAINERCLEANFILES = makefile.in diff --git a/businesscard-qrcode/examples/peter-muster-example-company-zuerich.pdf b/businesscard-qrcode/examples/peter-muster-example-company-zuerich.pdf index 4638570..170085a 100644 Binary files a/businesscard-qrcode/examples/peter-muster-example-company-zuerich.pdf and b/businesscard-qrcode/examples/peter-muster-example-company-zuerich.pdf differ diff --git a/businesscard-qrcode/examples/peter-muster-example-company-zuerich.tex b/businesscard-qrcode/examples/peter-muster-example-company-zuerich.tex index 252ee6c..48be708 100644 --- a/businesscard-qrcode/examples/peter-muster-example-company-zuerich.tex +++ b/businesscard-qrcode/examples/peter-muster-example-company-zuerich.tex @@ -1,18 +1,18 @@ \documentclass[nohint,textwidth=0.55,rightalign,nofill]{businesscard-qrcode} -\def\type{work} -\def\givennames{Peter} -\def\familynames{Muster} -\def\additionalnames{Example Company Ltd.} -\def\street{Im Stutz 123} -\def\pobox{Postfach 4567} -\def\zip{8000} -\def\city{Zürich} -\def\country{Switzerland} -\def\phone{+41 44 123 45 67} -\def\email{peter.muster@example.com} -\def\pgpfingerprint{4C8B 41AF FEC4 ED9D 3AF9 8500 F623 15D0 4D4C 0C62} -\def\pgpurl{https://pgp.mit.edu/pks/lookup?op=get\&search=0xF62315D04D4C0C62} +\type{work} +\givennames{Peter} +\familynames{Muster} +\additionalnames{Example\ Company\ Ltd.} +\street{Im\ Stutz\ 123} +\pobox{Postfach\ 4567} +\zip{8000} +\city{Zürich} +\country{Switzerland} +\phone{+41 44 123 45 67} +\email{peter.muster@example.com} +\pgpfingerprint{4C8B 41AF FEC4 ED9D 3AF9 8500 F623 15D0 4D4C 0C62} +\pgpurl{https://pgp.mit.edu/pks/lookup?op=get\&search=0xF62315D04D4C0C62} \begin{document} \drawcard diff --git a/businesscard-qrcode/examples/special-papersize.pdf b/businesscard-qrcode/examples/special-papersize.pdf new file mode 100644 index 0000000..eacb8c6 Binary files /dev/null and b/businesscard-qrcode/examples/special-papersize.pdf differ diff --git a/businesscard-qrcode/examples/special-papersize.tex b/businesscard-qrcode/examples/special-papersize.tex new file mode 100644 index 0000000..16e35c2 --- /dev/null +++ b/businesscard-qrcode/examples/special-papersize.tex @@ -0,0 +1,16 @@ +\documentclass[paperheight=5.4cm,paperwidth=10.4cm, + contentheight=5cm,contentwidth=10cm, + cutdist=2] + {businesscard-qrcode} + +\givennames{Gretchen\ Frieda} +\familynames{Huber\ Müller} +\street{Waldstrasse\ 15} +\zip{9876} +\city{Nirgendwo} +\phone{+41 78 654 32 10} +\email{gretchen.huber@example.com} + +\begin{document} + \drawcard +\end{document} \ No newline at end of file diff --git a/businesscard-qrcode/examples/texstudio_d30266.pdf b/businesscard-qrcode/examples/texstudio_d30266.pdf index 44389cd..87374a7 100644 Binary files a/businesscard-qrcode/examples/texstudio_d30266.pdf and b/businesscard-qrcode/examples/texstudio_d30266.pdf differ diff --git a/businesscard-qrcode/examples/texstudio_d30266.tex b/businesscard-qrcode/examples/texstudio_d30266.tex index 46fb765..a3002e8 100644 --- a/businesscard-qrcode/examples/texstudio_d30266.tex +++ b/businesscard-qrcode/examples/texstudio_d30266.tex @@ -1,14 +1,14 @@ \documentclass{businesscard-qrcode} -\def\type{home} -\def\givennames{An} -\def\familynames{Example} -\def\street{Einbahnstrasse 84} -\def\city{Irgendwo} -\def\zip{1001} -\def\country{Switzerland} -\def\homepage{example.com} -\def\email{name@example.com} +\type{home} +\givennames{An} +\familynames{Example} +\street{Einbahnstrasse\ 84} +\city{Irgendwo} +\zip{1001} +\country{Switzerland} +\homepage{example.com} +\email{name@example.com} \begin{document} \drawcard diff --git a/businesscard-qrcode/makefile.am b/businesscard-qrcode/makefile.am new file mode 100644 index 0000000..45865bd --- /dev/null +++ b/businesscard-qrcode/makefile.am @@ -0,0 +1,12 @@ +AUTOMAKE_OPTIONS = foreign + +SUBDIRS = examples screenshots + +dist_latex_DATA = @PACKAGE_NAME@.cls +dist_doc_DATA = README.md @PACKAGE_NAME@.pdf + +@PACKAGE_NAME@.pdf: README.md + pandoc --toc --latex-engine=xelatex -o $@ $< + +CLEANFILES = @PACKAGE_NAME@.pdf +MAINTAINERCLEANFILES = makefile.in aclocal.m4 configure install-sh missing diff --git a/businesscard-qrcode/screenshots.sh b/businesscard-qrcode/screenshots.sh deleted file mode 100755 index 5363701..0000000 --- a/businesscard-qrcode/screenshots.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -for f in examples/*.pdf; do - s=${f##*/}; - convert -density 600 -quality 90 $f screenshots/${s%pdf}jpg; -done diff --git a/businesscard-qrcode/screenshots/example.jpg b/businesscard-qrcode/screenshots/example.jpg index 026f797..6de6fdd 100644 Binary files a/businesscard-qrcode/screenshots/example.jpg and b/businesscard-qrcode/screenshots/example.jpg differ diff --git a/businesscard-qrcode/screenshots/john-doe-hongkong.jpg b/businesscard-qrcode/screenshots/john-doe-hongkong.jpg index e424cda..d3b1aa5 100644 Binary files a/businesscard-qrcode/screenshots/john-doe-hongkong.jpg and b/businesscard-qrcode/screenshots/john-doe-hongkong.jpg differ diff --git a/businesscard-qrcode/screenshots/makefile.am b/businesscard-qrcode/screenshots/makefile.am new file mode 100644 index 0000000..b566692 --- /dev/null +++ b/businesscard-qrcode/screenshots/makefile.am @@ -0,0 +1,11 @@ +EXAMPLES = example john-doe-hongkong \ + peter-muster-example-company-zuerich special-papersize \ + texstudio_d30266 + +screenshotdir=${docdir}/screenshots +dist_screenshot_DATA=$(EXAMPLES:%=%.jpg) + +%.jpg:${top_srcdir}/examples/%.pdf + convert -density 200 -quality 90 $< $@ + +MAINTAINERCLEANFILES = makefile.in diff --git a/businesscard-qrcode/screenshots/peter-muster-example-company-zuerich.jpg b/businesscard-qrcode/screenshots/peter-muster-example-company-zuerich.jpg index 59c6420..485e50c 100644 Binary files a/businesscard-qrcode/screenshots/peter-muster-example-company-zuerich.jpg and b/businesscard-qrcode/screenshots/peter-muster-example-company-zuerich.jpg differ diff --git a/businesscard-qrcode/screenshots/special-papersize.jpg b/businesscard-qrcode/screenshots/special-papersize.jpg new file mode 100644 index 0000000..8a451ce Binary files /dev/null and b/businesscard-qrcode/screenshots/special-papersize.jpg differ diff --git a/businesscard-qrcode/screenshots/texstudio_d30266.jpg b/businesscard-qrcode/screenshots/texstudio_d30266.jpg index 4493cff..8dd1ff8 100644 Binary files a/businesscard-qrcode/screenshots/texstudio_d30266.jpg and b/businesscard-qrcode/screenshots/texstudio_d30266.jpg differ