-
Notifications
You must be signed in to change notification settings - Fork 2
/
dnddetailssheet.sty
186 lines (176 loc) · 6.33 KB
/
dnddetailssheet.sty
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{dnddetailssheet}[2019/03/04 D&D Details Sheet]
\RequirePackage{pdfpages}
\RequirePackage{tikz}
\RequirePackage{amsmath}
\RequirePackage{array}
\RequirePackage[most]{tcolorbox}
\RequirePackage{setspace}
\RequirePackage{xkeyval}
\RequirePackage{ifthen}
\RequirePackage{xparse}
\DeclareOptionX{base}{\def\detailspdf{#1}}
\ProcessOptionsX\relax
\define@key[DndDetails]{Base}{Character}{\setkeys[DndDetails]{Character}{#1}}
\define@key[DndDetails]{Character}{Age}{\def\@DndDetails@Character@Age{#1}}
\define@key[DndDetails]{Character}{Height}{\def\@DndDetails@Character@Height{#1}}
\define@key[DndDetails]{Character}{Weight}{\def\@DndDetails@Character@Weight{#1}}
\define@key[DndDetails]{Character}{Eyes}{\def\@DndDetails@Character@Eyes{#1}}
\define@key[DndDetails]{Character}{Skin}{\def\@DndDetails@Character@Skin{#1}}
\define@key[DndDetails]{Character}{Hair}{\def\@DndDetails@Character@Hair{#1}}
\define@key[DndDetails]{Base}{Appearance}{\def\@DndDetails@Base@Appearance{#1}}
\define@key[DndDetails]{Base}{Backstory}{\def\@DndDetails@Base@Backstory{#1}}
\define@key[DndDetails]{Base}{Allies}{\setkeys[DndDetails]{Allies}{#1}}
\define@key[DndDetails]{Allies}{Orga}{\def\@DndDetails@Allies@Orga{#1}}
\define@key[DndDetails]{Allies}{Symbol}{\def\@DndDetails@Allies@Symbol{#1}}
\define@key[DndDetails]{Allies}{Left}{\def\@DndDetails@Allies@Left{#1}}
\define@key[DndDetails]{Allies}{Right}{\def\@DndDetails@Allies@Right{#1}}
\define@key[DndDetails]{Base}{Traits}{\setkeys[DndDetails]{Traits}{#1}}
\define@key[DndDetails]{Traits}{Left}{\def\@DndDetails@Traits@Left{#1}}
\define@key[DndDetails]{Traits}{Right}{\def\@DndDetails@Traits@Right{#1}}
\define@key[DndDetails]{Base}{Treasure}{\setkeys[DndDetails]{Treasure}{#1}}
\define@key[DndDetails]{Treasure}{Left}{\def\@DndDetails@Treasure@Left{#1}}
\define@key[DndDetails]{Treasure}{Right}{\def\@DndDetails@Treasure@Right{#1}}
\newcommand\DndDetailsSheet[1]{
\setkeys[DndDetails]{Base}{#1}
\includepdf[pages=1, pagecommand={\ifthispageodd{
\begin{tikzpicture}[remember picture, overlay,x=1cm,y=1cm,shift={(1.31,0)}]
} {
\begin{tikzpicture}[remember picture, overlay,x=1cm,y=1cm,shift={(-1.31,0)}]
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Character Details
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Character Name
\ifdefined\@DndBase@Character@Name
\node[draw=none,rectangle,text width=5.7 cm,align=center] at (0.3,0.3) {\huge \@DndBase@Character@Name};
\fi
% Age
\ifdefined\@DndDetails@Character@Age
\node[draw=none,rectangle,text width=3.5 cm] at (6.6, 0.7) {\@DndDetails@Character@Age};
\fi
% Height
\ifdefined\@DndDetails@Character@Height
\node[draw=none,rectangle,text width=3.0 cm] at (10.2, 0.7) {\@DndDetails@Character@Height};
\fi
% Weight
\ifdefined\@DndDetails@Character@Weight
\node[draw=none,rectangle,text width=3.0 cm] at (13.6, 0.7) {\@DndDetails@Character@Weight}; %(13.7, 0.8)
\fi
% Eyes
\ifdefined\@DndDetails@Character@Eyes
\node[draw=none,rectangle,text width=3.5 cm] at (6.6,-0.2) {\@DndDetails@Character@Eyes};
\fi
% Skin
\ifdefined\@DndDetails@Character@Skin
\node[draw=none,rectangle,text width=3.0 cm] at (10.2,-0.2) {\@DndDetails@Character@Skin};
\fi
% Hair
\ifdefined\@DndDetails@Character@Hair
\node[draw=none,rectangle,text width=3.0 cm] at (13.6,-0.2) {\@DndDetails@Character@Hair};
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Character Appearance
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% TODO: add picture mode
% Text
\ifdefined\@DndDetails@Base@Appearance
\node[draw=none,rectangle,text width=5.7 cm,align=left] at (-0.3,-3.97) {%
\setstretch{0.975}\small
\parbox[][4.4 cm][t]{5.7 cm}{\@DndDetails@Base@Appearance}
};
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Character Backstory
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\ifdefined\@DndDetails@Base@Backstory
\node[draw=none,rectangle,text width=5.7 cm,align=left] at (-0.3,-12.64) {%
\setstretch{0.975}\small
\parbox[][4.4 cm][t]{5.7 cm}{\@DndDetails@Base@Backstory}
};
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Allies & Organizations
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Organization Name
\ifdefined\@DndDetails@Allies@Orga
\node[draw=none,rectangle,text width=3.5 cm] at (12,-2.83) {\centering\@DndDetails@Allies@Orga};
\fi
% Symbol
\ifdefined\@DndDetails@Allies@Symbol
\node[draw=none,rectangle,text width=3.5 cm] at (12,-4.9) {\includegraphics[height=3.5cm]{\@DndDetails@Allies@Symbol}};
\fi
% Left
\ifdefined\@DndDetails@Allies@Left
\node[draw=none,rectangle,text width=5.9 cm,align=left] at (6.25,-3.67) {%
\setstretch{0.975}\small
\parbox[][3.9 cm][t]{5.9 cm}{\@DndDetails@Allies@Left}
};
\fi
% Right
\ifdefined\@DndDetails@Allies@Right
\node[draw=none,rectangle,text width=5.9 cm,align=left] at (12.65,-9.75) {%
\setstretch{0.975}\small
\parbox[][3.9 cm][t]{5.9 cm}{\@DndDetails@Allies@Right}
};
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Additional Features & Traits
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Left
\ifdefined\@DndDetails@Traits@Left
\node[draw=none,rectangle,text width=5.9 cm,align=left] at (6.25,-12.02) {%
\setstretch{0.975}\small
\parbox[][3.9 cm][t]{5.9 cm}{\@DndDetails@Traits@Left}
};
\fi
% Right
\ifdefined\@DndDetails@Traits@Right
\node[draw=none,rectangle,text width=5.9 cm,align=left] at (12.65,-12.02) {%
\setstretch{0.975}\small
\parbox[][3.9 cm][t]{5.9 cm}{\@DndDetails@Traits@Right}
};
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Treasure
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Left
\ifdefined\@DndDetails@Treasure@Left
\node[draw=none,rectangle,text width=5.9 cm,align=left] at (6.25,-19.94) {%
\setstretch{0.975}\small
\parbox[][3.9 cm][t]{5.9 cm}{\@DndDetails@Treasure@Left}
};
\fi
% Right
\ifdefined\@DndDetails@Treasure@Right
\node[draw=none,rectangle,text width=5.9 cm,align=left] at (12.65,-19.94) {%
\setstretch{0.975}\small
\parbox[][3.9 cm][t]{5.9 cm}{\@DndDetails@Treasure@Right}
};
\fi
%
\end{tikzpicture}}]{\detailspdf}
}