2

Okay, so i use mhchem package, and i've used the preamble for numerizing each equation, but this gives me trouble aligning the equations.

I want my equations aligned like this:

\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[danish]{babel}
\usepackage{fixltx2e}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\usepackage{stmaryrd} %plimsommer = \minuso

\makeatletter
\newcounter{reaction}
\renewcommand\thereaction{rx:\,\Roman{reaction}}
\newcommand\reactiontag%
{\refstepcounter{reaction}\tag{\thereaction}}
\newcommand\reaction@[2][]%
{\begin{equation}\cee{#2}%
\ifx\@empty#1\@empty\else\label{#1}\fi%
\reactiontag\end{equation}}
\newcommand\reaction@nonumber[1]%
{\begin{equation*}\cee{#1}\end{equation*}}
\newcommand\reaction%
{\@ifstar{\reaction@nonumber}{\reaction@}}
\makeatother %This makes \reaction have numbering

\begin{document}

    \begin{align*}
        \cee{&CH4(g) + 2SO2(g) -> CO2(g) + 2H2O(g) \\
        &$\Delta H\textsubscript{I}^\minuso=-804.2\text{ kJ/mol}$\\
        &C2H6(g) + 3.5O2(g) -> 2CO2(g) + 3H2O(g) \\
        &$\Delta H\textsubscript{II}^\minuso=-1428.9\text{ kJ/mol}$\\
        &C3H8(g) + 5O2(g) -> 3CO2(g) + 4H2O(g)\\
        &$\Delta H\textsubscript{III}^\minuso=-2045.5\text{ kJ/mol}$}
        \end{align*}

\end{document}

But this will not have the numerizing, like this piece of code will

\reaction{CH4(g) + 2SO2(g) -> CO2(g) + 2H2O(g)}\\
$\Delta H\textsubscript{I}^\minuso=-804.2\text{ kJ/mol}$
\reaction{C2H6(g) + 3.5O2(g) -> 2CO2(g) + 3H2O(g)}\\
$\Delta H\textsubscript{II}^\minuso=-1428.9\text{ kJ/mol}$
\reaction{C3H8(g) + 5O2(g) -> 3CO2(g) + 4H2O(g)}\\
$\Delta H\textsubscript{III}^\minuso=-2045.5\text{ kJ/mol}$

Can you help me align the last equations, similarly to the first ones?

1

If you have an up to date TeX distribution you can use existing packages:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}

\usepackage{chemmacros}[2015/09/23]
\chemsetup{
  formula = mhchem , % use mhchem for formulas
  modules = {reactions,thermodynamics} % load needed modules
}
% redefine \enthalpy to have standard subscript to the right:
\RenewChemState\enthalpy{
  symbol = H ,
  subscript-pos = right ,
  unit = \kilo\joule\per\mole
}
\sisetup{% unit settings
  per-mode = symbol
}

\begin{document}

\begin{reactions}
  CH4(g) + 2SO2(g)   &-> CO2(g) + 2H2O(g)  && {\enthalpy(I){-804.2}} \\
  C2H6(g) + 3.5O2(g) &-> 2CO2(g) + 3H2O(g) && {\enthalpy(II){-1428.9}} \\
  C3H8(g) + 5O2(g)   &-> 3CO2(g) + 4H2O(g) && {\enthalpy(III){-2045.5}}
\end{reactions}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.