[Tex/LaTex] chemfig chemname alignment

chemfighorizontal alignment

I wish to have a reaction in \chemfig and write some details under each molecule so am using the \chemname command. It puts the text under the molecule. However, as I have arrows in the reaction scheme, the whole system is misaligned. I have tried to use the \chemnameinit command to set the depth of the deepest molecule (commented out in lines 6-10 of the MWE below), but to no avail. Am I missing something simple?!

I tried putting the \arrow(){} command within the \chemname{} but that spits out errors. Having the \chemname{\chemfig{structure}{line 1\\ line2\\ line3\\ line4}} keeps the molecules aligned (without the \\ no alignment of molecules!)

\documentclass{standalone}
\usepackage{chemfig,chemmacros}
\usepackage{graphicx}
\begin{document}
\schemestart
%\chemnameinit{\chemfig{CH_3-C(-[:90]CH_3)(-[:-90]CH_3)-{\color{blue}\lewis{0:2:6:,Cl}}}}
%\chemnameinit{\chemfig{AlCl_3}}
%\chemnameinit{\chemfig{CH_3-C(-[:90]CH_3)(-[:-90]CH_3)-\chemabove{{\color{red}\lewis{0:2:6:,Cl}}}{\pch}-Al(-[:90]Cl_3)(-[:-90]Cl_3)-Cl_3}}
%\chemnameinit{\chemfig{CH_3-\chemabove{C}{\pch}(-[:60]CH_3)(-[:-60]CH_3) }}
%\chemnameinit{\chemfig{Cl-\chemabove{Al}{\qquad\mch}(-[:90]Cl)(-[:-90]Cl)-Cl}}
\chemname{\chemfig{CH_3-C(-[:90]CH_3)(-[:-90]CH_3)-{\color{blue}\lewis{0:2:6:,Cl}}}}{Lewis Base\\ Lone pair of e$^-$\\ on Cl\\ can donate}
\+
\chemname{\chemfig{AlCl_3}}{Lewis Acid\\ unfilled orbitals\\ on Al\\ Can accept e$^-$}
\arrow(--){<=>[][]}
\chemname{\chemfig{CH_3-C(-[:90]CH_3)(-[:-90]CH_3)-\chemabove{{\color{red}\lewis{0:2:6:,Cl}}}{\pch}-Al(-[:90]Cl_3)(-[:-90]Cl_3)-Cl_3}}{charged complex\\ \\ \\ }
\arrow(--){<=>[][]}
\chemname{\chemfig{CH_3-\chemabove{C}{\pch}(-[:60]CH_3)(-[:-60]CH_3) }}{Lewis Acid\\ \\ \\ }
\+
\chemname{\chemfig{Cl-\chemabove{Al}{\qquad\mch}(-[:90]Cl)(-[:-90]Cl)-Cl}}{Lewis Base\\ \\ \\ }
\schemestop

\end{document}

misaligned_arrows

Best Answer

chemfig's \arrow has the optional argument (<node1>.<anchor1>--<node2>.<anchor2>) where both node names and anchors can be left out. In your case it is sufficient to add suitable anchor names since the baseline of the molecules all are on the same line the way you defined them. I only added (besides some indentation for readability) the anchors base east and base west and removed the superfluous \\:

\documentclass{standalone}
\usepackage{chemfig,chemmacros}
\usepackage{graphicx}

\begin{document}

\schemestart
  \chemname
    {\chemfig{CH_3-C(-[:90]CH_3)(-[:-90]CH_3)-{\color{blue}\lewis{0:2:6:,Cl}}}}
    {Lewis Base\\ Lone pair of e$^-$\\ on Cl\\ can donate}
  \+
  \chemname
    {\chemfig{AlCl_3}}
    {Lewis Acid\\ unfilled orbitals\\ on Al\\ Can accept e$^-$}
  \arrow(.base east--.base west){<=>}
  \chemname
    {%
      \chemfig{
        CH_3-C(-[:90]CH_3)(-[:-90]CH_3)
        -\chemabove{{\color{red}\lewis{0:2:6:,Cl}}}{\pch}
        -Al(-[:90]Cl_3)(-[:-90]Cl_3)-Cl_3}%
    }
    {charged complex}
  \arrow(.base east--.base west){<=>}
  \chemname
    {\chemfig{CH_3-\chemabove{C}{\pch}(-[:60]CH_3)(-[:-60]CH_3) }}
    {Lewis Acid}
  \+
  \chemname
    {\chemfig{Cl-\chemabove{Al}{\qquad\mch}(-[:90]Cl)(-[:-90]Cl)-Cl}}
    {Lewis Base}
\schemestop

\end{document}

enter image description here

chemfig's arrows also have an optional argument where you can specify a vertical shift:

\arrow(.base east--.base west){<=>[][][4pt]}

If I add this to the MWE above I get:

enter image description here

Related Question