Math & ScienceAligning Equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
nomargfan661
Posts: 1
Joined: Wed Oct 30, 2013 6:17 pm

Aligning Equations

Post by nomargfan661 »

Hello all,
I have been searching for the past hour (approximately) for solutions to two problems with LaTeX, and I have found solutions for one problem or another, but haven't been able to find the solution for both.

My goal is to vertically AND horizontally align a group of equations. Each row of equations has two columns and there are a total of six rows. I also used subequations, which allowed me to vertically align the equations (i.e. 3a, 3b, 3c, etc.) however doing that did not permit me to horizontally align my equations. What I am trying to accomplish is get the space that is seen below between the equations as well as getting 3a, 3b, 3c, etc.

Any help would be greatly appreciated!!!

Code: Select all

\begin{eqnarray}
	O_2 + h\nu \rightarrow O + O & J_2 = 2 \times 10^{-9} s^{-1}  \\
	O + O \rightarrow O_2 & k_{11} = (1.3 \times 10^{-9}cm^{3}s^{-1}) \times f \\
	O + O_2 \rightarrow O_3 & k_{12} = (2.4 \times 10^{-2} cm^{3}s^{-1}) \times f \\
	O_3 + h\nu \rightarrow O_2 + O(^1 D) &  J_3 = 10^{-2} s^{-1} \\
	O(^1 D) + O_2 \rightarrow O + O_2 & k'_{12} = 0.6 \times 10^{-10} cm^{3}s^{-1} \\
	O(^1 D) + O_3 \rightarrow 2O_2 & k'_{13} = 2.4 \times 10^{-10} cm^{3}s^{-1}
\end{eqnarray}
Brandon

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

Aligning Equations

Post by localghost »

nomargfan661 wrote:[…] I have been searching for the past hour (approximately) for solutions to two problems with LaTeX, and I have found solutions for one problem or another, but haven't been able to find the solution for both.[…]
That is difficult to imagine since this is a FAQ.

Avoid eqnarray! In the meantime it should got around that this environment is better replaced by those from amsmath. This package also provides the subequations environment which formats the numbering as desired.

But I think that you need a bit more than the alignment for equations and an appropriate sub-numbering.
  • Chemical compounds can be typeset by chemformula from the chemmacros bundle.
  • For physical quantities it is suggestive to use siunitx.
All these suggestions in form of code look like this.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\usepackage{chemformula}
\usepackage{siunitx}

\begin{document}
  \begin{subequations}
    \begin{alignat}{2}
      \ch{O2 + $h\nu$ &-> O + O}          &           J_2 &= \SI{2e-9}{\per\s} \\
      \ch{O + O &-> O2}                   &        k_{11} &= (\SI{1.3e-9}{\cm\cubed\per\s}) \times f \\
      \ch{O + O2 &-> O3}                  &        k_{12} &= (\SI{2.4e-2}{\cm\cubed\per\s}) \times f \\
      \ch{O3 + $h\nu$ &-> O2 + O(^1 D)}   &\qquad     J_3 &= \SI{e-2}{\per\s} \\
      \ch{O(^1 D) + O2 &-> O + O2}        &       k'_{12} &= \SI{0.6e-10}{\cm\cubed\per\s} \\
      \ch{O(^1 D) + O3 &-> 2 O2}          &       k'_{13} &= \SI{2.4e-10}{\cm\cubed\per\s}
    \end{alignat}
  \end{subequations}
\end{document}
For details and more possibilities for customization please have a look at the manuals of the involved packages.


Best regards and welcome to the board
Thorsten
Post Reply