Debian Codegraph @

texmf-dist/doc/latex/pst-poker/pst-poker-doc.tex

raw
1 %% $Id: pst-poker-doc.tex 1121 2025-07-08 14:49:15Z herbert $
2 \DocumentMetadata{}
3 \listfiles
4 %
5 \documentclass[11pt,english,BCOR10mm,DIV=12, parskip=false,
6 smallheadings, headexclude, footexclude,oneside]{pst-doc}
7 \listfiles
8 \usepackage{hvlogos,xurl}
9 \usepackage[autostyle]{csquotes}
10
11 \addbibresource{\jobname.bib}
12 \usepackage{pst-poker}
13 \let\belowcaptionskip\abovecaptionskip
14 %
15 \def\textat{\char064}%
16 \newdimen\fullWidth
17 \lstset{explpreset={pos=l,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={}},
18 escapechar=§}
19
20 \def\bgImage{\crdAs}
21
22 \begin{document}
23 \title{\texttt{pst-poker}\\
24 \small v.\fileversion}
25 %\docauthor{Herbert Voß}
26 \author{Herbert Voß}
27 \date{\today}
28
29 \maketitle
30
31 \fullWidth=\linewidth
32 \advance\fullWidth by \marginparsep
33 \advance\fullWidth by \marginparwidth
34
35 \begin{abstract}
36 This document illustrates the possible variations in displaying playing cards
37 available in the \LaTeX\ \LPack{pst-poker} package.
38
39 \LPack{pst-poker} is based on the package \LPack{poker} from Olaf Encke.
40 %(\url{http://web.mit.edu/foley/games/Arcadia/sr/poker/pokersty}).
41 \vfill
42 \noindent
43 Thanks to: \\
44 Karl Berry
45
46 \end{abstract}
47
48 \clearpage
49 \tableofcontents
50
51
52 \clearpage
53
54
55 \section{Ibtroduction}
56
57 \LPack{pst-poker} itself loads the following packages:
58
59 \begin{verbatim}
60 \RequirePackage{pstricks,pst-blur,multido}
61 \RequirePackage{graphicx}
62 \RequirePackage[tiling]{pst-fill}
63 \end{verbatim}
64
65 If you want to pass some optional arguments to one or more of these packages you have
66 to use the macro \Lcs{PassOptionsToPackage} \emph{before} loading \LPack{pst-poker}.
67 The best way is before the document class.
68 For example
69
70 \begin{verbatim}
71 \PassOptionsToPackage{graphicx}{xetex}
72 \documentclass{article}
73 \usepackage{pst-poker}
74 [...]
75 \end{verbatim}
76
77
78
79 \section{Inline Poker symbols}
80
81 There are several possible styles for inline cards. The default way is as small cards, i.e.
82 {\Ac{} \Kh{} \Qd{} \Js{} \tenc}. They can also be displayed as simple symbols
83 {\psset{inline=symbol}\Ac{} \Kh{} \Qd{} \Js{} \tenc} or as boxed symbols {\psset{inline=boxed}\Ac{} \Kh{} \Qd{} \Js{} \tenc}.
84 A card back {\crdback[inline=symbol,backcolor=green]} is available, too.
85
86
87 It is also possible to variate the used colorset. In addition to the standard red/black colors, a
88 four color set {\psset{inline=card,colorset=4c}\Ac\Kh\Qd\Js\tenc} as often used in online
89 poker can be chosen. When colors are not desired, i.e. for printing purposes, the possible
90 alternatives are a grayscale version {\psset{inline=symbol,colorset=gs}\Ac{} \Kh{} \Qd{} \Js{}\tenc} or
91 complete black/white {\psset{inline=boxed,colorset=bw}\Ac{} \Kh{} \Qd{} \Js{} \tenc} with outlined red symbols.
92
93 %\psset{inline=card,colorset=2c}
94 \section{Poker cards}
95
96 The big cards offer a lot of options for design. The default design looks like this.
97 %\psset{cpr=7,framebg=beige}
98 \begin{center}
99 \crdAs
100 \crdtenh
101 \crdsevd
102 \crdsevc
103 \crdQd
104 \end{center}
105
106 The most basic variation is the \textsf{size} set by \Lkeyword{unit}.
107
108 \begin{LTXexample}[pos=t]
109 \crdAs
110 \crdtenh[unit=1.1]
111 \crdsevd[unit=1.2]
112 \crdsevc[unit=1.3]
113 \crdQd[unit=1.4]
114 \end{LTXexample}
115
116 As with the inline cards we can choose the \Lkeyword{colorset}.
117
118
119
120 \begin{LTXexample}[pos=t]
121 \psset{framebg=beige}
122 \crdAs
123 \crdtenh
124 \crdsevd
125 \crdsevc
126 \crdQd\\
127 \psset{colorset=4c}
128 \crdAs
129 \crdtenh
130 \crdsevd
131 \crdsevc
132 \crdQd\\
133 \psset{colorset=gs}
134 \crdAs
135 \crdtenh
136 \crdsevd
137 \crdsevc
138 \crdQd\\
139 \psset{colorset=bw}
140 \crdAs
141 \crdtenh
142 \crdsevd
143 \crdsevc
144 \crdQd
145 \end{LTXexample}
146
147 The \textsf{frame background} can be varied separately by the optional
148 argument \Lkeyword{framebg}, either with predefined colors as shown here
149 or by using a selfdefined color.
150
151 \begin{LTXexample}[pos=t]
152 \psset{colorset=2c}
153 \crdAs[framebg=beige]
154 \crdtenh[framebg=white]
155 \crdsevd[framebg=blue]
156 \crdsevc[framebg=yellow]
157 \crdQc[framebg=red]% not valid for Queen, Jack, King
158 \end{LTXexample}
159
160
161 %\crdQc[framebg=red]
162 %\crdQd[framebg=red]
163 %\crdQh[framebg=red]
164 %\crdQs[framebg=red]
165
166
167
168 It is also possible to place indices in all \textbf{four corners} or use \textbf{peek indices}.
169
170 \begin{LTXexample}[pos=t]
171 \psset{corners=2}\crdAs
172 \psset{corners=4}\crdtenh
173 \psset{peek=right}\crdsevd
174 \psset{peek=both}\crdsevc
175 \psset{corners=2,peek=left}\crdQd
176 \end{LTXexample}
177
178
179 Besides the \textbf{jumbo indices} a \textbf{regular index} can be used. All other options remain available.
180 \psset{index=regular}
181
182 \begin{LTXexample}[pos=t]
183 \psset{corners=2}\crdAs
184 \psset{corners=4,framebg=blue}\crdtenh
185 \psset{peek=right,framebg=beige,colorset=bw}\crdsevd
186 \psset{peek=both,colorset=4c}\crdsevc
187 \psset{corners=2,peek=left,colorset=2c}\crdQd
188 \end{LTXexample}
189
190
191
192
193
194 The \Lkeyword{crdshadow} of the cards can be shown blurred, solid or deactivated.
195
196 \begin{LTXexample}[pos=t]
197 \psset{index=jumbo,corners=2,colorset=4c}
198 \psset{crdshadow=blurred}\crdAs
199 \psset{crdshadow=solid}\crdtenh
200 \psset{crdshadow=solid,colorset=bw}\crdsevd
201 \psset{crdshadow=none,colorset=bw}\crdsevc
202 \psset{crdshadow=none,colorset=4c}\crdQd
203 \end{LTXexample}
204
205
206 \textbf{Card backs} are also available in various styles and customizable in color.
207
208 \begin{LTXexample}[pos=t]
209 {\psset{index=jumbo, colorset=4c, backcolor=red}
210 \crdback[crdshadow=none]
211 \crdback[crdshadow=blurred]
212 \crdback[crdshadow=solid]}
213
214 \psset{crdshadow=blurred,colorset=4c}
215 \crdback[backcolor=blue]
216 \crdback[backcolor=red]
217 \crdback[back=simple, backcolor=green]
218 \crdback[back=simple, backcolor=orange, crdshadow=none]
219
220 \crdback[colorset=2c, back=suits,backcolor=blue]
221 \crdback[colorset=bw, back=suits,backcolor=red]
222 \crdback[back=spades, backcolor=black]
223 \crdback[back=spades, backcolor=orange, crdshadow=blurred]
224 \end{LTXexample}
225 %\psset{back=fournier,backcolor=blue}\crdback
226 %\psset{back=fournier,backcolor=red}\crdback
227
228
229
230
231
232
233
234
235 \section{Usage}
236 To make the poker package available within a \LaTeX\ document you have to add
237 \begin{verbatim}
238 \usepackage{pst-poker}
239 \end{verbatim}
240 to the preamble. Then you can change the options used with the command
241 \begin{verbatim}
242 \psset{option=value[,option=value]}
243 \end{verbatim}
244 anywhere within the document.
245
246 \subsection{Inline cards}
247 To print inline cards you just need to call the macro associated with the card you want.
248 \begin{verbatim}
249 \As\tenh\sevd\sevc\Qd
250 \end{verbatim}
251 creates the cards \As\tenh\sevd\sevc\Qd.
252
253 They are coded by their value and suit. Use this table to select the value
254
255 \small
256 \bigskip
257 \begin{tabular}{c|c|c|c|c|c|c|c|c|c|c|c|c}
258 Ace & King & Queen & Jack & 10 & 9 & 8 & 7 & 6 & 5 & 4 & 3 & 2\\\hline
259 \texttt{A} & \texttt{K} & \texttt{Q} & \texttt{J} & \texttt{ten} & \texttt{nine} & \texttt{eig} & \texttt{sev} & \texttt{six} & \texttt{five} & \texttt{four} & \texttt{tre} & \texttt{two}\\
260 \end{tabular}
261
262 \normalsize
263 and the next to select the letter for the suit:
264
265 \bigskip
266 \begin{tabular}{c|c|c|c}
267 Spade & Heart & Diamond & Club\\\hline
268 \texttt{s} & \texttt{h} & \texttt{d} & \texttt{c}\\
269 \end{tabular}
270
271 You can influence the display of the inline cards with the options \texttt{inline} and \texttt{colorset}.
272
273 \begin{tabular}{lll}
274 Option & Values & Description \\\hline
275 \texttt{inline} & \texttt{symbol} & uses simple symbols to depict cards\\
276 & \texttt{boxed} & draws rounded boxes around the symbols\\
277 & \texttt{card} * & draws simplified cards with value and suit stacked vertically\\\hline
278 \texttt{colorset} & \texttt{2c} * & suits in red and black colors\\
279 & \texttt{4c} & suits in black/red/blue/green colors\\
280 & \texttt{gs} & grayscaled suits\\
281 & \texttt{bw} & black/white and outlined suits\\\hline
282 *: default\\
283 \end{tabular}
284
285
286 \subsubsection{Options}
287 Here we have a lot of options available to change the appearance of the cards. They are explained in table \ref{tab-opts}.
288
289 Since the \texttt{peek} option modifies the \texttt{corners} setting which in turn resets \texttt{peek}, it is advisable to first declare the \texttt{corners} option and then use the \texttt{peek} option if necessary.
290
291 The same applies to the \texttt{framebg} and \texttt{backcolor} options modifying the \texttt{colorset} option.
292
293 \begin{table}[!htb]
294 \centering
295 \caption{Options for cards using the \texttt{cards} environment}\label{tab-opts}
296 \begin{tabular}{lll}
297 Option & Values & Description \\\hline
298 %\texttt{cpr} & \texttt{\#} (*\texttt{7})& specifies the number of cards per row to be displayed \\\hline
299 \texttt{index} & \texttt{jumbo} *& jumbo size indices\\
300 & \texttt{regular} & regular size indices\\\hline
301 \texttt{corners} & \texttt{2} *& indices in upper left and lower right corners\\
302 & \texttt{4} & indices in all four corners\\\hline
303 \texttt{peek} & \texttt{right} & add peek indices to right corners\\
304 & \texttt{left} & add peek indices to left corners\\
305 & \texttt{both} & add peek indices to all corners\\\hline
306 \texttt{colorset} & \texttt{2c} * & suits in red and black colors\\
307 & \texttt{4c} & suits in black/red/blue/green colors\\
308 & \texttt{gs} & grayscaled suits\\
309 & \texttt{bw} & black/white and outlined suits\\\hline
310 \texttt{framebg} & \texttt{beige} *& color choices for inner frame background\\
311 & \texttt{blue} & \\
312 & \texttt{white} & \\
313 & \texttt{yellow} & \\
314 & $<$\texttt{user}$>$ & user defined color\\\hline
315 \texttt{back} & \texttt{simple} *& diamond/squares styled card back\\
316 & \texttt{suits} & suits in ellipse on net background\\
317 & \texttt{spades} & spades filled background\\\hline
318 \texttt{backcolor} & \texttt{blue} *& color choices of main background elements\\
319 & \texttt{red} & \\
320 & \texttt{green} & \\
321 & \texttt{orange} & \\
322 & $<$\texttt{user}$>$ & user defined color\\\hline
323 \texttt{crdshadow} & \texttt{blurred} *& gradient shadow\\
324 & \texttt{solid} & solid black shadow\\
325 & \texttt{none} & no shadow\\\hline
326 *: default\\
327 \end{tabular}
328 \end{table}
329
330 \subsubsection{Advanced constructs}
331 There are several commands available for the advanced placement of cards.
332 \begin{verbatim}
333 \crdpair{\crdKs}{\crdtenh}%
334 \crdflop{\crdsevd}{\crdsevc}{\crdQd}%
335 \crdKc\crdKd%
336 \end{verbatim}
337
338 \begin{center}
339 \crdpair{\crdKs}{\crdtenh}%
340 \crdflop{\crdsevd}{\crdsevc}{\crdQd}%
341 \crdKc\crdKd%
342 \end{center}
343
344 \begin{figure}[!htb]\centering
345 \crdpair{\crdKs}{\crdtenh}%
346 \crdflop{\crdsevd}{\crdsevc}{\crdQd}%
347 \crdKc\crdKd%
348 \caption{card pair, flop and two cards}\label{fig-pair}
349 \end{figure}
350
351 \begin{figure}[!htb]\centering
352 \begin{pspicture}(-4,-1)(4.5,5)
353 \psset{index=regular,crdshadow=none,colorset=4c}
354 \rput[b]{20}(0,0){\crdAs}
355 \rput[b]{10}(0,0){\crdAh}
356 \rput[b]{0}(0,0){\crdAd}
357 \rput[b]{-10}(0,0){\crdAc}
358 \rput[b]{-20}(0,0){\crdKh}
359 \end{pspicture}
360 \begin{pspicture}(-4.5,-1)(4,5)
361 \psset{index=jumbo,crdshadow=none,colorset=2c,framebg=blue}
362 \rput[b]{30}(0,0){\crdAs}
363 \rput[b]{15}(0,0){\crdAh}
364 \rput[b]{0}(0,0){\crdAd}
365 \rput[b]{-15}(0,0){\crdAc}
366 \rput[b]{-30}(0,0){\crdKh}
367 \end{pspicture}
368 \caption{Advanced display variations for floating cards}
369 \end{figure}
370
371 \newpage
372
373
374 %\minisec{Card Overview}
375 \begin{center}
376 \psset{colorset=2c,framebg=beige,corners=2,peek=right,crdshadow=blurred}
377 \crdAs
378 \crdKs
379 \crdQs
380 \crdJs
381 \crdtens
382 \crdnines
383 \crdeigs\\
384 \crdsevs
385 \crdsixs
386 \crdfives
387 \crdfours
388 \crdtres
389 \crdtwos\\
390 \crdAh
391 \crdKh
392 \crdQh
393 \crdJh
394 \crdtenh
395 \crdnineh
396 \crdeigh\\
397 \crdsevh
398 \crdsixh
399 \crdfiveh
400 \crdfourh
401 \crdtreh
402 \crdtwoh\\
403 \crdAd
404 \crdKd
405 \crdQd
406 \crdJd
407 \crdtend
408 \crdnined
409 \crdeigd\\
410 \crdsevd
411 \crdsixd
412 \crdfived
413 \crdfourd
414 \crdtred
415 \crdtwod\\
416 \crdAc
417 \crdKc
418 \crdQc
419 \crdJc
420 \crdtenc
421 \crdninec
422 \crdeigc\\
423 \crdsevc
424 \crdsixc
425 \crdfivec
426 \crdfourc
427 \crdtrec
428 \crdtwoc
429 \end{center}
430
431
432
433 %\clearpage
434 \begin{center}
435 \crdJs[unit=5cm,colorset=2c,corners=4,peek=right]
436
437
438 \verb|\crdJs[unit=5cm,colorset=2c,corners=4,peek=right]|
439
440 \end{center}
441
442 \clearpage
443
444 \section{List of all optional arguments for \texttt{pst-poker}}
445
446 \xkvview{family=pst-poker,columns={key,type,default}}
447
448
449 \nocite{*}
450 \bgroup
451 \RaggedRight
452 \printbibliography[heading=bibintoc]
453 \egroup
454
455 \printindex
456
457
458 \end{document}