Math & ScienceBreak up Equation and keep its Label right

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
NinaKeul
Posts: 5
Joined: Fri Sep 07, 2012 9:48 pm

Break up Equation and keep its Label right

Post by NinaKeul »

Dear all,

I am an newbie to LaTeX and hope that somebody can help me.

I have read through many forum postings, but could not find an answer, that would solve my problem.

I am trying to include a couple of equations into my thesis and have problems with placing the equation label exactly on the right for equations that are longer than one line (for single line equations it works just fine).


Below is a minimal examples of my code.

Thank you very much in advance,
Nina

Code: Select all

\documentclass[a4paper, twoside, titlepage, openright, 12pt, listof=totoc]{scrreprt}
\usepackage{amsmath, amssymb}		

\begin{document}

\begin{equation}
DIC =[CO_2^*]+[HCO_3^-]+ [ CO_3^{ 2-}]
\label{equ:4}
\end{equation}

\begin{equation}
  TA =[HCO_3^-]+2 [ CO_3^{ 2-}]+[B(OH)_4^-]+[OH^-]+[HPO_4^{2-}]+2[PO_4^{3-}]\\
  +[Si(OH)_3^-]+[NH_3]+ [HS^-]+...-[H^+]_F-[HF]-[H_3PO_4]-...                             \label{equ:6}
\end{equation}
\end{document}
Last edited by localghost on Fri Sep 07, 2012 9:59 pm, edited 2 times in total.

Recommended reading 2024:

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

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

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Break up Equation and keep its Label right

Post by cgnieder »

Hi Nina,

Welcome to the LaTeX community!

The split environment provided by amsmath is what you need. Details on it and on many other math related stuff can be found in the excellent mathmode document.

I couldn't help noticing that you're trying to typeset chemical formulas. For that task I would recommend either using the mhchem or the chemmacros package. Here is an example:

Code: Select all

\documentclass{scrreprt}
\usepackage{amsmath}
\usepackage{chemmacros}

\begin{document}

\begin{equation}
 DIC = \ch{[CO2^*] + [HCO3^-] + [CO3^{2-}]} \label{equ:4}
\end{equation}

\begin{equation}
\begin{split}
 TA &= \ch{[HCO3^-] + 2 [CO3^{2-}] + [B(OH)4^-] + [OH^-] + [HPO4^{2-}] + 2 [PO4^{3-}]} \\
   &\quad \ch{+ [Si(OH)3^-] + [NH3] + [HS^-] +} \ldots - \ch{[H^+]_F} - \ch{[HF]} - \ch{[H3PO4]} - \ldots
\end{split}
\end{equation}

\end{document}
Regards
site moderator & package author
NinaKeul
Posts: 5
Joined: Fri Sep 07, 2012 9:48 pm

Re: Break up Equation and keep its Label right

Post by NinaKeul »

Hi Clemens,

thank you very much for the fast solution and pointing me to teh packages for chemical formulas.

Works perfectly!

Best wishes,
Nina
Post Reply