
私は、通常の形式のゲームをフォーマットするために パッケージを使用していますsgame
。ゲームは一般的に 内でフォーマットされますfigure
が、 で使用したいと思いますequation
。句読点の垂直間隔に問題があります。
私が使用するコードは次のとおりです:
\documentclass{article}
\usepackage{color}
\usepackage{sgame}
\gamemathtrue
\begin{document}
\begin{equation}
\begin{game}{3}{2}
& F & O \\
F & 2, 2 & 0, 1 \\
O & 0, 0 & 1, 3 \\
P & 0, 0 & 1, 3
\end{game}
.
\end{equation}
\end{document}
結果は次のとおりです。
数式番号の配置は気に入っていますが、ピリオドの配置は気に入りません。ピリオドを表の最後の行のテキストに揃えたいと思います。距離は0.3\baselineskip
下の水平線からで、ベースラインからの距離は固定ではありません。
私が求めているのはこれです:
答え1
\documentclass{article}
\usepackage{color}
\usepackage{sgame}
\gamemathtrue
\begin{document}
\begin{equation}
\begin{game}{3}{2}
& F & O \\
F & 2, 2 & 0, 1 \\
O & 0, 0 & 1, 3 \\
P & 0, 0 & 1, 3\rlap{\quad.}
\end{game}
\end{equation}
\end{document}
答え2
ベースラインは0.3\baselineskip
ゲームの下部からのものではないことが判明しました。sgame
パッケージは、2 つの大きな違いを伴って配列構造を再実装します。
テキストはベースラインが30%ではなくセルの中央に配置されます
配列の周りのルールはテキストと衝突する可能性があり、一種のオーバーレイのように見える
\gamestretch
次のソリューションは、これら 2 つの違いに対処し、およびの値を変更するときに機能しますarrayrulewidth
。
\documentclass{article}
\usepackage{calc}
\usepackage{color}
\usepackage{sgamevar}
\newcommand{\punctuategame}[2]{%
\setbox0 = \hbox{#1}% box containing the whole game
\setbox1=\hbox{I}% box used to determined the height of text in a cell
\newlength{\vdisp}% vertical displacement of punctuation
\setlength{\vdisp}{-\dp0 - \arrayrulewidth + \gamestretch \baselineskip / 2 - \ht1 / 2}%
\newlength{\hdisp}% horizontal displacement of punctuation
\setlength{\hdisp}{0.5\arrayrulewidth}%
\mbox{#1}% placing the game
\raisebox{\vdisp}{\hspace{\hdisp}\mbox{#2}}}% placing punctuation
\begin{document}
\begin{equation}
\punctuategame{
\begin{game}{3}{2}
\> F \> O \\
F \> 2, 2 \> 0, 1 \\
O \> 0, 0 \> 1, 3 \\
P \> 0, 0 \> 1, 3
\end{game}
}{.}
\end{equation}
\end{document}