Debian Codegraph @

texmf-dist/doc/latex/trivialpursuit/TrivialPursuit-doc-en.tex

raw
1 % !TeX TXS-program:compile = txs:///pdflatex
2
3 \documentclass[11pt,a4paper]{ltxdoc}
4 \usepackage{TrivialPursuit}
5 \usepackage{fancyvrb}
6 \usepackage{fancyhdr}
7 \fancyhf{}
8 \renewcommand{\headrulewidth}{0pt}
9 \lfoot{\sffamily\small [TrivialPursuit]}
10 \cfoot{\sffamily\small - \thepage{} -}
11 \rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}}
12 \usepackage{hologo}
13 \providecommand\tikzlogo{Ti\textit{k}Z}
14 \providecommand\TeXLive{\TeX{}Live\xspace}
15 \providecommand\PSTricks{\textsf{PSTricks}\xspace}
16 \let\pstricks\PSTricks
17 \let\TikZ\tikzlogo
18
19 \usepackage{hyperref}
20 \urlstyle{same}
21 \hypersetup{pdfborder=0 0 0}
22 \usepackage[margin=2cm]{geometry}
23 \setlength{\parindent}{0pt}
24 \def\TPversion{0.1.7}
25 \def\TPdate{25/08/2025}
26 \usepackage{tcolorbox}
27 \tcbuselibrary{skins,hooks,listingsutf8}
28 \usepackage{soul}
29 \usepackage{openmoji}
30 \sethlcolor{lightgray!25}
31 \NewDocumentCommand\MontreCode{ m }{%
32 \hl{\vphantom{\texttt{pf}}\texttt{#1}}%
33 }
34
35 \begin{document}
36
37 \pagestyle{fancy}
38
39 \thispagestyle{empty}
40
41 \begin{center}
42 \begin{minipage}{0.88\linewidth}
43 \begin{tcolorbox}[colframe=yellow,colback=yellow!15]
44 \begin{center}
45 \begin{tabular}{c}
46 {\Huge \texttt{TrivialPursuit [en]}}\\
47 \\
48 {\LARGE Create a '\textit{Trivial Pursuit}' board,} \\
49 {\LARGE with customization.} \\
50 \\
51 {\small \texttt{Version \TPversion{} -- \TPdate}}
52 \end{tabular}
53 \end{center}
54 \end{tcolorbox}
55 \end{minipage}
56 \end{center}
57
58 \begin{center}
59 \begin{tabular}{c}
60 \texttt{Cédric Pierquet}\\
61 {\ttfamily c pierquet -- at -- outlook . fr}\\
62 \texttt{\url{https://github.com/cpierquet/latex-packages/tree/main/trivialpursuit}} \\
63 \\
64 \texttt{Trivial Pursuit\texttrademark, is a trademark of Hasbro.}
65 \end{tabular}
66 \end{center}
67
68 \hrule
69
70 \vfill
71
72 \begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
73 \BoardTrivialPursuit
74 \end{tcolorbox}
75
76 \vfill~
77
78 \pagebreak
79
80 \phantomsection
81
82 \hypertarget{matoc}{}
83
84 \tableofcontents
85
86 \vspace*{5mm}
87
88 \hrule
89
90 \vspace*{5mm}
91
92 \section{Introduction}
93
94 \subsection{Description}
95
96 This package provides a command to display a \textsf{Trivial Pursuit} (trademark of Hasbro) board, with some customization:
97
98 \begin{itemize}
99 \item of lengths (radius + height cells);
100 \item of colors;
101 \item of logos (with \MontreCode{fontawesome}).
102 \end{itemize}
103
104 Cells and colors are globally fixed, are came from an original board.
105
106 \medskip
107
108 For the moment, limitations are:
109
110 \begin{itemize}
111 \item number of categories (6);
112 \item logos, given by a character, eg from package \MontreCode{fontawesome}.
113 \end{itemize}
114
115 \subsection{Loading}
116
117 To load the package, simply add in the preamble:
118
119 \begin{quote}
120 \begin{verbatim}
121 \usepackage{TrivialPursuit} %with fa5, default
122 \usepackage[fa6]{TrivialPursuit} %with fa6 (test)
123 \usepackage[fa7]{TrivialPursuit} %with fa7 (test)
124 \usepackage[nofa]{TrivialPursuit} %w/o fa (test), loading manually
125 \end{verbatim}
126 \end{quote}
127
128 Loaded are useful package are:
129
130 \begin{itemize}
131 \item \MontreCode{tikz} with libraries \MontreCode{calc,positioning};
132 \item \MontreCode{calc} and \MontreCode{fontawesome5};
133 \item \MontreCode{simplekv}; \MontreCode{xintexpr} and \MontreCode{listofitems}.
134 \end{itemize}
135
136 \pagebreak
137
138 \section{History}
139
140 \begin{quote}
141 \begin{verbatim}
142 0.1.7: Cards
143 0.1.6: Bugfix + pre-compatibility with fa7
144 0.1.5: Bugfix (compatibility with twemoji)
145 0.1.4: Bugfix + pre-compatibility with fa6
146 0.1.2: Key [ShortVersion] in order to reduce number of border cells
147 0.1.1: Adding two schemes of colors
148 0.1.0: Initial version
149 \end{verbatim}
150 \end{quote}
151
152 \pagebreak
153
154 \section{The board macro}
155
156 \subsection{General usage}
157
158 The code draw the board, with optional logos.
159
160 All the available keys are presented in the following paragraph, but concerning the dimensions, \textit{general} are proposed by default, but it is however possible to modify them:
161
162 \begin{itemize}
163 \item either explicitly by the keys \MontreCode{[Radius=]} and \MontreCode{[BorderHeight=]};
164 \item or by specifying a particular unit using the \MontreCode{[Unit=]} key, in which case the general shape of the board will be preserved !
165 \end{itemize}
166
167 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
168 \BoardTrivialPursuit[Unit=0.5]
169 %
170 \BoardTrivialPursuit[Radius=4,BorderHeight=1.25] %beware of the rendering...
171
172 \BoardTrivialPursuit[Unit=0.33]
173 %
174 \BoardTrivialPursuit[Unit=0.33,ShortVersion]
175 \end{tcblisting}
176
177 \pagebreak
178
179 \subsection{Keys and options}
180
181 Available \textsf{keys} are:
182
183 \begin{itemize}
184 \item \MontreCode{Radius}:= radius of the board (in unit), and \MontreCode{8} by default;
185 \item \MontreCode{BorderHeight}:= height of ext cells, and \MontreCode{1.5} by default;
186 \item \MontreCode{ListColors}:= colors of the categories,
187
188 \hfill{}and \MontreCode{yellow,orange,blue,brown,green,pink} by default;
189 \item \MontreCode{ListIcons}:= icons of categories,
190
191 \hfill\MontreCode{\textbackslash faArchway,\textbackslash faTableTennis,\textbackslash faUmbrellaBeach,\textbackslash faGuitar,\textbackslash faTree,\textbackslash faMusic} by default;
192 \item \MontreCode{Icons}:= boolean for display icons, and \MontreCode{true} by default;
193 \item \MontreCode{Center}:= boolean for filling central hexagon, and \MontreCode{true} by default;
194 \item \MontreCode{ColorCenter}:= color of central hexagon, and \MontreCode{lightgray!25} by default;
195 \item \MontreCode{Colors}:= boolean fot printing colors, and \MontreCode{true} by default;
196 \item \MontreCode{Logo}:= boolean for displaying logo at the center, and \MontreCode{true} by default;
197 \item \MontreCode{Jokers}:= boolean for printing jokers, and \MontreCode{true} by default;
198 \item \MontreCode{IconJoker}:= icon for joker, and \MontreCode{\textbackslash faDice} by default;
199 \item \MontreCode{Blank}:= boolean for an empty board, and \MontreCode{false} by default;
200 \item \MontreCode{Unit}:= to precis an unit (better than a scale !), and \MontreCode{1} by default;
201 \item \MontreCode{Thickness}:= thickness of the borders, and \MontreCode{0.8pt} by default;
202 \item \MontreCode{Rotation}:= possible rotation of the board, and \MontreCode{0} by default;
203 \item \MontreCode{ShortVersion}:= use 5 cells instead 6 between 'big cells', and \MontreCode{false} by default.
204 \end{itemize}
205
206 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
207 \BoardTrivialPursuit[Rotation=35,Unit=0.5]
208 \BoardTrivialPursuit[Unit=0.5]
209 \end{tcblisting}
210
211 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
212 \BoardTrivialPursuit[Unit=0.5,Icons=false]
213 \BoardTrivialPursuit[Unit=0.5,Colors=false]
214 \end{tcblisting}
215
216 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
217 \BoardTrivialPursuit[Unit=0.5,Blank]
218 \BoardTrivialPursuit[Unit=0.5,Logo=false,Center=false,IconJoker=\faAward]
219 \end{tcblisting}
220
221 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
222 \BoardTrivialPursuit[%
223 Jokers=false,%
224 ListColors={%
225 blue!25,red!25,teal!25,orange!25,gray!50,violet!25},%
226 ListIcons={
227 \faAddressCard,\faAngleDoubleRight,\faAngry[regular],%
228 \faAtom,\faBalanceScaleLeft,\faBell}
229 ]
230 \end{tcblisting}
231
232 \pagebreak
233
234 \subsection{Schemes of colors, predefined fa icons}
235
236 In addition (on a suggestion from \textsf{quark67}), two color styles have been defined internally:
237
238 \begin{quote}
239 \begin{verbatim}
240 \TPColorsA
241 \TPColorsB
242 \end{verbatim}
243 \end{quote}
244
245 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
246 \BoardTrivialPursuit[Unit=0.5,ListColors=\TPColorsA]
247 \BoardTrivialPursuit[Unit=0.5,ListColors=\TPColorsB]
248 \end{tcblisting}
249
250 \begin{quote}
251 \begin{verbatim}
252 \categtrivialpursuit
253 \end{verbatim}
254 \end{quote}
255
256 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
257 \BoardTrivialPursuit%
258 [ListIcons=\categtrivialpursuit,ListColors=\TPColorsB,IconJoker=\faDice]
259 \end{tcblisting}
260
261 \section{The card macros}
262
263 \subsection{Global usage}
264
265 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
266 \CardTrivialRecto{Q1}{Q2}{Q3}{Q4}{Q5}{Q6}{10}
267
268 \CardTrivialVerso{A1}{A2}{A3}{A4}{A5}{A6}{256}
269
270 \CardTrivialVerso[scale=-0.5,rotate=15]{A1}{A2}{A3}{A4}{A5}{A6}{256}
271 \end{tcblisting}
272
273 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only}
274 \CardTrivialRecto%
275 [tikzpicture options]%
276 {Q1}{Q2}{Q3}{Q4}{Q5}{Q6}%
277 {card number}
278
279 \CardTrivialVerso%
280 [tikzpicture options]%
281 {A1}{A2}{A3}{A4}{A5}{A6}%
282 {card number}
283 \end{tcblisting}
284
285 \subsection{Customization macro}
286
287
288 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only}
289 \SetParamsCardTrivial{%
290 QA font=..., %font of Q/A
291 nb font=..., %font of number
292 label font=..., %font of categories
293 categ=..., %labels of categories
294 border deco color=...,
295 alt deco color=...,
296 color categ A=...,
297 color categ B=...,
298 color categ C=...,
299 color categ D=...,
300 color categ E=...,
301 color categ F=...,
302 alt deco=TF
303 }
304 \end{tcblisting}
305
306 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only}
307 %logo verso
308 \def\intlogocardversotrivial{%
309 \draw[white] (CARD-LOGO) node[rotate=90,text width=3.75cm,font=\Huge\sffamily,align=left] {{\TeX} \\\hfill{\itshape Pursuit}} ;
310 }
311 \end{tcblisting}
312
313 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only}
314 %logo recto (bg)
315 \def\intlogocardrectotrivial{}
316 \end{tcblisting}
317
318 \subsection{Example}
319
320 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only}
321 %\usepackage{openmoji}
322
323 \SetParamsCardTrivial{%
324 border deco color=teal,
325 alt deco color=orange,
326 QA font={\sffamily\fontsize{8pt}{10pt}\selectfont},%
327 label font={\bfseries},
328 categ={No,H,Ma,Oo,A,G}
329 }
330 \def\intlogocardversotrivial{%
331 \draw (CARD-LOGO) node[rotate=90]
332 {\openmoji[height=2.25cm]{game die}\openmoji[height=2.25cm]{glowing star}} ;
333 }
334 \def\intlogocardrectotrivial{%
335 \draw (CARD-LOGO) node[opacity=0.05]
336 {\openmoji[height=4.25cm]{green apple}} ;
337 }
338 \end{tcblisting}
339
340 \SetParamsCardTrivial{%
341 border deco color=teal,
342 alt deco color=orange,
343 QA font={\sffamily\fontsize{8pt}{10pt}\selectfont},%
344 label font={\bfseries},
345 categ={No,H,Ma,Oo,A,G}
346 }
347 \def\intlogocardversotrivial{%
348 \draw (CARD-LOGO) node[rotate=90]
349 {\openmoji[height=2.25cm]{game die}\openmoji[height=2.25cm]{glowing star}} ;
350 }
351 \def\intlogocardrectotrivial{%
352 \draw (CARD-LOGO) node[opacity=0.05]
353 {\openmoji[height=4.25cm]{green apple}} ;
354 }
355 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
356 \CardTrivialRecto{Q1}{Q2}{Q3}{Q4}{Q5}{Q6}{12}
357
358 \CardTrivialVerso[scale=-1]{A1}{A2}{A3}{A4}{A5}{A6}{12}
359 \end{tcblisting}
360
361 \end{document}