2

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}
3
  • Is there any special trick necessary to compile the code? I get Paragraph ended before \@fileswith@ptions was complete. Apr 25, 2019 at 19:17
  • missing closing braces of \usepackage{babel} @valerie Apr 25, 2019 at 19:18
  • @WeijunZhou Thanks! Apr 25, 2019 at 19:24

2 Answers 2

3

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

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

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

1
  • Oh, I see. Thanks a lot.
    – user186414
    May 5, 2019 at 10:10

You must log in to answer this question.