%% $Id: pst-poker-doc.tex 1135 2020-01-21 16:44:55Z herbert $ % \documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings, headexclude,footexclude,oneside]{pst-doc} \listfiles \usepackage{dtk-logos} \usepackage[autostyle]{csquotes} \addbibresource{\jobname.bib} \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{pst-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}