# Chemmacros reaction(s) environment doesn't display the first reactant if enclosed in square brackets

When typing reactions starting with coordinating compounds, I noticed that when the first reactant starts with "[" in both reaction and reactions environments the part enclosed in square brackets isn't rendered correctly:

\documentclass{article}
\usepackage{chemmacros}
\chemsetup{modules = all}

\begin{document}

\begin{reaction}
[ML6]A <=> [ML6]+ + A-
\end{reaction}

\end{document}


Neither pdflatex, nor xelatex show any error messages. Empirically I discovered that adding a pair of square brackets to the reaction(s) environment solves the problem:

\documentclass{article}
\usepackage{chemmacros}
\chemsetup{modules = all}

\begin{document}

\begin{reaction}[]
[ML6]A <=> [ML6]+ + A-
\end{reaction}

\end{document}


I'm also curious why \begin{reaction}[] actually works – maybe there are some arguments that reaction(s) environment expects?

• not specific to the reaction environment. it's just how latex works. see e.g. Error with square bracket in table or just try \documentclass{article}\begin{document}\begin{figure}[Test]\end{figure}\end{document} and you will get an error about unknown positional arguments. – Troy Dec 4 '18 at 17:07
• @Troy I see. So, what do you think would be the best course of action here: leave a couple of empty [] brackets every time, use {[} for the first complex, or something else? Also I find it weird that compilers don't complain at all as if ML6 were a valid argument. – andselisk Dec 4 '18 at 17:53
• in this case, I would do [] since it seems to be the quickest way to do it. I don't think one has any advantage (apart from flow of typing) over the other. maybe Clemens would have something to say regarding your second statement. – Troy Dec 4 '18 at 18:26
• chemmacros doesn't do this anymore with the newest release (should be available in the main distributions in a few days) – cgnieder Sep 27 '19 at 11:16

This is not a problem with an up to date chemmacros (v5.8f):

\documentclass{article}
\chemsetup{modules = reactions}

\begin{document}

\begin{reaction}
[ML6]A <=> [ML6]+ + A-
\end{reaction}

\begin{reaction}[]
[ML6]A <=> [ML6]+ + A-
\end{reaction}

\end{document}


• I really appreciate your competence. – Sebastiano Oct 14 '19 at 21:16