summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pst-poker/pst-poker-doc.tex
blob: 6d0d11e267ef3f713b54148d96545efae94ad412 (plain)
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
%% $Id: pst-poker-doc.tex 792 2018-08-03 19:20:08Z herbert $
%
\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings,
    headexclude,footexclude,oneside]{pst-doc}
\listfiles
\usepackage{dtk-logos}
\usepackage[autostyle]{csquotes}
\usepackage{biblatex}
\addbibresource{\jobname.bib}
\usepackage[utf8]{inputenc}
\usepackage{pst-poker}
\let\belowcaptionskip\abovecaptionskip
%
\def\textat{\char064}%
\newdimen\fullWidth
\lstset{explpreset={pos=l,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={}},
    escapechar=§}

\def\bgImage{\crdAs}


\begin{document}
\title{\texttt{pst-poker}\\
    \small v.\fileversion}
%\docauthor{Herbert Vo\ss}
\author{Herbert Voß}
\date{\today}

\maketitle

\fullWidth=\linewidth
\advance\fullWidth by \marginparsep
\advance\fullWidth by \marginparwidth


\begin{abstract}
This document illustrates the possible variations in displaying playing cards 
available in the \LaTeX\ \LPack{pst-poker} package.

\LPack{pst-poker} is based on the package \LPack{poker} from Olaf Encke 
(\url{http://web.mit.edu/foley/games/Arcadia/sr/poker/pokersty}).
\vfill
\noindent
Thanks to:  \\
Karl Berry

\end{abstract}

\clearpage
\tableofcontents


\clearpage


\section{Ibtroduction}

\LPack{pst-poker} itself loads the following packages:

\begin{verbatim}
\RequirePackage{pstricks,pst-blur,multido}
\RequirePackage{graphicx}
\RequirePackage[tiling]{pst-fill}
\end{verbatim}

If you want to pass some optional arguments to one or more of these packages you have
to use the macro \Lcs{PassOptionsToPackage} \emph{before} loading \LPack{pst-poker}.
The best way is before the document class.
 For example

\begin{verbatim}
\PassOptionsToPackage{graphicx}{xetex}
\documentclass{article}
\usepackage{pst-poker}
[...]
\end{verbatim}



\section{Inline Poker symbols}

There are several possible styles for inline cards. The default way is as small cards, i.e. 
{\Ac{} \Kh{} \Qd{} \Js{} \tenc}. They can also be displayed as simple symbols 
{\psset{inline=symbol}\Ac{} \Kh{} \Qd{} \Js{} \tenc} or as boxed symbols {\psset{inline=boxed}\Ac{} \Kh{} \Qd{} \Js{} \tenc}. 
A card back {\crdback[inline=symbol,backcolor=green]} is available, too.


It is also possible to variate the used colorset. In addition to the standard red/black colors, a 
four color set {\psset{inline=card,colorset=4c}\Ac\Kh\Qd\Js\tenc} as often used in online 
poker can be chosen. When colors are not desired, i.e. for printing purposes, the possible 
alternatives are a grayscale version {\psset{inline=symbol,colorset=gs}\Ac{} \Kh{} \Qd{} \Js{}\tenc} or 
complete black/white {\psset{inline=boxed,colorset=bw}\Ac{} \Kh{} \Qd{} \Js{} \tenc} with outlined red symbols.

%\psset{inline=card,colorset=2c}
\section{Poker cards}

The big cards offer a lot of options for design. The default design looks like this.
%\psset{cpr=7,framebg=beige}
\begin{center}
\crdAs
\crdtenh
\crdsevd
\crdsevc
\crdQd
\end{center}

The most basic variation is the \textsf{size} set by \Lkeyword{unit}.

\begin{LTXexample}[pos=t]
\crdAs
\psset{unit=1.1}
\crdtenh
\psset{unit=1.2}
\crdsevd
\psset{unit=1.3}
\crdsevc
\psset{unit=1.4}
\crdQd
\end{LTXexample}

As with the inline cards we can choose the \Lkeyword{colorset}.

\begin{LTXexample}[pos=t]
\psset{framebg=beige}
\crdAs
\crdtenh
\crdsevd
\crdsevc
\crdQd\\
\psset{colorset=4c}
\crdAs
\crdtenh
\crdsevd
\crdsevc
\crdQd\\
\psset{colorset=gs}
\crdAs
\crdtenh
\crdsevd
\crdsevc
\crdQd\\
\psset{colorset=bw}
\crdAs
\crdtenh
\crdsevd
\crdsevc
\crdQd
\end{LTXexample}

The \textsf{frame background} can be varied separately by the optional
argument \Lkeyword{framebg}, either with predefined colors as shown here or by using a selfdefined color.

\begin{LTXexample}[pos=t]
\psset{colorset=2c}
\psset{framebg=beige}\crdAs
\psset{framebg=white}\crdtenh
\psset{framebg=blue}\crdsevd
\psset{framebg=yellow}\crdsevc
\psset{framebg=beige}\crdQd
\end{LTXexample}

It is also possible to place indices in all \textbf{four corners} or use \textbf{peek indices}.

\begin{LTXexample}[pos=t]
\psset{corners=2}\crdAs
\psset{corners=4}\crdtenh
\psset{peek=right}\crdsevd
\psset{peek=both}\crdsevc
\psset{corners=2,peek=left}\crdQd
\end{LTXexample}


Besides the \textbf{jumbo indices} a \textbf{regular index} can be used. All other options remain available.
\psset{index=regular}

\begin{LTXexample}[pos=t]
\psset{corners=2}\crdAs
\psset{corners=4,framebg=blue}\crdtenh
\psset{peek=right,framebg=beige,colorset=bw}\crdsevd
\psset{peek=both,colorset=4c}\crdsevc
\psset{corners=2,peek=left,colorset=2c}\crdQd
\end{LTXexample}


The \Lkeyword{crdshadow} of the cards can be shown blurred, solid or deactivated.

\begin{LTXexample}[pos=t]
\psset{index=jumbo,corners=2,colorset=4c}
\psset{crdshadow=blurred}\crdAs
\psset{crdshadow=solid}\crdtenh
\psset{crdshadow=solid,colorset=bw}\crdsevd
\psset{crdshadow=none,colorset=bw}\crdsevc
\psset{crdshadow=none,colorset=4c}\crdQd
\end{LTXexample}


\textbf{Card backs} are also available in various styles and customizable in color.

\begin{LTXexample}[pos=t]
\psset{crdshadow=blurred,colorset=4c}
\psset{backcolor=blue}\crdback
\psset{backcolor=red}\crdback
\psset{back=simple,backcolor=green}\crdback
\psset{back=simple,backcolor=orange}\crdback\\
\psset{colorset=2c,back=suits,backcolor=blue}\crdback
\psset{colorset=bw,back=suits,backcolor=red}\crdback
\psset{back=spades,backcolor=black}\crdback
\psset{back=spades,backcolor=orange}\crdback\\
\end{LTXexample}
%\psset{back=fournier,backcolor=blue}\crdback
%\psset{back=fournier,backcolor=red}\crdback


\newpage
\section{Usage}
To make the poker package available within a \LaTeX\ document you have to add
\begin{verbatim}
 \usepackage{poker}
\end{verbatim}
to the preamble. Then you can change the options used with the command
\begin{verbatim}
 \psset{option=value[,option=value]}
\end{verbatim}
anywhere within the document.

\subsection{Inline cards}
To print inline cards you just need to call the macro associated with the card you want.
\begin{verbatim}
 \As\tenh\sevd\sevc\Qd
\end{verbatim}
creates the cards \As\tenh\sevd\sevc\Qd.

They are coded by their value and suit. Use this table to select the value

\small
\bigskip
\begin{tabular}{c|c|c|c|c|c|c|c|c|c|c|c|c}
Ace & King & Queen & Jack & 10 & 9 & 8 & 7 & 6 & 5 & 4 & 3 & 2\\\hline
\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}\\
\end{tabular}

\normalsize
and the next to select the letter for the suit:

\bigskip
\begin{tabular}{c|c|c|c}
Spade & Heart & Diamond & Club\\\hline
\texttt{s} & \texttt{h} & \texttt{d} & \texttt{c}\\
\end{tabular}

You can influence the display of the inline cards with the options \texttt{inline} and \texttt{colorset}.

\begin{tabular}{lll}
 Option & Values & Description \\\hline
\texttt{inline} & \texttt{symbol} & uses simple symbols to depict cards\\
& \texttt{boxed} & draws rounded boxes around the symbols\\
& \texttt{card} * & draws simplified cards with value and suit stacked vertically\\\hline
\texttt{colorset} & \texttt{2c} * & suits in red and black colors\\
& \texttt{4c} & suits in black/red/blue/green colors\\
& \texttt{gs} & grayscaled suits\\
& \texttt{bw} & black/white and outlined suits\\\hline
*: default\\
\end{tabular}


\subsubsection{Options}
Here we have a lot of options available to change the appearance of the cards. They are explained in table \ref{tab-opts}.

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.

The same applies to the \texttt{framebg} and \texttt{backcolor} options modifying the \texttt{colorset} option.

\begin{table}[!htb]
\centering
\caption{Options for cards using the \texttt{cards} environment}\label{tab-opts}
\begin{tabular}{lll}
 Option & Values & Description \\\hline
%\texttt{cpr} & \texttt{\#} (*\texttt{7})& specifies the number of cards per row to be displayed \\\hline
\texttt{index} & \texttt{jumbo} *& jumbo size indices\\
& \texttt{regular} & regular size indices\\\hline
\texttt{corners} & \texttt{2} *& indices in upper left and lower right corners\\
& \texttt{4} & indices in all four corners\\\hline
\texttt{peek} & \texttt{right} & add peek indices to right corners\\
& \texttt{left} & add peek indices to left corners\\
& \texttt{both} & add peek indices to all corners\\\hline
\texttt{colorset} & \texttt{2c} * & suits in red and black colors\\
& \texttt{4c} & suits in black/red/blue/green colors\\
& \texttt{gs} & grayscaled suits\\
& \texttt{bw} & black/white and outlined suits\\\hline
\texttt{framebg} & \texttt{beige} *& color choices for inner frame background\\
& \texttt{blue} & \\
& \texttt{white} & \\
& \texttt{yellow} & \\
& $<$\texttt{user}$>$ & user defined color\\\hline
\texttt{back} & \texttt{simple} *& diamond/squares styled card back\\
& \texttt{suits} & suits in ellipse on net background\\
& \texttt{spades} & spades filled background\\\hline
\texttt{backcolor} & \texttt{blue} *& color choices of main background elements\\
& \texttt{red} & \\
& \texttt{green} & \\
& \texttt{orange} & \\
& $<$\texttt{user}$>$ & user defined color\\\hline
\texttt{crdshadow} & \texttt{blurred} *& gradient shadow\\
& \texttt{solid} & solid black shadow\\
& \texttt{none} & no shadow\\\hline
*: default\\
\end{tabular}
\end{table}

\subsubsection{Advanced constructs}
There are several commands available for the advanced placement of cards.
\begin{verbatim}
  \crdpair{\crdKs}{\crdtenh}%
  \crdflop{\crdsevd}{\crdsevc}{\crdQd}%
  \crdKc\crdKd%
\end{verbatim}

\begin{center}
  \crdpair{\crdKs}{\crdtenh}%
  \crdflop{\crdsevd}{\crdsevc}{\crdQd}%
  \crdKc\crdKd%
\end{center}

\begin{figure}[!htb]\centering
\crdpair{\crdKs}{\crdtenh}%
\crdflop{\crdsevd}{\crdsevc}{\crdQd}%
\crdKc\crdKd%
\caption{card pair, flop and two cards}\label{fig-pair}
\end{figure}

\begin{figure}[!htb]\centering
\begin{pspicture}(-4,-1)(4.5,5)
\psset{index=regular,crdshadow=none,colorset=4c}
\rput[b]{20}(0,0){\crdAs}
\rput[b]{10}(0,0){\crdAh}
\rput[b]{0}(0,0){\crdAd}
\rput[b]{-10}(0,0){\crdAc}
\rput[b]{-20}(0,0){\crdKh}
\end{pspicture}
\begin{pspicture}(-4.5,-1)(4,5)
\psset{index=jumbo,crdshadow=none,colorset=2c,framebg=blue}
\rput[b]{30}(0,0){\crdAs}
\rput[b]{15}(0,0){\crdAh}
\rput[b]{0}(0,0){\crdAd}
\rput[b]{-15}(0,0){\crdAc}
\rput[b]{-30}(0,0){\crdKh}
\end{pspicture}
\caption{Advanced display variations for floating cards}
\end{figure}

\newpage


%\minisec{Card Overview}
\begin{center}
\psset{colorset=2c,framebg=beige,corners=2,peek=right,crdshadow=blurred}
\crdAs
\crdKs
\crdQs
\crdJs
\crdtens
\crdnines
\crdeigs\\
\crdsevs
\crdsixs
\crdfives
\crdfours
\crdtres
\crdtwos\\
\crdAh
\crdKh
\crdQh
\crdJh
\crdtenh
\crdnineh
\crdeigh\\
\crdsevh
\crdsixh
\crdfiveh
\crdfourh
\crdtreh
\crdtwoh\\
\crdAd
\crdKd
\crdQd
\crdJd
\crdtend
\crdnined
\crdeigd\\
\crdsevd
\crdsixd
\crdfived
\crdfourd
\crdtred
\crdtwod\\
\crdAc
\crdKc
\crdQc
\crdJc
\crdtenc
\crdninec
\crdeigc\\
\crdsevc
\crdsixc
\crdfivec
\crdfourc
\crdtrec
\crdtwoc
\end{center}



%\clearpage
\begin{center}
\psset{unit=5,colorset=2c,corners=4,peek=right}%
\crdJs
\end{center}






\section{List of all optional arguments for \texttt{pst-poker}}

\xkvview{family=pst-poker,columns={key,type,default}}


\nocite{*}
\bgroup
\RaggedRight
\printbibliography
\egroup

\printindex


\end{document}