0

I am using the package sgame for drawing strategic-form games for my thesis on game theory. Everything works fine, but I do not know how to cross rows or columns which are dominated. I found a very helpful script on

https://www.economics.utoronto.ca/osborne/latex/sgame.pdf

but the offered solution with

 \def\sgtextcolor{black}%
 \def\sglinecolor{black}%
 \newcommand\redStrike[2]{%
    \ncline[linewidth=1.2pt,nodesep=-14pt,linecolor=red]{#1}{#2}}

 \begin{game}{2}{2}
 &\rnode[t]{a12}{$L$}       &$R$\\
 \Rnode[href=20]{a21}{$T$}  &$1,1$ &\Rnode{a23}{$2,2$}\\
 $B$ &\rnode[b]{a32}{$2,2$} &$3,3$
 \end{game}
 % specify the nodes to be connected
 \redStrike{a21}{a23}
 \redStrike{a12}{a32}

does somehow not work in my script. Is there any other solution to my problem? This is how my matrix looks:

\begin{figure}[H]
    \centering
    \begin{game}{2}{2}[\textbf{S}][\textbf{T}]
        & G & S \\
        W & (10,5) & (0,-5)        \\
        L & (5,10) & (-5,0)        
    \end{game}
 \end{figure}
batu
  • 3

1 Answers1

0

The solution from the manual uses pstricks. This package should be used with the latex->dvips->ps2pdf compiler sequence (see https://tex.stackexchange.com/a/68871/89417) instead of the modern pdflatex compiler.

If you want to use pdflatex then you can use tikz instead. You can define empty tikz nodes at the position of the sgame cells and draw a line between those. This is a bit less clean because it involves manual spacing of the cells.

MWE for pstricks:

\documentclass{article}
\usepackage{sgame}
\usepackage{pstricks,pst-node}
\newcommand{\strike}[2]{\ncline[linewidth=1pt,nodesep=-14pt]{#1}{#2}}
\begin{document}
    \begin{game}{2}{2}[\textbf{S}][\textbf{T}]
        & G & \rnode[t]{a}{S} \\
        W & (10,5) & (0,-5)        \\
        L & (5,10) & \rnode[b]{b}{(-5,0)}        
    \end{game}
    \strike{a}{b}
\end{document}

Result:

enter image description here

MWE for tikz:

\documentclass{article}
\usepackage{sgame}
\usepackage{tikz}

\begin{document}
    \begin{game}{2}{2}[\textbf{S}][\textbf{T}]
        & G & \begin{tikzpicture}[remember picture,overlay] \node (a) {\phantom{S}}; \end{tikzpicture} \hspace*{-3mm} S \\
        W & (10,5) & (0,-5)        \\
        L & (5,10) & \hspace*{5mm}\begin{tikzpicture}[remember picture,overlay] \node (b) {\phantom{S}}; \draw (a.north) -- (b.south); \end{tikzpicture} \hspace*{-7mm} (-5,0)       
    \end{game}
\end{document}

Result:

enter image description here

Marijn
  • 37,699