5

I'm trying to write a paper for university and it involves using poker cards in latex. I'm using the Poker MIT Package:

http://web.mit.edu/foley/games/Arcadia/sr/poker/poker.sty

provides the poker.sty file required, and the page

http://web.mit.edu/foley/games/Arcadia/sr/poker/poker-doc.pdf

gives some help for people like me who aren't great with latex. In this second document, on page 4, the author writes: "Then you can change the options used with the command

\setkeys{poker}{option=value[,option=value]}

anywhere within the document." I have no idea how to use this and have tried fiddling about with it hoping it would work but with zero success. Available options are listed just below this on page 4, and I'd very much like to change from the default.

Could someone who's not a total noob please provide me with a sample implementation of the above to change the options? I really need the inline option set to symbol.

Thanks in advance!

  • 3
    Just a sidenote: everyone needs package documentation -- don't feel inferior for reading it <3 – Sean Allred Mar 29 '16 at 15:42
  • 2
    Also, welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Sean Allred Mar 29 '16 at 15:42
4

The package 'documentation' is really short, in my point of view, but looking into poker.sty the solution is very obvious

\define@choicekey*{poker}{inline}[\val\nr]{symbol,boxed,card}[symbol]{%
% omitted here by C.H. 
}

The relevant key is inline and is a choice - key, having only the allowed values symbol, boxed, card.

Use inline=symbol -- the initial default is card (set at the end of the package.)

It's possible to use \setkeys{poker}{...} at any place in the document, to change the decks/style etc.

Please be aware that the poker package relies on PostScript, so use latex, not pdflatex to compile this document.

Since the compilation fails for boxed style, I don't provide code for this.

\documentclass{article}

\usepackage{poker}

\setkeys{poker}{inline=symbol}

\begin{document}
\As\tenh\sevd\sevc\Qd

\setkeys{poker}{inline=card}
\As\tenh\sevd\sevc\Qd

\end{document}

enter image description here

  • Thank you very much, perfect solution. I've switched from using overleaf.com to TexMaker and compiling using XeLaTeX so that I can use the package, hopefully no more problems. Thanks again! – Conor Mar 29 '16 at 15:54
  • @Conor: You're welcome. It's always better to drop such Online Editors and use the local variant, in my point of view. Happy TeXing. – user31729 Mar 29 '16 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.