-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.tex
74 lines (63 loc) · 1.91 KB
/
single.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
% ten cards on an 8.5" x 11" page
% works with Avery business card template for print-n-play version
\documentclass{article}
\usepackage[paperwidth=3.25in,paperheight=2in,margin=0pt ]{geometry}
\usepackage{csvsimple}
\usepackage{tikz}
%\usetikzlibrary{positioning,fit,calc}
\usepackage{qrcode}
%\usepackage{showframe}
\usepackage{background}
% level can be "starter" or "levelone"
\newcommand{\level}{starter}
\definecolor{starter_color}{cmyk}{.40,0,.70,0}
\newcommand{\starterpath}{assets/single-\level-background.pdf}
\let\filepath\starterpath
\backgroundsetup{
position=current page.center,
angle=0,
opacity=1,
scale=1,
contents={\includegraphics[height=\paperheight]{\starterpath}}
}%
\begin{filecontents*}{test-phrases.csv}
num, phrase, link
1, I like to drink coffee all night long.,http://www.mightyverse.com
2, Bees have four wings.,
3, I like to eat scrambled eggs for breakfast.,
4, I would like to sit down.,
5, I like to travel.,
6, I play cards.,
7, I am hungry.,
8, This is a book.,
9, The fireworks are beautiful.,
10, I walk to work every day.,
\end{filecontents*}
% don't hyphenate
\tolerance=1
\hyphenpenalty=10000
\hbadness=10000
\setlength{\footskip}{20pt}
\setlength\parindent{0pt}
% lay out elements on the card
% #1 text of the phrase
\newcommand{\card}[2]{
\tikz {
\message {--------> #1 #2 ---}
\node[inner ysep=-.13in,inner xsep=-.14in]{\includegraphics[width=3.74in, height=2.24in]{assets/placeholder.pdf}};
\node[text width=2.6in, draw=none,align=center,font=\large\bf] at (0, .02in) { #1 };
\ifthenelse{\equal{#2}{}}{
% no URL, omit QR code
}{
\node [fill=white] (code) at (1.05in,-.47in) {
\qrcode[hyperlink,height=0.5in] {#2};
};
}
\node [ white, fill=starter_color, rounded corners=4pt, inner sep=4pt, font=\sffamily] (level) at (-1.1in,-.7in){\tiny\uppercase {starter}};
}
}
\begin{document}
\csvreader[
head to column names
]{test-phrases.csv}{}{\card \phrase \link}
\end{document}