[Tex/LaTex] Another problem with poker package

errorspackagespstricks

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.

Best Answer

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

Related Question