1

First, let me apologize for reviving the topic - I've found a couple of posts here mentioning the experimental poker package, but I still can't work it out.

Going through all the posts I came up with a MWE that should work:

\documentclass[11pt,a4paper]{report}

\usepackage[pdf]{pstricks}
\usepackage{auto-pst-pdf}
\usepackage{poker}
\setkeys{poker}{inline=symbol}

\begin{document}
  \begin{cards}
    \crdtenh
  \end{cards}
\end{document}

However... well - it doesn't.

I've tried three ways of compiling the code:

  1. xelatex Though it works fine, I lose all the fonts, which is ok for the MWE, but totally useless in any application (e.g. a book or article). All the fonts get substituted and default to a single one.

  2. latex -> dvips -> ps2pdf That fails at the last step (ps -> pdf) wih the following error:

    Dictionary stack: --dict:1198/1684(ro)(G)-- --dict:0/20(G)-- --dict:176/200(L)-- --dict:198/300(L)-- --dict:85/200(L)-- Current allocation mode is local Last OS error: No such file or directory Current file position is 333209 GPL Ghostscript 9.18: Unrecoverable error, exit code 1

  3. pdflatex -shell-excape This was said to be a silver bullet fixing my problems, but unfortunately no good. pdflatex fails with the following error:

! LaTeX Error: \begin{pspicture} on input line 12 ended by \end{cards}.

I guess the commands get invoked incorrectly. I've checked the code in poker.sty and all should work fine. Well... again - should.

I think I'm missing something here - could anyone help me with the problem ?

EDIT (as suggested in a comment, I provide more info about the package and other topics I found)

"poker" is an experimental package that can be found here:

Other topics I mentioned:

UPDATE: as suggested I switched to using poker2, but this still doesn't work for a more complicated example found in the package's doc:

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

The error remains the same:

! LaTeX Error: \begin{pspicture} on input line 12 ended by \end{cards}.

To be honest I'm perfectly fine with the ability to render single cards - now I'm only wondering if there's anything I could do to make it only better and work it out with groups of cards.

2
  • 2
    Are you planning to provide any hints on where to find poker.sty? Not on CTAN, not in TeX Live, never heard of it .... In addition, which posts did you find? Please share the information you do have with people trying to help!
    – cfr
    May 15, 2017 at 2:22
  • Sure - sorry, I assumed the issues with the package are known here. Let me update the description and thanks for the hint.
    – LA.27
    May 15, 2017 at 8:30

3 Answers 3

6

Use the current pst-poker.sty if you want to use auto-pst-pdf:

\documentclass[11pt,a4paper]{report}
\usepackage{auto-pst-pdf}
\usepackage{pst-poker}
\psset{inline=symbol}
\begin{document}

\begin{postscript}
\crdtenh
\end{postscript}

\end{document}

enter image description here

The environment cards is not really needed.

\documentclass[11pt,a4paper]{report}
\usepackage{auto-pst-pdf}
\usepackage{pst-poker}
\psset{inline=symbol}
\begin{document}

\begin{postscript}
    \crdtenh
\end{postscript}

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

\end{document}

enter image description here

7
  • That works fine for this example - however, I've just tried a more complicated one that contains nested environments and it fails. I've updated the original question with the code.
    – LA.27
    May 15, 2017 at 15:45
  • 1
    see my edited answer with a modified poker2.sty
    – user2478
    May 15, 2017 at 16:48
  • Works perfectly fine - thanks a lot, I owe you a decent chunk of a great cake ;).
    – LA.27
    May 15, 2017 at 18:45
  • Is poker2.sty going to remain available for future users? I notice it has a tmp path.
    – cfr
    May 15, 2017 at 23:54
  • It is Not my Package, but i'll see what i can do
    – user2478
    May 16, 2017 at 0:11
2

It is not enough to install only the sty. The package contains also various eps-graphics.

With xelatex and latex->dvips->ps2pdf it works if you remove auto-pst-pdf and the pdf-option of pstricks.

\documentclass[11pt,a4paper]{report}

\usepackage{poker}
\setkeys{poker}{inline=symbol}

 \begin{document}
  \begin{cards}
    \crdtenh
  \end{cards}
\end{document}

enter image description here

Imho a compilation with pdflatex and auto-pst-pdf would only work after some rewriting of the package -- it hides the end of some environments in commands and this confuses the preview package.

5
  • Yeah - I installed the whole package on my machine following hints in found in the thread I referenced (tex.stackexchange.com/questions/73016/…). The only problem with xelatex I found is that it fails to find my fonts that work with pdflatex. As a result it defaults everything (i.e. sections' headers, title page, paragraphs, etc.) to the same font style/weight, which I can't accept. The LaTeX source code is way too long to include here, though if it's essential I might try to truncate it and put here.
    – LA.27
    May 15, 2017 at 9:56
  • Lastly: could you please specify what did you mean by "it would work after some rewriting of the package" ? I'm happy to try and experiment with that a bit.
    – LA.27
    May 15, 2017 at 9:57
  • Ask a new question if you have problems with fonts in xelatex (but without a complete example it will be difficult to help). And if you want to rewrite the package I wouldn't use pstricks -- even if it works auto-pst-pdf is painful -- but move everything to tikz. May 15, 2017 at 10:02
  • Perfect Ulrike - that's exactly the response I expected. Forgive me brevity of the message, as I'm dealing with xelatex and pstricks for the very first time. Your response helped me to understand that dealing with those is a pain. Thanks.
    – LA.27
    May 15, 2017 at 10:07
  • 1
    xelatex and pstricks is in general quite fine, it is pdflatex and auto-pst-pdf which is a pain. May 15, 2017 at 10:08
1

I've just noticed something that might work as a cheap walkaround:

  • Running pdflatex -shell-escape fails, but it generates an auxiliary pdf with all the cards.
  • Using that I can generate a pdf containing all the cards (52 + back side + jokers).
  • Then I can create my own library that puts a required image from the pdf into my document. The usage would be exactly the same as in the original package, though some functionality would be lost (I'm fine with that for now).

Is there any obvious flaw in my reasoning ?

1
  • With the up-to-date pst-poker there will be no problem. See my edited answer.
    – user2478
    Jun 29, 2017 at 10:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .