Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

My code is shown below, every equation is left aligned, my problem is that the equations inside the array enviroment seem to be indented. How can I align all the equations to the same vertical line?

\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}
share|improve this question

2 Answers 2

up vote 3 down vote accepted

Use @{} as in \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}

enter image description here

As a side note, instead of defining \ket and \bra, you may opt to use physics package that offers many enhancements.

share|improve this answer

You never want to use consecutive display math environments.

Use 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}

enter image description here

I've loaded the braket package for \ket.

Alternatively, if you don't want the first equation to be aligned at the equals with the following ones, there's gather and 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}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.