1

I am using the chemmacros package and I would like to know if it's possible to write next to a reaction, for example, like this:enter image description here Or maybe with the help of other package.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{{./images/}}
\usepackage[figuresleft]{rotating}
\usepackage{hyperref}
\usepackage[spanish,es-noquoting]{babel}
\usepackage{chemmacros}
\chemsetup{modules={reactions,thermodynamics}}
\usepackage[margin=2.5cm]{geometry}
\renewcommand{\baselinestretch}{1.15}
\usepackage{helvet} 
\renewcommand{\familydefault}{\sfdefault}
\pagenumbering{roman}

\begin{document}
\begin{reactions*}
    2 NH3\gas{} + 5/2 O2\gas{} &-> 3 H2O\gas{} + 2 NO\gas{}\\
    2 NH3\gas{} + 2 O2\gas{} &-> 3 H2O\gas{} + N2O\gas{}\\
    2 NH3\gas{} + 3/2 O2\gas{} &-> 3 H2O\gas{} + N2\gas{}
\end{reactions*}
\end{document}
  • Is there any special trick necessary to compile the code? I get Paragraph ended before \@fileswith@ptions was complete. – Snobbish Hi-rep users Apr 25 at 19:17
  • missing closing braces of \usepackage{babel} @valerie – Weijun Zhou Apr 25 at 19:18
  • @WeijunZhou Thanks! – Snobbish Hi-rep users Apr 25 at 19:24
2

Adding another alignment point:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{{./images/}}
\usepackage[figuresleft]{rotating}
\usepackage{hyperref}
\usepackage[spanish,es-noquoting]{babel}
\usepackage{chemmacros}
\chemsetup{modules={reactions,thermodynamics}}
\usepackage[margin=2.5cm]{geometry}
\renewcommand{\baselinestretch}{1.15}
\usepackage{helvet} 
\renewcommand{\familydefault}{\sfdefault}
\pagenumbering{roman}

\begin{document}
\begin{reactions*}
    2 NH3\gas{} + 5/2 O2\gas{} &-> 3 H2O\gas{} + 2 NO\gas{}  & text\\
    2 NH3\gas{} + 2 O2\gas{} &-> 3 H2O\gas{} + N2O\gas{}  & text\\
    2 NH3\gas{} + 3/2 O2\gas{} &-> 3 H2O\gas{} + N2\gas{}  & text
\end{reactions*}
\end{document}

enter image description here

  • Thanks, this works for me, but I seems that this way you can't use spaces, because it seems to ignore them. – Daniel Álvarez Apr 28 at 17:43
0

chemmacros has a special function to typeset such states:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{{./images/}}
\usepackage[figuresleft]{rotating}
\usepackage{hyperref}
\usepackage[spanish,es-noquoting]{babel}
\usepackage{chemmacros}
\chemsetup{modules={reactions,thermodynamics}}
\usepackage[margin=2.5cm]{geometry}
\renewcommand{\baselinestretch}{1.15}
\usepackage{helvet} 
\renewcommand{\familydefault}{\sfdefault}
\pagenumbering{roman}

\NewChemState\foo{symbol=H,superscript=$\circ$,unit=\kilo\joule,subscript-pos=right}

\begin{document}

\begin{align*}
    \ch{2 NH3\gas{} + 5/2 O2\gas{} &-> 3 H2O\gas{} + 2 NO\gas{}} && \foo(A){+2035}  \\
    \ch{2 NH3\gas{} + 2 O2\gas{} &-> 3 H2O\gas{} + N2O\gas{}}&& \foo(B){+36}\\
    \ch{2 NH3\gas{} + 3/2 O2\gas{} &-> 3 H2O\gas{} + N2\gas{}}&& \foo(C){-285}
\end{align*}

\end{document}

enter image description here

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.