
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
는 두 가지 주요 차이점을 제외하고 배열 구조를 다시 구현합니다.
기준선을 30%로 두는 대신 텍스트가 셀 중앙에 위치합니다.
배열 주변의 규칙은 텍스트와 충돌할 수 있으며 일종의 오버레이에 있는 것처럼 보입니다.
\gamestretch
다음 솔루션은 이러한 두 가지 차이점을 처리하고 및 값을 변경할 때 작동합니다 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}