乳胶中的特定 table

Specific table in Latex

我正在尝试 table 这样:

但看起来不太好,我的代码是

\begin{center}
\begin{tabular}{ c c c c }
    & & \textbf{Sferyczne} & \textbf{Kartezjańskie} \ 
    $l=0$ & $y^{0}_{0}(\theta,\phi)=$ & $\sqrt{\frac{1}{4\pi}}$ & $\sqrt{\frac{1}{4\pi}}$ \  
    $l=1$ & \begin{dcases} $y^{-1}_{1}(\theta,\phi)=$ \ $y^{0}_{1}(\theta,\phi)=$ \ $y^{1}_{1}(\theta,\phi)=$ \end{dcases} & \begin{tabular}{c} $\sqrt{\frac{3}{4\pi}}\cos\phi\sin\theta$ \ g \ g \end{tabular} & \begin{tabular}{c} $\sqrt{\frac{3}{4\pi}}x$ \end{tabular} \
    cell10 & cell11 & cell12   
\end{tabular}
\end{center}

这就是它的样子:

请帮助我获得与第一张图片相同的table。

这是实现您想要的输出的一种方法:

\documentclass{article}

\usepackage{xparse,eqparbox,amsmath}

% https://tex.stackexchange.com/a/34412/5764
\makeatletter
\NewDocumentCommand{\eqmathbox}{o O{c} m}{%
  \IfValueTF{#1}
    {\def\eqmathbox@##1##2{\eqmakebox[#1][#2]{$##1##2$}}}
    {\def\eqmathbox@##1##2{\eqmakebox{$##1##2$}}}
  \mathpalette\eqmathbox@{#3}
}
\makeatother

\newcommand{\ts}{\quad}

\begin{document}

\[
  \renewcommand{\arraystretch}{2.5}
  \begin{array}{ r r }
          & \eqmakebox[c1]{} \ts 
              \eqmakebox[c2][c]{\textbf{Spherical}} \ts 
              \eqmakebox[c3][c]{\textbf{Cartesian}} \
    l = 0 & \eqmathbox[c1][r]{y_0^0(\theta, \phi) =} \ts 
              \eqmathbox[c2][l]{\sqrt{\dfrac{1}{4 \pi}}} \ts 
              \eqmathbox[c3][l]{\sqrt{\dfrac{1}{4 \pi}},} \
    l = 1 & \left\{\begin{array}{ @{} r @{} }
            \eqmathbox[c1][r]{y_1^{-1}(\theta, \phi) =} \ts 
              \eqmathbox[c2][l]{\sqrt{\dfrac{3}{4 \pi}} \sin \phi \sin \theta} \ts 
              \eqmathbox[c3][l]{\sqrt{\dfrac{3}{4 \pi}} x,} \
            \eqmathbox[c1][r]{y_1^0(\theta, \phi) =} \ts 
              \eqmathbox[c2][l]{\sqrt{\dfrac{3}{4 \pi}} \cos \theta} \ts 
              \eqmathbox[c3][l]{\sqrt{\dfrac{3}{4 \pi}} z,} \
            \eqmathbox[c1][r]{y_1^1(\theta, \phi) =} \ts 
              \eqmathbox[c2][l]{\sqrt{\dfrac{3}{4 \pi}} \cos \phi \sin \theta} \ts 
              \eqmathbox[c3][l]{\sqrt{\dfrac{3}{4 \pi}} y,}
          \end{array}\right.\kern-\nulldelimiterspace \
    l = 2 & \left\{\begin{array}{ @{} r @{} }
            \eqmathbox[c1][r]{y_2^{-2}(\theta, \phi) =} \ts 
              \eqmathbox[c2][l]{\sqrt{\dfrac{15}{4 \pi}} \sin \phi \cos \phi \sin^2 \theta} \ts 
              \eqmathbox[c3][l]{\sqrt{\dfrac{15}{4 \pi}} x y,} \
            \eqmathbox[c1][r]{y_2^{-1}(\theta, \phi) =} \ts 
              \eqmathbox[c2][l]{\sqrt{\dfrac{15}{4 \pi}} \sin \phi \sin \theta \cos \theta} \ts 
              \eqmathbox[c3][l]{\sqrt{\dfrac{15}{4 \pi}} y z,} \
            \eqmathbox[c1][r]{y_2^0(\theta, \phi) =} \ts 
              \eqmathbox[c2][l]{\sqrt{\dfrac{5}{16 \pi}} (3 \cos^2 \theta - 1)} \ts 
              \eqmathbox[c3][l]{\sqrt{\dfrac{5}{16 \pi}} (3 z^2 - 1),} \
            \eqmathbox[c1][r]{y_2^1(\theta, \phi) =} \ts 
              \eqmathbox[c2][l]{\sqrt{\dfrac{15}{4 \pi}} \cos \phi \sin \theta \cos \theta} \ts 
              \eqmathbox[c3][l]{\sqrt{\dfrac{15}{8 \pi}} x z,} \
            \eqmathbox[c1][r]{y_2^2(\theta, \phi) =} \ts 
              \eqmathbox[c2][l]{\sqrt{\dfrac{15}{16 \pi}} (\cos^2 \phi - \sin^2 \phi) \sin^2 \theta} \ts 
              \eqmathbox[c3][l]{\sqrt{\dfrac{15}{32 \pi}} (x^2 - y^2).}
          \end{array}\right.\kern-\nulldelimiterspace \
          & \eqmakebox[c1]{} \ts 
              \eqmakebox[c2][c]{\textbf{Spherical}} \ts 
              \eqmakebox[c3][c]{\textbf{Cartesian}}
  \end{array}
\]

\end{document}

该方法使用框来伪造柱状对齐。外部 array 仅包含两个 r 右对齐列,第一个用于 l = ? 构造,第二个用于其余部分。第二列中的每个元素都设置在一个带有标记的框内(使用 \eqmakebox\eqmathbox):\eq..box[<tag>][<align>]{<stuff>}。每个具有相同 <tag> 的框将具有相同的最大宽度,您可以指定单个框 <align>ment.

您可以改变 \arraystretch 中的数字以增加整个结构的垂直高度。此外,插入 \ts 以表示 tabular s 分离,默认为 1em(或 \quad)的 space。您可以将其更改为(例如)\hspace{2cm} 以在列之间插入更大的水平间隙。