pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · to make the poker package...

13
pst-poker v.0.03a Herbert Voß January 21, 2020 This document illustrates the possible variations in displaying playing cards available in the L A T E X pst-poker package. pst-poker is based on the package poker from Olaf Encke (http://web.mit.edu/ foley/games/Arcadia/sr/poker/pokersty). Thanks to: Karl Berry 1

Upload: others

Post on 26-Sep-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

pst-pokerv.0.03a

Herbert Voß

January 21, 2020

This document illustrates the possible variations in displaying playing cards available

in the LATEX pst-poker package.

pst-poker is based on the package poker from Olaf Encke (http://web.mit.edu/

foley/games/Arcadia/sr/poker/pokersty).

Thanks to:

Karl Berry

1

Page 2: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

Contents 2

Contents

1 Ibtroduction 3

2 Inline Poker symbols 3

3 Poker cards 3

4 Usage 8

4.1 Inline cards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

5 List of all optional arguments for pst-poker 11

References 12

Page 3: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

1 Ibtroduction 3

1 Ibtroduction

pst-poker itself loads the following packages:

\RequirePackage{pstricks,pst-blur,multido}

\RequirePackage{graphicx}

\RequirePackage[tiling]{pst-fill}

If you want to pass some optional arguments to one or more of these packages you have to use the

macro \PassOptionsToPackage before loading pst-poker. The best way is before the document

class. For example

\PassOptionsToPackage{graphicx}{xetex}

\documentclass{article}

\usepackage{pst-poker}

[...]

2 Inline Poker symbols

There are several possible styles for inline cards. The default way is as small cards, i.e. A♣

Kr

Qq

J♠

10♣ .

They can also be displayed as simple symbols A♣ Kr Qq J♠ 10♣ or as boxed symbols A ♣ K r

Q q J ♠ 10 ♣ . A card back is available, too.

It is also possible to variate the used colorset. In addition to the standard red/black colors, a four

color set A♣Kr

Qq

J♠

10♣ 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 A♣ Kr Qq J♠10♣ or complete

black/white A ♣ K ♥ Q ♦ J ♠ 10 ♣ with outlined red symbols.

3 Poker cards

The big cards offer a lot of options for design. The default design looks like this.

A♠

♠A

10r

r

10

r

r

r

r

r

r

r

r

r

r

7q

q

7

q

q

q

q

q

q

q

7♣

♣7

Qq

q

Q

q

q

The most basic variation is the size set by unit.

Page 4: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

3 Poker cards 4

A♠

♠A

10r

r

10

r

r

r

r

r

r

r

r

r

r

7q

q

7

q

q

q

q

q

q

q

7♣

♣7

Qq

q

Q

q

q

\crdAs

\psset{unit=1.1}

\crdtenh

\psset{unit=1.2}

\crdsevd

\psset{unit=1.3}

\crdsevc

\psset{unit=1.4}

\crdQd

As with the inline cards we can choose the colorset.

Page 5: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

3 Poker cards 5

A♠

♠A

10r

r

10

r

r

r

r

r

r

r

r

r

r

7q

q

7

q

q

q

q

q

q

q

7♣

♣7

Qq

q

Q

q

q

A♠

♠A

10r

r

10

r

r

r

r

r

r

r

r

r

r

7q

q

7

q

q

q

q

q

q

q

7♣

♣7

Qq

q

Q

q

q

A♠

♠A

10r

r

10

r

r

r

r

r

r

r

r

r

r

7q

q

7

q

q

q

q

q

q

q

7♣

♣7

Qq

q

Q

q

q

A♠

♠A

10♥

♥10

7♦

♦7

7♣

♣7

Q♦

♦Q

\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

The frame background can be varied separately by the optional argument framebg, either with

predefined colors as shown here or by using a selfdefined color.

Page 6: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

3 Poker cards 6

A♠

♠A

10r

r

10

r

r

r

r

r

r

r

r

r

r

7q

q

7

q

q

q

q

q

q

q

7♣

♣7

Qq

q

Q

q

q

\psset{colorset=2c}

\psset{framebg=beige}\crdAs

\psset{framebg=white}\crdtenh

\psset{framebg=blue}\crdsevd

\psset{framebg=yellow}\crdsevc

\psset{framebg=beige}\crdQd

It is also possible to place indices in all four corners or use peek indices.

A♠

♠A

10r

r

10

10r

r

10

r

r

r

r

r

r

r

r

r

r

7q

q

7

7q

7q

q

q

q

q

q

q

q

7♣

7♣

7♣

7♣

Qq

Qq

q

q

\psset{corners=2}\crdAs

\psset{corners=4}\crdtenh

\psset{peek=right}\crdsevd

\psset{peek=both}\crdsevc

\psset{corners=2,peek=left}\crdQd

Besides the jumbo indices a regular index can be used. All other options remain available.

A♠

♠A

10r

r

10

10r

r

10

r

r

r

r

r

r

r

r

r

r

7♦

♦7

7♦

7♦

7♣

7♣

7♣

7♣

Qq

Qq

q

q

\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

The crdshadow of the cards can be shown blurred, solid or deactivated.

A♠

♠A

10r

r

10

r

r

r

r

r

r

r

r

r

r

7♦

♦7

7♣

♣7

Qq

q

Q

q

q

\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

Card backs are also available in various styles and customizable in color.

Page 7: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

3 Poker cards 7

♠q♣r

♠q♣r

♠♦♣♥

♠♦♣♥

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠ ♠ ♠ ♠ ♠ ♠ ♠ ♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠

♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠ ♠ ♠ ♠ ♠ ♠ ♠ ♠

\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\\

Page 8: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

4 Usage 8

4 Usage

To make the poker package available within a LATEX document you have to add

\usepackage{pst-poker}

to the preamble. Then you can change the options used with the command

\psset{option=value[,option=value]}

anywhere within the document.

4.1 Inline cards

To print inline cards you just need to call the macro associated with the card you want.

\As\tenh\sevd\sevc\Qd

creates the cards A♠

10r

7q

7♣Qq

.

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

Ace King Queen Jack 10 9 8 7 6 5 4 3 2

A K Q J ten nine eig sev six five four tre two

and the next to select the letter for the suit:

Spade Heart Diamond Club

s h d c

You can influence the display of the inline cards with the options inline and colorset.

Option Values Description

inline symbol uses simple symbols to depict cards

boxed draws rounded boxes around the symbols

card * draws simplified cards with value and suit stacked vertically

colorset 2c * suits in red and black colors

4c suits in black/red/blue/green colors

gs grayscaled suits

bw black/white and outlined suits

*: default

Options

Here we have a lot of options available to change the appearance of the cards. They are explained

in table 1.

Since the peek option modifies the corners setting which in turn resets peek, it is advisable to

first declare the corners option and then use the peek option if necessary.

The same applies to the framebg and backcolor options modifying the colorset option.

Advanced constructs

There are several commands available for the advanced placement of cards.

\crdpair{\crdKs}{\crdtenh}%

\crdflop{\crdsevd}{\crdsevc}{\crdQd}%

\crdKc\crdKd%

Page 9: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

4 Usage 9

Table 1: Options for cards using the cards environment

Option Values Description

index jumbo * jumbo size indices

regular regular size indices

corners 2 * indices in upper left and lower right corners

4 indices in all four corners

peek right add peek indices to right corners

left add peek indices to left corners

both add peek indices to all corners

colorset 2c * suits in red and black colors

4c suits in black/red/blue/green colors

gs grayscaled suits

bw black/white and outlined suits

framebg beige * color choices for inner frame background

blue

white

yellow

<user> user defined color

back simple * diamond/squares styled card back

suits suits in ellipse on net background

spades spades filled background

backcolor blue * color choices of main background elements

red

green

orange

<user> user defined color

crdshadow blurred * gradient shadow

solid solid black shadow

none no shadow

*: default

K♠

♠K

10r

r

10

r

r

r

r

r

r

r

r

r

r

7q

q

7

q

q

q

q

q

q

q

7♣

♣7

Qq

q

Q

q

q

K♣

♣K

Kq

q

K

q

q

K♠

♠K

10r

r

10

r

r

r

r

r

r

r

r

r

r

7q

q

7

q

q

q

q

q

q

q

7♣

♣7

Qq

q

Q

q

q

K♣

♣K

Kq

q

K

q

q

Figure 1: card pair, flop and two cards

Page 10: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

4 Usage 10

A♠

♠A

Ar

r

A

r

Aq

q

A

q

A♣

♣A

Kr

r

K

r

r

A♠ ♠

A♠

Ar

r

A

r

Aq

q

A

q

A♣

♣A

Kr

r

K

r

r

Figure 2: Advanced display variations for floating cards

A♠

♠A

A♠

A♠

K♠

♠K

K♠

K♠

Q♠

♠Q

Q♠

Q♠

J

♠J

J♠

J♠

10♠

♠10

10♠

10♠

9♠

♠9

9♠

9♠

8♠

♠8

8♠

8♠

7♠

♠7

7♠

7♠

6♠

♠6

6♠

6♠

5♠

♠5

5♠

5♠

4♠

♠4

4♠

4♠

3♠

♠3

3♠

3♠

2♠

♠2

2♠

2♠

Ar

r

A

Ar

Ar

r

Kr

r

K

Kr

Kr

r

r

Qr

r

Q

Qr

Qr

r

r

J

r

r

J

Jr

Jr

r

r

10r

r

10

10r

10r

r

r

r

r

r

r

r

r

r

r

9r

r

9

9r

9r

r

r

r

r

r

r

r

r

r

8r

r

8

8r

8r

r

r

r

r

r

r

r

r

7r

r

77r

7r

r

r

r

r

r

r

r

6r

r

66r

6r

r

r

r

r

r

r

5r

r

55r

5r

r

r

r

r

r

4r

r

44r

4r

r

r

r

r

3r

r

33r

3r

r

r

r

2r

r

22r

2r

r

r

Aq

q

A

Aq

Aq

q

Kq

q

K

Kq

Kq

q

q

Qq

q

Q

Qq

Qq

q

q

J

q

q

J

Jq

Jq

q

q

10q

q

10

10q

10q

q

q

q

q

q

q

q

q

q

q

9q

q

9

9q

9q

q

q

q

q

q

q

q

q

q

8q

q

8

8q

8q

q

q

q

q

q

q

q

q

7q

q

7

7q

7q

q

q

q

q

q

q

q

6q

q

6

6q

6q

q

q

q

q

q

q

5q

q

5

5q

5q

q

q

q

q

q

4q

q

4

4q

4q

q

q

q

q

3q

q

3

3q

3q

q

q

q

2q

q

2

2q

2q

q

q

A♣

♣A

A♣

A♣

K♣

♣K

K♣

K♣

Q♣

♣Q

Q♣

Q♣

J

J

J♣

J♣

10♣

♣10

10♣

10♣

9♣

♣9

9♣

9♣

8♣

♣8

8♣

8♣

7♣

♣7

7♣

7♣

6♣

♣6

6♣

6♣

5♣

♣5

5♣

5♣

4♣

♣4

4♣

4♣

3♣

♣3

3♣

3♣

2♣

♣2

2♣

2♣

Page 11: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

5 List of all optional arguments for pst-poker 11

J

♠J

J♠

J♠

5 List of all optional arguments for pst-poker

Key Type Default

colorset choice 2c

colorset choice [none]

inline choice symbol

inline choice [none]

corners choice 4

corners choice [none]

peek choice r

peek choice [none]

framebg ordinary blue

backcolor ordinary red

index choice regular

index choice [none]

crdshadow choice blurred

crdshadow choice [none]

back choice suits

back choice [none]

cardsuit choice [none]

cardvalue choice [none]

Page 12: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

References 12

References

[1] Denis Girou. “Présentation de PSTricks”. In: Cahier GUTenberg 16 (Apr. 1994), pp. 21–70.

[2] Michel Goosens et al. The LATEX Graphics Companion. 2nd ed. Reading, Mass.: Addison-Wesley

Publishing Company, 2007.

[3] Alan Hoenig. TEX Unbound: LATEX & TEX Strategies, Fonts, Graphics, and More. London: Ox-

ford University Press, 1998.

[4] Nikolai G. Kollock. PostScript richtig eingesetzt: vom Konzept zum praktischen Einsatz. Vater-

stetten: IWT, 1989.

[5] Frank Mittelbach and Michel Goosens et al. The LATEX Companion. 2nd ed. Boston: Addison-

Wesley Publishing Company, 2004.

[6] Herbert Voß. PSTricks Grafik für TEX und LATEX. 7th ed. Heidelberg and Berlin: DANTE –

Lehmanns, 2016.

[7] Herbert Voß. PSTricks Graphics for LATEX. 1st ed. Cambridge: UIT, 2011.

[8] Timothy Van Zandt. multido.tex - a loop macro, that supports fixed-point addition. 1997.

URL: /graphics/pstricks/generic/multido.tex.

[9] Timothy Van Zandt. PSTricks - PostScript macros for generic TEX. 1993.

[10] Timothy Van Zandt and Denis Girou. “Inside PSTricks”. In: TUGboat 15 (Sept. 1994), pp. 239–

246.

Page 13: pst-poker - ibibliomirrors.ibiblio.org/.../doc/pst-poker-doc.pdf · To make the poker package available within a LATEX document you have to add \usepackage{pst-poker} to the preamble

Index

C

colorset, 4

crdshadow, 6

F

framebg, 5

K

Keyword

– colorset, 4

– crdshadow, 6

– framebg, 5

– unit, 3

M

Macro

– \PassOptionsToPackage, 3

P

Package

– poker, 1

– pst-poker, 1, 3

\PassOptionsToPackage, 3

poker, 1

pst-poker, 1, 3

U

unit, 3

13