I am currently using Martin J. Osborne's package sgame to draw some matrix form games. However, I have a problem: I cannot center the matrices properly when adding extra rows to the matrix. The next picture shows that, when using \hbox to add an extra row, the centering is bad because LaTex seems not to consider the extra row given by \hbox (when \hbox is not used, the centering is correct). Therefore, the centering of the second matrix is ugly:
This is a MWE that reproduces this behaviour.
\documentclass[a4paper]{report}
\usepackage{amsmath, mathtools, amsthm}
\usepackage{sgame}
\renewcommand{\gamestretch}{1.5}
\gamemathtrue
\def\hangUnder#1{\hbox to 0pt {\raisebox{-5mm}[0pt][0pt]{#1}}}
\irpawcgltrue
\irplwcgltrue
\begin{document}
\begin{figure}[!htb]
\centering
\begin{game}{2}{2}[Player 1][Player 2]
& $L$ & $R$\\
$H$ & 0,1 & 0,0\\
$L$ & 0,0 & 0,1
\end{game}
\medskip
\caption{Matching Pennies}\label{MPS6}
\end{figure}
\begin{figure}[!htb]
\centering
\begin{game}{2}{2}[Player 1][Player 2]
& $L$ & $R$\\
$U$ & 0,1 & 0,0\hbox to 0pt{\hspace{7pt} $p$}\\
$D$ & 0,0\hangUnder{\hspace{-13pt}$q$} & 0,1\hangUnder{\hspace{-20pt}$1-q$} \hbox to 0pt{\hspace{7pt} $1-p$}
\end{game}
\medskip
\caption{Matching Pennies}\label{MPS3}
\end{figure}
\end{document}
What I would like is that the hboxes are considered when computing the horizontal center of the figure. Analogously, using \hangunder reduces the space between the figure and the caption unless I manually add some arbitrary vertical space with \vspace. I would like \hangunder to be considered when doing the computations, to avoid manually adding a vertical space. Thank you all! :)
\hbox
isn't a command supported in latex documents use\makebox[0pt][l]{...}
to make a 0 width box\hbox
not being centred by\centering
and similar latex constructs is by design