4

As explained in this answer, the difference between align and alignat lies chiefly in the presence of some spacing between even and odd columns.

I would like to get the same result as with alignat (i.e. no spacing) but with a unique equation tag, similar to the use of aligned within equation (which adds spacing in the same way as align)

mwe

\documentclass[preview]{standalone}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage[T1]{fontenc} 
\usepackage[latin1]{inputenc}
\begin{document}
I would like the same spacing as in:
    \begin{alignat}{2}
      \nu_n &= \mu_n \vec{F}_n &&= - \mu_n \nabla\phi_n\\
      \nu_p &= \mu_p \vec{F}_p &&= - \mu_p \nabla\phi_p,
    \end{alignat}
but with only one tag, as in:
    \begin{equation}
      \begin{aligned}
        \nu_n &= \mu_n \vec{F}_n &&= - \mu_n \nabla\phi_n\\
        \nu_p &= \mu_p \vec{F}_p &&= - \mu_p \nabla\phi_p
      \end{aligned}.
    \end{equation}
\end{document}

pic

Davide
  • 608
  • 1
    you might try taking a look at the amsmath user's guide (texdoc amsmath). it covers all the possibilities in very few pages. – barbara beeton Dec 08 '15 at 14:17

2 Answers2

6

Just use the "internal" form alignedat.

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation}
  \begin{alignedat}{2}
  \nu_n &= \mu_n \vec{F}_n &&= - \mu_n \nabla\phi_n\\
  \nu_p &= \mu_p \vec{F}_p &&= - \mu_p \nabla\phi_p,
  \end{alignedat}
\end{equation}

\end{document}

You may want to add a small negative space \! in front of the alignedat environment, see e.g. here.

campa
  • 31,130
  • wow i was looking for an alignedat environment exactly.... but when i tried something was wrong in my code (errors showed up), so i thought that ther was no alignedat ended up googling.. but nothing showed up for alignedat! – Davide Dec 08 '15 at 13:28
0

a partial solution may be to use subequations:

\documentclass[preview]{standalone}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage[T1]{fontenc} 
\usepackage[latin1]{inputenc}
\begin{document}
    \begin{subequations}\label{both:equations}
      \begin{alignat}{2}
        \nu_n &= \mu_n \vec{F}_n &&= - \mu_n \nabla\phi_n\\
        \nu_p &= \mu_p \vec{F}_p &&= - \mu_p \nabla\phi_p,
      \end{alignat}
    \end{subequations}
\end{document}

which allows to reference both equations with one number - but still produces two tags...

Davide
  • 608