LaTeX forum ⇒ Math & ScienceAligning Equations

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

Aligning Equations

Postby nomargfan661 » Wed Oct 30, 2013 6:34 pm

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!!!

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

Brandon

Tags:

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

Postby localghost » Wed Oct 30, 2013 7:21 pm

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.
  1. \documentclass[11pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{mathtools}
  4. \usepackage{chemformula}
  5. \usepackage{siunitx}
  6.  
  7. \begin{document}
  8. \begin{subequations}
  9. \begin{alignat}{2}
  10. \ch{O2 + $h\nu$ &-> O + O} & J_2 &= \SI{2e-9}{\per\s} \\
  11. \ch{O + O &-> O2} & k_{11} &= (\SI{1.3e-9}{\cm\cubed\per\s}) \times f \\
  12. \ch{O + O2 &-> O3} & k_{12} &= (\SI{2.4e-2}{\cm\cubed\per\s}) \times f \\
  13. \ch{O3 + $h\nu$ &-> O2 + O(^1 D)} &\qquad J_3 &= \SI{e-2}{\per\s} \\
  14. \ch{O(^1 D) + O2 &-> O + O2} & k'_{12} &= \SI{0.6e-10}{\cm\cubed\per\s} \\
  15. \ch{O(^1 D) + O3 &-> 2 O2} & k'_{13} &= \SI{2.4e-10}{\cm\cubed\per\s}
  16. \end{alignat}
  17. \end{subequations}
  18. \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
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 2 guests