我想要这样的表:但是我的代码不是那么好看
\开始{中心}\ begin {tabular} {c c c c} &安培; &安培; \ textbf {Sferyczne}& \ textbf {Kartezja艅skie} \ $ l = 0 $& …
这是实现您想要的输出的一种方法:
\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> 换货。
array
r
l = ?
\eqmakebox
\eqmathbox
\eq..box[<tag>][<align>]{<stuff>}
<tag>
<align>
你可以改变号码 \arraystretch 增加整个建筑的垂直高度。也, \ts 插入表示一个 t abular s 分离,默认为空间 1em (要么 \quad )。您可以将此更改为(比如说) \hspace{2cm} 在列之间插入更大的水平间隙。
\arraystretch
\ts
t
s
1em
\quad
\hspace{2cm}