booktabs 表格列分隔

booktabs 表格列分隔

努力将桌子安装到投影机滑轨上。

在此处输入图片描述

为什么列之间有这么多空隙?!

\begin{frame}
\frametitle{Recovering GR}
\begin{table} 
\centering 
\renewcommand{\arraystretch}{1.3}
\begin{tabular}{ l l}
\midrule
\makecell[l]{Dependent spin \\connection} & $\MyLeftColumn{\omega_\mu{}^{ab}} = 2 e^{\lambda[a} \partial_{[\lambda}e_{\mu]}{}^{b]} - e_{\mu}{}^c e^{\rho a} e^{\sigma b} \partial_{[\rho} e_{\sigma]c}$ \\ 
\midrule 
Metric & $\MyLeftColumn{g_{\mu\nu} } = e_{\mu}{}^a e_\nu{}^b \eta_{ab}$ \\  
\midrule
\makecell[l]{Christoffel \\ connection} & $\MyLeftColumn{\Gamma^\nu_{\mu\lambda}} = e^\nu{}_a ( \partial_\mu e_\lambda{}^a  + \omega_\mu{}^a{}_b e_\lambda{}^a)$   \\  
\midrule 
Zero torsion & $\begin{aligned} \MyLeftColumn{T_{\mu\lambda}{}^\nu} &= 2 \Gamma_{[\mu\lambda]}^\nu \\ &= 2 e^\nu{}_a ( \partial_{[\mu} e_{\lambda]}{}^a  + \omega_{[\mu}{}^a{}_b e_{\lambda]}{}^a = R_{\mu\lambda}{}^a(e)=0) \\ &= 0 \end{aligned}$ \\
\midrule
On-shell & $\MyLeftColumn{R_{\mu\nu}} = e^\mu{}_a R_{\mu\nu}{}^{ab}(\omega) = 0$ \\  
\midrule
Action & $\begin{aligned}\MyLeftColumn{S} &= \int d^4x \text{det}(e_\mu{}^a) R(\omega)\\ \MyLeftColumn{R(\omega)} &= e^\mu{}^a e^\mu{}_b R_{\mu\nu}{}^{ab}(\omega)
\end{aligned}$ \\  
\midrule
\end{tabular}
\end{table}
\end{frame}

我的序言

\documentclass[notes]{beamer}
\usetheme{Singapore}
\usepackage[utf8]{inputenc}
\usepackage[export]{adjustbox}
\usepackage{amssymb,amsmath,tabu}
\usepackage{booktabs}
\usepackage{eqparbox}
\newcommand\MyLeftColumn[1]{\eqmakebox[A][r]{$#1$}}
\usepackage{array}
\usepackage{float}
\usepackage{subcaption} 
\usepackage{makecell}
\usepackage{amsfonts}
\usepackage[czech]{babel}
\usepackage{amsthm}
\usepackage{amssymb,graphicx}
\usepackage{hyphenat}
\usepackage[font={small}]{caption}
\usepackage{float}

我按照薛定谔的猫的回答使用了这种表格格式表格单元格中的多行数组

答案1

我想我明白哪里出了问题,尽管从你发布的代码来看,这并不一定正确。我相信你\eqmakebox在文档的其他地方使用了具有相同标签/id 的命令。这将使所有框都具有所有这些内容的最大宽度。但是,你只想最大化给定表中框的宽度。这可以通过为每个表赋予一个唯一的 id 来实现。以下代码提供了一种实现此目的的可能方法。

\documentclass[notes]{beamer}
\usetheme{Singapore}
\usepackage[utf8]{inputenc}
\usepackage[export]{adjustbox}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage{eqparbox}
\usepackage{array}
\usepackage{subcaption} 
\usepackage{makecell}
\usepackage[czech]{babel}
\newcommand{\diff}{\mathop{}\!\mathsf{d}}
\newcommand\MyLeftColumn[1]{\eqmakebox[\myID][r]{$#1$}}
\newcommand{\myID}{A}

\begin{document}
\begin{frame}
\frametitle{Recovering GR}
\begin{table} 
\centering 
\renewcommand{\arraystretch}{1.3}%
\renewcommand{\myID}{RGR}% <- use a new id for the eqparboxes in this frame
\small
\begin{tabular}{ l l}
\midrule
\makecell[l]{Dependent spin \\connection} & $\MyLeftColumn{\omega_\mu{}^{ab}} = 2 e^{\lambda[a} \partial_{[\lambda}e_{\mu]}{}^{b]} - e_{\mu}{}^c e^{\rho a} e^{\sigma b} \partial_{[\rho} e_{\sigma]c}$ \\ 
\midrule 
Metric & $\MyLeftColumn{g_{\mu\nu} } = e_{\mu}{}^a e_\nu{}^b \eta_{ab}$ \\  
\midrule
\makecell[l]{Christoffel \\ connection} & $\MyLeftColumn{\Gamma^\nu_{\mu\lambda}} = e^\nu{}_a ( \partial_\mu e_\lambda{}^a  + \omega_\mu{}^a{}_b e_\lambda{}^a)$   \\  
\midrule 
Zero torsion & $\begin{aligned} \MyLeftColumn{T_{\mu\lambda}{}^\nu} &= 2 \Gamma_{[\mu\lambda]}^\nu \\ &= 2 e^\nu{}_a ( \partial_{[\mu} e_{\lambda]}{}^a  + \omega_{[\mu}{}^a{}_b e_{\lambda]}{}^a = R_{\mu\lambda}{}^a(e)=0) \\ &= 0 \end{aligned}$ \\
\midrule
On-shell & $\MyLeftColumn{R_{\mu\nu}} = e^\mu{}_a R_{\mu\nu}{}^{ab}(\omega) = 0$ \\  
\midrule
Action & $\begin{aligned}\MyLeftColumn{S} &= \int\!\diff^4x\, \det(e_\mu{}^a) R(\omega)\\ \MyLeftColumn{R(\omega)} &= e^\mu{}^a e^\mu{}_b R_{\mu\nu}{}^{ab}(\omega)
\end{aligned}$ \\  
\midrule
\end{tabular}
\end{table}
\end{frame}

\end{document}

在此处输入图片描述

如果您有更多使用 的表\MyLeftColumn,请使用每个表唯一的\renewcommand{\myID}{...}位置...。(可以通过添加一些计数器或使其依赖于某些计数器来实现自动化,但这永远不会完全安全,因此我建议在此处采用更手动的方式。)

顺便说一句,使用\det而不是,以及可与变量 区分的\text{det}微分。dd

相关内容