我的代码如下所示,每个方程式都左对齐,我的问题是数组环境中的方程式似乎缩进。我该如何对齐全部方程式是否位于同一条垂直线上?
\documentclass[letterpaper,10 pt,two column,fleqn]{article}
\setlength{\columnsep}{2.5cm}
\usepackage[inner=2.5cm,outer=2.5cm,bottom=2.5cm,top=2.5cm,landscape]{geometry}
\usepackage{nopageno,array,graphicx,amsbsy,amsfonts}
\usepackage{amsmath,MnSymbol,wasysym,bbold}
\newcommand{\ket}[1]{|{#1}\rangle}
\begin{document}
\[S_z\ket{\pm} = \pm\frac{\hbar}{2}\ket{\pm}\]
\[S_{\pm} = S_x\pm S_y\]
\[\begin{array}{ll}
S_z = \dfrac{\hbar}{2}(\ket{+}\bra{+} + \ket{-}\bra{-}) \mbox{\hspace{10mm}}& \ket{s_z,\pm} = \ket{\pm}\\ \\
S_y = \dfrac{-i\hbar}{2}(\ket{+}\bra{-} - \ket{-}\bra{+}) &\ket{s_y,\pm} = \dfrac{1}{\sqrt{2}}(\ket{+}\pm i\ket{-})\\ \\
S_x = \dfrac{\hbar}{2}(\ket{+}\bra{-} + \ket{-}\bra{+}) & \ket{s_x,\pm} = \dfrac{1}{\sqrt{2}}(\ket{+}\pm\ket{-})\\
\end{array}\]
\end{document}
答案1
使用@{}
方式与 相同\begin{array}{@{}ll}
。
\documentclass[letterpaper,10 pt,two column,fleqn]{article}
\setlength{\columnsep}{2.5cm}
\usepackage[inner=2.5cm,outer=2.5cm,bottom=2.5cm,top=2.5cm,landscape]{geometry}
\usepackage{nopageno,array,graphicx,amsbsy,amsfonts}
\usepackage{amsmath,MnSymbol,wasysym,bbold,physics}
%\newcommand{\ket}[1]{|{#1}\rangle}
\begin{document}
\[S_z\ket{\pm} = \pm\frac{\hbar}{2}\ket{\pm}\]
\[S_{\pm} = S_x\pm S_y\]
\[\begin{array}{@{}ll}
S_z = \dfrac{\hbar}{2}(\ket{+}\bra{+} + \ket{-}\bra{-}) \mbox{\hspace{10mm}}& \ket{s_z,\pm} = \ket{\pm}\\ \\
S_y = \dfrac{-i\hbar}{2}(\ket{+}\bra{-} - \ket{-}\bra{+}) &\ket{s_y,\pm} = \dfrac{1}{\sqrt{2}}(\ket{+}\pm i\ket{-})\\ \\
S_x = \dfrac{\hbar}{2}(\ket{+}\bra{-} + \ket{-}\bra{+}) & \ket{s_x,\pm} = \dfrac{1}{\sqrt{2}}(\ket{+}\pm\ket{-})\\
\end{array}\]
\end{document}
附注:您可以选择使用提供许多增强功能的包,而不是定义\ket
和。\bra
physics
答案2
你绝不想要使用连续显示数学环境。
使用align
:
\documentclass[letterpaper,10pt,twocolumn,fleqn]{article}
\usepackage{amsmath,braket}
\begin{document}
\begin{align*}
S_z\ket{\pm} &= \pm\frac{\hbar}{2}\ket{\pm} \\
S_{\pm} &= S_x\pm S_y \\
S_z &= \dfrac{\hbar}{2}(\ket{+}\bra{+} + \ket{-}\bra{-})
& \ket{s_z,\pm} &= \ket{\pm} \\
S_y &= \dfrac{-i\hbar}{2}(\ket{+}\bra{-} - \ket{-}\bra{+})
& \ket{s_y,\pm} &= \dfrac{1}{\sqrt{2}}(\ket{+}\pm i\ket{-}) \\
S_x &= \dfrac{\hbar}{2}(\ket{+}\bra{-} + \ket{-}\bra{+})
& \ket{s_x,\pm} &= \dfrac{1}{\sqrt{2}}(\ket{+}\pm\ket{-})
\end{align*}
\end{document}
我已经加载了braket
的包\ket
。
或者,如果您不想让第一个等式与后面的等式在等号处对齐,则有gather
和aligned
:
\documentclass[letterpaper,10pt,twocolumn,fleqn]{article}
\usepackage{amsmath,braket}
\begin{document}
\begin{gather*}
S_z\ket{\pm} = \pm\frac{\hbar}{2}\ket{\pm} \\
\!\begin{aligned}
S_{\pm} &= S_x\pm S_y \\
S_z &= \dfrac{\hbar}{2}(\ket{+}\bra{+} + \ket{-}\bra{-})
& \ket{s_z,\pm} &= \ket{\pm} \\
S_y &= \dfrac{-i\hbar}{2}(\ket{+}\bra{-} - \ket{-}\bra{+})
& \ket{s_y,\pm} &= \dfrac{1}{\sqrt{2}}(\ket{+}\pm i\ket{-}) \\
S_x &= \dfrac{\hbar}{2}(\ket{+}\bra{-} + \ket{-}\bra{+})
& \ket{s_x,\pm} &= \dfrac{1}{\sqrt{2}}(\ket{+}\pm\ket{-})
\end{aligned}
\end{gather*}
\end{document}