\begin{align}
&\vec{\nabla} \cdot \vec{E} = \frac{\rho}{\epsilon_0} & \text{Gauss’s Law}\\
&\vec{\nabla} \cdot \vec{B} = 0 & \text{Gauss’s Law for Magnetism}
\end{align}
Asked
Active
Viewed 250 times
4
Bernard
- 271,350
Sophie Feng
- 49
2 Answers
12
. You've forgotten that n alignment points requires 2n -1 ampersands: one to introduce each alignment column but the first, and one for each alignment point in its column. So try this:
\begin{align}
\vec{\nabla} \cdot \vec{E} &= \frac{\rho}{\epsilon_0} & &\text{Gauss’ Law}\\
\vec{\nabla} \cdot \vec{B} &= 0 & &\text{Gauss’ Law for Magnetism}
\end{align}
Bernard
- 271,350
-
4Also, you can't have a blank line in an align environment. – Teepeemm Oct 21 '21 at 17:39
-
@Teepeem: That's right. I mainly focused on the number of ampersands, so I forgot this point. Thanks for pointing it! – Bernard Oct 21 '21 at 17:44
3
A different approach using a simple enviroment array where I have used a different aesthetic of LaTeX-code. It is possible also to use also alignat instead of an array.
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\begin{document}
\[
\begin{array}{lll}
\boldsymbol{\nabla}\cdot \mathbf{E} = \dfrac{\rho}{\epsilon_0} &\qquad \text{Gauss's Law}\\
\boldsymbol{\nabla}\cdot \mathbf{B} = \mathbf{0} &\qquad \text{Gauss's Law for Magnetism}
\end{array}
\]
\end{document}
Sebastiano
- 54,118

