I'm using the chemmacros
package, its reactions
environment, and the article
document class:
\documentclass[a4paper, 12pt]{article}
\usepackage{amsmath, amsthm, amssymb, mathtools}
\usepackage{upgreek, chemfig, chemmacros}
\chemsetup{modules = all}
\chemsetup[reactions]{ before-tag = \thesection. } % Adds section number to label
\makeatletter
\@addtoreset{reaction}{section}
\makeatother
\begin{document}
\section{Galvanic cell}
\begin{reactions}
Zn &-> Zn\pch[2] + 2 e\mch \label{eq:galvZnR} \\
Cu\pch[2] + 2 e\mch &-> Cu \label{eq:galvCuR}
\end{reactions}
As seen in~\ref{eq:galvZnR} and~\ref{eq:galvCuR}...
\end{document}
Now I want to change the reactions label numbering to include the section number. From the chemmacros manual I found the way using the reaction/before-tag.
But the reference to the label does not include the section number. How do I fix this? I tried \numberwithin{equation}{section}
since reactions
only is a wrapper to align (?) but it does not work.
My next guess would be entirely redefining the reactions environment as seeen in https://tex.stackexchange.com/a/267804 but that seems like a rather dirty way.
Thanks for the help!