1

This is very likely a very dumb question. Please embarrass me. :-)

I enjoy using the chemmacros package tremendously. But I just don't seem to be able to get the \redox module work for me.

The PDF looks alright during the compiling but finishes wrong. There will be no overhead bridging at all, just a short vertical stick/arrow at the end of the equation, with "oxidation" above it.

I suspect \redox can't find the nodes defined by \OX but I just don't see why.

Here's the Minimum non-Working Example:

\documentclass{scrartcl}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{upgreek}
\usepackage{chemfig}
\usepackage{chemformula}
\usepackage{chemmacros}

\begin{document}
\vspace{7mm}
\OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b){oxidation}
\end{document}

enter image description here

5
  • Welcome to TeX.SX! Your example compiles without errors on my computer, and maybe the output is wrong but I don't know what it should look like. Maybe you could add a picture of the intended output?
    – Vincent
    Mar 9, 2023 at 2:01
  • Thanks Vincent for trying to help me! I've added my result. I said that I suspected the \redox cannot find the nodes defined. But on second thought, that can't be the case as the PDF temporarily looked correct during compiling (I use SumatraPDF for viewing). Just that the final result came out wrong.
    – Franxon
    Mar 9, 2023 at 2:11
  • I got a different output (a line going up from "Na", then right with "oxidation" written on top, then down to "Na+"). Are you sure your TeX distribution is up to date?
    – Vincent
    Mar 9, 2023 at 2:25
  • texlive = 2022. vscode. texworkshop. lualatex.
    – Franxon
    Mar 9, 2023 at 2:40
  • I reinstalled the texlive 2022, took nearly 6 hours but it solved a couple of problems. I also realised that the siunitx package font-family = \sffamily option is also contributing to the same problem, when the chemical equation is complicated. When I unchecked it, not only did I get the \redox working, I got the sorrily missed \tableofcontents back too!
    – Franxon
    Mar 9, 2023 at 10:21

1 Answer 1

0

This code work for me

\documentclass{scrartcl}
\usepackage{amsmath}
\usepackage{chemformula}
\usepackage{chemmacros}
\begin{document}
    \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b)[blue,-stealth]{oxidation}
\end{document}

enter image description here

One more complete code

\documentclass[margin={1mm 7mm}, varwidth]{standalone}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage[dvipsnames]{xcolor}
\usepackage{chemmacros}
\usechemmodule{all}

\begin{document}
 \ch{2 "\OX{o1,\ox*{0,Na}}" + "\OX{r1,\ox*{0,Cl}}" {}2
    -> 2 "\OX{o2,\ox*{+1,Na}}" {}+ + 2 "\OX{r2,\ox*{-1,Cl}}" {}-}
\redox(o1,o2)[green,-stealth]{\small OX}
\redox(r1,r2)[purple,-stealth][-1]{\small RED}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .