Math & ScienceAlignment inside the \align enviroment

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Eenzc
Posts: 48
Joined: Thu Jun 26, 2008 2:38 pm

Alignment inside the \align enviroment

Post by Eenzc »

Hello,

I'm using \begin{align} instead of \begin{equation} because it allows me to align my equals signs and reaction <=> symbols above each other.

However In one case I have a third column in which I have a series of numbers that I would like to align above each other. This could be easily acomplished if I could set the alignment of that column to left align.

Is there a way to do this inside the align enviroment?

Code: Select all

%%%% Math Packages 
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}

%%%% Chemistry Specific
\usepackage{sistyle} % includes SI style sheets
\usepackage[version=3]{mhchem}

%%%% Custom standard symbol

\makeatletter
\providecommand\barcirc{\mathpalette\@barred\circ}
\def\@barred#1#2{\ooalign{\hfil$#1-$\hfil\cr\hfil$#1#2$\hfil\cr}}
\newcommand\stst{^{\protect\barcirc}}

%%%%%%%%%%%%

Code: Select all


\begin{align}
\ce{O2 + 4H+ + 4e}	~& \ce{<=> 2H2O}   ~& E\stst : \SI{+1.2300}{V}  \\
\ce{O2 + 2H+ + 2e} 	~& \ce{<=> H2O2}   ~& E\stst : \SI{+0.695}{V}
\end{align}

The problem being that because the numbers are to a different precision the column is skewed.

Many thanks.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

Alignment inside the \align enviroment

Post by localghost »

In this case the alignat environment is more suitable.

Code: Select all

\begin{alignat}{2}
  \ce{O2 + 4H+ + 4e} & \ce{<=> 2H2O} &\qquad\qquad\qquad E\stst &: \SI{+1.2300}{V}  \\
  \ce{O2 + 2H+ + 2e} & \ce{<=> H2O2} & E\stst &: \SI{+0.695}{V}
\end{alignat}
A good description of this environment is given in the "Math mode" document.

One additional hint at the end. Perhaps the \ominus symbol does it instead of your complex defined \stst command.

Code: Select all

\[
  E^\ominus
\]

Best regards
Thorsten¹
Eenzc
Posts: 48
Joined: Thu Jun 26, 2008 2:38 pm

Re: Alignment inside the \align enviroment

Post by Eenzc »

Thanks that was very helpful.
Post Reply