-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcard.tex
141 lines (128 loc) · 4.48 KB
/
card.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
% BUSINESS CARD template
% created by Karol Kozioł (www.karol-koziol.net)
% for ShareLaTeX - online LaTeX editor (www.sharelatex.com)
% May 2013
% Addition: QR code support
% by Dieter Castel
% February 2015
\documentclass[10pt]{article}
\usepackage[dvips]{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage{tikz}
%Add package to provide QR code
\usepackage{qrcode}
\usepackage{geometry}
\geometry{total={210mm,297mm},hmargin=10mm,vmargin=2mm}
\pagestyle{empty}
\renewcommand\familydefault{\sfdefault}
\usepackage{tgadventor}
%%% BUSINESS CARD SIZE
\newlength{\cardw}
\newlength{\cardh}
%% ISO 7810 size: 85.60mm × 53.98mm
\setlength{\cardw}{85.60mm}
\setlength{\cardh}{53.98mm}
%% European size: 85mm × 55mm
% \setlength{\cardw}{85mm}
% \setlength{\cardh}{55mm}
%% US size: 3.5 in × 2 in
%\setlength{\cardw}{3.5in}
%\setlength{\cardh}{2in}
%%% DEFINE USER DATA
\newcommand{\Surname}{
Doe
}%
\newcommand{\Firstname}{
Joe
}%
\newcommand{\Name}{
{\textbf{\Firstname \Surname}}
}% No size here so it's easier to try out multiple sizes
\newcommand{\Description}{
{CEO of XYZ Company}
}% No size here so it's easier to try out multiple sizes
\newcommand{\Email}{
}%
\newcommand{\Phone}{
+44 123456789
}%
\newcommand{\Website}{
http://joedoe.net
}%
\newcommand{\Twitter}{
@JoeDoeTweets
}%
%MeCard command to include in QR Code
\newcommand{\MeCard}{
MECARD:N:\Firstname,\Surname;TEL:\Phone;EMAIL:\Email;URL:\Website;;
}
%Content of the QR Code
\newcommand{\TheQRContent}{
\MeCard
}
%Make actual QR code
\newcommand{\MyQRC}{
\qrcode[nolinks, height=0.3\cardw]{\TheQRContent}
}
\begin{document}
% Example with QR code
\begin{tikzpicture}
% grid
\foreach \i in {0,1,2,3,4,5} \draw[very thin, gray,dashed] (0,\i*\cardh) -- (2*\cardw,\i*\cardh);
\foreach \j in {0,1,2} \draw[very thin, gray,dashed] (\j*\cardw,0) -- (\j*\cardw,5*\cardh);
% card content
\foreach \i in {0,1} \foreach \j in {0,1,2,3,4} {
% Add QR Code to the card
\node at (\i*\cardw+0.2\cardw,\j*\cardh+0.5\cardh){\MyQRC};
% center text
\node[black!25!gray] at (\i*\cardw+0.65\cardw,\j*\cardh+0.75\cardh) {\huge \Name};
\node at (\i*\cardw+0.65\cardw,\j*\cardh+0.55\cardh) {\large \Description};
\node at (\i*\cardw+0.65\cardw,\j*\cardh+0.35\cardh) {\Phone};
\node at (\i*\cardw+0.65\cardw,\j*\cardh+0.2\cardh) {\Email};
};
\end{tikzpicture}
\newpage
% Original ShareLaTeX example with logo
\begin{tikzpicture}
% grid
\foreach \i in {0,1,2,3,4,5} \draw[very thin, gray,dashed] (0,\i*\cardh) -- (2*\cardw,\i*\cardh);
\foreach \j in {0,1,2} \draw[very thin, gray,dashed] (\j*\cardw,0) -- (\j*\cardw,5*\cardh);
% card content
\foreach \i in {0,1} \foreach \j in {0,1,2,3,4} {
% Add logo to the card
\node at (\i*\cardw+0.2\cardw,\j*\cardh+0.5\cardh) {\includegraphics[width=0.2\cardw]{logo}};
% center text
\node[black!25!gray] at (\i*\cardw+0.65\cardw,\j*\cardh+0.75\cardh) {\huge \Name};
\node at (\i*\cardw+0.65\cardw,\j*\cardh+0.55\cardh) {\large \Description};
\node at (\i*\cardw+0.65\cardw,\j*\cardh+0.35\cardh) {\Phone};
\node at (\i*\cardw+0.65\cardw,\j*\cardh+0.2\cardh) {\Email};
% align text left % \node[black!25!gray,right] at (\i*\cardw+0.4\cardw,\j*\cardh+0.75\cardh) {\huge \Name};
% \node[right] at (\i*\cardw+0.4\cardw,\j*\cardh+0.55\cardh) {\large \Description};
% \node[right] at (\i*\cardw+0.4\cardw,\j*\cardh+0.35\cardh) {\Phone};
% \node[right] at (\i*\cardw+0.4\cardw,\j*\cardh+0.2\cardh) {\Email};
};
\end{tikzpicture}
\newpage
% Other example with centred (custom size) Name, QR Code and twitter.
\begin{tikzpicture}
% grid
\foreach \i in {0,1,2,3,4,5} \draw[very thin, gray,dashed] (0,\i*\cardh) -- (2*\cardw,\i*\cardh);
\foreach \j in {0,1,2} \draw[very thin, gray,dashed] (\j*\cardw,0) -- (\j*\cardw,5*\cardh);
% card content
\foreach \i in {0,1} \foreach \j in {0,1,2,3,4} {
% Add QR code to the card
\node at (\i*\cardw+0.23\cardw,\j*\cardh+0.35\cardh){\MyQRC};
% center text for Name and Description
\node at (\i*\cardw+0.50\cardw,\j*\cardh+0.83\cardh) {\fontsize{26pt} \selectfont \Name};
\node at (\i*\cardw+0.50\cardw,\j*\cardh+0.67\cardh) {\fontsize{20pt} \selectfont \Description};
% Aligin text left for other info
\node[right] at (\i*\cardw+0.43\cardw,\j*\cardh+0.50\cardh) {\Email};
\node[right] at (\i*\cardw+0.43\cardw,\j*\cardh+0.40\cardh) {\Website};
\node[right] at (\i*\cardw+0.43\cardw,\j*\cardh+0.30\cardh) {\Phone};
\node[right] at (\i*\cardw+0.43\cardw,\j*\cardh+0.20\cardh) {\Twitter};
};
\end{tikzpicture}
\end{document}