TransWikia.com

Align chemical equation with potential

TeX - LaTeX Asked on July 30, 2021

I want to make numbered chemical equation with the potential of that equation on the right. This is what I have:

begin{align}
label{eq:NiOOH}
    ce{NiOOH + H2O + e- &<=>[discharge][charge] Ni(OH)2 + OH-}
    tagaddtext{[$E_0,red=0,52$ si{volt}]}
end{align}

For most of the equations this work, however if equation is too long it overlapse with potential:
enter image description here

I tried to align equation to the left with FLALIGN, but there was no change.

All other complex equations looks the same:
enter image description here

2 Answers

enter image description here

documentclass{article}
usepackage{chemmacros}
usechemmodule{reactions}
usepackage{siunitx}

begin{document}

begin{reaction}
    NiOOH + H2O + e- <=>[discharge][charge] Ni(OH)2 + OH-
     $qquad[E_0,red=SI{0,52}{volt}]$ label{rct:NiOOH}
end{reaction}

end{document}

Answered by leandriis on July 30, 2021

I propose this MWE and I have get this using for the double arrow chemarrow package. Of course you can always use the specific chemmacros package. For the use of tagaddtext from this site, you must add the code:

makeatletter
providecommandadd@text{}
newcommandtagaddtext[1]{%
  gdefadd@text{#1gdefadd@text{}}}% 
renewcommandtagform@[1]{%
  maketag@@@{llap{add@textquad}(ignorespaces#1unskip@@italiccorr)}%
}
makeatother

It is very important that you add a minimal complete compilable code.

documentclass[a4paper,12pt]{article}
usepackage{amsmath}
usepackage[margin=2cm]{geometry}
usepackage{chemarrow}
usepackage{siunitx}
sisetup{detect-all}

makeatletter
providecommandadd@text{}
newcommandtagaddtext[1]{%
  gdefadd@text{#1gdefadd@text{}}}% 
renewcommandtagform@[1]{%
  maketag@@@{llap{add@textquad}(ignorespaces#1unskip@@italiccorr)}%
}
makeatother

begin{document}
begin{align}
mathrm{NiOOH + H_2O + e^-} autorightleftharpoons{discharge}{charge} mathrm{Ni(OH)_2 + OH^-}& &tagaddtext{$[E_0, text{red}=0.52 si{volt}]$}
label{eq:NiOOH}
end{align}
end{document}

enter image description here

Answered by Sebastiano on July 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP