增加 Latex 表中的空间

增加 Latex 表中的空间

以下代码生成一个表:

\documentclass{article}
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{multirow}
\usepackage[]{amsmath}
\usepackage[]{graphicx}
\usepackage{mathtools}

\begin{table}[h!]
\centering
\begin{tabular}{M{20mm}M{20mm}M{20mm}}
& positive spin, $s > 0$ & negative spin, $s > 0$\\ \cline{1-3}
\multicolumn{1}{ |c| }{Local integrals of motion} & \multicolumn{1}{ |c| }
{$P_{s} = \int_{C} [T_{s+1}(z)d\text{z}+\Theta_{s-1}(z)d\bar{\text{z}}]$} & 
\multicolumn{1}{ |c| }{$\bar{P}_{s} = \int_{C} [\bar{T}_{s+1}
(z)d\bar{\text{z}}+\bar{\Theta}_{s-1}(z)d\text{z}]$}      \\ [1ex] \cline{1-3}
\multicolumn{1}{ |c| }{Local currents} & \multicolumn{1}{ |c| }{$(T_{s+1}, 
\Theta_{s-1})$} & \multicolumn{1}{ |c| }{$(\bar{\Theta}_{s-1}, 
\bar{T}_{s+1})$}     \\ \cline{1-3}
\multicolumn{1}{ |c| }{Continuity equation} & \multicolumn{1}{ |c| }
{$\partial_{\bar{\text{z}}}T_{s+1}(z) = \partial_{\text{z}}\Theta_{s-1}(z)$} 
& \multicolumn{1}{ |c| }{$\partial_{\text{z}}\bar{T}_{s+1}(z) = 
\partial_{\bar{\text{z}}}\bar{\Theta}_{s-1}(z)$} \\ \cline{1-3}
\end{tabular}
\caption{Local integrals of motion and local conserved currents of integrable quantum field theories}
\label{table:1}
\end{table}

\end{document}

此代码生成下表:

在此处输入图片描述

我想扩大每行的垂直空间,以增加美感。你能帮忙吗?

答案1

我会删除所有垂直规则和 4 条水平规则中的 3 条。我还会使用环境tabularx。而且,出于谨慎考虑,我会写\mathrm{z}而不是\text{z}

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath,booktabs,tabularx,ragged2e}
\newcolumntype{C}{>{$}c<{$}} % automatic math mode
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}

\begin{document}
\begin{table}[h!]
\setlength\tabcolsep{5pt} % default value: 6pt
\begin{tabularx}{\textwidth}{@{} Y CC @{}}
& \text{positive spin}, s > 0 
& \text{negative spin}, s > 0\\ 
\midrule
Local integrals of motion
& P_{s} = \int_{C} [T_{s+1}(z)d\mathrm{z}
                +\Theta_{s-1}(z)d\bar{\mathrm{z}}] 
& \bar{P}_{s} = \int_{C} [\bar{T}_{s+1}(z)d\bar{\mathrm{z}} 
                +\bar{\Theta}_{s-1}(z)d\mathrm{z}] \\ 
Local currents 
& (T_{s+1}, \Theta_{s-1}) 
& (\bar{\Theta}_{s-1}, \bar{T}_{s+1}) \\ 
Continuity equation
& \partial_{\bar{\mathrm{z}}}T_{s+1}(z) = 
    \partial_{\mathrm{z}}\Theta_{s-1}(z)
& \partial_{\mathrm{z}}\bar{T}_{s+1}(z) = 
    \partial_{\bar{\mathrm{z}}}\bar{\Theta}_{s-1}(z) \\ 
\end{tabularx}
\caption{Local integrals of motion and local conserved currents of 
         integrable quantum field theories}
\label{table:1}
\end{table}

\end{document}

附录:如果文本块足够宽,使得第一列中的换行符没有必要(如您发布的屏幕截图中的情况一样),那么在行之间添加一些空白会很受欢迎:

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath,booktabs,array}
\newcolumntype{C}{>{$\displaystyle}c<{$}} % automatic display-math mode
\usepackage{geometry}
\begin{document}
\begin{table}[h!]
% Let LaTeX figure out amount of intercolumn whitespace:
\setlength\tabcolsep{0pt} 
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l CC }
\toprule
& \text{positive spin}, s > 0 
& \text{negative spin}, s > 0\\ 
\midrule
Local integrals of motion
& P_{s} = \int_{C} [T_{s+1}(z)\,d\mathrm{z}
          +\Theta_{s-1}(z)\,d\bar{\mathrm{z}}] 
& \bar{P}_{s} = \int_{C} [\bar{T}_{s+1}(z)\,d\bar{\mathrm{z}} 
          +\bar{\Theta}_{s-1}(z)\,d\mathrm{z}] \\
\addlinespace 
Local currents 
& (T_{s+1}, \Theta_{s-1}) 
& (\bar{\Theta}_{s-1}, \bar{T}_{s+1})     \\ 
\addlinespace
Continuity equation
& \partial_{\bar{\mathrm{z}}}T_{s+1}(z) = 
       \partial_{\mathrm{z}}\Theta_{s-1}(z)
& \partial_{\mathrm{z}}\bar{T}_{s+1}(z) = 
      \partial_{\bar{\mathrm{z}}}\bar{\Theta}_{s-1}(z) \\ 
\bottomrule
\end{tabular*}
\caption{Local integrals of motion and local conserved 
         currents of integrable quantum field theories}
\label{table:1}
\end{table}

\end{document}

答案2

我可以提出这个建议,并进行一些改进。所有这些\multicolumns 都不是必需的。我使用cellspace包在单元格的顶部和底部添加了一些填充,借用了\widebar来自的命令(用于大写字母上方),并使用来自的命令mathabx将积分的大小增加到中等大小:\medintnccmath

\documentclass{article}
\usepackage{geometry}
\usepackage{amsmath, nccmath}
\usepackage{array, makecell, cellspace}
\setlength\cellspacetoplimit{5pt}
\setlength\cellspacebottomlimit{5pt}

\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
<-6> mathx5 <6-7> mathx6 <7-8> mathx7
<8-9> mathx8 <9-10> mathx9
<10-12> mathx10 <12-> mathx12
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareMathAccent{\widebar}{0}{mathx}{"73}

\begin{document}

\begin{table}[h!]
\centering
\begin{tabular}{|Sl|*{2}{>{$}Sc<{$}|}}
\multicolumn{1}{c}{}& \multicolumn{1}{Sc}{positive spin, $s > 0$} & \multicolumn{1}{c}{negative spin, $s > 0$}\\ %
\hline
\makecell[l]{Local integrals\\ of motion} & P_{s} =\medint \int_{C}\bigl[T_{s+1}(z)\,\mathrm d{z}+\Theta_{s-1}(z)\,\mathrm d\bar{{z}}\bigr] &
\widebar{P}_{s} = \medint\int_{C}\bigl [\widebar{T}_{s+1} (z)\,\mathrm d\bar{z}+\widebar{\Theta}_{s-1}(z)\,\mathrm d z\bigr] \\ [1ex] %
\hline
Local currents & (T_{s+1}, \Theta_{s-1}) & (\widebar{\Theta}_{s-1}, \widebar{T}_{s+1}) \\ %
\cline{1-3}
Continuity equation & \partial_{\bar{z}}T_{s+1}(z) = \partial_{z}\Theta_{s-1}(z)
& \partial_{z}\widebar{T}_{s+1}(z) =\partial_{\bar{z}}\widebar{\Theta}_{s-1}(z) \\%
 \hline
\end{tabular}
\caption{Local integrals of motion and local conserved currents of integrable quantum field theories}
\label{table:1}
\end{table}

\end{document} 

在此处输入图片描述

相关内容