Math & ScienceNotes to the right of equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Hundisch
Posts: 1
Joined: Tue Mar 22, 2011 5:23 pm

Notes to the right of equations

Post by Hundisch »

I'm not a frequent user of LateX, so this question could well have an obvious solution. I'm trying to create a set of equations on seperate lines which have justification notes on the right of some of the equations.

I used the code below hoping that the second set of equations aligned with & on each line would align but it doesn't seem to. It creates a space between the note and the equation on the same line but doesn't align the notes with each other.

Code: Select all

Let $f: G \rightarrow G'$ be a homomorphism with trivial kernel.  Then $f$ is injective.  

\begin{align}
  f(a)&=f(b) \nonumber\\
  f(a)^{-1} f(a) &= f(a^{-1})f(b) &(f(a)^{-1} = f(a^{-1})) \nonumber\\
  e' &= f(a^{-1}b) &(f(ab) = f(a)f(b)) \nonumber\\
  e &= a^{-1}b &(f^{-1}(e) = {e}) \nonumber
\end{align}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Notes to the right of equations

Post by localghost »

Please always provide a minimal example that is compilable as is. Otherwise specific help is nearly impossible especially when a problem becomes more complicated.

For your problem you have to use the alignat environment from the amsmath package.

Code: Select all

\documentclass[11pt,a4paper]{article}   
\usepackage{fixltx2e}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}   % loads »amsmath«

\begin{document}
Let $f: G \rightarrow G'$ be a homomorphism with trivial kernel.  Then $f$ is injective. 

\begin{alignat*}{2}
  f(a) &= f(b)\\
  f(a)^{-1} f(a) &= f(a^{-1})f(b) &\qquad\qquad (f(a)^{-1} &= f(a^{-1})) \\
  e' &= f(a^{-1}b) & (f(ab) &= f(a)f(b)) \\
  e &= a^{-1}b & (f^{-1}(e) &= {e})
\end{alignat*}
\end{document}
Further explanations in the package manual or in the excellent »Math mode« document.


Best regards and welcome to the board
Thorsten
Post Reply