Chemfig – How to Name Multiple Compounds Under a Single Label

chemfigformatting

I know within the chemfig package compounds can be named with the command \chemname. Is there a way to label some compounds under a single label? For example, put a label "Reactants" under the reactants in a reactions scheme.

In the following example:

\documentclass{article}
\usepackage{chemfig,chemmacros}
\begin{document}

\schemestart
\chemfig{R-[:30](=[:90]O)-[:-30]R}
\arrow{0}[,.5]
\chemfig{R'-[:30](=[:90]O)-[:-30]R'}
\arrow{0}[,1.5]
\chemfig{R'-[:30](=[:90]O)-[:-30]R}
\schemestop

\end{document}

I can put a label under the third compound with \chemname, but how can I put a single label under the first two compounds?

Best Answer

If you place the first two compounds in a \subscheme{...} the whole subscheme gets a unique name that you can refer to in an arrow using the \arrow{@<name>--) syntax:

\documentclass{article}
\usepackage{chemfig}
\begin{document}

% uncomment to see the names:
% schemedebug{true}
\schemestart
\subscheme{
  \chemfig{R-[:30](=[:90]O)-[:-30]R}
  \arrow{0}[,.5]
  \chemfig{R'-[:30](=[:90]O)-[:-30]R'}
}
\arrow{0}[,1.5]
\chemfig{R'-[:30](=[:90]O)-[:-30]R}
% use an invisible arrow pointing downwards to place the label text:
\arrow(@c1--){0}[-90,.1]
Below the first two compounds
\schemestop

\end{document}

enter image description here