我想在 latex 中重现这些表格。
不幸的是,当我要写它们时,它们很糟糕。
它们是代表博弈论案例的表格。
这是我针对第一个问题提出的暂定解决方案:
\begin{table}[]
\begin{tabular}{|l|l|l|l|}
\hline
Pilot & Move & Performance & Cost \\ \hline
\multirow{3}{*}{A} & 1 & $eq_{1} = 42$ & \Delta t_{p} = 2 \\ \cline{2-4}
& 2 & $eq_{2} = 44$ & 2\Delta t_{p} = 4 \\ \cline{2-4}
& 3 & $eq_{3} = 42$ & \Delta t_{p} = 2 \\ \hline
\multirow{3}{*}{B} & 1 & $eq_{1} = 42$ & \Delta t_{p} = 2 \\ \cline{2-4}
& 2 & $eq_{2} = 44$ & 2\Delta t_{p} = 4 \\ \cline{2-4}
& 3 & $eq_{3} = 42$ & \Delta t_{p} = 2 \\ \hline
\end{tabular}
\end{table}
答案1
这是针对您的第一张表的解决方案。它使用了tabularray
非常适合这种表的包。
\documentclass{article}
\usepackage{tabularray}
\newcommand{\lbf}{\large\bfseries}
\begin{document}
\begin{table}
\begin{tblr}{colspec={|c|c|c|c|},hlines,
cell{2}{1}={r=2}{font=\lbf},cell{4}{1}={r=2}{font=\lbf}}
Player & Action & Cost & Effectiveness \\ \hline
S & D (detailed scan) & $c_D = 2$ & $ b_D = 1 $ \\
& Q (quick scan) & $c_Q = 1$ & $ b_Q = 1 $ \\
A & F (fast mode) & $c_F = 1$ & $ b_F = -1 $ \\
& C (cautious mode) & $c_C = 2$ & $ b_C = 1 $ \\
\end{tblr}
\end{table}
\end{document}
答案2
第一个(@Pieter van Oostrum 不错的答案的一点点变化,+1)和第二个表格:
\documentclass{article}
\usepackage[skip=1ex, font=small, labelfont=bf]{caption}
\usepackage{tabularray}
\newcommand{\lbf}{\large\bfseries}
\begin{document}
\begin{table}[ht]
\centering
\caption{First table}
\begin{tblr}{hlines, vlines,
colspec={c l *{2}{Q[l, mode=math]}},
cell{2}{1}={r=2}{font=\lbf},
cell{4}{1}={r=2}{font=\lbf},
row{1} = {mode=text, c}
}
Player & Action & Cost & Effectiveness \\
\hline
S & D (detailed scan) & c_D = 2 & b_D = 1 \\
& Q (quick scan) & c_Q = 1 & b_Q = 1 \\
A & F (fast mode) & c_F = 1 & b_F = -1 \\
& C (cautious mode) & c_C = 2 & b_C = 1 \\
\end{tblr}
\end{table}
\begin{table}[ht]
\centering
\caption{Second table}
\begin{tblr}{hline{3-Z}=solid, vline{3-Z}=solid,
colspec={c c *{2}{Q[l, mode=math]}},
row{1-2} = {mode=text, c}
}
\SetCell[c=2, r=2]{c}
& & \SetCell[c=2]{c} Player A
& \\
& & F & C \\
\SetCell[r=4]{c} Player S
&\SetCell[r=2]{c} D
& P_{r_n} - c_D + b_D & P_{r_c} - c_D + b_D \\
& & P_{r_n} - c_F + b_D & P_{r_c} - c_C + b_C \\
&\SetCell[r=2]{c} Q
& P_{r_n} - c_Q + b_D & P_{r_c} - c_Q + b_Q \\
& & P_{r_n} - c_F + b_D & P_{r_c} - c_C + b_C \\
\end{tblr}
\end{table}
\end{document}