2

I am using chemmacros to write REDOX chemical reactions. I tried using "standalone" to create a file the size of the equation, but it didn't work.

enter image description here

how to solve this problem?

\documentclass[border=2pt]{standalone}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage[dvipsnames]{xcolor}

\usepackage{chemmacros}
\usechemmodule{all}

\begin{document}

\OX{a,Na} $\rightarrow$ \OX{b,Na}\pch

\redox(a,b)[->,red]{ox}

\redox(a,b)[<-,blue][-1]{red}

\end{document}
Zarko
  • 296,517
CrocoDuck
  • 3,875

1 Answers1

1

Try the following:

\documentclass[margin={-0.5mm 6mm}, varwidth]{standalone}
\usepackage{amsmath}
\usepackage[dvipsnames]{xcolor}
\usepackage{chemmacros}
\usechemmodule{all}

\begin{document}

\raisebox{1ex}{
\OX{a,Na} $\rightarrow$ \OX{b,Na}\pch
\redox(a,b)[->,red]{ox}
\redox(a,b)[<-,blue][-1]{redux}
                }

\end{document}

enter image description here

  • It seems that bounding box of this chem expression doesn't consider arrow nor label above/below it, consequently you need to add more vertical space about/below expression.
  • Baseline of expression is not at its vertical center. This is in above MWE corrected by \raisebox.
  • all length are determined by trial/error method :-(
Zarko
  • 296,517