\begin{table}
\centering
\renewcommand{\arraystretch}{1.3}
\begin{tabular}{c | l}
Group element & $\begin{array} {r@{}l@{}} U(\xi) & {}= e^{\xi^a P_a} \\ U(\Lambda) & {}= e^{-\frac{1}{2}\lambda^{ab}M_{ab}} \end{array}$ \\
\hline
Algebra & $\begin{array} {r@{}l@{}} [M_{[ab]},M_{[cd]}] & {}= 4\eta_{[a[c}M_{d]b]} \\ f_{[ab][cd]}{}^{[ef]} & {}= 8 \eta_{[c[b}\delta^{[e}_{a]}\delta^{f]}_{d]} \\ P_{a},M_{[bc]} & {}= 2\eta_{a[b}P_{c]} \\ f_{a,[bc]}{}^d & {}= 2 \eta_{a[b}\delta_{c]}^d\end{array}$ \\ \hline
Connection & $A_\mu = A_\mu{}^a T_a$ \\ \hline
Curvature & $\begin{array} {r@{}l@{}} R_{\mu\nu} & {}= R_{\mu\nu}{}^a T_a \\ R_{\mu\nu}{}^a & {}= 2 \partial_{[\mu}A_{\nu]} + f_{ab}{}^c A_\mu{}^b A_\nu{}^c \end{array}$ \\
\end{tabular}
\end{table}
我试图在代数行中的 $[P_{a},M_{[bc]}]$ 的第三行上得到一个括号。每当我在左边和右边添加 [ 和 ] 时,我都会得到
出现以下错误
答案1
\\
带有可选参数,即长度。您可以使用\\\relax [ P_{a},M_{[bc]} ]
。
\documentclass{article}
\begin{document}
\begin{table}
\centering
\renewcommand{\arraystretch}{1.3}
\begin{tabular}{c | l}
Group element & $\begin{array} {r@{}l@{}} U(\xi) & {}= e^{\xi^a P_a} \\ U(\Lambda) & {}= e^{-\frac{1}{2}\lambda^{ab}M_{ab}} \end{array}$ \\
\hline
Algebra & $\begin{array} {r@{}l@{}} [M_{[ab]},M_{[cd]}] & {}=
4\eta_{[a[c}M_{d]b]} \\ f_{[ab][cd]}{}^{[ef]} & {}= 8
\eta_{[c[b}\delta^{[e}_{a]}\delta^{f]}_{d]} \\\relax [ P_{a},M_{[bc]} ]& {}= 2\eta_{a[b}P_{c]} \\ f_{a,[bc]}{}^d & {}= 2 \eta_{a[b}\delta_{c]}^d\end{array}$ \\ \hline
Connection & $A_\mu = A_\mu{}^a T_a$ \\ \hline
Curvature & $\begin{array} {r@{}l@{}} R_{\mu\nu} & {}= R_{\mu\nu}{}^a T_a \\ R_{\mu\nu}{}^a & {}= 2 \partial_{[\mu}A_{\nu]} + f_{ab}{}^c A_\mu{}^b A_\nu{}^c \end{array}$ \\
\end{tabular}
\end{table}
\end{document}
但我会用它aligned
来代替手工制作的数组,或许还会用到一些其他的东西。
\documentclass{article}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{eqparbox}
\newcommand\MyLeftColumn[1]{\eqmakebox[A][r]{$#1$}}
\begin{document}
\begin{table}
\centering
\renewcommand{\arraystretch}{1.3}
\begin{tabular}{l l}
\toprule
Group element & $\begin{aligned} \MyLeftColumn{U(\xi)} &= e^{\xi^a P_a} \\
\MyLeftColumn{U(\Lambda)} & {}=
e^{-\frac{1}{2}\lambda^{ab}M_{ab}} \end{aligned}$ \\
\midrule
Algebra & $\begin{aligned}\relax \MyLeftColumn{[M_{[ab]},M_{[cd]}]} & =
4\eta_{[a[c}M_{d]b]} \\ \MyLeftColumn{f_{[ab][cd]}{}^{[ef]}} & = 8
\eta_{[c[b}\delta^{[e}_{a]}\delta^{f]}_{d]} \\\relax
\MyLeftColumn{[ P_{a},M_{[bc]} ]}& = 2\eta_{a[b}P_{c]} \\
\MyLeftColumn{f_{a,[bc]}{}^d} & {}= 2 \eta_{a[b}\delta_{c]}^d\end{aligned}$ \\
\midrule
Connection & $\MyLeftColumn{A_\mu} = A_\mu{}^a T_a$ \\
\midrule
Curvature & $\begin{aligned} \MyLeftColumn{R_{\mu\nu}} & = R_{\mu\nu}{}^a T_a \\
\MyLeftColumn{R_{\mu\nu}{}^a} & = 2 \partial_{[\mu}A_{\nu]} + f_{ab}{}^c A_\mu{}^b A_\nu{}^c \end{aligned}$ \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
答案2
我已经编辑了这个答案,因为使用最新版本nicematrix
(v.5.1),不需要使用 Tikz 来绘制垂直规则:|
序言中的符号与规则直接兼容booktabs
。
如果您想在使用 工具构建的表格中添加垂直规则booktabs
(这不符合 的精神booktabs
),您可以使用nicematrix
。
\documentclass{article}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{nicematrix}
\usepackage{tikz}
\usepackage{eqparbox}
\newcommand\MyLeftColumn[1]{\eqmakebox[A][r]{$#1$}}
\begin{document}
\begin{table}
\centering
\renewcommand{\arraystretch}{1.3}
\begin{NiceTabular}{l|l}
\toprule
Group element & $\begin{aligned} \MyLeftColumn{U(\xi)} &= e^{\xi^a P_a} \\
\MyLeftColumn{U(\Lambda)} & {}=
e^{-\frac{1}{2}\lambda^{ab}M_{ab}} \end{aligned}$ \\
\midrule
Algebra & $\begin{aligned}\relax \MyLeftColumn{[M_{[ab]},M_{[cd]}]} & =
4\eta_{[a[c}M_{d]b]} \\ \MyLeftColumn{f_{[ab][cd]}{}^{[ef]}} & = 8
\eta_{[c[b}\delta^{[e}_{a]}\delta^{f]}_{d]} \\\relax
\MyLeftColumn{[ P_{a},M_{[bc]} ]}& = 2\eta_{a[b}P_{c]} \\
\MyLeftColumn{f_{a,[bc]}{}^d} & {}= 2 \eta_{a[b}\delta_{c]}^d\end{aligned}$ \\
\midrule
Connection & $\MyLeftColumn{A_\mu} = A_\mu{}^a T_a$ \\
\midrule
Curvature & $\begin{aligned} \MyLeftColumn{R_{\mu\nu}} & = R_{\mu\nu}{}^a T_a \\
\MyLeftColumn{R_{\mu\nu}{}^a} & = 2 \partial_{[\mu}A_{\nu]} + f_{ab}{}^c A_\mu{}^b A_\nu{}^c \end{aligned}$ \\
\bottomrule
\end{NiceTabular}
\end{table}
\end{document}