Math & ScienceAlignment of Equation Labels

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Ashiataka
Posts: 12
Joined: Tue Jun 26, 2012 2:38 pm

Alignment of Equation Labels

Post by Ashiataka »

I want to include labels preceding each of Maxwell's Equations. The problem is that at the moment the label impinges on the actual equation. So what I need to know is how to left align the commments.

I hope that makes sense. Thank you.

Code: Select all

\begin{subequations}
 Maxwell's equations (Differential Form):
\begin{align}
          \textrm{Gauss' Law} &\nabla \cdot \vec{E}  =  \frac{\rho}{\varepsilon_0}\\
         \textrm{Gauss' Law ($\vec{B}$ Fields)}  &\nabla \cdot \vec{B}  =  0\\
         \textrm{Faraday's Law} &\nabla \times \vec{E}  = - \frac{\partial \vec{B}}{\partial t}\\
         \textrm{Ampere's Law} &\nabla \times \vec{B}  =  \mu_0 \vec{J} + \mu_0\varepsilon_0\frac{\partial \vec{E}}{\partial t}
\end{align}
\end{subequations}
Last edited by Stefan Kottwitz on Tue Jun 26, 2012 3:48 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Alignment of Equation Labels

Post by localghost »

Try something like this.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools}    % loads »amsmath«

\begin{document}
  Maxwell's equations (Differential Form):
  \begin{subequations}
    \begin{alignat}{2}
      \mathllap{\text{Gauss' Law}\qquad} && \nabla\cdot\vec{E} &= \frac{\rho}{\varepsilon_0} \\
      \mathllap{\text{Gauss' Law ($\vec{B}$ Fields)}\qquad} && \nabla\cdot\vec{B}  &= 0 \\
      \mathllap{\text{Faraday's Law}\qquad} && \nabla\times\vec{E} &= -\frac{\partial \vec{B}}{\partial t} \\
      \mathllap{\text{Ampere's Law}\qquad} && \nabla\times\vec{B} &= \mu_0\vec{J}+\mu_0\varepsilon_0\frac{\partial\vec{E}}{\partial t}
    \end{alignat}
  \end{subequations}
\end{document}
Study the mathtools manual for more information.

For more helpful stuff about math typesetting refer to the »Math mode« document.


Best regards and welcome to the board
Thorsten
Ashiataka
Posts: 12
Joined: Tue Jun 26, 2012 2:38 pm

Re: Alignment of Equation Labels

Post by Ashiataka »

Thank you :).
Post Reply